Jump to content

All Activity

This stream auto-updates     

  1. Yesterday
  2. When is the next contest?

    A repost from Facebook - dated January 9 "Mid february it's time for a Smart competition again! This time the winner recieves the Asus Tinkerboard which is an absolute power-house of a SBC (single board computer). We ourselves use this board for running Smart Mobile Studio via EXAGEAR (x86 emulation for ARM devices), and also as a node.js and Android deployment device. Like our sister group, Delphi Developer, we are printing a special edition white "retro case" for this fantastic little machine (fresh off the mint, they were done printing yesterday at 25 hours each). The lucky winner recieves the following (pre assembled ofcourse): 1 x "Special Edition" White Retro Case 1 x Asus Tinkerboard 1 x 32 Gb Samsung class 10 SD card 1 x Fan to ensure reliable operational temperature 1 x Red light diode power indicator 1 x Smart ready Ubuntu installation (*) Samba is setup and registers on the network as "SmartDevice". PM2 which is the node.js clustering software used to run large Smart Mobile Studio cloud services is also "ready to go". Sftp is likewise there, so you can upload your compiled code as part of your build process (Smart has project options for this). More information about the competition will be released in due time (at least a month from now), but if you have been waiting for a nice competition - now is the chance to create, port or implement something amazing 😎 Looking forward to the submissions. We are lucky to have so many fine developers using Smart!"
  3. Last week
  4. Smart Test Framework

    Thank you, great (System.diagnostics ==> smartcl.diagnostics)
  5. Smart Test Framework

    Hey, here is the SMS test framework fixed! Projct download: ProjTester
  6. Currently, the listbox has events for handling items that have been clicked or selected......but I need a list box item that can be double clicked Would it be possible to add this to the RTL? e.g. TW3ListBox = class(TW3ScrollControl) private FOnItemDblClick: TW3ListBoxItemDataEvent; procedure SetOnItemDblClick(Value: TW3ListBoxItemDataEvent); protected procedure HandleItemDblClick(Sender: TObject); public published property OnItemDblClick: TW3ListBoxItemDataEvent read FOnItemDblClick write SetOnItemDblClick; end; implementation procedure TW3ListBox.HandleItemDblClick(Sender: TObject); begin if not (csDestroying in ComponentState) then begin for var i:=0 to FFilteredItems.Count-1 do begin var Item := TW3ListBoxItemData(FFilteredItems[i]); if Item.ItemObject=Sender then begin if MultiSelect then begin Item.Selected := not Item.Selected; if Item.Selected then FSelectedIndex := Item.Index else FSelectedIndex := -1; end else SelectedIndex := Item.Index; if Assigned(FOnItemDblClick) then FOnItemDblClick(Self, Item); if Assigned(FOnSelected) then FOnSelected(Self, Item.Index); break; end; end; end; end; procedure TW3ListBox.SetOnItemDblClick(Value: TW3ListBoxItemDataEvent); begin FOnItemDblClick := Value; end; procedure TW3ListBox.ShowListItem(Item: TW3ListBoxItemData); begin if Assigned(FOnShowItem) then FOnShowItem(Self,Item) else if Item.ItemObject is TW3Label then TW3Label(Item.ItemObject).Caption:=Item.Caption else TW3CustomControl(Item.ItemObject).InnerText:=Item.Caption; Item.ItemObject.OnClick:=@HandleItemClick; Item.ItemObject.OnDblClick:=@HandleItemDblClick; end; end.
  7. Vibration API

    If you make a Phonegap app, then it's simply: PhoneGap.Notification.vibrate(1000);
  8. shoestring framework

    The documentation for the native framework can be found here
  9. Vibration API

    try this browserapi.window.navigator.vibrate(200); // vibrate for 200ms browserapi.window.navigator.vibrate([100,30,100,30,100,200,200,30,200,30,200,200,100,30,100,30,100]); // Vibrate 'SOS' in Morse. The vibration api does not work on ios safari, opera and edge
  10. Vibration API

    I am trying to use the vibration API on android phone but it's not working - seems there is something I'm not doing right I have tried the code below, but none is working. Is there a way to create vibration using SMS code without cordova plugin? asm navigator.vibrate(500); end; and asm window.navigator.vibrate([500]); end; and asm function vib() { navigator.vibrate([500]); } vib(); end;
  11. Earlier
  12. Overriding TW3ListBoxItemData style

    hmmm, how'd i miss that? thanks
  13. Overriding TW3ListBoxItemData style

    And when you have a pretty short list like this, but with complicated items, it's a good idea to set W3Listbox1.RecycleControls := False;
  14. Overriding TW3ListBoxItemData style

    Found the problem in your CSS. Try this: .XListBoxItemSelectedStyle{ background-color: #000000; color: #FFFFFF } .XListBoxItemStyle{ color: #000000; background-color: #FFFFFF
  15. Database Examples

    @lennart What is "TW3WebSQLCustomTransaction" I only find "TW3WebSQLTransaction"....however, the GetWriteTransaction method expects a "TW3CustomDbTransaction" which seems to work. Also, is there a reason why you would NOT also put the "checking of database active property" and the "creation of table" in the Application object? e.g. procedure TApplication.ApplicationStarting; var Transaction: TW3CustomDbTransaction; begin //setup database engine FDatabase:=TW3WebSQLDatabase.Create; FDatabase.DBName:={$I 'app:name'}; FDatabase.DBDescription:='Database for ' + {$I 'app:name'}; FDatabase.DBSize:=(1024 * 1024) * 4; // activate database try if not Datastore.Active then Datastore.Active := True; except on e: exception do begin writeln("Failed to activate database: "); writeln(e.message); exit; end; end; // Create our table // Get new write transaction if Datastore.GetWriteTransaction(Transaction) then begin try Transaction.Execute("create table if not exists customers (id integer primary key asc, name string);",[]); finally if Transaction.LastFailed then WriteLn(Transaction.LastError); Transaction.Free; end; end else raise Exception.Create('Failed to create write transaction error'); inherited; end;
  16. Overriding TW3ListBoxItemData style

    @lennart, @jarto Testing the latest update, I am trying to override the TW3ListBoxItemData's "RemoveSelectedStyle" and "SetSelectedStyle" methods. However, I can't seem to get the StyleClass property to work. However, I can do color changes at runtime. procedure TXListBoxItemData.RemoveSelectedStyle; begin //TXListBoxItem(ItemObject).StyleClass:= 'XListBoxItemStyle'; //does not work //TXListBoxItem(ItemObject).Label.StyleClass:= 'XListBoxItemStyle'; //does not work TXListBoxItem(ItemObject).Label.Color:= clWhite; //works TXListBoxItem(ItemObject).Label.Font.Color:= clBlack; //works end; procedure TXListBoxItemData.SetSelectedStyle; begin //TXListBoxItem(ItemObject).StyleClass:= 'XListBoxItemSelectedStyle'; //does not work //TXListBoxItem(ItemObject).Label.StyleClass:= 'XListBoxItemSelectedStyle'; //does not work TXListBoxItem(ItemObject).Label.Color:= clBlack; //works TXListBoxItem(ItemObject).Label.Font.Color:= clWhite; //works end; It seems that the StyleClass will not happen instaneously. Is there a method that has to be called after setting StyleClass to get it to refresh immediately? When I select an item, I do not see the Style change until I select another item, then the previous item I selected, changes Download from Github Thanx
  17. New Alpha update

    New update available: In this one I've fixed some bugs in TW3ListBox and TW3CheckListBox. @IElite Have a look at the TW3CheckListBox source to see how you can control the creation of TW3ListBoxItemData. I also added TW3ListBox.Selected[Index] so that you can easily toggle selected on/off for items.
  18. New Alpha update

    I'll try to write an example today. Edit: Actually, while doing it I found some bugs too. I will fix those too.
  19. Database Examples

    @lennart THANKS! Please, I would love to see a sqlite example when you find the time. Thats the one I have been working with the longest trying to do persistent data
  20. New Alpha update

    Thanks for the TW3ListBox and TW3CheckListBox changes! How do you override the creation of the TW3ListBoxItemData ? Specifically how to override the SetSelected? This is something I am very interested in doing Here is a ListBox example I created for demo purposes that uses a custom listbox item here is the code on github
  21. New Alpha update

    exciting to see the update. smartcl.pas needs // Implementation of storage-device "Browser:" //SmartCL.StorageDevice.Browser, as SmartCL.StorageDevice.Browser, file doesn't exist
  22. New Alpha update

    After a long break, a new update is available: IDE: - Added support for search paths - Updated SynEdit - Bug fixes - ACE (TW3AceEditor) added to the Component Palette RTL: - New units: - System.Collections - System.StorageDevice - Marjor improvements to TW3Dataset, TW3DatasetFilter and WebSQL - Bug fixes and improvements to TextParser - Bug fixes to WebFonts support - Moved TCriticalSection to System.Types - Improvements to TW3ListBox and TW3CheckListBox: - Support for SelectedIndex and automatic change of style background for selected items - Support for MultiSelect - Possibility to override creation of TW3ListBoxItemData - Allows use of own classes and properties - Allows overriding SetSelected to control what styling changes should be made when items are selected Bug fixes to many demos
  23. Save and load SQLite Database to local storage

    ok thanks, I see lynkfs is also having troubles
  24. Requesting a trial key

    Hi Allen, Thank you for reporting this. We had some temporary server problems. I just tested this and now it does work.
  25. SQLite Loadfromstream

    This code snippet saves a SQLite database to local storage and reloads it again. All goes fine up till the end (LoadFromStream) but leaves the db in an inactive state Any suggestions ? var MyStream : TStringStream; MyStream := TStringStream.Create; db.SaveToStream(MyStream,true); var textdata3 := MyStream.DataString; //save textdata3 to local storage var LocalStorage2 := TW3LocalStorage.Create; LocalStorage2.Open('sqlite'); LocalStorage2.SetKeyStr('stream',textdata3); LocalStorage2.Close; //read textdata3 from local storage LocalStorage2.Open('sqlite'); textdata3 := LocalStorage2.GetKeyStr('stream','unknown'); LocalStorage2.Close; MyStream.DataString := textdata3; db.LoadFromStream(MyStream); //all good up to here writeln(db.active); //false
  26. Requesting a trial key

    I am unable to request a trial key. The button on the webpage is not working. Best Regards, Allen
  27. Save Content Dialog

    The node filesystem is wrapped. But right now im implementing filesystem classes, meaning that we will have a unified solution for this. Since storage is so different between node, browser, phonegap and various embedded hardware - it makes sense to create some "driver" like classes that expose a common interface. As for the filesystem units. The System.Filesystem.pas file is presently used by node.js only, but it will be absorbed by the drivers soon. The Filesystem.Memory unit is a fully working filesystem for a "ram disk". That you can also save to the cache. It gives you things like chdir, mkdir, dir, paths etc. etc. for a in-memory device. Then you can save the data to the cache. So this is the "driver" for the browser so to speak. A identical class is being written for nodejs. Both will be async (!) So heads up on that!
  28. back(s)lash

    Its not a "bug", the $ postfix / prefix means its a managed variable/field. Write a normal streamer or implement a ToJSON() mechanism. The mess of raw JS is what we are trying to get away from
  1. Load more activity