Jump to content

lynkfs

Moderators
  • Content Count

    740
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by lynkfs

  1. Demo1 and Demo2 P5.js : There are different ways of doing this - mapping all p5.js functions and variables to pascal so they can be accessed from Smart by name - take a bit of a shortcut The latter approach looks like this : - let P5 construct its canvas. This requires a minimum sketch.js file with its setup and draw functions. (The draw function can be empty. See project zipfile demo1) - copy the constructed canvas to a Smart component (W3Panel); - use p5 functions in code Demo1 uses this approach, Demo2 is a copy of one of the p5 examples Both projects in
  2. lynkfs

    proxy

    I recently came across the javascript proxy object A proxy object basically monitors a chosen object, and has getter and setter functions which are invoked when the value of any of its properties changes (set) or are being accessed (get). In that respect there are some similarities with the mutationobserver object. In the below code snippet a regular EditBox has its text saved in a proxied object, which triggers the setter function and a Button which reads that value and thus triggers the getter function procedure TForm1.InitializeForm; begin inherited; // this is a go
  3. lynkfs

    app

    I usually don't publish commercial apps on the forum. Here is the exception : a retail shopping experience - made with Smart
  4. Suggestion can the default viewport meta tag in the generated index.html file be changed from <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0, user-scalable=no"/> into <meta name="viewport" content="width=device-width, maximum-scale=2, initial-scale=1, user-scalable=yes"/> This allows to pinch & zoom images etc on mobile by default
  5. The MP4 codecs are only license free in browsers (as long as users don't have to pay for the audio or video). In any other application the use of the most widely used MP4 codecs requires a commercial license. Looks like that is the reason for the exclusion of mp4 in CEF4 It should be possible to write-your-own MP4 codec. There are a couple of interesting posts on the subject (post 1, post 2) and there is a rudimentary codec structure in the rtl (system.codec.) However not in the complexity of what mp4 requires Google has produced its own license free product : 'webm' This is us
  6. I can't seem to be able to play video in the embedded browser The test-code below works fine in any standalone browser, but not in the ide // video var video1 : variant := new JObject; video1 := browserapi.document.createElement('video'); self.handle.appendChild(video1); video1.outerHTML := #' <video class="div" src="video1.mp4" muted="true" playsinline="true" preload="auto" poster="" autoplay="" loop="true" width="' + InttoStr(self.width) + '"></video>'; There is link here which refers to disabled codecs in CEF4, would that be the cause ? It
  7. lynkfs

    responsive grid

    I believe so. The grid is a bit more versatile in that it covers 2 dimensions, where flex is basically one-dimensional. Moot point if using flex works fine
  8. Composing a Radiogroup in the designer works fine For objects created in code however the add function doesn't work //creating in code var RadioGroup1 : TW3RadioGroup := TW3RadioGroup.Create(self); RadioGroup1.setbounds (200,200,200,200); RadioGroup1.Add('bbb'); <==== no results //created in the designer W3RadioGroup1.Add('aaaa'); <==== correct results (probably to do with the difference between TStringlist and TStrArray)
  9. lynkfs

    responsive grid

    This post is about using the css-grid for responsive content. It happens often that the contents of a container need to re-arrange itself depending on the size (width) of the container, as in Using a css-grid for that purpose, the code is pretty minimal at just 5 lines : //container (w3panel) cards.handle.style.display := 'grid'; cards.handle.style['grid-template-columns'] := 'repeat(auto-fill, minmax(180px, 1fr))'; //set minmax to just a bit bigger than the card-width cards.handle.style['grid-gap'] := '50px'; cards.handle.style['justify-items'] := 'center
  10. I'm sharing some links below to app-demo's, based on design templates. I'm a big fan of these types of templates as they provide essential design guidance on navigation, styling and the use of animation. And since I'm not a graphic designer, that all helps tremendously. The demo's below are recreated in Smart, using elements of the 'famous' design templates (https://famous.co) Retail shop demo couple of slides of a business presentation demo's optimised for laptop only (also the background video's on the first forms may take a couple of seconds to load) On t
  11. I mostly agree. I suppose that on rare occasions one might want to do something when tw3display or displayview gets the focus, like in Display.OnGotFocus := procedure(sender:tobject) begin writeln('focus'); display.handle.style['background-color'] := 'white' end; see the zen-sky demo where display is a visible element Very rare I think, and even then the tabindex shouldn't be 1 but rather 0
  12. The edge sense controller works, but has some caveats. For one, it does not display the edge cursors for elements with a scrollbar
  13. note : I'm not an expert in css, but I did notice that the first div child of the checkbox has a display="inline-block" as an attribute of that element. I think that should be a property of the style (style ="display:flex;width ... etc) Also I think the answer is to change the box layout system for these components from block to flex (or grid) original : <div class="lbxcontent lbxcontent_v_center lbxdisableBreak lbxcontent_h_center" display="inline-block" style="width: 100%;"> <input type="checkbox" display="inline-block" style="width: 16px; height: 16px; position: rel
  14. lynkfs

    swipe

    just for reference : I'm using the SmartCL.Controller.Swipe controller to enable swiping I noticed that on Android phones I need to change the default parameters to something like constructor TW3SwipeController.Create(const AOwner:TW3TagObj); begin inherited Create(AOwner); FHRange:=TW3SwipeRange.Create(20,90); // [min]---X---[max] //20-40 FVRange:=TW3SwipeRange.Create(20,90); // [min]---Y---[max] //20-40 Latency := 55; //35 Options := []; //[coStrictTarget]; end; otherwise it wouldn't detect a swipe reliably
  15. I'm working on a project which has 2 (inter)faces : one where the user is in a design phase, and one where the end-result is being displayed The idea is that there will be users in the role as designer, and other users which will be just using the end result. These other users should not even be aware of the design environment I'm looking for the best way to distinguish between these 2 states. In principle this could be solved by dividing the project into 2 separate projects letting the user switch between these environments at will (like selecting a menu item, maybe
  16. opacity settings of TW3Panel (and probably of the other visual controls as well) are not rendered correctly The css opacity style is a float between 0 and 1, current designer expects an integer between 0 and 255
  17. or ping the socket server let's ask @jarto
  18. I suppose we could check the browsers url object. If it is something like 'http://127.0.0.1:8090' it might be the internal ide browser Must be a better way
  19. What would be the best code to see if a project runs in the IDE-browser or whether it runs natively in any other browser ?
  20. there is also the system.db.pas unit, which provides some db and sql based references
  21. They must have some sort of an sql parser. Some links : Commercial vcl (delphi tokyo) parser : http://sqlparser.com/download.php http://sqlparser.com/dlaction.php?fid=gspdxe10_2_tokyo_trial&ftitle=General%20SQL%20Parser%20VCL%20for%20delphi%20XE10.2%20tokyo%20trial%20version and some really old ones https://torry.net/quicksearchd.php?String=sql+parser&Title=Yes http://www.felix-colibri.com/papers/db/sql_parser/sql_parser.html to write a complete sql parser from scratch might be a big job
  22. I guess there are a couple of approaches : - Have access to the meta information when parsing results. Most SQL based rdbms's have type information stored in meta tables, which is accessible by a normal query. Unfortunately this is not standardised, so MySQL, Oracle, DB2, SQL server etc have differently named tables for that purpose. For SQLite see this link. - Let the developer define the meta data in the designer while setting up the data link, and store it somewhere persistently (TDatalink ?). Then parse the results with this stored meta data. - If you only want to know if a
  23. lynkfs

    visual design

    I've been following this company for a while. They went from a startup promising a contemporary development product to a web design template producer. And I must say, I really like their designs. When I need some inspiration for app design, I do have a look at what they're offering https://famous.co/
  24. The other possible downside of using window.open is that it depends on the users browser setting whether it opens a new tab or a new window. This behaviour cannot be determined by js, it is dependent on the user. While chrome seems to favour using the tab-mechanism, other browsers don't. I've tested a couple which resulted in 'pop-up blocked' messages Also mobile browsers don't have tabs, so they will spawn a new window at best. (There is something called the tab-api, which gives granular tab processing under program control. This is used for developing browser extensions,
  25. The other thing I noticed when comparing the same project generated by SMS3.0.0 and the latest alpha is a marked speed increase. I did some tests on the training phase of a neural network, with these results : SMS 3.0.0 : Training took 30810 milliseconds. SMS 3.1.9 : Training took 18937 milliseconds. SMS 3.0.0 : Training took 32611 milliseconds. SMS 3.1.9 : Training took 47272 milliseconds. SMS 3.0.0 : Training took 34233 milliseconds. SMS 3.1.9 : Training took 16627 milliseconds. SMS 3.0.0 : Training took 33177 milliseconds. SMS 3.1.9 : Training took 18275 mil
×
×
  • Create New...