home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xwindow.h < prev    next >
C/C++ Source or Header  |  1998-04-06  |  5KB  |  126 lines

  1. #ifndef __OOL_XWINDOW_H__
  2. #define __OOL_XWINDOW_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XWindow                               */
  8. /*                       derived from: XObject                               */
  9. /*                        last update: 3/98                                  */
  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_TABSTOP  WS_TABSTOP
  29.    #define WIN_BORDER   FS_BORDER
  30.    #define WIN_ANIMATE  WS_ANIMATE
  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.    #define WIN_FRAMEOWNER   QW_FRAMEOWNER
  40.  
  41.    #define PTR_ARROW    SPTR_ARROW
  42.    #define PTR_TEXT     SPTR_TEXT
  43.    #define PTR_WAIT     SPTR_WAIT
  44.    #define PTR_SIZE     SPTR_SIZE
  45.    #define PTR_SIZENWSE SPTR_SIZENWSE
  46.    #define PTR_SIZENESW SPTR_SIZENESW
  47.    #define PTR_SIZEWE   SPTR_SIZEWE
  48.    #define PTR_SIZENS   SPTR_SIZENS
  49.    #define PTR_MOVE     SPTR_MOVE
  50.    #define PTR_ILLEGAL  SPTR_ILLEGAL
  51.  
  52. #endif
  53.  
  54. class _export_ XWindow: public XObject
  55. {
  56.       friend MRESULT HandleDefault( XWindow * w, ULONG msg, MPARAM mp1, MPARAM mp2, BOOL& handled);
  57.       friend MRESULT HandleFrameDefault( XFrameWindow * w, ULONG msg, MPARAM mp1, MPARAM mp2, BOOL& handled);
  58.       friend class XHandler;
  59.       friend class XFrameWindow;
  60.       friend class XScrollWindow;
  61.       friend class XFrame;
  62.       friend class XNoteBook;
  63.    private:
  64.       XHandler ** regHandlers;
  65.       USHORT handlers;
  66.    protected:
  67.       OOL_WINDOWHANDLE winhandle;
  68.       XWindow( )
  69.          {
  70.             winhandle = 0;
  71.             handlers = 0;
  72.             regHandlers = NULL;
  73.          }
  74.    public:
  75.       virtual ~XWindow();
  76.       virtual void Activate( void ) const;
  77.       virtual void Close() const;
  78.       virtual BOOL DoCommand( LONG ) { return FALSE;}
  79.       virtual void DoControl( XControlEvent *);
  80.       virtual void DoMove( void ) { ;}
  81.       virtual void DoSize( XSize* ) { ;}
  82.       virtual BOOL DoSysCommand( USHORT syscom) { return TRUE;}
  83.       virtual void Draw( void ) { ;}
  84.       virtual void Enable( const BOOL enable = TRUE);
  85.       virtual void EnableWindowUpdate ( const BOOL update = TRUE) const ;
  86.       virtual void FocusChanged( BOOL ) { ;}
  87.       virtual void GetBackgroundColor( XColor * rgbColor) const;
  88.       virtual LONG GetClientHandle( void ) const { return winhandle; }
  89.       void GetForegroundColor( XColor * rgbColor) const;
  90.       virtual OOL_WINDOWHANDLE GetHandle(void) const {return winhandle;}
  91.       virtual void GetSize( XRect* rect) const;
  92.       static LONG GetSysValue( LONG valueID );
  93.       virtual void GetText( XString * buffer ) const;
  94.       virtual void GetUpdateRect( XRect*) const;
  95.       virtual XWindow * XWindow :: GetWindow( const ULONG id );
  96.       virtual SHORT GetWindowID( void ) const;
  97.       virtual void Invalidate( BOOL invalidateChilds = FALSE, XRect * rect = NULL );
  98.       virtual BOOL IsVisible( void ) const;
  99.       virtual BOOL IsEnabled( void ) const;
  100.       void GetFontName( XString *) const;
  101.       static void GetPointerPos( XPoint * p);
  102.       static OOL_POINTERHANDLE GetPointerHandle( void );
  103.       virtual ULONG GetStyle(void) const;
  104.       static OOL_POINTERHANDLE GetSystemPointerHandle( const LONG theID, const BOOL copy = FALSE );
  105.       virtual LONG GetTextLength( void) const;
  106.       virtual XWindow * QueryWindow( const ULONG id ) const;
  107.       static void * SendMsg( const OOL_WINDOWHANDLE handle, const ULONG msg, void * mp1, void * mp2) { return WinSendMsg( handle, msg, mp1, mp2); }
  108.       virtual BOOL SetBackgroundColor( const XColor * rgbColor);
  109.       virtual void SetBottom( void ) const ;
  110.       BOOL SetFocus( void ) const ;
  111.       virtual BOOL SetForegroundColor( const XColor * rgbColor) const;
  112.       BOOL SetFont(const char * fontName, const unsigned short fontSize) const;
  113.       BOOL SetFont(const char * fontNameSize) const;
  114.       virtual void SetOwner( const XWindow * w ) const;
  115.       virtual void SetParent( const XWindow * w, const BOOL redraw = FALSE) const;
  116.       static BOOL SetPointer( const OOL_POINTERHANDLE thePointer);
  117.       virtual void SetSize( const XRect * rect) const;
  118.       virtual void SetSize( const ULONG xPos, const ULONG yPos, const ULONG width, const ULONG height) const;
  119.       virtual void SetStyle( const ULONG style);
  120.       virtual void SetText(const char * text);
  121.       virtual void SetTop( void ) const;
  122.       virtual void Show( const BOOL show = TRUE);
  123. };
  124.  
  125. #endif
  126.