Differences between revisions 5 and 8 (spanning 3 versions)
Revision 5 as of 2015-12-31 00:33:17
Size: 2103
Editor: clifford
Comment:
Revision 8 as of 2015-12-31 01:09:52
Size: 4337
Editor: clifford
Comment:
Deletions are marked like this. Additions are marked like this.
Line 30: Line 30:

Line 45: Line 43:
    init_query(&gl_query[0]);
Line 48: Line 45:
----
== 4, convert the s_flddes lists ==
=== converting rep and lstr programs ===
in rep and lstr type of program , we normally have one page for inputs, if more then one list exist need to combine them into one.

=== converting cont programs ===
in cont programs we will have multiple pages, due to historical reason each page will have 2 fields lists one for labels and one for input fields.

following are the definition of a nonclickable program field lists

{{{
GLOBAL COUNT nscrn = 2;//number of pages
GLOBAL struct s_outflddes *scrnarray[] = {NULL, scrn, scrn2};//labels list for each page
GLOBAL struct s_flddes *procarray[] = {NULL, flds, flds2};//inputs list for each page
GLOBAL struct s_outflddes scrn[] =
    {
    {0,COMPUTE,COMPARE,0,"",&Debug,NORECBUF,INTEGER,INTEGER|CONSTANT,YES},
    {IF_EQUAL,OUTPUT, 4,OCOL1,"58t.'auto-allocate unallocated amounts when posting trans'' :'"},
    {0,OUTPUT, LINE+1,OCOL1,"58t.'default period - week/month (W/M)'' :'"},
    {0,OUTPUT, LINE+1,OCOL1,"58t.'use private customer group'' :'"},
    {0,OUTPUT, LINE+1,OCOL1,"58t.'customer lookups by contact details'' :'"},
    {0,NULL},
    } ;
GLOBAL struct s_flddes flds[] =
    {
    {0,COMPUTE,COMPARE,0,"",&Debug,NORECBUF,INTEGER,INTEGER|CONSTANT,YES},
    {IF_EQUAL,EDIT,4 ,ICOL1,"yn", OFFSET(s_drcont, dissct), CONTROL, CHAR},
    {0,EDIT|SPECIAL,LINE+1,ICOL1,"mw", OFFSET(s_drcont, defper), CONTROL, CHAR,0,0,0,0,speclfunc},
    {0,EDIT,LINE+1,ICOL1,"yn", OFFSET(s_drcont, priv_grp), CONTROL, CHAR},
    {0,EDIT,LINE+1,ICOL1,"yn", OFFSET(s_drcont, use_contact), CONTROL, CHAR},
    {0,NULL},
    } ;
GLOBAL struct s_outflddes scrn[] =
    {
    //something
    .......
    .......
    } ;
GLOBAL struct s_flddes flds[] =
    {
    //something
    ......
    ......
    } ;
}}}
the above example define a cont program contain 2 pages and their fields lists.

note that the page start at array[1].

to convert do the following

 * convert all the LINE+1 to actual numbers
 * only reserve the lines which is either DISPLAY or EDIT or INPUT
 * remove the SPECIAL flags
 * zero all the IF_* flags.
 * add the handle number so later can identify a paticular field in the list.

Converting Input screen from non-clickable to clickable

1, Indroduction.

A simplified explanation of how the original program work was show in following diagram,

origin.jpeg

As shown in the diagram, we create a edit field for field 1, then after the user finish editing it we remove it. In other words, at any instance only one edit field was presented, the other field which look like a edit field is actually a label which look like a edit field. So that is why clicking on the other fields will not work.


To be able to have a clickable program , we must have every edit field present the same time. Following is a simplified version of what is going on when the program was converted.

newparam.jpeg

The main different between the old way and the new way, is how we process the field list. As explain above, the old way put a field immediately on the screen when going through the field list. The new way instead of showing it straight the way, we allocate the field to a parameter dialogue box which will be shown once every field was added to the box. When we show the dialogue box, it will contain all the fields. So the user can click amount the fields.


2, Overview of the convertion.

currently the following types of program can be converted.

  • lstr
  • rep
  • cont

to convert any of these program invlove the following step

  1. declear the program use the clickable dialogue.
  2. convert the s_flddes / s_outflddes lists
  3. implement the "paramctl()" function.


3, declear using clickable dialogue.

since we cannot convert all the program in the same time so we need a way to define which program is clickable and which program is not.

To declear a program is clickable simply set the global variable "guiparamready" to YES in the spclinit() function, the spclinit() function get run in the very beginning of the run time.

following is an example

spclinit()
    {
    IMPORT BOOL guiparamready;
    guiparamready = YES;
    }


4, convert the s_flddes lists

converting rep and lstr programs

in rep and lstr type of program , we normally have one page for inputs, if more then one list exist need to combine them into one.

converting cont programs

in cont programs we will have multiple pages, due to historical reason each page will have 2 fields lists one for labels and one for input fields.

following are the definition of a nonclickable program field lists

GLOBAL  COUNT   nscrn = 2;//number of pages
GLOBAL  struct  s_outflddes *scrnarray[] = {NULL, scrn, scrn2};//labels list for each page
GLOBAL  struct  s_flddes    *procarray[] = {NULL, flds, flds2};//inputs list for each page
GLOBAL  struct  s_outflddes scrn[] =
    {
    {0,COMPUTE,COMPARE,0,"",&Debug,NORECBUF,INTEGER,INTEGER|CONSTANT,YES},
    {IF_EQUAL,OUTPUT, 4,OCOL1,"58t.'auto-allocate unallocated amounts when posting trans'' :'"},
    {0,OUTPUT, LINE+1,OCOL1,"58t.'default period - week/month (W/M)'' :'"},
    {0,OUTPUT, LINE+1,OCOL1,"58t.'use private customer group'' :'"},
    {0,OUTPUT, LINE+1,OCOL1,"58t.'customer lookups by contact details'' :'"},
    {0,NULL},
    } ;
GLOBAL  struct  s_flddes    flds[] =
    {
    {0,COMPUTE,COMPARE,0,"",&Debug,NORECBUF,INTEGER,INTEGER|CONSTANT,YES},
    {IF_EQUAL,EDIT,4 ,ICOL1,"yn", OFFSET(s_drcont, dissct),      CONTROL, CHAR},
    {0,EDIT|SPECIAL,LINE+1,ICOL1,"mw", OFFSET(s_drcont, defper),      CONTROL, CHAR,0,0,0,0,speclfunc},
    {0,EDIT,LINE+1,ICOL1,"yn", OFFSET(s_drcont, priv_grp),    CONTROL, CHAR},
    {0,EDIT,LINE+1,ICOL1,"yn", OFFSET(s_drcont, use_contact),  CONTROL, CHAR},
    {0,NULL},
    } ;
GLOBAL  struct  s_outflddes scrn[] =
    {
    //something
    .......
    .......
    } ;
GLOBAL  struct  s_flddes    flds[] =
    {
    //something
    ......
    ......
    } ;

the above example define a cont program contain 2 pages and their fields lists.

note that the page start at array[1].

to convert do the following

  • convert all the LINE+1 to actual numbers
  • only reserve the lines which is either DISPLAY or EDIT or INPUT
  • remove the SPECIAL flags
  • zero all the IF_* flags.
  • add the handle number so later can identify a paticular field in the list.

CONTROL/Software/Development/Clickable (last edited 2016-01-11 23:47:29 by test10)