Jump to content

All Activity

This stream auto-updates     

  1. Yesterday
  2. Daniel Eiszele

    Learning Smart Mobile Studio

    I would also suggest Jon Lennart Aasenden's blog, https://jonlennartaasenden.wordpress.com/news/ as invaluable for understanding the Smart Mobile studio paradigm. His blog is not solely about Smart Mobile Studio but putting them in as search terms should return a wealth of knowledge on the subject.
  3. lynkfs

    file system

    A quick test on persistence : indexedDB (and hence the client file system) is persistent per device. Which means that once a filesystem is created, it will be there the next time the app is activated. Some caveats though it is pretty safe, but not 100% so. Browsers may delete a database if there is not enough diskspace. Why and when differs between browsers somewhat too. storage access is regulated by 'same origin'. In the demo above the file system is accessible in the lynkfs.com domain, but not in ibm.com Which is ok. firing up multiple instances of chrome does not disrupt access, the db is accessible in all instances there is no cross-access between browsers (firefox doesn't see indexDB instances created in Chrome) users may clear browser cache/memory/storage All in all not too bad
  4. Last week
  5. lynkfs

    Learning Smart Mobile Studio

    Look at Primož Gabrijelčič's book on SMS, available on https://leanpub.com/asmartbook Very valuable and I still consult it on a regular basis There is some info on http://www.pp4s.co.uk/main/smart-gettingstarted.html as well
  6. DavidRM

    Bugs and Features 3.1.0.88

    I just saw it happen when I selected a block of lines from the bottom up (instead of top down). -David
  7. DelphiNoob

    Learning Smart Mobile Studio

    It's been about a month and a bit that I started using Smart Mobile Studio and often I run into a problem but struggle to find the resources to help me out. Smart Mobile Studio forums has helped me a lot but there are times where I would like to figure it out myself or would like to solve the problem ASAP. Can anyone recommend a website I can go to learn more about Smart Mobile Studio? Thanks.
  8. DelphiNoob

    Getting user's input from input box

    Yes this is perfect! I haven't actually came across the prompt yet. Thanks @jarto and @Daniel Eiszele
  9. IElite

    file system

    ill have to give this a try very soon, thanx for sharing
  10. kockas

    Responsive Design

    yes you are right, thank you! It's another world. I'm better off trying to sort out Smartmobile Studios image components in real time....
  11. jarto

    Bugs and Features 3.1.0.88

    This is weird. I was able to reproduce this once, but most often it does comment both lines.
  12. jarto

    Bugs and Features 3.1.0.88

    @tristan The development-channel has now an update, which fixes the bugs in TW3TabControl
  13. jarto

    Development updates

    New update available: IDE: Zip Entire Project did not include Form .sfm -files RTL: Bug fixes to TW3TabControl
  14. lynkfs

    file system

    This code works (File system in the browser) create and mount a FileSystem create a directory write a file with some contents read the stats of this file read the contents of this file write another file list the directory contents in a memo Demo procedure TForm1.InitializeForm; begin inherited; // this is a good place to initialize components var Script := browserapi.document.createElement('script'); Script.src := 'res/filer.js'; //https://raw.githubusercontent.com/filerjs/filer/develop/dist/filer.js browserapi.document.head.appendChild(Script); Script.onload := procedure begin writeln('filer loaded'); var Filer := browserapi.window.Filer; writeln('instance created'); var fs : variant := new JObject; asm @fs = new (@Filer).FileSystem({ name: "myfilesystem01", flags: [ 'FORMAT' ] }); end; writeln('filesystem created'); //mkdir fs.mkdir('/docs', procedure(err:boolean) begin if (err) then writeln('Unable to create /docs dir'); end); //write file fs.writeFile('/docs/firstDoc.txt', 'Hello World', procedure(err:boolean) begin if (err) then writeln('Unable to write /docs/firstDoc.txt'); end); //stats fs.stat('/docs/firstDoc.txt', procedure(err, stats:variant) begin if (err) then writeln ('Unable to stat /docs/first.txt') else writeln(stats); end); // Read file fs.readFile('/docs/firstDoc.txt', 'utf8', procedure (err:boolean; data:string ) begin if (err) then writeln ('Unable to read /docs/firstDoc.txt') else writeln(data); end); //write second file fs.writeFile('/docs/secondDoc.txt', 'Brave new world', procedure(err:boolean) begin if (err) then writeln('Unable to write /docs/secondDoc.txt'); end); //get reference to shell var sh : variant := new JObject; asm @sh = new (@fs).Shell(); end; // list directory, shallow listing sh.ls('/docs', procedure(err:boolean; entries: array of variant) begin if (err) then writeln ('Unable to read /docs directory') else begin W3Memo1.Text := '/docs' + #10; for var i := 0 to entries.length -1 do begin writeln(entries[i].name); W3Memo1.Text := W3Memo1.Text + ' ' + entries[i].name + #10; end; end; end); end; end; I like this a lot note : works from file or server, not in the ide
  15. jarto

    Getting user's input from input box

    A simple solution is Prompt, like @Daniel Eiszelewrote: var Answer:=Prompt('Question'); WriteLn(Answer); If you want a more beautiful solution, then you can make a form for the input and show it modally. That way you can control everything.
  16. lynkfs

    file system

    The original html5 spec had a file api which allowed to read and write files clientside (the File Directories and System Api). This was only fully implemented by Chrome at one point, but even then Chrome needed to be started with a switch (-allow-file-access-from-files). Today clientside storage is limited to cookies, local/session storage, indexedDB and the Cache API. While I understand the reasons for limiting file handling on the client, it is sometimes annoying. Fortunately some pretty creative solutions have emerged. One of them is Filer. This is a nodejs fs filesystem look-a-like which uses indexedDB for storage, and runs in the browser. Basically it allows for a complete filesystem clientside. Not bad at all. To continue stacking : Filer is stacked on top of indexedDB. Stack nohost on top of Filer and you have a web fileserver (based on service workers) in the browser. Amazing. Will certainly try this out.
  17. Daniel Eiszele

    Getting user's input from input box

    "Prompt" is the command that you are after.
  18. DelphiNoob

    Getting user's input from input box

    Alright. Well then is there an alternative to get an input from the user?
  19. jarto

    Bugs and Features 3.1.0.88

    Thank you. Now I can reproduce the problem. Gonna have a look.
  20. tristan

    Bugs and Features 3.1.0.88

    TabForms.zip
  21. COMFIED

    Favicon

    Thanks!
  22. lynkfs

    Favicon

    The standard generated index file in smart doesn't contain a link tag for a favicon (something like <link id="favicon" rel="icon" href="res/favicon.png" type="image/png" sizes="16x16"> However this can be added in code (or add it manually to the default.html file in the template directory, or add it to a Custom Template in the ide) In code : procedure TForm1.InitializeForm; begin inherited; // this is a good place to initialize components var link := w3_createHtmlElement('link'); link.id := 'favicon'; link.href := 'res/favicon.png'; link.rel := 'icon'; link.&type := 'image/png'; link.sizes := '16x16'; browserapi.document.getElementsByTagName('head')[0].appendChild(link); end; If you want to change the icon later on, you can do that too procedure TForm1.W3Button1Click(Sender: TObject); begin var favicon := browserapi.document.getElementById('favicon'); favicon.href := 'res/favicon2.png'; end;
  23. jarto

    Bugs and Features 3.1.0.88

    Thank you bvery much for reporting these. TabForms.zip does not contain the form sfm-files, so I can't test that bug right away. Can you manyally zip the folder so all files are included?
  24. jarto

    TW3StringGrid is available

    Thank you @tristan and @IElite Yeah, creating new culumn types is really as simple as generating the right html. Especially with images. With images you probably don't even have to override SetColumnEvents. It's mainly used with controls where the used can change the cell value, like Edit, Combo and Boolean.
  25. COMFIED

    Favicon

    Hi Is there a way to automatically add head links to a page favicon .ico in the root or res folder via code?
  26. tristan

    Bugs and Features 3.1.0.88

    Hi, Thanks for all the effort in making Smart Mobile Studio a powerful tool for pascal web development. After having a license for over a year I am finally making some effort at building a real life application. I just want to provide some feedback; I did try a quick search in the forum to avoid duplication. I believe I am testing the latest development version; however I do find it difficult to know with any certainty. Versioning Release notes in SmartUpdate have incorrect date (I think). Can you make it easier to identify the version available? SmartUpdate fails with DEVELOPMENT not available unless re-run with /changechannel /showhidden parameters IDE Import existing form. I could not find an intuitive way to import a form created from another project. Copy form into new project folder, add external, not added to Form section Switch comment (CTRL + /) will not include the last line selected Controls TabControl AnimateTabs with Forms in tabs, will cause form contents to disappear (in particular memo and stringrids) (See TabForms demo with TMemo on form3) Turning off AnimateTabs will resolve the issue. TabForms.zip
  1. Load more activity
×