home *** CD-ROM | disk | FTP | other *** search
-
- {$M 20000,0,655360}
- {-- Defaults }
- {$A-} {-- A- byte alignment }
- {$B-} {-- B- short circuit boolean evaluation }
- {$D+} {-- D- No debug info }
- {$E-} {-- E- No emulation }
- {$F-} {-- F- Far calls only when necessary }
- {$I-} {-- I- I/O error checking done internally }
- {$L+} {-- L- No local symbols }
- {$N-} {-- N- Software reals }
- {$R-} {-- R- Range checking off }
- {$S-} {-- S- Stack overflow off }
- {$V-} {-- V- No strict type checking }
-
- uses virtmem,
- errorlog,
- teglfont,
- teglmain,
- tegledit,
- tgraph,
- teglintr,
- teglmenu,
- teglpick,
- teglunit,
- fastgrph;
-
- var pickeditem : string;
-
- {$F+}
- Function ExitOption(fs:ImageStkPtr; ms: MsClickPtr) : Word;
- {$F+}
- BEGIN
- Abortexit(pickeditem);
- exitoption := 1;
- END;
-
- {$F+}
- function droppicklist(fs:ImageStkPtr; Userkey:word; Var DataArea):Word;
- {$F-}
- var picklist : optionmptr absolute DataArea;
- begin
- dropoptionmenu(picklist);
- droppicklist := 0;
- END;
-
- {$F+}
- Function Gotitem(fs:ImageStkPtr; ms: MsClickPtr) : Word;
- {$F+}
- begin
- beep(500,4,50);
- gotitem := 1;
- end;
-
- procedure createtestpicklist;
- var x,y,x1,y1 : word;
- ax,ay,ax1,ay1 : word;
- picklist : optionmptr;
- ifs : imagestkptr;
- margins : word;
- maxwidth : word;
- begin
- x := 100;
- y := 100;
- x1 := x+200;
- y1 := y+200;
- margins := 2;
- maxwidth := 150;
-
- pushimage(x,y,x1,y1);
- shadowbox(x,y,x1,y1);
-
- {---------------------------------------------------------------------}
- { Create an edit event to allow the user to edit the selected item }
- {---------------------------------------------------------------------}
- ax := 10+2+margins; {<-- pick list adds 2 pixel before the text}
- ay := 10+2;
- ax1 := ax+MaxWidth;
- ay1 := ay+14; {<-- Font height}
-
- setkeyboardmouse(false);
- ifs := stackptr;
- DefineStrEditEvent(ifs,ax,ay,ax1,ay1,40,blue,@font14,true,
- pickeditem,Allchars,StrRedisplay,StrRedisplay,nilunitproc);
- AddMouseClickMask(getlastmsptr(ifs),@Maskcursor,2,6);
-
-
- {---------------------------------------------------------------------}
- { Create drop down pick list event }
- {---------------------------------------------------------------------}
- picklist := createpicklist(@font14);
- setpicklistmargin(picklist,margins);
- setpicklistwidth(picklist,maxwidth);
- DefinePickItem(picklist,'item one on list',gotitem,pickeditem);
- DefinePickItem(picklist,'item two on list',gotitem,pickeditem);
- DefinePickItem(picklist,'item three on list',gotitem,pickeditem);
-
- definepicklistarea(ifs,10,10,3,1,picklist);
-
- {---------------------------------------------------------------------}
- { define a user data area for the picklist with an arbitrary }
- { key of 222. }
- {---------------------------------------------------------------------}
- setuserdataarea(ifs,222,picklist,droppicklist);
-
- { pushimage(400,100,500,300);
- shadowbox(400,100,500,300); }
- end;
-
- begin
- EasyTegl;
- EasyOut;
-
- createtestpicklist;
-
- TEGLSupervisor;
- end.