Browse Source

* enhancements by Charlie/INQ

Tomas Hajny 26 years ago
parent
commit
ee52225f00
1 changed files with 11 additions and 7 deletions
  1. 11 7
      rtl/os2/tests/basicpm.pas

+ 11 - 7
rtl/os2/tests/basicpm.pas

@@ -1,7 +1,7 @@
 program BasicPM;
 program BasicPM;
 
 
 uses
 uses
- Os2Def, PMWin, PMGpi;
+ Os2Def, PMWin;
 
 
 function ClientWindowProc (Window, Msg: cardinal; MP1, MP2: pointer): pointer;
 function ClientWindowProc (Window, Msg: cardinal; MP1, MP2: pointer): pointer;
                                                                  cdecl; export;
                                                                  cdecl; export;
@@ -15,9 +15,9 @@ begin
  ClientWindowProc := nil;
  ClientWindowProc := nil;
  case Msg of
  case Msg of
   wm_Paint: begin
   wm_Paint: begin
-             PS := WinBeginPaint(Window, 0, nil);
-             GpiErase(PS);
-             WinEndPaint(PS);
+             PS := WinBeginPaint (Window, 0, @R);
+             WinFillRect (PS, @R, SYSCLR_WINDOW);
+             WinEndPaint (PS);
             end;
             end;
   else ClientWindowProc := WinDefWindowProc (Window, Msg, MP1, MP2);
   else ClientWindowProc := WinDefWindowProc (Window, Msg, MP1, MP2);
  end;
  end;
@@ -37,12 +37,16 @@ begin
  Anchor := WinInitialize(0);
  Anchor := WinInitialize(0);
  { It might be beneficial to set the second parameter of the following }
  { It might be beneficial to set the second parameter of the following }
  { call to something large, such as 1000.  The OS/2 documentation does }
  { call to something large, such as 1000.  The OS/2 documentation does }
- { not recommend this, however } MsgQue := WinCreateMsgQueue(Anchor, 0);
+ { not recommend this, however } MsgQue := WinCreateMsgQueue (Anchor, 0);
  if MsgQue = 0 then Halt (254);
  if MsgQue = 0 then Halt (254);
- WinRegisterClass (Anchor, ClassName, proc (ClientWindowProc), cs_SizeRedraw,
+
+ WinMessageBox (HWND_DESKTOP, HWND_DESKTOP, 'FPC test', 'BASIC PM', 0,
+                                                      MB_OK or MB_INFORMATION);
+
+ WinRegisterClass (Anchor, ClassName, proc (@ClientWindowProc), cs_SizeRedraw,
                                                              SizeOf (pointer));
                                                              SizeOf (pointer));
  Frame := WinCreateStdWindow (hwnd_Desktop, 0, WinFlags, ClassName,
  Frame := WinCreateStdWindow (hwnd_Desktop, 0, WinFlags, ClassName,
-                                       'BASIC', 0, 0, idClientWindow, Client);
+                                     'BASIC PM', 0, 0, idClientWindow, Client);
  if (Frame <> 0) then
  if (Frame <> 0) then
  begin
  begin
   WinSetWindowPos (Frame, 0, 0, WinQuerySysValue (hwnd_Desktop,
   WinSetWindowPos (Frame, 0, 0, WinQuerySysValue (hwnd_Desktop,