~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to rtl/os2/tests/basicpm.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
program BasicPM;
2
 
 
3
 
uses
4
 
 Os2Def, PMWin;
5
 
 
6
 
function ClientWindowProc (Window, Msg: cardinal; MP1, MP2: pointer): pointer;
7
 
                                                                 cdecl; export;
8
 
var
9
 
 Li: longint;
10
 
 Ps: cardinal;
11
 
 R: TRectL;
12
 
 P: TPointL;
13
 
 Rgn: cardinal;
14
 
begin
15
 
 ClientWindowProc := nil;
16
 
 case Msg of
17
 
  wm_Paint: begin
18
 
             PS := WinBeginPaint (Window, 0, @R);
19
 
             WinFillRect (PS, @R, SYSCLR_WINDOW);
20
 
             WinEndPaint (PS);
21
 
            end;
22
 
  else ClientWindowProc := WinDefWindowProc (Window, Msg, MP1, MP2);
23
 
 end;
24
 
end;
25
 
 
26
 
const
27
 
 idClientWindow = 11000;
28
 
 WinFlags: cardinal = fcf_TitleBar + fcf_SysMenu + fcf_SizeBorder +
29
 
                                   fcf_MinMax + fcf_TaskList + fcf_NoByteAlign;
30
 
 ClassName = 'MYVIEW';
31
 
 
32
 
var
33
 
 Anchor, MsgQue: cardinal;
34
 
 Message: TQMsg;
35
 
 Frame, Client: cardinal;
36
 
begin
37
 
 Anchor := WinInitialize(0);
38
 
 { It might be beneficial to set the second parameter of the following }
39
 
 { call to something large, such as 1000.  The OS/2 documentation does }
40
 
 { not recommend this, however } MsgQue := WinCreateMsgQueue (Anchor, 0);
41
 
 if MsgQue = 0 then Halt (254);
42
 
 
43
 
 WinMessageBox (HWND_DESKTOP, HWND_DESKTOP, 'FPC test', 'BASIC PM', 0,
44
 
                                                      MB_OK or MB_INFORMATION);
45
 
 
46
 
 WinRegisterClass (Anchor, ClassName, proc (@ClientWindowProc), cs_SizeRedraw,
47
 
                                                             SizeOf (pointer));
48
 
 Frame := WinCreateStdWindow (hwnd_Desktop, 0, WinFlags, ClassName,
49
 
                                     'BASIC PM', 0, 0, idClientWindow, Client);
50
 
 if (Frame <> 0) then
51
 
 begin
52
 
  WinSetWindowPos (Frame, 0, 0, WinQuerySysValue (hwnd_Desktop,
53
 
         sv_CyScreen) - 200, 200, 200, swp_Move + swp_Size + swp_Activate +
54
 
                                                                     swp_Show);
55
 
  while WinGetMsg (Anchor, Message, 0, 0, 0) do
56
 
                                              WinDispatchMsg (Anchor, Message);
57
 
 
58
 
  WinDestroyWindow (Frame);
59
 
 end;
60
 
 WinDestroyMsgQueue (MsgQue);
61
 
 WinTerminate (Anchor);
62
 
end.