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: News

Smart Mobile Studio 1.1

Posted on 15.03.2013 by Smart Mobile Studio Team Posted in News
Smart Mobile Studio 1.1

Smart Mobile Studio 1.1

We are proud to release Smart Mobile Studio 1.1 to the general public (build 1.1.0.911).

You can download the product here

Notes

  • Remember to update the css and html in your projects after updating (right click file in the ide, click “revert to default”)
  • Remember to back-up any units you have stored in either the RTL or Libraries folder before you install
  • Remember to re-build the RTL index database after installation to examine the new classes and units in the classbrowser
  • Since all controls now exist in their own RTL units, some projects might require you to alter the uses section manually (the easiest way is to drop a control onto the designer, as this will add the unit automatically for you).
  • You can now use curley brackets in ASM sections

Changelog

  • Fixed: TW3Canvas.toDataURL
  • Added: L-System Fiddle demo
  • Added: URI functions
  • Fixed: installer script backs up libs + RTL
  • Fixed: Allow adjusting tab height
  • Added: Active property to pause animation
  • Added: w3Elements.pas  &  elements controls to toolbar
  • Improved JS SetLength for arrays of simple types
  • Re-committed latest WebIDL code
  • Fixed: browser render bug. Was in fact the onNeedsInclude event that needed a modification
  • Added: registered various controls
  • Fixed: unit parser
  • Added: some automatic Web IDL translations (manual work necessary!)
  • Fix: empty names for anonymous methods in unitparser
  • Clarified error messages
  • Initial version of unit test demo (text runner)
  • Updated unit test framework. Unpublished methods that didn’t need published status (now)
  • Fixed: CTRL+V missing from SearchAndReplaceDialog -> ComboBoxSearch
  • Added unit tests
  • SmartUnit now reached initial working state
  • Added time properties
  • TestFramework initial version
  • Added property read write syntax with automatic anonymous field declaration
  • Fixed case for strict hints
  • FastInt64ToStr RTTIMethodAttribute.Call MultByPowerOfTwo expression
  • Minor codegen improvements & cleanup
  • Fixed case for strict hints
  • Added missing units
  • Fixed case for strict hints
  • Updated: CSS theme for latest components + cleanup
  • Added “case of boolean” optimization to if/then/else Improved if..then condExpr optimization for the CodeGen
  • Reintroduced as unit namespace, please complete with missing units from former W3Ctrls unit!
  • Fixed name case
  • Fixed case for strict hints
  • Extended if then optimization to if then else
  • Added RelIntIs(Not)
  • Zero optimization Fixed for non-prototypable fields in external classes
  • Added initial RTTI for methods
  • Improved error reporting when crash occurs during optimization
  • Improved CodeGen for
  • “if” on assigned & int<>0 checks
  • Layout and widget updates
  • Updated: Added check and callback timer to scrollbox so that it initializes when the form is ready (if the contentbox holds elements).
  • Added: childadded + childremoved methods to TW3Component
  • Added: W3_DOMReady function in W3System.pas
  • Altered: cleaned up the use of w3ctrls in various RTL units
  • Altered: All components are now in their seperate units
  • All controls seperated into units
  • Fixed minor memory leak
  • Fixed json array clear
  • Altered: Basecompiler changes Lost: vertical scrollbar (!) damn svn?
  • Fixed external form issue in background compiler & some refactorings in compiler unit
  • Fixed missing initial background compilation for new projects
  • Added: *.inc files to repository
  • RTL Backup before splitting components into their own unit
  • Added: debug logging of background compiler error messages &  added more user warnings in case such errors appear.
  • JSON.Stringify did not work with obfuscation
  • Accept initialization/finalization as end markers for a type declaration block
  • Added: simplified helper syntax
  • Delete unused file (QR code was used as test)
  • Added: QR code generation for server window
  • Moved remaining forms to source directory (below new subdirectory ‘window’, as these are no dialogs)
  • Removed unused dependency WIP on new flowing components
  • Fixed smart-linking not properly filtering the main program, initialization & finalization sections (relevant when types or functions where declared there, but not used)
  • Fixed codegen for multi-dimensional dynamic arrays
  • Improved symbol dictionary discrimination between forwards & declarations
  • Fixed requestAnimationFrame support for IE8-9 and others
  • Fixed hints for strict mode
  • Added: TW3CustomScrollBar Class
  • Added: TW3VerticalScrollbar
  • Altered: Tweaked CSS, more firefox styles
  • Altered: Added css for scrollbar
  • Improved unit test coverage
  • Test manual execution of the automatic build #2
  • Test manual execution of the automatic build
  • Added: The switch control is now added to the toolbar palette
  • Altered: The TW3ToggleSwitch transition now uses the w3_CSSPrefix so it also works on other browsers
  • Altered: minor changes to the toggle-switch. Delayed event callback more in sync with the css animation + destructor
  • Added: TW3ToggleSwitch control
  • Altered: Updated the CSS stylesheet with toggle css classes
  • Added: requestAnimFrame added to drivers
  • Improved unit test coverage
  • Support asm blocks with curlies in them
  • Add support for deactivating curly comments in Pascal tokenizer
  • Tokenizer tests moved to own unit
  • Fix for anonymous symbols acquire in a class var ExprBase
  • Fixed: Adjustment error in TW3HeaderControl fixed
  • Improved errors for null read/write expressions
  • Fixed: Layout difference between offline & online rendering
  • Fixed: Added callback for control adjustment (important!)
  • Added: supportAdjustment method to TW3MovableControl
  • Altered: AdjustToParentBox now checks supportAdjustment
  • Altered: TW3ProgressBar is not affected by AdjustToParentBox
  • Fixed: missing adjustToparentBox
  • Added: internet explorer driver
  • Added: requestAnimationFrame in driver API
  • Disabled trigger and delayed start for code templates (should never work this way)
  • Added Layout.Center
  • Added: script to flush the target RTL folder when updating
  • Added NoRTTI option and slightly rearranged options dialog (compiler options contain only compiler options now, etc.), also added new tab for the linker (as there will be more options in the future for sure)

Sincerely,
Jon Lennart Aasenden
—
The Smart Mobile Studio Team

Creating a TScrollbox

Posted on 05.03.2013 by Jon Lennart Posted in News

The interface of the TW3Scrollbox:

unit w3scrollbox;
 
interface
 
uses w3system, w3components, w3graphics, w3scrollbar;
 
  //Default size of the scrollbars
  const
  CNT_SCROLLBAR_SIZE  = 18;
 
type
 
  TW3ScrollBoxContainer = Class(TW3CustomControl)
  End;
 
  TW3Scrollbox = Class(TW3CustomControl)
  Private
    FHScroll: TW3HorizontalScrollbar;
    FVScroll: TW3VerticalScrollbar;
    FContent: TW3ScrollBoxContainer;
    Procedure HandleScroll(sender:TObject);
    Procedure UpdateWhenReady;
  protected
    procedure ChildAdded(Const aChild:TW3Component);override;
    procedure InitializeObject; override;
    procedure FinalizeObject; override;
    procedure Resize; override;
  public
    Property  Content:TW3ScrollBoxContainer read FContent;
    Procedure Update;
  End;

Since all the child objects will be created runtime via the constructor in Smart, the JavaScript browser code might not be ready when ChildAdded() is called (which is invoked whenever a child control attach as a child). The “UpdateWhenReady” method will wait until both the DOM (document object model) and TApplication instance is truly ready, and then it will automatically update the scrollbars if there is any content that is larger than the client-area.

Take a look at the implementation:

implementation
 
 
  //###########################################################################
  // TW3Scrollbox
  //###########################################################################
 
  procedure TW3Scrollbox.InitializeObject;
  Begin
    inherited;
    FContent:=TW3ScrollBoxContainer.Create(self);
 
    FHScroll:=TW3HorizontalScrollbar.Create(self);
    FHScroll.OnChanged:=HandleScroll;
    FHScroll.visible:=False;
 
    FVScroll:=TW3VerticalScrollbar.create(self);
    FVScroll.OnChanged:=HandleScroll;
    FVScroll.visible:=False;
 
    //UpdateWhenReady;
  end;
 
  procedure TW3Scrollbox.FinalizeObject;
  Begin
    FHScroll.free;
    FVScroll.free;
    FContent.free;
    inherited;
  end;
 
  procedure TW3Scrollbox.ChildAdded(Const aChild:TW3Component);
  Begin
    inherited ChildAdded(aChild);
    UpdateWhenReady;
  end;
 
  Procedure TW3Scrollbox.UpdateWhenReady;
  begin
    if (w3_DOMReady=False)
    or (ObjectReady=False) then
    w3_callback(updateWhenReady,10) else
    w3_callback(Update,1);
  end;
 
  procedure TW3Scrollbox.Resize;
  var
    wd,hd:  Integer;
  begin
    inherited;
    wd:=clientWidth;
    hd:=clientHeight;
 
    if FHScroll.visible then
    dec(hd,CNT_SCROLLBAR_SIZE);
 
    if FVScroll.Visible then
    dec(wd,CNT_SCROLLBAR_SIZE);
 
    if FHScroll.Visible then
    FHScroll.setBounds(0,hd,wd,CNT_SCROLLBAR_SIZE);
 
    if FVScroll.Visible then
    FVScroll.setBounds(wd,0,CNT_SCROLLBAR_SIZE,hd);
 
    FContent.SetBounds(1,1,wd-2,hd-2);
  end;
 
  Procedure TW3Scrollbox.HandleScroll(sender:TObject);
  Begin
    FContent.ScrollInfo.ScrollTo(FHScroll.Position,FVScroll.Position);
  end;
 
  Procedure TW3Scrollbox.Update;
  begin
    BeginUpdate;
    try
      if FContent.ScrollInfo.ScrollWidth>FContent.ClientWidth then
      Begin
        FHScroll.Total:=FContent.ScrollInfo.ScrollWidth;
        FHScroll.PageSize:=FContent.ClientWidth;
        If not FHScroll.Visible then
        Begin
          FHScroll.Visible:=True;
          self.SetWasSized;
        end;
      end;
 
      if FContent.ScrollInfo.ScrollHeight>FContent.clientHeight then
      Begin
        FVScroll.Total:=FContent.ScrollInfo.ScrollHeight;
        FVScroll.PageSize:=FContent.clientHeight;
        If not FVScroll.Visible then
        Begin
          FVScroll.Visible:=True;
          SetWasSized;
        end;
      end;
 
      FContent.SendToBack;
 
    finally
      EndUpdate;
    end;
 
  end;
 
end.

Using the scrollbox (without the designer) is straight forward. In this case I added a Beatles poster as a resource, inserted an image into the content of the scrollbox – and used the image as a background (as opposed to the image itself. Neat trick!).

FBox:=TW3Scrollbox.Create(self);
FBox.SetBounds(10,200,600,500);
FBox.StyleClass:='TW3CustomControl';
 
FTest:=TW3Image.Create(FBox.Content);
FTest.Background.FromURL('res/beatles.jpg');
FTest.setBounds(0,0,1644 * 2, 1086 * 2);

Creating a scrollbar

Posted on 04.03.2013 by Jon Lennart Posted in Developers log, News

So, what is a scrollbar? In short it consists of 4 parts: an up arrow, a region to move a handle, the handle, and a down arrow. The hard part is not to draw or setup the actual control, but to translate between screen coordinates and the values the scrollbar represents. The scrollbar might represent 100000 items of “something”, but since you have (for instance) only 400 pixels to represent that sum – you have to translate between the visual and the abstract.
Continue reading→

Creating a toggle switch

Posted on 03.03.2013 by Jon Lennart Posted in Developers log, News

Smart Mobile Studio component writing is actually very simple. It’s much easier than under Delphi – but it involves one aspect that to some Spartans can feel.. well, a bit odd. Namely the fact that you have to take CSS into account.
Continue reading→

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

Smart Graphics – Part 5

Posted on 31.01.2013 by Jon Lennart Posted in News

This is the final installment of our graphics programming overview. If you havent read the previous articles they can be found here:

  • first article
  • second article
  • third article
  • fourth article

In this final installment on graphics programming, we will be looking at Sprite3d. This is a very popular graphics library for HTML5 and javascript development which uses the latest hardware acelerated CSS technologies. In fact we found it so useful that we decided not to wrap it – but rather create a full implementation in object pascal from scratch.
Continue reading→

Smart Graphics – Part 4

Posted on 30.01.2013 by Jon Lennart Posted in Developers log, News 3 Comments

In this installment of our graphics tutorial we will be covering alpha blending (opacity) for controls and images, and also how to load images via code into your Smart applications. If you haven’t read the previous articles they can be found here:

  • first article
  • second article
  • third article

There are also plenty of examples in the documentation, here (see bottom of page) that will get you up and running quickly.
Continue reading→

Smart Graphics – Part 3

Posted on 28.01.2013 by Jon Lennart Posted in Developers log, News

In our previous articles we covered general concepts related to graphics programming together with basic drawing methods, focusing on those that should be familiar to Delphi programmers. In this article we will investigate double buffering and learn about off-screen bitmaps.
Continue reading→

Smart Graphics – Part 2

Posted on 27.01.2013 by Jon Lennart Posted in Developers log, News

In the previous article we introduced some general graphical concepts, things like double buffering, per scene rendering, sprites and alpha blending. Time to get our hands dirty and jump into it – how can a Delphi developer leverage his skills under HTML5? Well let’s find out!
Continue reading→

Smart Graphics

Posted on 24.01.2013 by Jon Lennart Posted in Developers log, News

Every Delphi programmer knows how to use the canvas. Its easy, its straight forward and it can be a source of phenomenal frustration if you want to do more than draw straight lines. Good old TCanvas is, despite it’s ease of use, a dinosaur in terms of modern features. The moment you start thinking about anti-aliasing, alpha blending or anything pertaining to rotation – it’s game over for TCanvas.

A smarter canvas

Smart mobile studio implements (or wraps) the HTML5 canvas directly, which means that you have access to all the latest features. The HTML5 canvas was implemented by Apple (webkit codebase) and is the browser equivalent of their Quartz API. This means first of all that it’s a bit trickier to get going, but on the flipside once you master it you can generate some truly amazing graphical effects.

Before we dig into the canvas, i thought it might be best to get up to speed with some of the terminology you are bound to encounter. Some of the concepts are not bound directly to HTML5 but are loosely related to computer programming in general.

Double buffering

Double buffering simply means that you draw your graphics to an offscreen bitmap rather than directly onto the visible canvas. When you are finished drawing you copy (also called “blitting”) the result to the visible display in one fast operation. This technique reduces flickering and makes movement appear smooth. The reason double buffering works is because there is often a delay between your calls – and the actual pixel memory being altered by the CPU/GPU (graphical processing unit). It greatly depends on the kind of hardware you are running, but either way – double buffering is what people do.

On a side note I can mention that Delphi actually uses double buffering by default. If you look up the drawing mechanism for TWinControl you will find that Delphi allocates a new bitmap, draws the control, then copy the result onto the device context. The problem with Delphi is that it allocates a bitmap for each draw, which is extremely slow. Thankfully, we dont have to care about that under Smart Mobile Studio.

Per scene rendering

Under Delphi whenever you use the canvas and call methods like lineto, circle, ellipse etc. these functions are executed “as is”. So once you issue a call to lineTo the underlying WINAPI draws a line into the bitmap your canvas is connected to. This method is very effective, bare bone and does it’s job well. Sadly it is very tricky to create anything modern with this. It’s perfect for 1990’s user interfaces but doesnt cut it for 2013.

HTML5 doesnt really work this way (nor does quartz) because here everything is based on paths. A path is basically just an array of TPoints that you pre-calculate before anything is drawn on screen. So to draw a line you first have to call beginpath, then issue a moveto and lineto command (which we already know under delphi), and finally you draw the line with a call to stroke or endpath. Here is a code snippet from HTML5 Canvas Tutorials:

      canvas.beginPath();
      canvas.moveTo(100, 20);

      // line 1
      canvas.lineTo(200, 160);

      // quadratic curve
      canvas.quadraticCurveTo(230, 200, 250, 120);

      // bezier curve
      canvas.bezierCurveTo(290, -40, 300, 200, 400, 150);

      // line 2
      canvas.lineTo(500, 90);

      canvas.lineWidth := 5;
      canvas.strokeStyle := 'blue';
      canvas.stroke();
Paths are cool

Paths are cool

As you can probably imagine, by automating the variables involved you can really get some amazing results with very little effort. Check out this liquid particles demo for instance (click image):

Nice canvas demo

Nice canvas demo

My personal favorite JavaScript demo has to be: or so they say

Also make sure you check out the graphics demos that ship with Smart Mobile Studio for more inspiration! And remember, the smart canvas maps more or less directly to the HTML5 canvas. We have added a few helper routines to make life easier for pascal programmers (and helper classes) but you will have no problems following a HTML5 JavaScript canvas tutorial with Smart Mobile Studio.

Alpha blending

Alpha blending simply means that you can draw graphics that is semi-transparent. Typically alpha blending is associated with 32bit graphics (RGBA) where each pixel or dot on the display is represented by 4 bytes. The first 3 bytes represents red, green and blue while the last byte defines the opacity of the pixel. When you copy a bitmap onto another which uses opacity as an option, it will merge with the existing graphics rather than overlap with it.

Sprites

In the golden days of 16 bit home computers (Amiga and Atari) the hardware supported sprites. A sprite is basically just a small, transparent picture which game programmers use to display and animate characters. In our day of fast processors and high speed 3d effects – there is no longer hardware support for sprites, but the concept of a “sprite” (as a moving graphical element) is still widely used. So if someone uses the term “sprite” or “bob” (the graphical co-processor in the Amiga was called “the blitter”, hence “blitter object”) you what they are talking about.

Next article

In this first installment we have taken a quick look at related concepts that you are bound to meet when programming graphics. Concepts like double buffering, sprites, alpha blending are universal and are deployed on all platforms regardless of language. So it’s handy to get to know these concepts straight away. We have also introduced how the HTML5 canvas works, that it uses paths rather than ad-hoc, brute force like good old TCanvas.

In the next installment we will dive into Smart Mobile Studio and familiarize ourselves with the API and draw some stuff. We will further look at how each of the above concepts work, things like double buffering, in real-life.

Reference material

  • W3Schools HTML5 canvas tutorial
  • HTML5 path tutorial
  • Liquid particles demo
  • Apple Quartz API documentation
  • Or so they say JS demo
Apple code delphi graphics javascript Object Pascal pixel webkit

Smart Mobile Studio v1.1 (beta-2)

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

We are very proud to present an updated beta-version of our 1.1 release (build number v1.1.0.372) of Smart Mobile Studio. If you would like to give this update a test run before we officially release it, then you can download the installer directly from SmartMobileStudio.com/download/setup_v1_1_0_372_beta.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 the improvements that have been done since the previous beta (see full manifest of changes for beta 1 here).

IDE changes

  • 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

  • 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

  • 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: formating of Archimedes Spiral
  • Added: frames demo
  • Added: modal dialog example

Sincerely,
Jon Lennart Aasenden
—
The Smart Mobile Studio Team

beta release

Scrollcontrol, creating a better menu

Posted on 18.01.2013 by Jon Lennart Posted in Developers log, News 2 Comments

Smart Mobile Studio comes with an implementation of the standard, round cornered, iPhone menu – but while handy, there are cases where you want to display more than just some options. What we really need is a scrolling menu that can be easily adapted to display more information. It’s time to dive deeper into the RTL and create a scrolling control.
Continue reading→

The Smart Contest 2013 – Topic for the first round

Posted on 15.01.2013 by Smart Mobile Studio Team Posted in Developers log, News
Fractal art created by longan drink.

Fractal art created by longan drink.

As previously announced, we will arrange 4 contests this year with some really cool prizes.

The topic for the first round will be “Graphics”.

We will reveal the details of this round by the end of January, but pay attention to our upcoming blog posts. They will give you lots of inspiration and get you started on the “graphics area” with Smart Mobile Studio.

(To get some inspirations right away, you can click on the image above).

In case you missed it:
First prize in each round will be a tablet (iPad, iPad mini, Android based tablet, Windows tablet). Value ~750 USD


Q: Will it be possible to participate with a trial version of Smart Mobile Studio?
A: Yes. We will even extend your trial period to cover the competition period if that is necessary. 😀


Best regards,
The Smart Mobile Studio Team

announcement graphics Smart Contest 2013

Working with webSQL

Posted on 08.01.2013 by Jon Lennart Posted in Developers log, News

In the current release of Smart Mobile Studio we have finally added database support. Since smart mobile development targets the browser API directly, the classes are more low-level than what we have in delphi, but the flip side is that there are a lot less elements involved and they are very easy to use.
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
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • Next
© Optimale Systemer AS