Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by jarto

  1. jarto

    Node.js API in a Visual Components Project

    I don't think you can use NodeJS api in a Visual Components Project.
  2. jarto

    Building an application

    @IElite already posted a link to my tutorial. If the problem you have is only to get the apk to your phone, I usually just connect my phone to my laptop via a usb cable and copy the apk to a folder. Then I start the file manager app in the Android phone, go to that folder, locate the apk and install it.
  3. jarto

    Page Loading Issues with iPhone Browser

    Are you saving something to the local storage? If not, this could be as simple as just cache. In that case, try deleting the app.manifest -file and uncheck "Generate cache manifest" on the Linker page in Project Options.
  4. jarto

    components lose name - little IDE bug

    Thank you. I'll add this to my work list.
  5. Good to know that we found the reason. Now I have to dig deeper and figure out, what causes the shortcuts to change. Edit: I still have not found a way to make the IDE to save a keyboard_shortcuts.xml with those two commands. They certainly are the reason for the conflict as those two shortcuts are set in SynEdit code. I'll solve this now by preventing those two from being saved to the xml-file.
  6. Thank you. Could you also zip and e-mail me your keyboard_shortcuts.xml-file from C:\ProgramData\The Smart Company\Smart Mobile Studio My email-address is jt at smartmobilestudio.com After mailing it, please try to replace it with the one I've attached here. keyboard_shortcuts.zip
  7. Hi, do you have a possibility to send me a zip of your project and steps on how to reproduce this? If I can reproduce the bug, I can certainly fix it fast.
  8. jarto

    Another GumRoad License Problem

    @KultiVator A license was generated and sent in the morning of May 30th. Can you please check if the license happens to have gone to your spam folder? I'll forward you the e-mail containing the license also now. Edit: I also sent you a private message here with the license key
  9. jarto

    TIniFile Question

    Yeah, that explains it. BTW, you don't need to use TW3Dispatch.Timeout here: TW3Dispatch.SetTimeout(Sender.free,100); A simple Sender.Free is enough.
  10. jarto

    TIniFile Question

    @Christian can you attach the apps.ini -file? I've tested your code with a short apps.ini-file like this and it works: [Test] Foo=bar My test code: unit Form1; interface uses System.Types, System.Types.Convert, System.Objects, System.Time, System.IOUtils, System.Device.Storage, System.IniFile, SmartCL.Net.Http, SmartCL.System, SmartCL.Time, SmartCL.Graphics, SmartCL.Components, SmartCL.FileUtils, SmartCL.Device.Storage, SmartCL.Forms, SmartCL.Fonts, SmartCL.Theme, SmartCL.Borders, SmartCL.Application; type TForm1 = class(TW3Form) private {$I 'Form1:intf'} protected procedure InitializeForm; override; procedure InitializeObject; override; procedure Resize; override; end; TIniFileHelper = class helper for TIniFile procedure LoadFromUrl(aUrl:String;Callback: TProcedureRef = nil); end; implementation { TForm1 } procedure TForm1.InitializeForm; begin inherited; var ini:=TIniFile.Create; ini.LoadFromUrl('res/apps.ini',procedure begin WriteLn('Got the callback'); WriteLn(ini.Read('Test','Foo')); end); end; procedure TForm1.InitializeObject; begin inherited; {$I 'Form1:impl'} end; procedure TForm1.Resize; begin inherited; end; procedure TIniFileHelper.LoadFromUrl(AUrl:String; Callback:TProcedureRef); var mRequest: TW3HttpRequest; begin mRequest := TW3HttpRequest.Create; mRequest.OnDataReady := procedure (Sender:TW3HttpRequest) begin WriteLn(Sender.ResponseText); ParseContent(Sender.ResponseText); if assigned(Callback) then Callback; TW3Dispatch.SetTimeout(Sender.free,100); end; mRequest.Get(aUrl); end; initialization Forms.RegisterForm({$I %FILE%}, TForm1); end.
  11. jarto

    Editing "Color" as a property

    We are working on replacing the Object Inspector with a better one.
  12. jarto

    Radiogroup - change items text

    With the current designer, having the items as a TStrArray is the only way we can define items at design time.
  13. jarto

    window component

    Cool, you found the new events like OnAllMovement. That makes the code a lot easier. The jitteryness may come from MoveTo. Forgot one thing: You need to call Ctrl.SetCapture when MouseDown happens and Ctrl.ReleaseCapture during MouseUp.
  14. jarto

    window component

    @warleyalex Yeah, well, the problem you experience is because the current Object Inspector lacks features. We're in the process of replacing it with a better component, which should let you edit more properties. For example sets. The Object Inspector also needs a lot of work. The current design was based on the idea that we'd get the Chromium to render us a live preview that we could use to make the controls look realistic. However, there was some changes in Chromium that broke that feature. So we're currently thinking about what'd be the best way to proceed. Basically: Should we try to improve the current one or replace it with something better.
  15. jarto

    window component

    Something like this: var saveX, saveY: Integer; Header.OnMouseDown:=procedure(Sender: TObject; Button: TMouseButton; shiftState: TShiftState; x, y: integer) begin var Ctrl:=TW3CustomControl(Sender); Ctrl.Cursor:=crMove; saveX:=x; saveY:=y; end; Header.OnMouseMove:=procedure(Sender: TObject; ShiftState: TShiftState; x, y: integer) begin var Ctrl:=TW3CustomControl(Sender); if Ctrl.Cursor=crMove then begin Ctrl.MoveTo(Ctrl.Left-(saveX-x),Ctrl.Top-(saveY-y)); PrevSize:=Ctrl.BoundsRect; saveX:=x; saveY:=y; end; end; Header.OnMouseUp:=procedure(Sender: TObject; Button: TMouseButton; shiftState: TShiftState; x, y: integer) begin var Ctrl:=TW3CustomControl(Sender); Ctrl.Cursor:=crDefault; end;
  16. jarto

    window component

    Did you change to use the normal events? Because the situation I mentioned above does still happen when you drag the window.
  17. Smart Mobile Studio 3.0.2 is released. This version contains all the fixes and improvements from the development-channel. There are lots of bug fixes and improvements to the IDE thanks to all the help from our users here. The Smart Mobile Studio team wants to with everybody a Merry Christmas and Happy New Year. Release notes: https://smartmobilestudio.com/2018/12/21/smart-mobile-studio-3-0-2-released/
  18. I also tried to find out which DWS version we use but the source tree does not tell it. @gabr42 may know more as we've not updated DWScript since I joined the project.
  19. jarto

    window component

    @lynkfs SetCapture/ReleaseCapture takes care of those dragging problems that @Czar mentioned. Edit: However, to be able to use SetCapture and ReleaseCapture, you need to listen to MouseDown, MouseUp and MouseMove using the normal Delphi-like events instead of using the raw JS events. Edit2: When you use normal events, the EventManager takes care of a boatload of the complexity. For example, SetCapture locks on to the control meaning that all move events go that one. (See the Scrollbars code in the RTL as an example) The EventManager also notices situations where you click on control to drag it, move the mouse outside of the whole browser window and release the button there. If you try to listen to events through JS, these kinds of special situations are a pain to handle correctly.
  20. We are using the Development version 2.3 with custom bug fixes to the date handling routines. They fix the time zone related problems mentioned here: I don't exactly know when the latest DWS was cloned, but we've used the same version (besides those fixes) for at least 2 years.
  21. jarto

    RoadMap 2019

    @IElite What you're asking for depends a lot on the design of your app and the server api. If you write both, then you yourself get to design how the server and the mobile app talk to each other. A1. Your app makes a https get to your server to retrieve the latest JSON data. To see an example, have a look at how the StringGrid demo reads a local file. The difference between reading data from local or a remote address depends only on the url used. To make this very smooth, you can do this: App starts Make the https get to the remote server Make a call with TW3Dispatch with a 2 second delay to read the local json When you start receiving data from the remote server, cancel the local read (set a boolean or something) Which ever get-command received data, update the GUI based on the data A2. Requesting a value from the server is a simple GET to your server software. You decide what the parameters are that the server needs to identify what data you're requesting. Modifying is a POST command. Again, you decide the parameters. Make sure to verify the parameters so that you're not creating a security hole. B. I'd do this so that your server app is the only one that talks to the database. You just create a simple API for the discussion between your mobile app and the server. So in the end it's basically just your mobile app doing get- and post-calls.
  22. As you all know, almost all classes in Smart Mobile Studio are named TW3Something. For example: TW3Button, TW3Panel etc. The decision to do that was done during the first stages of development of Smart Mobile Studio. However, there's no technical reason why the "W3" has to be there. So basically, we could rename all the components and classes to be more compatible with Delphi and making code sharing and porting easier. I wrote a program yesterday evening that analyzed and renamed all the classes and records that start with TW3 in the RTL. There are 849 of them to be precise. The app also renamed themes and the IDE code, so that I was able to compile a new IDE and make my first app with TForm and TButton etc. It all worked nicely, except that the chart component is causing a bit of trouble. It's using TPanel and a couple of other classes that would cause conflicts. I'd be able to add remapping functions to the IDE so that you could load an old project and all the TW3Whatever-classes would be converted to TWhatever. But if you have your own components using names like TPanel, TButton, TList, TStringList, they would cause trouble. Question is: Do you have them and how much of code like this do you have? Any thoughts?
  23. The Development-channel in SmartUpdate contains all the latest changes in Smart Mobile Studio. It's a good channel to follow for those who want all the new features and bug fixes right away, instead of waiting for the next formal release. To follow the Development-channel: Make a new folder and add: SmartUpdate.exe Your own user.lic from your current Smart Mobile Studio folder. To get all the latest changes in the Development-channel: Run: SmartUpdate /changechannel /showhidden When asked for which channel to follow, choose Development The purpose of this topic is to inform about all the new features and fixes.
  24. jarto

    Development updates

    New update available in the development-channel: Themes: New background for highlighting errors: bsErrorBackground TW3StringGrid: New event for setting custom row borders and backgrounds: OnDrawGridLineTheme
  25. A new update is available in the development-channel of SmartUpdate. It contains a completely new Grid: TW3StringGrid. It's a completely new design, which was made to be very fast and able to handle lots of data. This is achieved through dynamic drawing: Only the visible grid lines are rendered. There is a new StringGrid-demo in the Featured Demos. It downloads a json file and populates the grid with data from it. TW3StringGrid supports six different column types: Text (column class TW3StringGridTextColumn) Numeric (column class TW3StringGridNumericColumn) EditBox (column class TW3StringGridEditColumn) ComboBox (column class TW3StringGridComboColumn) Checkmark (column class TW3StringGridCheckmarkColumn) Button (column class TW3StringGridButtonColumn) Columns are created by calling: MyNewColumn:=Grid.AddColumn(ColumnClass); If no ColumnClass is given, a Text column is created. Column properties: Caption Width BorderType Default is btLightBorderRight. Set to btNone if you don't want any vertical borders. Backgroundtype Default is btNone to let the line color through. AlignText (The same way as in TW3Label) taLeft (default) taCenter taRight SelectOptions (for TW3StringGridComboColumn only) This is an array of selectable values. First value (index 0) is the value for no selection. For example: SelectOptions:=['','First','Second','Third']; RowBorderType: Default is btLightBorderBottom. Set to btNone if you don't want any horizontal borders. RowBackgroundType: Default is bsListItemBackground. Set to bsDecorativeListItemBackground (or test other backgrounds) to change the background style for even rows. RowOddBorderType: Default is btLightBorderBottom. Set to btNone if you don't want any horizontal borders. Affects odd rows. RowOddBackgroundType: Default is bsListItemBackground. Set to bsDecorativeListItemBackground (or test other backgrounds) to change the background style for odd rows. Grid properties: RowCount: Set number of rows to show FixedColumns: How many columns should be fixed (aka not scrollable horizontally) LineHeight MultiSelect Events: OnCellClick: Is triggered when the row is clicked. OnCellChanged: Is triggered when cell content changes through editing (for example: through editing) OnDrawGridLineTheme: Can be used to set custom backgrounds and borders for a row. (for example, set background to bsErrorBackground for lines that should be highlighted to the user) Methods: InvalidateGrid: Triggers a repaint of the grid. Sort Sorting TW3StringGrid supports sorting based on one of multiple columns. Clicking on the column headers sets or reverses sort order. You can also control sorting in code: procedure AddSortColumn(Index: Integer; SortOrder: TW3SortOrder = soNormal); overload; procedure AddSortColumn(Col: TW3StringGridColumn; SortOrder: TW3SortOrder = soNormal); overload; procedure SetSortColumn(Index: Integer; SortOrder: TW3SortOrder = soNormal); overload; procedure SetSortColumn(Col: TW3StringGridColumn; SortOrder: TW3SortOrder = soNormal); overload; procedure ToggleSortColumn(Index: Integer); For example: Grid.SortOptions.AddSortColumn(3,soReverse); //Set primary sort column Grid.SortOptions.AddSortColumn(1); //Add secondary sort columns Grid.Sort; Working with sorted data When the Grid is sorted, it only affects how data is shown. Sorting does not change Grid data itself at all. When you work with a sorted grid events and indexes (for example SelectedIndex) always refer to the index in the grid data itself and NOT the visible line number. TW3StringGrid uses these events: TW3StringGridColumnEvent = procedure(const Sender: TW3StringGridColumn; const Row: Integer); TW3StringGridEvent = procedure(const Sender: TObject; const Row, Col: Integer); If you have a Grid where "Australia" is on line 2, SelectedIndex:=2 selects that row regardless of how the grid is sorted. Clicking on that row or changing data on that row also returns Row=2 regardless of how the grid is sorted.