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

  1. #ifndef __OOL_XCONTAINER_H__
  2. #define __OOL_XCONTAINER_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XContainerControl                     */
  8. /*                       derived from: XControl                              */
  9. /*                        last update: 9/96                                  */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13.  
  14. #include "xcontrol.h"
  15.  
  16. #ifdef OOL_FOR_OS2_X86
  17.    #ifndef CRA_SOURCE
  18.       #define CRA_SOURCE  0x00004000L
  19.    #endif
  20.  
  21.    //container creation styles
  22.    #define CON_AUTOPOSITION CCS_AUTOPOSITION
  23.    #define CON_EXTENDSEL    CCS_EXTENDSEL
  24.    #define CON_MULTIPLESEL  CCS_MULTIPLESEL
  25.    #define CON_READONLY     CCS_READONLY
  26.    #define CON_SINGLESEL    CCS_SINGLESEL
  27.  
  28.    //object-emphasis, can be or-ed
  29.    #define CON_CURSORED         CRA_CURSORED
  30.    #define CON_DISABLED         CRA_DISABLED
  31.    #define CON_INUSE            CRA_INUSE
  32.    #define CON_PICKED           CRA_PICKED
  33.    #define CON_SELECTED         CRA_SELECTED
  34.    #define CON_SOURCE           CRA_SOURCE
  35.    #define CON_RECORDREADONLY   CRA_RECORDREADONLY
  36.    #define CON_EXPANDED         CRA_EXPANDED
  37.  
  38.    //enumeration styles (FindObject)
  39.    #define CON_FIRST      CMA_FIRST
  40.    #define CON_FIRSTCHILD CMA_FIRSTCHILD
  41.    #define CON_LAST       CMA_LAST
  42.    #define CON_LASTCHILD  CMA_LASTCHILD
  43.    #define CON_NEXT       CMA_NEXT
  44.    #define CON_PARENT     CMA_PARENT
  45.    #define CON_PREV       CMA_PREV
  46.    #define CON_END        CMA_END
  47.  
  48.    //other
  49.    #define CON_REPOSITION    CMA_REPOSITION
  50.    #define CON_NOREPOSITION  CMA_NOREPOSITION
  51.    #define CON_TEXTCHANGED   CMA_TEXTCHANGED
  52.    #define CON_ERASE         CMA_ERASE
  53.  
  54.    #define CON_FREE       CMA_FREE
  55.    #define CON_INVALIDATE CMA_INVALIDATE
  56.  
  57. #endif
  58.  
  59. class XContainerInfo;
  60. class XContainerObject;
  61. class XContainerColumn;
  62.  
  63. class _export_ XContainerControl: public XControl{
  64.       friend void BuildChilds( HWND );
  65.       friend MRESULT HandleDefault(XWindow * w, ULONG msg, MPARAM mp1, MPARAM mp2, BOOL & handled);
  66.    private:
  67.       XContainerControl( const HWND hwnd): XControl(hwnd) {;}
  68.       void Clean( PRECORDCORE first );
  69.       XString title;
  70.    public:
  71.       XContainerControl( const XWindow * owner, const XRect& rec = XRect(), const USHORT id = 0, const ULONG style=WIN_VISIBLE|WIN_BORDER, const char * font = NULL);
  72.       virtual ~XContainerControl() { RemoveAll(TRUE); }
  73.       BOOL AddObject( XContainerObject * object, XContainerObject * parentObject=NULL, XContainerObject * siblingObject = (XContainerObject*) CON_END, BOOL draw = TRUE);
  74.       BOOL AddObjectList( XContainerObject ** objectList, const USHORT count, XContainerObject * parentObject=NULL, XContainerObject * siblingObject = (XContainerObject*) CON_END, BOOL draw = TRUE);
  75.       void Arrange(void) const ;
  76.       BOOL BeginEdit(const XContainerObject * obj, const XContainerColumn * col = NULL, const ULONG winID = 0) const;
  77.       virtual void DoHScroll( LONG pix) {;}
  78.       virtual void DoVScroll( LONG pix) {;}
  79.       void EndEdit() const;
  80.       BOOL ExpandTreeObject( const XContainerObject *, const BOOL=TRUE) const ;
  81.       XContainerObject * FindObject( const XContainerObject * startObject = NULL, const SHORT select=CON_FIRST);
  82.       BOOL FreeObject(XContainerObject*);
  83.       XContainerColumn * GetColumn( const XContainerColumn * col, const SHORT option);
  84.       void GetInfo( XContainerInfo*);
  85.       XContainerObject * GetObject( const XContainerObject * startObject = NULL, const SHORT filter= CON_SELECTED);
  86.       BOOL GetObjectRect(XRect * r, const XContainerObject * o, const BOOL rightWin = FALSE, const SHORT extension = 0) const ;
  87.       void HScroll( const LONG pix ) const ;
  88.       BOOL InsertColumn( const XContainerColumn * column, const XContainerColumn * insertBehind = NULL, const BOOL redraw = FALSE);
  89.       void InvalidateObject( const XContainerObject * obj = NULL, const SHORT option = CMA_REPOSITION) const ;
  90.       void RemoveAll( BOOL destroyObjects = TRUE );
  91.       BOOL RemoveColumn( XContainerColumn * column, const SHORT option);
  92.       BOOL RemoveObject( XContainerObject *, const BOOL destroyObject = TRUE, const BOOL redraw = FALSE) const ;
  93.       BOOL RemoveObjectList( XContainerObject **, const SHORT count, const BOOL destroyObject = TRUE, const BOOL redraw = FALSE) const ;
  94.       void SortObjects( void ) const ;
  95.       void SetInfo( XContainerInfo*);
  96.       void SetObjectEmphasis( const XContainerObject * obj, const SHORT emph, const BOOL enableEmph=TRUE) const ;
  97.       virtual void TitleEdited( const char *) { ;}
  98.       void UpdateColumns( void ) const;
  99.       void VScroll( const LONG pix ) const ;
  100. };
  101.  
  102. #endif
  103.