Page tree
Skip to end of metadata
Go to start of metadata

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.

 

Qube Logo (smile)

 

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.

 

Qube Form Example # 1
<?xml version="1.0" encoding="utf-8"?>

<Qube>

	<QubeForm qxmlid="TestAppForm" terminal="Default" type="Form">
		<HandlerController qxmlid="Main">
			<Text qxmlid="label1">Message: </Text>
			<Edit qxmlid="textBox2">
				<Text>Hi, How are you?</Text>
			</Edit>
			<Button qxmlid="btnSend">
				<Handler name="Event" value="Send">
					<Argument name="data" value="msg..." />
				</Handler>
				<Text>Send</Text>
			</Button>
		</HandlerController>
	</QubeForm>

</Qube>

 

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.

 

Qube Lang Example
<?xml version="1.0" encoding="utf-8"?>
<Qube>
    <QubeLang location="en" default="true">
       <LangItem id="txtInfo">Count of pictures:</LangItem>
       <LangItem id="btnSend">Send</LangItem>
    </QubeLang>
    <QubeLang location="cs">
       <LangItem id="txtInfo">Pocet obrazku:</LangItem>
       <LangItem id="btnSend">Poslat</LangItem>
    </QubeLang>
</Qube>

 

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.

 

Qube Form Example # 2
<?xml version="1.0" encoding="utf-8"?>

<Qube>
    <QubeForm resizeable="true" closeable="true" 
              qxmlid="ApplicationsForm" type="Applications">
    	<Style>
			<Property name="width" value="645" />
			<Property name="height" value="364" />
			<Property name="color" value="ControlText" />
			<Property name="background-color" value="Control" />
    	</Style>

    	<Caption>Applications</Caption>

    	<HandlerController>

      		<Button type="submit" enabled="true" qxmlid="button44">
        		<Text>Nsys.Demo</Text>
        		<Handler name="SystemEvent" value="SwitchProcess" runat="server">
          			<Argument name="ClassName" value="Nsys.Demo.NsysDemo" />
        		</Handler>
        		<Style>
          			<Property name="top" value="302" />
          			<Property name="left" value="480" />
          			<Property name="width" value="150" />
          			<Property name="height" value="23" />
          			<Property name="color" value="ControlText" />
          			<Property name="background-color" value="Control" />
        		</Style>
      		</Button>
    	</HandlerController>
    </QubeForm>
</Qube>

 

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:

  1. For direct creation you can use methods CreateElement and AddChild from class XmlDocument.
  2. Modification of XML document loaded from file system.
  3. 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.


Related Topics

  • No labels