Qube is simple XML dialect used for user interface definition that contains a collection of various components including Edit (text field), Button, ImageView, Text etc. The appearance of the application to end-user is implemented at Nsys Terminal.
The Qube form describes appearance of the application (placing components on forms). The modification can change the appearance of the application, thereby achieving another presentation of information to user (e.g. remap buttons, add a picture). In case of change in the behavior of certain component, must be also modified the application code (e.g. insert a text label to a component). The basic modification may consider changing of CSS styles and images.
Description of Qube components that are available in Nsys Platform and example of usage can be found here. QubeLang is another part of Qube specification that can be used for various language versions of the Qube forms.
Each text item in the XML definition of QubeLang is defined by an attribute ID which is unique for the specific language version. As you can see from the example of QubeLang syntax above so in the case of new language support it is about adding of new language section with element QubeLang.
Each Qube element has an unique identifier qxmlid (Qube Xml Id). This identifier can be easily used for searching of components in the Qube document. Most components can contain nested element Style that adjusts display style of component such as dimensions or color.
In Qube specification you can find that Button component can contains nested element Handler that helps to define an action which is fired when button is pushed. It is worth noting the runat attribute specifies whether the event is executed on server or client side. When event is executed on server side then after button is pushed the terminal sends Qpacket which contains information about all changes in Qube document on client side. Nsys Terminal sends only changed components that are contained in the nearest parent element HandlerController and when creating XML document with these changes the plunge is ignored. All components are embedded directly in the root XML document. When processing XML with changes the search by qxmlid comes.
The main task of the server is processing requests and as a respond to these actions send a new Qube document representing the new appearance of the form. In the response may be included simultaneously several forms that can have different types (application form, modal window etc).
Create Qube documents manually can sometimes be a difficult process that can be resolved by using of a special application Nsys.Qube.Designer. It is used to generate a skeleton of Qube document. The application creates really just a skeleton and is therefore to be manually entered into the document some modifications, such as changing the type of form, HandlerController, Handler, etc.
The functionality of Nsys.Qube.Designer application is based on the load of .NET assembly that contains the forms that are derived from class System.Windows.Forms.Form. On this basis, it is possible to generate Qube documents according to one or more specified forms.
In case you want to use the functionality of Qube document generation then it is required to create a Windows form as part of .NET assembly. You can use instrument Visual Studio for this. It works with C# Express edition as well.
For creating of Qube XML documents exist following alternatives:
- For direct creation you can use methods CreateElement and AddChild from class XmlDocument.
- Modification of XML document loaded from file system.
- Create an instance of the class Nsys.Qube.QubeDocument from a XML document. Then modify the instance of class and store changes by serialization to XML.