2.1 Dialog Definitions

A dialog system is to be created which first offers the user a table-like overview of names and addresses; now you may modify the overview in a sub-window. This overview consists of the first rows in a file. Since this file may contain a lot of rows, only parts of the rows will always be loaded and displayed. To realize such an overview, first a function is required to initialize the table, and second a reloading function is needed which will load new data in the table element when required.

A double-click on the table element is to open a modal detail window in which the data can be changed. According to the action, functions will be called which transfer this data via records as parameters to C functions for further processing.

2.1.1 Overview Window

The window is as follows:

Figure 3-1: Window name overview

In the dialog script this window is defined as follows:

window WnUebersicht
{
  .visible false;
  .active  false;
  .title   "name overview";
  .xleft   0;
  .width   50;
  .ytop    -2;
  .height  16;
  .iconic  false;
  .iconifyable true;
  child tablefield T1
  {
    .visible true;
    .xauto   0;
    .xleft   1;
    .xright  1;
    .yauto   0;
    .ytop    0;
    .ybottom 1;
    .posraster   true;
    .sizeraster  true;
    .fieldshadow false;
    .contentfunc CONTENT;
    .selection[sel_row]    true;
    .selection[sel_header] false;
    .selection[sel_single] false;
    .colcount 3;
    .rowcount 30;
    .rowheadshadow true;
    .rowheader 1;
    .colfirst  1;
    .rowfirst  2;
    .colwidth[0]  12;
    .rowheight[0] 1;
    .rowlinewidth[1] 3;
    .content[1,1] "name";
    .content[1,2] "first name";
    .content[1,3] "city";
    .xraster 10;
    .yraster 16;
  }
  child pushbutton PENDE
  {
    .xleft 36;
    .width 11;
    .yauto -1;
    .text  "&exit";
  }
}

2.1.2 Detail Window

The complete data belonging to a name is represented in a subwindow which has been defined as a dialogbox in which the user can modify the data.

The window in which data can be modified is as follows:

Figure 3-2: Detail Window

The definition for the window in the script is the following:

window WnName
{
  .visible false;
  .active  false;
  .title   "0";
  .xleft   110;
  .width   50;
  .ytop    80;
  .height  13;
  .dialogbox   true;
  .iconifyable true;
  integer AktivesLand := 0;
  child Eintrag Lname
  {
    .ytop 0;
    .S.text "name";
    .E.active  false;
    .E.content "";
  }
  child Eintrag Lfirstname
  {
    .ytop 2;
    .S.text "first name";
    .E.content "";
  }
  child Eintrag Lcity
  {
    .ytop 4;
    .S.text "city";
    .E.content "";
  }
  child Eintrag Lstreet
  {
    .ytop 6;
    .S.text "street";
    .E.content "";
  }
  child pushbutton PbAbbrechen
  {
    .xleft 22;
    .width 11;
    .ytop  10;
    .text  "&exit";
  }
  child pushbutton PbOk
  {
    .xauto  -1;
    .width  12;
    .xright 1;
    .ytop   10;
    .text   "OK";
  }
  child radiobutton GERMANY
  {
    .active true;
    .text   "Germany";
    .xleft  3;
    .ytop   8;
    .posraster  true;
    .sizeraster true;
    .userdata   1;
    .LandesCode := 1;
  }
  child radiobutton EUROPE
  {
    .active false;
    .text   "europe";
    .xleft  19;
    .ytop   8;
    .posraster  true;
    .sizeraster true;
    .userdata   2;
    .LandesCode := 2;
  }
  child radiobutton OTHER
  {
    .active false;
    .text   "others";
    .xleft  33;
    .ytop   8;
    .posraster  true;
    .sizeraster true;
    .userdata   3;
    .LandesCode := 3;
  }
}

For an easier definition of this window a model has been introduced which consists of a groupbox with a statictext and an edittext as children. Instances of this model serve as children of the detail window. The corresponding definition in the dialog script is as follows:

model groupbox Eintrag
{
  .xleft  2;
  .width  45;
  .height 2;
  .borderwidth 0;
  child statictext S
  {
    .sensitive false;
    .xleft 0;
    .ytop  0;
  }
  child edittext E
  {
    .xleft 12;
    .width 30;
    .ytop  0;
  }
}

2.1.3 Messagebox

A messagebox will inform you once all entries have been read from the file.

Figure 3-3: Messagebox

messagebox Mb
{
  .text  "There are no\nentries in this\nfile anymore!";
  .title "attention";
  .icon  icon_error;
  .button[1] button_ok;
  .button[2] nobutton;
  .button[3] nobutton;
}