Jump to content

All Activity

This stream auto-updates     

  1. Yesterday
  2. One year of hard work, lots of changes, new features and bug fixes. But here it is! Release announcement: https://smartmobilestudio.com/2018/07/20/smart-mobile-studio-3-0-released/ Most of you have already been using beta-versions, that are really, really close to this release. The last bit was to fix the cors-problem in the Images and to add the Smart Desktop source code to the Featured Demos. We've also set up a live demo of the Desktop to showcase what Smart Mobile Studio and JavaScript can do: desktop.smartmobilestudio.com Big thanks to everybody here, who have helped by testing, suggesting improvements and reporting bugs.
  3. bilcan

    Application.Display.OnMouseMove

    Thank you jarto.
  4. Last week
  5. lennart

    loading images

    It is a standard property available for JS developers. There was no other reason for adding it than making it available also to Smart developers. It was unfortunate that it was initialized with "anonymous", which sadly is the cause of this mess. My apologies
  6. jarto

    Application.Display.OnMouseMove

    All the mouse and touch events are these days handled centrally by TW3EventManger. When the mouse moves anywhere in the document, it finds out which component it should belong to and generates the mousemove. If you use SetCapture, the Event Manager makes sure to only send the mousemove event to that component and nowhere else. The old versions of Smart Mobile Studio was not as strict, but that resulted in all kinds of other problems where the same event could fire multiple times etc. If you want to be able to listen to global mouse movements, you can still do it with addEventListener: uses ... W3C.DOM, ... procedure GlobalMouseMove(eventObj: JMouseEvent); begin WriteLn('Global Mousemove!'); end; Application.Document.Handle.addEventListener('mousemove', @GlobalMouseMove, True);
  7. bilcan

    Application.Display.OnMouseMove

    I think I have to use Application.Display.SetCapture to capture global mouse movements but after I do that, I can't capture any w3Panel's OnmouseDown event? It used to work fine. Did I miss something? Application.Display.SetCapture; Application.Display.OnMouseMove := DisplayMouseMove;
  8. jarto

    loading images

    I'll find out if there was a reason it was added. This change came when @lennartfixed images to work with streams. If that is needed for streams, I'll simply move it so it's set on demand. If it's not needed at all, I'll remove it.
  9. Czar

    loading images

    You sir are a life saver. I have tested my initial projects and they now work again as expected. Can I assume that "SetCrossOrigin('Anonymous');" won't make a return in later versions TestImage.rar
  10. jarto

    loading images

    Ok, Removing this line fixes the problem, but there's something weird going on with that Simple Browser app: This works: file:///C:/ImageProblem/wwwCURRENT/index.html This does not: c:\ImageProblem\wwwCURRENT\index.html Hmm.... now it works again with both paths. Weird. But anyway, that SetCrossOrigin -call is the source of the problem. Going to make sure that it's called only when needed.
  11. jarto

    loading images

    Can I also have the SMS source for this test?
  12. Czar

    loading images

    www.numberworks.com/downloads/ImageProblem.rar Open SimpleBrowser.exe and insert these into address (change to suit location ) c:\ImageProblem\wwwCURRENT\index.html c:\ImageProblem\wwwWORKS\index.html If you go to wwwCurrent you will see image location - but no image. If you try wwwWORKS then you will see a green screen. Only difference between these two is which version of SMS was used.
  13. Hello Lennart, thank you for your notice, I did not know second param's feature. I have changed form creation part, so application create forms automatically at the beginning and I have not had any problem so far. P.S Migrating from 2.2 to 3.0 beta 2 was quite easy, thank you for your great work.
  14. jarto

    loading images

    Yes please!
  15. jarto

    loading images

    @Czar Try removing line 311 from SmartCL.Controls.Image.pas: SetCrossOrigin('Anonymous'); If it doesn't help, please zip the www-folders for me compiled with both the old and new version and send them to jt at smartmobilestudio.com
  16. Czar

    loading images

    Would it help if I sent you simplebrowser app and two versions of the HTML file - one old one new? Easy to demonstrate
  17. Czar

    loading images

    1. deleting manifest has no effect. 2. Putting in cross origin no effect. If I compile again with older SMS then it works correctly. Compile with current and it doesn't.
  18. jarto

    loading images

    Can you also try doing this before calling LoadFromURL? Backimg.CrossOrigin := '';
  19. jarto

    loading images

    Gonna have a look. Hang tight. First thing you should test: See if you have app.manifest -file there causing problems. So try comparing or deleting the manifest file if it exists.
  20. Czar

    loading images

    Can you think of a reason why it only came into effect with the latest update? I would love to roll back to previous behaviour
  21. 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
  22. Czar

    loading images

    I have since updated my CEF4 code with the latest version. No change. I have made a very simply VCL sms program with an image loading a png. And it fails when opening via CEF4 browser. If I copy the index.html into a webserver then the browser will show images but not when it is a local file. I have been using this browser for a number of years to display SMS index.html files so I would keen to have it resolved the change is the new SMS version.
  23. Czar

    loading images

    The behaviour for this BackImg.LoadFromURL('res/back1366.png'); has changed since the last update. It works fine in browsers (internal and external) but it no longer works in my app that uses chromium (CEF4). At the moment if I compile in older version - all good - recompile in newer version and the images don't load if I use my delphi based chromium browser. Any suggestions about where to start looking for a solution? I am using the browser app for all of my SMS based software so this represents a significant problem for me.
  24. One thing I noticed is that you pass TRUE as the second parameter of RegisterForm -- This should only be done once. The TRUE defines that the registered form is the "main" form. So only one should have TRUE while all the others should be false. I also suspect that you should wait for the instance to finish before jumping (since you have modified the start code directlt): TW3Dispatch.WaitFor([form1,form2,form3], procedure () begin Application.GotoForm(bla bla bla); end);
  25. 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 created with methods to maintain a list of values and to make it usable in Venn-diagrammatic operations (intersect, union, difference, subset etc). TSet is implemented 3 times: as a component derived from TObject, as a component derived from a jsArray and as a component derived directly from the javascript object (jsObject). These implementations differ internally quite a bit, but usage in a Smart app is exactly the same. A) TSet derived from TObject type TSet = class public Constructor Create; virtual; Procedure add(Item: Variant); Procedure remove(Item: Variant); Function contains(Item: Variant) : boolean; Function union(&Set: TSet2) : TSet2; Function intersect(&Set: TSet2) : TSet2; Function difference(&Set: TSet2) : TSet2; Function isSubset(&Set: TSet2) : boolean; Function length : integer; Procedure Print; values : array of variant; end; implementation Constructor TSet.Create; begin inherited Create; end; Procedure TSet.add(Item: Variant); begin If values.IndexOf(Item) < 0 then values.add(Item); end; and usage var set1 : TSet := TSet.Create; set1.add(1); set1.add(2); set1.add(3); set1.print(); // => 1 2 3 nothing special about this B ) TSet derived from a javascript array (see) Javascript has a different inheritance mechanism using prototypes. type TSet = class public Constructor Create; virtual; Procedure add(Item: Variant); ... FHandle: variant; end; implementation Constructor TSet.Create; begin inherited Create; asm function Set() { this.values = []; } Set.prototype.add = function(value) { if(!~this.values.indexOf(value)) { this.values.push(value); } }; @FHandle = new Set(); end; end; Procedure TSet.add(Item: Variant); begin FHandle.add(Item); end; usage is the same. C) TSet derived from the ultimate ancestor : jsObject type TSet = class public Constructor Create; virtual; Procedure add(Item: Variant); ... FHandle: variant; end; implementation Constructor TSet.Create; begin inherited Create; asm function Set() { this.lastIndex = 0; } Set.prototype.add = function(value) { for (var property1 in this) { if (typeof this[property1] === 'number') { if (this[property1] == value) { break; } else { Object.defineProperty(this, this.lastIndex.toString() , { value: value, configurable: true, writable: true, enumerable: true }); //console.log(this.lastIndex); this.lastIndex++; break; }; }; }; //console.log(Object.getOwnPropertyNames(this)); }; @FHandle = new Set(); end; end; Procedure TSet.add(Item: Variant); begin FHandle.add(Item); end; again usage is the same I don't think these last 2 approaches have much of a practical application, and while it works, there is no obvious advantage to stray away from TObject (and there may be hidden disadvantages as well). Curiosity kills the cat. Project code with full implementations and demo (not much to see, uses console)
  26. You only attached Unit1, so there's no way for me to properly debug. Here's my best guess: This is what Unit1 looks like in a new project. unit Unit1; interface uses Pseudo.CreateForms, // auto-generated unit that creates forms during startup System.Types, SmartCL.System, SmartCL.Components, SmartCL.Forms, SmartCL.Application, Form1; type TApplication = class(TW3CustomApplication) end; implementation end. While previously you created all the forms by code, it's now done by TW3Application itself. You can control it here: If you can't see all your forms there, try creating a new project and add your old existing forms to it. When Auto is checked in that list, TW3Application creates the form during startup. If you continue to have issues, you can send a zip of your project to jt at smartmobilestudio.com and I'll be happy to help.
  1. Load more activity
×