home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 3.ddi / OWLINC.ZIP / DIALOG.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.9 KB  |  102 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #ifndef __DIALOG_H
  4. #define __DIALOG_H
  5.  
  6. #ifndef __APPLICAT_H
  7. #include <applicat.h>
  8. #endif
  9.  
  10. #pragma option -Vo-
  11. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  12. #pragma option -po-
  13. #endif
  14.  
  15. const int BAD_DIALOG_STATUS = -2;
  16.  
  17. /* TDialog creation atributes */
  18. struct _CLASSTYPE TDialogAttr { // _CLASSTYPE needed by BC++ 2.0
  19.     LPSTR Name;
  20.     DWORD Param;
  21. };
  22.  
  23.   /* TDialog */
  24.  
  25. _CLASSDEF(TDialog)
  26.  
  27. class _EXPORT TDialog : public TWindowsObject
  28. {
  29. public:
  30.     TDialogAttr Attr;
  31.     BOOL IsModal;
  32.  
  33.     TDialog(PTWindowsObject AParent, LPSTR AName, PTModule AModule = NULL);
  34.     TDialog(PTWindowsObject AParent, int ResourceId, PTModule AModule = NULL);
  35.     virtual ~TDialog();
  36.  
  37.     virtual BOOL Create();
  38.     virtual int Execute();
  39.  
  40.     virtual void CloseWindow(int ARetValue);
  41.     virtual void CloseWindow();
  42.     virtual void ShutDownWindow(int ARetValue);
  43.     virtual void ShutDownWindow();
  44.     virtual void Destroy(int ARetValue);
  45.     virtual void Destroy();
  46.  
  47.     void SetCaption(LPSTR ATitle);
  48.  
  49. /* Returns the handle of the dialog's control with the passed Id.*/
  50.     HWND GetItemHandle(int DlgItemID)
  51.       { return GetDlgItem(HWindow, DlgItemID); }
  52.  
  53. /* Sends the passed message to the dialog's control which has
  54.    the Id DlgItemID. */
  55.     DWORD SendDlgItemMsg(int DlgItemID, WORD AMsg, WORD WParam, DWORD LParam)
  56.       { return SendDlgItemMessage(HWindow, DlgItemID, AMsg, WParam, LParam); }
  57.  
  58.  
  59.     virtual classType        isA() const
  60.     { return dialogClass; }
  61.     virtual Pchar nameOf() const
  62.         { return "TDialog"; }
  63.  
  64.     static PTStreamable build();
  65.  
  66. protected:
  67.     virtual void GetWindowClass(WNDCLASS _FAR & AWndClass);
  68.     virtual LPSTR GetClassName();
  69.     virtual void SetupWindow();
  70.     virtual void Ok(RTMessage Msg) = [ID_FIRST + IDOK];
  71.     virtual void Cancel(RTMessage Msg) = [ID_FIRST + IDCANCEL];
  72.     virtual void WMInitDialog(RTMessage Msg) = [WM_FIRST + WM_INITDIALOG];
  73.     virtual void WMQueryEndSession(RTMessage Msg) =
  74.                  [WM_FIRST + WM_QUERYENDSESSION];
  75.     virtual void WMClose(RTMessage Msg) = [WM_FIRST + WM_CLOSE];
  76.  
  77.     TDialog(StreamableInit) : TWindowsObject(streamableInit) {};
  78.     virtual void write (Ropstream os);
  79.     virtual Pvoid read (Ripstream is);
  80.  
  81. private:
  82.     virtual const Pchar streamableName() const
  83.         { return "TDialog"; }
  84. };
  85.  
  86. inline Ripstream operator >> ( Ripstream is, RTDialog cl )
  87.     { return is >> (RTStreamable)cl; }
  88. inline Ripstream operator >> ( Ripstream is, RPTDialog cl )
  89.     { return is >> (RPvoid)cl; }
  90.  
  91. inline Ropstream operator << ( Ropstream os, RTDialog cl )
  92.     { return os << (RTStreamable )cl; }
  93. inline Ropstream operator << ( Ropstream os, PTDialog cl )
  94.     { return os << (PTStreamable)cl; }
  95.  
  96. #pragma option -Vo.
  97. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  98. #pragma option -po.
  99. #endif
  100.  
  101. #endif
  102.