home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / DELPHI / GBUTTON / GBTNAPP.PAS < prev    next >
Pascal/Delphi Source File  |  1995-04-27  |  2KB  |  75 lines

  1. program GButtonApp;
  2.  
  3. {---------------------------------------------------------------------
  4. Very simple example application for the custom control GraphicButton
  5. (GButtons.DLL) of the SMWCC 2.0 Custom Control Pack
  6.  
  7. Copyright (C) by Sebastian Modersohn
  8.  
  9. Note: This code file isn't documented into detail. If you have
  10.       questions to *THIS* code file or want to know some details
  11.       please contact me via CompuServe, ID 100340,1474.
  12. ---------------------------------------------------------------------}
  13.  
  14. {$IFNDEF AUTOLOAD}
  15.  
  16.   You HAVE to compile this program with the global defined symbol "AUTOLOAD" !
  17.   This demonstrates the autoloading feature of the import unit GButton!
  18. {$ENDIF}
  19.  
  20. {$R GBtnApp}
  21.  
  22. uses WinTypes, WinProcs, OWindows, ODialogs, Strings, BWCC,
  23.      {the import unit for the button; only used for autoloading!}
  24.      GButton, GBtnCo;
  25.  
  26. type
  27.   PGButtonWindow = ^TGButtonWindow;
  28.   TGButtonWindow = object(TDlgWindow)
  29.     constructor Init(AParent: PWindowsObject; AName: PChar);
  30.  
  31.     procedure SetupWindow; virtual;
  32.  
  33.     procedure Help(var Msg: TMessage);
  34.       virtual id_First + idHelp;
  35.   end;
  36.  
  37. {App thatinitializes the main window}
  38.   PGButtonApp = ^TGButtonApp;
  39.   TGButtonApp = object(TApplication)
  40.     procedure InitMainWindow; virtual;
  41.   end;
  42.  
  43. { TGButtonWindow }
  44.  
  45. constructor TGButtonWindow.Init(AParent: PWindowsObject; AName: PChar);
  46. begin
  47.   inherited Init(AParent, AName);
  48. end;
  49.  
  50. procedure TGButtonWindow.SetupWindow;
  51. begin
  52.   inherited SetupWindow;
  53. end;
  54.  
  55. procedure TGButtonWindow.Help(var Msg: TMessage);
  56. begin
  57.   WinHelp(HWindow, HelpFile, Help_Context, 100);
  58. end;
  59.  
  60. { TGButtonApp }
  61.  
  62. procedure TGButtonApp.InitMainWindow;
  63. begin
  64.   MainWindow := New(PGButtonWindow, Init(nil, 'dlg_main'));
  65. end;
  66.  
  67. var
  68.   App: TGButtonApp;
  69.  
  70. begin
  71.   App.Init('GButton Demo');
  72.   App.Run;
  73.   App.Done;
  74. end.
  75.