Sciter, Delphi wrapper

February 25, 2015

Filed under: Sciter,Source code — Andrew @ 2:38 pm
Sciter/Delphi demo

Sciter/Delphi demo

Mr. Baranov D.A. have published his Delphi wrapper for Sciter at GitHub.

Object match feature in Sciter 3.2.0.3

February 13, 2015

Filed under: Sciter,Script — Andrew @ 8:44 pm

In Sciter 3.2.0.3 I’ve added so called object match feature to built-in like operator and switch/like statement.

Let’s imagine that we have some sequence of objects/data like:

      var shoppingCartData = [
        { product:"Apple", price: 0.95, calories:52 },
        { product:"Orange", price: 0.75, calories:47 },
        { product:"Toothbrush", price: 1.75 },
        "deleted",
        { product:"Pear", price: 1.25, calories:57 },      
        { product:"Soap", price: 2.75 },
      ];

And we would like to do something separately for food items and other purchased goods. With the new switch/like addition that will simply look like this:

for( var item in shoppingCartData ) 
  switch(item) 
  {
     like { price: Float, calories: Integer } :  
           // appears as a food item, do something with it
           ...
           break; 
     like { price: Float } : 
           // not a food item
           ...
           break;            
     case "deleted" :
           // item was deleted, skip it  
           break;
     default:
           // unknown thing, is it just a present? 
           break; 
  }

Same pattern matching was added to the like expression:

if( item like { product: String, price: Float } )
    stdout.println( item, "is a pricey product" );

Hope this will make life easier in some cases.

January 28, 2015

Filed under: HTML and CSS,Sciter — Andrew @ 10:53 am

In Sciter <frame> element may have content-style attribute defined.

That content-style attribute takes URL of style sheet that gets applied on top of existing styles of the document:

<frame src="some-child.htm" content-style="content.css" />

That content.css gets appended to the list of other styles of the some-child.htm as if that document has <link rel="stylesheet" type="text/css" href="content.css"> at the end:

<html>
<head>
  <style>
    ... local styles ...
  </style>
</head>
<body>
   ... local content ...
</body>
 <link rel="stylesheet" type="text/css" href="content.css">
</html>

So when host document wants:

  1. to customize rendering of child document in the frame
  2. and/or inject some scripting behaviors in it

it can provide its own content.css file without the need of that child element modification.

Sciter SDK built-in document browser is an example of content-style usage:

{sciter-sdk]/doc/main.htm defines content frame as:

<frame #content src="content/preface.htm" content-style="styles/content.css"/>

so each document loaded into the frame gets {sciter-sdk}/doc/styles/content.css applied to its content

Sciter article on CodeProject

January 7, 2015

Filed under: How-to,Sciter — Andrew @ 10:30 am

Sciter clock

I’ve published Sciter technology introduction article on CodeProject with the brief description of samples included in SDK.

Sciter-XGL

December 16, 2014

Filed under: Sciter — Andrew @ 10:00 pm

Thinking about making so called sciter-xgl – smaller version of the Sciter but with OpenGL backend and with slightly reduced feature set. Targeted on games and the like use cases. And with broader platform support including all mobiles I can put my hands on.

Thinking…

Linux version is coming

December 10, 2014

Filed under: Sciter — Andrew @ 3:21 pm

Actually it is not about Linux only but any POSIX compatible system that is capable to run GTK 3.0 and above.

Sciter on Ubuntu Linux

Sciter on Ubuntu Linux

Next Page »