Re: User interfaces using XML



> Please supply a sample .uiml file for a simple application (such as
> notepad). 
 
> Paul
> 

Here goes:

<interface name="myNotePad" class="notepad">
  <commandgroup name="main" class="man">

In a GUI this would be the menu bar. A Graphical Inetrface could decide to put 
some of these on a toolbar, according to what class they are.

    <commandgroup name="file" class="file">

In a GUI this would be an item on the bar

      <semantic-commandgroup name="file1" class="weak">
        <command name="open" class="open">
          <connect signal="activate" message="command_open"/>

When this command is sctivated, the callback (corba method or whatever) 
'command_open' is called.

        </command>
        <command name="save" class="save">
          <connect signal="activate" message="command_save"/>
        </command>
        <command name="saveas" class="saveas">
          <connect signal="activate" message="command_saveas"/>
        </command>
      </semnatic-commandgroup>

Here would be a spacer

      <semnatic-commandgroup name="file2" class="weak">
        <command name="exit" class="exit">
          <connect signal="activate" message="command_exit"/>
        </command>
      </semnatic-commandgroup>
    </commandgroup>

Now for a standard edit menu. These could be activated by either clicking on 
them in a gui, Or the line 'edit.cut' in a script or even saying "edit-cut" in 
a speech interface.

    <commandgroup name="edit" class="edit">
      <command name="cut" class="cut">
        <connect signal="activate" message="command_cut"/>
      </command>
      <command name="copy" class="copy">
        <connect signal="activate" message="command_copy"/>
      </command>
      <command name="paste" class="paste">
        <connect signal="activate" message="command_paste"/>
      </command>
      <command name="find" class="find">
        <connect signal="activate" message="command_find"/>
      </command>
    </commandgroup>
  </commandgroup>

Now the actual data of the application

  <datagroup name="data" class="main">
    <data interface="text/multiple" arguments="editable;selections" 
name="text" class="notepad">
       <connect signal="change" message="text_change"/>

Ask to be notified whenever the text changes. This signal would be defined as 
part of a text/multiple interface.

    </data>
  </datagroup>

The find dialogue box (or series of questions). In retrospect this could have 
been included with the command 'find' above so that the command is more 
connected with the data it needs to execute.

  <dialogue name="find" class="find">
    <commandgroup name="commands" class="dialogue-commands">
      <command name="find" class="activate">

A standard "OK" button.

        <connect signal="activate" message="find"/>
      </command>
      <command name="cancel" class="cancel">
        <connect signal="activate" message="no_find"/>
      </command>
    </commandgroup>
    <datagroup name="find_data" class="dialogue_data">
      <data interface="text/single" arguments="editable" name="word" 
class="word">
      </data>
      <data interface="option/boolean" name="case_sensitive" 
class="case_sensitive">
      </data>
    </datagroup>
  </dialogue>
</interface>

The class names are there so that things like 'all activate commands are in 
24pt Times Roman and say "OK" except ones called "find" which say "Find"' in 
some kind of stylesheet system.

This would be a little clearer with some real code to back it up.

Bob




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]