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

Category Archives: Developers log

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

Nullable types

Posted on 16.01.2016 by Smart Mobile Studio Team Posted in Developers log, News and articles

JavaScript – in contrast to Object Pascal – is a dynamic language. Beyond dynamic type checks, this also means that it can be extended at runtime. Thus, variables and with this fields of prototypes may only be present (accessible) when they have been set first. In external JavaScript libraries, these are typically initialized or set, but not necessarily. And sometimes it is even intentional to leave them unset.

Continue reading→

DSharp DWScript javascript Nullable types Object Pascal

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

Using external JS libraries with Smart Mobile Studio

Posted on 15.01.2016 by Smart Mobile Studio Team Posted in Developers log, News and articles
Neuron groups, ZEISS-Microscopy, CC

Neuron groups, ZEISS-Microscopy, CC

In the forums there was a discussion about how to wrap existing libraries transparently and with a minimum of overhead. In that discussion an example was given about how to wrap the neural network library brain. To avoid posting the same text here as well, this blog post is about translating another neural network library called ‘Synaptic‘.

Continue reading→

HTML5 javascript Neuronal Networks Object Pascal

Smart Mobile Studio 2.2 (beta-4)

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

Before releasing the final version of Smart Mobile Studio 2.2, we decided to push out one more (we hope it will be the last) beta release, beta-4.

If you are already running the beta-2, you can just start the SmartUpdate program and it will fetch the new version. Otherwise, you should follow the detailed instructions outlined in the beta-1 announcement.

Changes since beta-3

  • Sped-up replace dialog.
  • Built-in basic Cordova support.
  • Added correct MIME type for WOFF and WOFF2 fonts.
  • Added font loading API (see http://www.w3.org/TR/css-font-loading/).
  • Introduced option for resource file path handling.
  • Added ‘Wrap string’ feature to the editor to wrap a string which is longer than the right edge (Editor.RightEdge) to the next line(s).
  • Added a simple geolocation demo.
  • Added a simple geolocation-based sunrise/sunset calculator.
  • Resource files are only written to disk when they are modified, not every time project is saved.
  • Improved working with icons.
  • Added option to have the internal browser log reversed (newest information at the top).
  • Implemented the sort project file feature.
  • Added feature to only write resources when neeeded.
  • Added support for bulk deletion of several project files.
  • Added Splash Screen demo (http://smartmobilestudio.com/2015/09/27/writing-small-splash-screen-pre-loader-code).
  • Improved WebSocket support with binary and BLOB messages.
  • Updated to the latest DWScript.
  • JUInt8ClampedArray was replaced with JUint8Array which has better browser support.
  • Redesigned REST API and updated the demo.
  • REST API appends random number to the end by default (unless .NoRandomize is called).
  • Updated basic examples
  • Fixed method type detection bug in DWScript.
  • Fixed compiler issue with external class fields being assigned in an initialization section.
  • Fixed missing default icon for iOS.
  • Fixed compiler issues with incorrect array assignments.
  • Fixed the bug which occurred when several replacements were done in one line.
  • Fixed old MIME types.
  • Fixed Canvas Application demo.
  • Compiler fixes for overloaded methods & override.
  • Fixed response code in server for failed GET requests.
  • Fixed TW3Label positioning bug.
  • Fixed wrong icon for external resource files
  • Fixed System.Date/JDateHelper.SetAsDateTime and .SetAsLocalDateTime.
  • Fixed: Double-clicking on a ‘folder’ icon crashed the program.
  • Fixed w3_getStyleAsFloat.
  • Fixed icon preview.

Writing small splash screen / pre-loader code

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

For large applications it is often needed to have a splash screen that is shown while pre-loading the required resources in the background. It is especially needed when the application should run from the web with a low connection speed.

Typically the splash screen should show a static image or simple animation. At the same time it should pre-load and cache all resources which are required to run the application. This well-defined task does not need a lot code to run and thus should be written as efficient as possible to avoid long load times for the splash screen itself.

This article is about writing small splash screen / pre-loader code, which can be used upfront any of your application.

Continue reading→

company logo DOM Efficient HTML5 Pre-loader small Splash screen

Structures, dealing with name pairs

Posted on 26.09.2015 by Jon Lennart Posted in Developers log

When talking to your REST server or nodeJS service, it can sometimes be overkill to ship a huge and complex wad of JSON or XML over the wire. I noticed that WebSocket transferes can sometimes get a tiny delay if the server is dealing with high payloads. Although we are talking milliseconds here, it’s always good to refactor and make things as small as possible.

The solution I came up with is essentially a dynamically created “record”. Where you would normally write:

type
  TMyData = record
    field1: String;
    field2: TDateTime;
    field3: Integer;
  end;

TW3Structure allows you to do this programatically, both for binary and JSON. Which can be handy when playing around with your own protocols. So with TW3Structure you can do stuff like:

var Structure := TW3JsonStructure.Create(null);
Structure.WriteString('field1','some value');
Structure.WriteDateTime('field1',Now);
Structure.WriteInt('field2',1200);

var JSONData:String;
Structure.SaveToJSON(JSONData);

WebSocket.Send(JSONData);

I also added support for TStream which does the exact same thing, but in true binary form. Perfect for storing simple data in the browser cache or your mobile device’s sandbox.

unit system.namepair;

interface

uses
  System.types,
  System.streams,
  SmartCL.System;

type

  EW3Structure = class(EW3Exception);
  TW3Structure = Class(TObject)
  public
    procedure   WriteString(name:string;value:String;
                const encode:Boolean);overload;
    procedure   WriteInt(name:string;Value:Integer);overload;
    procedure   WriteBool(name:string;value:Boolean);overload;
    procedure   WriteFloat(name:String;value:Float);overload;
    procedure   WriteDateTime(name:String;value:TDateTime);overload;

    procedure   Write(name:String;value:variant);overload;virtual;abstract;

    procedure   Clear;virtual;abstract;

    procedure   SaveToJSON(var Data:String);virtual;abstract;
    procedure   LoadFromJSON(Value:String);virtual;abstract;

    procedure   SaveToStream(Stream:TStream);virtual;abstract;
    procedure   LoadFromStream(Stream:TStream);virtual;abstract;
  end;

  TW3JsonStructure = Class(TW3Structure)
  private
    FBuffer:  Variant;
  public
    procedure   Clear;override;
    procedure   SaveToJson(var Data:String);override;
    procedure   LoadFromJson(Value:String);override;
    procedure   SaveToStream(Stream:TStream);override;
    procedure   LoadFromStream(Stream:TStream);override;

    procedure   Write(name:String;value:variant);overload;override;
    Constructor Create(const Data:Variant);virtual;
  end;


  TW3BinProxyItem = Record
    daName:   String;
    daValue:  Variant;
  end;

  TW3BinaryStructure = Class(TW3Structure)
  private
    FData:      Array of TW3BinProxyItem;
    function    IndexOfName(name:String):Integer;
  protected
    procedure   Clear;override;
    procedure   SaveToJson(var Data:String);override;
    procedure   LoadFromJson(Value:String);override;
    procedure   SaveToStream(Stream:TStream);override;
    procedure   LoadFromStream(Stream:TStream);override;
    procedure   Write(name:String;value:variant);overload;override;
  end;


implementation

resourcestring

CNT_ERR_STRUCTURE_FUNCTION  =
'Stream storage failed, structure contains function reference error';

CNT_ERR_STRUCTURE_SYMBOL  =
'Stream storage failed, structure contains symbol reference error';

CNT_ERR_STRUCTURE_UNKNOWN =
'Stream storage failed, structure contains uknown data-type error';

CNT_ERR_STRUCTURE_FAILEDREAD =
'Failed to read structure, invalid datatype error';

CNT_ERR_STRUCTURE_INVALIDSIGN =
'Failed to read structure, invalid data signature error';

//############################################################################
// TW3BinaryStructure
//###########################################################################

const
CNT_STRUCT_SIGNATURE  = $CCCCFF00;

function TW3BinaryStructure.IndexOfName(name:String):Integer;
var
  x:  Integer;
begin
  result:=-1;
  if FData.Count>0 then
  for x:=FData.low to FData.high do
  begin
    if Sametext(Fdata[x].daName,Name) then
    begin
      result:=x;
      break;
    end;
  end;
end;

procedure TW3BinaryStructure.Write(name:String;value:variant);
var
  mIndex: Integer;
  mItem:  TW3BinProxyItem;
Begin
  mIndex:=IndexOfName(name);
  if mIndex<0 then
  begin
    mItem.daName:=name;
    mItem.daValue:=Value;
    FData.add(mItem);
  end else
  FData[mIndex].daValue:=Value;
end;

procedure TW3BinaryStructure.Clear;
Begin
  FData.Clear;
end;

procedure TW3BinaryStructure.SaveToJson(var Data:String);
Begin
  asm
    @Data = json.stringify( (@self.FData) );
  end;
end;

procedure TW3BinaryStructure.LoadFromJson(Value:String);
Begin
  asm
    (@self.FData) = json.parse(@Value);
  end;
end;

procedure TW3BinaryStructure.SaveToStream(Stream:TStream);
var
  x:  Integer;
  mWriter:  TWriter;
Begin
  mWriter:=TWriter.Create(Stream);
  try
    mWriter.WriteInteger(CNT_STRUCT_SIGNATURE);
    mWriter.WriteInteger(FData.Count);
    if FData.Count>0 then
    begin
      for x:=0 to FData.Count-1 do
      begin
        /* Write the name */
        mWriter.WriteString(FData[x].daName);

        /* Write the datatype */
        mWriter.WriteInteger(ord(FData[x].daValue.datatype));

        /* Write the value */
        case FData[x].daValue.datatype of
        vdBoolean:
          begin
            mWriter.WriteBoolean(FData[x].daValue);
          end;
        vdInteger:
          begin
            mWriter.WriteInteger(FData[x].daValue);
          end;
        vdFloat:
          begin
            mWriter.WriteDouble(FData[x].daValue);
          end;
        vdString:
          begin
            mWriter.WriteString(FData[x].daValue);
          end;
        vdFunction:
          begin
            Raise EW3Structure.Create(CNT_ERR_STRUCTURE_FUNCTION);
          end;
        vdSymbol:
          begin
            Raise EW3Structure.Create(CNT_ERR_STRUCTURE_SYMBOL);
          end;
        vdUnknown:
          begin
            Raise EW3Structure.Create(CNT_ERR_STRUCTURE_UNKNOWN);
          end;
        end;
      end;
    end;
  finally
    mWriter.free;
  end;
end;

procedure TW3BinaryStructure.LoadFromStream(Stream:TStream);
var
  mCount:   Integer;
  mReader:  TReader;
  mKind:    Integer;
  mRec:     TW3BinProxyItem;
Begin
  Clear;
  mReader:=TReader.Create(Stream);
  try
    if mReader.ReadInteger = CNT_STRUCT_SIGNATURE then
    begin
      mCount:=mReader.ReadInteger;
      while mCount>0 do
      begin
        mRec.daName:=mReader.ReadString;
        mKind:=mReader.ReadInteger;
        case TW3VariantDataType(mKind) of
        vdBoolean:  mRec.daValue:=mReader.ReadBoolean;
        vdInteger:  mRec.daValue:=mReader.ReadInteger;
        vdFloat:    mRec.daValue:=mReader.ReadDouble;
        vdString:   mRec.daValue:=mReader.ReadString;
        else
          Raise EW3Structure.Create(CNT_ERR_STRUCTURE_FAILEDREAD);
        end;

        FData.add(mRec);
        mRec.daName:="";
        mRec.daValue:=null;

        dec(mCount);
      end;
    end else
    Raise EW3Structure.Create(CNT_ERR_STRUCTURE_INVALIDSIGN);
  finally
    mReader.free;
  end;
end;

//############################################################################
// TW3Structure
//###########################################################################

procedure TW3Structure.WriteString(name:string;
          value:String;const encode:Boolean);
begin
  (* base64 encode string to avoid possible recursion
     should someone store another JSON object as a string *)
  if encode then
  Begin
    asm
      @value = btoa(@value);
    end;
  end;
  Write(name,value);
end;

procedure TW3Structure.WriteInt(name:string;Value:Integer);
begin
  Write(name,value);
end;

procedure TW3Structure.WriteBool(name:string;value:Boolean);
begin
  Write(name,value);
end;

procedure TW3Structure.WriteFloat(name:String;value:Float);
begin
  Write(name,value);
end;

procedure TW3Structure.WriteDateTime(name:String;value:TDateTime);
begin
  Write(name,value);
end;

//############################################################################
// TW3JsonStructure
//###########################################################################

Constructor TW3JsonStructure.Create(const Data:Variant);
begin
  inherited Create;
  if not TVariant.IsNull(Data)
  and not Data.IsUnassigned then
  FBuffer:=Data else
  FBuffer:=TVariant.CreateObject;
end;

procedure TW3JsonStructure.SaveToJSON(var Data:String);
begin
  if (FBuffer<>unassigned)
  and (FBuffer<>NULL) then
  Data:=JSON.Stringify(FBuffer) else
  Data:=null;
end;

procedure TW3JsonStructure.LoadFromJSON(Value:String);
begin
  value:=trim(Value);
  if value.length>0 then
  FBuffer:=JSON.Parse(value) else
  FBuffer:=TVariant.CreateObject;
end;

procedure TW3JsonStructure.SaveToStream(Stream:TStream);
var
  mWriter:  TWriter;
  mtext:    String;
begin
  SaveToJSON(mText);
  mWriter:=TWriter.Create(Stream);
  try
    mWriter.writeString(mText);
  finally
    mWriter.free;
  end;
end;

procedure TW3JsonStructure.LoadFromStream(Stream:TStream);
var
  mText:    String;
  mReader:  TReader;
begin
  mReader:=TReader.Create(stream);
  try
    mText:=mReader.ReadString;
  finally
    mReader.free;
  end;
  LoadFromJSON(mtext);
end;

procedure TW3JsonStructure.Clear;
begin
  FBuffer:=TVariant.CreateObject;
end;

procedure TW3JsonStructure.Write(name:String;value:variant);
begin
  FBuffer[name]:=value;
end;

end.
binary code JSON Records Streams Structures WebSocket

Smart Mobile Studio 2.2 (beta-3)

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

For the past two months we were working on the 2.2 release, adding few small features and fixing bugs. (Thanks for all the feedback!)

We are now nearing the final release, but before pressing the button we prepared one more (we hope it is the last) beta version – beta-3.

If you are already running the beta-2, you can just start the SmartUpdate program and it will fetch the new version. Otherwise, you should follow the detailed instructions outlined in the beta-1 announcement.

Known problems

  • System.TypeCon doesn’t handle correctly browsers that do not support UInt8ClampedArray (Safari, default browser on Android 4.x, …). Currently, beta-3 just ignores the exception in that unit which allows the application to start but most of the type conversion functions will fail if you’ll try to use them.

Changes since beta-2

  • Compiler supports comparing Variant to nil with = and <> operators.
  • Added option controlling whether to add unit to the project’s uses section to the ‘new unit/form’ dialog.
  • Added unit name validation to the ‘new unit/form’ dialog.
  • Improved Find&Replace dialog behaviour when executing ‘Replace all’.
  • Added W3C.Console unit.
  • Added tool ‘Limit precision’ to the editor’s pop-up menu. This tool limits precision of numbers in the selected code.
  • Added support for the Page Visibility API to the RTL.
  • Added simple example for the Page Visibility API.
  • Added preferences page for internal browser configuration.
  • Updated to CEF3 revision 2069.
  • Updated W3C.Canvas2DContext and W3C.HTML5 units.
  • Removed the GUI for disabling WebKit GPU acceleration as DCEF3 no longer supports that.
  • Fixed event generation problem on secondary forms.
  • Fixed “Invalid variant operation” error in the compiler.
  • Fixed codegen for some class parameters.
  • Fixed codegen for StrBeginsWith.
  • Fixed “double free” bug in TW3Component.Destroy.
  • Fixed issue with performing a background compilation twice on project load. The fix not only removes an internal exception, but also speeds-up project loading as it only updates editor states once.
  • Fixed problems with Property Inspector and event generation (general crashes, “Invalid property value” exceptions).
  • Fixed implementation of TMath.PI and TMath.E in Espruino.System.
  • Project is correctly reloaded in internal browser when recompiled.
  • Corrected ‘Show parameter’ (Shift + Ctrl + Space).
  • Fixed a problem when project files for a newly created project were not monitored for changes.
  • Fixed a problem when change was not detected if a form file (.sfm) was modified on disk.
  • When a new project is created, existing Unit1/Form1 files are no longer silently overwritten.
  • Fixed loading a project without a .sdk file.
  • Corrected occasional problem when File1.sfm was not written to disk when new project was created.
  • Corrected extensions for generated icon files.
  • Fixed a bug where all controls on the form were duplicated when form was edited ouside of the program while it was open in the editor.

Smart Mobile Studio 2.2 (beta-2)

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

Beta-2 of Smart Mobile Studio 2.2 is now ready.

If you are new to the beta program, you can just follow instructions outlined in the beta 1 announcement.

If you have already installed the beta-1, then please first update the SmartUpdate program with the fresh version. We have enhanced it with two small details. Firstly, it will display the changelog for the selected channel before the download is started and secondly, it can now update itself. So from now on SmartUpdate will fetch a fresh copy of itself from the server whenever we add functionality or fix some bug.

SmartUpdate - Changelog

Before upgrading to the new beta, please close the Smart Mobile Studio IDE.

Changes

We only changed a few critical critical files in this update, but fixes were really important so you definitely should upgrade from beta-1 to beta-2. Most importantly, we have fixed some problems with the visual library (“forms” part of the RTL) while also improving the rendering speed by a factor of 2-3x (depending on occasion an on the browser).

Smart Mobile Studio 2.2 (beta-1)

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

We are very proud to announce a start of the beta cycle for the next Smart Mobile Studio release – 2.2. Amongst many other news (a full list of changes can be found at the end of this article), we are also presenting new distribution mechanism, a SmartUpdate program.

With SmartUpdate you can follow different Smart Mobile Studio distribution channels. At the moment, Beta is the only distribution channel but this will most probably change after the 2.2 is released. We plan to introduce at least a Stable channel that would distribute stable releases.

Of course, you’ll still be able to use the standard distribution mechanism – the installer – for stable releases but betas will only be released via the SmartUpdate.

Another big change in the 2.2 beta is that you can install it into a single folder. You can also run it from that folder and it will not interfere with other (stable) Smart installation on the same computer. This will greatly simplify the testing. Also, if you want to test Smart on different computers, you can just make a copy of that folder.

Disclaimer

Please keep in mind that this is beta quality software and that problems are expected. Don’t open you production projects directly in Smart Mobile Studio 2.2 beta, but always make a copy first! As the beta is installed in a separated folder, it will not mess with your existing installation, but it may corrupt any project you open in the IDE. (We are pretty sure that it won’t, but such things have happened before and can happen again. That’s why we are beta testing before the release.)

Continue reading→

Smart Mobile Studio 2.1 (Hotfix 2)

Posted on 11.10.2014 by Smart Mobile Studio Team Posted in Announcements, Developers log, News 1 Comment

More fixes are collected in this second hotfix release.

 

Download

You can download the installer here:

  • Basic
  • Professional
  • Enterprise
  • Educational

For information about other releases, take a look in the release history.

 

Changelog

Compiler

  • Fixed support of expressions in array insert.
  • FloatToStr is now overloaded rather than a function with a default parameter.
  • Added support for + and += operators for array concatenation.
  • Fixed issue with overloaded methods and public/private scoping.
  • Fixed scoping issues with helpers.
  • Added support for the ‘library’ keyword.
  • Parser supports default property of a property. Example: someObject.stringDictionary[‘abc’] := ‘123’;
  • Relaxed Gabelou for fields of external classes.
  • Eliminated TObject dependency from some external-class related codegen.

 

IDE

  • Fixed: ‘Code packing’ option was not stored.
  • Preferences not defaulted properly after a re-installation

 

RTL

  • Fixed some minor issues and UTF-8 encoding in the RTL
  • Shims.InternetExplorer is included if SMART_LEGACY_INTERNET_EXPLORER conditional symbol is defined.
  • Fixed setting style attributes in SmartCL.Borders.
  • Fixed code that sets font family in TW3CustomFont.
  • Added property .TextContent.
  • Added SmartCL.Controls.ScrollBox to SmartCL.Controls.
  • Removed deprecated unit warning in DataSnap.pas
  • Added JEventTarget overload (needed for older browsers).
  • Added Method, StatusClass, and URL properties to TW3HttpRequest.
  • Added Timeout and OnTimeout properties to TW3HttpRequest.
  • Added THttpHeaders class to SmartCL.Inet.
  • Added unit SmartCL.Inet.REST which simplifies sending REST requests.
  • Added function Test to string helpers in SmartCL.RegEx.
  • Fixed default Header / Toolbar controls inverse gradient colors.
  • Fixed OnTouch event handling for controls that can accept focus (memo, edit).

 

Demos

  • A Smart Book Demos are converted to 2.1 format.

 

—

Sincerely,
The Smart Mobile Studio Team

Hotfix release

Smart Mobile Studio 2.1 (Hotfix 1)

Posted on 04.09.2014 by Smart Mobile Studio Team Posted in Announcements, Developers log, News 1 Comment

We have done some improvements with v2.1, and we’ve collected these in a new hotfix release.

 

Download

You can download the installer here:

  • setup_enterprise.exe
  • setup_professional.exe
  • setup_basic.exe
  • setup_educational.exe

For other information about other releases, take a look in the release history.

 

Changelog

Compiler

  • Linker error caused by DWS filter in HTML/CSS files are reported.
  • Added ability to cast JS “Variant” to arrays.
  • Added support for initializing record fields inline in class/record declarations.
  • Better error in case of invalid array syntax.
  • Fixed issues with symbol table handling.
  • Inline resources ({$R file:’…’}) are linked properly.
  • Non-empty set constants are supported as parameters and default parameters.
  • Added support for integer<->set conversion for small sets.
  • Local (in project folder) copies of RTL files take priority during the compilation.
  • Fixed support for ‘break’ statement inside a ‘case’ statement.
  • Fixed operator precedence, operators now evaluate just like in Delphi.

 

Debugger

  • Fixed several memory corruption problems.
  • Breakpoints are disabled when debugging is not enabled.
  • JavaScript file name is shown in the stack frame.

 

IDE

  • Added resource string export.
  • When Custom CSS was selected in project options, CSS file did not appear in the Project Manager.
  • Improved Basic edition (non-functional parts are not shown).
  • Fixed “Find in Files” which reported unit name instead of file name.
  • Fixed a rare issue with QR code generation.
  • Full path name is shown in a tab hint.
  • Console messages are shown correctly when built-in browser is used.
  • Category for components can be set in the package builder.
  • A  warning is displayed if package compilation fails during IDE load.
  • “ZIP entire project” was not working properly.
  • Fixed label display on the welcome page.
  • F3 function key was not working on the Source page of the built-in browser.
  • Improved serving of text files.
  • Fixed unicode character handling in forms.
  • Unit was not marked as saved after a new project was saved for the first time.
  • Suggestions are not invoked inside a string.
  • DataSnap proxy generator DLL is included in the installer.
  • Unopened files were not saved after ‘Make item external’.
  • Improved loading times for large and old Base64 encoded projects.
  • Fixed ‘asm’ statement detection in highlighter.
  • More than one external source file can be added in one step.
  • Fixed execution in external browser – when started twice in a row without closing Brower/Server window, source was not reloaded in the external browser.
  • Fixed occasional execution problems.
  • If an error occurs when executing program in internal browser, cursor jumps to the JavaScript source line which caused the error.

 

RTL

  • Added bunch of W3C APIs.
  • Added Tizen APIs.
  • Improved GLScene libraries.
  • Fixed problem when InitializeObject was called twice for forms in old (pre-2.1) projects.
  • CSS theme cleanup.
  • Fixed w3_getElementByName.

 

Demos

  • Added example for XMLHttpRequest.
  • Updated all contest demos [GraphicsDemo, Afternoon Walk, Real Fire, RetroBalls, Biotopia, PolyDNA]  to the new format (including minor fixes related to changes in v2.1).

 

—

Sincerely,
The Smart Mobile Studio Team

Hotfix release

Smart Mobile Studio 2.1

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

Smart Mobile Studio 2.1We are proud to release Smart Mobile Studio 2.1.

Download

You can download the installer here:

  • setup_enterprise.exe
  • setup_professional.exe
  • setup_basic.exe
  • setup_educational.exe

A valid license key (trial or subscription) is required.

NOTE: Since v2.0 isn’t forward compatible, you can’t open v2.1 projects in v2.0. Make sure to always backup your projects case you want to revert to v2.0.

—
Sincerely,
The Smart Mobile Studio Team

Continue reading→

Stable release Version 2.1

Smart Mobile Studio 2.1 (beta-3)

Posted on 26.07.2014 by Smart Mobile Studio Team Posted in Announcements, Developers log, News 4 Comments

Smart Mobile Studio 2.1 (beta)

This version is actually more like a “release candidate” than a “beta”.

There’s only one issue left, and that’s related to RTTI.
If we mange to fix this issue within the next few days, then we will include that fix in the final release. If not, we’ll postpone the RTTI to the first hotfix and release this version as is.

If you would like to give this a try, you can download the installer here:

  • setup_enterprise.exe
  • setup_professional.exe
  • setup_basic.exe
  • setup_educational.exe

A valid license key (trial or subscription) is required.

NOTE: Since v2.0 isn’t forward compatible, you can’t open v2.1 projects in v2.0. Make sure to always backup your projects case you want to revert to v2.0 again.

—
Sincerely,
The Smart Mobile Studio Team

Continue reading→

Smart Mobile Studio 2.1 (beta-2)

Posted on 19.07.2014 by Smart Mobile Studio Team Posted in Announcements, Developers log, News 11 Comments

Smart Mobile Studio 2.1 (beta)

We have received lots of useful feedback from the first beta.

We have addressed most of these, but there are a few more issues we want to implement before the final release. Thus a second beta.

If you would like to give this a try, you can download the installer here:

  • setup_enterprise.exe
  • setup_professional.exe
  • setup_basic.exe
  • setup_educational.exe

A valid license key (trial or subscription) is required.

NOTE: Since v2.0 isn’t forward compatible, you can’t open v2.1 projects in v2.0 anymore. Make sure to always backup your projects case you want to revert to v2.0 again.

—
Sincerely,
The Smart Mobile Studio Team

Continue reading→

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)
  • Prev
  • 1
  • 2
  • 3
  • 4
  • …
  • 8
  • Next
© Optimale Systemer AS