home *** CD-ROM | disk | FTP | other *** search
/ Prima Shareware 3 / DuCom_Prima-Shareware-3_cd1.bin / PROGRAMO / PASCAL / TOOLTIP / DEMO.PAS next >
Encoding:
Pascal/Delphi Source File  |  1994-10-10  |  1.3 KB  |  61 lines

  1. {ToolTip demonstration program (C) Antony Lewis 1994        }
  2. {Uses the DEMO.RES resource file for the toolbar.           }
  3. {The buttons do nothing except demonstrate the ToolTips     }
  4. {It is the toolbar from Crossword Compiler for Windows v2.03}
  5. program Demo;
  6. {$R DEMO.RES}
  7.  
  8. uses WinTypes, WinProcs, OWindows, Toolbar, ToolTip;
  9.  
  10. type
  11.   TDemoApp = object(TApplication)
  12.     procedure InitMainWindow; virtual;
  13.   end;
  14.  
  15. Type PMain=^TMain;
  16.      TMain=object(TWindow)
  17.      ToolBar:PHelpToolBar;
  18.      constructor init;
  19.      procedure RedoClientRect;virtual;
  20.      procedure WMSize(var Msg: TMessage);virtual wm_First + wm_Size;
  21. end;
  22.  
  23. constructor TMain.Init;
  24. begin
  25. inherited init(nil, 'Demo ToolTip program');
  26. Toolbar := New(PHelpToolbar, Init(@Self, 'Toolbar_1', tbHorizontal,500));
  27. end;
  28.  
  29. procedure TMain.RedoClientRect;
  30. var R: TRect;
  31.   procedure NotifyChildren( P: PWindow ); far;
  32.   begin
  33.     if P^.HWindow <> 0 then
  34.       SendMessage(P^.HWindow, am_CalcParentClientRect, AllowRepaint, Longint(@R));
  35.   end;
  36. begin
  37.   GetClientRect(HWindow, R);
  38.   ForEach(@NotifyChildren);
  39. end;
  40.  
  41. procedure TMain.WMSize(var Msg: TMessage);
  42. begin
  43.   RedoClientRect;
  44. end;
  45.  
  46.  
  47.  
  48. procedure TDemoApp.InitMainWindow;
  49. begin
  50.   MainWindow := New(PMain, Init);
  51. end;
  52.  
  53. var
  54.   DemoApp: TDemoApp;
  55.  
  56. begin
  57.   DemoApp.Init('DemoApp');
  58.   DemoApp.Run;
  59.   DemoApp.Done;
  60. end.
  61.