home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / starview / inc / sv.hxx < prev    next >
Encoding:
Text File  |  1992-08-01  |  60.9 KB  |  2,301 lines

  1. /*************************************************************************
  2. * SV.HXX
  3. * (c) 1992 STAR DIVISION
  4. *************************************************************************/
  5. #ifndef _SV_HXX
  6. #define _SV_HXX
  7. #define _WINDOW_H
  8. #define _SYSWIN_H
  9. #define _WRKWIN_H
  10. #define _MDIWIN_H
  11. #define _MSGBOX_H
  12. #define _ICON_H
  13. #define _IMPRC_H
  14. #define _DIALOG_H
  15. #define _BITMAP_H
  16. #define _MENU_H
  17. #define _EDIT_H
  18. #define _LSTBOX_H
  19. #define _POINTR_H
  20. #define _CURSOR_H
  21. #define _GLOBDEFS_H
  22. #define _OUTDEV_H
  23. #define _VIRDEV_H
  24. #define _PRINT_H
  25. #define _TIMER_H
  26. #define _CTRL_H
  27. #define _SCRBAR_H
  28. #define _BUTTON_H
  29. class ImpOutputDevice{    char dummy[ 69 ]; };
  30. class ImpWindow{    char dummy[ 38 ]; };
  31. class ImpSysWin{    char dummy[ 1 ]; };
  32. class ImpWorkWin{    char dummy[ 9 ]; };
  33. class ImpMessBox{    char dummy[ 10 ]; };
  34. struct IMPRCTYPE{    char dummy[ 3 ]; };
  35. class ImpDlg{    char dummy[ 6 ]; };
  36. class ImpModalDlg{    char dummy[ 5 ]; };
  37. class ImpBitmap{    char dummy[ 4 ]; };
  38. class ImpMenu{    char dummy[ 25 ]; };
  39. class ImpLstBox{    char dummy[ 4 ]; };
  40. class ImpComboBox{    char dummy[ 2 ]; };
  41. class ImpVirtDevice{    char dummy[ 8 ]; };
  42. class ImpPointer{    char dummy[ 5 ]; };
  43. class ImpIcon{    char dummy[ 5 ]; };
  44. class ImpCursor{    char dummy[ 11 ]; };
  45. class ImpMDIWin{    char dummy[ 12 ]; };
  46. class ImpPrinter{    char dummy[ 7 ]; };
  47. class ImpTimer{    char dummy[ 1 ]; };
  48. class ImpControl{    char dummy[ 9 ]; };
  49. class ImpScrBar{    char dummy[ 13 ]; };
  50. class ImpEdit{    char dummy[ 2 ]; };
  51. class ImpTriBox{    char dummy[ 2 ]; };
  52. #ifndef _TOOLS_HXX
  53. #include "tools.hxx"
  54. #endif
  55.  
  56. #ifndef _SV_H
  57. #define _SV_H
  58.  
  59. #ifndef _SOLAR_H
  60. #endif
  61.  
  62. #ifndef _TOOLS_HXX
  63. #endif
  64.  
  65. #define WorkWindow         WrkWin
  66. #define SystemWindow       SysWin
  67. #define ScrollBar          ScrBar
  68. #define AutoScrollBar      AScrBar
  69. #define PushButton         PButton
  70. #define DefPushButton      DPButton
  71. #define CheckBox           ChkBox
  72. #define AutoCheckBox       AChkBox
  73. #define RadioButton        RaButton
  74. #define AutoRadioButton    ARaButton
  75. #define SingleLineEdit     SLEdit
  76. #define MultiLineEdit      MLEdit
  77. #define ModelessDialog     MLDialog
  78. #define ModalDialog        MDDialog
  79. #define DropDownComboBox   DComboBox
  80. #define DropDownListBox    DListBox
  81. #define AcceleratorManager AMGR
  82.  
  83. #endif 
  84.  
  85. #ifndef _WINBIT_HXX
  86. #define _WINBIT_HXX
  87.  
  88. #ifndef _SV_H
  89. #endif
  90.  
  91. #define WB_BORDER            ((WinBits)0x0001)
  92. #define WB_CLIPCHILDREN      ((WinBits)0x0002)
  93.  
  94. #define WB_SIZEABLE          ((WinBits)0x0004)
  95. #define WB_MOVEABLE          ((WinBits)0x0008)
  96. #define WB_MINABLE           ((WinBits)0x0010)
  97. #define WB_MAXABLE           ((WinBits)0x0020)
  98. #define WB_CLOSEABLE         ((WinBits)0x0040)
  99. #define WB_APP               ((WinBits)0x0080)
  100.  
  101. #define WB_SIZEMOVE          (WB_SIZEABLE | WB_MOVEABLE)
  102. #define WB_MINMAX            (WB_MINABLE | WB_MAXABLE)
  103. #define WB_STDWORK           (WB_MINMAX | WB_SIZEMOVE | WB_CLOSEABLE)
  104. #define WB_STDMDI            WB_CLOSEABLE
  105.  
  106. #define WB_TABSTOP           ((WinBits)0x0004)
  107. #define WB_GROUP             ((WinBits)0x0008)
  108.  
  109. #define WB_SYSMODAL          ((WinBits)0x1000)
  110.  
  111. #define WB_STDMODELESS       (WB_MOVEABLE | WB_CLOSEABLE)
  112. #define WB_STDMODAL          (WB_MOVEABLE | WB_CLOSEABLE)
  113.  
  114. #define WB_LEFT              ((WinBits)0x0020)
  115. #define WB_CENTER            ((WinBits)0x0040)
  116. #define WB_RIGHT             ((WinBits)0x0080)
  117.  
  118. #define WB_HSCROLL           ((WinBits)0x0100)
  119. #define WB_VSCROLL           ((WinBits)0x0200)
  120.  
  121. #define WB_SORT              ((WinBits)0x0400)
  122.  
  123. #define WB_OK                ((WinBits)0x0004)
  124. #define WB_OK_CANCEL         ((WinBits)0x0008)
  125. #define WB_YES_NO            ((WinBits)0x0010)
  126. #define WB_YES_NO_CANCEL     ((WinBits)0x0020)
  127. #define WB_RETRY_CANCEL      ((WinBits)0x0040)
  128.  
  129. #define WB_DEF_OK            ((WinBits)0x0080)
  130. #define WB_DEF_CANCEL        ((WinBits)0x0100)
  131. #define WB_DEF_RETRY         ((WinBits)0x0200)
  132. #define WB_DEF_YES           ((WinBits)0x0400)
  133. #define WB_DEF_NO            ((WinBits)0x0800)
  134.  
  135. #ifdef MTF
  136. #define WB_DEFBUTTON         ((WinBits)0x8000)
  137. #define WB_MENUBAR           ((WinBits)0x0001)
  138. #define WB_MENUPOPUP         ((WinBits)0x0002)
  139. #endif
  140. #define WB_HIDE              ((WinBits)0x4000)
  141.  
  142. typedef USHORT WinBits;
  143.  
  144. enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW };
  145.  
  146. #endif 
  147.  
  148. #ifndef _RESID_HXX
  149. #define _RESID_HXX
  150.  
  151. #ifndef _TOOLS_HXX
  152. #endif
  153.  
  154. #ifndef _SV_H
  155. #endif
  156. #ifndef _WINBIT_HXX
  157. #endif
  158.  
  159. struct RSHEADER_TYPE;
  160.  
  161. typedef short RESOURCE_TYPE;
  162. #define RSC_NOTYPE              0x100
  163.  
  164. class ResId
  165. {
  166. private:
  167.     RSHEADER_TYPE*  pResource;     
  168.  
  169.     USHORT          nResId;        
  170.     USHORT          nLockCount;    
  171.     RESOURCE_TYPE   nRT;           
  172.     char*           pStr;          
  173.  
  174.                    ResId( const ResId & );       
  175.     ResId &        operator =  ( const ResId & );
  176. public:
  177.     WinBits         aWinBits;      
  178.  
  179.                     ResId( RSHEADER_TYPE * pRc ){
  180.                         pResource = pRc;
  181.                         nRT = RSC_NOTYPE;
  182.                         nLockCount = 0;
  183.                         pStr = NULL;
  184.                     };
  185.                     ResId( USHORT nId, BOOL bLock = FALSE );
  186.                     ~ResId();
  187.  
  188.     ResId&          Lock() { nLockCount++; return( *this ); };
  189.     ResId&          Lock( RESOURCE_TYPE nTyp ){   
  190.                         if( RSC_NOTYPE == nRT )
  191.                             nRT = nTyp;
  192.                         return( Lock() );
  193.                     }
  194.  
  195.     RESOURCE_TYPE   GetRT(){ return( nRT ); };    
  196.     ResId&          SetRT( RESOURCE_TYPE nTyp ){  
  197.                         if( RSC_NOTYPE == nRT )
  198.                             nRT = nTyp;
  199.                         return( *this );
  200.                     }
  201.  
  202.     void            PopContext();
  203.     void            Unlock(){
  204.                         if( ! --nLockCount ){
  205.  
  206.                             PopContext();
  207.                         }
  208.                     }
  209.  
  210.     USHORT         GetId() { return( nResId ); }
  211.     RSHEADER_TYPE* GetpResource() { return( pResource ); }
  212.  
  213.     operator       const char*();
  214. };
  215.  
  216. #endif 
  217.  
  218. #ifndef _RC_HXX
  219. #define _RC_HXX
  220.  
  221. #ifndef _SV_H
  222. #endif
  223. #ifndef _TOOLS_HXX
  224. #endif
  225. #ifndef _RESID_HXX
  226. #endif
  227. #ifndef _IMPRC_H
  228. #endif
  229.  
  230. struct RSHEADER_TYPE{
  231.     USHORT          nId;        
  232.     RESOURCE_TYPE   nRT;        
  233.     USHORT          nGlobOff;   
  234.     USHORT          nLocalOff;  
  235. };
  236.  
  237. struct RSBYNAME_TYPE { 
  238.     RSHEADER_TYPE   Header;     
  239.     USHORT          nId;        
  240.     RESOURCE_TYPE   rtType;     
  241. };
  242.  
  243. class ResImp
  244. {
  245. protected:
  246.  
  247.     ResImp( char * pFileName = (char *)0 );
  248.     ~ResImp();
  249.  
  250.     void * LoadGlobalRes( RESOURCE_TYPE nRT, USHORT nId,
  251.                           void ** pResHandle );
  252.  
  253.     void FreeGlobalRes( void *aResHandle, void * pResource );
  254.  
  255.     BOOL IsSystemRes( RESOURCE_TYPE nRT );
  256. public:
  257.     IMPRCTYPE   imp;
  258. };
  259.  
  260. typedef short LOAD_FLAGS;
  261.  
  262. #define RC_NOTYPE          0x0     
  263. #define RC_GLOBAL          0x1     
  264. #define RC_NOFREE          0x2     
  265.  
  266. struct STACK_TYPE {
  267.  
  268.     RSHEADER_TYPE * pResource; 
  269.     void          * pClassRes; 
  270.     LOAD_FLAGS      Flags;     
  271.     void *          aResHandle;
  272. };
  273.  
  274. #define MAX_RC_STACK    32
  275.  
  276. class ResMgr : public ResImp
  277. {
  278.     BOOL        bModul;    
  279.     STACK_TYPE  aStack[ MAX_RC_STACK ]; 
  280.     short       nTopRes;   
  281. public:
  282.     ResMgr( char * pFileName = (char *)0 );
  283.     ~ResMgr();
  284.  
  285.     BOOL GetResource( RESOURCE_TYPE, USHORT nId,
  286.                      RSHEADER_TYPE *, BOOL bNoFree = FALSE );
  287.     void     PopContext();       
  288.  
  289.     void *   Increment( USHORT nSize ){
  290.         if( aStack[ nTopRes ].pClassRes )
  291.             aStack[ nTopRes ].pClassRes =
  292.               (char * )(aStack[ nTopRes ].pClassRes) + nSize;
  293.         return( aStack[ nTopRes ].pClassRes );
  294.     }
  295.  
  296.     USHORT GetObjSize( RSHEADER_TYPE * pHT ){
  297.         return( pHT->nGlobOff );
  298.     }
  299.  
  300.     USHORT GetStringSize( char * pStr );
  301.  
  302.     void * GetSysDepen();
  303.  
  304.     void * GetClass(){
  305.        return( aStack[ nTopRes ].pClassRes );
  306.     }
  307.  
  308.     USHORT GetRemainSize();
  309. };
  310.  
  311. class Resource : public LinkHdl
  312. {
  313.  
  314. protected:
  315.  
  316.     BOOL GetRes( ResId& rResId, BOOL bNoFree = FALSE );
  317.  
  318.     void * GetSysDepenRes(){
  319.         return( GetResManager()->GetSysDepen() );
  320.     };
  321.  
  322.     void * GetClassRes(){
  323.         return( GetResManager()->GetClass() );
  324.     };
  325.  
  326.     void * IncrementRes( USHORT nBytes ){
  327.         return( GetResManager()->Increment( nBytes ) );
  328.     };
  329.  
  330.     USHORT GetObjSizeRes( RSHEADER_TYPE * pHT ){
  331.         return( GetResManager()->GetObjSize( pHT ) );
  332.     };
  333.  
  334.     USHORT GetStringSizeRes( char * pStr ){
  335.         return( GetResManager()->GetStringSize( pStr ) );
  336.     };
  337.  
  338.     USHORT GetRemainSizeRes(){
  339.         return( GetResManager()->GetRemainSize() );
  340.     };
  341.  
  342.     Resource( ResId& rResId, BOOL bNoFree = FALSE );
  343.  
  344.     Resource(){};
  345.  
  346. public:
  347.  
  348.                     ~Resource(){};
  349.  
  350.     static ResMgr * GetResManager();
  351.  
  352.     static void SetResManager( ResMgr * paResMgr );
  353.  
  354. };
  355.  
  356. #endif 
  357.  
  358. #ifndef _MAPMOD_HXX
  359. #define _MAPMOD_HXX
  360.  
  361. #ifndef _SV_H
  362. #endif
  363. #ifndef _RESID_HXX
  364. #endif
  365. #ifndef _RC_HXX
  366. #endif
  367.  
  368. enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
  369.                MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH,
  370.                MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT };
  371.  
  372. class ImpMapMode;
  373.  
  374. class MapMode : public Resource
  375. {
  376. protected:
  377.     ImpMapMode* pImpMapMode;
  378.  
  379. public:
  380.                 MapMode();
  381.                 MapMode( const MapMode& rMapMode );
  382.                 MapMode( MapUnit eUnit );
  383.                 MapMode( MapUnit eUnit, const Point& rLogicOrg,
  384.                          const Fraction& rScaleX, const Fraction& rScaleY );
  385.                 MapMode( ResId& rResId );
  386.     virtual     ~MapMode();
  387.  
  388.     MapUnit     ChangeMapUnit( MapUnit eUnit );
  389.     MapUnit     GetMapUnit() const;
  390.  
  391.     Point       ChangeOrigin( const Point& rOrigin );
  392.     Point       GetOrigin() const;
  393.  
  394.     Fraction    ChangeScaleX( const Fraction& rScaleX );
  395.     Fraction    GetScaleX() const;
  396.     Fraction    ChangeScaleY( const Fraction& rScaleY );
  397.     Fraction    GetScaleY() const;
  398.  
  399.     MapMode&    operator=( const MapMode& rMapMode );
  400.  
  401.     BOOL        operator==( const MapMode& rMapMode ) const;
  402.     BOOL        operator!=( const MapMode& rMapMode ) const;
  403. };
  404.  
  405. #endif  
  406.  
  407. #ifndef _COLOR_HXX
  408. #define _COLOR_HXX
  409.  
  410. #ifndef _SV_H
  411. #endif
  412. #ifndef _RESID_HXX
  413. #endif
  414. #ifndef _RC_HXX
  415. #endif
  416.  
  417. enum ColorName { COL_BLACK, COL_BLUE, COL_GREEN, COL_CYAN,
  418.                  COL_RED, COL_MAGENTA, COL_BROWN, COL_GRAY,
  419.                  COL_LIGHTGRAY, COL_LIGHTBLUE, COL_LIGHTGREEN,
  420.                  COL_LIGHTCYAN, COL_LIGHTRED, COL_LIGHTMAGENTA,
  421.                  COL_YELLOW, COL_WHITE,
  422.                  COL_MENUBAR, COL_MENUBARTEXT,
  423.                  COL_POPUPMENU, COL_POPUPMENUTEXT,
  424.                  COL_WINDOWTEXT, COL_WINDOWWORKSPACE,
  425.                  COL_HIGHLIGHT, COL_HIGHLIGHTTEXT,
  426.                  COL_3DTEXT, COL_3DFACE, COL_3DLIGHT, COL_3DSHADOW,
  427.                  COL_USER };
  428.  
  429. class Color : public Resource
  430. {
  431. protected:
  432.     ColorName eColorName;
  433.     USHORT    nRed;
  434.     USHORT    nGreen;
  435.     USHORT    nBlue;
  436.  
  437. public:
  438.               Color();
  439.               Color( ColorName eColorName );
  440.               Color( USHORT nRed, USHORT nGreen, USHORT nBlue );
  441.               Color( ResId &rResId );
  442.     virtual   ~Color();
  443.  
  444.     USHORT    ChangeRed( USHORT nRed );
  445.     USHORT    GetRed() const;
  446.     USHORT    ChangeGreen( USHORT nGreen );
  447.     USHORT    GetGreen() const;
  448.     USHORT    ChangeBlue( USHORT nBlue );
  449.     USHORT    GetBlue() const;
  450.  
  451.     ColorName ChangeColorName( ColorName eColorName );
  452.     ColorName GetColorName() const { return eColorName; }
  453.  
  454.     BOOL      operator==( const Color& rColor ) const;
  455.     BOOL      operator!=( const Color& rColor ) const;
  456. };
  457.  
  458. #endif  
  459.  
  460. #ifndef _BITMAP_HXX
  461. #define _BITMAP_HXX
  462.  
  463. #ifndef _SV_H
  464. #endif
  465. #ifndef _RESID_HXX
  466. #endif
  467. #ifndef _RC_HXX
  468. #endif
  469.  
  470. class ImpBitmap;
  471.  
  472. class Bitmap : public Resource
  473. {
  474. protected:
  475.  
  476.     ImpBitmap*    pImpBitmap;
  477.  
  478. public:
  479.               Bitmap();
  480.               Bitmap( const Bitmap& rBitmap );
  481.               Bitmap( ResId& rResId );
  482.     virtual   ~Bitmap();
  483.  
  484.     Size      GetSizePixel() const;
  485.     USHORT    GetColorCount() const;
  486.  
  487.     Bitmap&   operator=( const Bitmap& rBitmap );
  488.  
  489.     BOOL      operator==( const Bitmap& rBitmap ) const;
  490.     BOOL      operator!=( const Bitmap& rBitmap ) const;
  491. };
  492.  
  493. #endif  
  494.  
  495. #ifndef _GDIOBJ_HXX
  496. #define _GDIOBJ_HXX
  497.  
  498. #ifndef _SV_H
  499. #endif
  500. #ifndef _RESID_HXX
  501. #endif
  502. #ifndef _RC_HXX
  503. #endif
  504. #ifndef _COLOR_HXX
  505. #endif
  506. #ifndef _BITMAP_HXX
  507. #endif
  508.  
  509. enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT };
  510.  
  511. class ImpPen;
  512.  
  513. class Pen : public Resource
  514. {
  515. protected:
  516.     ImpPen*   pImpPen;
  517.  
  518. public:
  519.               Pen();
  520.               Pen( const Pen& rPen );
  521.               Pen( PenStyle eStyle );
  522.               Pen( const Color& rColor, USHORT nWidth = 0,
  523.                    PenStyle eStyle = PEN_SOLID );
  524.               Pen( ResId &rResId );
  525.     virtual   ~Pen();
  526.  
  527.     Color     ChangeColor( const Color& rColor );
  528.     Color     GetColor() const;
  529.  
  530.     USHORT    ChangeWidth( USHORT nWidth );
  531.     USHORT    GetWidth() const;
  532.  
  533.     PenStyle  ChangeStyle( PenStyle eStyle );
  534.     PenStyle  GetStyle() const;
  535.  
  536.     Pen&      operator=( const Pen& rPen );
  537.     BOOL      operator==( const Pen& rPen ) const;
  538.     BOOL      operator!=( const Pen& rPen ) const;
  539. };
  540.  
  541. enum BrushStyle { BRUSH_NULL, BRUSH_SOLID, BRUSH_HORZ, BRUSH_VERT,
  542.                   BRUSH_CROSS, BRUSH_DIAGCROSS, BRUSH_UPDIAG, BRUSH_DOWNDIAG,
  543.                   BRUSH_25, BRUSH_50, BRUSH_75,
  544.                   BRUSH_BITMAP };
  545.  
  546. class ImpBrush;
  547.  
  548. class Brush : public Resource
  549. {
  550. protected:
  551.     ImpBrush*      pImpBrush;
  552.  
  553. public:
  554.                    Brush();
  555.                    Brush( const Brush& rBrush );
  556.                    Brush( BrushStyle eStyle );
  557.                    Brush( const Color& rColor,
  558.                           BrushStyle aStyle = BRUSH_SOLID );
  559.                    Brush( const Color& rColor, const Color& rFillColor,
  560.                           BrushStyle eStyle );
  561.                    Brush( const Bitmap& rBitmap );
  562.                    Brush( ResId& rResId );
  563.     virtual        ~Brush();
  564.  
  565.     Color          ChangeColor( const Color& rColor );
  566.     Color          GetColor() const;
  567.     Color          ChangeFillColor( const Color& rColor );
  568.     Color          GetFillColor() const;
  569.  
  570.     BrushStyle     ChangeStyle( BrushStyle eStyle );
  571.     BrushStyle     GetStyle() const;
  572.     Bitmap         ChangeBitmap( const Bitmap& rBitmap );
  573.     Bitmap         GetBitmap() const;
  574.  
  575.     BOOL           ChangeTransparent( BOOL bTransparent );
  576.     BOOL           IsTransparent() const;
  577.     BOOL           IsHatched() const;
  578.  
  579.     Brush&         operator=( const Brush& rBrush );
  580.     BOOL           operator==( const Brush& rBrush ) const;
  581.     BOOL           operator!=( const Brush& rBrush ) const;
  582. };
  583.  
  584. enum FontCharSet { CHARSET_DONTKNOW, CHARSET_ANSI, CHARSET_IBMPC, CHARSET_MAC,
  585.                    CHARSET_SYMBOL };
  586. enum FontFamily  { FAMILY_DONTKNOW, FAMILY_DECORATIVE, FAMILY_MODERN,
  587.                    FAMILY_ROMAN, FAMILY_SCRIPT, FAMILY_SWISS, FAMILY_SYSTEM };
  588. enum FontPitch   { PITCH_DONTKNOW, PITCH_FIXED, PITCH_VARIABLE };
  589. enum FontWeight  { WEIGHT_DONTKNOW, WEIGHT_LIGHT, WEIGHT_NORMAL, WEIGHT_BOLD };
  590. enum FontAlign   { ALIGN_TOP, ALIGN_BASELINE, ALIGN_BOTTOM };
  591.  
  592. class ImpFont;
  593.  
  594. class Font : public Resource
  595. {
  596. protected:
  597.     ImpFont*       pImpFont;
  598.  
  599. public:
  600.                    Font();
  601.                    Font( const Font& rFont );
  602.                    Font( const String& rName, const Size& rSize );
  603.                    Font( FontFamily eFamily, const Size& rSize );
  604.                    Font( ResId & rResId );
  605.     virtual        ~Font();
  606.  
  607.     Color          ChangeColor( const Color& rColor );
  608.     Color          GetColor() const;
  609.     Color          ChangeFillColor( const Color& rColor );
  610.     Color          GetFillColor() const;
  611.  
  612.     FontFamily     ChangeFamily( FontFamily eFamily );
  613.     FontFamily     GetFamily() const;
  614.     String         ChangeName( const String& rName );
  615.     String         GetName() const;
  616.     Size           ChangeSize( const Size& rSize );
  617.     Size           GetSize() const;
  618.  
  619.     FontCharSet    ChangeCharSet( FontCharSet eCharSet );
  620.     FontCharSet    GetCharSet() const;
  621.     FontPitch      ChangePitch( FontPitch ePitch );
  622.     FontPitch      GetPitch() const;
  623.  
  624.     FontAlign      ChangeAlign( FontAlign eAlign );
  625.     FontAlign      GetAlign() const;
  626.  
  627.     short          ChangeLineOrientation( short nLineOrientation );
  628.     short          GetLineOrientation() const;
  629.     short          ChangeCharOrientation( short nCharOrientation );
  630.     short          GetCharOrientation() const;
  631.  
  632.     FontWeight     ChangeWeight( FontWeight eWeight );
  633.     FontWeight     GetWeight() const;
  634.  
  635.     BOOL           ChangeItalic( BOOL bItalic );
  636.     BOOL           IsItalic() const;
  637.     BOOL           ChangeUnderline( BOOL bUnderline );
  638.     BOOL           IsUnderline() const;
  639.     BOOL           ChangeStrikeout( BOOL bStrikeout );
  640.     BOOL           IsStrikeout() const;
  641.     BOOL           ChangeOutline( BOOL bOutline );
  642.     BOOL           IsOutline() const;
  643.     BOOL           ChangeShadow( BOOL bShadow );
  644.     BOOL           IsShadow() const;
  645.  
  646.     BOOL           ChangeTransparent( BOOL bTransparent );
  647.     BOOL           IsTransparent() const;
  648.  
  649.     Font&          operator=( const Font& rFont );
  650.     BOOL           operator==( const Font& rFont ) const;
  651.     BOOL           operator!=( const Font& rFont ) const;
  652. };
  653.  
  654. #endif  
  655.  
  656. #ifndef _POINTR_HXX
  657. #define _POINTR_HXX
  658.  
  659. #ifndef _TOOLS_HXX
  660. #endif
  661. #ifndef _SV_H
  662. #endif
  663. #ifndef _RESID_HXX
  664. #endif
  665. #ifndef _RC_HXX
  666. #endif
  667.  
  668. enum PointerStyle { POINTER_ARROW, POINTER_WAIT, POINTER_CROSS,
  669.                     POINTER_BEAM, POINTER_NULL };
  670.  
  671. class ImpPointer;
  672.  
  673. class Pointer : public Resource
  674. {
  675. protected:
  676.     ImpPointer*    pImpPointer;    
  677.  
  678. public:
  679.                    Pointer( PointerStyle = POINTER_ARROW );
  680.                    Pointer( const Pointer& rPointer );
  681.                    Pointer( ResId& rResId );
  682.     virtual        ~Pointer();
  683.  
  684.     static  void   Show();
  685.     static  void   Hide();
  686.     static  BOOL   IsVisible();
  687.  
  688.     static  Point  ChangePosPixel( const Point& rPos );
  689.     static  Point  GetPosPixel();
  690.  
  691.     Pointer&       operator=( const Pointer& rPointer );
  692.  
  693.     BOOL           operator==( const Pointer& rPointer ) const;
  694.     BOOL           operator!=( const Pointer& rPointer ) const;
  695. };
  696.  
  697. #endif 
  698.  
  699. #ifndef _ICON_HXX
  700. #define _ICON_HXX
  701.  
  702. #ifndef _SV_H
  703. #endif
  704. #ifndef _RESID_HXX
  705. #endif
  706. #ifndef _RC_HXX
  707. #endif
  708.  
  709. class ImpIcon;
  710.  
  711. enum IconStyle { ICON_DEFAULT, ICON_INFO, ICON_WARNING, ICON_ERROR,
  712.                  ICON_QUERY, ICON_NULL };
  713.  
  714. class Icon : public Resource
  715. {
  716. protected:
  717.     ImpIcon*  pImpIcon;      
  718.  
  719. public:
  720.               Icon( IconStyle aStyle = ICON_DEFAULT );
  721.               Icon( const Icon& rIcon );
  722.               Icon( ResId& rResId );
  723.     virtual   ~Icon();
  724.  
  725.     Size      GetSizePixel() const;
  726.  
  727.     Icon&     operator =( const Icon& rIcon );
  728.  
  729.     BOOL      operator ==( const Icon& rIcon ) const;
  730.     BOOL      operator !=( const Icon& rIcon ) const;
  731. };
  732.  
  733. #endif  
  734.  
  735. #ifndef _KEYCOD_HXX
  736. #define _KEYCOD_HXX
  737.  
  738. #ifndef _SV_H
  739. #endif
  740. #ifndef _TOOLS_HXX
  741. #endif
  742.  
  743. #define KEYGROUP_NUM    0x0100
  744. #define KEYGROUP_ALPHA  0x0200
  745. #define KEYGROUP_FKEYS  0x0300
  746. #define KEYGROUP_CURSOR 0x0400
  747. #define KEYGROUP_MISC   0x0500
  748.  
  749. #define KEY_0           (KEYGROUP_NUM+0)
  750. #define KEY_1           (KEYGROUP_NUM+1)
  751. #define KEY_2           (KEYGROUP_NUM+2)
  752. #define KEY_3           (KEYGROUP_NUM+3)
  753. #define KEY_4           (KEYGROUP_NUM+4)
  754. #define KEY_5           (KEYGROUP_NUM+5)
  755. #define KEY_6           (KEYGROUP_NUM+6)
  756. #define KEY_7           (KEYGROUP_NUM+7)
  757. #define KEY_8           (KEYGROUP_NUM+8)
  758. #define KEY_9           (KEYGROUP_NUM+9)
  759.  
  760. #define KEY_A           (KEYGROUP_ALPHA+0)
  761. #define KEY_B           (KEYGROUP_ALPHA+1)
  762. #define KEY_C           (KEYGROUP_ALPHA+2)
  763. #define KEY_D           (KEYGROUP_ALPHA+3)
  764. #define KEY_E           (KEYGROUP_ALPHA+4)
  765. #define KEY_F           (KEYGROUP_ALPHA+5)
  766. #define KEY_G           (KEYGROUP_ALPHA+6)
  767. #define KEY_H           (KEYGROUP_ALPHA+7)
  768. #define KEY_I           (KEYGROUP_ALPHA+8)
  769. #define KEY_J           (KEYGROUP_ALPHA+9)
  770. #define KEY_K           (KEYGROUP_ALPHA+10)
  771. #define KEY_L           (KEYGROUP_ALPHA+11)
  772. #define KEY_M           (KEYGROUP_ALPHA+12)
  773. #define KEY_N           (KEYGROUP_ALPHA+13)
  774. #define KEY_O           (KEYGROUP_ALPHA+14)
  775. #define KEY_P           (KEYGROUP_ALPHA+15)
  776. #define KEY_Q           (KEYGROUP_ALPHA+16)
  777. #define KEY_R           (KEYGROUP_ALPHA+17)
  778. #define KEY_S           (KEYGROUP_ALPHA+18)
  779. #define KEY_T           (KEYGROUP_ALPHA+19)
  780. #define KEY_U           (KEYGROUP_ALPHA+21)
  781. #define KEY_V           (KEYGROUP_ALPHA+22)
  782. #define KEY_W           (KEYGROUP_ALPHA+23)
  783. #define KEY_X           (KEYGROUP_ALPHA+24)
  784. #define KEY_Y           (KEYGROUP_ALPHA+25)
  785. #define KEY_Z           (KEYGROUP_ALPHA+26)
  786.  
  787. #define KEY_F1          (KEYGROUP_FKEYS+0)
  788. #define KEY_F2          (KEYGROUP_FKEYS+1)
  789. #define KEY_F3          (KEYGROUP_FKEYS+2)
  790. #define KEY_F4          (KEYGROUP_FKEYS+3)
  791. #define KEY_F5          (KEYGROUP_FKEYS+4)
  792. #define KEY_F6          (KEYGROUP_FKEYS+5)
  793. #define KEY_F7          (KEYGROUP_FKEYS+6)
  794. #define KEY_F8          (KEYGROUP_FKEYS+7)
  795. #define KEY_F9          (KEYGROUP_FKEYS+8)
  796. #define KEY_F10         (KEYGROUP_FKEYS+9)
  797. #define KEY_F11         (KEYGROUP_FKEYS+10)
  798. #define KEY_F12         (KEYGROUP_FKEYS+11)
  799. #define KEY_F13         (KEYGROUP_FKEYS+12)
  800. #define KEY_F14         (KEYGROUP_FKEYS+13)
  801. #define KEY_F15         (KEYGROUP_FKEYS+14)
  802. #define KEY_F16         (KEYGROUP_FKEYS+15)
  803. #define KEY_F17         (KEYGROUP_FKEYS+16)
  804. #define KEY_F18         (KEYGROUP_FKEYS+17)
  805. #define KEY_F19         (KEYGROUP_FKEYS+18)
  806. #define KEY_F20         (KEYGROUP_FKEYS+19)
  807. #define KEY_F21         (KEYGROUP_FKEYS+21)
  808. #define KEY_F22         (KEYGROUP_FKEYS+22)
  809. #define KEY_F23         (KEYGROUP_FKEYS+23)
  810. #define KEY_F24         (KEYGROUP_FKEYS+24)
  811.  
  812. #define KEY_DOWN        (KEYGROUP_CURSOR+0)
  813. #define KEY_UP          (KEYGROUP_CURSOR+1)
  814. #define KEY_LEFT        (KEYGROUP_CURSOR+2)
  815. #define KEY_RIGHT       (KEYGROUP_CURSOR+3)
  816. #define KEY_HOME        (KEYGROUP_CURSOR+4)
  817. #define KEY_END         (KEYGROUP_CURSOR+5)
  818. #define KEY_PAGEUP      (KEYGROUP_CURSOR+6)
  819. #define KEY_PAGEDOWN    (KEYGROUP_CURSOR+7)
  820.  
  821. #define KEY_RETURN      (KEYGROUP_MISC+0)
  822. #define KEY_ESCAPE      (KEYGROUP_MISC+1)
  823. #define KEY_TAB         (KEYGROUP_MISC+2)
  824. #define KEY_BACKSPACE   (KEYGROUP_MISC+3)
  825. #define KEY_SPACE       (KEYGROUP_MISC+4)
  826. #define KEY_INSERT      (KEYGROUP_MISC+5)
  827. #define KEY_DELETE      (KEYGROUP_MISC+6)
  828.  
  829. #define KEY_SHIFT       0x1000
  830. #define KEY_MOD1        0x2000
  831. #define KEY_MOD2        0x4000
  832.  
  833. class KeyCode
  834. {
  835. protected:
  836.     USHORT    nCode;
  837.  
  838.     USHORT    GetFullCode() const { return nCode; }
  839.  
  840. public:
  841.               KeyCode() { nCode = 0; }
  842.               KeyCode( USHORT nKey, USHORT nModifier = 0 );
  843.               KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2 );
  844.  
  845.     USHORT    GetCode() const;
  846.  
  847.     USHORT    GetModifier() const;
  848.     BOOL      IsShift() const;
  849.     BOOL      IsMod1() const;
  850.     BOOL      IsMod2() const;
  851.  
  852.     USHORT    GetGroup() const;
  853.  
  854.     BOOL      operator ==( const KeyCode& rKeyCode ) const
  855.                   { return nCode == rKeyCode.nCode; }
  856.     BOOL      operator !=( const KeyCode& rKeyCode ) const
  857.                   { return nCode != rKeyCode.nCode; }
  858. };
  859.  
  860. #endif 
  861.  
  862. #ifndef _EVENT_HXX
  863. #define _EVENT_HXX
  864.  
  865. #ifndef _SV_H
  866. #endif
  867.  
  868. #ifndef _TOOLS_HXX
  869. #endif
  870.  
  871. #ifndef _KEYCOD_HXX
  872. #endif
  873.  
  874. class KeyEvent
  875. {
  876. private:
  877.     KeyCode   aKeyCode;
  878.     char      nCharCode;
  879.     USHORT    nRepeat;
  880.  
  881. public:
  882.               KeyEvent()          { nCharCode = 0; nRepeat = 0; }
  883.               KeyEvent( char nCharCode, const KeyCode& rKeyCode,
  884.                         USHORT nRepeat = 0 );
  885.  
  886.     char      GetCharCode() const { return nCharCode; }
  887.     KeyCode   GetKeyCode() const  { return aKeyCode;  }
  888.     USHORT    GetRepeat() const   { return nRepeat;   }
  889. };
  890.  
  891. #define MOUSE_MOVE           1
  892. #define MOUSE_SIMPLEDRAG     2
  893. #define MOUSE_EXTDRAG        3
  894.  
  895. #define MOUSE_SIMPLE         1
  896. #define MOUSE_EXT            2
  897. #define MOUSE_MULTI          3
  898.  
  899. #define MOUSE_LEFT      0x0001
  900. #define MOUSE_MIDDLE    0x0002
  901. #define MOUSE_RIGHT     0x0004
  902.  
  903. class MouseEvent
  904. {
  905. private:
  906.     Point     aPos;
  907.     USHORT    nMode;
  908.     USHORT    nClicks;
  909.     USHORT    nCode;
  910.  
  911. public:
  912.               MouseEvent()        { nMode = 0; nClicks = 0; nCode = 0; }
  913.               MouseEvent( const Point& rPos, USHORT nClicks = 1,
  914.                           USHORT nMode = 0, USHORT nButtons = 0,
  915.                           USHORT nModifier = 0 );
  916.  
  917.     Point     GetPosPixel() const { return aPos;    }
  918.     USHORT    GetMode() const     { return nMode;   }
  919.     USHORT    GetClicks() const   { return nClicks; }
  920.  
  921.     USHORT    GetButtons() const;
  922.     BOOL      IsLeft() const;
  923.     BOOL      IsMiddle() const;
  924.     BOOL      IsRight() const;
  925.  
  926.     USHORT    GetModifier() const;
  927.     BOOL      IsShift() const;
  928.     BOOL      IsMod1() const;
  929.     BOOL      IsMod2() const;
  930. };
  931.  
  932. enum HelpMode { HELPMODE_CONTEXT, HELPMODE_EXTENDED, HELPMODE_ALL };
  933.  
  934. class HelpEvent
  935. {
  936. private:
  937.     Point     aPos;
  938.     HelpMode  eMode;
  939.  
  940. public:
  941.               HelpEvent()         { eMode = HELPMODE_CONTEXT;   }
  942.               HelpEvent( const Point& rPos, HelpMode eMode );
  943.  
  944.     Point     GetMousePosPixel() const { return aPos;           }
  945.     HelpMode  GetMode() const          { return eMode;          }
  946. };
  947.  
  948. #endif 
  949. #ifndef RSC_COMPILER
  950.  
  951. #ifndef _APP_HXX
  952. #define _APP_HXX
  953.  
  954. #ifndef _TOOLS_HXX
  955. #endif
  956. #ifndef _SV_H
  957. #endif
  958. #ifndef _GDIOBJ_HXX
  959. #endif
  960. #ifndef _EVENT_HXX
  961. #endif
  962.  
  963. class MenuBar;
  964. class Window;
  965. class WorkWindow;
  966. class Accelerator;
  967. class Help;
  968.  
  969. enum SysChangeType { CHANGE_FONTCOUNT, CHANGE_OTHER };
  970.  
  971. class Application : public LinkHdl
  972. {
  973. protected:
  974.     void           Execute();
  975.     virtual BOOL   QueryExit();
  976.  
  977.     virtual void   SysChange( SysChangeType eChgType );
  978.  
  979.     virtual void   ActivateExtHelp();
  980.     virtual void   DeactivateExtHelp();
  981.  
  982. public:
  983.                    Application();
  984.                    ~Application();
  985.  
  986.     virtual void   Main( int nArgc, char* pArgv[] ) = 0;
  987.  
  988.     BOOL           IsInMain() const;
  989.     BOOL           IsInExecute() const;
  990.  
  991.     void           Wait( BOOL bWait = TRUE );
  992.     BOOL           IsWait() const;
  993.  
  994.     void           Quit();
  995.     void           Reschedule();
  996.     BOOL           AnyInput();
  997.  
  998.     BOOL           InsertIdleHdl( const Link& rLink, USHORT nPriority );
  999.     void           RemoveIdleHdl( const Link& rLink );
  1000.  
  1001.     WorkWindow*    GetAppWindow() const;
  1002.  
  1003.     MenuBar*       ChangeAppMenu( MenuBar* pAppMenu = NULL );
  1004.     MenuBar*       GetAppMenu() const;
  1005.  
  1006.     Font           ChangeAppFont( const Font& rFont );
  1007.     Font           GetAppFont() const;
  1008.  
  1009.     BOOL           InsertAccel( Accelerator* pAccel );
  1010.     BOOL           RemoveAccel( Accelerator* pAccel );
  1011.     void           FlushAccel();
  1012.  
  1013.     Help*          ChangeHelp( Help* pHelp = NULL );
  1014.     Help*          GetHelp() const;
  1015.  
  1016.     void           EnableHelp( HelpMode eHelpMode );
  1017.     void           DisableHelp( HelpMode eHelpMode );
  1018.     BOOL           IsHelpEnabled( HelpMode eHelpMode ) const;
  1019. };
  1020.  
  1021. extern Application* pApp;    
  1022.  
  1023. #endif 
  1024.  
  1025. #ifndef _METRIC_HXX
  1026. #define _METRIC_HXX
  1027.  
  1028. #ifndef _SV_H
  1029. #endif
  1030.  
  1031. #ifndef _GDIOBJ_HXX
  1032. #endif
  1033.  
  1034. class ImpFontMetric;
  1035.  
  1036. #define CHARORIENTATION_DONTKNOW  ((short)0x7FFF)
  1037. #define LINEORIENTATION_DONTKNOW  ((short)0x7FFF)
  1038.  
  1039. enum FontType { TYPE_DONTKNOW, TYPE_RASTER, TYPE_VECTOR, TYPE_SCALABLE };
  1040.  
  1041. class FontMetric
  1042. {
  1043. protected:
  1044.     ImpFontMetric* pImpMetric;    
  1045.  
  1046. public:
  1047.                    FontMetric();
  1048.                    FontMetric( const FontMetric& rMetric );
  1049.                    ~FontMetric();
  1050.  
  1051.     Color          GetColor() const;
  1052.     Color          GetFillColor() const;
  1053.  
  1054.     FontFamily     GetFamily() const;
  1055.     String         GetName() const;
  1056.     Size           GetSize() const;
  1057.  
  1058.     FontCharSet    GetCharSet() const;
  1059.     FontPitch      GetPitch() const;
  1060.  
  1061.     FontAlign      GetAlign() const;
  1062.  
  1063.     short          GetLineOrientation() const;
  1064.     short          GetCharOrientation() const;
  1065.  
  1066.     FontWeight     GetWeight() const;
  1067.  
  1068.     BOOL           IsItalic() const;
  1069.     BOOL           IsUnderline() const;
  1070.     BOOL           IsStrikeout() const;
  1071.     BOOL           IsOutline() const;
  1072.     BOOL           IsShadow() const;
  1073.     BOOL           IsTransparent() const;
  1074.  
  1075.     FontType       GetType() const;
  1076.     BOOL           IsDeviceFont() const;
  1077.  
  1078.     USHORT         GetAscent() const;
  1079.     USHORT         GetDescent() const;
  1080.     USHORT         GetLeading() const;
  1081.  
  1082.     BOOL           ExistChar( char c ) const;
  1083.  
  1084.     FontMetric&    operator =( const FontMetric& rMetric );
  1085.     BOOL           operator ==( const FontMetric& rMetric ) const;
  1086.     BOOL           operator !=( const FontMetric& rMetric ) const;
  1087. };
  1088.  
  1089. #endif 
  1090.  
  1091. #ifndef _OUTDEV_HXX
  1092. #define _OUTDEV_HXX
  1093.  
  1094. #ifndef _SV_H
  1095. #endif
  1096. #ifndef _TOOLS_HXX
  1097. #endif
  1098. #ifndef _RESID_HXX
  1099. #endif
  1100. #ifndef _RC_HXX
  1101. #endif
  1102. #ifndef _GDIOBJ_HXX
  1103. #endif
  1104. #ifndef _MAPMOD_HXX
  1105. #endif
  1106. #ifndef _OUTDEV_H
  1107. #endif
  1108. #ifndef _METRIC_HXX
  1109. #endif
  1110.  
  1111. class  EnvStack;
  1112. class  GDIMetaFile;
  1113. class  Bitmap;
  1114. class  Icon;
  1115.  
  1116. enum RasterOp { ROP_OVERPAINT, ROP_INVERT,
  1117.                 ROP_AND, ROP_OR, ROP_XOR, ROP_NXOR };
  1118.  
  1119. class OutputDevice : public Resource
  1120. {
  1121. protected:
  1122.     ImpOutputDevice     aImpOPD;
  1123.     EnvStack*           pStack;
  1124.     GDIMetaFile*        pMetaFile;
  1125.     BOOL                bBlackHole;          
  1126.     Pen                 aPen;
  1127.     Font                aFont;
  1128.     Brush               aBackBrush;
  1129.     Brush               aFillInBrush;
  1130.     MapMode             aMapMode;
  1131.     RasterOp            aRasterOp;
  1132.     BOOL                bMap;
  1133.  
  1134.                    OutputDevice();
  1135.                    OutputDevice( ResId& rResId );
  1136.  
  1137. public:
  1138.     virtual        ~OutputDevice();
  1139.  
  1140.     void           DrawText( const Point& rStartPt, const String& rStr,
  1141.                              USHORT nIndex = 0, USHORT nLen = STRING_LEN );
  1142.     void           DrawKernText( const Point& rStartPt, const String& rStr,
  1143.                                  USHORT nIndex = 0, USHORT nLen = STRING_LEN,
  1144.                                  short* pKernAry = NULL );
  1145.     Size           GetTextSize( const String& rStr, USHORT nIndex = 0,
  1146.                                 USHORT nLen = STRING_LEN ) const;
  1147.     Size           GetKernTextSize( const String& rStr, USHORT nIndex = 0,
  1148.                                     USHORT nLen = STRING_LEN,
  1149.                                     short* pKernAry = NULL ) const;
  1150.     void           DrawPixel( const Point& rPt, const Color& rColor );
  1151.     void           DrawPoint( const Point& rPt );
  1152.     void           DrawLine( const Point& rStartPt, const Point& rEndPt );
  1153.     void           DrawRect( const Rectangle& rRect, USHORT nHorzRount = 0,
  1154.                              USHORT nVertRound = 0 );
  1155.     void           DrawEllipse( const Rectangle& rRect );
  1156.     void           DrawArc( const Rectangle& rRect, const Point& rStartPt,
  1157.                             const Point& rEndPt );
  1158.     void           DrawPie( const Rectangle& rRect, const Point& rStartPt,
  1159.                             const Point& rEndPt );
  1160.     void           DrawPolyLine( USHORT nPoints, Point aPtAry[] );
  1161.     void           DrawPolygon( USHORT nPoints, Point aPtAry[] );
  1162.     void           DrawOutDev( const Point& rDestPt, const Size& rDestSize,
  1163.                                const Point& rSrcPt,  const Size& rSrcSize,
  1164.                                const OutputDevice& rOutDev );
  1165.     void           DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap );
  1166.     void           DrawBitmap( const Point& rDestPt, const Size& rDestSize,
  1167.                                const Bitmap& rBitmap );
  1168.     void           DrawIcon( const Point& rPoint, const Icon& rIcon );
  1169.  
  1170.     void           InvertRect( const Rectangle& rRect );
  1171.     void           HighlightRect( const Rectangle& rRect );
  1172.  
  1173.     Color          GetPixel( const Point& rPt ) const;
  1174.     Bitmap         GetBitmap( const Point& rSrcPt, const Size& rSize ) const;
  1175.  
  1176.     Rectangle      ChangeClipRect();
  1177.     Rectangle      ChangeClipRect( const Rectangle& rRect );
  1178.     Rectangle      GetClipRect() const;
  1179.     BOOL           IsClipRect() const;
  1180.  
  1181.     Pen            ChangePen( const Pen& rNewPen );
  1182.     Pen            GetPen() const { return aPen; }
  1183.     Font           ChangeFont( const Font& rNewFont );
  1184.     Font           GetFont() const { return aFont; }
  1185.     Brush          ChangeBackgroundBrush( const Brush& rNewBrush );
  1186.     Brush          GetBackgroundBrush() const { return aBackBrush; }
  1187.     Brush          ChangeFillInBrush( const Brush& rNewBrush );
  1188.     Brush          GetFillInBrush() const { return aFillInBrush; }
  1189.  
  1190.     MapMode        ChangeMapMode( const MapMode& rNewMapMode );
  1191.     MapMode        GetMapMode() const { return aMapMode; }
  1192.  
  1193.     Point          LogicToPixel( const Point& rLogicPt ) const;
  1194.     Size           LogicToPixel( const Size& rLogicSize ) const;
  1195.     Rectangle      LogicToPixel( const Rectangle& rLogicRect ) const;
  1196.     Point          LogicToPixel( const Point& rLogicPt,
  1197.                                  const MapMode& rMapMode ) const;
  1198.     Size           LogicToPixel( const Size& rLogicSize,
  1199.                                  const MapMode& rMapMode ) const;
  1200.     Rectangle      LogicToPixel( const Rectangle& rLogicRect,
  1201.                                  const MapMode& rMapMode ) const;
  1202.     Point          PixelToLogic( const Point& rDevicePt ) const;
  1203.     Size           PixelToLogic( const Size& rDeviceSize ) const;
  1204.     Rectangle      PixelToLogic( const Rectangle& rDeviceRect ) const;
  1205.     Point          PixelToLogic( const Point& rDevicePt,
  1206.                                  const MapMode& rMapMode ) const;
  1207.     Size           PixelToLogic( const Size& rDeviceSize,
  1208.                                  const MapMode& rMapMode ) const;
  1209.     Rectangle      PixelToLogic( const Rectangle& rDeviceRect,
  1210.                                  const MapMode& rMapMode ) const;
  1211.  
  1212.     RasterOp       ChangeRasterOp( RasterOp aNewROP );
  1213.     RasterOp       GetRasterOp() const { return aRasterOp; }
  1214.  
  1215.             Size   GetOutputSize() const;
  1216.     virtual Size   GetOutputSizePixel() const;
  1217.  
  1218.     USHORT         GetDevFontCount() const;
  1219.     Font           GetDevFont( USHORT nDevFont ) const;
  1220.  
  1221.     USHORT         GetDevFontSizeCount( const Font& rFont ) const;
  1222.     Size           GetDevFontSize( const Font& rFont, USHORT nSize ) const;
  1223.  
  1224.     FontMetric     GetFontMetric() const;
  1225.     FontMetric     GetFontMetric( const Font& rFont ) const;
  1226.  
  1227.     void           Push();
  1228.     void           Pop();
  1229. };
  1230.  
  1231. #endif 
  1232. #ifndef SV_NOWINDOW
  1233.  
  1234. #ifndef _WINDOW_HXX
  1235. #define _WINDOW_HXX
  1236.  
  1237. #ifndef _SV_H
  1238. #endif
  1239. #ifndef _TOOLS_HXX
  1240. #endif
  1241. #ifndef _WINBIT_HXX
  1242. #endif
  1243. #ifndef _RESID_HXX
  1244. #endif
  1245. #ifndef _OUTDEV_HXX
  1246. #endif
  1247. #ifndef _WINDOW_H
  1248. #endif
  1249.  
  1250. class  Cursor;
  1251. class  Pointer;
  1252. class  MouseEvent;
  1253. class  KeyEvent;
  1254. class  HelpEvent;
  1255. class  ResOwner;
  1256. struct RCENUM_TYPE;
  1257.  
  1258. class Window : public OutputDevice
  1259. {
  1260. private:
  1261.     ResOwner* pAutoResObject;  
  1262.  
  1263. protected:
  1264.     ImpWindow      aImpWnd;
  1265.  
  1266.                    Window( RESOURCE_TYPE nTyp, Window* pParent,
  1267.                            WinBits nWinStyle );
  1268.  
  1269.     virtual void   MouseMove( const MouseEvent& rMEvt );
  1270.     virtual void   MouseButtonDown( const MouseEvent& rMEvt );
  1271.     virtual void   MouseButtonUp( const MouseEvent& rMEvt );
  1272.     virtual void   KeyInput( const KeyEvent& rKEvent );
  1273.     virtual void   Paint( const Rectangle& rRect );
  1274.     virtual void   Resize();
  1275.     virtual void   Move();
  1276.     virtual void   GetFocus();
  1277.     virtual void   LooseFocus();
  1278.     virtual void   RequestHelp( const HelpEvent& rHEvt );
  1279.  
  1280. public:
  1281.                    Window( Window* pParent, WinBits nWinStyle = 0 );
  1282.                    Window( Window* pParent, ResId& rId );
  1283.                    ~Window();
  1284.  
  1285.     Window*        ChangeParent( Window* pNewParent );
  1286.     Window*        GetParent() const;
  1287.  
  1288.     void           Show();
  1289.     void           Hide();
  1290.     BOOL           IsVisible() const;
  1291.  
  1292.     void           Enable();
  1293.     void           Disable();
  1294.     BOOL           IsEnabled() const;
  1295.  
  1296.     void           ToTop();
  1297.     Point          ChangePosPixel( const Point& rNewPos );
  1298.     Point          GetPosPixel() const;
  1299.     Size           ChangeSizePixel( const Size& rNewSize );
  1300.     Size           GetSizePixel() const;
  1301.     void           SetPosSizePixel( const Point& rNewPos,
  1302.                                     const Size& rNewSize );
  1303.     Size           ChangeOutputSizePixel( const Size& rNewSize );
  1304.     Size           GetOutputSizePixel() const;
  1305.  
  1306.     Point          OutputToScreenPixel( const Point& rPt ) const;
  1307.     Point          ScreenToOutputPixel( const Point& rPt ) const;
  1308.  
  1309.     void           CaptureMouse();
  1310.     void           ReleaseMouse();
  1311.  
  1312.     void           GrabFocus();
  1313.     BOOL           HasFocus() const;
  1314.  
  1315.     void           Scroll( short nHorzScroll, short nVertScroll );
  1316.     void           Scroll( short nHorzScroll, short nVertScroll,
  1317.                            const Rectangle& rRect );
  1318.     void           Invalidate();
  1319.     void           Invalidate( const Rectangle& rRect );
  1320.     void           InvalidateForeground();
  1321.     void           InvalidateForeground( const Rectangle& rRect );
  1322.     void           Update();
  1323.     void           Flash();
  1324.  
  1325.     BOOL           ChangeUpdateMode( BOOL bUpdate );
  1326.     BOOL           GetUpdateMode() const;
  1327.  
  1328.     void           SetText( const String& rStr );
  1329.     String         GetText() const;
  1330.     USHORT         GetTextLen() const;
  1331.  
  1332.     Pointer        ChangePointer( const Pointer& rPointer );
  1333.     Pointer        GetPointer() const;
  1334.  
  1335.     Cursor*        ChangeCursor( Cursor* pCursor );
  1336.     Cursor*        GetCursor() const;
  1337.  
  1338.     void           SetHelpText( const String& rStr );
  1339.     String         GetHelpText() const;
  1340.     USHORT         GetHelpTextLen() const;
  1341.  
  1342.     ULONG          ChangeHelpId( ULONG nHelpId );
  1343.     ULONG          GetHelpId() const;
  1344. };
  1345.  
  1346. #endif 
  1347.  
  1348. #ifndef _SYSWIN_HXX
  1349. #define _SYSWIN_HXX
  1350.  
  1351. #ifndef _SV_H
  1352. #endif
  1353. #ifndef _WINBIT_HXX
  1354. #endif
  1355. #ifndef _RESID_HXX
  1356. #endif
  1357. #ifndef _WINDOW_HXX
  1358. #endif
  1359. #ifndef _SYSWIN_H
  1360. #endif
  1361.  
  1362. class SystemWindow : public Window
  1363. {
  1364. protected:
  1365.    ImpSysWin       aImpSysWnd;
  1366.  
  1367.                    SystemWindow( RESOURCE_TYPE nTyp, Window* pParent,
  1368.                                  WinBits nWinStyle );
  1369.  
  1370.                    SystemWindow( Window* pParent, ResId& rResId );
  1371.  
  1372.     virtual void   Activate();
  1373.     virtual void   Deactivate();
  1374.  
  1375. public:
  1376.                    ~SystemWindow();
  1377.  
  1378.     virtual BOOL   Close();
  1379.  
  1380.     BOOL           IsActive() const;
  1381. };
  1382.  
  1383. #endif 
  1384.  
  1385. #ifndef _WRKWIN_HXX
  1386. #define _WRKWIN_HXX
  1387.  
  1388. #ifndef _SV_H
  1389. #endif
  1390. #ifndef _RESID_HXX
  1391. #endif
  1392. #ifndef _SYSWIN_HXX
  1393. #endif
  1394. #ifndef _WRKWIN_H
  1395. #endif
  1396.  
  1397. class Icon;
  1398.  
  1399. class WorkWindow : public SystemWindow
  1400. {
  1401. protected:
  1402.     ImpWorkWin     aImpWork;
  1403.  
  1404.                    WorkWindow( RESOURCE_TYPE nTyp,Window* pParent,
  1405.                                WinBits nWinStyle );
  1406.  
  1407. public:
  1408.               WorkWindow( Window* pParent, WinBits nWinStyle = WB_STDWORK );
  1409.               WorkWindow( Window* pParent, ResId& rResId );
  1410.               ~WorkWindow();
  1411.  
  1412.     void      Minimize();
  1413.     void      Maximize();
  1414.     void      Restore();
  1415.  
  1416.     BOOL      IsMinimized() const;
  1417.     BOOL      IsMaximized() const;
  1418.  
  1419.     Icon      ChangeIcon( const Icon& rNewIcon );
  1420.     Icon      GetIcon() const;
  1421. };
  1422.  
  1423. #endif 
  1424. #ifndef SV_NOCONTROL
  1425.  
  1426. #ifndef _CTRL_HXX
  1427. #define _CTRL_HXX
  1428.  
  1429. #ifndef _SV_H
  1430. #endif
  1431. #ifndef _RESID_HXX
  1432. #endif
  1433. #ifndef _WINDOW_HXX
  1434. #endif
  1435. #ifndef _CTRL_H
  1436. #endif
  1437.  
  1438. class Control : public Window
  1439. {
  1440. private:
  1441.     Link      aGetFcHdlLink;      
  1442.     Link      aLosFcHdlLink;      
  1443.  
  1444. protected:
  1445.     ImpControl     aImpCtrl;
  1446.  
  1447.               Control( RESOURCE_TYPE nTyp, Window* pParent,
  1448.                        WinBits nWinStyle );
  1449.  
  1450.     void      GetFocus();
  1451.     void      LooseFocus();
  1452.  
  1453. public:
  1454.               Control( Window* pWindow, WinBits nWinStyle = 0 );
  1455.               Control( Window* pWindow, ResId& rResId );
  1456.               ~Control();
  1457.  
  1458.     void      ShowFocus( const Rectangle& rRect );
  1459.     void      HideFocus();
  1460.  
  1461.     void      DrawCtrlText( const Point& rPoint, const String& rStr,
  1462.                             USHORT nIndex = 0, USHORT nLen = STRING_LEN );
  1463.     Size      GetCtrlTextSize( const String& rStr, USHORT nIndex = 0,
  1464.                                USHORT nLen = STRING_LEN ) const;
  1465.  
  1466.     Link      ChangeGetFocusHdl( const Link& rLink );
  1467.     Link      GetGetFocusHdl() const   { return aGetFcHdlLink; }
  1468.     Link      ChangeLooseFocusHdl( const Link& rLink );
  1469.     Link      GetLooseFocusHdl() const { return aLosFcHdlLink; }
  1470. };
  1471.  
  1472. #endif  
  1473.  
  1474. #ifndef _SCRBAR_HXX
  1475. #define _SCRBAR_HXX
  1476.  
  1477. #ifndef _SV_H
  1478. #endif
  1479. #ifndef _TOOLS_HXX
  1480. #endif
  1481. #ifndef _WINBIT_HXX
  1482. #endif
  1483. #ifndef _RESID_HXX
  1484. #endif
  1485. #ifndef _CTRL_HXX
  1486. #endif
  1487. #ifndef _SCRBAR_H
  1488. #endif
  1489.  
  1490. class ScrollBar : public Control
  1491. {
  1492. private:
  1493.     ImpScrBar aImpScrBar;
  1494.     Link      aLnMoveHdlLink;     
  1495.     Link      aPgMoveHdlLink;     
  1496.     Link      aThumbDragHdlLink;  
  1497.     Link      aEndScrollHdlLink;  
  1498.  
  1499. protected:
  1500.  
  1501.               ScrollBar( RESOURCE_TYPE nTyp, Window* pParent,
  1502.                          WinBits nWinStyle );
  1503.  
  1504. public:
  1505.               ScrollBar( Window* pParent, WinBits nWinStyle = WB_VSCROLL );
  1506.               ScrollBar( Window* pParent, ResId& rResId );
  1507.  
  1508.     virtual   void LineMove();
  1509.     virtual   void PageMove();
  1510.     virtual   void ThumbDrag();
  1511.     virtual   void EndScroll();
  1512.  
  1513. public:
  1514.     short     ChangeThumbPos( short nThumbPos );
  1515.     short     GetThumbPos() const;
  1516.     short     ChangePageSize( short nNewSize );
  1517.     short     GetPageSize() const;
  1518.     short     ChangeLineSize( short nNewSize );
  1519.     short     GetLineSize() const;
  1520.     Range     ChangeRange( const Range& rRange );
  1521.     Range     GetRange() const;
  1522.  
  1523.     short     GetDelta() const;
  1524.     short     GetDeltaSum() const;
  1525.  
  1526.     Link      ChangeLineMoveHdl( const Link& rLink );
  1527.     Link      GetLineMoveHdl() const             { return aLnMoveHdlLink;     }
  1528.     Link      ChangePageMoveHdl( const Link& rLink );
  1529.     Link      GetPageMoveHdl() const             { return aPgMoveHdlLink;     }
  1530.     Link      ChangeThumbDragHdl( const Link& rLink );
  1531.     Link      GetThumbDragHdl() const            { return aThumbDragHdlLink;  }
  1532.     Link      ChangeEndScrollHdl( const Link& rLink );
  1533.     Link      GetEndScrollHdl() const            { return aEndScrollHdlLink;  }
  1534. };
  1535.  
  1536. class AutoScrollBar : public ScrollBar
  1537. {
  1538. public:
  1539.     AutoScrollBar( Window* pParent, WinBits nWinStyle = WB_VSCROLL );
  1540.     AutoScrollBar( Window* pParent, ResId& rResId );
  1541. };
  1542.  
  1543. #endif 
  1544.  
  1545. #ifndef _BUTTON_HXX
  1546. #define _BUTTON_HXX
  1547.  
  1548. #ifndef _SV_H
  1549. #endif
  1550. #ifndef _WINBIT_HXX
  1551. #endif
  1552. #ifndef _RESID_HXX
  1553. #endif
  1554. #ifndef _CTRL_HXX
  1555. #endif
  1556. #ifndef _BUTTON_H
  1557. #endif
  1558.  
  1559. class Button : public Control
  1560. {
  1561. private:
  1562.     Link           aClkHdlLink;    
  1563.  
  1564. protected:
  1565.  
  1566.                    Button( RESOURCE_TYPE nTyp, Window* pParent,
  1567.                            WinBits nWinStyle );
  1568.  
  1569.     virtual void   Click();
  1570.  
  1571. public:
  1572.                    Button( Window* pParent, WinBits nWinStyle = 0 );
  1573.                    Button( Window* pParent, ResId& rResId );
  1574.  
  1575.     Link           ChangeClickHdl( const Link& rLink );
  1576.     Link           GetClickHdl() const { return aClkHdlLink; }
  1577. };
  1578.  
  1579. class PushButton : public Button
  1580. {
  1581. protected:
  1582.  
  1583.          PushButton( RESOURCE_TYPE nTyp, Window* pParent,
  1584.                      WinBits nWinStyle );
  1585.  
  1586. public:
  1587.          PushButton( Window* pParent, WinBits nWinStyle = 0 );
  1588.          PushButton( Window* pParent, ResId& rResId );
  1589. };
  1590.  
  1591. class DefPushButton : public PushButton
  1592. {
  1593. public:
  1594.          DefPushButton( Window* pParent, WinBits nWinStyle = 0 );
  1595.          DefPushButton( Window* pParent, ResId& rResId );
  1596. };
  1597.  
  1598. class RadioButton : public Button
  1599. {
  1600. protected:
  1601.  
  1602.          RadioButton( RESOURCE_TYPE nTyp, Window* pParent,
  1603.                       WinBits nWinStyle );
  1604.  
  1605. public:
  1606.          RadioButton( Window* pParent, WinBits nWinStyle = 0 );
  1607.          RadioButton( Window* pParent, ResId& rResId );
  1608.  
  1609.     void Check( BOOL bCheck = TRUE );
  1610.     BOOL IsChecked() const;
  1611. };
  1612.  
  1613. class AutoRadioButton : public RadioButton
  1614. {
  1615. public:
  1616.          AutoRadioButton( Window* pParent, WinBits nWinStyle = 0 );
  1617.          AutoRadioButton( Window* pParent, ResId& rResId );
  1618. };
  1619.  
  1620. class CheckBox : public Button
  1621. {
  1622. protected:
  1623.  
  1624.          CheckBox( RESOURCE_TYPE nTyp, Window* pParent, WinBits nWinStyle );
  1625.  
  1626. public:
  1627.          CheckBox( Window* pParent, WinBits nWinStyle = 0 );
  1628.          CheckBox( Window* pParent, ResId& rResId );
  1629.  
  1630.     void Check( BOOL bCheck = TRUE );
  1631.     BOOL IsChecked() const;
  1632. };
  1633.  
  1634. class AutoCheckBox : public CheckBox
  1635. {
  1636. public:
  1637.          AutoCheckBox( Window* pParent, WinBits nWinStyle = 0 );
  1638.          AutoCheckBox( Window* pParent, ResId& rResId );
  1639. };
  1640.  
  1641. class TriStateBox : public Button
  1642. {
  1643. protected:
  1644.     ImpTriBox aImpTriBox;
  1645.  
  1646.               TriStateBox( RESOURCE_TYPE nTyp, Window* pParent,
  1647.                            WinBits nWinStyle );
  1648.  
  1649. public:
  1650.               TriStateBox( Window* pParent, WinBits nWinStyle = 0 );
  1651.               TriStateBox( Window* pParent, ResId& rResId );
  1652.  
  1653.     TriState  ChangeState( TriState aState );
  1654.     TriState  GetState() const;
  1655.  
  1656.     void      EnableTriState( BOOL bTriState = TRUE );
  1657.     BOOL      IsTriStateEnabled() const;
  1658. };
  1659.  
  1660. class AutoTriStateBox : public TriStateBox
  1661. {
  1662. public:
  1663.          AutoTriStateBox( Window* pParent, WinBits nWinStyle = 0 );
  1664.          AutoTriStateBox( Window* pParent, ResId& rResId );
  1665. };
  1666.  
  1667. #endif  
  1668.  
  1669. #ifndef _FIXED_HXX
  1670. #define _FIXED_HXX
  1671.  
  1672. #ifndef _SV_H
  1673. #endif
  1674. #ifndef _WINBIT_HXX
  1675. #endif
  1676. #ifndef _RESID_HXX
  1677. #endif
  1678. #ifndef _CTRL_HXX
  1679. #endif
  1680. #ifndef _BITMAP_HXX
  1681. #endif
  1682. #ifndef _ICON_HXX
  1683. #endif
  1684.  
  1685. class FixedText : public Control
  1686. {
  1687. public:
  1688.          FixedText( Window* pParent, WinBits nWinStyle = WB_LEFT );
  1689.          FixedText( Window* pParent, ResId& rResId );
  1690. };
  1691.  
  1692. class FixedBitmap : public Control
  1693. {
  1694. private:
  1695.     Bitmap    aBmp;
  1696.  
  1697. protected:
  1698.     void      Paint( const Rectangle& );
  1699.     void      Resize();
  1700.  
  1701. public:
  1702.               FixedBitmap( Window* pParent, WinBits nWinStyle = 0 );
  1703.               FixedBitmap( Window* pParent, ResId& rResId );
  1704.  
  1705.     Bitmap    ChangeBitmap( const Bitmap& rBitmap );
  1706.     Bitmap    GetBitmap() const { return aBmp; }
  1707. };
  1708.  
  1709. class FixedIcon : public Control
  1710. {
  1711. private:
  1712.     Icon      aIcon;
  1713.  
  1714. protected:
  1715.     void      Paint( const Rectangle& );
  1716.     void      Resize();
  1717.  
  1718. public:
  1719.               FixedIcon( Window* pParent, WinBits nWinStyle = 0 );
  1720.               FixedIcon( Window* pParent, ResId& rResId );
  1721.  
  1722.     Icon      ChangeIcon( const Icon& rIcon );
  1723.     Icon      GetIcon() const { return aIcon; }
  1724. };
  1725.  
  1726. #endif 
  1727.  
  1728. #ifndef _GROUP_HXX
  1729. #define _GROUP_HXX
  1730.  
  1731. #ifndef _SV_H
  1732. #endif
  1733. #ifndef _WINBIT_HXX
  1734. #endif
  1735. #ifndef _RESID_HXX
  1736. #endif
  1737. #ifndef _CTRL_HXX
  1738. #endif
  1739.  
  1740. class GroupBox : public Control
  1741. {
  1742. public:
  1743.          GroupBox( Window* pParent, ResId& rResId );
  1744.          GroupBox( Window* pParent );
  1745. };
  1746.  
  1747. #endif 
  1748.  
  1749. #ifndef _LSTBOX_HXX
  1750. #define _LSTBOX_HXX
  1751.  
  1752. #ifndef _SV_H
  1753. #endif
  1754. #ifndef _WINBIT_HXX
  1755. #endif
  1756. #ifndef _RESID_HXX
  1757. #endif
  1758. #ifndef _CTRL_HXX
  1759. #endif
  1760. #ifndef _LSTBOX_H
  1761. #endif
  1762.  
  1763. #define LISTBOX_APPEND            ((USHORT)0xFFFF)
  1764. #define LISTBOX_ENTRY_NOTFOUND    ((USHORT)0xFFFF)
  1765.  
  1766. class ListBox : public Control
  1767. {
  1768. private:
  1769.     ImpLstBox aImpLB;             
  1770.     Link      aHighlightHdlLink;  
  1771.     Link      aSelectHdlLink;     
  1772.  
  1773.     void      ReadResource();     
  1774.  
  1775. protected:
  1776.  
  1777.               ListBox( RESOURCE_TYPE nTyp, Window* pParent,
  1778.                        WinBits nWinStyle );
  1779.  
  1780.     virtual   void Highlight();
  1781.     virtual   void Select();
  1782.  
  1783. public:
  1784.               ListBox( Window* pParent, WinBits nWinStyle = WB_BORDER );
  1785.               ListBox( Window* pParent, ResId& rResId );
  1786.  
  1787.     void      InsertEntry( const String& rStr, USHORT nPos = LISTBOX_APPEND );
  1788.     void      RemoveEntry( const String& rStr );
  1789.     void      RemoveEntry( USHORT nPos );
  1790.  
  1791.     USHORT    GetEntryPos( const String& rStr ) const;
  1792.     USHORT    GetEntryLen( USHORT nPos ) const;
  1793.     String    GetEntry( USHORT nPos ) const;
  1794.     USHORT    GetEntryCount() const;
  1795.  
  1796.     USHORT    GetCurEntryPos() const;
  1797.     USHORT    GetCurEntryLen() const;
  1798.     String    GetCurEntry() const;
  1799.  
  1800.     void      SetCurEntryPos( USHORT nPos );
  1801.     void      SetCurEntry( const String& rStr );
  1802.     void      SetNoCurEntry();
  1803.  
  1804.     void      Clear();
  1805.  
  1806.     Link      ChangeHighlightHdl( const Link& rLink );
  1807.     Link      GetHighlightHdl() const { return aHighlightHdlLink;  }
  1808.     Link      ChangeSelectHdl( const Link& rLink );
  1809.     Link      GetSelectHdl() const    { return aSelectHdlLink;     }
  1810. };
  1811.  
  1812. class DropDownListBox : public ListBox
  1813. {
  1814. private:
  1815.     Link            aDropDownHdlLink;   
  1816.  
  1817. protected:
  1818.     virtual void    DropDown();
  1819.  
  1820. public:
  1821.                     DropDownListBox( Window* pParent,
  1822.                                      WinBits nWinStyle = 0 );
  1823.                     DropDownListBox( Window* pParent, ResId& rResId );
  1824.  
  1825.     Link            ChangeDropDownHdl( const Link& rLink );
  1826.     Link            GetDropDownHdl() const { return aDropDownHdlLink;  }
  1827. };
  1828.  
  1829. #define COMBOBOX_NOLIMIT     0
  1830.  
  1831. class ComboBox : public ListBox
  1832. {
  1833. private:
  1834.     ImpComboBox    aImpComboBox;
  1835.  
  1836.     Link           aChangeHdlLink;     
  1837.     BOOL           bSetTextModify;     
  1838.     BOOL           bModify;            
  1839.  
  1840. protected:
  1841.  
  1842.                    ComboBox( RESOURCE_TYPE nTyp, Window* pParent,
  1843.                              WinBits nWinStyle );
  1844.  
  1845.     virtual void   Modify();
  1846.  
  1847. public:
  1848.                    ComboBox( Window* pParent, WinBits nWinStyle = 0 );
  1849.                    ComboBox( Window* pParent, ResId& rResId );
  1850.  
  1851.     USHORT         ChangeMaxTextLen( USHORT nMaxLen = COMBOBOX_NOLIMIT );
  1852.     USHORT         GetMaxTextLen() const;
  1853.  
  1854.     BOOL           IsSetTextModified() const { return( bSetTextModify ); }
  1855.     BOOL           IsModified() const        { return( bModify );        }
  1856.  
  1857.     Selection      ChangeSelection( const Selection& rSelection );
  1858.     Selection      GetSelection() const;
  1859.     String         GetSelected() const;
  1860.  
  1861.     Link           ChangeModifyHdl( const Link& rLink );
  1862.     Link           GetModifyHdl() const      { return aChangeHdlLink;  }
  1863. };
  1864.  
  1865. class DropDownComboBox : public ComboBox
  1866. {
  1867. private:
  1868.     Link            aDropDownHdlLink;   
  1869.  
  1870. protected:
  1871.     virtual void    DropDown();
  1872.  
  1873. public:
  1874.                     DropDownComboBox( Window* pParent,
  1875.                                       WinBits nWinStyle = 0 );
  1876.                     DropDownComboBox( Window* pParent, ResId& rResId );
  1877.  
  1878.     Link            ChangeDropDownHdl( const Link& rLink );
  1879.     Link            GetDropDownHdl() const { return aDropDownHdlLink;  }
  1880. };
  1881.  
  1882. #endif  
  1883.  
  1884. #ifndef _EDIT_HXX
  1885. #define _EDIT_HXX
  1886.  
  1887. #ifndef _SV_H
  1888. #endif
  1889. #ifndef _WINBIT_HXX
  1890. #endif
  1891. #ifndef _RESID_HXX
  1892. #endif
  1893. #ifndef _CTRL_HXX
  1894. #endif
  1895. #ifndef _EDIT_H
  1896. #endif
  1897.  
  1898. #define EDIT_NOLIMIT    0
  1899.  
  1900. class Edit : public Control
  1901. {
  1902. private:
  1903.     ImpEdit        aImpEdit;           
  1904.  
  1905.     Link           aChangeHdlLink;     
  1906.     BOOL           bSetTextModify;     
  1907.     BOOL           bModify;            
  1908.  
  1909. protected:
  1910.  
  1911.                    Edit( RESOURCE_TYPE nTyp, Window* pParent,
  1912.                          WinBits nWinStyle );
  1913.  
  1914.                    Edit( Window* pParent, ResId& rResId );
  1915.  
  1916.     virtual void   Modify();
  1917.  
  1918. public:
  1919.     USHORT         ChangeMaxTextLen( USHORT nMaxLen = EDIT_NOLIMIT );
  1920.     USHORT         GetMaxTextLen() const;
  1921.  
  1922.     BOOL           IsSetTextModified() const { return( bSetTextModify ); }
  1923.     BOOL           IsModified() const        { return( bModify );        }
  1924.  
  1925.     Selection      ChangeSelection( const Selection& rSelection );
  1926.     Selection      GetSelection() const;
  1927.  
  1928.     void           ReplaceSelected( const String& rStr );
  1929.     void           DeleteSelected();
  1930.     String         GetSelected() const;
  1931.  
  1932.     void           Cut();
  1933.     void           Copy();
  1934.     void           Paste();
  1935.  
  1936.     Link           ChangeModifyHdl( const Link& rLink );
  1937.     Link           GetModifyHdl() const      { return aChangeHdlLink;    }
  1938. };
  1939.  
  1940. class SingleLineEdit : public Edit
  1941. {
  1942. public:
  1943.          SingleLineEdit( Window* pParent,
  1944.                          WinBits nWinStyle = WB_LEFT | WB_BORDER );
  1945.          SingleLineEdit( Window* pParent, ResId& rResId );
  1946. };
  1947.  
  1948. class MultiLineEdit : public Edit
  1949. {
  1950. public:
  1951.          MultiLineEdit( Window* pParent,
  1952.                         WinBits nWinStyle = WB_LEFT | WB_BORDER );
  1953.          MultiLineEdit( Window* pParent, ResId& rResId );
  1954. };
  1955.  
  1956. #endif 
  1957. #endif
  1958. #ifndef SV_NODIALOG
  1959.  
  1960. #ifndef _DIALOG_HXX
  1961. #define _DIALOG_HXX
  1962.  
  1963. #ifndef _SV_H
  1964. #endif
  1965. #ifndef _WINBIT_HXX
  1966. #endif
  1967. #ifndef _RESID_HXX
  1968. #endif
  1969. #ifndef _SYSWIN_HXX
  1970. #endif
  1971. #ifndef _DIALOG_H
  1972. #endif
  1973.  
  1974. class Dialog : public SystemWindow
  1975. {
  1976. protected:
  1977.     ImpDlg    aImpDlg;       
  1978.  
  1979.          Dialog( Window* pParent, WinBits nWinStyle );
  1980.  
  1981.          Dialog( Window* pParent, ResId& rResId );
  1982.  
  1983.          Dialog( RESOURCE_TYPE nTyp, Window* pParent, WinBits nWinStyle );
  1984.  
  1985. public:
  1986.          ~Dialog();
  1987. };
  1988.  
  1989. class ModelessDialog : public Dialog
  1990. {
  1991. public:
  1992.          ModelessDialog( Window* pParent, WinBits nWinStyle = WB_STDMODELESS );
  1993.          ModelessDialog( Window* pParent, ResId& rResId );
  1994.          ~ModelessDialog();
  1995. };
  1996.  
  1997. class ModalDialog : public Dialog
  1998. {
  1999. private:
  2000.     void      Show() {}
  2001.     void      Hide() {}
  2002.  
  2003. protected:
  2004.     ImpModalDlg    aImpModalDlg;
  2005.  
  2006.               ModalDialog( RESOURCE_TYPE nTyp, Window* pParent,
  2007.                            WinBits nStyle );
  2008.  
  2009.     BOOL      Close();
  2010.  
  2011. public:
  2012.               ModalDialog( Window* pParent, WinBits nWinStyle = WB_STDMODAL );
  2013.               ModalDialog( Window* pParent, ResId& rResId );
  2014.               ~ModalDialog();
  2015.  
  2016.     short     Execute();
  2017.     BOOL      IsInExecute() const;
  2018.  
  2019.     void      EndDialog( short nResult = 0 );
  2020. };
  2021.  
  2022. #endif  
  2023. #endif
  2024. #ifndef SV_NOMSGBOX
  2025.  
  2026. #ifndef _MSGBOX_HXX
  2027. #define _MSGBOX_HXX
  2028.  
  2029. #ifndef _SV_H
  2030. #endif
  2031. #ifndef _RESID_HXX
  2032. #endif
  2033. #ifndef _WINBIT_HXX
  2034. #endif
  2035. #ifndef _WINDOW_HXX
  2036. #endif
  2037. #ifndef _DIALOG_HXX
  2038. #endif
  2039. #ifndef _MSGBOX_H
  2040. #endif
  2041.  
  2042. #define RET_OK               1
  2043. #define RET_CANCEL           2
  2044. #define RET_YES              3
  2045. #define RET_NO               4
  2046. #define RET_RETRY            5
  2047.  
  2048. class MessBox : public ModalDialog
  2049. {
  2050. protected:
  2051.     ImpMessBox     aImpMess;
  2052.  
  2053. #ifdef MAC
  2054.     void      Paint( const Rectangle& rRect );
  2055. #endif
  2056.  
  2057. public:
  2058.               MessBox( Window* pParent, WinBits nWinStyle,
  2059.                        const String& rTitle, const String& rMessage );
  2060.               MessBox( Window* pParent, ResId& rResId );
  2061.               ~MessBox();
  2062.  
  2063.     short     Execute();
  2064. };
  2065.  
  2066. class InfoBox : public MessBox
  2067. {
  2068. public:
  2069.         InfoBox( Window* pParent, const String& rMessage );
  2070.         InfoBox( Window* pParent, ResId & rResId );
  2071. };
  2072.  
  2073. class WarningBox : public MessBox
  2074. {
  2075. public:
  2076.         WarningBox( Window* pParent, WinBits nWinStyle,
  2077.                     const String& rMessage );
  2078.         WarningBox( Window* pParent, ResId& rResId );
  2079. };
  2080.  
  2081. class ErrorBox : public MessBox
  2082. {
  2083. public:
  2084.         ErrorBox( Window* pParent, WinBits nWinStyle,
  2085.                   const String& rMessage );
  2086.         ErrorBox( Window* pParent, ResId& rResId );
  2087. };
  2088.  
  2089. class QueryBox : public MessBox
  2090. {
  2091. public:
  2092.         QueryBox( Window* pParent, WinBits nWinStyle,
  2093.                   const String& rMessage );
  2094.         QueryBox( Window* pParent, ResId& rResId );
  2095. };
  2096.  
  2097. class SysMessBox : public MessBox
  2098. {
  2099. public:
  2100.         SysMessBox( Window* pParent, WinBits nWinStyle,
  2101.                     const String& rMessage );
  2102.         SysMessBox( Window* pParent, ResId& rResId );
  2103. };
  2104.  
  2105. #endif 
  2106. #endif
  2107. #endif
  2108. #ifndef SV_NOMENU
  2109.  
  2110. #ifndef _MENU_HXX
  2111. #define _MENU_HXX
  2112.  
  2113. #ifndef _SV_H
  2114. #endif
  2115. #ifndef _RESID_HXX
  2116. #endif
  2117. #ifndef _RC_HXX
  2118. #endif
  2119. #ifndef _MENU_H
  2120. #endif
  2121.  
  2122. struct RCENUM_TYPE;
  2123. class  PopupMenu;
  2124. class  Bitmap;
  2125. class  HelpEvent;
  2126.  
  2127. #define  MENU_APPEND         ((USHORT)-1)
  2128. #define  MENU_ITEM_NOTFOUND  ((USHORT)-1)
  2129.  
  2130. class Menu : public Resource
  2131. {
  2132. protected:
  2133.     ImpMenu        aImpMenu;           
  2134.  
  2135.                        Menu();
  2136.                        Menu( ResId& );
  2137.  
  2138.     virtual void   Activate();
  2139.     virtual void   Deactivate();
  2140.     virtual void   Highlight();
  2141.     virtual void   Select();
  2142.     virtual void   RequestHelp( const HelpEvent& rHEvt );
  2143.  
  2144. public:
  2145.     virtual        ~Menu();
  2146.  
  2147.     BOOL           InsertItem( ResId& rResId, USHORT nPos = MENU_APPEND );
  2148.     BOOL           InsertItem( USHORT nItemId, const String& rStr,
  2149.                                USHORT nPos = MENU_APPEND );
  2150.     BOOL           InsertItem( USHORT nItemId, const Bitmap& rBitmap,
  2151.                                USHORT nPos = MENU_APPEND );
  2152.     void           InsertSeparator( USHORT nPos = MENU_APPEND );
  2153.     void           RemoveItem( USHORT nPos );
  2154.  
  2155.     USHORT         GetItemCount() const;
  2156.     USHORT         GetItemId( USHORT nPos ) const;
  2157.     USHORT         GetItemPos( USHORT nItemId ) const;
  2158.     USHORT         GetCurItemId() const;
  2159.  
  2160.     PopupMenu*     ChangePopupMenu( USHORT nItemId, PopupMenu* pMenu );
  2161.     PopupMenu*     GetPopupMenu( USHORT nItemId ) const;
  2162.  
  2163.     void           CheckItem( USHORT nItemId, BOOL bCheck = TRUE );
  2164.     BOOL           IsItemChecked( USHORT nItemId ) const;
  2165.  
  2166.     void           EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
  2167.     BOOL           IsItemEnabled( USHORT nItemId ) const;
  2168.  
  2169.     void           SetItemText( USHORT nItemId, const String& rStr );
  2170.     String         GetItemText( USHORT nItemId ) const;
  2171.     USHORT         GetItemTextLen( USHORT nItemId ) const;
  2172.  
  2173.     void           SetItemBitmap( USHORT nItemId, const Bitmap& rBitmap );
  2174.     Bitmap         GetItemBitmap( USHORT nItemId ) const;
  2175.  
  2176.     void           SetHelpText( USHORT nItemId, const String& rString );
  2177.     String         GetHelpText( USHORT nItemId ) const;
  2178.     USHORT         GetHelpTextLen( USHORT nItemId ) const;
  2179.  
  2180.     ULONG          ChangeHelpId( USHORT nItemId, ULONG nHelpId );
  2181.     ULONG          GetHelpId( USHORT nItemId ) const;
  2182.  
  2183.     void           PushActivateHdl( const Link& rLink );
  2184.     Link           PopActivateHdl();
  2185.     void           PushDeactivateHdl( const Link& rLink );
  2186.     Link           PopDeactivateHdl();
  2187.     void           PushHighlightHdl( const Link& rLink );
  2188.     Link           PopHighlightHdl();
  2189.     void           PushSelectHdl( const Link& rLink );
  2190.     Link           PopSelectHdl();
  2191. };
  2192.  
  2193. class MenuBar : public Menu
  2194. {
  2195. public:
  2196.          MenuBar();
  2197.          MenuBar( ResId& rResId );
  2198. };
  2199.  
  2200. class PopupMenu : public Menu
  2201. {
  2202. public:
  2203.          PopupMenu();
  2204.          PopupMenu( ResId& rResId );
  2205.  
  2206.     void Execute( const Point& rPopupPos );
  2207. };
  2208.  
  2209. #endif 
  2210. #endif
  2211.  
  2212. #ifndef _TIMER_HXX
  2213. #define _TIMER_HXX
  2214.  
  2215. #ifndef _TOOLS_HXX
  2216. #endif
  2217. #ifndef _SV_H
  2218. #endif
  2219. #ifndef _TIMER_H
  2220. #endif
  2221.  
  2222. class Timer : public LinkHdl
  2223. {
  2224. private:
  2225.     Link           aTimeoutLinkHdl;
  2226.     ULONG          nTimeout;
  2227.     BOOL           bActive;
  2228.  
  2229. protected:
  2230.     ImpTimer       aImpTimer;
  2231.  
  2232.     virtual void   Timeout();
  2233.  
  2234. public:
  2235.                    Timer();
  2236.                    ~Timer();
  2237.  
  2238.     void           Start();
  2239.     void           Stop();
  2240.  
  2241.     ULONG          ChangeTimeout( ULONG nTimeout );
  2242.     ULONG          GetTimeout() const { return nTimeout; }
  2243.     BOOL           IsActive() const { return bActive; }
  2244.  
  2245.     Link           ChangeTimeoutHdl( const Link& rLink );
  2246.     Link           GetTimeoutHdl() const { return aTimeoutLinkHdl; }
  2247. };
  2248.  
  2249. class AutoTimer : public Timer
  2250. {
  2251. public:
  2252.          AutoTimer();
  2253. };
  2254.  
  2255. #endif 
  2256.  
  2257. #ifndef _GDIMTF_HXX
  2258. #define _GDIMTF_HXX
  2259.  
  2260. #ifndef _TOOLS_HXX
  2261. #endif
  2262. #ifndef _SV_H
  2263. #endif
  2264.  
  2265. class OutputDevice;
  2266.  
  2267. class GDIMetaFile : public MetaFile
  2268. {
  2269. private:
  2270.     GDIMetaFile*   pPrev;
  2271.     GDIMetaFile*   pNext;
  2272.  
  2273. protected:
  2274.     void           AddGDIAction( MetaAction* pAction );
  2275.     void           Linker( void* pObject, BOOL bLink );
  2276.  
  2277. public:
  2278.                    GDIMetaFile();
  2279.                    GDIMetaFile( const GDIMetaFile& rMtf );
  2280.                    ~GDIMetaFile();
  2281.  
  2282.     BOOL           Record( OutputDevice* pOutDev )
  2283.                        { return MetaFile::Record( (void*)pOutDev ); }
  2284.     BOOL           Play( OutputDevice* pOutDev )
  2285.                        { return MetaFile::Play( (void*)pOutDev ); }
  2286.     BOOL           Play( OutputDevice* pOutDev, const String& rToLabel )
  2287.                        { return MetaFile::Play( (void*)pOutDev, rToLabel ); }
  2288.     BOOL           Play( GDIMetaFile& rMtf )
  2289.                        { return MetaFile::Play( rMtf ); }
  2290.     BOOL           Play( GDIMetaFile& rMtf, const String& rToLabel )
  2291.                        { return MetaFile::Play( rMtf, rToLabel ); }
  2292.  
  2293.     GDIMetaFile&   operator=( const GDIMetaFile& rMtf );
  2294.  
  2295.     BOOL           SaveStatus();
  2296. };
  2297.  
  2298. #endif 
  2299. #endif
  2300. #endif
  2301.