home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xfrmwnd.h < prev    next >
C/C++ Source or Header  |  1998-02-15  |  6KB  |  137 lines

  1. #ifndef __OOL_XFRAMEWND_H__
  2. #define __OOL_XFRAMEWND_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XFrameWindow                          */
  8. /*                       derived from: XWindow                               */
  9. /*                        last update: 6/97                                  */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13.  
  14. #include "xwindow.h"
  15. #include "XRect.h"
  16. #include "XColor.h"
  17. #include "XString.h"
  18. #include "XHandler.h"
  19. #include "XPoint.h"
  20. #include "XCntrEvn.h"
  21. #include "XRes.h"
  22. #include "XScrlbar.h"
  23. #include "XMenu.h"
  24. #include "XApp.h"
  25. #include "XIcon.h"
  26.  
  27. #ifdef OOL_FOR_OS2_X86
  28.    #define FRM_TITLEBAR         0x00000001
  29.    #define FRM_SYSMENU          0x00000002
  30.    #define FRM_SIZEBORDER       0x00000008
  31.    #define FRM_MINBUTTON        0x00000010
  32.    #define FRM_MAXBUTTON        0x00000020
  33.    #define FRM_CENTER           0x00080000
  34.    #define FRM_DIALOGBORDER     0x00000100
  35.    #define FRM_BORDER           0x00000200
  36.    #define FRM_TASKLIST         0x00000800
  37.    #define FRM_NOBYTEALIGN      0x00001000
  38.    #define FRM_NOMOVEWITHOWNER  0x00002000
  39.    #define FRM_ICON             0x00004000
  40.    #define FRM_ACCELTABLE       0x00008000
  41.    #define FRM_SYSMODAL         0x00010000
  42.    #define FRM_SCREENALIGN      0x00020000
  43.    #define FRM_MOUSEALIGN       0x00040000
  44.    #define FRM_HIDEBUTTON       0x01000000
  45.    #define FRM_HIDEMAX          0x01000020
  46.    #define FRM_AUTOICON         0x40000000
  47.    #define FRM_MENU             FCF_MENU
  48. #endif
  49.  
  50.  
  51. class _export_ XFrameWindow : public XWindow{
  52.       friend class XMenuBar;
  53.       friend class XPopupMenu;
  54.       friend class XFrameControl;
  55.       friend class XHelpInstance;
  56.       friend class XObjectWindow;
  57.       friend class XFrame;
  58.       friend class XToolBar;
  59.       friend class ToolBarParent;
  60.       friend MRESULT EXPENTRY DProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  61.       friend MRESULT EXPENTRY WindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  62.       friend MRESULT HandleFrameDefault( XFrameWindow * w, ULONG msg, MPARAM mp1, MPARAM mp2, BOOL& handled);
  63.       friend MRESULT EXPENTRY ScrollProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  64.    protected:
  65.       XScrollBar * vert, *horz;
  66.    public:
  67.       enum __WindowStyles__ {
  68.                 defaultStyle = FRM_TITLEBAR | FRM_SYSMENU | FRM_SIZEBORDER | FRM_MINBUTTON | FRM_MAXBUTTON | WIN_VISIBLE,
  69.                 defaultDialogStyle = FRM_TITLEBAR | FRM_SYSMENU | FRM_DIALOGBORDER | WIN_VISIBLE,
  70.                 defaultClientStyle = FRM_BORDER | WIN_VISIBLE
  71.       };
  72.    protected:
  73.       HSWITCH sEntry;
  74.       OOL_WINDOWHANDLE dummy;
  75.       XFrame * frameWin;
  76.       XWindow * clientWindow;
  77.       XFrameWindow * lockingWin;
  78.       OOL_WINDOWHANDLE frame, dlgHandle;
  79.       BOOL enabled;
  80.       PFNWP oldfunc;
  81.       LONG backCol;
  82.       void CreateWindow( const ULONG id, const XResourceLibrary * lib,
  83.                      const char * title =NULL,
  84.                      const ULONG createstyle = defaultStyle,
  85.                      const XRect * rec = NULL,
  86.                      const XFrameWindow * parent=NULL,
  87.                      const BOOL buildFromResources = FALSE,
  88.                      const BOOL animate = FALSE);
  89.    public:
  90.       XFrameWindow( const XResource * resource,
  91.                      const char * title =NULL,
  92.                      const ULONG createstyle = defaultStyle,
  93.                      const XRect& rec = XRect(),
  94.                      const XFrameWindow * parent=NULL,
  95.                      const BOOL buildFromResources = FALSE,
  96.                      const BOOL animate = FALSE);
  97.       XFrameWindow( const ULONG id,
  98.                      const char * title =NULL,
  99.                      const ULONG createstyle = defaultStyle,
  100.                      const XRect& rec = XRect(),
  101.                      const XFrameWindow * parent=NULL,
  102.                      const BOOL buildFromResources = FALSE,
  103.                      const BOOL animate = FALSE);
  104.       virtual ~XFrameWindow();
  105.       void Activate( void ) const;
  106.       virtual void DoControl( XControlEvent*) { ;}
  107.       virtual void Draw ( void ) { ;}
  108.       void Enable( const BOOL enable = TRUE);
  109.       void EnableWindowUpdate ( const BOOL enable = TRUE ) const ;
  110.       void FillBackground( void );
  111.       virtual void GetBackgroundColor( XColor * rgbColor) const;
  112.       void GetClientSize( XRect *) const ;
  113.       OOL_WINDOWHANDLE GetHandle() const;
  114.       void GetSize( XRect* rect) const;
  115.       void GetText( XString * buffer ) const;
  116.       XWindow * GetWindow( const ULONG id);
  117.       virtual void InitMenu( XMenu *) {;}
  118.       virtual BOOL QueryForClose( void ) { return TRUE; }
  119.       XMenuBar * GetMenu( void ) const ;
  120.       virtual BOOL SetBackgroundColor( const XColor*);
  121.       void SetBottom(void) const ;
  122.       BOOL SetClient( const XWindow * c);
  123.       void SetIcon( const XIcon *);
  124.       void SetSize( const XRect * rect) const;
  125.       void SetSize( const ULONG xPos, const ULONG yPos, const ULONG width, const ULONG height) const;
  126.       void SetText(const char * buffer);
  127.       void SetTop(void) const;
  128.       void Show( const BOOL show=TRUE);
  129.       void ShowModal( XFrameWindow *  );
  130.       void Minimize() const;
  131.       void Maximize() const;
  132.       void Restore() const;
  133. };
  134.  
  135.  
  136. #endif
  137.