Thursday, June 28, 2012

SVG Surface

A few months ago I've made an experiment: I've created a canvas-independent class that rendered on a SVG. Then, I've added a simple interface that allowed me to render the SVG on an operating-system dependent surface. This was a base for an UI based on SVG and completely independent of the OS. After a few more testing, I've decided to integrate this surface in Concept Client 2.0.190. So here it is:


All the buttons are defined in XML:

_Common.svg
<svg width="500" height="300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 <defs>
  <linearGradient id="linearGradient1">
   <stop stop-color="#ffb100" offset="0"/>
   <stop stop-color="#ffb100" stop-opacity="0.498039" offset="0.5"/>
   <stop stop-color="#ffffff" offset="1"/>
  </linearGradient>
  <linearGradient y2="-0.000052" x2="0.519006" y1="2.485417" x1="0.527431" id="linearGradient11" xlink:href="#linearGradient1"/>

  <linearGradient id="linearGradient2">
   <stop stop-color="#ffff00" offset="0"/>
   <stop stop-color="#ffff00" stop-opacity="0.498039" offset="0.5"/>
   <stop stop-color="#ffffff" offset="1"/>
  </linearGradient>
  <linearGradient y2="-0.000052" x2="0.519006" y1="2.485417" x1="0.527431" id="linearGradient12" xlink:href="#linearGradient2"/>

  <linearGradient id="linearGradient3">
   <stop stop-color="#ffb1ff" offset="0"/>
   <stop stop-color="#ffb1ff" stop-opacity="0.498039" offset="0.5"/>
   <stop stop-color="#ffffff" offset="1"/>
  </linearGradient>
  <linearGradient y2="-0.000052" x2="0.519006" y1="2.485417" x1="0.527431" id="linearGradient13" xlink:href="#linearGradient3"/>

 </defs>
 <metadata>image/svg+xml</metadata>
</svg>


Button.svg
<control class="Button">
    <svg for="normal" width="70" height="30">
        <rect fill="url(#linearGradient11)" stroke-width="0.799956" stroke-opacity="0.805" ry="5.809992" y="0" x="0" height="100%" width="100%"/>
    </svg>

    <svg for="prelight" width="70" height="30">
        <rect fill="url(#linearGradient12)" stroke-width="0.799956" stroke-opacity="0.805" ry="5.809992" y="0" x="0" height="100%" width="100%"/>
    </svg>

    <svg for="clicked" width="70" height="30">
        <rect fill="url(#linearGradient13)" stroke-width="0.799956" stroke-opacity="0.805" ry="5.809992" y="0" x="0" height="100%" width="100%"/>
    </svg>
</control>



Label.svg
<control class="Label" passive="1">
    <svg for="normal" width="70" height="30">
        <text style="font-size: 12; fill:#A0A0A0; font-style:bold; stroke-width:2px; font-family: verdana, arial, sans-serif;" id="text3208" y="100%" x="0" xml:space="preserve">Hello !</text>
    </svg>

    <svg for="prelight" width="70" height="30">
        <text style="font-size: 12; fill:#ffffff; font-style:bold; stroke-width:2px; font-family: verdana, arial, sans-serif;" id="text3208" y="100%" x="0" xml:space="preserve">Hello !</text>
    </svg>

    <svg for="clicked" width="70" height="30">
        <text style="font-size: 12; fill:#FF8080; font-style:bold; stroke-width:2px; font-family: verdana, arial, sans-serif;" id="text3208" y="100%" x="2" xml:space="preserve">Hello !</text>
    </svg>
</control>



This surface enables you do easily define your own custom controls.

I think that this will be the base for Concept Client 4.0 IF and only IF I decide do get rid of GTK+. Gtk is a fabulous UI framework, but moving to my own, backwards-compatible framework, it will give Concept Applications a nicer look and feel. This is just an idea. Most probably I will use both GTK+ and SVG surfaces.

Now, this is Gyro!

video

Tuesday, June 26, 2012

Treeviewlicious

I've implemented lots of CRM's and search engines using GyroGears. Once in a while I get some unusual request, that GyroGears cannot fulfill

This happened yesterday, two times. A CRM client asked for a solution to group similar client requests in view. Something like the e-mails. You get an e-mail, then a reply, and so on.

So I've decided to add this feature (it was done at about 2 AM in the morning).


As you can see, the "Cereri" (it means "Requests") objects are  grouped together (Notice the expander).


And all this is done by using a flag "Show in tree view when  possible". No other configuration required.

Now, about the second feature. This it will take me a few days. A client of mine asked to use simultaneous AND and OR filters. Now the filters are combined with AND by default and can be combined with OR by default. But never both AND and OR. This is now on my todo list, I hope to have it ready in about a week or so.

Thursday, June 21, 2012

Gyrolicious

I've had some unusual requests in the last two weeks, so I've decided to implement them in Gyro core.

The users asked for navigation buttons (next/previous) for objects. This derives from the fact that all day are using web browsers. And a web browser has next and previous buttons, so here there are:


Even the cursor now follows the displayed object. This is a really simple feature asked by the users.

In several projects I've needed a way to filter some records by some "assigned users". For example in a project management solution, it is possible to add a member called "Responsible" defined as a relation with the user entity. Then, you can set the member as a filter member, and when a user that is listed in the responsible field logs in, it will see only his tasks. Here is a simple example - a meeting and some invited users:


Now, only the invited users will see the meeting. Do notice the Filter level - a user of a greater level will see all the meetings.

Another request was regarding Xapian. When using indexed search, there were some limitation: you couldn't use filters, and the search felled back to the database engine (which is not a good idea when performing complex searches). Now, you can filter Xapian data. Also, sort was added for the results. The results are sorted only for equal relevance (sort first by relevance and then by the selected field).

As usual, lots of bug fixes. The main fix is in Concept Client - there was some inconvenient stuff happening when using multiple displays. The main form opened in a window and, in some cases, the child window in another window. Of course, you can specify programatically what screen to use. Now, the child windows always inherit the parent display.

Sunday, June 10, 2012

NuoDB driver

I've tested these days NuoDB. It's a promising database server, for now in Beta, but there are some problems, that make NuoDB somehow more like a pre-alpha release. It's cool, it's cloud, it's nice and is something that we all want and need: SQL on the NoSQL market - the cloud.

GyroGears already generates code for NuoDB, but since is so unstable, I don't recommend deploying Gyro applications on NuoDB.

The driver low level API's are "pre-documented" here:
http://www.radgs.com/docs/help/standard.db.nuo.html

And the high level version:
http://www.radgs.com/docs/help/NuoConnection.html
http://www.radgs.com/docs/help/NuoDataSet.html

Also, I've optimized the strings and the arrays in Concept core. I've reduced the number of memory reallocations, resulting in faster indexing times. I've added a compile-time flag for using std::map instead of my key-value implementation.

std::map is faster than my implementation when adding more than 200,000 key-value pairs, but I'm faster on access. Also, std::map uses at least 1/3 more memory than my implementation, due to its list-style implementation. I use static vectors, that reallocate when needed. This reallocation is somehow slow, but overall, it performs better.

The string operator += was optimized, being up to 20 times faster now, due to a new memory allocation strategy.

In Gyro, besides NuoDB driver, I've fixed a bug with pagination, discovered in the new version of Concept Client.