Better CSS sprites

First of all I shall admit that current way of doing CSS sprites appears as a hack. OK, what exactly is the CSS sprite? (actually sprite is a wrong name for the entity but seems like it is already wide spread, sigh ) Sprite (here) is just a fragment (slice, portion) of some base image….

Comments in source code considered harmful

In the file ResourceFontFileLoader.h (offical Windows SDK samples) you can see variable declared as: static IDWriteFontFileLoader* instance_; As you see it is a raw pointer here. And in the file ResourceFontFileLoader.cpp it is initialized with this: // Smart pointer to singleton instance of the font file loader. IDWriteFontFileLoader* ResourceFontFileLoader::instance_( new(std::nothrow) ResourceFontFileLoader() ); Note the comment….

Sciter UI, application architecture

Architecture of applications that use Sciter based UI can be visualized as this: Typically such applications contain two distinct layers: UI layer that uses Sciter window with loaded HTML/CSS and scripts (code behind UI); Application logic layer, most of the time that is native code implementing logic of the application. Ideally these two layers shall…

Caret positions in HTML

Working on behavior:richtext again. This time for Sciter2. The behavior:richtext is the thing behind Sciter’s <richtext> element or <div contenteditable> in Web browsers. behavior:richtext in Sciter1 uses “flat” DOM model: div:element, paragraph:element, that model is similar to the RichTextBox in Windows. But in Sciter2 new behavior:richtext uses standard DOM model of HTML content: element:node, text:node,…