Jump to content


Popular Content

Showing content with the highest reputation since 06/21/2018 in all areas

  1. 4 points

    Scroll bar bug

    This was a weird bug that required changes in SynEdit code itself. May be a Delphi bug even. But I got it fixed and it will be in 3.0
  2. 4 points
    @rshotbolt Here are some resources that might help you out. I like the first one as it explains the precedence and how each overrides the others. Playing with the design 03.06.2013 https://smartmobilestudio.com/2013/06/03/playing-with-the-design/ Smart Mobile Studio and CSS: part 1 October 9, 2017 https://jonlennartaasenden.wordpress.com/2017/10/09/smart-mobile-studio-and-css-part-1/ Smart Mobile Studio and CSS: part 2 https://jonlennartaasenden.wordpress.com/2017/10/11/smart-mobile-studio-and-css-part-2/ Smart Mobile Studio and CSS: part 3 https://jonlennartaasenden.wordpress.com/2017/10/12/smart-mobile-studio-and-css-part-3/ Smart Mobile Studio and CSS: part 4 https://jonlennartaasenden.wordpress.com/2017/10/18/smart-mobile-studio-and-css-part-4/ Themes and styles https://smartmobilestudio.com/documentation/getting-started/themes-and-styles/ Working with controls, the boxing model 05.01.2012 https://smartmobilestudio.com/2012/01/05/working-with-controls-the-boxing-model/ Hidden stylesheets with Smart Pascal August 13, 2014 https://jonlennartaasenden.wordpress.com/2014/08/13/hidden-stylesheets-with-smart-pascal/ HTML5 Attributes, learn how to trigger conditional styling with Smart Mobile Studio November 8, 2017 https://jonlennartaasenden.wordpress.com/2017/11/08/html5-attributes-learn-how-to-trigger-conditional-styling-with-smart-mobile-studio/
  3. 3 points
    New update available with SmartUpdate in both alpha- and beta-channels. The update contains lots of bug fixes to the IDE. Some are smaller, but the most important deals with debugging and breakpoints. With this update, breakpoints finally work as they should. The changes to background compilation also makes the IDE a lot smoother to use. We also went through all the demos, fixed and improved a bunch of them and added two new ones. Before updating, please delete the "Featured Demos" -folder to make sure that no old demos will remain after the update. Changelog: 15.7.2018 RTL: - ShowModal: Trigger a cancel if the user clicks on the opaque background. - Bug fixes to Scrollbars - Changed padding in all themes. - Previously all controls had default padding (usually 2px), including div. - Now only known controls have the default padding. - Bug fix to TW3Image.LoadFromStream() IDE: - Bug fixes and improvements to background compilation. - Fixes problems with setting breakpoints in the SMS IDE. - If debugging with breakpoints, code obfuscation and packing is switched off. - If execute was set to a browser, instead of embedded Chrome, closing the debugger window caused an exception. - Fix "code painting bug while scrolling" in SynEdit. - Color picker to work with styled application. Demos: - Added: - https server demo - ThemeView demo - Bug fixes and improvements to many demos.
  4. 3 points
    New update available with SmartUpdate in both alpha- and beta-channels: 1.7.2018 Range checking caused apps not to start due to an error in Base64 lookup tables. Update TW3AceEditor. TW3TabControl: If PrepareTab was called for the visible tab, it was moved to the wrong place. TW3Label: Fix vertical alignment to work with older browsers. TW3ComboBox: Allow values to be set during ObjectReady. Bug fix to TMemoryStream.WriteBuffer. Bug fix to WaitFor.
  5. 3 points
    Thank you. I just updated the download -page to point to the latest beta-download. Also added instructions on how to do a portable installation.
  6. 2 points

    Websocket Server Start Error

    Have you installed the websocket package in the output directory? You write "I installed nodejs websocket" but it has to be the "ws" package and it has to be in the same folder as the project compiled file. 1. Open shell (CMD) and cd to the project folder 2. CD into the output folder (just compile to create it) 3. in the shell window, type "npm install ws". Npm (node package manager) will now download and place the ws (websocket) package files relative to the compiled *.js file (your compiled project file). 4. then run the project Note: To build a dependency file, add the "--save" param to the NPM command, it will then create a packages file. This is cool when you want to push your code to amazon etc. because node will then notice this and install all the dependencies in one-go I tested your code and it worked on the first try after i installed the ws library
  7. 2 points

    WebWorkers and Flow Based Programming

    WebWorkers and Flow Based Programming It has been a while since I got as excited as I was when I read J.Morrison's book "Flow-Based Programming: A New Approach to Application Development - 2nd edition". This post is not meant to give an overview of FBP, but if someone is interested, the first edition of his book is available online for free. FBP utilises independantly running processes which are wired together in an assembly line type of arrangement. The main advantages are that each process runs on demand rather than on availability, components can easily be re-wired to implement changes in requirements and there are possibilities for extensive component re-use. I was in the process of porting this framework to Smart, when I realised that javascript and concurrently running processes is not an easy match. Basically all js code in the browser executes in the same thread, and time-slicing mechanisms like setTimeout (used in the framework I was porting) doesn't enable real concurrent processing. However there are 2 exceptions to escape the single-threadedness : IFrames and webworkers. Both implement runtimes separate from the main thread and have their own heap, stack and message handling mechanism. The similarities between the FBP and shared webworker specs are (more than) striking, so this post is about having a go at implementing FBP using webworkers. Technically - processes (fbp) can be implemented through shared webworkers - connections between processes (fbp) can be implemented using channels (webworker to webworker, buffered) - ports (fbp) can be implemented using ports (webworker) - reading/writing of information packets's (fbp) can be implemented using messaging (webworker) - information packet handling (fbp) can be implemented using the transferable interface (webworker) The demo chosen is a variation of the 'Galaxy Clock' project in the featured-demo's section. The variation being that the 'single motor' driving the 3 hands of the clock (hr, min, sec) is replaced by 3 separate 'motors', each driving one of the hands and each one operating in its own thread. The architecture of this demo : a scheduler webworker receives the current local time when a button is clicked in the main program. It transfers the time-elements to each of the other web-workers through the channels created. These other webworkers in their turn update the main project at appropriate intervals. The result of this rather peculiar architecture. The hr/min/sec displays are purposely not synchronised and are all running at 10x normal clock-speed.
  8. 2 points
    That's sooo much better - I've now bought the pro version. it really would pay you dividends to update the exe and demos on your download link though, its currently on version
  9. 1 point
    You only attached Unit1, so there's no way for me to properly debug. Here's my best guess: This is what Unit1 looks like in a new project. unit Unit1; interface uses Pseudo.CreateForms, // auto-generated unit that creates forms during startup System.Types, SmartCL.System, SmartCL.Components, SmartCL.Forms, SmartCL.Application, Form1; type TApplication = class(TW3CustomApplication) end; implementation end. While previously you created all the forms by code, it's now done by TW3Application itself. You can control it here: If you can't see all your forms there, try creating a new project and add your old existing forms to it. When Auto is checked in that list, TW3Application creates the form during startup. If you continue to have issues, you can send a zip of your project to jt at smartmobilestudio.com and I'll be happy to help.
  10. 1 point

    Date and Time Computations

    You can simply cast the TDateTimes to Double. The difference in the integer parts is the number of days and the fractional parts is fractions of a day e.g. 0.5 = 12pm, so multiplying the fractional part by 24 is the number of hours. procedure TForm1.W3Button1Click(Sender: TObject); var dt1, dt2: TDateTime; dt3: Integer; dt4: Double; begin dt1 := Now; dt2 := Now + 2.5; dt3 := Floor(dt2 - dt1); dt4 := Frac(dt2 - dt1) * 24; ShowMessage(IntToStr(dt3) + ' days ' + IntToStr(dt4) + ' hours'); end; If you want better precision than hours, a bit more work is needed!
  11. 1 point

    Websocket Server Start Error

    Its actually one of the coolest things about node.js! Node also has clang (c++ compiler) built-in, so if you use native packages it will actually re-compile node.js on the spot (!) But the majority of modules are raw JS and can be safely copied between systems. So you can write a server on windows, and just copy it to linux without any change
  12. 1 point
    Paulo Lopes

    Scroll bar bug

    When use the Scroll bar to far bottom or to top the IDE select all text and turn blue. If press delete or backspace can lose code.
  13. 1 point

    Scroll bar bug

    Looks like an issue with Selstart/SelLength or the associated Windows messages being fired during scrolling. If nothing is selected before scrolling takes place then SelLength should always be zero. What kind of Delphi control are the IDE and browser source code windows?
  14. 1 point

    architecture 911

    Interesting things sometimes happen unexpectedly. In this case by combining several unrelated posts : rapid prototyping webworkers and flow based programming compiled procedures In reverse order : the last post described a short-cut to produce webworkers on the fly. The middle post describes an alternative architecture where a network is constructed out of webworkers and messagechannels, and the first post covers a possible take on rapid prototyping. The subject of this post is that prototyped business processes can be graphed as well moreover, these business process graphs can be mapped as a network of workers which can be of the on-the-fly internal type. That makes for a crazy architecture, but with some advantages. For interested parties, see document here. It also has a link to see this in action.
  15. 1 point
    I suppose the Theme is iOS in that demo? Have a look at Project Options / Linker. Try other themes there to change how the app looks like.
  16. 1 point

    webworker demos fail

    Disable Range checking in Project Options. There's a small bug in the start of applications if range checking is enabled. I'm going to push a fix to it soon.
  17. 1 point

    compiled procedures

    When creating webworkers, the choice is to either set up a separate project for each worker (see featured demo's), or create separate text files with the webworkers code. Another alternative is to create workers from a string : myWorker := createWorker(#" onmessage = function(e) { console.log(e.data); } "); function createWorker(workerFunc: string) : variant; var newworker: variant; begin asm const blob = new Blob([workerFunc], {type: 'application/javascript'}); const url = URL.createObjectURL(blob); @newworker = new Worker(url); end; result := newworker; end; hybrid coding The main advantage though is that creating workers can be done in the main project, no need to switch back and forth Note : unfortunately I don't see a possibility to use the 'toString()' method here to generate webworker strings from compiled pascal functions. Edited : Actually it is possible to create webworkers inline/on the fly from compiled procedures without resorting to writing js-code. As an example the TestFunc procedure below is injected into a new Worker as compiled js. No need to specify an external worker file either. //create a new variant var Dummy : variant := TVariant.CreateObject; //give it an anonymous function Dummy.TestFunc := lambda (e:variant) function test(a: integer): integer; begin result := inc(a); end; asm console.log((@e).data); end; var a:integer := 1; a := test(a); asm console.log(@a); end; end; //convert function TestFunc to a string and create worker from it var temp: string; asm @temp = ((@Dummy).TestFunc).toString(); end; WWTry := createWorker( 'onmessage = ' + temp ); the resulting worker code : onmessage = function (e) { var a = 0; function test(a) { return ++a; }; console.log((e).data); // 'testing' a = 1; a = test(a); console.log(a); // '2' } and executing worker : //execute worker WWTry.postMessage('testing'); results as expected in 'testing' '2'
  18. 1 point
    I just ran some tests. The extra Move does not cause an error or wrong result, but it's extra. I'll remove it in the next update. Thanks!
  19. 1 point
    The following lines are duplicated when copying to an empty buffer. Is this necessary and if so, why? TMarshal.Move(mData,0,FBuffer.handle,0,buffer.length); TMarshal.Move(mData,0,FBuffer.Handle,0,Buffer.length);
  20. 1 point
    You're probably using an old version of alpha. There were unupdated demos in the early alpha releases, but they have all been fixed later. Now our build server even requires all the demos to compile, so there really should be no broken demos. The latest alpha version as I type this is If you have anything less, do this: Download and save SmartUpdate.exe to a new, empty folder from https://s3.eu-central-1.amazonaws.com/smart-mobile-studio/download/SmartUpdate.exe Copy your user.lic to the same folder Run SmartUpdate.exe When selecting channel, choose alpha. This way you should get a 100% up to date version. Keep running SmartUpdate.exe every time you see an update message from us here.
  21. 1 point

    'Open in Browser' not working

    Thanks Jarto - I added SmartMS.exe and port 8090 to my ALLOW rules in the firewall and it now works!
  22. 1 point

    'Open in Browser' not working

    @rshotboltHave you tested if your firewall blocks it? And what browser are you using? I've sometimes had problems connecting with IE/Edge, but no problems ever with Chrome or Firefox.
  23. 1 point

    Tw3TabControl's OnPrepareTab ?

    Yeah, let me explain what OnPrepareTab does: Imagine that you have tens of tabs. If all of them were built at once, it would take a lot of time and slow down your code. Also, building most of them might be for no good, if most of the tabs were never shown. So, when you add a tab, nothing happens unless the tab you added is the one showing or just next to it. In your example: Add tabs one, two and three. Tab "one" is showing, so OnPrepareTab is called for it and OnShowTab right away after it. Tab "two" is right next to it, so OnPrepareTab is called for it too. If the user changes to tab "two", OnShowTab is called for it and OnPrepareTab for tab "three". So, the function of OnPrepareTab is that you have the possibility to build the tab before it's showing. That way you'll most likely have it looking good before it's going to be visible. @lynkfs also explained what went wrong in your example. When you're using anonymous procedures and you're using variables from outside of it, you very often have no control over what the values of the outside variables are.
  24. 1 point
    New update again available with SmartUpdate in both the alpha- and beta-channels: RTL: - NodeJS: - Support for https and https server. - Support for WebSocket Security (WSS) - Improvements to the Ragnarok server. - Improvements to text parsing. - Changes to TW3TabControl: - Hide tab contents properly, if the tab is not visible. - Added HideHeader/ShowHeader - Changes to how ContextMenus are handled - As default, context menu is only shown on TW3EditBox, TW3Memo and TW3AceEditor. - Set TW3CustomControl.AllowContextMenu to true to enable on other controls. - OnContextPopup's Handled-property changed to allow proper control. - Improvements to the way listmenu-items layout the text. - Bug fixes and improvements to TW3ToolBar.
  25. 1 point

    Rapid prototyping

    Rapid prototyping Wikipedia "Rapid prototyping is commonly applied in software engineering to try out new business models and application architectures". Embarcadero "use rapid prototyping to : -Create a real working prototype, incorporate feedback and get your app to market fast -Use the power of components to quickly prototype multi-device applications -Collaborate with users, incorporate their feedback, and deliver richer apps -Quickly go from prototype to production without wasted effort Smart Mobile Studio "Our technology gives a tremendous advantage over classical web developers that must rely on a wide scope of JavaScript libraries, libraries that rarely co-exist without causing browser instabilities. With Smart this is not the case – here you can enjoy the same freedom of rapid, object oriented software architecture as you would under Delphi or Visual Studio. Obviously products like Smart and Delphi are geared (at least marketing wise) towards rapid prototyping. The topic of this post is to have a look at this process of rapid prototyping, and maybe do this from a different angle than usually done. The Process The RP process is the refining iteration of "design > build > test > feedback > adjust" and starts at a minimum with some kind of description of the business, or part of it. By way of demo I selected the "EU-Rent Car Rental" fictitious business. This is a standardised demo business put together and described in the OMG standards documentation : This quite succinctly describes this business. Step 1 is to find an internal structure to model on, and for this I selected the graph structure. Graphs are amazing. I'm sure NLP (natural language processing) is getting to the point that the above text can be translated into a graph structure automatically. However, sidestepping that for the moment, the above description can be easily re-written in the subject-predicate-object W3C graph format : customers issue bookings bookings specify car groups a car group has a specific rate rental cars are grouped in car groups branches have bookings customers may accumulate memberships points membership points may be used for rentals customers may generate bad experiences etc. etc." and this can be immediately parsed into a graph structure like : Graphs like this can be used to auto-generate an application as described in this forum post. It doesn't give a full-fledged app, but at least it is something. The project-source (native format) implementing that demo can be found here Step 2 is to add some data to the graph.