home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / hpp.z / dtwobj.hpp < prev    next >
C/C++ Source or Header  |  1996-11-14  |  4KB  |  97 lines

  1. #ifndef _DTWOBJ_HPP
  2. #define _DTWOBJ_HPP
  3.  
  4. #include "dtobject.hpp"
  5. class ostream;
  6. class DTWForm;
  7.  
  8. enum MMWCodeGeneration {
  9.     MM_CG_AppInit,                      // "WRichTextBox::GetRegistered.."
  10.     MM_CB_HPP,                          // form1.hpp
  11.     MM_CB_CPP,                          // form1.cpp
  12.     MM_CB_RC,                           // form1.rc
  13.  
  14.     MM_CG_FORM_BaseClasses,             // base classes needed by this component
  15.     MM_CG_FORM_CreateDecl,              // "WBool Create( WWindow * );"
  16.     MM_CG_FORM_CreateDefn,              // "WBool Form1::Create( WWindow * )"
  17.     MM_CG_FORM_CallCreate,              // "ok = WWindow::Create( parent, ... )"
  18.  
  19.     MM_CG_HPP_EnumeratorID,             // "CB_1 = 101,"
  20.     MM_CG_HPP_EventDecl,                // "WBool cb_1_Clicked( ... );"
  21.     MM_CG_HPP_MemberDecl,               // "WCommandButton *  cb_1;"
  22.  
  23.     MM_CG_IncludeFiles,                 // "spindial.hpp"
  24.     MM_CG_IncludePaths,                 // "f:\mystuff\mycontrol\hpp"
  25.     MM_CG_Libraries,                    // "mycontrol.lib"
  26.     MM_CG_LibraryPaths,                 // "f:\mystuff\mycontrol\lib"
  27.  
  28.     MM_CG_ConstructorInitializer,       // "    , cb_1( NULL )"
  29.     MM_CG_ConstructorCode,              // "// any constructor code"
  30.  
  31.     MM_CG_InitNew,                      // "cb_1 = new WCommandButton;"
  32.     MM_CG_InitEventHandlerList,         // "WEventHandlerList cb_1_Event..."
  33.     MM_CG_InitEventHandlers,            // "cb_1->SetEventHandlerList( ... );"
  34.     MM_CG_RemoveEventHandlers,          // "cb_1->RemoveEventHandlerList( ... );"
  35.     MM_CG_InitDDXDataSource,            // "cb_1->SetDDXDataSource( ... );"
  36.     MM_CG_InitCreate,                   // "cb_1->Create( ... );"
  37.     MM_CG_InitProperties,               // "cb_1->SetFont( ... );"
  38.     MM_CG_CallCreateEventHandler,       // "cb_1->CallEventHandler( ... );"
  39.     MM_CG_CallDestroyEventHandler,      // "cb_1->CallEventHandler( ... );"
  40.     MM_CG_InitTransaction,              // "trans_1->Connect( ... );"
  41.     MM_CG_InitQuery,                    // "query_1->Open( ... );"
  42.     MM_CG_AutoOpenQuery,                // "WOptima::AuotOpen...;"
  43.     MM_CG_InitTabControl,               // "_TabForm1->Create( this, ...);"
  44.  
  45.     MM_CG_FiniTransaction,              // "trans_1->Disconnect();"
  46.     MM_CG_FiniQuery,                    // "query_1->Close();"
  47.     MM_CG_FiniDelete,                   // "delete cb_1;"
  48.     MM_CG_FiniReset,                    // "cb_1 = NULL;"
  49.  
  50.     MM_CG_MemberFunctions,              // "WBool Form1::..."
  51.  
  52.     MM_CG_DDXMember,                    // "WString     ddxNum;"
  53.     MM_CG_DDXGetDefault,                // "ddx->gender = 'M';"
  54.  
  55.     MM_CG_RC_Defines,                   // "#define CB_1 101"
  56.     MM_CG_RC_MainLevel,                 // "SPINDIAL_1_DATA RCDATA"
  57.     MM_CG_RC_Control,                   // "CB_1 CONTROL ..."
  58.  
  59.     MM_CG_StaticData,                   // "WStaticToolbarData __Form1_Base::toolb_1_table[] = ..."
  60.     MM_CG_HPP_BaseMemberFuncDecl,       // WBool __Base_toolb_1_ClickEvent(...);
  61.     MM_CG_CPP_BaseMemberFuncDefn,       // WBool __Base_toolb_1_ClickEvent(...) {...}
  62. };
  63.  
  64. struct MMWCodeGenerationData {
  65.     MMWCodeGeneration   tag;            // redundancy
  66.     DTWForm *           form;           // the main containing form
  67.     WBool               isDialog;       // uses dialog template
  68. };
  69.  
  70. class METAEXPORTCLASSDEF DTWObject : public DTObjectBase
  71. {
  72.     public:
  73.         DTWObject( const MetaObject * );
  74.  
  75.         virtual void            DTGetRectangle( WRect & r,
  76.                                                 WBool abs = FALSE ) const;
  77.         virtual void            DTSetRectangle( const WRect & r );
  78.  
  79.         virtual void            DTGetClientRectangle( WRect & r ) const;
  80.  
  81.         virtual void            DTGetRCRectangle( WRect & r ) const;
  82.  
  83.         virtual WRect           DTMapPixelsToDLU( const WRect & pix ) const;
  84.         virtual WRect           DTMapDLUToPixels( const WRect & dlu ) const;
  85.  
  86.         virtual void            DTBringToTop();
  87.  
  88.         virtual void            DTRepaint();
  89.  
  90.         virtual void            GenCode( MMCodeGeneration cg, WStringList & ) const;
  91.  
  92.         virtual void            GenerateCode( MMWCodeGeneration tag, ostream & out, MMWCodeGenerationData & data );
  93.  
  94. };
  95.  
  96. #endif // _DTWOBJ_HPP
  97.