Jump to content

Czar

Members
  • Content Count

    425
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Czar

  1. Czar

    TryStrToInt bug

    Ran into this issue again - who is looking after the codegen?
  2. Czar

    TryStrToInt bug

    I have found a most strange bug. If I use TryStrToInt then the integer variable is not accessible anywhere else in the program except for in the current local procedure. Here is the code. You can see the difficulty is a global. As long as the line TryStrToInt(d, difficulty); remains in the program as valid code the difficulty will not available in other procedures. I put the d='20' to show you that the code doesn't even need to run for it to screw up the results. If you run the code you will see in the console that difficulty is 101 in the procedure but when the writeln in GetQuestion is run the console shows [object object]. If you comment out TryStrToInt (and preceding line) then everything works as expected. unit Form1; interface uses SmartCL.System, SmartCL.Graphics, SmartCL.Components, SmartCL.Forms, system.types, SmartCL.Fonts, SmartCL.Borders, SmartCL.Application; type TForm1 = class(TW3Form) private {$I 'Form1:intf'} procedure GetQuestion; protected procedure InitializeForm; override; procedure InitializeObject; override; procedure Resize; override; end; var difficulty : integer; implementation { TForm1 } procedure TForm1.InitializeForm; begin inherited; // this is a good place to initialize components var d : string; d := '10'; difficulty := 101; if d='20' then // only here to prove a point TryStrToInt(d, difficulty); writeln('Difficulty exists here >'+inttostr(difficulty)); GetQuestion; end; procedure TForm1.GetQuestion; begin writeln('But difficulty no longer existss here > '+inttostr(difficulty)); // result = [object object] end; procedure TForm1.InitializeObject; begin inherited; {$I 'Form1:impl'} end; procedure TForm1.Resize; begin inherited; end; initialization Forms.RegisterForm({$I %FILE%}, TForm1); end.
  3. Components on the visual form lose their name property if they are cut and paste. I use this quite often as I will use a panel to organise related editboxes, and labels. 1. drop a label on the visual forum and call it lbl1 2. now drop a panel on the form. 3. We will cut the label and paste it inside form. select the lbl + ctrl X. And then select the panel and ctrl + v to paste the label into the form. 4 . This works fine but the label is now call w3label1 It would be nice if the component retained the name property.
  4. Czar

    Editing "Color" as a property

    The colour property is irritating to use. It is not possible to edit directly, you cannot paste a value in the only way is bring up the colour picker. And even then you can can't paste in colour values in Hex you have to add them in one bye at a time. Could this property be opened up so we can simply type in $c0c0c0 etc
  5. It is not possible to change the text of a radiogroup item e.g., W3RadioGroup1.Add('test'); W3RadioGroup1.items[0] := 'it does not work'; as a workaround - I am removing and then inserting
  6. Czar

    Radiogroup - change items text

    Ok, good work around - wasn't obvious for me
  7. Czar

    window component

    Looks nice, unsure what I would use it for at the moment but good to see if here. You are undoubtedly aware that if mouse comes off the window the dragging stops.
  8. Czar

    reCaptcha

    I am trying to implement a "i am not a robot" into my website Basic HTML/JS looks like the following with a second step required to validate it server side. <script src="https://www.google.com/recaptcha/api.js"></script> HTML: <div class="g-recaptcha" data-sitekey="YOUR_KEY" data-callback="correctCaptcha"></div> JS: var correctCaptcha = function(response) { alert(response); }; I thought I could manage getting it to wok in SMS but I got very lost. I couldn't find examples that seemed to be a parallel challenge. It would be great to have some clear tutorial or case study to show how it is possible to integrate JS and or it would be good to a have google recaptcha component info link: https://stackoverflow.com/questions/27902539/how-can-i-validate-google-recaptcha-v2-using-javascript-jquery https://developers.google.com/recaptcha/intro
  9. Czar

    reCaptcha

    Yes, without the backend check it is nothing. I am only putting it on our page becuase of one person's concerns about spammers
  10. Czar

    reCaptcha

    Well you made that look easy Works without a hitch,
  11. Czar

    reCaptcha

    I will check this out when I get home
  12. Czar

    UI layout

    For me the most frustrating aspect of using SMS is layouts. Putting together anything beyond a trivial UI takes ages and is very frustrating to achieve. The Tlayout is not intuitive, it has weird and unexplainable side effects and takes a long time to get it right. Once you have it working then generally it is fine. We really need to have a more intuitive system to allow easy to create and maintain UI. I believe simple anchor (left, top, right, bottom)m, Align and "alignWithMargin" like Delphi has would be a great bonus to SMS. I have no idea what would be involved, or how much work it would be, but I would love to see this being developed.
  13. Czar

    UI layout

    Loving the update. Only had a little play but it seems to be working as expected
  14. If it was possible to not break existing code then I would not be against it. I don't convert much delphi code so I don't see it as important from that point of view. It might make it more delphi friendly perhaps, making transition easier for people. I think what catches out more delphi users is that expected properties of components aren't there, something as simple as changing the form colour is not obvious. The paradigm shift is quite steep if you aren't used to working with CSS and HTML etc (which I am not) so it takes a little bit of adjustment.
  15. Czar

    UI layout

  16. Czar

    UI layout

    Being able to make more complex UI that works on all devices will make life much much easier Looking forward to finished product.
  17. Czar

    Development updates

    I like the lighter default theme for buttons. Thanks for the update.
  18. I am having a number of issues with w3labels and correct wrapping of text. 1. When using a layout wordwrap is not obeyed- text disappears off to the side. 2. Wordwrap does work correctly in a normal non-layout formatted label - chopping off text top and bottom Changing wordwrap and autosize properties does not solve the issues. You can see in the picture the layout version along the top (above the button) and a normal label not in the layout below the button. In the top label the sentence is cut off at ... the sessions your children will be absent for:" (in italics is missing). In the bottom label the wordwrap does not result in sufficient height. ---- No custom css or non-standard settings just opened a new Visual Component Project internal browser set to limited width - e.g., (480x800) labelissue.zip
  19. Czar

    RTL Search

    I use this external program. Just add .pas to search options. It is very quick and it is only way that I can search through rtl and projects. http://www.harddisksearch.com/
  20. Czar

    css styling

    Aha. Ok I now understand. I will take a closer look on monday as this approach does sound promising
  21. Czar

    css styling

    I really not sure what I supposed to see. Here is a screen recording
  22. Czar

    css styling

    Hi, I might be missing the point - I click on tailwind one and see "oh" in a dialog. I click on tailwind 2 and nothing happens, no visual change. checked firefox and chrome
  23. Czar

    RoadMap 2019

    I too would love to see a roadmap plan for the next 12 months. The efforts have been going into special projects that not many people will probably have a use for and the bread-and-butter has been left at a usable but not great state. For example, the IDE could do with love. The fact that the visual components don't surface basics like font size/colour etc and requires work arounds and non-intuitive knowledge suggests low hanging fruit for improvements. The ide has lots of bugs and irritating issues. for example events on buttons will often be reoved or doubled up. e.g., OnSubmitClick for button can be set once but if double click on it again often it breaks. Would the team consider open sourcing the IDE? Or maybe looking at a completly different model. I am invested in using SMS but I did so in the hope of meaningful improvements. Jarto I believe you are only active owner and I really appreciate your efforts but you are one person and this project could be so much more with greater input from more people.
  24. Czar

    Font size and style in buttons

    It would be awesome if we had a few more CSS options/themes available. I find it difficult to come up with a consistent style that varies from the ones provided. Maybe we could create a bounty to encourage someone to develop some themes?
  25. Czar

    layout, wordwrap and label nightmare

    Hi @jarto, I have tried all the permutations, autosize on/off and wordwrap on/off and the label doesn't behave nicely. With a label and Tlayout, I would have thought that the layout determines the width of the label and the label's content would determine the height if wordwrap is true. As a normal label (not using tlayout), if autosize is false and Wordwrap:=true then the the height of the label should increase within the provided width so that the content fits.
×