| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778 |
- Listing:
- 1 (*-------------------------------------------------------------------------*
- 2 * *
- 3 * PMJP.MOD - Presentation manager demo *
- 4 * *
- 5 * COPYRIGHT (C) 1989..1992 Clarion Software Corporation. *
- 6 * All Rights Reserved *
- 7 * *
- 8 *--------------------------------------------------------------------------*)
- 9
- 10 MODULE PMJP;
- 11
- 12 (* Simple demonstation of a PM Application using Win and Gpi calls *)
- 13
- 14 (* This application can be used as the basis of a shell for your own
- 15 application
- 16 *)
- 17 (*# call(same_ds => off) *)
- 18 (*# data(heap_size=> 3000) *)
- 19
- 20
- 21 IMPORT OS2DEF,Win,Gpi,Dos,Lib,SYSTEM;
- 22 FROM OS2DEF IMPORT HDC,HRGN,HAB,HPS,HBITMAP,HWND,HMODULE,HSEM,
- ***** ^ duplicate identifier
- 23 POINTL,RECTL,PID,TID,LSET,NULL,
- 24 COLOR,NullVar,NullStr,BOOL ;
- 25
- 26 CONST
- 27 WindowId = 255;
- 28
- 29 VAR
- 30 Hab : HAB;
- 31 Hps : HPS;
- 32 BackColor : COLOR;
- 33 ForeColor : COLOR;
- 34 ChangeBack: BOOLEAN;
- 35
- 36
- 37
- 38
- 39 (*-------------------- Error reporting procedure ---------------------*)
- 40 PROCEDURE Error;
- 41 VAR
- 42 errinf : Win.PERRINFO;
- ***** ^ not supported yet
- 43 (*# save,
- 44 data(near_ptr=>off) *)
- 45 emsg : POINTER TO ARRAY[0..255] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 46 (*# restore *)
- 47 mbid : Win.MBID;
- ***** ^ not supported yet
- 48 win : HWND;
- 49 BEGIN
- 50 errinf := Win.GetErrorInfo(Hab);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 51 IF errinf=FarNIL THEN RETURN END;
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- 52 emsg := [SYSTEM.Seg(errinf^):CARDINAL([SYSTEM.Seg(errinf^):errinf^.Msg]^)];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 53 win := Win.QueryActiveWindow(Win.HWND_DESKTOP,B_FALSE);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- 54 mbid := Win.MessageBox(Win.HWND_DESKTOP,win,emsg^,'Error Returned',0,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 55 Win.MB_ICONHAND+Win.MB_CANCEL+Win.MB_MOVEABLE);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 56 IF Win.FreeErrorInfo(errinf^) THEN END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 57 END Error;
- ***** ^ not supported yet
- 58
- 59 (*-------------------- JP drawing ---------------------------------------*)
- 60
- 61 PROCEDURE DrawTitle;
- 62 (* Creates font and displays message *)
- 63 CONST
- 64 Title1 = 'TopSpeed Modula-2 Demonstration Program';
- ***** ^ not supported yet
- 65 Title2 = 'Mouse button 1 cycles Foreground';
- ***** ^ not supported yet
- 66 Title3 = 'Mouse button 2 cycles Background';
- ***** ^ not supported yet
- 67 Title4 = 'F3 exits program';
- ***** ^ not supported yet
- 68 VAR
- 69 pt : POINTL;
- 70 b : Gpi.SIZEF;
- ***** ^ not supported yet
- 71 BEGIN
- 72 pt.x := 1; pt.y := 1;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 73 IF NOT Gpi.SetCharShear(Hps,pt) THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 74 pt.x := 20; pt.y := 220;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 75 IF Gpi.CharStringAt(Hps,pt,SIZE(Title1),Title1)<0 THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 76 pt.x := 20; pt.y := 200;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 77 IF Gpi.CharStringAt(Hps,pt,SIZE(Title2),Title2)<0 THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 78 pt.x := 20; pt.y := 190;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 79 IF Gpi.CharStringAt(Hps,pt,SIZE(Title3),Title3)<0 THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 80 pt.x := 20; pt.y := 180;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 81 IF Gpi.CharStringAt(Hps,pt,SIZE(Title4),Title4)<0 THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 82 END DrawTitle;
- ***** ^ not supported yet
- 83
- 84 PROCEDURE DrawJp;
- 85 TYPE
- 86 Shade = (normal,light,dark);
- 87 A10 = ARRAY[0..9] OF CARDINAL;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 88 A6 = ARRAY[0..5] OF CARDINAL;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 89 A4 = ARRAY[0..3] OF CARDINAL;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 90 A3 = ARRAY[0..2] OF CARDINAL;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 91 CONST
- 92 Lx = A6(0,30,60,52,30,10);
- ***** ^ not supported yet
- 93 Ly = A6(50,40,53,57,48,55);
- ***** ^ not supported yet
- 94 Jx = A10(0, 30,30,0,0, 10,10,20,20,0);
- ***** ^ not supported yet
- 95 Jy = A10(50,40,0,10,25,21,15,12,33,40);
- ***** ^ not supported yet
- 96 Px = A6(60,30,30,40,40,60);
- ***** ^ not supported yet
- 97 Py = A6(53,40,0,5,15,25);
- ***** ^ not supported yet
- 98 P1x = A4(10,10,20,20);
- ***** ^ not supported yet
- 99 P1y = A4(15,21,26,20);
- ***** ^ not supported yet
- 100 P2x = A3(40,50,40);
- ***** ^ not supported yet
- 101 P2y = A3(25,30,35);
- ***** ^ not supported yet
- 102 P3x = A4(0, 10,20,10);
- ***** ^ not supported yet
- 103 P3y = A4(25,21,26,30);
- ***** ^ not supported yet
- 104 P4x = A3(10,20,20);
- ***** ^ not supported yet
- 105 P4y = A3(15,20,12);
- ***** ^ not supported yet
- 106 P5x = A3(50,50,40);
- ***** ^ not supported yet
- 107 P5y = A3(40,30,35);
- ***** ^ not supported yet
- 108
- 109 PROCEDURE Xlat(x,y:CARDINAL;VAR xo,yo:CARDINAL);
- 110 BEGIN
- 111 xo := x*3+80; yo := y*3;
- 112 END Xlat;
- ***** ^ not supported yet
- 113
- 114
- 115 PROCEDURE Polygon(xa,ya :ARRAY OF CARDINAL;
- ***** ^ not supported yet
- 116 c:Shade);
- 117 VAR
- 118 xt,yt: A10;
- ***** ^ not supported yet
- 119 i,n : CARDINAL;
- 120 pt : POINTL;
- 121 BEGIN
- 122 n := HIGH(xa)+1;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 123 FOR i := 0 TO n-1 DO Xlat(xa[i],ya[i],xt[i],yt[i]); END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 124 pt.x := LONGINT(xt[0]);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 125 pt.y := LONGINT(yt[0]);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 126 IF NOT Gpi.Move(Hps,pt) THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 127 CASE c OF
- ***** ^ not supported yet
- 128 | normal : IF NOT Gpi.SetPattern(Hps,Gpi.PATSYM_DENSE4) THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 129 | dark : IF NOT Gpi.SetPattern(Hps,Gpi.PATSYM_DENSE2) THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 130 | light : IF NOT Gpi.SetPattern(Hps,Gpi.PATSYM_DENSE6) THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 131 END;
- 132 IF NOT Gpi.SetBackMix(Hps,Gpi.BM_OVERPAINT) THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 133 IF NOT Gpi.BeginArea(Hps,Gpi.BA_BOUNDARY) THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 134 FOR i := 1 TO n-1 DO
- 135 pt.x := LONGINT(xt[i]);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 136 pt.y := LONGINT(yt[i]);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 137 IF Gpi.Line(Hps,pt)<0 THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 138 END ;
- 139 IF Gpi.EndArea(Hps)<0 THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 140 END Polygon;
- ***** ^ not supported yet
- 141
- 142 BEGIN
- 143 Polygon(Lx,Ly,dark);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 144 Polygon(Jx,Jy,light);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 145 Polygon(Px,Py,normal);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 146 Polygon(P1x,P1y,normal);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 147 Polygon(P2x,P2y,dark);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 148 Polygon(P3x,P3y,dark);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 149 Polygon(P4x,P4y,dark);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 150 Polygon(P5x,P5y,light);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 151 END DrawJp;
- ***** ^ not supported yet
- 152
- 153
- 154
- 155 (*-------------------- Start of window procedure ---------------------*)
- 156 (*# save,
- 157 call(near_call=>off, reg_param=>(), reg_saved=>(di,si,ds,es,st1,st2)) *)
- 158 PROCEDURE WindowProc(hwnd : HWND;msg:CARDINAL;mp1,mp2:Win.MPARAM):Win.MRESULT;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 159 VAR
- 160 rc : RECTL;
- 161 pt : POINTL;
- 162 r : CARDINAL;
- 163 hr : Gpi.HITSRET;
- ***** ^ not supported yet
- 164 cm : Win.CHARMSG;
- ***** ^ not supported yet
- 165 BEGIN
- 166 CASE msg OF
- 167 | Win.WM_PAINT:
- ***** ^ not supported yet
- ***** ^ not supported yet
- 168
- 169 (*----------------------------------------------------------------*)
- 170 (* Window contents are drawn here in WM_PAINT processing. *)
- 171 (*----------------------------------------------------------------*)
- 172
- 173 (* Obtain a cached micro PS *)
- 174 Hps := Win.BeginPaint( hwnd, HPS(NULL), rc );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 175
- 176 IF ChangeBack THEN
- 177 IF NOT Win.FillRect( Hps, rc, BackColor ) THEN (* Fill invalid rectangle *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 178 Error;
- ***** ^ not supported yet
- 179 END ;
- 180 END ;
- 181 ChangeBack := TRUE ;
- 182
- 183 IF NOT Gpi.SetColor( Hps, Gpi.CLR_RED) THEN (* Set color of the text *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 184 Error;
- ***** ^ not supported yet
- 185 END;
- 186 DrawTitle;
- ***** ^ not supported yet
- 187
- 188 IF NOT Gpi.SetColor( Hps, ForeColor) THEN (* Set color of the Block *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 189 Error;
- ***** ^ not supported yet
- 190 END;
- 191
- 192 DrawJp;
- ***** ^ not supported yet
- 193
- 194
- 195 IF NOT Win.EndPaint( Hps ) THEN (* Drawing is complete *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 196 Error;
- ***** ^ not supported yet
- 197 END;
- 198
- 199 | Win.WM_BUTTON1DOWN:
- ***** ^ not supported yet
- ***** ^ not supported yet
- 200
- 201 (*---------------------------------------------------------------*)
- 202 (* Mouse button 1 has been clicked, so first ensure we have the *)
- 203 (* input focus and then cycle the foreground color and cause the *)
- 204 (* the window to be redrawn. *)
- 205 (*---------------------------------------------------------------*)
- 206
- 207 IF NOT Win.SetFocus( Win.HWND_DESKTOP, hwnd ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 208 Error;
- ***** ^ not supported yet
- 209 END;
- 210
- 211 REPEAT
- 212 IF ForeColor=15 THEN ForeColor := 1 ELSE INC(ForeColor) END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 213 UNTIL ForeColor<>BackColor;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 214
- 215 ChangeBack := FALSE ;
- 216 IF NOT Win.InvalidateRect( hwnd, RECTL(NullVar), B_TRUE ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- 217 Error;
- ***** ^ not supported yet
- 218 END;
- 219
- 220 | Win.WM_BUTTON2DOWN:
- ***** ^ not supported yet
- ***** ^ not supported yet
- 221
- 222 (*---------------------------------------------------------------*)
- 223 (* Mouse button 2 has been clicked, so first ensure we have the *)
- 224 (* input focus and then cycle the background color and cause the *)
- 225 (* the window to be redrawn. *)
- 226 (*---------------------------------------------------------------*)
- 227
- 228 IF NOT Win.SetFocus( Win.HWND_DESKTOP, hwnd ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 229 Error;
- ***** ^ not supported yet
- 230 END;
- 231
- 232 REPEAT
- 233 IF BackColor=15 THEN BackColor := 1 ELSE INC(BackColor) END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 234 UNTIL ForeColor<>BackColor;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 235 ChangeBack := TRUE;
- 236
- 237 IF NOT Win.InvalidateRect( hwnd, RECTL(NullVar), B_TRUE ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- 238 Error;
- ***** ^ not supported yet
- 239 END;
- 240
- 241 | Win.WM_CHAR:
- ***** ^ not supported yet
- ***** ^ not supported yet
- 242
- 243 (*----------------------------------------------------------------*)
- 244 (* Character input is processed here. *)
- 245 (* The first two bytes of message parameter 2 contain *)
- 246 (* the character code. *)
- 247 (*----------------------------------------------------------------*)
- 248
- 249 cm := Win.CHARMSG(mp2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 250 IF cm.vkey = Win.VK_F3 THEN (* If the key pressed is F3,*)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 251 IF NOT Win.PostMsg( hwnd, Win.WM_QUIT, 0, 0 ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 252 Error;
- ***** ^ not supported yet
- 253 END; (* post a quit message to *)
- 254 END; (* end the application. *)
- 255
- 256 | Win.WM_CLOSE:
- ***** ^ not supported yet
- ***** ^ not supported yet
- 257
- 258 (*----------------------------------------------------------------*)
- 259 (* This is the place to put your termination routines *)
- 260 (*----------------------------------------------------------------*)
- 261
- 262 IF NOT Win.PostMsg( hwnd, Win.WM_QUIT, 0, 0 ) THEN (* Cause termination *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 263 Error;
- ***** ^ not supported yet
- 264 END;
- 265
- 266 ELSE
- 267
- 268 (*----------------------------------------------------------------*)
- 269 (* Everything else comes here. This call MUST exist *)
- 270 (* in your window procedure. *)
- 271 (*----------------------------------------------------------------*)
- 272
- 273 RETURN Win.DefWindowProc( hwnd, msg, mp1, mp2 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 274 END;
- 275 RETURN Win.MPARAM(FALSE);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 276
- 277 END WindowProc;
- ***** ^ not supported yet
- 278 (*# restore *)
- 279 (*--------------------- End of window procedure ----------------------*)
- 280
- 281 PROCEDURE Main;
- 282 VAR
- 283 hmq : Win.HMQ;
- ***** ^ not supported yet
- 284 qmsg : Win.QMSG;
- ***** ^ not supported yet
- 285 client : HWND;
- 286 frame : HWND;
- 287 createfl : LSET;
- 288 b : BOOLEAN;
- 289 r : Win.MRESULT;
- ***** ^ not supported yet
- 290
- 291 BEGIN
- 292 ForeColor := Gpi.CLR_BLUE;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 293 BackColor := Gpi.CLR_CYAN;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 294 ChangeBack := TRUE ;
- 295 Hab := Win.Initialize( NULL ); (* Initialize PM *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 296 hmq := Win.CreateMsgQueue( Hab, 0 ); (* Create a message queue *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 297
- 298 IF NOT Win.RegisterClass( (* Register window class *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- 299 Hab, (* Anchor block handle *)
- ***** ^ not supported yet
- 300 FarADR("MyWindow"), (* Window class name *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 301 WindowProc, (* Address of window procedure *)
- ***** ^ not supported yet
- 302 0, (* No special Class Style *)
- 303 0 (* No extra window words *)
- 304 ) THEN Error END;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 305
- 306 createfl := Win.FCF_TITLEBAR; (* Set Frame Control Flag *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 307
- 308 frame := Win.CreateStdWindow(
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 309 Win.HWND_DESKTOP, (* Desktop window is parent *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- 310 Win.FS_TASKLIST, (* Class Style *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- 311 createfl, (* Frame control flag *)
- ***** ^ not supported yet
- 312 FarADR("MyWindow"), (* Client window class name *)
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 313 ', TopSpeed Demo', (* Title *)
- ***** ^ not supported yet
- 314 0, (* No special class style *)
- 315 NULL, (* Resource is in .EXE file *)
- ***** ^ not supported yet
- 316 WindowId, (* Frame window identifier *)
- 317 client (* Client window handle *)
- ***** ^ not supported yet
- 318 );
- 319
- 320 IF NOT Win.SetWindowPos( frame, (* Set the size and position of *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 321 Win.HWND_TOP, (* the window before showing. *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- 322 100, 60, 350, 260,
- 323 Win.SWP_SIZE+Win.SWP_MOVE+Win.SWP_ACTIVATE+Win.SWP_SHOW
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 324 ) THEN Error END;
- ***** ^ not supported yet
- 325
- 326 (*----------------------------------------------------------------------*)
- 327 (* Get and dispatch messages from the application message queue *)
- 328 (* until WinGetMsg returns FALSE, indicating a WM_QUIT message. *)
- 329 (*----------------------------------------------------------------------*)
- 330 WHILE( Win.GetMsg( Hab, qmsg, HWND(NULL), 0, 0 ) ) DO
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 331 r := Win.DispatchMsg( Hab, qmsg );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 332 END;
- 333
- 334 IF NOT Win.DestroyWindow( frame ) THEN (* Tidy up... *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 335 Error;
- ***** ^ not supported yet
- 336 END;
- 337 IF NOT Win.DestroyMsgQueue( hmq ) THEN (* and *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 338 Error;
- ***** ^ not supported yet
- 339 END;
- 340 IF NOT Win.Terminate( Hab ) THEN (* terminate the application *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 341 Error;
- ***** ^ not supported yet
- 342 END;
- 343
- 344 END Main;
- ***** ^ not supported yet
- 345 (*---------------------- End of main procedure -----------------------*)
- 346
- 347 BEGIN
- 348 Main;
- ***** ^ not supported yet
- 349 END PMJP.
- 423 errors
|