home *** CD-ROM | disk | FTP | other *** search
- {ToolTip demonstration program (C) Antony Lewis 1994 }
- {Uses the DEMO.RES resource file for the toolbar. }
- {The buttons do nothing except demonstrate the ToolTips }
- {It is the toolbar from Crossword Compiler for Windows v2.03}
- program Demo;
- {$R DEMO.RES}
-
- uses WinTypes, WinProcs, OWindows, Toolbar, ToolTip;
-
- type
- TDemoApp = object(TApplication)
- procedure InitMainWindow; virtual;
- end;
-
- Type PMain=^TMain;
- TMain=object(TWindow)
- ToolBar:PHelpToolBar;
- constructor init;
- procedure RedoClientRect;virtual;
- procedure WMSize(var Msg: TMessage);virtual wm_First + wm_Size;
- end;
-
- constructor TMain.Init;
- begin
- inherited init(nil, 'Demo ToolTip program');
- Toolbar := New(PHelpToolbar, Init(@Self, 'Toolbar_1', tbHorizontal,500));
- end;
-
- procedure TMain.RedoClientRect;
- var R: TRect;
- procedure NotifyChildren( P: PWindow ); far;
- begin
- if P^.HWindow <> 0 then
- SendMessage(P^.HWindow, am_CalcParentClientRect, AllowRepaint, Longint(@R));
- end;
- begin
- GetClientRect(HWindow, R);
- ForEach(@NotifyChildren);
- end;
-
- procedure TMain.WMSize(var Msg: TMessage);
- begin
- RedoClientRect;
- end;
-
-
-
- procedure TDemoApp.InitMainWindow;
- begin
- MainWindow := New(PMain, Init);
- end;
-
- var
- DemoApp: TDemoApp;
-
- begin
- DemoApp.Init('DemoApp');
- DemoApp.Run;
- DemoApp.Done;
- end.
-