home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xcontobj.h < prev    next >
C/C++ Source or Header  |  1997-11-01  |  3KB  |  63 lines

  1. #ifndef __OOL_XCONTOBJECT_H__
  2. #define __OOL_XCONTOBJECT_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XContainerObject                      */
  8. /*                       derived from: XObject                               */
  9. /*                        last update: 8/97                                  */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13.  
  14.  
  15. #include "xobject.h"
  16. #include "xcontain.h"
  17. #include "XBitmap.h"
  18. #include "XIcon.h"
  19. #include "xdate.h"
  20. #include "xtime.h"
  21. #include "xstring.h"
  22.  
  23.  
  24. class XContainerControl;
  25. class XString;
  26. class XTime;
  27. class XDate;
  28.  
  29. class _export_ XContainerObject: public XObject
  30. {
  31.       friend XContainerControl;
  32.       friend MRESULT HandleDefault(XWindow * w, ULONG msg, MPARAM mp1, MPARAM mp2, BOOL & handled);
  33.    private:
  34.       RECORDCORE * core;
  35.       char * GetColumnPointer( SHORT column) { return (char *) ((PBYTE) core + sizeof(RECORDCORE) + sizeof(void*) + column * sizeof(void*)); }
  36.    protected:
  37.       XString title;
  38.    public:
  39.       XContainerObject( const XContainerControl * owner, const SHORT columns = 0, const LONG attr = 0);
  40.       virtual ~XContainerObject() { ;}
  41.       virtual BOOL AllocMemory( char * oldText, SHORT newTextLength, XContainerColumn* ) { return FALSE;}
  42.       LONG GetEmphasis( void ) const { return core->flRecordAttr; }
  43.       void GetBitmap( XBitmap *);
  44.       void GetIcon( XIcon * );
  45.       void GetTitle( XString *);
  46.       void SetBitmap( const XBitmap * b) { core->hbmBitmap = b->GetHandle(); }
  47.       void SetColumnData( const SHORT column, const char * data) { memcpy( GetColumnPointer(column), &data, sizeof(PVOID)); }
  48.       void SetColumnData( const SHORT column, const LONG data) { memcpy( GetColumnPointer(column), &data, sizeof(LONG)); }
  49.       void SetColumnData( const SHORT column, const XBitmap*bitmap) { LONG buffer = bitmap->GetHandle(); memcpy( GetColumnPointer(column), &buffer, sizeof(LONG)); }
  50.       void SetColumnData( const SHORT column, const XDate * data) { memcpy( GetColumnPointer(column), &data->d, 4); }
  51.       void SetColumnData( const SHORT column, const XIcon * icon) { LONG buffer = icon->GetHandle(); memcpy( GetColumnPointer(column), &buffer, sizeof(LONG)); }
  52.       void SetColumnData( const SHORT column, const XTime * data) { memcpy( GetColumnPointer(column), &data->t, 3); }
  53.       void SetIcon( const XIcon * icon) { core->hptrIcon = icon->GetHandle(); }
  54.       void SetMiniBitmap( const XBitmap* b) {core->hbmMiniBitmap = b->GetHandle();}
  55.       void SetMiniIcon( const XIcon* icon) { core->hptrMiniIcon = icon->GetHandle(); }
  56.       void SetTitle( char * t) { title = t; core->pszIcon = core->pszName = core->pszTree = core->pszText = (PSZ) (char*) title; }
  57.       virtual SHORT Sort( const XContainerObject*) const { return 0; }
  58.       virtual void TitleEdited( const char *, XContainerColumn* col = NULL) { ;}
  59. };
  60.  
  61.  
  62. #endif
  63.