Jump to content

lynkfs

Moderators
  • Content Count

    743
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by lynkfs

  1. lynkfs

    proxy

    I didn't know of this object either until recently. It has been around for a long time and is supported in all browsers. afaik it handles subobjects as well I'll check it out
  2. lynkfs

    app

    the paypal library. That gives credit-card, debit-card and paypal in one go you need to go through a vetting process, but after that easy to include
  3. Edited The other approach is to gain access to the internal j5 functions in a more readable way, as in function createElement(a,b:string): Variant; external 'createElement'; function ellipse(a,b,c,d:integer): Variant; external 'ellipse'; implementation { TForm1 } procedure TForm1.W3Button1Click(Sender: TObject); begin var txt := createElement('p', 'move your mouse over the canvas'); txt.position(50, 70); W3DivHtmlElement1.onMouseMove := procedure(Sender: TObject; Shift: TShiftState; X: Integer; Y: Integer) begin ellipse(X,Y,80,80); end; which eliminates the asm blo
  4. 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
  5. 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
  6. lynkfs

    app

    I usually don't publish commercial apps on the forum. Here is the exception : a retail shopping experience - made with Smart
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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)
  12. 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
  13. 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
  14. 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
  15. The edge sense controller works, but has some caveats. For one, it does not display the edge cursors for elements with a scrollbar
  16. 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
  17. 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
  18. 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
  19. 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
  20. or ping the socket server let's ask @jarto
  21. 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
  22. 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 ?
  23. there is also the system.db.pas unit, which provides some db and sql based references
  24. 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
  25. 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
×
×
  • Create New...