home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / include / xwindow.h < prev    next >
C/C++ Source or Header  |  1997-03-07  |  5KB  |  121 lines

  1. #ifndef __OOL_XWINDOW_H__
  2. #define __OOL_XWINDOW_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------- OS/2 Beta 1 */
  6. /*===========================================================================*/
  7. /*                              class: XWindow                               */
  8. /*                       derived from: XObject                               */
  9. /*                        last update: 12/96                                 */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13. #include "xobject.h"
  14. #include "XRect.h"
  15. #include "XColor.h"
  16. #include "XString.h"
  17. #include "xHandler.h"
  18. #include "XPoint.h"
  19. #include "XCntrEvn.H"
  20.  
  21. class XFrameWindow;
  22. class XSize;
  23.  
  24. #define OOL_ADDCLIENT  WM_USER + 9987
  25.  
  26. #ifdef OOL_FOR_OS2_X86
  27.    #define WIN_VISIBLE  WS_VISIBLE
  28.    #define WIN_BORDER   FS_BORDER
  29.    #define WIN_ANIMATE  WS_ANIMATE
  30.    #define WIN_PARENT   QW_PARENT
  31.    #define WIN_NEXT     QW_NEXT
  32.    #define WIN_PREV     QW_PREV
  33.    #define WIN_TOP        QW_TOP
  34.    #define WIN_BOTTOM    QW_BOTTOM
  35.    #define WIN_OWNER        QW_OWNER
  36.    #define WIN_PARENT    QW_PARENT
  37.    #define WIN_NEXTTOP    QW_NEXTTOP
  38.    #define WIN_PREVTOP    QW_PREVTOP
  39.  
  40.    #define PTR_ARROW    SPTR_ARROW
  41.    #define PTR_TEXT     SPTR_TEXT
  42.    #define PTR_WAIT     SPTR_WAIT
  43.    #define PTR_SIZE     SPTR_SIZE
  44.    #define PTR_SIZENWSE SPTR_SIZENWSE
  45.    #define PTR_SIZENESW SPTR_SIZENESW
  46.    #define PTR_SIZEWE   SPTR_SIZEWE
  47.    #define PTR_SIZENS   SPTR_SIZENS
  48.    #define PTR_MOVE     SPTR_MOVE
  49.    #define PTR_ILLEGAL  SPTR_ILLEGAL
  50.  
  51. #endif
  52.  
  53. class _export_ XWindow: public XObject
  54. {
  55.       friend MRESULT HandleDefault( XWindow * w, ULONG msg, MPARAM mp1, MPARAM mp2, BOOL& handled);
  56.       friend MRESULT HandleFrameDefault( XFrameWindow * w, ULONG msg, MPARAM mp1, MPARAM mp2, BOOL& handled);
  57.       friend class XHandler;
  58.       friend class XFrameWindow;
  59.       friend class XScrollWindow;
  60.       friend class XFrame;
  61.       friend class XNoteBook;
  62.    private:
  63.       XHandler ** regHandlers;
  64.       USHORT handlers;
  65.    protected:
  66.       OOL_WINDOWHANDLE winhandle;
  67.       XWindow( )
  68.             {
  69.                winhandle = 0;
  70.                handlers = 0;
  71.                regHandlers = NULL;
  72.             }
  73.    public:
  74.       virtual ~XWindow();
  75.       virtual void Activate( void );
  76.       virtual BOOL DoCommand( LONG ) { return FALSE;}
  77.       virtual void DoControl( XControlEvent *);
  78.       virtual void DoMove( void ) { ;}
  79.       virtual void DoSize( XSize* ) { ;}
  80.       virtual void Draw( void ) { ;}
  81.       virtual void Enable( const BOOL enable = TRUE);
  82.       virtual void EnableWindowUpdate ( const BOOL update = TRUE) const ;
  83.       virtual void FocusChanged( BOOL ) { ;}
  84.       virtual void GetBackgroundColor( XColor * rgbColor);
  85.       virtual LONG GetClientHandle( void ) const { return winhandle; }
  86.       void GetForegroundColor( XColor * rgbColor);
  87.       virtual OOL_WINDOWHANDLE GetHandle(void) const {return winhandle;}
  88.       virtual void GetSize( XRect* rect) const;
  89.       virtual void GetText( XString * buffer );
  90.         virtual void GetUpdateRect( XRect*);
  91.       virtual XWindow * XWindow :: GetWindow( const ULONG id );
  92.       virtual SHORT GetWindowID( void ) const;
  93.       virtual void Invalidate( BOOL invalidateChilds = FALSE );
  94.       virtual BOOL IsVisible( void ) const;
  95.       virtual BOOL IsEnabled( void ) const;
  96.       void GetFontName( XString *);
  97.       static void GetPointerPos( XPoint * p);
  98.       static OOL_POINTERHANDLE GetPointerHandle( void );
  99.       virtual ULONG GetStyle(void) const;
  100.       static OOL_POINTERHANDLE GetSystemPointerHandle( LONG theID, BOOL copy = FALSE );
  101.       virtual LONG GetTextLength( void);
  102.       virtual XWindow * QueryWindow( const ULONG id ) const ;
  103.       static void * SendMsg( const OOL_WINDOWHANDLE handle, const ULONG msg, void * mp1, void * mp2) { return WinSendMsg( handle, msg, mp1, mp2); }
  104.       BOOL SetBackgroundColor( const XColor * rgbColor) const;
  105.       virtual void SetBottom( void ) const ;
  106.       BOOL SetFocus( void ) const ;
  107.       BOOL SetForegroundColor( const XColor * rgbColor) const;
  108.       BOOL SetFont(const char * fontName, const unsigned short fontSize) const;
  109.       BOOL SetFont(const char * fontNameSize) const;
  110.       virtual void SetOwner( const XWindow * w ) const;
  111.       virtual void SetParent( const XWindow * w, const BOOL redraw = FALSE) const;
  112.       static BOOL SetPointer( const OOL_POINTERHANDLE thePointer);
  113.       virtual void SetSize( const XRect * rect) const;
  114.       virtual void SetStyle( const ULONG style);
  115.       virtual void SetText(const char * text);
  116.       virtual void SetTop( void ) const;
  117.       virtual void Show( const BOOL show = TRUE);
  118. };
  119.  
  120. #endif
  121.