Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by warleyalex

  1. FRepliedSearchCriteria.SetLength(20); console.log( JSON.Stringify(Variant(FRepliedSearchCriteria)) );
  2. warleyalex


    //------ typescript definition ------- /** Documentation: https://katex.org/docs/options.html */ export interface KatexOptions { /** * If `true`, math will be rendered in display mode * (math in display style and center math on page) * * If `false`, math will be rendered in inline mode * @default false */ displayMode?: boolean; /** * If `true`, KaTeX will throw a `ParseError` when * it encounters an unsupported command or invalid LaTex * * If `false`, KaTeX will render unsupported commands as
  3. This designer looks nice. One other missing thing, that I think very frustating is the Object Inpector, just because lacks some basic features, such as support for some custom properties. That could use to make the controls look realistic. A new refactoring Objector Inspector is welcomed to this designer.
  4. OFF TOPIC - "SMS Component design" Just things that crosses my mind, and I want to discuss. Please don’t see that as an attack to someones's work. I really like SMS and the new possibilities. We all want the best possible development experience result. While the visual widgets/UI in SMS still is customizable (by user and developer). I often spend more time on UI parts to realize the look and feel i want to have. I have to say here, one think that is very frustating for me is the SMS form designer I've spent a few minutes reflecting on this RAD approach and its form designe
  5. Could you help to comment that can Websockets work on mobile phones devices? I remember we may be able to use them with SMS applications with mORMot weksockets, built-in using nterface SOA callbacks . But we can seious limitation over a 3G connection or security requirements (like explicit SLL certificates), connections dropping out on mobile phones. Desktops and laptops are a different story of course.
  6. We simply cannot open your project at labelissue.zip, missing "Form1.sfm"! It's an old married, TW3Label does not like the TW3Layout. Anyway, I think the unfinished widget SimpleLabel (TW3SimpleLabel => SmartCL.Controls.SimpleLabel.pas) works "almost" as expected. projTeste.zip
  7. The CSS browser prefixes that you can use are: Android: -webkit- Chrome: -webkit- Firefox: -moz- Internet Explorer: -ms- iOS: -webkit- Opera: -o- Safari: -webkit- Please, fix the smartCL.System --> unitFCSSToken := 'Moz'; ---> I think should be lowecase w3_setStyle(FParticles.Handle, BrowserAPI.PrefixDef('transform'), 'scale(0.5,0.5)'); w3_setStyle(FParticles.Handle, BrowserAPI.PrefixDef('transform-origin'), 'left top');
  8. I think box-shadow CSS will need 3 things to work on iOS: 1) Vendor Prefix on the box-shadow -webkit-box-shadow: {...} 2) Border Radius set, example to 1px border-radius: 1px 3) disabled appearance -webkit-appearance: none; //--> remember to put it before box-shadow, not after
  9. look this following procedure: procedure main; begin Sleep(5000); console.log('A'); Sleep(3000); console.log('B'); end; when we run this code, it will immediately output 'A' and 'B' - JS the asyncronous nature. ...but I want our program to log 'A' after 5 seconds then log 'B' after 3 seconds... that why we, we need the async / await native keywords in SMS. In a "synchronous" manner. Await and Async are just syntactic sugar for working with promises. It would be cool if we can declare a method like: procedure main; async; The compiler can check whether the encom
  10. I'll try to mimic your example... type TTeamXfer = record TeamID: integer; external 'teamID'; Name: string; external 'name'; Desc: string; external 'desc'; Web: string; external 'web'; Bonus: integer; external 'bonus'; Shots: integer; external 'shots'; Splats: integer; external 'splats'; BonusCurrent: integer; external 'bonusCurrent'; ShotsCurrent: integer; external 'shotsCurrent'; SplatsCurrent: integer; external 'splatsCurrent'; end; type TTeamStruct = class public r: TTeamXfer; function Save(Value: TTeamXfer): TTeamXfer; end; functio
  11. to match/map the JSON fieldname, you have to declare the record definition is type TFishRecord = record Category: String; external 'Category'; Common_Name: String; external 'Common_Name'; Length_Cm: String; external 'Length_Cm'; Length_In: String; external 'Length_In'; Notes: String; external 'Notes'; Species_Name: String; external 'Species_Name'; Species_No: String; external 'Species_No'; end; to emit this JS Object, for instance: { Category : "Snapper", Common_Name : "Red Emperor", Length_Cm : "60", Length_In : "23.62204724
  12. I think you should use the record type to store/retrieve the JSON data. type TFishRecord = record Category: String; Common_Name: String; Length_Cm: String; Length_In: String; Notes: String; Species_Name: String; Species_No: String; end; type TForm1 = class(TW3Form) private {$I 'Form1:intf'} fishRecord: TFishRecord; protected procedure InitializeForm; override; procedure InitializeObject; override; procedure Resize; override; end; implementation var fishJsonData = #'[ {"Species_No":"90020","Category":"Triggerfishy","Common_Name"
  13. humm, I rememeber this minor bug y can see on the old SMS. I can not see this ugly message anymore on the 3.x, anyway you could try this: Tools --> IDE Settings... --> Preferences | Keyboard -> Edit editor shortcuts --> Reset List
  14. Solution as JObject base class Type TT = Class(JObject) TableName: string; CreateFunc: TFn; end; var Regist: array of TT; initialization var rr : TT; rr := new TT; rr.TableName := 'devil_report'; rr.CreateFunc := @CreateServer; Regist.Add(rr); rr.TableName := 'flowers_report'; rr.CreateFunc := @CreateServer; Regist.Add(rr); (...) // Display the object for var i:= Regist.Low to Regist.High do console.log(Regist[i]);
  15. Another solution using record type; type TModelClassRegistration = record TableName: string; external "TableName"; CreateFunc: function : JPromise; external "CreateFunc"; end; var RegisteredModelClasses: array of TModelClassRegistration; initialization var rec :TModelClassRegistration; rec.TableName := 'devil_report'; rec.CreateFunc := @CreateServer; RegisteredModelClasses.Add(rec); rec.TableName:= 'flowers_report'; rec.CreateFunc := @CreateServer; RegisteredModelClasses.Add(rec); rec.TableName := 'cards_report'; rec.CreateFunc := @CreateServer; Registe
  16. Yes. they removed the VarIsValidRef method. hum, at the System.types unit, there's a helper class TW3VariantHelper where lives a method Valid. if TW3VariantHelper.Valid(str) then ; I would prefer a global big unit with all methods instead of helper class approach.
  17. solution I: =========== var // _TableList: array[0..0] of variant = [ _TableList:= [ CLASS TableName:= 'Server'; external 'TableName'; CreateFunc:= @CreateServer; external 'CreateFunc' END ]; // This works ========================================================== var _TableList2: array[0..0] of TMySqlCreateTable = [ ( TableName: 'Server'; CreateFunc: @CreateServer ) ]; // Syntax Error: Constant expression expected [line: 85, column: 52, file: unit2] ========================================================== _TableList2[0].TableName := 'Server'; _TableList2[0].CreateF
  18. I download the mORMot_and_Open_Source_friends_234301_06b24ae728 today and patched some needed SynCrossPlatform units and mORMotWrappers (generate mORMot cross-platform clients code from the server). and some changes at the project 27 and 29, Now, it compiles and works in both SMS (lastest WinXP compatible) and SMS (development version)! download link: mORMot with SMS 2x and 3x
  19. The crazy AB apparently he's out of the time or holidays since december. I do perform the tests on the mORMot lastest trunk (december/2018) and it compiles and works in both SMS (the lastest WinXP compatible) and SMS (development version)! I have to download mORMot again(jan/2019) and submit the changes of the SynCrossPlatform units to AB.
  20. A lot of RTL work and especially bug fixes was done, but Jon Lennart did pretty much all the NodeJS work. In one of his posts https://jonlennartaasenden.wordpress.com/2019/01/19/quartex-web-os-a-cloud-os-in-takes-form/ he said: "Also, fixed more bugs in the Smart RTL than I can count..." These fixes are available just for top supporters, you have to pay to become a patron. My intuition is that a quick and deep overdue of the Smart NJ part is required!
  21. warleyalex


    The unit ECMA.Promise is broken. I use this definition Using Promises in SMS unit uPromises; interface uses W3C.Console, W3C.DOM, W3C.XMLHttpRequest; type TVariantDynArray = array of Variant; JDeferred = class; TJPromiseCallback = procedure(Value: Variant); TJDeferredObject_fn = function(d: TJPromiseCallback): Variant; TJDeferredObject = procedure(resolve: TJPromiseCallback; reject: TJPromiseCallback); TJPromiseCallback_fn = function(Value: Variant): Variant; TJDeferredEventHandler = function(event: Variant): Variant; JPromise = class external 'Promise' constructor
  22. I don't want to interrupt your holidays. I thought I was going crazy. Crazy about smart. I have SMS 2.2.2 (last winXP), SMS 3.0.2 (stable release) and SMS (development) installed. It was exactly the same project, same source, but I forgot to copy the SynCrossPlatform units ( SynCrossPlatformCrypto.pas | SynCrossPlatformREST.pas | SynCrossPlatformSpecific.pas ) into SMS3.0.20/Libraries folder and the issue has vanished, the designer worked as expected in SMS - without any error.
  23. In fact, there is an bug on older SMS versions 1.2 | 2.0 | 2.0.1 | 2.2 and 2.2.2 - the TObject::Destroy method would just delete the property named "prop" rather than the actually all the properties of the object itself. For instance, obj.Free is doing nothing because the method Destroy was buggy // old SMS version var TObject={ (...) Destroy: function (s) { for (var prop in s) if (s.hasOwnProperty(prop)) delete s.prop }, Destroy$: function(s) { return s.ClassType.Destroy(s) }, (...) } On newer SMS version 3.x, they fixed the TObject::Destroy method.
  24. The download link from SMS 3.0.2 stable release: https://smartmobilestudio.com/download/3.0.2/setup.exe There is no issue when I drag n' drop a new widget/TWButton onto designer then double click at the button in SMS 3.0.2. This is an old SMS project, created with SMS 2.0.1 - packed with winrar 5.50. SMS 3.0.2 can open it but we can not jump to the W3Button1Click procedure like 3.1.x.
  25. SMS (from the development channel) works as expected! The issue is from the SMS (stable release). When I click at the widget button/W3Button2 for instance, it would go to the code editor W3Button2Click procedure in the 3.1x, but fails at 3.0x. <object type="TW3Button"> <Caption>W3Button</Caption> <Width>128</Width> <Top>272</Top> <Left>272</Left> <Height>32</Height> <Name>W3Button2</Name> <OnClick>W3Button2
  • Create New...