Jump to content

lynkfs

Moderators
  • Content Count

    743
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by lynkfs

  1. lynkfs

    Freeing objects?

    there are a couple of posts under 'garbage' search see this one :
  2. Might be a padding problem (2px) related to images. Ask @jarto a (quick and ugly) workaround if you need a temporary fix is to use the OnFinished method of fxMoveBy (4th parameter) and manually set image-tops to 2 px less. procedure TForm1.W3Button1Click(Sender: TObject); begin ShiftFeedbackBalls; var FeedbackInst:= tw3image.create(self); FeedbackInst.loadfromurl('res/ballGreen.png'); FeedbackInst.setbounds(10,15,30,30); FeedbackInst.OnLoad:=procedure (sender:TObject) Begin // FeedbackInst.AlphaBlend:=True; end; FeedbackInst.fxMoveBy(3
  3. the removeEventlistener is not required. LMsg is probably redundant. LMsg.data equals Event.data (for postmessaged messages) I like your use of the iFrame.messagePort. Although not per se required, it limits the messages being delivered through pre-defined channels, rather than broadcasting them all over the place. (The same mechanism can be used in webworkers, see previous post)
  4. not sure how to answer your post I understand from your initial question that your current infobar iframe responds to a message, so it must have some code to handle that message (ie success = green ball) The example sent sets an eventlistener on the infobar and handles the message, not really different I think Maybe we both have a doh moment
  5. in the example i send you, the Iframe is your infobar and the postmessage is sent from the sender. The sender (your main form ?) sends a postmessage with some payload ('success'), which is picked up by the eventlistener of the embedded window (contentWindow) within the infobar iFrame. The payload is contained in the data variable of the event (evt.data). make sure you set up the eventlistener on a fully loaded element (hence the onload handler), or alternatively put it in a readyExecute section (instead of 'eventlistener' an alternative syntax : W3IframeHTMLElement1.handle.conte
  6. form with iframe element and button button sends message to iframe which echoes it to console (substitute button with your main sender) unit Form1; interface uses System.Types, System.Types.Convert, System.Objects, System.Time, SmartCL.System, SmartCL.Time, SmartCL.Graphics, SmartCL.Components, SmartCL.FileUtils, SmartCL.Forms, SmartCL.Fonts, SmartCL.Theme, SmartCL.Borders, SmartCL.Application, SmartCL.Controls.Elements, SmartCL.Controls.Button; type TForm1 = class(TW3Form) procedure W3Button1Click(Sender: TObject); private {$I 'Form1:
  7. lynkfs

    loading images

    it is a cors error Access to Image at 'file:///C:/Users/...../res/object.jpg' from origin 'null' has been blocked by CORS policy: Invalid response. Origin 'null' is therefore not allowed access. would be very interested in getting a solution for this too
  8. lynkfs

    inheritance

    There are various object-types implemented in Smart and javascript. According to aSmartbook (4.1.6) Smart has a super-parent class 'Object' which is parent to TObject and to JObject. TObject is the ancestor for all rtl descendants and JObject is the parent for external classes. Javascript of course has its own object structure. I was wondering if it would be possible to derive usable components from any or all of these various object types. Deriving a new class therefore depends on who (which object type) is going to be chosen as ancestor. By way of demo, a TSet class is creat
  9. Interesting things sometimes happen unexpectedly. In this case by combining several unrelated posts : rapid prototyping webworkers and flow based programming compiled procedures In reverse order : the last post described a short-cut to produce webworkers on the fly. The middle post describes an alternative architecture where a network is constructed out of webworkers and messagechannels, and the first post covers a possible take on rapid prototyping. The subject of this post is that prototyped business processes can be graphed as well moreover, these
  10. lynkfs

    Scroll bar bug

    This has happened since day 1, somewhere in 2013, so it has occurred a lot. Every time it happens I heave a mental *sigh* and then move on. I'm sure it has something to do with my setup (Win10 on MacOs via Boot Camp), although none of the other programs on this platform have this behaviour - SMS only. A comparison with Paulo's setup or video ☺️ might shed some light if there are more people effected.
  11. lynkfs

    Scroll bar bug

    in my install (win10) the ide source code pane auto-selects text and auto-scrolls every time the scrollbar (hor or vert) is dragged with the mouse or when the arrows on the scroll bars are clicked
  12. lynkfs

    Scroll bar bug

    annoying isn't it. I've been wanting to ask if there is a solution for that for a long time. Maybe there is ? @jarto
  13. Found that after all it actually is possible to create webworkers inline/on the fly from compiled procedures without resorting to writing js-code and without having to specify an external javascript file either. See edited previous post
  14. The webworker demos (featured demos) seem to fail ? @jarto
  15. When creating webworkers, the choice is to either set up a separate project for each worker (see featured demo's), or create separate text files with the webworkers code. Another alternative is to create workers from a string : myWorker := createWorker(#" onmessage = function(e) { console.log(e.data); } "); function createWorker(workerFunc: string) : variant; var newworker: variant; begin asm const blob = new Blob([workerFunc], {type: 'application/javascript'}); const url = URL.createObjectURL(blob); @newworker = new Worker(url); end; result := newwork
  16. mmm, works fine with FF at my place. (FF Quantum 61.0 64 bit on Win10) FF is usually better than Chrome in this respect, it handles local file-based webworkers as well as server-based ones, where Chrome silently fails on local file based webworkers. But I'm surprised by this SecurityError. Googling this gives lots of references to FF being resentful to blocked cookies ? Lots of other reactions as well, so I'm not sure. Might try sandboxing (hamburger-help) to see if that makes a difference As a side-note : I know Edge (and Safari) don't support SharedWorkers yet, so this demo w
  17. WebWorkers and Flow Based Programming It has been a while since I got as excited as I was when I read J.Morrison's book "Flow-Based Programming: A New Approach to Application Development - 2nd edition". This post is not meant to give an overview of FBP, but if someone is interested, the first edition of his book is available online for free. FBP utilises independantly running processes which are wired together in an assembly line type of arrangement. The main advantages are that each process runs on demand rather than on availability, components can easily be re-wired to impleme
  18. lynkfs

    framework

    I probably misunderstood the original post. I can see that Lazarus and pas2js could produce a result from the native framework's source code. After all, it doesn't use or need any of the RTL units. Interesting.
  19. lynkfs

    framework

    I suppose this was bound to happen. Not sure if I should object to this or not, after all I put source code in the public domain Meant though for Smart users only. Could we have a secure place somewhere which we can use to share code for the Smart community only ?
  20. your OnPrepareTab code is executed when the 'PrepareTab' event eventually eventuates. By that time your 1-3 loop has finished and str will have the value of the last looping. Your second block seems correct to me
  21. This is the third of three mini posts on (my take on) rapid prototyping, to explore possibilities of how to easily generate prototypes of complex systems. Step 3 is to model the business processes. I'm using a standardised demo-business (EU-rent) and graphs to model concept, data and processes. Every node represents a main business process and at least one of the edges represent the starting event. Some business processes occur many times per day, some only once in a while. So for instance EU-rent, which has 1000 branches in multiple countries, will have a process to "open
  22. All doable but really depends on what infrastructure you have available and the functionality you want to give your users - do you really want to email or is upload to some server ok too ? - does it have to be your own serverpark or is a professional service ok ? - do users need to make screenshots themselves under app-control or are these available as image files somewhere - how do you want to be nofified among other questions which come to mind. I've used Cloudinary in the past which I can recommend (post here). They have an upload widget which integrates well
  23. This is the second of three mini posts on (my take on) rapid prototyping. Step 1 in the previous post was about concept modelling / creating an application graph. Step 2 is to give it some more depth by adding data to graph-nodes. This allows for generating more inclusive app prototypes. Step 3 is using the edges between nodes for modelling business processes. Adding data is the easy step. Every node in the graph has some specific associated data elements. Customers typically have a name, address, email address, Cars have number plates, vin-numbers, model types etc.
  24. Rapid prototyping Wikipedia "Rapid prototyping is commonly applied in software engineering to try out new business models and application architectures". Embarcadero "use rapid prototyping to : -Create a real working prototype, incorporate feedback and get your app to market fast -Use the power of components to quickly prototype multi-device applications -Collaborate with users, incorporate their feedback, and deliver richer apps -Quickly go from prototype to production without wasted effort Smart Mobile Studio "Our technology gives a tremendous advantage over clas
  25. try "INSERT INTO customers (name, address) VALUES (?, ?)", ['Henry Lawson', 'Never-Never Country']
×
×
  • Create New...