Jump to content

Igor Savkic

Members
  • Content count

    197
  • Joined

  • Last visited

About Igor Savkic

  • Rank

Smart Mobile Studio

  • Edition
    Professional

Recent Profile Visitors

179 profile views
  1. Igor Savkic

    Confused on variants

    //compiles but gives execution error : Uncaught TypeError: MyList1.Business.Depts[0].Staff.add is not a function MyList1.Business.Depts[0].Staff.add('st4'); //works. Why does 'push' work but 'add' doesn't ? MyList1.Business.Depts[0].Staff.push('st5'); AFAIU you're working here with raw Variant and Staff is JS array object that doesn't have add function defined only push: //lowercase 'staff'. Compiles but gives execution error : Uncaught TypeError: Cannot read property 'push' of undefined MyList1.Business.Depts[0].staff.push('st6'); JS functions and properties are case sensitive so there's no staff defined only Staff.
  2. Igor Savkic

    Obfuscation To Protect Code

    Try Google obfuscation (https://developers.google.com/closure/compiler/) but sometimes SMS project doesn't work after it's processed. For really sensitive algos or data, I guess best way to protect it would be to move it to a server side and let SMS client just download minimum that's required for display.
  3. Igor Savkic

    Save Content Dialog

    I don't know about displaying File Save dialog but you can create a hidden a (nchor) element and use it to download file. Take a look at here, it's nicely explained: https://jonlennartaasenden.wordpress.com/2017/01/20/smart-pascal-download-streams/
  4. Igor Savkic

    back(s)lash

    > stringifying this (asm @textdata = JSON.stringify(@data); where @data refers to JA) gives what I was after. > Except that all fieldnames in the result-string have a '$1' appended ({"field1$1"). No idea why that happens or how to avoid that. I would bet on obfuscation mechanism, try declaring all your fields with property: JB = record property field1: string; property params: Array of JC; end;
  5. Igor Savkic

    sqLite's TSQLiteResult Values

    fListBox.Add(fData.values$1); //doesn't work Try in asm, it's allowed to use such property names like: asm @Temp = @fData.values$1; FListBox.Add(ReadItem(Temp));
  6. Igor Savkic

    sqLite's TSQLiteResult Values

    > that gives me the same result > [{"values$1":["WS0202","Maintenance","jdoe"]}] > I need to be able to get the individual data, WS0202, Maintenance, jdoe OK, so you first have array where elements are objects that have string array called "values$1". Try something like: var v: Variant; i: Integer; procedure ReadItem(const AValue: Variant); var i: Integer; begin for i := 0 to AValue.length - 1 do WriteLn(AValue[i]); end; begin v := JSON.Parse('[{"values$1":["WS0202","Maintenance","jdoe"]}]'); for i := 0 to v.length - 1 do ReadItem(v[i].values$1); end;
  7. Igor Savkic

    sqLite's TSQLiteResult Values

    > writeln(JSON.Stringify(sqlResult.Values)); > Syntax Error: Argument 0 expects type "Variant" instead of "array of record TSQLiteRowValues" [line: 98, column: 30, file: frmMain] Try casting to Variant like: writeln(JSON.Stringify(Variant(sqlResult.Values))); or otherwise use asm to assign sqlResult.Values to some Variant variable, something like: asm @Temp = @sqlResult.Values; end; > writeln(JSON.Stringify(sqlResult.Values[0])); > gives me the json structure, but how do i get to the individual data values It's easy if you know structure, how does it look like? On unrelated note, is there any way to control formatting in this forum editor, my reply really looks bad but I don't see a way to change a simple thing.
  8. Igor Savkic

    sqLite's TSQLiteResult Values

    Try to see what JS structure it really has, for example WriteLn(JSON.Stringify(sqlResult.Values)); WriteLn(JSON.Stringify(sqlResult.Values[0]));
  9. Igor Savkic

    sqLite's TSQLiteResult Values

  10. Igor Savkic

    IDE Component Issue ?

    > Is anyone else experiencing an issue with the default sizing of components when placed on a form consecutively? I think I've seen it too in old SMS couple of times, my guess is that during drag drop, SMS treats pressed mouse as request to resize control and depending on how you drop it and move mouse it shrinks.
  11. Igor Savkic

    problem, maybe...

    > In the current ALPHA, you are also able to define custom "width"/"height" values for > TApplication.ShowDialog calls. Also consider adding AutoSized dialog. In most cases one would change default width/height when text that's showing is too big so he'll use GetTextWidth/Height to get true size and adjust dialog size accordingly.
  12. Igor Savkic

    onkeyup-down

    > Yes, i've used OnKeyDown on mainform. but calling setfocus in InitializeForm gives no result. Are you using new alpha? If so, perhaps you need to flag that you intend to listen for keys, I know it's mandatory for custom controls to add cfKeyCapture to CreationFlags, but I'm not sure about added forms and controls on it, check. Alternative is of course to just use MYForm.Handle.addEventListener and make a classic JS event.
  13. Igor Savkic

    The Grid - 6 ways to skin a cat

    Thanks for this, I never heard before of web components and it's canvas grid. During last RTL provided grid was unusable and since I needed a grid capable of showing hundreds of items, I've ended up writing one based on HTMLTableElement which was fast but hard to control (columns, scrolling). I would be very curios to know how all these grids (together with new SMS grid) behaves in large dataset (10+ columns with thousands of records).
  14. Igor Savkic

    Floating modeless forms

    > Taking my first serious look at SMS and investigating if it's possible to > create floating modeless forms to produce an MDI-style interface. I can see that the > default form doesn't have a border, title bar etc - is there any sample > code around demonstrating a more Delphi-like form? Perhaps Smart Desktop Demo is good starting point, take a look at http://quartexhq.myasustor.com/for demo https://bitbucket.org/hexmonks/clientfor ReadMe and code and https://jonlennartaasenden.wordpress.com/?s=smart+desktopfor documentation
  15. Igor Savkic

    Smart 2.9.9 [alpha] is here!

    Thanks for clarification. What happens if I'm listening on two different events in child and parent, OnClick in child and OnMouseDown in parent. Will I only get OnClick for child or both?
×