home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / include / xcontain.h < prev    next >
Text File  |  1997-02-23  |  4KB  |  95 lines

  1. #ifndef __OOL_XCONTAINER_H__
  2. #define __OOL_XCONTAINER_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------- OS/2 Beta 1 */
  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.  
  64. class _export_ XContainerControl: public XControl{
  65.       friend void BuildChilds( HWND );
  66.    private:
  67.       XContainerControl( const HWND hwnd): XControl(hwnd) {;}
  68.       void Clean( PRECORDCORE first );
  69.    public:
  70.       XContainerControl( const XWindow * owner, const XRect * rec, const USHORT id = 0, const ULONG style=WIN_VISIBLE|WIN_BORDER, const char * font = NULL);
  71.       virtual ~XContainerControl() { RemoveAll(TRUE); }
  72.       BOOL AddObject( XContainerObject * object, XContainerObject * parentObject=NULL, XContainerObject * siblingObject = (XContainerObject*) CON_END, BOOL draw = TRUE);
  73.       BOOL AddObjectList( XContainerObject ** objectList, const USHORT count, XContainerObject * parentObject=NULL, XContainerObject * siblingObject = (XContainerObject*) CON_END, BOOL draw = TRUE);
  74.       void Arrange(void) const ;
  75.       BOOL ExpandTreeObject( const XContainerObject *, const BOOL=TRUE) const ;
  76.       XContainerObject * FindObject( const XContainerObject * startObject = NULL, const SHORT select=CON_FIRST);
  77.       void HScroll( const LONG pix ) const ;
  78.       BOOL InsertColumn( const XContainerColumn * column, const XContainerColumn * insertBehind = NULL, const BOOL redraw = FALSE);
  79.       void InvalidateObject( const XContainerObject * obj = NULL, const SHORT option = CMA_REPOSITION) const ;
  80.       XContainerColumn * GetColumn( const XContainerColumn * col, const SHORT option);
  81.       void GetInfo( XContainerInfo*);
  82.       XContainerObject * GetObject( const XContainerObject * startObject = NULL, const SHORT filter= CON_SELECTED);
  83.       void RemoveAll( BOOL destroyObjects = TRUE );
  84.       BOOL RemoveColumn( XContainerColumn * column, const SHORT option);
  85.       BOOL RemoveObject( XContainerObject *, const BOOL destroyObject = TRUE, const BOOL redraw = FALSE) const ;
  86.       BOOL RemoveObjectList( XContainerObject **, const SHORT count, const BOOL destroyObject = TRUE, const BOOL redraw = FALSE) const ;
  87.       void SortObjects( void ) const ;
  88.       void SetInfo( XContainerInfo*);
  89.       void SetObjectEmphasis( const XContainerObject * obj, const SHORT emph, const BOOL enableEmph=TRUE) const ;
  90.       void UpdateColumns( void ) const;
  91.       void VScroll( const LONG pix ) const ;
  92. };
  93.  
  94. #endif
  95.