home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / c / mobjm260 / sfxdlg.pa_ / sfxdlg.pa
Encoding:
Text File  |  1994-09-06  |  2.8 KB  |  104 lines

  1. (*******************************************************************)
  2. (*                                                                 *)
  3. (*          Microworks ObjectMate 2.6                                                      *)
  4. (*                                                                 *)
  5. (*     Windows Interface Develpment Kit the Borland Languages.     *)
  6. (*                                                                 *)
  7. (*         SFXDLG.PAS : Basic SFX dialog box                                *)
  8. (*                                                                                                                           *)
  9. (*     Copyright 1992-94 Microworks Sydney, Australia.               *)
  10. (*                                                                 *)
  11. (*******************************************************************)
  12.  
  13. (* The SFX dialog sample creates basic SFX dialog using the modifiable class
  14.  * 'SFXDlg'. This class lets you set the dialog style by passing one or more
  15.  * of the ObjectMate window style flags in the Attr.Param field. The constructor
  16.  * lists all the possible style flag variations and SetupWindow uses the
  17.  * 'CenterWindow' function to center the dilaog box over the desktop window.
  18.  *)
  19.  
  20. program SFXDlg;
  21.  
  22. uses WinTypes, WinProcs, SFX200,
  23.          {$IFDEF Ver15}
  24.              WObjects;
  25.          {$ELSE}
  26.              Objects, OWindows, ODialogs;
  27.          {$ENDIF}
  28.  
  29. {$R SFXDlg.res}
  30.  
  31. const
  32.  
  33.     AppName : PChar = 'SFXDialog';
  34.  
  35. type
  36.  
  37.     PSFXDialog = ^TSFXDialog;
  38.     TSFXDialog = object(TDialog)
  39.         constructor Init(AParent: PWindowsObject; AName: PChar);
  40.         destructor Done; virtual;
  41.         procedure SetUpWindow; virtual;
  42.         procedure WMPaint (var Msg: TMessage); virtual wm_First + wm_Paint;
  43.     end;
  44.  
  45.     PSFXApp = ^TSFXApp;
  46.     TSFXApp = object(TApplication)
  47.         procedure InitMainWindow; virtual;
  48.     end;
  49.  
  50. {********** TSFXApp **********}
  51.  
  52. procedure TSFXApp.InitMainWindow;
  53. begin
  54.     MainWindow := New(PSFXDialog, Init(nil, 'SFXDialog'));
  55. end;
  56.  
  57. {********** TSFXDialog **********}
  58.  
  59. constructor TSFXDialog.Init(AParent: PWindowsObject; AName: PChar);
  60. begin
  61.     TDialog.Init(AParent, AName);
  62.     {Attr.Param := mws_FramedClient;}
  63.     {Attr.Param := mws_RaisedClient;}
  64.     {Attr.Param := mws_Glaze;}
  65.     {Attr.Param := mws_Steel;}
  66.     {Attr.Param := mws_SFXFrame;}
  67.     {Attr.Param := mws_3DFrame;}
  68.     {Attr.Param := mws_3DGlaze;
  69.     {Attr.Param := mws_3DSteel;}
  70.     {Attr.Param := mws_Framed3DFrame;}
  71.     {Attr.Param := mws_Framed3DGlaze}
  72.     {Attr.Param := mws_Framed3DSteel;}
  73.     {Attr.Param := mws_Raised3DFrame;}
  74.     {Attr.Param := mws_Raised3DGlaze;}
  75.     Attr.Param := mws_Raised3DSteel;
  76.     {Attr.Param := Attr.Param or MWS_SFXCAPTION;}
  77. end;
  78.  
  79. destructor TSFXDialog.Done;
  80. begin
  81.     TDialog.Done;
  82. end;
  83.  
  84. procedure TSFXDialog.SetUpWindow;
  85. begin
  86.     TDialog.SetUpWindow;
  87.     CenterWindow(0, HWindow);
  88. end;
  89.  
  90. procedure TSFXDialog.WMPaint (var Msg: TMessage);
  91. begin
  92.     TDialog.DefWndProc(Msg);
  93. end;
  94.  
  95. {********** Main program **********}
  96.  
  97. var
  98.     App: TSFXApp;
  99. begin
  100.     App.Init(AppName);
  101.     App.Run;
  102.     App.Done;
  103. end.
  104.