Smart Mobile Studio
  • News
  • Forums
  • Download
  • Store
  • Showcases
    • Featured demos
    • The Smart Contest 2013, Round 1 – Graphics
  • Documentation
    • Get the book
    • System requirements
    • Prerequisites
    • Getting started
      • Introduction
      • Application architecture
      • The application object
      • Forms and navigation
      • Message dialogs
      • Themes and styles
    • Project types
      • Visual project
      • Game project
      • Console project
    • Layout manager
    • Networking
      • TW3HttpRequest
      • TW3JSONP
      • Loading files
  • About

Tag Archives: Smart Mobile Studio

SPNG: Be informed when values change

Posted on 08.04.2017 by Jon Lennart Posted in Developers log, News, News and articles 2 Comments

There are many new and powerful features in the upcoming release of Smart Mobile Studio (also refered to as Smart Pascal, Next Generation: SPNG in short): One of the most powerful is the ability to be notified when a value or object changes with a single line of code.

So far TVariant has just been a helper class for dealing with typical tasks. Well, perhaps not just typical because under Smart Pascal, variants can map directly to a javascript object (of any type) and allows you direct access to its prototype. The Handle property that all visual controls have is an example of this. The type TControlHandle is actually a reference to the visual element inside the DOM (document object mode). So by accessing that directly in your code, you can change styles, attributes and properties of that element. You are not bounds to only use our pre-fabricated solutions.

In the next update TVariant have a lot of new members. Two that stands out as important: watch() and unwatch().

As their name imply they will warch something for you. In this case you wil be notified whenever a single property, a whole object or indeed – a property deep within an object is altered. It may sound trivial but it’s actually one of those features that lays the foundation for responsive, data-aware controls.

But you can use it for many other things as well. For example you can now attach an event directly to a string. And whenever that string changes (either by your code, the user, or some other script) you can act on it directly. That is pretty cool and very helpful!

  // create an empty javascript object
  var MyValue: Variant := TVariant.CreateObject();

  // Set a default value
  MyValue.NewProperty := 12; // add a property and set a value

  // We want to know when the object changes
  TVariant.Watch(MyValue, "NewProperty", procedure ()
    begin
      showmessage("You changed the value!");
    end);

In this snippet we setup a javascript object and place a named-property inside that object. We then listen for changes to that property (by name even). So if you change that value further down in the code, or by calling some procedure elsewhere – the event will fire and show the message dialog.

This is of-cource just a tiny fragment of the new code that has been added, not to mention the changes and fixes. Some of these features are presently in alpha stage and is being tested. We will post more and more news in the days and weeks ahead – and we are sure you will be pleased with some the fantastic new things you can now code!

Here is an example of the new desktop and windowing applications you can write (picture below): The smart desktop!

The Smart desktop

We decided to update the uartex Media Desktop, an example initially made for touch based embedded environments – and turned it into a fully functional desktop environment!

Both the desktop itself, the filesystem, the IO drivers and windowing toolkit is written in Smart Pascal. You can create kiosk software designed to run on embedded devices, advanced applications designed to run on your intranet – or full cloud systems. So it can run a Smart application inside each Window if you like. But you have full control over windows, file access, directly listings, menu items and can sculpt both the desktop and applications to suit your needs.

The desktop can be coupled with a node.js backend that handles multi-user login and file access. It gives your users access to designated home-folders (again under your control). So each user can have their own work files just like a thin client, and each user can run different applications from a fully working desktop environment.

Below you are seeing Quake II compiled from C/C++ to LLVM bitcode. This is in turn compiled to JavaScript via asm.js. This means the browser will compile the javascript into machine code after loading. So Quake II runs at native speed, all JavaScript, inside our desktop window.

Create windowed applications with Smart Desktop

Create windowed applications with Smart Desktop

You will also be happy to head that x86 Linux and ARM kiosk distros have been created. So once happy with your desktop you can in fact boot straight into it in fullscreen. No Linux desktop or shell — just your desktop running. Both Firefox and Chrome can be used as presenter.

Have a great easter!

announcement code demo HTML5 javascript Object Pascal OP4JS release Smart Mobile Studio Upcoming features

NodeJS server programming

Posted on 26.09.2016 by Jon Lennart Posted in Developers log 3 Comments

Work is progressing at a steady pace, and one of the aspects of the new Smart Mobile Studio is how the RTL is cleverly organized into namespaces.

Now it’s to early to spill the beans on all the new stuff, but in short we reached the point where we had to make some radical changes in order for the product to grow and reach its full potential. So far our RTL has aimed at the much loved VCL/LCL component architecture. This is not going to change at all, but how things are organized just had to be dealt with at some point. The longer we wait, the harder it’s going to be to introduce new features.

Namespaces

In the new model we have a clear distinction between visual and non-visual units. Visual units (or code in general) depends on the document object model (DOM) being present. As you probably know, non-visual environments like Node.js and IO.js doesnt have a document object model. These are primarily designed to run server code. They are also used to write actual system services (specially on Linux where turning a script into a background service is easy) or command line scripts.

Add to that technologies like Cordova Phonegap and Espruino (micro controller); then hybrid systems like nodewebkit, and you probably understand how important a clear separation of concepts and code is. But im not going into the nitty gritty of this now.

NodeJS and server side programming

Smart Mobile Studio have shipped with a node.js project type for some time. It throws you in at the deep-end of JavaScript programming, with nothing but the low-level header files to work with. This is fine if you are a JavaScript guru and know node intimately. But working on the level of headers and external declarations is not really user friendly. When you need to finish a server by next week, one that scales and can be clustered (which is just so powerful that I find it hard to describe just how cool this is) – you dont want to fiddle around with header files.

Well, soon you wont have to! In fact, as of writing I’m testing the first server type (http) and it’s performing brilliantly. Its a pleasure to write this part of the RTL !

Nodejs rocks! And with Smart Pascal, it rocks even more!

Nodejs rocks! And with Smart Pascal, it rocks even more!

A simple Node.js server

So, what does the most basic node.js web service look like? It’s almost to easy:

  var server := TNJHTTPServer.Create;
  Server.Port:=80;
  Server.OnAfterServerStarted:= procedure (sender: TObject)
    begin
      console.log("Server has started, listening on port:" + TNJHTTPServer(Sender).Port.toString);
    end;

  Server.OnRequest := procedure (Sender: TObject;
      const Request: TNJHttpRequest;
      const Response: TNJHttpResponse)
    begin
      console.log("-------------");
      console.log("Handling request:");
      console.log(request.Method);
      console.log(request.Url);
      console.log(request.Socket.remoteAddress);
      console.log("Listing headers:");
      for var x:=1 to request.headers.count do
      begin
        console.log(request.headers.Items[x-1]);
      end;
      console.log("-- OK");
      var LText:= "Your headers are:" + #13
        + Request.Headers.ToJSON() + #13
        + "All done.";
      response.end(Ltext);
    end;

  server.Start;

And that’s just one type of server. The really exciting stuff is when you dig into websocket and use socket.io to design your protocols (and clustering!). You can even setup events on both sides that trigger on spesific message types. Forget about heavy duty threading models — all of that is done for you. All you have to do is write the actual service.

Benefits of Node.js

Hosting node services costs next to nothing. Hosting providers are a dime a dozen and you can forget about those nifty prices you normally pay for pure executables (like under Delphi or Lazarus). So there is a huge financial aspect to take into consideration here as well, not just technical jargon. Node services can be moved, they are platform independent and couldnt care less if you use Linux or Windows, Amazon or Azure: as long as node is installed your good to go!

And last but not least: inter-communicating with existing services that are modern, and delivering solutions to your customers that talk JavaScript, Delphi, C++, C# or whatever their preference may be.

So good times ahead!

Cordova HTML5 javascript node.js nodejs rtl Smart Mobile Studio socket.io

That installer thing

Posted on 23.09.2016 by Jon Lennart Posted in Developers log

Smart Mobile Studio can be downloaded as a traditional installer-file for Microsoft Windows. This works quite well, especially when doing a clean install, and it would be very odd not to provide an installer in 2016.

However, we do get feedback from people that experience problems with this. Not the installer itself, but rather when they update their system by just installing on-top of an older installation, things become problematic. In short: depending on just how old that installation is, it can be plain sailing or a frustrating experience.

In newer versions of SMS you dont need to download a new installer

In newer versions of SMS you dont need to download a new installer

A while back we introduced the concept of “live updates”. In short Smart Mobile Studio ships with an automatic update application that makes sure you have the latest executables, the latest RTL and that your libraries are always fresh off the mint. Each version of Smart has its own channel inside the update program. The value of such a system is naturally that you dont have to keep on downloading installers, punch in the serial number – or that we accidentally overwrite or delete your own library files. The updater will only deal with the files known to it’s RTL, and leave your work in peace.

File IO is not just write and forget

Windows abound

Windows abound

Windows is not what it used to be. I personally think Windows has embraced the concept of users, access rights and credentials quite well (although Windows Vista made me leave the platform for Ubuntu Linux for a while). But all in all, Windows 7, 8 and 10 are a joy to use.

However, writing an installer that should be compatible with the majority of Windows systems (as many as possible) is not actually straight forward.  There are still things like credentials, roaming and non-roaming profiles, read/write rights, elevated users and functionality requiring admin notification (not to mention access bits on the filesystem itself); So a Windows box in Indonesia is not nessacarily identical to a Windows box in north America.

Microsoft have clear cut rules established for what paths to use when installing software. Smart Mobile Studio follows those rules always, but just because you follow the rules, doesnt mean that the user’s credentials (which propagate into everything he/she does) allows you to write all the files. This is where elevation comes in; Something that is finally easier to deal with in Delphi, the compiler we use to make Smart Mobile Studio.

We have seen people try to install Smart Mobile on thin clients and chrome-books, on roaming profiles in a corporate environment to their old Windows 98 machine. To make a long story short: modern Windows can be configured to be just about anything, and when installing a development platform you really need a normal PC without those restrictions. A developer machine.

Older installations

One of the biggest problems we have had and something that is topping our “how to” question chart, is when they have an ancient version of Smart Mobile Studio on their harddisk (anything from the first beta through version 2.0). This was before we added the automatic update program, and more importantly — the preferences files and dll files have since been utterly re-designed.

So they install the new version thinking it will replace some 3-4 year old install. But fact is, the installer will not overwrite the preferences file, and in many cases its not allowed to delete/replace the dll files. The old software prior to the update program must be manually un-installed through Windows before you install a more modern version (!)

What typically happens is that the old preferences file is left lingering on the system, the new executable tries to read it but finds none of the values it expects. This causes conflicts inside SMS, the server in particular is sensitive to this (which will be made more robust). This is not critical stuff, but annoying.

Using an old preferences file on a new exe will cause problems

Using an old preferences file on a new exe will cause problems, this is a typical stacktrace

The secondly, more critical, is when the older DLL files for the webkit rendering engine is left to linger. That means the header-files we use to talk with the DLL files wont match, causing a serious and show-stopping exception.

Again, manually uninstall the older version first. Then go into your “program files” folder and make sure to delete it completely. Same goes for “program data” (or appdata local or roaming). And last but not least, “user data” where library units, the RTL and various other tidbits are stored.

Using the update program

If you have a newer version you really dont need to download and use the installer. Simply start the update program and it will download the latest files. But its vital to remember that if you have made manual changes to the RTL files (which technically you shouldnt, but we dont mind as long as you stick to the license agreement for copying) – the update program will overwrite those files.

The point of the update program is to make sure the RTL, libraries, shims and IDE executable is the latest. It wont touch files that doesnt belong to SMS.

HTML5 Installer Object Pascal OP4JS Smart Mobile Studio

Events as objects

Posted on 18.01.2016 by Jon Lennart Posted in Developers log 5 Comments

Events are fun right? Well, only in part to be honest. For example, what do you do if you want to catch the same event but at different places?

This is where JavaScript’s addEventListener() comes into play. In short it allows you to add as many event-handlers to the same event as your heart desires. But raw unadulterated JavaScript is a bit of a mess, so I decided to wrap this up in clear cut objects. Oh, and I added a “fixed” event for when you want to have objects for standard events as well.

So now whenever you want to hook an event without ruining your published event-handlers (for instance in TW3CustomControl) you can just use one of these 🙂

Enjoy!

unit eventobjs;

interface

uses 
  w3c.dom,
  SmartCL.Components,
  SmartCL.System;

type


  TEventObjTriggeredEvent = procedure (sender:TObject;EventObj:JEvent);

  TEventObj = class(TObject)
  private
    FOwner:     TW3TagObj;
    FAttached:  Boolean;
    FEventName: String;
  protected
    procedure   HandleEvent(eobj:variant);virtual;
  public
    Property    Attached:Boolean read FAttached;
    procedure   Attach(EventName:String);
    procedure   Detach;
    constructor Create(AOwner:TW3TagObj);virtual;
    destructor  Destroy;Override;
  public
    Property    EventName:String read FEventName;
    Property    Owner:TW3TagObj read FOwner;
    Property    OnEvent: TEventObjTriggeredEvent;
  end;

  TFixedEventObj = class(TObject)
  protected
    FAttached:  Boolean;
    FOwner:     TW3TagObj;
    procedure   HandleEvent(eobj:variant);virtual;
  protected
    function    DoGetEventName:String;virtual;abstract;
  public
    Property    Attached:Boolean read FAttached;
    procedure   Attach;
    procedure   Detach;
    constructor Create(AOwner:TW3TagObj);virtual;
    destructor  Destroy;override;
  public
    Property    Owner:TW3TagObj read FOwner;
    Property    OnEvent: TEventObjTriggeredEvent;
  end;

  TElementRemovedEvent = class(TFixedEventObj)
  protected
    function  DoGetEventName:String;override;
  end;

  TElementAddedEvent = class(TFixedEventObj)
  protected
    function  DoGetEventName:String;override;
  end;

implementation


//#############################################################################
// TElementAddedEvent
//#############################################################################

function TElementAddedEvent.DoGetEventName:String;
begin
  result := "DOMNodeInserted";
end;

//#############################################################################
// TElementRemovedEvent
//#############################################################################

function TElementRemovedEvent.DoGetEventName:String;
begin
  result := "DOMNodeRemoved";
end;

//#############################################################################
// TFixedEventObj
//#############################################################################

constructor TFixedEventObj.Create(AOwner:TW3TagObj);
begin
  inherited Create;
  FOwner:=AOwner;
  Attach;
end;

destructor TFixedEventObj.Destroy;
begin
  Detach;
  inherited;
end;

procedure TFixedEventObj.Attach;
begin
  if FAttached then
  Detach;
  FOwner.Handle.addEventListener(DoGetEventName,@HandleEvent,true);
  FAttached := true;
end;

procedure TFixedEventObj.Detach;
begin
  if FAttached then
  begin
    FOwner.Handle.removeEventListener(DoGetEventName,@HandleEvent,true);
    FAttached := false;
  end;
end;

procedure TFixedEventObj.HandleEvent(eObj:variant);
begin
  if assigned(OnEvent) then
  OnEvent(self, JEvent(eObj));
end;

//#############################################################################
// TEventObj
//#############################################################################

constructor TEventObj.Create(AOwner:TW3TagObj);
begin
  inherited Create;
  FOwner := AOwner;
end;

destructor TEventObj.Destroy;
begin
  if FAttached then
  Detach;
  inherited;
end;

procedure TEventObj.HandleEvent(eobj:variant);
begin
  if assigned(OnEvent) then
  OnEvent(self,JEvent(eObj));
end;

procedure TEventObj.Attach(EventName:String);
begin
  if FAttached then
  Detach;

  FEventName := EventName;
  try
    FOwner.handle.addEventListener(FEventName,@HandleEvent,true);
  except
    FEventname:= '';
    FAttached:=false;
    exit;
  end;
  FAttached:=true;
end;

procedure TEventObj.Detach;
begin
  if FAttached then
  begin
    try
      FOwner.handle.removeEventListener(FEventName,@HandleEvent,true);
    finally
      FEventName := '';
      FAttached := false;
    end;
  end;
end;

end.
code events HTML5 javascript Object Pascal OP4JS Pascal Smart Mobile Studio w3C

Telling a 32bit float from a 64bit float

Posted on 16.01.2016 by Jon Lennart Posted in Developers log 2 Comments

The RTL is getting a bit of attention these days, with plenty of visual effects, tweens and more being added to it. It’s easy to forget that sometimes even the smallest things can be of utmost importance. Like how to tell a single from a double via code!

As you may have noticed, Smart Mobile suddenly got support for streams, memory allocation and the ability to manipulate data on byte and bit level. This may sound trivial but it actually changes how we write and deal with data completely. Under vanilla JavaScript working with bits and bytes can be a huge problem. Most JS developers shun native, raw data like the plauge – because they cant do much with it. Well, thats not going to be a problem for us! Buffers, streams, memory allocation, move, copy — easy as apple pie 🙂

Effect Virtual Machine

Amos Basic 2d and 3d

Amos Basic 2d and 3d

Today I was fiddling with a “mini language” module I have been working on. Actually it’s an effect module that allows you to script and compile effect logic in smart pascal itself, so almost like a second language. If you ever played around with Amos Basic on the Amiga home computer back in the 90’s, you may remember that Amos had a secondary animation language? Well, on that old computer sprites and animation was interrupt based (just think threads if you dont have any idea what hardware interrupts are). This allowed the creator of Amos Basic, Francois Lionet, to add a really cool animation language which was executed in the background — allowing your main program to run in parallell to your animation code.

I dont know how many months and years I spent coding Amos and BlitzBasic in my teens, but let’s just say it was A LOT! Francois Lionet and Mark Sibly, the author of BlitzBasic and the Blitz compiler chain were my absolute childhood heroes.

Well, that animation language (but better naturally) is in effect what I am hoping to achieve with my little virtual machine. I really want it to be super-easy to create awesome effects, and I want it to be fast, flicker free and smooth as a baby’s bottom. So a mini bytecode system seems like just the ticket to get that working – and naturally it’s written in smart itself, so you can play around with it when it’s done.

But back to the problem: I had to extend the TReader and TWriter class with the abillity to handle variant datatypes. This also meant adding “word” as a new RTL datatype to handle those 16 bit values. And last but not least — detecting the difference between 32 and 64 bit floating points.

I mean, if you get that wrong it’s going to cause havoc!

CodeSeg and DataSeg

In a bytecode virtual machine like, say, Java or CLR (common language runtime, .NET style) your compiler have to deal with two different things: code and data. One thing is variables (both global and local), but what about constants? Whenever you pass a fixed value to a procedure, that value is actually a constant. It doesnt change and it will be compiled with your program. Well this is where the compiler get’s smart and picks that up, and the value is stored in a special list. So when the program runs, it will fetch that constant from storage and use it. Or, in case of the CLR, it will be compiled directly into the bytecode if it’s an intrinsic value (long story).

Bytecode galore

Bytecode galore

As you probably guess, that’s called a dataseg (data segment), which is different from a codeseg, where the opcode and “asm” is stored.

So thats when i suddenly realized: we have no function in the RTL to tell the difference between a 32bit float and a 64bit float !

Well here is one way of telling the difference. It’s already incorporated into the Read/Write variant, which are functions I added to TReader and TWriter. So you dont have to worry about it. But for those that have (for some odd reason) been looking for this — here it is:

 function IsFloat32(const x:variant):Boolean;
 begin
  asm
  @result = isFinite(@x) && @x == Math.fround(@x);
  end;
 end;

Not much is it? But yet so important.

HTML5 javascript Object Pascal Smart Mobile Studio

Smart Mobile Studio 2.0

Posted on 09.12.2013 by Smart Mobile Studio Team Posted in Developers log, News 3 Comments

This is a list of all changes since the last official release (1.1.2).

Compiler

New functionality

  • Added command line compiler smsc.
  • Added support for external variables and external class variables.
  • Scriptable HTML templates and CSS scripts.
  • CSS is compressed during compilation.
  • New ways to include an external resource:
    • {$R ‘resource.js’} or {$R ‘file:resource.js’} will copy the resource to the ‘res’ folder during compilation and link it into the program (‘<script>’ statement will be generated in the HTML code or ‘require’ will be generated for NodeJS code).
    • {$R ‘http://server/path/script.js’} or {$R ‘https://server/path/script.js’} will just link the code to the program without copying anything.
    • You can specify MIME type for the resource by prefixing it to the resource name: {$R ‘text/javascript:http://server/path/file.php’}. If the MIME type is not provided, it will be generated automatically from the extension part of the resource name.
  • Compiled program is stored in a ‘www’ subfolder (previously it was stored in a ‘bin’ subfolder).

Improved functionality

  • Improved codegen for static and static sealed classes.
  • Improved codegen for “new JObject”.

Bugs fixed

  • Fixed various codegen problems related to constant arrays, external classes and nested records.

RTL

New functionality

  • Added support for the Espruino microcontroller.
  • Added wrappers for JavaScript functions prompt() and confirm().
  • Added support for Android Home Screen applications (http://www.delphitools.info/2013/10/16/chrome-web-apps-in-android/).
  • Added TMetronome class (http://www.delphitools.info/2013/10/18/time-stepping-for-games-and-simulations/).
  • New units: w3WebWorker, w3c.WebSpeechAPI, Chrome.Serial, Firefox\Bluetooth.
  • Added methods to the w3colors unit.

Improved functionality

  • Redesigned (faster) GameView.
  • Improved TW3Button with ‘pressed’ state.
  • More IE shims.
  • Improved W3Effects.
  • Improved ColorToWebStr.
  • Improved TW3BufferedImage.SetSize.
  • Improved compiler messages window.

Bugs fixed

  • Fixed System.Diagnostics performance timer fallback (for Safari).
  • Fixed HSL delta methods in w3colors.

IDE

New functionality

  • New visual designer.
  • New component package manager.
  • New project file format, incompatible with older Smart versions. Projects are now stored with a .sproj extension and forms with a .sfm extension.
  • New, XML-based preferences file (preferences.xml) replaced INI-based file (preferences.ini).
  • Added NodeJS and WebWorkers project types.
  • Added tool that creates DataSnap service connector (Delphi Enterprise must be installed on the same computer).
  • Build automation with build scripts.
  • Source maps.
  • Lines/blocks can be moved up/down with Alt+Shift+Up/Down.
  • Internal browser allows taking screenshot of the running application.
  • Configuration option “Save projects before compilation”.
  • A project can be compiled and run even if it was never saved.
  • Implemented Open, Save, Save As, Save Project As.
  • Metadata information can be set for a project.
  • IDE state related to the project (open tabs, top line, bookmarks) is stored in the <projectname>.dsk file and is restored when a project is open.
  • Redesigned template (HTML and CSS) handling.
  • Ctrl+click ‘link’ highlighting.
  • Source code change bar to indicate changes (original, modified, saved).
  • Default project options for each project type can be configured.
  • Added compilation options ‘Automatically refresh in browser’ and ‘Handle uncaught exceptions’.
  • Added support for defining conditional compilation symbols on a project level.
  • Redesigned ‘run’ experience (http://smartmobilestudio.com/2013/10/12/new-ways-to-run-a-project/).

Improved functionality

  • Project title can contain spaces.
  • Custom HTML & CSS code is now separated from general resources
  • Better structure of project options (removed dead settings)
  • Application adapts to low-resolution displays.
  • Improved HTML highlighter, now supports embedded JavaScript, DWS, and CSS.
  • Dotted unit names are supported.
  • Snippets are stored in a separate folder, one snippet per file.
  • Redesigned server/internal browser forms and execution options.
  • Added shortcuts to toggle Compiler Messages and Mini Map visibility.
  • Improved renaming of units.

Bugs fixed

  • Code completion works in .spr files.
  • Highlighter preview (in Preferences) uses currently selected editor font.
  • Configured editor font is correctly displayed when Preview dialog is open.

Removed functionality

  • Compact toolbar.
  • Exit button in the toolbar.
  • Removed ‘Visual components project (New Project Script Demo)’ project type.

Other

New functionality

  • New demos: eSpeak, TransitionEffects, Complex Numbers.
  • Added touch and acceleration support to the “Box2D Demo” project.

Changed

  • Renamed some demos (removed ‘by XXXX’).

Removed

  • Removed demo “Box2D Integration”.
new Smart Mobile Studio Version 2.0

Smart Mobile Studio v2.0 (beta)

Posted on 06.12.2013 by Smart Mobile Studio Team Posted in Developers log, News

Version 2.0 of Smart Mobile Studio will soon be ready for the release.

Over the last few days, we have distributed a private beta to some selected users, and now we would like to make this available for everyone.

We know you have been waiting for this – and so have we!

Download the installer and follow the instructions.

We hope you’ll be as excited about this release as we are 🙂

—
Sincerely,
The Smart Mobile Studio Team

beta release Smart Mobile Studio Version 2.0

Smart Mobile Studio 1.1.2 (beta-2)

Posted on 27.07.2013 by Smart Mobile Studio Team Posted in Developers log

We have received lots of useful feedback from the first beta-version of v1.1.2 (build 13).
We have fixed these issues in a new beta-version.

News in 1.1.2.14

These are the changes from beta-1 (v1.1.2.13):

  • Snippets will not be overwritten during installation.
  • Existing RTL files and Library files are backed up with a date-time stamp.
  • RTL index gets rebuild autmatically.
  • Cleanup in css-files.
  • CD out of the project folder when a project is closed.
  • ‘Rename Unit’ works again.

Download/installation

Download the installer, (link removed, since new version is available) and install as normal.

Known issues

We have one more issue we would like to fix before we release this version. That’s a compiler bug we discovered in the last minute.
If you write this Smart code:
[code]
Round(1 / (r / 10));
[/code]

It will be compiled to this JavaScript code:
[code]
Math.round(1/r$4/10);
[/code]
which is equal to “Round((1 / r) / 10);”

The workaround is to use a temp variable for “(r / 10)”.
[code]
var
tmp: Real;
begin
tmp := (r / 10);
Result := Round(1 / tmp);
end;
[/code]

—
Sincerely,
The Smart Mobile Studio Team

beta release Smart Mobile Studio

Smart Mobile Studio 1.1.2 beta

Posted on 03.07.2013 by Smart Mobile Studio Team Posted in Developers log, Documentation, News 2 Comments

Just before the first round of summer holidays we managed to put together a beta version of the next Smart Mobile Studio, version 1.1.2. Installer is available on the download page (link removed, since beta 2 is ready).

Installation

In case you are using the snippets functionality of the Smart Mobile Studio, you should first make a backup copy of the snippets file, because the installer will silently overwrite it with a fresh version. (Yes, this is a bug. Yes, we will fix it.) Navigate to Documents, Smart Mobile Projects and make a copy of the snippets.xml file (in another folder). Restore it after the installation.

Before the installation you should check that SmartMS.exe process is not present in the memory. Due to a bug in the 1.1.1 version, closing Smart Mobile Studio sometimes left SmartMS.exe process active in memory and that would prevent the new version from being installed. Just run Task Manager and kill any SmartMS.exe you can find (or reboot the computer, that would also work).

SmartMS

If you are upgrading an existing installation, please run Tools, Rebuild RTL Index the first time you start Smart Mobile Studio. This should be done automatically on the first run but we made a mistake preparing the installer and this step is skipped. It will be fixed in the real 1.1.2 release.

Changes

The focus of this release was mainly on fixing old bugs and making everying run smooth. We did, however, add some useful new features.

As you’ll probably notice looking at the changelist below, we didn’t fix most of the problems with the form designer. The reason for this is that we’re working on a completely new designer which will be included in the 1.2 release (expected to be released in autumn).

Compiler

New functionality

  • Compiler now supports the “in” operator to check if a string contains another string.
  • Added a bunch of built-in helpers/aliases for types String, Integer, Float and Boolean. (Full list can be found in the DWScript documentation.)
  • Helpers can operate directly on in-line constants. For example, now you can write “hello”.Reverse (which would return “olleh”).
  • “For in” syntax can be used on variants (for var s in someVariant do …). This allows enumerating members of a raw JavaScript objects.
  • “For in” syntax can be used on sets (for var el in someSet do …).
  • Dynamic arrays now have a “sort” method which takes a comparison function; that maps directly to JavaScript array sort method. String, Integer and Float arrays also implement a “sort” method without a parameter which sorts the array in the natural order.
  • Dynamic arrays now have a “map” method which maps directly to the JavaScript map method.
  • Conditional compilation symbol DWSCRIPT is always defined.
  • Added CompilerVersion constant. It holds a floating point value that holds the compiler version in language terms under the form YYYYMMDD.XX, with XX the minor version. This will be updated each time the language changes.
  • Added ability to mark all named types as deprecated (just postfix with deprecated “optional message”), this means among other things that (unlike in Delphi) classes and records can be marked as deprecated.
  • Added limited support for sets.
    • Only sets of enumerations are supported.
    • Only in operator is supported.
    • Compiler supports Include and Exclude methods, which can be used in two ways, either as “Include(mySet, value)” or as “mySet.Include(value)”.

Improved functionality

  • Better code completion hints on array elements.
  • Functions and methods can be marked inline. This is implemented only for Delphi compatibility; inline is ignored in the compiler.
  • “For x in string” loops now accept “break” and “continue” statements.

RTL

New functionality

  • Unhandled exceptions in console applications are caught and logged to the console window.
  • Added w3_prompt function which maps to the JavaScript prompt command.

Improved functionality

  • W3Effects unit supports FireFox.

Bugs fixed

  • A toolbar button glyph is displayed even if the button caption is empty.
  • TW3CustomStorage.getKeyInt tries to convert string data back to the integer form; only if that fails it returns the default value.
  • TW3Label appearance changes when it is disabled.
  • TW3CheckBox is fully disabled when the Enabled property is set to False.

IDE

New functionality

  • Forms and units can be stored in external files by default (Preferences, Store new forms and units in external files).
  • Position and size of the Smart Mobile Studio is remembered between sessions.
  • Open tabs, editor bookmarks and active tab are stored in the project (.opp) file and are restored when the project is open.
  • Project file (.opp) uses CDATA for form/unit storage to be more version control-friendly.
  • When a file is modified outside the Smart Mobile Studio environment, a prompt will ask the user to reload the file. A built-in “difference” engine can be used to show changes between the editor and disk file. External program (such as WinMerge or Beyond Compare) can be configured and used instead of the internal one.

Improved functionality

  • When a built-in server is used to serve the application files, address in the Serving link can be changed to any of computer’s internal addresses.
  • Name of the open project is shown in the window title.
  • Screen resolution list in Preferences, Layout can be sorted manually.
  • Units and forms can be deleted from the project by pressing the Del key when a unit/form node is selected in the Project Browser.
  • Ctrl+Click on an identifier jumps to the beginning of the row.
  • Ctrl+Click on an identifier scrolls the target to the middle of the screen.
  • Better performance when many JavaScript messages are logged to the console log window in the integrated browser.
  • Add Form/Add Unit commands prompt for the new form/unit name.
  • Search centers the result in the text editor.
  • Ctrl+/ removes comment markers that are preceeded by whitespace.
  • Scroll past EOF setting is enabled on a new install.
  • Improved highlighter configuration. All elements (strings, numbers, reserved words …) can now be configured separately for different file types (pascal, javascript …). Highlighter settings can be stored in a file.
  • New examples.

Bugs fixed

  • Edited data is not lost anymore if you click on the form designer while editing data in the property inspector.
  • A text containing single quotes can be now entered into the Caption and Text properties in the property inspector.
  • Right-clicking in the project browser works as expected.
  • Shortcuts (Ctrl+C, Ctrl+X, Ctrl+V, Del) on the Design tab are now working correctly.
  • Form and unit renaming corrected.
  • Del key works in the Search & Replace dialog.
  • Search & Replace works correctly when Case-sensitive checkbox is not checked and the found text doesn’t match case-sensitively.

—
Sincerely,
Primož Gabrijelčič, product manager

beta release Smart Mobile Studio

Smart Mobile Studio 1.1 RC (build 1.1.0.400)

Posted on 15.02.2013 by Smart Mobile Studio Team Posted in News

We are very proud to present the release candidate for Smart Mobile Studio version 1.1  (build number v1.1.0.400). If you would like to give this groundbreaking product a test drive before we officially release it, then you can download the installer directly from SmartMobileStudio.com/download/setup_v1_1_0_400_rc.exe


(The context menu is replaced with Ctrl+Shift+R (start/stop recording) and Ctrl+Shift+P (replay the recorded macro).

We have done a lot of improvements in the IDE, the editor, the RTL and the Smart Pascal language. Below is a list of some of the improvements that have been done since version 1.0 (see full manifest of changes for beta 1 here).

IDE changes

  • Added: Support for external form files
  • Added: Navigate to ancestor from class-browser
  • Added: Components are now organized in more tabs
  • Added: RTL source proxy, speeds up compilation and dependency chain
  • Added: Syntax hints and improved code insight
  • Added: The IDE now uses threading to handle background compilation
  • Added: Dependencies for controls are automatically added to the uses clause
  • Fixed: Resizer bugs for nested controls
  • Fixed: Scrolling issue fixed ([CTRL] + [Up]/[Down])
  • Fixed: Disabled unit structure flickering
  • Fixed: LineCount issue
  • Fixed: Case fix for strict hints
  • Fixed: A label “mistake” in the baseframe (it was renamed further up the chain).
  • Fixed: modified [CTRL]+/ to work the same as in Delphi:
    • if a single line is changed, caret is moved to the next line (current column is preserved)
    • if multiple lines are selected, comment is toggled for the whole block and caret is move to the line following the block (current column is set to 1)
    • modification is placed into the undo buffer so that it can be undone
  • Altered: [CTRL]+[/] is replaced by [CTRL]+[#] for systems where [/] is only accessible via [SHIFT]
  • Altered: Minor changes on compiler output (bulk output of errors, warnings and hints).
  • Altered: Search and replace dialog remembers the last states
  • Altered: improved code proposal (insert item highlight)
  • Altered: dialogs are centered
  • Altered: Recent file on welcome tab now supports to show unlimited entries if desired (by default limited to 10 items)
  • Added: Pascal “Gabelou” StyleCop (see prefrences->misc. to enable it).
  • Added: Rename refactoring (including closed files)
  • Added ‘Format Keywords’ action (see popup menu), which translates all keywords to lowercase.
  • Added: Simplified BrowserAPI
  • Added: possibility to filter log messages from the console output (filtered ‘event.layerX and event.layerY are broken and deprecated …’ by default). Select a certain text to filter and right click -> Ignore Message to filter out all messages containing this particular string. The filter will be resetted on restart.

RTL

  • Updated: Remobjects headers
  • Updated: WebGL headers
  • Updated: Sprite3d
  • Added: DrawTo, DrawPart and misc CODEF functions added to TW3Canvas
  • Added: TW3Progressbar control
  • Added: TW3ListBox control
  • Added: Unit for complex numbers (w3complex.pas)
  • Minor formating and added overload function for CreateImageData
  • Added fast sequential read text file loaders
  • Applied the new ‘Format Keywords’ to the remaining RTL files
  • Removed duplicate & tweaked hash function
  • Improved hashing function
  • dialogs need custom initialization
    • modal dialog support integrated into TW3CustomApplication (ShowModal, HideModal)
    • modal dialog is re-centered if application is resized (for example when orientation of a mobile device changes)
    • added  TW3CustomApplication.CreateOpaqueMask
    • TW3CustomControl.getMaxZIndex is now public
    • modal dialogs triggered from modal dialogs are now supported
  • Fixed: zIndex issues with modal dialogs
  • Fixed: opaque layer has high z-index to cover all controls on the form
  • Fixed: SendToBack
  • Altered: dialogs are centered on the form
  • Altered: event handlers are only called when assigned
  • Altered: W3ModalDialog made external for easier reuse
  • Altered: updated Remobjects interface
  • Altered: Changed default Mouse event X,Y coordinates
  • Added: W3ModalDialog uses opaque div to block owner form (tnx to Eric)
  • Added: PixelRatio info
  • Added TVariant.Properties + OwnProperties
  • Added HorzLine/VertLine
  • Added: New FillRectF/StrokeRectF overloads
  • Added: TW3CustomApplication.FormByName, TW3Component.ChildByName, TW3Component.EnumChildrenAltered: SetSize now virtual
  • Added: PhoneGapAPI is now complete

COMPILER

  • Added: Support for RTTI (!)
  • Added: Support for property expressions
  • Added: Support for interface expressions
  • Fixed: Case fixes for strict mode
  • Fixed: an issue where compiler would accept method implementations in a different unit the class was declared
  • Fixed: Lambdas don’t have a “var”/”const”/etc. section
  • Fixed: issue with invalid symbol table in suggestions in case of fatal error in a lambda
  • Fixed: SymbolDictionary bug for forwarded overloaded methods
  • Fixed: calling overloaded inherited constructors
  • Fixed: codegen for assignments of a function’s result to a var param
  • Fixed: timestamp is now up to date
  • Updated: now uses latest compiler core
  • Updated: tokenizer updated to latest revision
  • Altered: Compile speed optimizations
  • Added: Missing semi-colon no longer a stopping error
  • Added: JSON to reserved names
  • Added: JSON static class
  • Added: Preparation for source maps

DEMOS

  • Fixed: style bug in smartflow
  • Fixed: bug in spartacus
  • Fixed: bug in box2d wrapper
  • Altered: Tested all demos (with exception of gyro). All demos now compile.
  • Altered: formatting of Archimedes Spiral
  • Added: frames demo
  • Added: modal dialog example

Sincerely,
Jon Lennart Aasenden
—
The Smart Mobile Studio Team

Android announcement Apple candidate compiler CSS HTML5 javascript Object Pascal OP4JS Pascal release Smart Mobile Studio w3C webkit

Smart Contest 2013 – Round #1

Posted on 01.02.2013 by Smart Mobile Studio Team Posted in Developers log, News

February is upon us and so is our announced graphics competition! This is the first competition out of four this year. So this is your chance to win some exciting prices by showing off your Object Pascal skills!

The topic of this round is: graphics programming (eg. demo-scene, fractal art, visualizations etc).

The rules are as follows:

  • Registration before the 10th of February (registration at contest@smartmobilestudio.com)
  • Deliver your contribution before 1st of March
  • Games are not accepted this round (that’s scheduled for a later date)
  • User interaction is allowed (but not mandatory)
  • Porting of retro demos is allowed (providing it is a clean rewrite)
  • JavaScript snippets are allowed (within limits)

Fractal art

Fractal art

Demos

Demoscene

Prizes

First prize is a tablet device of your own choice (up to USD 750). So have your pick between

  • iPhone
  • iPad
  • iPad mini
  • Windows Tablet
  • Windows phone
  • Android tablet or phone

Judges

Primož Gabrijelčič

Developer of the popular omnithread library, author of the Smart Mobile Studio Bible, contributor to the Smart Mobile Studio IDE and RTL, and dedicated object pascal speaker and innovator

Christian Budde

Developer of various open source projects. Among these, the popular Delphi ASIO & VST Project for professional audio related development. Another focus of his work is Graphics, which is reflected in projects such as the modernized AggPas implementation, an independent object pascal png library and a native object pascal interface to TrueType fonts (called PascalType). He is also contributor and maintainer of  Graphics32.

Currently he is working on the Smart Mobile Studio IDE and RTL.

Delivery

All contributions must be delivered in full source and binary with no missing pieces. The project must compile on the current version of Smart Mobile Studio (1.1 branch).

Happy coding!

Android announcement Apple competition delphi demo graphics iPad javascript Object Pascal OP4JS Prices Smart Contest 2013 Smart Mobile Studio Windows Tablet

Updated roadmap

Posted on 04.01.2013 by Smart Mobile Studio Team Posted in News 3 Comments

We are proud to present our roadmap for 2013, with the goals we have set out to achieve and the technologies we are going to build. Due to unforeseen circumstances – some of the technologies that were planned for 2012 have been pushed ahead into 2013, there have also been significant shifts in the world of browser technologies that have made some of our plans redundant (“native” webservice support is one feature, which is now covered by node.js).
Continue reading→

announcement roadmap Smart Mobile Studio

Only days left

Posted on 11.05.2012 by Jon Lennart Posted in News 17 Comments
Only days to go

Only days to go

It is now only a matter of days before Smart Mobile Studio 1.0 goes on sale. It marks the end of a one year journey for us to create something completely new for the object pascal community, written in nothing but Delphi itself. But while the journey from idea to realization is over, the next stage of Smart technology is about to begin – and it’s going to be big. Really big.

In this our first release, focus has been on providing you with a solid foundation. A visual javascript component library (VJL) with identical parent/child relationship to what you are already familiar with. An integrated development environment with essential functionality including a component palette. And last but not least, a mock form designer with live rendering of the actual HTML5.

As we move ahead each aspect of the formula will be expanded, strengthened and refined. And while we cant blow the whistle just yet, we have something very exciting in our labs that is going to change everything. Forever.

This is quite possibly the most significant Pascal
development to be watching right now, and brings
the wonderful Pascal language to the world of
Internet development! -Simon Stuart, Delphi developer via Google+

FireFox HTML5 javascript Mozilla OP4JS Safari Safari Mobile Smart Mobile Studio webkit

What is new in community beta 2?

Posted on 25.04.2012 by Jon Lennart Posted in News 4 Comments

Below are some of the new features that has been added to Smart Mobile Studio community beta II. We hope you find our efforts in creating this product,a product that is both unique, innovative and extremely powerful, useful and interesting. Our customers can look forward to gestures, databases, even better browser support, Phone-Gap support and (last but not least) WebGL. We also aim for tight integration with classical Delphi server technology, like the Remobjects remoting framework and the C# websocket hub.
Continue reading→

C# fpc Free Pascal HTML5 javascript JS mono Object Pascal OP4JS Remobjects Smart Mobile Studio WebSocket

Global rename function

Posted on 17.02.2012 by Jon Lennart Posted in Developers log, News and articles 6 Comments
Global rename done

Global rename done

Being able to rename a unit via the project treeview is commonplace in mid to high range editors today. There are a lot of javascript editors out there, some more evolved than others – but the number of object pascal editors is sadly very limited. You have Delphi of-course which is great (and the most advanced object pascal editor on the marked), then there is Lazarus which is the free and open version written in freepascal – and while there are other alternatives, none of them even comes close to the original “Delphi” look and feel.

Believe it or not but this time Smart Mobile Studio actually got something Delphi doesn’t (Delphi 7 was our initial model): global renaming. When you rename a unit under Smart, it doesn’t just alter the source-code for the unit in question – it alters all references to that unit in the entire project. No need to backtrack and update the uses declaration elsewhere, they are all changed in a single sweep.

We can actually map the use of a class or method throughout a whole project, and it’s super quick as well!

Database mapped RTL

But we have more tricks up our sleeve. I took the time to make a recursive database indexer for our RTL files. So the first time you run Smart it will parse and extract every inch of information about the RTL and store it in a database table. This table is kept in memory and used to speedup extraction of data regarding classes, methods and properties.

It also has the benefit of giving me instant access to things like class ancestors, data types, fields, scope, interfaces and all those tiresome look-up chores that makes a mess of a codebase. So armed with a TClientDataset map (what did you expect? No self respecting Delphi app is complete without at least one instance of TClientDataset) of the RTL, it is now super easy to beef up and compliment the compiler. On top of my head here are a few things i’m gunning for:

  • Complete class at cursor
  • Rename class at cursor
  • Add interface to class
  • Merge classes
  • Support for documentation remarks above methods
  • Mouse-over information about symbols

I doubt we will be able to stuff all the goodies into version 1 of Smart Mobile Studio, but rest assured that I will do my best to get as much features into Smart as I can.

Globals

And now that the indexing and background compile is up to speed, the time has come to finish the globals feature. Globals allows you to edit a list of object (of any class) that should be created automatically by TApplication. Very handy if you have a database connection or some game logic you want to be created on startup.

These are exciting days!

Smart Mobile Studio Upcoming features

Pages

  • About
  • Feature Matrix
  • Forums
  • News
  • Release History
  • Download
  • Showcases
    • The Smart Contest 2013, Round 1 – Graphics
  • Store
  • Documentation
    • Creating your own controls
    • Debugging, exceptions and error handling
    • Differences between Delphi and Smart
    • Get the book
    • Getting started
      • Introduction
      • Local storage, session storage and global storage
      • Application architecture
      • The application object
      • Forms and navigation
      • Message dialogs
      • pmSmart Box Model
      • Themes and styles
    • Layout manager
    • Networking
      • Loading files
      • TW3HttpRequest
      • TW3JSONP
    • Prerequisites
    • Real data, talking to sqLite
    • System requirements
    • Project types
      • Visual project
      • Game project
      • Console project

Archives

  • December 2019
  • December 2018
  • November 2018
  • July 2018
  • June 2018
  • February 2018
  • September 2017
  • April 2017
  • November 2016
  • October 2016
  • September 2016
  • April 2016
  • March 2016
  • January 2016
  • October 2015
  • September 2015
  • July 2015
  • April 2015
  • January 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • November 2011
  • October 2011
  • September 2011

Categories

  • Announcements (25)
  • Developers log (119)
  • Documentation (26)
  • News (104)
  • News and articles (16)

WordPress

  • Register
  • Log in
  • WordPress

Subscribe

  • Entries (RSS)
  • Comments (RSS)
  • 1
  • 2
  • Next
© Optimale Systemer AS