home *** CD-ROM | disk | FTP | other *** search
/ PC Direkt 1995 March / PCD_395.iso / starview / winmsci / german / sv.hx_ / SV.HXX
Encoding:
Text File  |  1994-10-07  |  184.3 KB  |  6,300 lines

  1. /*************************************************************************
  2. * SV.HXX
  3. * Fri Oct  7 09:28:01 1994
  4. * (c) 1992-1994 STAR DIVISION
  5. *************************************************************************/
  6. #ifndef _SV_HXX
  7. #define _SV_HXX
  8. #define _WINDOW_H
  9. #define _SYSWIN_H
  10. #define _WRKWIN_H
  11. #define _MDIWIN_H
  12. #define _FLOATWIN_H
  13. #define _MSGBOX_H
  14. #define _ICON_H
  15. #define _IMPRC_H
  16. #define _DIALOG_H
  17. #define _BITMAP_H
  18. #define _MENU_H
  19. #define _EDIT_H
  20. #define _LSTBOX_H
  21. #define _COMBOBOX_H
  22. #define _POINTR_H
  23. #define _CURSOR_H
  24. #define _GLOBDEFS_H
  25. #define _OUTDEV_H
  26. #define _VIRDEV_H
  27. #define _IMPPRN_H
  28. #define _TIMER_H
  29. #define _CTRL_H
  30. #define _SCRBAR_H
  31. #define _BUTTON_H
  32. #define _SYMBTN_H
  33. #define _SYSDLG_H
  34. #define _FILDLG_H
  35. #define _PRNDLG_H
  36. #define _COLDLG_H
  37. #define _FONTDLG_H
  38. #ifndef _TOOLS_HXX
  39. #include <tools.hxx>
  40. #endif
  41. class ImpOutputDevice { char dummy[ 90 ]; };
  42. class ImpVirtDevice { char dummy[ 8 ]; };
  43. class ImpPrinter { char dummy[ 15 ]; };
  44. class ImpWindow { char dummy[ 62 ]; };
  45. class ImpSysWin { char dummy[ 4 ]; };
  46. class ImpWorkWin { char dummy[ 14 ]; };
  47. class ImpMDIWin { char dummy[ 12 ]; };
  48. class ImpFloatWin { char dummy[ 44 ]; };
  49. class ImpMessBox { char dummy[ 12 ]; };
  50. struct IMPRCTYPE { char dummy[ 3 ]; };
  51. class ImpDlg { char dummy[ 14 ]; };
  52. class ImpModalDlg { char dummy[ 6 ]; };
  53. class ImpSysDlg { char dummy[ 8 ]; };
  54. class ImpFileDlg { char dummy[ 24 ]; };
  55. class ImpPrnSetupDlg { char dummy[ 2 ]; };
  56. class ImpPrintDlg { char dummy[ 2 ]; };
  57. class ImpColorDlg { char dummy[ 2 ]; };
  58. class ImpFontDlg { char dummy[ 2 ]; };
  59. class ImpControl { char dummy[ 10 ]; };
  60. class ImpLstBox { char dummy[ 14 ]; };
  61. class ImpComboBox { char dummy[ 10 ]; };
  62. class ImpScrBar { char dummy[ 22 ]; };
  63. class ImpEdit { char dummy[ 4 ]; };
  64. class ImpTriBox { char dummy[ 2 ]; };
  65. class ImpSymBtn { char dummy[ 26 ]; };
  66. class ImpBmpBtn { char dummy[ 2 ]; };
  67. class ImpSplitter { char dummy[ 2 ]; };
  68. class ImpMenu { char dummy[ 132 ]; };
  69. class ImpCursor { char dummy[ 1 ]; };
  70. class ImpTimer { char dummy[ 1 ]; };
  71.  
  72. #ifndef _SV_H
  73. #define _SV_H
  74.  
  75. #ifndef _SOLAR_H
  76. #endif
  77.  
  78. #ifndef _TOOLS_HXX
  79. #endif
  80.  
  81. #if defined( __SC__ ) || defined( _MSC_VER ) || (defined( ALPHA ) && defined( WNT ))
  82. #define protected public
  83.  
  84. #ifndef ALL_WARNINGS
  85. #pragma warning(disable: 4355)
  86. #endif
  87. #endif
  88.  
  89. #define SystemWindow                SysWin
  90. #define PatternFormatter            PatFmt
  91. #define NumericFormatter            NumFmt
  92. #define MetricFormatter             MetFmt
  93. #define CurrencyFormatter           CurrFmt
  94. #define DateFormatter               DateFmt
  95. #define TimeFormatter               TimeFmt
  96. #define AcceleratorManager          AMGR
  97.  
  98. #define GDIPixelAction              GDIPixAct
  99. #define GDIPointAction              GDIPtAct
  100. #define GDILineAction               GDILineAct
  101. #define GDIRectAction               GDIRectAct
  102. #define GDIEllipseAction            GDIElipAct
  103. #define GDIArcAction                GDIArcAct
  104. #define GDIPieAction                GDIPieAct
  105. #define GDIInvertRectAction         GDIInAct
  106. #define GDIHighlightRectAction      GDIHighAct
  107. #define GDIPolyLineAction           GDIPolLinAct
  108. #define GDIPolygonAction            GDIPolygonAct
  109. #define GDIPolyPolygonAction        GDIPolyPolyAct
  110. #define GDITextAction               GDITextAct
  111. #define GDIKernTextAction           GDIKernTextAct
  112. #define GDIStretchTextAction        GDIStrechAct
  113. #define GDIIconAction               GDIIconAct
  114. #define GDIBitmapAction             GDIBmpAct
  115. #define GDIBitmapScaleAction        GDIBmpScalAct
  116. #define GDIPenAction                GDIPenAct
  117. #define GDIFontAction               GDIFontAct
  118. #define GDIBackBrushAction          GDIBkBrushAct
  119. #define GDIFillBrushAction          GDIFillBrushAct
  120. #define GDIClipRegionAction         GDIClipAct
  121. #define GDIMoveClipRegionAction     GDIMoveClipAct
  122. #define GDIIsectClipRegionAction    GDIInClipAct
  123. #define GDIMapModeAction            GDIMapAct
  124. #define GDIRasterOpAction           GDIRasterAct
  125. #define GDIPushAction               GDIPushAct
  126. #define GDIPopAction                GDIPopAct
  127.  
  128. #endif 
  129.  
  130. #ifndef _WINBIT_HXX
  131. #define _WINBIT_HXX
  132.  
  133. #ifndef _SV_H
  134. #endif
  135.  
  136. typedef USHORT WinBits;
  137.  
  138. #define WB_BORDER               ((WinBits)0x0001)
  139. #define WB_CLIPCHILDREN         ((WinBits)0x0002)
  140.  
  141. #define WB_SVLOOK               ((WinBits)0x0004)
  142.  
  143. #define WB_AUTOSIZE             ((WinBits)0x0008)
  144.  
  145. #define WB_SIZEABLE             ((WinBits)0x0010)
  146. #define WB_MOVEABLE             ((WinBits)0x0020)
  147. #define WB_MINABLE              ((WinBits)0x0040)
  148. #define WB_MAXABLE              ((WinBits)0x0080)
  149. #define WB_CLOSEABLE            ((WinBits)0x0100)
  150. #define WB_TABCONTROL           ((WinBits)0x0200)
  151.  
  152. #define WB_APP                  ((WinBits)0x0400)
  153.  
  154. #define WB_SIZEMOVE             (WB_SIZEABLE | WB_MOVEABLE)
  155. #define WB_MINMAX               (WB_MINABLE | WB_MAXABLE)
  156. #define WB_STDWORK              (WB_MINMAX | WB_SIZEMOVE | WB_CLOSEABLE)
  157. #define WB_STDMDI               WB_CLOSEABLE
  158.  
  159. #define WB_HIDEWHENDEACTIVATE   ((WinBits)0x0040)
  160. #define WB_ZOOMABLE             ((WinBits)0x0080)
  161. #define WB_STDFLOATWIN          WB_CLOSEABLE
  162.  
  163. #define WB_TABSTOP              ((WinBits)0x0010)
  164. #define WB_GROUP                ((WinBits)0x0020)
  165.  
  166. #define WB_SYSMODAL             ((WinBits)0x4000)
  167. #define WB_PININ                ((WinBits)0x2000)
  168.  
  169. #define WB_STDMODELESS          (WB_MOVEABLE | WB_CLOSEABLE)
  170. #define WB_STDMODAL             (WB_MOVEABLE)
  171.  
  172. #define WB_DEFBUTTON            ((WinBits)0x0100)
  173. #define WB_REPEAT               ((WinBits)0x4000)
  174.  
  175. #define WB_LEFT                 ((WinBits)0x0100)
  176. #define WB_CENTER               ((WinBits)0x0200)
  177. #define WB_RIGHT                ((WinBits)0x0400)
  178.  
  179. #define WB_PASSWORD             ((WinBits)0x0040)
  180.  
  181. #define WB_NOWORDBREAK          ((WinBits)0x0040)
  182.  
  183. #define WB_SPIN                 ((WinBits)0x0800)
  184.  
  185. #define WB_HSCROLL              ((WinBits)0x1000)
  186. #define WB_VSCROLL              ((WinBits)0x2000)
  187.  
  188. #define WB_READONLY             ((WinBits)0x0080)
  189.  
  190. #define WB_DRAG                 ((WinBits)0x4000)
  191.  
  192. #define WB_SORT                 ((WinBits)0x0100)
  193. #define WB_SIMPLEMODE           ((WinBits)0x0200)
  194. #define WB_DDEXTRAWIDTH         ((WinBits)0x0400)
  195. #define WB_DROPDOWN             ((WinBits)0x0800)
  196. #define WB_AUTOHSCROLL          ((WinBits)0x4000)
  197.  
  198. #define WB_SCROLL               ((WinBits)0x1000)
  199.  
  200. #define WB_OK                   ((WinBits)0x0010)
  201. #define WB_OK_CANCEL            ((WinBits)0x0020)
  202. #define WB_YES_NO               ((WinBits)0x0040)
  203. #define WB_YES_NO_CANCEL        ((WinBits)0x0080)
  204. #define WB_RETRY_CANCEL         ((WinBits)0x0100)
  205.  
  206. #define WB_DEF_OK               ((WinBits)0x0200)
  207. #define WB_DEF_CANCEL           ((WinBits)0x0400)
  208. #define WB_DEF_RETRY            ((WinBits)0x0800)
  209. #define WB_DEF_YES              ((WinBits)0x1000)
  210. #define WB_DEF_NO               ((WinBits)0x2000)
  211.  
  212. #define WB_OPEN                 ((WinBits)0x1000)
  213. #define WB_SAVEAS               ((WinBits)0x2000)
  214.  
  215. #define WB_HIDE                 ((WinBits)0x8000)
  216.  
  217. typedef USHORT MenuItemBits;
  218.  
  219. #define MIB_CHECKABLE       ((MenuItemBits)0x0001)
  220. #define MIB_ABOUT           ((MenuItemBits)0x0002)
  221. #define MIB_HELP            ((MenuItemBits)0x0004)
  222.  
  223. enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW };
  224.  
  225. enum SymbolType { ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT };
  226.  
  227. enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
  228.                  FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
  229.                  FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM };
  230.  
  231. enum TimeFieldFormat { TIMEF_NONE, TIMEF_SEC, TIMEF_100TH_SEC };
  232.  
  233. enum ButtonType { BUTTON_SYMBOL, BUTTON_TEXT, BUTTON_SYMBOLTEXT };
  234. enum ToolBoxItemType { TOOLBOXITEM_DONTKNOW, TOOLBOXITEM_BUTTON,
  235.                        TOOLBOXITEM_SPACE, TOOLBOXITEM_SEPARATOR,
  236.                        TOOLBOXITEM_BREAK };
  237. enum ToolBoxAlign { BOXALIGN_LEFT, BOXALIGN_TOP, BOXALIGN_RIGHT,
  238.                     BOXALIGN_BOTTOM };
  239.  
  240. enum StatusBarAlign { STATUSBAR_ALIGN_LEFT, STATUSBAR_ALIGN_RIGHT };
  241.  
  242. enum ScrollType { SCROLL_DONTKNOW, SCROLL_LINEUP, SCROLL_LINEDOWN,
  243.                   SCROLL_PAGEUP, SCROLL_PAGEDOWN, SCROLL_DRAG };
  244.  
  245. #endif 
  246.  
  247. #ifndef _RESID_HXX
  248. #define _RESID_HXX
  249.  
  250. #ifndef _SV_H
  251. #endif
  252. #ifndef _WINBIT_HXX
  253. #endif
  254.  
  255. struct RSHEADER_TYPE;
  256.  
  257. typedef short RESOURCE_TYPE;
  258. #define RSC_NOTYPE              0x100
  259.  
  260. class ResId
  261. {
  262.     RSHEADER_TYPE*  pResource;     
  263.  
  264.     USHORT          nResId;        
  265.     RESOURCE_TYPE   nRT;           
  266.     char*           pStr;          
  267.  
  268. public:
  269.     WinBits         aWinBits;      
  270.  
  271.                     ResId( RSHEADER_TYPE * pRc )
  272.                     {
  273.                         pResource = pRc;
  274.                         nRT = RSC_NOTYPE;
  275.                     }
  276.                     ResId( USHORT nId )
  277.                     {
  278.                         nResId = nId;
  279.                         pResource = NULL;
  280.                         nRT = RSC_NOTYPE;
  281.                     }
  282.  
  283.     RESOURCE_TYPE   GetRT() const { return( nRT ); }    
  284.     const ResId&    SetRT( RESOURCE_TYPE nTyp ) const
  285.                     {  
  286.                         if( RSC_NOTYPE == nRT )
  287.                             ((ResId *)this)->nRT = nTyp;
  288.                         return( *this );
  289.                     }
  290.  
  291.     USHORT         GetId()          const { return( nResId ); }
  292.     RSHEADER_TYPE* GetpResource()   const { return( pResource ); }
  293. };
  294.  
  295. #endif 
  296.  
  297. #ifndef _RC_H
  298. #define _RC_H
  299.  
  300. #ifndef _SV_H
  301. #endif
  302. #ifndef _RESID_HXX
  303. #endif
  304.  
  305. #define RSCVERSION_ID  131
  306.  
  307. #define RC_NO_ID    (USHORT)0xFFFF
  308.  
  309. #define RSC_BYNAME              (RSC_NOTYPE + 0x01)
  310. #define RSC_VERSIONCONTROL      (RSC_NOTYPE + 0x02) 
  311. #define RSC_APPLICATION         (RSC_NOTYPE + 0x03) 
  312.  
  313. #define RSC_RESOURCE            (RSC_NOTYPE + 0x10)
  314. #define RSC_STRING              (RSC_NOTYPE + 0x11)
  315. #define RSC_ICON                (RSC_NOTYPE + 0x12)
  316. #define RSC_BITMAP              (RSC_NOTYPE + 0x13)
  317. #define RSC_POINTER             (RSC_NOTYPE + 0x14)
  318. #define RSC_BRUSH               (RSC_NOTYPE + 0x15)
  319. #define RSC_COLOR               (RSC_NOTYPE + 0x16)
  320. #define RSC_FONT                (RSC_NOTYPE + 0x17)
  321. #define RSC_PEN                 (RSC_NOTYPE + 0x18)
  322. #define RSC_MAPMODE             (RSC_NOTYPE + 0x19)
  323. #define RSC_ACCEL               (RSC_NOTYPE + 0x1a)
  324. #define RSC_ACCELITEM           (RSC_NOTYPE + 0x1b)
  325. #define RSC_MENU                (RSC_NOTYPE + 0x1c)
  326. #define RSC_MENUITEM            (RSC_NOTYPE + 0x1d)
  327. #define RSC_OUTPUTDEVICE        (RSC_NOTYPE + 0x1e)
  328. #define RSC_KEYCODE             (RSC_NOTYPE + 0x1f)
  329. #define RSC_TIME                (RSC_NOTYPE + 0x20)
  330. #define RSC_DATE                (RSC_NOTYPE + 0x21)
  331. #define RSC_INTERNATIONAL       (RSC_NOTYPE + 0x22)
  332.  
  333. #define RSC_MESSBOX             (RSC_NOTYPE + 0x30)
  334. #define RSC_INFOBOX             (RSC_NOTYPE + 0x31)
  335. #define RSC_WARNINGBOX          (RSC_NOTYPE + 0x32)
  336. #define RSC_ERRORBOX            (RSC_NOTYPE + 0x33)
  337. #define RSC_QUERYBOX            (RSC_NOTYPE + 0x34)
  338. #define RSC_WINDOW              (RSC_NOTYPE + 0x35)
  339. #define RSC_SYSWINDOW           (RSC_NOTYPE + 0x36)
  340. #define RSC_WORKWIN             (RSC_NOTYPE + 0x37)
  341. #define RSC_MDIWINDOW           (RSC_NOTYPE + 0x38)
  342. #define RSC_DIALOG              (RSC_NOTYPE + 0x39)
  343. #define RSC_MODELESSDIALOG      (RSC_NOTYPE + 0x3a)
  344. #define RSC_MODALDIALOG         (RSC_NOTYPE + 0x3b)
  345. #define RSC_SYSTEMDIALOG        (RSC_NOTYPE + 0x3c)
  346. #define RSC_FILEDIALOG          (RSC_NOTYPE + 0x3d)
  347. #define RSC_PRINTERSETUPDIALOG  (RSC_NOTYPE + 0x3e)
  348. #define RSC_PRINTDIALOG         (RSC_NOTYPE + 0x3f)
  349. #define RSC_COLORDIALOG         (RSC_NOTYPE + 0x40)
  350. #define RSC_FONTDIALOG          (RSC_NOTYPE + 0x41)
  351. #define RSC_CONTROL             (RSC_NOTYPE + 0x42)
  352. #define RSC_BUTTON              (RSC_NOTYPE + 0x43)
  353. #define RSC_PUSHBUTTON          (RSC_NOTYPE + 0x44)
  354. #define RSC_OKBUTTON            (RSC_NOTYPE + 0x45)
  355. #define RSC_CANCELBUTTON        (RSC_NOTYPE + 0x46)
  356. #define RSC_HELPBUTTON          (RSC_NOTYPE + 0x47)
  357. #define RSC_MENUBUTTON          (RSC_NOTYPE + 0x48)
  358. #define RSC_MOREBUTTON          (RSC_NOTYPE + 0x49)
  359. #define RSC_SYMBOLBUTTON        (RSC_NOTYPE + 0x4a)
  360. #define RSC_BITMAPBUTTON        (RSC_NOTYPE + 0x4b)
  361. #define RSC_SPINBUTTON          (RSC_NOTYPE + 0x4c)
  362. #define RSC_RADIOBUTTON         (RSC_NOTYPE + 0x4d)
  363. #define RSC_CHECKBOX            (RSC_NOTYPE + 0x4e)
  364. #define RSC_TRISTATEBOX         (RSC_NOTYPE + 0x4f)
  365. #define RSC_EDIT                (RSC_NOTYPE + 0x50)
  366. #define RSC_MULTILINEEDIT       (RSC_NOTYPE + 0x51)
  367. #define RSC_COMBOBOX            (RSC_NOTYPE + 0x52)
  368. #define RSC_LISTBOX             (RSC_NOTYPE + 0x53)
  369. #define RSC_MULTILISTBOX        (RSC_NOTYPE + 0x54)
  370. #define RSC_TEXT                (RSC_NOTYPE + 0x55)
  371. #define RSC_FIXEDBITMAP         (RSC_NOTYPE + 0x56)
  372. #define RSC_FIXEDICON           (RSC_NOTYPE + 0x57)
  373. #define RSC_GROUPBOX            (RSC_NOTYPE + 0x58)
  374. #define RSC_SCROLLBAR           (RSC_NOTYPE + 0x59)
  375. #define RSC_SPLITTER            (RSC_NOTYPE + 0x5a)
  376. #define RSC_SPLITBAR            (RSC_NOTYPE + 0x5b)
  377. #define RSC_SPINFIELD           (RSC_NOTYPE + 0x5c)
  378. #define RSC_PATTERNFIELD        (RSC_NOTYPE + 0x5d)
  379. #define RSC_NUMERICFIELD        (RSC_NOTYPE + 0x5e)
  380. #define RSC_METRICFIELD         (RSC_NOTYPE + 0x5f)
  381. #define RSC_CURRENCYFIELD       (RSC_NOTYPE + 0x60)
  382. #define RSC_DATEFIELD           (RSC_NOTYPE + 0x61)
  383. #define RSC_TIMEFIELD           (RSC_NOTYPE + 0x62)
  384. #define RSC_PATTERNBOX          (RSC_NOTYPE + 0x63)
  385. #define RSC_NUMERICBOX          (RSC_NOTYPE + 0x64)
  386. #define RSC_METRICBOX           (RSC_NOTYPE + 0x65)
  387. #define RSC_CURRENCYBOX         (RSC_NOTYPE + 0x66)
  388. #define RSC_DATEBOX             (RSC_NOTYPE + 0x67)
  389. #define RSC_TIMEBOX             (RSC_NOTYPE + 0x68)
  390. #define RSC_TOOLBOXITEM         (RSC_NOTYPE + 0x69)
  391. #define RSC_TOOLBOX             (RSC_NOTYPE + 0x6a)
  392. #define RSC_STATUSBAR           (RSC_NOTYPE + 0x6b)
  393. #define RSC_FLOATINGWINDOW      (RSC_NOTYPE + 0x6c)
  394.  
  395. #define RSC_ABBREVBUTTON        (RSC_NOTYPE + 0x80)
  396. #define RSC_HELPWINDOW          (RSC_NOTYPE + 0x81)
  397. #define RSC_MAGNIFIER           (RSC_NOTYPE + 0x82)
  398.  
  399. #define RT_SYS_POINTER          (RSC_NOTYPE + 0xf0)
  400. #define RT_SYS_ICON             (RSC_NOTYPE + 0xf1)
  401. #define RT_SYS_BITMAP           (RSC_NOTYPE + 0xf2)
  402. #define RT_SYS_STRING           (RSC_NOTYPE + 0xf3)
  403. #define RT_SYS_FILE             (RSC_NOTYPE + 0xf4)
  404.  
  405. #define RSC_ARROW               (RSC_NOTYPE + 0xf5)
  406.  
  407. #define OUTDEV_PEN      0x01
  408. #define OUTDEV_BGBRUSH  0x02
  409. #define OUTDEV_FIBRUSH  0x04
  410. #define OUTDEV_FONT     0x08
  411. #define OUTDEV_MAPMODE  0x10
  412. struct RSOUTPUTDEVICE_TYPE {
  413.     short nObjFollows;  
  414.  
  415. };
  416.  
  417. #define RSC_EXTRAMAPUNIT    0xFFFF 
  418.  
  419. typedef short RSWND_STYLE;
  420. #define RSWND_DISABLED      0x01
  421. #define RSWND_CLIENTSIZE    0x02
  422.  
  423. #define WINDOW_XYMAPMODE    0x0001
  424. #define WINDOW_X            0x0002
  425. #define WINDOW_Y            0x0004
  426. #define WINDOW_WHMAPMODE    0x0008
  427. #define WINDOW_WIDTH        0x0010
  428. #define WINDOW_HEIGHT       0x0020
  429. #define WINDOW_CHILDS       0x0040
  430. #define WINDOW_TEXT         0x0080
  431. #define WINDOW_HELPTEXT     0x0100
  432. #define WINDOW_POINTER      0x0200
  433. struct RSWINDOW_TYPE {
  434.     USHORT          nObjMask;       
  435.     RSWND_STYLE     nRSStyle;       
  436.     short           nStyle;         
  437.     USHORT          nHiHelpId;      
  438.     USHORT          nLoHelpId;     
  439.  
  440. };
  441.  
  442. #define WORKWIN_SHOWNORMAL    0
  443. #define WORKWIN_SHOWMINIMIZED 1
  444. #define WORKWIN_SHOWMAXIMIZED 2
  445. #define WORKWIN_ICON          0x01
  446. struct RSWORKWIN_TYPE {
  447.     short   nObjMask;       
  448.     short   nShowStyle;     
  449.  
  450. };
  451.  
  452. struct RSLISTBOX_TYPE {
  453.     short   nSelPos;    
  454.     short   nNumber;    
  455.  
  456. };
  457.  
  458. struct RSCOMBOBOX_TYPE {
  459.     short   nNumber;    
  460.  
  461. };
  462.  
  463. struct RSRADIOBUTTON_TYPE {
  464.     short   nChecked;   
  465. };
  466.  
  467. struct RSCHECKBOX_TYPE {
  468.     short   nChecked;   
  469. };
  470.  
  471. struct RSTRISTATEBOX_TYPE {
  472.     short   nTriState;          
  473.     short   bDisableTriState;   
  474. };
  475.  
  476. #define RSCMENUBUTTON_MENU          0x01
  477. struct RSMENUBUTTON_TYPE {
  478.     short   nObjMask;       
  479.  
  480. };
  481.  
  482. struct RSSYMBOLBUTTON_TYPE {
  483.     USHORT   nSymbol;       
  484. };
  485.  
  486. #define RSCBITMAPBUTTON_BITMAP          0x01
  487. struct RSBITMAPBUTTON_TYPE
  488. {
  489.     short   nObjMask;       
  490.  
  491. };
  492.  
  493. struct RSEDIT_TYPE {
  494.     USHORT   nTextLength;    
  495. };
  496.  
  497. struct RSSCROLL_TYPE {
  498.     short   nMin;
  499.     short   nMax;
  500.     short   nThumbPos;
  501.     short   nPage;
  502.     short   nStep;
  503.     short   nVisibleSize;
  504. };
  505.  
  506. struct RSKEYCODE_TYPE {
  507.     USHORT          nKeyCode;       
  508.     USHORT          nModifier;      
  509.     USHORT          nKeyFunc;       
  510. };
  511.  
  512. struct RSMENU_TYPE {
  513.     short   nObjFollows;
  514.  
  515. };
  516.  
  517. #define RSC_MENUITEM_DISABLE    0x01
  518. #define RSC_MENUITEM_CHECKED    0x02
  519. #define RSC_MENUITEM_SEPARATOR  0x04
  520. #define RSC_MENUITEM_CHECKABLE  0x08
  521. #define RSC_MENUITEM_ABOUT      0x10
  522. #define RSC_MENUITEM_HELP       0x20
  523.  
  524. #define RSC_MENUITEM_BITMAP     0x01
  525. #define RSC_MENUITEM_KEYCODE    0x02
  526. #define RSC_MENUITEM_MENU       0x04
  527.  
  528. struct RSMENUITEM_TYPE {
  529.     USHORT      nObjMask;       
  530.     USHORT      nMenuItemId;    
  531.     USHORT      nStatus;        
  532.     USHORT      nHiHelpId;      
  533.     USHORT      nLoHelpId;     
  534.  
  535. };
  536.  
  537. struct RSACCEL_TYPE {
  538.  
  539.     short nObjFollows;  
  540.  
  541. };
  542.  
  543. #define ACCELITEM_ACCEL       0x01
  544. #define ACCELITEM_KEY       0x02
  545.  
  546. struct RSACCELITEM_TYPE {
  547.     USHORT          nObjMask;       
  548.     USHORT          nAccelKeyId;    
  549.     USHORT          bDisable;       
  550.  
  551. };
  552.  
  553. struct RSCOLOR_TYPE {
  554.     USHORT nRed;
  555.     USHORT nGreen;
  556.     USHORT nBlue;
  557.     USHORT nSystemColor;
  558. };
  559.  
  560. struct RSMAPMODE_TYPE {
  561.     short nMapUnit;
  562.     short nXOrigin;
  563.     short nYOrigin;
  564.     short nXNumerator;
  565.     short nXDeNominator;
  566.     short nYNumerator;
  567.     short nYDeNominator;
  568. };
  569.  
  570. #define PEN_COLOR           0x01
  571. struct RSPEN_TYPE {
  572.     short           nObjFollows;
  573.     USHORT          nPenWidth;
  574.     USHORT          nPenStyle;
  575.  
  576. };
  577.  
  578. #define BRUSH_BRUSHCOLOR    0x01
  579. #define BRUSH_FILLCOLOR     0x02
  580. #define BRUSH_BRUSHBITMAP   0x04
  581. struct RSBRUSH_TYPE {
  582.     short               nObjMask;
  583.     USHORT              nBrushStyle;
  584.     short               bTransparent;
  585.  
  586. };
  587.  
  588. #define FONT_ITALIC         0x01
  589. #define FONT_TRANSPARENT    0x02
  590. #define FONT_SHADOW         0x04
  591. #define FONT_OUTLINE        0x08
  592.  
  593. #define FONT_FONTCOLOR      0x01
  594. #define FONT_FILLCOLOR      0x02
  595. struct RSFONT_TYPE {
  596.     short           nObjMask;
  597.     short           nFontFamily;
  598.     short           nFontWeight;
  599.     short           nFontCharSet;
  600.     short           nFontPitch;
  601.     short           nFontAlign;
  602.     short           nFontUnderline;
  603.     short           nFontStrikeout;
  604.     USHORT          nHeight;
  605.     USHORT          nWidth;
  606.     short           nCharOrientation;
  607.     short           nLineOrientation;
  608.     short           nAttributes;
  609.  
  610. };
  611.  
  612. #define RSC_BITMAP_SYSTEM   0
  613. #define RSC_BITMAP_DIB      1
  614. #define RSC_BITMAP_PIC      2
  615. struct RSBITMAP_TYPE {
  616.     USHORT  nBitmapTyp; 
  617.     USHORT  nBitmapId;  
  618.  
  619. };
  620.  
  621. #define ICON_ICON   0
  622. #define ICON_CICN   1
  623. #define ICON_DIB    2
  624. struct RSICON_TYPE {
  625.     USHORT  nSystemIcon;    
  626.     USHORT  nIconTyp;       
  627.     USHORT  nIconId;        
  628.  
  629. };
  630.  
  631. struct RSPOINTER_TYPE {
  632.     USHORT  nSystemPointer; 
  633.     USHORT  nPointerTyp;    
  634.     USHORT  nPointerId;     
  635.  
  636. };
  637.  
  638. struct RSMESSAGEBOX_TYPE {
  639.     USHORT      nButtons;   
  640.     USHORT      nDefButton; 
  641.     USHORT      nHiHelpId;  
  642.     USHORT      nLoHelpId;  
  643.     USHORT      bSysModal;  
  644.  
  645. };
  646.  
  647. #define SPLITBAR_WIDTH          0x01
  648. #define SPLITBAR_SCROLLBAR1     0x02
  649. #define SPLITBAR_SCROLLBAR2     0x04
  650. struct RSSPLITBAR_TYPE {
  651.     short   nObjMask;       
  652.  
  653. };
  654.  
  655. #define FILEDIALOG_DEFAULTEXT       0x01
  656. #define FILEDIALOG_FILTERLIST       0x02
  657. #define FILEDIALOG_CURFILTER        0x04
  658. struct RSFILEDIALOG_TYPE {
  659.     short   nObjMask;       
  660.  
  661. };
  662.  
  663. #define RSC_PRINTDIALOG_DISABLEPAGEVIEW     0x01
  664. #define RSC_PRINTDIALOG_DISABLESELECTION    0x02
  665. #define RSC_PRINTDIALOG_CHECKSELECTION      0x04
  666. #define RSC_PRINTDIALOG_DISABLECOLLATE      0x08
  667. #define RSC_PRINTDIALOG_CHECKCOLLATE        0x10
  668.  
  669. struct RSPRINTDIALOG_TYPE {
  670.     short   nObjMask;       
  671.  
  672. };
  673.  
  674. #define TIME_HOUR       0x01
  675. #define TIME_MINUTE     0x02
  676. #define TIME_SECOND     0x04
  677. #define TIME_SEC100     0x08
  678. struct RSTIME_TYPE {
  679.     short   nObjMask;       
  680.  
  681. };
  682.  
  683. #define DATE_YEAR       0x01
  684. #define DATE_MONTH      0x02
  685. #define DATE_DAY        0x04
  686. struct RSDATE_TYPE {
  687.     short   nObjMask;       
  688.  
  689. };
  690.  
  691. #define INT1_LANGUAGE                   0x0001
  692. #define INT1_COUNTRY                    0x0002
  693. #define INT1_DATEFORMAT                 0x0004
  694. #define INT1_DATEDAYLEADINDZERO         0x0008
  695. #define INT1_DATEMONTHLEADINDZERO       0x0010
  696. #define INT1_DATECENTURY                0x0020
  697. #define INT1_LONGDATEFORMAT             0x0040
  698. #define INT1_LONGDATEDAYOFWEEKFORMAT    0x0080
  699. #define INT1_LONGDATEDAYOFWEEKSEP       0x0100
  700. #define INT1_LONGDATEDAYLEADINGZERO     0x0200
  701. #define INT1_LONGDATEDAYSEP             0x0400
  702. #define INT1_LONGDATEMONTHFORMAT        0x0800
  703. #define INT1_LONGDATEMONTHSEP           0x1000
  704. #define INT1_LONGDATECENTURY            0x2000
  705. #define INT1_LONGDATEYEARSEP            0x4000
  706. #define INT1_TIMEFORMAT                 0x8000
  707. struct RSINT1_TYPE {
  708.     short   nObjMask;       
  709.  
  710. };
  711.  
  712. #define INT2_TIMELEADINGZERO        0x0001
  713. #define INT2_TIMEAM                 0x0002
  714. #define INT2_TIMEPM                 0x0004
  715. #define INT2_NUMLEADINGZERO         0x0008
  716. #define INT2_NUMDIGITS              0x0010
  717. #define INT2_CURRPOSITIVEFORMAT     0x0020
  718. #define INT2_CURRNEGATIVEFORMAT     0x0040
  719. #define INT2_CURRDIGITS             0x0080
  720. #define INT2_NUMTRAILINGZEROS       0x0100
  721. struct RSINT2_TYPE {
  722.     short   nObjMask;       
  723.  
  724. };
  725.  
  726. #define APPLICATION_ICON          0x01
  727. #define APPLICATION_FONT          0x02
  728. #define APPLICATION_MENUBAR       0x04
  729. #define APPLICATION_ACCELERATOR   0x08
  730. #define APPLICATION_I12           0x10
  731. #define APPLICATION_SVLOOK        0x20
  732. struct RSAPPLICATION_TYPE {
  733.     short   nObjMask;       
  734.  
  735. };
  736.  
  737. #define PATTERNFORMATTER_STRICTFORMAT       0x01
  738. #define PATTERNFORMATTER_EDITMASK           0x02
  739. #define PATTERNFORMATTER_LITTERALMASK       0x04
  740. struct RSPATTERNFORMATTER_TYPE {
  741.     short   nObjMask;       
  742.  
  743. };
  744.  
  745. #define NUMERICFORMATTER_MIN                0x01
  746. #define NUMERICFORMATTER_MAX                0x02
  747. #define NUMERICFORMATTER_STRICTFORMAT       0x04
  748. #define NUMERICFORMATTER_I12                0x08
  749. #define NUMERICFORMATTER_DECIMALDIGITS      0x10
  750. #define NUMERICFORMATTER_VALUE              0x20
  751. struct RSNUMERICFORMATTER_TYPE {
  752.     short   nObjMask;       
  753.  
  754. };
  755.  
  756. #define METRICFORMATTER_UNIT                0x01
  757. #define METRICFORMATTER_CUSTOMUNITTEXT      0x02
  758. struct RSMETRICFORMATTER_TYPE {
  759.     short   nObjMask;       
  760.  
  761. };
  762.  
  763. #define DATEFORMATTER_MIN               0x01
  764. #define DATEFORMATTER_MAX               0x02
  765. #define DATEFORMATTER_LONGFORMAT        0x04
  766. #define DATEFORMATTER_STRICTFORMAT      0x08
  767. #define DATEFORMATTER_I12               0x10
  768. #define DATEFORMATTER_VALUE             0x20
  769. struct RSDATEFORMATTER_TYPE {
  770.     short   nObjMask;       
  771.  
  772. };
  773.  
  774. #define TIMEFORMATTER_MIN               0x01
  775. #define TIMEFORMATTER_MAX               0x02
  776. #define TIMEFORMATTER_TIMEFIELDFORMAT   0x04
  777. #define TIMEFORMATTER_DURATION          0x08
  778. #define TIMEFORMATTER_STRICTFORMAT      0x10
  779. #define TIMEFORMATTER_I12               0x20
  780. #define TIMEFORMATTER_VALUE             0x40
  781. struct RSTIMEFORMATTER_TYPE {
  782.     short   nObjMask;       
  783.  
  784. };
  785.  
  786. #define NUMERICFIELD_FIRST      0x01
  787. #define NUMERICFIELD_LAST       0x02
  788. #define NUMERICFIELD_SPINSIZE   0x04
  789. struct RSNUMERICFIELD_TYPE {
  790.     short   nObjMask;       
  791.  
  792. };
  793.  
  794. #define METRICFIELD_FIRST       0x01
  795. #define METRICFIELD_LAST        0x02
  796. #define METRICFIELD_SPINSIZE    0x04
  797. struct RSMETRICFIELD_TYPE {
  798.     short   nObjMask;       
  799.  
  800. };
  801.  
  802. #define CURRENCYFIELD_FIRST     0x01
  803. #define CURRENCYFIELD_LAST      0x02
  804. #define CURRENCYFIELD_SPINSIZE  0x04
  805. struct RSCURRENCYFIELD_TYPE {
  806.     short   nObjMask;       
  807.  
  808. };
  809.  
  810. #define DATEFIELD_FIRST     0x01
  811. #define DATEFIELD_LAST      0x02
  812. struct RSDATEFIELD_TYPE {
  813.     short   nObjMask;       
  814.  
  815. };
  816. #define TIMEFIELD_FIRST     0x01
  817. #define TIMEFIELD_LAST      0x02
  818. struct RSTIMEFIELD_TYPE {
  819.     short   nObjMask;       
  820.  
  821. };
  822.  
  823. #define RSC_TOOLBOXITEM_ID          0x0001
  824. #define RSC_TOOLBOXITEM_TYPE        0x0002
  825. #define RSC_TOOLBOXITEM_HELPID      0x0004
  826. #define RSC_TOOLBOXITEM_TEXT        0x0008
  827. #define RSC_TOOLBOXITEM_HELPTEXT    0x0010
  828. #define RSC_TOOLBOXITEM_BITMAP      0x0020
  829. #define RSC_TOOLBOXITEM_DISBITMAP   0x0040
  830. #define RSC_TOOLBOXITEM_CHECK       0x0080
  831. #define RSC_TOOLBOXITEM_DISABLE     0x0100
  832.  
  833. struct RSTOOLBOXITEM_TYPE
  834. {
  835.     USHORT      nObjMask;           
  836.  
  837. };
  838.  
  839. #define RSC_TOOLBOX_BUTTONTYPE          0x01
  840. #define RSC_TOOLBOX_ALIGN               0x02
  841. #define RSC_TOOLBOX_LINECOUNT           0x04
  842. #define RSC_TOOLBOX_ITEMLIST            0x08
  843.  
  844. struct RSTOOLBOX_TYPE
  845. {
  846.     USHORT      nObjMask;       
  847.  
  848. };
  849.  
  850. #define RSC_STATUSBAR_ALIGN         0x01
  851. struct RSSTATUSBAR_TYPE
  852. {
  853.     USHORT      nObjMask;   
  854.  
  855. };
  856.  
  857. #define RSC_MOREBUTTON_STATE            0x01
  858. #define RSC_MOREBUTTON_MAPUNIT          0x02
  859. #define RSC_MOREBUTTON_DELTA            0x04
  860. struct RSMOREBUTTON_TYPE
  861. {
  862.     USHORT      nObjMask;   
  863.  
  864. };
  865.  
  866. #define RSC_FLOATINGWINDOW_WHMAPMODE        0x01
  867. #define RSC_FLOATINGWINDOW_WIDTH            0x02
  868. #define RSC_FLOATINGWINDOW_HEIGHT           0x04
  869. #define RSC_FLOATINGWINDOW_ZOOMIN           0x08
  870. struct RSFLOATINGWINDOW_TYPE
  871. {
  872.     USHORT      nObjMask;   
  873.  
  874. };
  875.  
  876. #endif 
  877.  
  878. #ifndef _RC_HXX
  879. #define _RC_HXX
  880.  
  881. #ifndef _SV_H
  882. #endif
  883. #ifndef _RESID_HXX
  884. #endif
  885. #ifndef _IMPRC_H
  886. #endif
  887.  
  888. class Resource;
  889.  
  890. struct RSHEADER_TYPE{
  891.     USHORT          nId;        
  892.     RESOURCE_TYPE   nRT;        
  893.     USHORT          nGlobOff;   
  894.     USHORT          nLocalOff;  
  895. };
  896.  
  897. struct RSBYNAME_TYPE { 
  898.     RSHEADER_TYPE   Header;     
  899.     USHORT          nId;        
  900.     RESOURCE_TYPE   rtType;     
  901. };
  902.  
  903. class ResImp
  904. {
  905. protected:
  906.     ResImp( char * pFileName = (char *)0 );
  907.     ~ResImp();
  908.  
  909.     BOOL IsGlobalAvailable( RESOURCE_TYPE nRT, USHORT nId ) const;
  910.  
  911.     void * LoadGlobalRes( RESOURCE_TYPE nRT, USHORT nId,
  912.                           void ** pResHandle );
  913.  
  914.     void FreeGlobalRes( void *aResHandle, void * pResource );
  915. public:
  916.     IMPRCTYPE   imp;
  917. };
  918.  
  919. typedef short LOAD_FLAGS;
  920.  
  921. #define RC_NOTYPE          0x0     
  922. #define RC_GLOBAL          0x1     
  923.  
  924. struct STACK_TYPE {
  925.  
  926.     RSHEADER_TYPE * pResource; 
  927.     void          * pClassRes; 
  928.     LOAD_FLAGS      Flags;     
  929.     void *          aResHandle;
  930.     const Resource* pResObj;    
  931.     USHORT          nId;        
  932.     void            Clear( const Resource * pObj = NULL, USHORT Id = 0 )
  933.                     {
  934.                         pResource   = NULL;
  935.                         pClassRes   = NULL;
  936.                         Flags       = RC_NOTYPE;
  937.                         aResHandle  = NULL;
  938.                         pResObj     = pObj;
  939.                         nId         = Id;
  940.                     }
  941. };
  942.  
  943. #define MAX_RC_STACK    32
  944.  
  945. class ResMgr : public ResImp
  946. {
  947.     BOOL        bModul;    
  948.     STACK_TYPE  aStack[ MAX_RC_STACK ]; 
  949.     short       nTopRes;   
  950. public:
  951.     ResMgr( char * pFileName = (char *)0 );
  952.     ~ResMgr();
  953.  
  954.     void    TestStack( const Resource * ); 
  955.  
  956.     BOOL    IsAvailable( RESOURCE_TYPE, USHORT nId,
  957.                          RSHEADER_TYPE * = NULL,
  958.                          const Resource * = NULL) const;
  959.  
  960.     BOOL    GetResource( RESOURCE_TYPE, USHORT nId,
  961.                          RSHEADER_TYPE *, const Resource * );
  962.     void    PopContext( const Resource * );       
  963.  
  964.     void *   Increment( USHORT nSize );
  965.  
  966.     static USHORT GetObjSize( RSHEADER_TYPE * pHT )
  967.     {
  968.         return( pHT->nGlobOff );
  969.     }
  970.  
  971.     static USHORT GetStringSize( USHORT nLen )
  972.     {
  973.         nLen++;
  974.         return (nLen + nLen%2);
  975.     }
  976.     static USHORT GetStringSize( char * pStr );
  977.  
  978.     static long GetLong( void * pLong )
  979.     {
  980.         return (long)(((INT32)(*(UINT16*)pLong) << 16) | *(((UINT16*)pLong) + 1));
  981.     }
  982.  
  983.     void * GetClass()
  984.     {
  985.        return( aStack[ nTopRes ].pClassRes );
  986.     }
  987.  
  988.     USHORT GetRemainSize();
  989. };
  990.  
  991. class Resource : public LinkHdl
  992. {
  993. protected:
  994.  
  995.     BOOL IsAvailableRes( const ResId& rId ) const
  996.     {
  997.         return( GetResManager()->IsAvailable( rId.GetRT(), rId.GetId(),
  998.                                               rId.GetpResource(), this ) );
  999.     }
  1000.  
  1001.     void GetRes( const ResId& rResId );
  1002.  
  1003.     void TestRes();
  1004.  
  1005.     static void * GetClassRes()
  1006.     {
  1007.         return( GetResManager()->GetClass() );
  1008.     }
  1009.  
  1010.     static void * IncrementRes( USHORT nBytes )
  1011.     {
  1012.         return( GetResManager()->Increment( nBytes ) );
  1013.     }
  1014.  
  1015.     static USHORT GetObjSizeRes( RSHEADER_TYPE * pHT )
  1016.     {
  1017.         return( ResMgr::GetObjSize( pHT ) );
  1018.     }
  1019.  
  1020.     static USHORT GetStringSizeRes( char * pStr )
  1021.     {
  1022.         return( ResMgr::GetStringSize( pStr ) );
  1023.     }
  1024.  
  1025.     static USHORT GetRemainSizeRes()
  1026.     {
  1027.         return( GetResManager()->GetRemainSize() );
  1028.     }
  1029.  
  1030.     static long GetLongRes( void * pLong )
  1031.     {
  1032.         return( ResMgr::GetLong( pLong ) );
  1033.     }
  1034.  
  1035.     void FreeResource()
  1036.     { 
  1037.         GetResManager()->PopContext( this );
  1038.     }
  1039.  
  1040.     Resource( const ResId& rResId );
  1041.  
  1042.     Resource() {};
  1043.  
  1044. public:
  1045.  
  1046.     ~Resource()
  1047.     {
  1048. #ifdef DBG_UTIL
  1049.         TestRes();
  1050. #endif
  1051.     }
  1052.  
  1053.     static ResMgr * GetResManager();
  1054.  
  1055.     static void SetResManager( ResMgr * paResMgr );
  1056.  
  1057.     static void DisableErrorBox();
  1058. };
  1059.  
  1060. #endif 
  1061.  
  1062. #ifndef _MAPMOD_HXX
  1063. #define _MAPMOD_HXX
  1064.  
  1065. #ifndef _SV_H
  1066. #endif
  1067. #ifndef _RESID_HXX
  1068. #endif
  1069. #ifndef _RC_HXX
  1070. #endif
  1071.  
  1072. enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
  1073.                MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH,
  1074.                MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT };
  1075.  
  1076. class ImpMapMode
  1077. {
  1078.     friend class    MapMode;
  1079.  
  1080. protected:
  1081.     USHORT          nRefCount;
  1082.     MapUnit         eUnit;
  1083.     Point           aOrigin;
  1084.     Fraction        aScaleX;
  1085.     Fraction        aScaleY;
  1086.     BOOL            bStatic;
  1087.  
  1088. public:
  1089.                     ImpMapMode();
  1090.                     ImpMapMode( const ImpMapMode& rImpMapMode );
  1091.  
  1092.     BOOL            IsEqual( const ImpMapMode& rImpMapMode ) const;
  1093. };
  1094.  
  1095. class ImpMapMode;
  1096.  
  1097. class MapMode : public Resource
  1098. {
  1099. protected:
  1100.     ImpMapMode*     pImpMapMode;
  1101.  
  1102. public:
  1103.                     MapMode();
  1104.                     MapMode( const MapMode& rMapMode );
  1105.                     MapMode( MapUnit eUnit );
  1106.                     MapMode( MapUnit eUnit, const Point& rLogicOrg,
  1107.                              const Fraction& rScaleX, const Fraction& rScaleY );
  1108.                     MapMode( const ResId& rResId );
  1109.                     ~MapMode();
  1110.  
  1111.     MapUnit         ChangeMapUnit( MapUnit eUnit );
  1112.     MapUnit         GetMapUnit() const
  1113.                         { return pImpMapMode->eUnit; }
  1114.  
  1115.     Point           ChangeOrigin( const Point& rOrigin );
  1116.     const Point&    GetOrigin() const
  1117.                         { return pImpMapMode->aOrigin; }
  1118.  
  1119.     Fraction        ChangeScaleX( const Fraction& rScaleX );
  1120.     const Fraction& GetScaleX() const
  1121.                         { return pImpMapMode->aScaleX; }
  1122.     Fraction        ChangeScaleY( const Fraction& rScaleY );
  1123.     const Fraction& GetScaleY() const
  1124.                         { return pImpMapMode->aScaleY; }
  1125.  
  1126.     MapMode&        operator=( const MapMode& rMapMode );
  1127.  
  1128.     BOOL            operator==( const MapMode& rMapMode ) const;
  1129.     BOOL            operator!=( const MapMode& rMapMode ) const;
  1130. };
  1131.  
  1132. #endif  
  1133.  
  1134. #ifndef _COLOR_HXX
  1135. #define _COLOR_HXX
  1136.  
  1137. #ifndef _SV_H
  1138. #endif
  1139. #ifndef _RESID_HXX
  1140. #endif
  1141. #ifndef _RC_HXX
  1142. #endif
  1143.  
  1144. #define COLCOUNT_MONOCHROM          ((ULONG)2)
  1145. #define COLCOUNT_16                 ((ULONG)16)
  1146. #define COLCOUNT_256                ((ULONG)256)
  1147. #define COLCOUNT_HICOLOR1           (((ULONG)0x00007FFF)+1)
  1148. #define COLCOUNT_HICOLOR2           (((ULONG)0x0000FFFF)+1)
  1149. #define COLCOUNT_TRUECOLOR          (((ULONG)0x00FFFFFF)+1)
  1150.  
  1151. enum ColorName { COL_BLACK, COL_BLUE, COL_GREEN, COL_CYAN,
  1152.                  COL_RED, COL_MAGENTA, COL_BROWN, COL_GRAY,
  1153.                  COL_LIGHTGRAY, COL_LIGHTBLUE, COL_LIGHTGREEN,
  1154.                  COL_LIGHTCYAN, COL_LIGHTRED, COL_LIGHTMAGENTA,
  1155.                  COL_YELLOW, COL_WHITE,
  1156.                  COL_MENUBAR, COL_MENUBARTEXT,
  1157.                  COL_POPUPMENU, COL_POPUPMENUTEXT,
  1158.                  COL_WINDOWTEXT, COL_WINDOWWORKSPACE,
  1159.                  COL_HIGHLIGHT, COL_HIGHLIGHTTEXT,
  1160.                  COL_3DTEXT, COL_3DFACE, COL_3DLIGHT, COL_3DSHADOW,
  1161.                  COL_SCROLLBAR, COL_USER };
  1162.  
  1163. class Color : public Resource
  1164. {
  1165. protected:
  1166.     ColorName   eColorName;
  1167.     USHORT      nRed;
  1168.     USHORT      nGreen;
  1169.     USHORT      nBlue;
  1170.  
  1171. public:
  1172.                 Color();
  1173.                 Color( ColorName eColorName );
  1174.                 Color( USHORT nRed, USHORT nGreen, USHORT nBlue );
  1175.                 Color( const ResId &rResId );
  1176.  
  1177.     USHORT      ChangeRed( USHORT nRed );
  1178.     USHORT      GetRed() const;
  1179.     USHORT      ChangeGreen( USHORT nGreen );
  1180.     USHORT      GetGreen() const;
  1181.     USHORT      ChangeBlue( USHORT nBlue );
  1182.     USHORT      GetBlue() const;
  1183.  
  1184.     ColorName   ChangeColorName( ColorName eColorName );
  1185.     ColorName   GetColorName() const { return eColorName; }
  1186.  
  1187.     BOOL        operator==( const Color& rColor ) const;
  1188.     BOOL        operator!=( const Color& rColor ) const;
  1189. };
  1190.  
  1191. inline Color::Color()
  1192. {
  1193.     Color::eColorName = COL_BLACK;
  1194. }
  1195.  
  1196. inline Color::Color( ColorName _eColorName )
  1197. {
  1198.     Color::eColorName = _eColorName;
  1199.     if ( _eColorName == COL_USER )
  1200.     {
  1201.         nRed = nGreen = nBlue = 0;
  1202.     }
  1203. }
  1204.  
  1205. inline Color::Color( USHORT _nRed, USHORT _nGreen, USHORT _nBlue )
  1206. {
  1207.     Color::eColorName = COL_USER;
  1208.     Color::nRed       = _nRed;
  1209.     Color::nGreen     = _nGreen;
  1210.     Color::nBlue      = _nBlue;
  1211. }
  1212.  
  1213. #endif  
  1214.  
  1215. #ifndef _PAL_HXX
  1216. #define _PAL_HXX
  1217.  
  1218. #ifndef _SV_H
  1219. #endif
  1220. #ifndef _COLOR_H
  1221. #endif
  1222.  
  1223. class ImpPalette;
  1224.  
  1225. class Palette
  1226. {
  1227. protected:
  1228.     ImpPalette*     pImpPalette;    
  1229.  
  1230. public:
  1231.                     Palette( USHORT nEntries = 0 );
  1232.                     Palette( USHORT nEntries, Color aColAry[],
  1233.                              BOOL bAnimate = FALSE );
  1234.                     Palette( const Palette& rPal );
  1235.                     ~Palette();
  1236.  
  1237.     USHORT          ChangeEntryCount( USHORT nEntries );
  1238.     USHORT          GetEntryCount() const;
  1239.     Color           ChangeColor( USHORT nEntry, const Color& rCol );
  1240.     Color           GetColor( USHORT nEntry ) const;
  1241.     BOOL            ChangeAnimate( USHORT nEntry, BOOL bAnimate );
  1242.     BOOL            IsAnimate( USHORT nEntry ) const;
  1243.     void            SetAnimate( BOOL bAnimate );
  1244.  
  1245.     Palette&        operator=( const Palette& rPalette );
  1246.     Color           operator[]( USHORT nPos ) const;
  1247.     Color&          operator[]( USHORT nPos );
  1248.  
  1249.     BOOL            operator==( const Palette& rPalette ) const;
  1250.     BOOL            operator!=( const Palette& rPalette ) const;
  1251. };
  1252.  
  1253. #endif 
  1254.  
  1255. #ifndef _BITMAP_HXX
  1256. #define _BITMAP_HXX
  1257.  
  1258. #ifndef _SV_H
  1259. #endif
  1260. #ifndef _PAL_HXX
  1261. #endif
  1262. #ifndef _RESID_HXX
  1263. #endif
  1264. #ifndef _RC_HXX
  1265. #endif
  1266.  
  1267. class ImpBitmap;
  1268. class istream;
  1269. class ostream;
  1270.  
  1271. class Bitmap : public Resource
  1272. {
  1273. protected:
  1274.  
  1275.     ImpBitmap*      pImpBitmap;
  1276.  
  1277. public:
  1278.                     Bitmap();
  1279.                     Bitmap( const Bitmap& rBitmap );
  1280.                     Bitmap( const ResId& rResId );
  1281.                     ~Bitmap();
  1282.  
  1283.     Palette         ChangePalette( const Palette& rPal );
  1284.     Palette         GetPalette() const;
  1285.  
  1286.     ULONG           GetColorCount() const;
  1287.     Size            GetSizePixel() const;
  1288.  
  1289.     ULONG            GetSizeBytes() const;
  1290.  
  1291.     Bitmap&         operator=( const Bitmap& rBitmap );
  1292.  
  1293.     BOOL            operator==( const Bitmap& rBitmap ) const;
  1294.     BOOL            operator!=( const Bitmap& rBitmap ) const;
  1295.  
  1296.     friend istream& operator>>( istream& rIStream, Bitmap& rBitmap );
  1297.     friend ostream& operator<<( ostream& rOStream, const Bitmap& rBitmap );
  1298. };
  1299.  
  1300. #endif  
  1301.  
  1302. #ifndef _GDIOBJ_HXX
  1303. #define _GDIOBJ_HXX
  1304.  
  1305. #ifndef _SV_H
  1306. #endif
  1307. #ifndef _RESID_HXX
  1308. #endif
  1309. #ifndef _RC_HXX
  1310. #endif
  1311. #ifndef _COLOR_HXX
  1312. #endif
  1313. #ifndef _BITMAP_HXX
  1314. #endif
  1315.  
  1316. class ImpPen;
  1317. class ImpBrush;
  1318. class ImpFont;
  1319.  
  1320. enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT };
  1321.  
  1322. class ImpPen
  1323. {
  1324.     friend class Pen;
  1325.  
  1326. protected:
  1327.     USHORT          nRefCount;
  1328.     Color           aColor;
  1329.     USHORT          nWidth;
  1330.     PenStyle        eStyle;
  1331.     BOOL            bStatic;
  1332.     BOOL            bDummy;
  1333.  
  1334. public:
  1335.                     ImpPen();
  1336.                     ImpPen( const ImpPen& rImpPen );
  1337.                     ImpPen( const Color& rColor, USHORT nWidth,
  1338.                             PenStyle eStyle );
  1339.  
  1340.     BOOL            IsEqual( const ImpPen& rImpPen ) const;
  1341. };
  1342.  
  1343. class Pen : public Resource
  1344. {
  1345. protected:
  1346.     ImpPen*         pImpPen;
  1347.  
  1348. public:
  1349.                     Pen();
  1350.                     Pen( const Pen& rPen );
  1351.                     Pen( PenStyle eStyle );
  1352.                     Pen( const Color& rColor, USHORT nWidth = 0,
  1353.                          PenStyle eStyle = PEN_SOLID );
  1354.                     Pen( const ResId &rResId );
  1355.                     ~Pen();
  1356.  
  1357.     Color           ChangeColor( const Color& rColor );
  1358.     const Color&    GetColor() const
  1359.                         { return pImpPen->aColor; }
  1360.  
  1361.     USHORT          ChangeWidth( USHORT nWidth );
  1362.     USHORT          GetWidth() const
  1363.                         { return pImpPen->nWidth; }
  1364.  
  1365.     PenStyle        ChangeStyle( PenStyle eStyle );
  1366.     PenStyle        GetStyle() const
  1367.                         { return pImpPen->eStyle; }
  1368.  
  1369.     Pen&            operator=( const Pen& rPen );
  1370.     BOOL            operator==( const Pen& rPen ) const;
  1371.     BOOL            operator!=( const Pen& rPen ) const;
  1372. };
  1373.  
  1374. #define BRUSH_SIZE      8
  1375.  
  1376. enum BrushStyle { BRUSH_NULL, BRUSH_SOLID, BRUSH_HORZ, BRUSH_VERT,
  1377.                   BRUSH_CROSS, BRUSH_DIAGCROSS, BRUSH_UPDIAG, BRUSH_DOWNDIAG,
  1378.                   BRUSH_25, BRUSH_50, BRUSH_75,
  1379.                   BRUSH_BITMAP };
  1380.  
  1381. class ImpBrush
  1382. {
  1383.     friend class Brush;
  1384.  
  1385. protected:
  1386.     USHORT          nRefCount;
  1387.     Color           aColor;
  1388.     Color           aFillColor;
  1389.     BrushStyle      eStyle;
  1390.     Bitmap          aBitmap;
  1391.     BOOL            bTransparent;
  1392.     BOOL            bStatic;
  1393.  
  1394. public:
  1395.                     ImpBrush();
  1396.                     ImpBrush( const ImpBrush& rImpBrush );
  1397.                     ImpBrush( const Color& rColor,
  1398.                               const Color& rFillColor,
  1399.                               BrushStyle eStyle, BOOL bTransparent );
  1400.  
  1401.     BOOL            IsEqual( const ImpBrush& rImpBrush ) const;
  1402. };
  1403.  
  1404. class Brush : public Resource
  1405. {
  1406. protected:
  1407.     ImpBrush*       pImpBrush;
  1408.  
  1409. public:
  1410.                     Brush();
  1411.                     Brush( const Brush& rBrush );
  1412.                     Brush( BrushStyle eStyle );
  1413.                     Brush( const Color& rColor,
  1414.                            BrushStyle aStyle = BRUSH_SOLID );
  1415.                     Brush( const Color& rColor, const Color& rFillColor,
  1416.                            BrushStyle eStyle );
  1417.                     Brush( const Bitmap& rBitmap );
  1418.                     Brush( const ResId& rResId );
  1419.                     ~Brush();
  1420.  
  1421.     Color           ChangeColor( const Color& rColor );
  1422.     const Color&    GetColor() const
  1423.                         { return pImpBrush->aColor; }
  1424.     Color           ChangeFillColor( const Color& rColor );
  1425.     const Color&    GetFillColor() const
  1426.                         { return pImpBrush->aFillColor; }
  1427.  
  1428.     BrushStyle      ChangeStyle( BrushStyle eStyle );
  1429.     BrushStyle      GetStyle() const
  1430.                         { return pImpBrush->eStyle; }
  1431.     Bitmap          ChangeBitmap( const Bitmap& rBitmap );
  1432.     const Bitmap&   GetBitmap() const
  1433.                         { return pImpBrush->aBitmap; }
  1434.  
  1435.     BOOL            ChangeTransparent( BOOL bTransparent );
  1436.     BOOL            IsTransparent() const;
  1437.     BOOL            IsHatched() const;
  1438.  
  1439.     Brush&          operator=( const Brush& rBrush );
  1440.     BOOL            operator==( const Brush& rBrush ) const;
  1441.     BOOL            operator!=( const Brush& rBrush ) const;
  1442. };
  1443.  
  1444. enum FontFamily    { FAMILY_DONTKNOW, FAMILY_DECORATIVE, FAMILY_MODERN,
  1445.                      FAMILY_ROMAN, FAMILY_SCRIPT, FAMILY_SWISS, FAMILY_SYSTEM };
  1446. enum FontPitch     { PITCH_DONTKNOW, PITCH_FIXED, PITCH_VARIABLE };
  1447. enum FontAlign     { ALIGN_TOP, ALIGN_BASELINE, ALIGN_BOTTOM };
  1448. enum FontWeight    { WEIGHT_DONTKNOW, WEIGHT_LIGHT, WEIGHT_NORMAL, WEIGHT_BOLD };
  1449. enum FontUnderline { UNDERLINE_NONE, UNDERLINE_SINGLE, UNDERLINE_DOUBLE };
  1450. enum FontStrikeout { STRIKEOUT_NONE, STRIKEOUT_SINGLE, STRIKEOUT_DOUBLE };
  1451.  
  1452. class ImpFont
  1453. {
  1454.     friend class Font;
  1455. protected:
  1456.     USHORT          nRefCount;
  1457.     Color           aColor;
  1458.     Color           aFillColor;
  1459.     String          aName;
  1460.     Size            aSize;
  1461.     short           nCharOrientation;
  1462.     short           nLineOrientation;
  1463.     CharSet         eCharSet;
  1464.     FontFamily      eFamily;
  1465.     FontPitch       ePitch;
  1466.     FontAlign       eAlign;
  1467.     FontWeight      eWeight;
  1468.     FontUnderline   eUnderline;
  1469.     FontStrikeout   eStrikeout;
  1470.     BOOL            bItalic;
  1471.     BOOL            bOutline;
  1472.     BOOL            bShadow;
  1473.     BOOL            bTransparent;
  1474.     BOOL            bStatic;
  1475.     BOOL            bDummy;
  1476.  
  1477. public:
  1478.                     ImpFont();
  1479.                     ImpFont( const ImpFont& rImpFont );
  1480.  
  1481.     BOOL            IsEqual( const ImpFont& rImpFont ) const;
  1482. };
  1483.  
  1484. class Font : public Resource
  1485. {
  1486. protected:
  1487.     ImpFont*        pImpFont;
  1488.  
  1489. public:
  1490.                     Font();
  1491.                     Font( const Font& rFont );
  1492.                     Font( const String& rName, const Size& rSize );
  1493.                     Font( FontFamily eFamily, const Size& rSize );
  1494.                     Font( const ResId & rResId );
  1495.                     ~Font();
  1496.  
  1497.     Color           ChangeColor( const Color& rColor );
  1498.     const Color&    GetColor() const
  1499.                         { return pImpFont->aColor; }
  1500.     Color           ChangeFillColor( const Color& rColor );
  1501.     const Color&    GetFillColor() const
  1502.                         { return pImpFont->aFillColor; }
  1503.  
  1504.     FontFamily      ChangeFamily( FontFamily eFamily );
  1505.     FontFamily      GetFamily() const
  1506.                         { return pImpFont->eFamily; }
  1507.     String          ChangeName( const String& rName );
  1508.     const String&   GetName() const
  1509.                         { return pImpFont->aName; }
  1510.     Size            ChangeSize( const Size& rSize );
  1511.     const Size&     GetSize() const
  1512.                         { return pImpFont->aSize; }
  1513.  
  1514.     CharSet         ChangeCharSet( CharSet eCharSet );
  1515.     CharSet         GetCharSet() const
  1516.                         { return pImpFont->eCharSet; }
  1517.     FontPitch       ChangePitch( FontPitch ePitch );
  1518.     FontPitch       GetPitch() const
  1519.                         { return pImpFont->ePitch; }
  1520.  
  1521.     FontAlign       ChangeAlign( FontAlign eAlign );
  1522.     FontAlign       GetAlign() const
  1523.                         { return pImpFont->eAlign; }
  1524.  
  1525.     short           ChangeLineOrientation( short nLineOrientation );
  1526.     short           GetLineOrientation() const
  1527.                         { return pImpFont->nLineOrientation; }
  1528.     short           ChangeCharOrientation( short nCharOrientation );
  1529.     short           GetCharOrientation() const
  1530.                         { return pImpFont->nCharOrientation; }
  1531.  
  1532.     FontWeight      ChangeWeight( FontWeight eWeight );
  1533.     FontWeight      GetWeight() const
  1534.                         { return pImpFont->eWeight; }
  1535.     FontUnderline   ChangeUnderline( FontUnderline eUnderline );
  1536.     FontUnderline   GetUnderline() const
  1537.                         { return pImpFont->eUnderline; }
  1538.     FontStrikeout   ChangeStrikeout( FontStrikeout eStrikeout );
  1539.     FontStrikeout   GetStrikeout() const
  1540.                         { return pImpFont->eStrikeout; }
  1541.     BOOL            ChangeItalic( BOOL bItalic );
  1542.     BOOL            IsItalic() const
  1543.                         { return pImpFont->bItalic; }
  1544.     BOOL            ChangeOutline( BOOL bOutline );
  1545.     BOOL            IsOutline() const
  1546.                         { return pImpFont->bOutline; }
  1547.     BOOL            ChangeShadow( BOOL bShadow );
  1548.     BOOL            IsShadow() const
  1549.                         { return pImpFont->bShadow; }
  1550.  
  1551.     BOOL            ChangeTransparent( BOOL bTransparent );
  1552.     BOOL            IsTransparent() const
  1553.                         { return pImpFont->bTransparent; }
  1554.  
  1555.     Font&           operator=( const Font& rFont );
  1556.     BOOL            operator==( const Font& rFont ) const;
  1557.     BOOL            operator!=( const Font& rFont ) const;
  1558. };
  1559.  
  1560. #endif  
  1561.  
  1562. #ifndef _POINTR_HXX
  1563. #define _POINTR_HXX
  1564.  
  1565. #ifndef _SV_H
  1566. #endif
  1567. #ifndef _RESID_HXX
  1568. #endif
  1569. #ifndef _RC_HXX
  1570. #endif
  1571.  
  1572. class ImpPointer;
  1573.  
  1574. enum PointerStyle { POINTER_ARROW, POINTER_WAIT, POINTER_CROSS,
  1575.                     POINTER_BEAM, POINTER_HSPLIT, POINTER_VSPLIT,
  1576.                     POINTER_MOVEFILE, POINTER_COPYFILE,
  1577.                     POINTER_MOVEFILES, POINTER_COPYFILES,
  1578.                     POINTER_NOTALLOWED, POINTER_NULL };
  1579.  
  1580. class Pointer : public Resource
  1581. {
  1582. protected:
  1583.     ImpPointer*     pImpPointer;    
  1584.  
  1585. public:
  1586.                     Pointer();
  1587.                     Pointer( PointerStyle );
  1588.                     Pointer( const Pointer& rPointer );
  1589.                     Pointer( const ResId& rResId );
  1590.                     ~Pointer();
  1591.  
  1592.     static  void    Show();
  1593.     static  void    Hide();
  1594.     static  BOOL    IsVisible();
  1595.  
  1596.     static  Point   ChangePosPixel( const Point& rPos );
  1597.     static  Point   GetPosPixel();
  1598.  
  1599.     Pointer&        operator=( const Pointer& rPointer );
  1600.  
  1601.     BOOL            operator==( const Pointer& rPointer ) const;
  1602.     BOOL            operator!=( const Pointer& rPointer ) const;
  1603. };
  1604.  
  1605. #endif 
  1606.  
  1607. #ifndef _ICON_HXX
  1608. #define _ICON_HXX
  1609.  
  1610. #ifndef _SV_H
  1611. #endif
  1612. #ifndef _RESID_HXX
  1613. #endif
  1614. #ifndef _RC_HXX
  1615. #endif
  1616.  
  1617. class ImpIcon;
  1618.  
  1619. enum IconStyle { ICON_DEFAULT, ICON_INFO, ICON_WARNING, ICON_ERROR,
  1620.                  ICON_QUERY, ICON_NULL };
  1621.  
  1622. class Icon : public Resource
  1623. {
  1624. protected:
  1625.     ImpIcon*    pImpIcon;      
  1626.  
  1627. public:
  1628.                 Icon();
  1629.                 Icon( IconStyle aStyle );
  1630.                 Icon( const Icon& rIcon );
  1631.                 Icon( const ResId& rResId );
  1632.                 ~Icon();
  1633.  
  1634.     Size        GetSizePixel() const;
  1635.  
  1636.     Icon&       operator =( const Icon& rIcon );
  1637.  
  1638.     BOOL        operator ==( const Icon& rIcon ) const;
  1639.     BOOL        operator !=( const Icon& rIcon ) const;
  1640. };
  1641.  
  1642. #endif  
  1643.  
  1644. #ifndef _KEYCOD_HXX
  1645. #define _KEYCOD_HXX
  1646.  
  1647. #ifndef _SV_H
  1648. #endif
  1649. #ifndef RESID_HXX
  1650. #endif
  1651. #ifndef RC_HXX
  1652. #endif
  1653.  
  1654. #define KEYGROUP_NUM    ((USHORT)0x0100)
  1655. #define KEYGROUP_ALPHA  ((USHORT)0x0200)
  1656. #define KEYGROUP_FKEYS  ((USHORT)0x0300)
  1657. #define KEYGROUP_CURSOR ((USHORT)0x0400)
  1658. #define KEYGROUP_MISC   ((USHORT)0x0500)
  1659.  
  1660. #define KEY_0           ((USHORT)(KEYGROUP_NUM+0))
  1661. #define KEY_1           ((USHORT)(KEYGROUP_NUM+1))
  1662. #define KEY_2           ((USHORT)(KEYGROUP_NUM+2))
  1663. #define KEY_3           ((USHORT)(KEYGROUP_NUM+3))
  1664. #define KEY_4           ((USHORT)(KEYGROUP_NUM+4))
  1665. #define KEY_5           ((USHORT)(KEYGROUP_NUM+5))
  1666. #define KEY_6           ((USHORT)(KEYGROUP_NUM+6))
  1667. #define KEY_7           ((USHORT)(KEYGROUP_NUM+7))
  1668. #define KEY_8           ((USHORT)(KEYGROUP_NUM+8))
  1669. #define KEY_9           ((USHORT)(KEYGROUP_NUM+9))
  1670.  
  1671. #define KEY_A           ((USHORT)(KEYGROUP_ALPHA+0))
  1672. #define KEY_B           ((USHORT)(KEYGROUP_ALPHA+1))
  1673. #define KEY_C           ((USHORT)(KEYGROUP_ALPHA+2))
  1674. #define KEY_D           ((USHORT)(KEYGROUP_ALPHA+3))
  1675. #define KEY_E           ((USHORT)(KEYGROUP_ALPHA+4))
  1676. #define KEY_F           ((USHORT)(KEYGROUP_ALPHA+5))
  1677. #define KEY_G           ((USHORT)(KEYGROUP_ALPHA+6))
  1678. #define KEY_H           ((USHORT)(KEYGROUP_ALPHA+7))
  1679. #define KEY_I           ((USHORT)(KEYGROUP_ALPHA+8))
  1680. #define KEY_J           ((USHORT)(KEYGROUP_ALPHA+9))
  1681. #define KEY_K           ((USHORT)(KEYGROUP_ALPHA+10))
  1682. #define KEY_L           ((USHORT)(KEYGROUP_ALPHA+11))
  1683. #define KEY_M           ((USHORT)(KEYGROUP_ALPHA+12))
  1684. #define KEY_N           ((USHORT)(KEYGROUP_ALPHA+13))
  1685. #define KEY_O           ((USHORT)(KEYGROUP_ALPHA+14))
  1686. #define KEY_P           ((USHORT)(KEYGROUP_ALPHA+15))
  1687. #define KEY_Q           ((USHORT)(KEYGROUP_ALPHA+16))
  1688. #define KEY_R           ((USHORT)(KEYGROUP_ALPHA+17))
  1689. #define KEY_S           ((USHORT)(KEYGROUP_ALPHA+18))
  1690. #define KEY_T           ((USHORT)(KEYGROUP_ALPHA+19))
  1691. #define KEY_U           ((USHORT)(KEYGROUP_ALPHA+20))
  1692. #define KEY_V           ((USHORT)(KEYGROUP_ALPHA+21))
  1693. #define KEY_W           ((USHORT)(KEYGROUP_ALPHA+22))
  1694. #define KEY_X           ((USHORT)(KEYGROUP_ALPHA+23))
  1695. #define KEY_Y           ((USHORT)(KEYGROUP_ALPHA+24))
  1696. #define KEY_Z           ((USHORT)(KEYGROUP_ALPHA+25))
  1697.  
  1698. #define KEY_F1          ((USHORT)(KEYGROUP_FKEYS+0))
  1699. #define KEY_F2          ((USHORT)(KEYGROUP_FKEYS+1))
  1700. #define KEY_F3          ((USHORT)(KEYGROUP_FKEYS+2))
  1701. #define KEY_F4          ((USHORT)(KEYGROUP_FKEYS+3))
  1702. #define KEY_F5          ((USHORT)(KEYGROUP_FKEYS+4))
  1703. #define KEY_F6          ((USHORT)(KEYGROUP_FKEYS+5))
  1704. #define KEY_F7          ((USHORT)(KEYGROUP_FKEYS+6))
  1705. #define KEY_F8          ((USHORT)(KEYGROUP_FKEYS+7))
  1706. #define KEY_F9          ((USHORT)(KEYGROUP_FKEYS+8))
  1707. #define KEY_F10         ((USHORT)(KEYGROUP_FKEYS+9))
  1708. #define KEY_F11         ((USHORT)(KEYGROUP_FKEYS+10))
  1709. #define KEY_F12         ((USHORT)(KEYGROUP_FKEYS+11))
  1710. #define KEY_F13         ((USHORT)(KEYGROUP_FKEYS+12))
  1711. #define KEY_F14         ((USHORT)(KEYGROUP_FKEYS+13))
  1712. #define KEY_F15         ((USHORT)(KEYGROUP_FKEYS+14))
  1713. #define KEY_F16         ((USHORT)(KEYGROUP_FKEYS+15))
  1714. #define KEY_F17         ((USHORT)(KEYGROUP_FKEYS+16))
  1715. #define KEY_F18         ((USHORT)(KEYGROUP_FKEYS+17))
  1716. #define KEY_F19         ((USHORT)(KEYGROUP_FKEYS+18))
  1717. #define KEY_F20         ((USHORT)(KEYGROUP_FKEYS+19))
  1718. #define KEY_F21         ((USHORT)(KEYGROUP_FKEYS+20))
  1719. #define KEY_F22         ((USHORT)(KEYGROUP_FKEYS+21))
  1720. #define KEY_F23         ((USHORT)(KEYGROUP_FKEYS+22))
  1721. #define KEY_F24         ((USHORT)(KEYGROUP_FKEYS+23))
  1722. #define KEY_F25         ((USHORT)(KEYGROUP_FKEYS+24))
  1723. #define KEY_F26         ((USHORT)(KEYGROUP_FKEYS+25))
  1724.  
  1725. #define KEY_DOWN        ((USHORT)(KEYGROUP_CURSOR+0))
  1726. #define KEY_UP          ((USHORT)(KEYGROUP_CURSOR+1))
  1727. #define KEY_LEFT        ((USHORT)(KEYGROUP_CURSOR+2))
  1728. #define KEY_RIGHT       ((USHORT)(KEYGROUP_CURSOR+3))
  1729. #define KEY_HOME        ((USHORT)(KEYGROUP_CURSOR+4))
  1730. #define KEY_END         ((USHORT)(KEYGROUP_CURSOR+5))
  1731. #define KEY_PAGEUP      ((USHORT)(KEYGROUP_CURSOR+6))
  1732. #define KEY_PAGEDOWN    ((USHORT)(KEYGROUP_CURSOR+7))
  1733.  
  1734. #define KEY_RETURN      ((USHORT)(KEYGROUP_MISC+0))
  1735. #define KEY_ESCAPE      ((USHORT)(KEYGROUP_MISC+1))
  1736. #define KEY_TAB         ((USHORT)(KEYGROUP_MISC+2))
  1737. #define KEY_BACKSPACE   ((USHORT)(KEYGROUP_MISC+3))
  1738. #define KEY_SPACE       ((USHORT)(KEYGROUP_MISC+4))
  1739. #define KEY_INSERT      ((USHORT)(KEYGROUP_MISC+5))
  1740. #define KEY_DELETE      ((USHORT)(KEYGROUP_MISC+6))
  1741.  
  1742. #define KEY_ADD         ((USHORT)(KEYGROUP_MISC+7))
  1743. #define KEY_SUBTRACT    ((USHORT)(KEYGROUP_MISC+8))
  1744. #define KEY_MULTIPLY    ((USHORT)(KEYGROUP_MISC+9))
  1745. #define KEY_DIVIDE      ((USHORT)(KEYGROUP_MISC+10))
  1746. #define KEY_POINT       ((USHORT)(KEYGROUP_MISC+11))
  1747. #define KEY_COMMA       ((USHORT)(KEYGROUP_MISC+12))
  1748. #define KEY_LESS        ((USHORT)(KEYGROUP_MISC+13))
  1749. #define KEY_GREATER     ((USHORT)(KEYGROUP_MISC+14))
  1750. #define KEY_EQUAL       ((USHORT)(KEYGROUP_MISC+15))
  1751.  
  1752. #define KEY_OPEN        ((USHORT)(KEYGROUP_MISC+16))
  1753. #define KEY_CUT         ((USHORT)(KEYGROUP_MISC+17))
  1754. #define KEY_COPY        ((USHORT)(KEYGROUP_MISC+18))
  1755. #define KEY_PASTE       ((USHORT)(KEYGROUP_MISC+19))
  1756. #define KEY_UNDO        ((USHORT)(KEYGROUP_MISC+20))
  1757. #define KEY_REPEAT      ((USHORT)(KEYGROUP_MISC+21))
  1758. #define KEY_FIND        ((USHORT)(KEYGROUP_MISC+22))
  1759. #define KEY_PROPERTIES  ((USHORT)(KEYGROUP_MISC+23))
  1760. #define KEY_FRONT       ((USHORT)(KEYGROUP_MISC+24))
  1761.  
  1762. #define KEY_SHIFT       ((USHORT)0x1000)
  1763. #define KEY_MOD1        ((USHORT)0x2000)
  1764. #define KEY_MOD2        ((USHORT)0x4000)
  1765.  
  1766. enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN,
  1767.                    KEYFUNC_SAVE, KEYFUNC_SAVEAS, KEYFUNC_PRINT,
  1768.                    KEYFUNC_CLOSE, KEYFUNC_QUIT,
  1769.                    KEYFUNC_CUT, KEYFUNC_COPY, KEYFUNC_PASTE, KEYFUNC_UNDO,
  1770.                    KEYFUNC_REDO, KEYFUNC_DELETE, KEYFUNC_REPEAT,
  1771.                    KEYFUNC_FIND, KEYFUNC_FINDBACKWARD, KEYFUNC_PROPERTIES,
  1772.                    KEYFUNC_FRONT };
  1773.  
  1774. class KeyCode : public Resource
  1775. {
  1776. protected:
  1777.     USHORT      nCode;
  1778.     KeyFuncType eFunc;
  1779.  
  1780.     USHORT      GetFullCode() const { return nCode; }
  1781.     KeyFuncType GetFullFunction() const { return eFunc; }
  1782.  
  1783. public:
  1784.                 KeyCode() { nCode = 0; eFunc = KEYFUNC_DONTKNOW; }
  1785.                 KeyCode( const ResId& rResId );
  1786.                 KeyCode( USHORT nKey, USHORT nModifier = 0 )
  1787.                     { nCode = nKey | nModifier; eFunc = KEYFUNC_DONTKNOW; }
  1788.                 KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2 );
  1789.                 KeyCode( KeyFuncType eFunction );
  1790.  
  1791.     USHORT      GetCode() const
  1792.                     { return (nCode & 0x0FFF); }
  1793.  
  1794.     USHORT      GetModifier() const
  1795.                     { return ( nCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2) ); }
  1796.     BOOL        IsShift() const
  1797.                     { return ( (nCode & KEY_SHIFT) ? TRUE : FALSE ); }
  1798.     BOOL        IsMod1() const
  1799.                     { return ( (nCode & KEY_MOD1) ? TRUE : FALSE ); }
  1800.     BOOL        IsMod2() const
  1801.                     { return ( (nCode & KEY_MOD2) ? TRUE : FALSE ); }
  1802.  
  1803.     USHORT      GetGroup() const
  1804.                     { return (nCode & 0x0F00); }
  1805.  
  1806.     String      GetName() const;
  1807.  
  1808.     BOOL        IsFunction() const
  1809.                     { return ((eFunc != KEYFUNC_DONTKNOW) ? TRUE : FALSE); }
  1810.  
  1811.     KeyFuncType GetFunction() const;
  1812.  
  1813.     BOOL        operator ==( const KeyCode& rKeyCode ) const;
  1814.     BOOL        operator !=( const KeyCode& rKeyCode ) const;
  1815. };
  1816.  
  1817. inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2 )
  1818. {
  1819.     nCode = nKey;
  1820.     if( bShift )
  1821.         nCode |= KEY_SHIFT;
  1822.     if( bMod1 )
  1823.         nCode |= KEY_MOD1;
  1824.     if( bMod2 )
  1825.         nCode |= KEY_MOD2;
  1826.     eFunc = KEYFUNC_DONTKNOW;
  1827. }
  1828.  
  1829. inline BOOL KeyCode::operator ==( const KeyCode& rKeyCode ) const
  1830. {
  1831.     if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
  1832.         return nCode == rKeyCode.nCode;
  1833.     else
  1834.         return GetFunction() == rKeyCode.GetFunction();
  1835. }
  1836.  
  1837. inline BOOL KeyCode::operator !=( const KeyCode& rKeyCode ) const
  1838. {
  1839.     if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
  1840.         return nCode != rKeyCode.nCode;
  1841.     else
  1842.         return GetFunction() != rKeyCode.GetFunction();
  1843. }
  1844.  
  1845. #endif 
  1846.  
  1847. #ifndef _EVENT_HXX
  1848. #define _EVENT_HXX
  1849.  
  1850. #ifndef _SV_H
  1851. #endif
  1852.  
  1853. #ifndef _KEYCOD_HXX
  1854. #endif
  1855.  
  1856. class KeyEvent
  1857. {
  1858. private:
  1859.     KeyCode         aKeyCode;
  1860.     char            nCharCode;
  1861.     USHORT          nRepeat;
  1862.  
  1863. public:
  1864.                     KeyEvent();
  1865.                     KeyEvent( char nCharCode, const KeyCode& rKeyCode,
  1866.                               USHORT nRepeat = 0 );
  1867.  
  1868.     char            GetCharCode() const { return nCharCode; }
  1869.     const KeyCode&  GetKeyCode() const  { return aKeyCode;  }
  1870.     USHORT          GetRepeat() const   { return nRepeat;   }
  1871. };
  1872.  
  1873. inline KeyEvent::KeyEvent()
  1874. {
  1875.     nCharCode = 0;
  1876.     nRepeat   = 0;
  1877. }
  1878.  
  1879. inline KeyEvent::KeyEvent( char _nCharCode, const KeyCode& rKeyCode,
  1880.                            USHORT _nRepeat )
  1881. {
  1882.     KeyEvent::nCharCode = _nCharCode;
  1883.     KeyEvent::aKeyCode  = rKeyCode;
  1884.     KeyEvent::nRepeat   = _nRepeat;
  1885. }
  1886.  
  1887. #define MOUSE_SIMPLEMOVE    ((USHORT)0x0001)
  1888. #define MOUSE_DRAG          ((USHORT)0x0002)
  1889. #define MOUSE_DRAGMOVE      ((USHORT)0x0004)
  1890. #define MOUSE_DRAGCOPY      ((USHORT)0x0008)
  1891.  
  1892. #define MOUSE_SIMPLECLICK   ((USHORT)0x0001)
  1893. #define MOUSE_SELECT        ((USHORT)0x0002)
  1894. #define MOUSE_MULTISELECT   ((USHORT)0x0004)
  1895. #define MOUSE_RANGESELECT   ((USHORT)0x0008)
  1896. #define MOUSE_CONTEXTMENU   ((USHORT)0x0010)
  1897.  
  1898. #define MOUSE_LEFT          ((USHORT)0x0001)
  1899. #define MOUSE_MIDDLE        ((USHORT)0x0002)
  1900. #define MOUSE_RIGHT         ((USHORT)0x0004)
  1901.  
  1902. class MouseEvent
  1903. {
  1904. private:
  1905.     Point           aPos;
  1906.     USHORT          nMode;
  1907.     USHORT          nClicks;
  1908.     USHORT          nCode;
  1909.  
  1910. public:
  1911.                     MouseEvent();
  1912.                     MouseEvent( const Point& rPos, USHORT nClicks = 1,
  1913.                                 USHORT nMode = 0, USHORT nButtons = 0,
  1914.                                 USHORT nModifier = 0 );
  1915.  
  1916.     const Point&    GetPosPixel() const
  1917.                         { return aPos; }
  1918.     USHORT          GetMode() const
  1919.                         { return nMode; }
  1920.     USHORT          GetClicks() const
  1921.                         { return nClicks; }
  1922.  
  1923.     USHORT          GetButtons() const
  1924.                         { return (nCode & (MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)); }
  1925.     BOOL            IsLeft() const
  1926.                         { return ( (nCode & MOUSE_LEFT) ? TRUE : FALSE ); }
  1927.     BOOL            IsMiddle() const
  1928.                         { return ( (nCode & MOUSE_MIDDLE) ? TRUE : FALSE ); }
  1929.     BOOL            IsRight() const
  1930.                         { return ( (nCode & MOUSE_RIGHT) ? TRUE : FALSE ); }
  1931.  
  1932.     USHORT          GetModifier() const
  1933.                         { return (nCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
  1934.     BOOL            IsShift() const
  1935.                         { return ( (nCode & KEY_SHIFT) ? TRUE : FALSE ); }
  1936.     BOOL            IsMod1() const
  1937.                         { return ( (nCode & KEY_MOD1) ? TRUE : FALSE ); }
  1938.     BOOL            IsMod2() const
  1939.                         { return ( (nCode & KEY_MOD2) ? TRUE : FALSE ); }
  1940. };
  1941.  
  1942. inline MouseEvent::MouseEvent()
  1943. {
  1944.     nMode   = 0;
  1945.     nClicks = 0;
  1946.     nCode   = 0;
  1947. }
  1948.  
  1949. inline MouseEvent::MouseEvent( const Point& rPos, USHORT _nClicks,
  1950.                                USHORT _nMode,
  1951.                                USHORT nButtons, USHORT nModifier )
  1952. {
  1953.     MouseEvent::aPos    = rPos;
  1954.     MouseEvent::nClicks = _nClicks;
  1955.     MouseEvent::nMode   = _nMode;
  1956.     MouseEvent::nCode   = nButtons | nModifier;
  1957. }
  1958.  
  1959. #define APPEVENT_PARAM_DELIMITER '\n'
  1960.  
  1961. #define APPEVENT_OPEN_STRING        "Open"
  1962. #define APPEVENT_PRINT_STRING       "Print"
  1963. #define APPEVENT_DISKINSERT_STRING  "DiskInsert"
  1964.  
  1965. class ApplicationEvent
  1966. {
  1967. private:
  1968.     String          aSenderAppName;     
  1969.     String          aSenderProcId;      
  1970.     String          aEvent;             
  1971.     String          aData;              
  1972.  
  1973. public:
  1974.                     ApplicationEvent() {}
  1975.                     ApplicationEvent( const String& rSenderAppName,
  1976.                                       const String& rSenderProcId,
  1977.                                       const String& rEvent,
  1978.                                       const String& rData );
  1979.  
  1980.     const String&   GetSenderAppName() const { return aSenderAppName; }
  1981.     const String&   GetSenderProcId() const { return aSenderProcId; }
  1982.     const String&   GetEvent() const { return aEvent; }
  1983.     const String&   GetData() const { return aData; }
  1984.  
  1985.     BOOL            IsOpenEvent() const;
  1986.     BOOL            IsPrintEvent() const;
  1987.     BOOL            IsDiskInsertEvent() const;
  1988.  
  1989.     USHORT          GetParamCount() const;
  1990.     String          GetParam( USHORT nParam ) const;
  1991. };
  1992.  
  1993. inline BOOL ApplicationEvent::IsOpenEvent() const
  1994. {
  1995.     if ( aEvent == APPEVENT_OPEN_STRING )
  1996.         return TRUE;
  1997.     else
  1998.         return FALSE;
  1999. }
  2000.  
  2001. inline BOOL ApplicationEvent::IsPrintEvent() const
  2002. {
  2003.     if ( aEvent == APPEVENT_PRINT_STRING )
  2004.         return TRUE;
  2005.     else
  2006.         return FALSE;
  2007. }
  2008.  
  2009. inline BOOL ApplicationEvent::IsDiskInsertEvent() const
  2010. {
  2011.     if ( aEvent == APPEVENT_DISKINSERT_STRING )
  2012.         return TRUE;
  2013.     else
  2014.         return FALSE;
  2015. }
  2016.  
  2017. inline USHORT ApplicationEvent::GetParamCount() const
  2018. {
  2019.     return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER );
  2020. }
  2021.  
  2022. inline String ApplicationEvent::GetParam( USHORT nParam ) const
  2023. {
  2024.     return aData.GetToken( nParam, APPEVENT_PARAM_DELIMITER );
  2025. }
  2026.  
  2027. enum HelpMode { HELPMODE_CONTEXT, HELPMODE_EXTENDED,
  2028.                 HELPMODE_BALLOON, HELPMODE_ALL };
  2029.  
  2030. class HelpEvent
  2031. {
  2032. private:
  2033.     Point           aPos;
  2034.     HelpMode        eMode;
  2035.  
  2036. public:
  2037.                     HelpEvent();
  2038.                     HelpEvent( const Point& rPos, HelpMode eMode );
  2039.  
  2040.     const Point&    GetMousePosPixel() const { return aPos; }
  2041.     HelpMode        GetMode() const { return eMode; }
  2042. };
  2043.  
  2044. inline HelpEvent::HelpEvent()
  2045. {
  2046.     eMode = HELPMODE_CONTEXT;
  2047. }
  2048.  
  2049. inline HelpEvent::HelpEvent( const Point& rPos, HelpMode _eMode )
  2050. {
  2051.     HelpEvent::aPos  = rPos;
  2052.     HelpEvent::eMode = _eMode;
  2053. }
  2054.  
  2055. enum DropAction { DROP_NONE, DROP_CANCEL = DROP_NONE,
  2056.                   DROP_MOVE, DROP_COPY, DROP_LINK, DROP_PRINT, DROP_DISCARD };
  2057.  
  2058. class DropEvent
  2059. {
  2060. protected:
  2061.     DropAction      eAction;
  2062.     Point           aDropPos;
  2063.     BOOL            bLeave;
  2064.  
  2065. public:
  2066.                     DropEvent();
  2067.                     DropEvent( const Point& rPos, DropAction eAction,
  2068.                                BOOL bLeaveWindow = FALSE );
  2069.  
  2070.     const Point&    GetPosPixel() const { return aDropPos; }
  2071.     DropAction      GetAction() const { return eAction; }
  2072.     BOOL            IsLeaveWindow() const { return bLeave; }
  2073. };
  2074.  
  2075. #endif 
  2076.  
  2077. #ifndef _HELP_HXX
  2078. #define _HELP_HXX
  2079.  
  2080. #ifndef _SV_H
  2081. #endif
  2082.  
  2083. #define  HELP_INDEX          ((ULONG)0xFFFFFFFF)
  2084. #define  HELP_HELPONHELP     ((ULONG)0xFFFFFFFE)
  2085.  
  2086. class Help
  2087. {
  2088. private:
  2089.     String          aHelpFile;
  2090.  
  2091. public:
  2092.                     Help();
  2093.  
  2094.     BOOL            Start( ULONG nHelpId );
  2095.     BOOL            Start( const String& rKeyWord );
  2096.  
  2097.     void            SetHelpFile( const String& rFileName );
  2098.     String          GetHelpFile() const;
  2099.  
  2100.     static BOOL     EnableBalloonMode();
  2101.     static BOOL     DisableBalloonMode();
  2102.     static BOOL     IsBalloonModeEnabled();
  2103.     static BOOL     ShowBalloon( const Point& rScreenPos,
  2104.                                  const String& rHelpText );
  2105.     static BOOL     ShowBalloon( const Point& rScreenPos,
  2106.                                  const Rectangle& rScreenRect,
  2107.                                  const String& rHelpText );
  2108. };
  2109.  
  2110. #endif 
  2111. #ifndef RSC_COMPILER
  2112.  
  2113. #ifndef _APP_HXX
  2114. #define _APP_HXX
  2115.  
  2116. #ifndef _SV_H
  2117. #endif
  2118. #ifndef _GDIOBJ_HXX
  2119. #endif
  2120. #ifndef _EVENT_HXX
  2121. #endif
  2122. #ifndef _HELP_HXX
  2123. #endif
  2124.  
  2125. class ResId;
  2126. class MenuBar;
  2127. class Window;
  2128. class WorkWindow;
  2129. class Accelerator;
  2130.  
  2131. #define EXC_RSCNOTLOADED        0x0100
  2132. #define EXC_SYSOBJNOTCREATED    0x0200
  2133. #define EXC_SYSTEM                0x0300
  2134. #define EXC_USER                0x1000
  2135.  
  2136. #define INPUT_MOUSE             0x0001
  2137. #define INPUT_KEYBOARD          0x0002
  2138. #define INPUT_PAINT             0x0004
  2139. #define INPUT_TIMER             0x0008
  2140. #define INPUT_OTHER             0x0010
  2141. #define INPUT_MOUSEANDKEYBOARD  (INPUT_MOUSE | INPUT_KEYBOARD)
  2142. #define INPUT_ANY               (INPUT_MOUSEANDKEYBOARD | INPUT_PAINT | \
  2143.                                  INPUT_TIMER | INPUT_OTHER)
  2144.  
  2145. #define DISPATCH_OPEN           1
  2146. #define DISPATCH_PRINT          2
  2147.  
  2148. enum SysChangeType { CHANGE_FONTCOUNT, CHANGE_OTHER };
  2149.  
  2150. enum AccelType { ACCEL_STANDARD, ACCEL_ALWAYS };
  2151.  
  2152. class Application : public LinkHdl
  2153. {
  2154. protected:
  2155.     void            Execute();
  2156.     virtual BOOL    QueryExit();
  2157.  
  2158.     virtual void    SysChange( SysChangeType eChgType );
  2159.     virtual void    AppEvent( const ApplicationEvent& rAppEvent );
  2160.     virtual void    UserEvent( ULONG nEvent, void* pEventData );
  2161.  
  2162.     virtual void    ActivateExtHelp();
  2163.     virtual void    DeactivateExtHelp();
  2164.  
  2165. public:
  2166.                     Application();
  2167.                     ~Application();
  2168.  
  2169.     virtual void    Main( int nArgc, char* pArgv[] ) = 0;
  2170.  
  2171.     void            InitAppRes( const ResId& rResId );
  2172.  
  2173.     BOOL            IsInMain() const;
  2174.     BOOL            IsInExecute() const;
  2175.     BOOL            IsInModalMode() const;
  2176.  
  2177.     virtual void    Exception( short nError = 0 );
  2178.     void            Abort( const String& rErrorText );
  2179.  
  2180.     void            Quit();
  2181.     void            Reschedule();
  2182.     BOOL            AnyInput( USHORT nType = INPUT_ANY );
  2183.  
  2184.     USHORT          DispatchAppEvents( int nArgc, char* pArgv[] );
  2185.     void            PostUserEvent( ULONG nEvent, void* pEventData );
  2186.     BOOL            PostAppEvent( const String& rAppName,
  2187.                                   const String& rProcId,
  2188.                                   const String& rEventName,
  2189.                                   const String& rData );
  2190.  
  2191.     void            Wait( BOOL bWait = TRUE );
  2192.     BOOL            IsWait() const;
  2193.  
  2194.     BOOL            InsertIdleHdl( const Link& rLink, USHORT nPriority );
  2195.     void            RemoveIdleHdl( const Link& rLink );
  2196.  
  2197.     WorkWindow*     GetAppWindow() const;
  2198.  
  2199.     MenuBar*        ChangeAppMenu( MenuBar* pAppMenu = NULL );
  2200.     MenuBar*        GetAppMenu() const;
  2201.  
  2202.     Font            ChangeAppFont( const Font& rFont );
  2203.     Font            GetAppFont() const;
  2204.  
  2205.     International   ChangeAppInternational( const International& rIntn );
  2206.     International   GetAppInternational() const;
  2207.  
  2208.     String          ChangeAppName( const String& rUniqueName );
  2209.     String          GetAppName() const;
  2210.     String          GetAppFileName() const;
  2211.  
  2212.     void            EnableMenuAccel();
  2213.     void            DisableMenuAccel();
  2214.     BOOL            IsMenuAccelEnabled() const;
  2215.  
  2216.     BOOL            InsertAccel( Accelerator* pAccel,
  2217.                                  AccelType eType = ACCEL_STANDARD );
  2218.     void            RemoveAccel( Accelerator* pAccel );
  2219.     void            FlushAccel();
  2220.  
  2221.     Help*           ChangeHelp( Help* pHelp = NULL );
  2222.     Help*           GetHelp() const;
  2223.  
  2224.     void            EnableHelp( HelpMode eHelpMode );
  2225.     void            DisableHelp( HelpMode eHelpMode );
  2226.     BOOL            IsHelpEnabled( HelpMode eHelpMode ) const;
  2227.  
  2228.     void            EnableSVLook();
  2229.     void            DisableSVLook();
  2230.     BOOL            IsSVLookEnabled() const;
  2231. };
  2232.  
  2233. extern Application* pApp;    
  2234. Application* GetpApp();
  2235.  
  2236. #endif 
  2237.  
  2238. #ifndef _MDIAPP_HXX
  2239. #define _MDIAPP_HXX
  2240.  
  2241. #ifndef _SV_H
  2242. #endif
  2243. #ifndef _APP_HXX
  2244. #endif
  2245.  
  2246. class MDIWindow;
  2247. class PopupMenu;
  2248.  
  2249. class MDIApplication : public Application
  2250. {
  2251. public:
  2252.                    MDIApplication();
  2253.                    ~MDIApplication();
  2254.  
  2255.     virtual void   Main( int nArgc, char* pArgv[] ) = 0;
  2256.  
  2257.     void           Tile();
  2258.     void           Horizontal();
  2259.     void           Vertical();
  2260.     void           Cascade();
  2261.     void           Arrange();
  2262.  
  2263.     BOOL           CloseAll();
  2264.  
  2265.     MDIWindow*     ChangeActiveWindow( MDIWindow* pNewWindow );
  2266.     MDIWindow*     GetActiveWindow() const;
  2267.     MDIWindow*     ActivateNextWindow();
  2268.  
  2269.     USHORT         GetWindowCount() const;
  2270.     USHORT         GetVisibleWindowCount() const;
  2271.  
  2272.     PopupMenu*     ChangeMDIMenu( PopupMenu* pNewMenu );
  2273.     PopupMenu*     GetMDIMenu() const;
  2274. };
  2275.  
  2276. #endif 
  2277.  
  2278. #ifndef _TIMER_HXX
  2279. #define _TIMER_HXX
  2280.  
  2281. #ifndef _SV_H
  2282. #endif
  2283. #ifndef _TIMER_H
  2284. #endif
  2285.  
  2286. class Timer : public LinkHdl
  2287. {
  2288. private:
  2289.     Link            aTimeoutLinkHdl;
  2290.     ULONG           nTimeout;
  2291.     BOOL            bActive;
  2292.  
  2293. protected:
  2294.     ImpTimer        aImpTimer;
  2295.  
  2296.     virtual void    Timeout();
  2297.  
  2298. public:
  2299.                     Timer();
  2300.                     Timer( const Timer& rTimer );
  2301.                     ~Timer();
  2302.  
  2303.     void            Start();
  2304.     void            Stop();
  2305.  
  2306.     ULONG           ChangeTimeout( ULONG nTimeout );
  2307.     ULONG           GetTimeout() const { return nTimeout; }
  2308.     BOOL            IsActive() const { return bActive; }
  2309.  
  2310.     Link            ChangeTimeoutHdl( const Link& rLink );
  2311.     Link            GetTimeoutHdl() const { return aTimeoutLinkHdl; }
  2312.  
  2313.     Timer&          operator=( const Timer& rTimer );
  2314. };
  2315.  
  2316. inline Link Timer::ChangeTimeoutHdl( const Link& rNewLink )
  2317. {
  2318.     Link aOldLink = aTimeoutLinkHdl;
  2319.     aTimeoutLinkHdl = rNewLink;
  2320.     return aOldLink;
  2321. }
  2322.  
  2323. class AutoTimer : public Timer
  2324. {
  2325. public:
  2326.                 AutoTimer();
  2327.                 AutoTimer( const AutoTimer& rTimer );
  2328.  
  2329.     AutoTimer&  operator=( const AutoTimer& rTimer )
  2330.                     { Timer::operator=( rTimer ); return *this; }
  2331. };
  2332.  
  2333. #endif 
  2334.  
  2335. #ifndef _METRIC_HXX
  2336. #define _METRIC_HXX
  2337.  
  2338. #ifndef _SV_H
  2339. #endif
  2340.  
  2341. #ifndef _GDIOBJ_HXX
  2342. #endif
  2343.  
  2344. enum FontType { TYPE_DONTKNOW, TYPE_RASTER, TYPE_VECTOR, TYPE_SCALABLE };
  2345.  
  2346. class ImpFontMetric
  2347. {
  2348. public:
  2349.     USHORT          nRefCount;          
  2350.     Font            aFont;              
  2351.     FontType        eType;              
  2352.     BOOL            bDevice;            
  2353.     USHORT          nAscent;            
  2354.     USHORT          nDescent;           
  2355.     USHORT          nLeading;           
  2356.     short           nSlant;             
  2357.     char            cFirstChar;         
  2358.     char            cLastChar;          
  2359.  
  2360.     BOOL            IsEqual( const ImpFontMetric& rMetric ) const;
  2361. };
  2362.  
  2363. class FontMetric
  2364. {
  2365. protected:
  2366.     ImpFontMetric*  pImpMetric;    
  2367.  
  2368. public:
  2369.                     FontMetric();
  2370.                     FontMetric( const FontMetric& rMetric );
  2371.                     ~FontMetric();
  2372.  
  2373.     const Font&     GetPhysicalFont() const
  2374.                         { return pImpMetric->aFont; }
  2375.  
  2376.     FontType        GetType() const
  2377.                         { return pImpMetric->eType; }
  2378.     BOOL            IsDeviceFont() const
  2379.                         { return pImpMetric->bDevice; }
  2380.  
  2381.     USHORT          GetAscent() const
  2382.                         { return pImpMetric->nAscent; }
  2383.     USHORT          GetDescent() const
  2384.                         { return pImpMetric->nDescent; }
  2385.     USHORT          GetLeading() const
  2386.                         { return pImpMetric->nLeading; }
  2387.     short           GetSlant() const
  2388.                         { return pImpMetric->nSlant; }
  2389.  
  2390.     BOOL            ExistChar( char c ) const;
  2391.  
  2392.     FontMetric&     operator =( const FontMetric& rMetric );
  2393.     BOOL            operator ==( const FontMetric& rMetric ) const;
  2394.     BOOL            operator !=( const FontMetric& rMetric ) const;
  2395. };
  2396.  
  2397. #endif 
  2398.  
  2399. #ifndef _REGION_HXX
  2400. #define _REGION_HXX
  2401.  
  2402. #ifndef _SV_H
  2403. #endif
  2404.  
  2405. class ImpRegion;
  2406. class Polygon;
  2407. class PolyPolygon;
  2408.  
  2409. enum RegionType { REGION_EMPTY, REGION_RECTANGLE, REGION_POLYGON,
  2410.                   REGION_POLYPOLYGON, REGION_COMPLEX };
  2411.  
  2412. class Region
  2413. {
  2414. protected:
  2415.     ImpRegion*  pImpRegion;
  2416.  
  2417. public:
  2418.                 Region();
  2419.                 Region( const Rectangle& rRect );
  2420.                 Region( const Polygon& rPolygon );
  2421.                 Region( const PolyPolygon& rPolyPoly );
  2422.                 Region( const Region& rRegion );
  2423.                 ~Region();
  2424.  
  2425.     BOOL        IsEmpty() const;
  2426.     Rectangle   GetBoundRect() const;
  2427.  
  2428.     RegionType  GetType() const;
  2429.  
  2430.     void        Intersect( const Rectangle& rRect );
  2431.     void        Move( short nHorzMove, short nVertMove );
  2432.  
  2433.     Region&     operator=( const Region& rRegion );
  2434.     BOOL        operator==( const Region& rRegion ) const;
  2435.     BOOL        operator!=( const Region& rRegion ) const;
  2436. };
  2437.  
  2438. #endif  
  2439.  
  2440. #ifndef _OUTDEV_HXX
  2441. #define _OUTDEV_HXX
  2442.  
  2443. #ifndef _SV_H
  2444. #endif
  2445. #ifndef _RESID_HXX
  2446. #endif
  2447. #ifndef _RC_HXX
  2448. #endif
  2449. #ifndef _GDIOBJ_HXX
  2450. #endif
  2451. #ifndef _MAPMOD_HXX
  2452. #endif
  2453. #ifndef _OUTDEV_H
  2454. #endif
  2455. #ifndef _METRIC_HXX
  2456. #endif
  2457. #ifndef _REGION_HXX
  2458. #endif
  2459.  
  2460. class EnvStack;
  2461. class GDIMetaFile;
  2462. class Bitmap;
  2463. class Icon;
  2464. class Polygon;
  2465. class PolyPolygon;
  2466. class Region;
  2467.  
  2468. enum RasterOp { ROP_OVERPAINT, ROP_INVERT, ROP_AND, ROP_OR, ROP_XOR, ROP_NXOR };
  2469.  
  2470. enum OutDevType { OUTDEV_DONTKNOW, OUTDEV_WINDOW, OUTDEV_PRINTER,
  2471.                   OUTDEV_VIRDEV };
  2472.  
  2473. class OutputDevice : public Resource
  2474. {
  2475.     friend          ImpOutputDevice;
  2476.  
  2477. private:
  2478.                     OutputDevice( const OutputDevice& rOutDev );
  2479.     OutputDevice&   operator =( const OutputDevice& rOutDev );
  2480.  
  2481. protected:
  2482.     ImpOutputDevice aImpOPD;
  2483.     EnvStack*       pStack;
  2484.     GDIMetaFile*    pMetaFile;
  2485.     BOOL            bBlackHole;         
  2486.     Pen             aPen;
  2487.     Font            aFont;
  2488.     Brush           aBackBrush;
  2489.     Brush           aFillInBrush;
  2490.     MapMode         aMapMode;
  2491.     RasterOp        aRasterOp;
  2492.     BOOL            bMap;
  2493.     Region          aClipRegion;
  2494.     BOOL            bClipRegion;
  2495.     OutDevType      eOutDevType;
  2496.  
  2497.     void            ImpSelectClipRegion( BOOL bNewRegion );
  2498.  
  2499. #ifdef UNX
  2500.  
  2501.                     OutputDevice( const ResId & rResId, void ** ppClassRes );
  2502.  
  2503.                     OutputDevice( const void * );
  2504.  
  2505.     void            InitResource();
  2506. #endif
  2507.  
  2508.                     OutputDevice();
  2509.                     OutputDevice( const ResId& rResId );
  2510.  
  2511. public:
  2512.     virtual         ~OutputDevice();
  2513.  
  2514.     void            DrawText( const Point& rStartPt, const String& rStr,
  2515.                               USHORT nIndex = 0, USHORT nLen = STRING_LEN );
  2516.     void            DrawStretchText( const Point& rStartPt, USHORT nWidth,
  2517.                                      const String& rStr,
  2518.                                      USHORT nIndex = 0, USHORT nLen = STRING_LEN );
  2519.     void            DrawKernText( const Point& rStartPt, const String& rStr,
  2520.                                   USHORT nIndex = 0, USHORT nLen = STRING_LEN,
  2521.                                   short* pKernAry = NULL );
  2522.     Size            GetTextSize( const String& rStr, USHORT nIndex = 0,
  2523.                                  USHORT nLen = STRING_LEN ) const;
  2524.     Size            GetStretchTextSize( const String& rStr, USHORT nWidth,
  2525.                                         USHORT nPartIndex, USHORT nPartLen,
  2526.                                         USHORT nIndex = 0, USHORT nLen = STRING_LEN ) const;
  2527.     Size            GetKernTextSize( const String& rStr, USHORT nIndex = 0,
  2528.                                      USHORT nLen = STRING_LEN,
  2529.                                     short* pKernAry = NULL ) const;
  2530.  
  2531.     void            DrawPixel( const Point& rPt, const Color& rColor );
  2532.     void            DrawPoint( const Point& rPt );
  2533.     void            DrawLine( const Point& rStartPt, const Point& rEndPt );
  2534.     void            DrawRect( const Rectangle& rRect, USHORT nHorzRount = 0,
  2535.                               USHORT nVertRound = 0 );
  2536.     void            DrawEllipse( const Rectangle& rRect );
  2537.     void            DrawArc( const Rectangle& rRect, const Point& rStartPt,
  2538.                              const Point& rEndPt );
  2539.     void            DrawPie( const Rectangle& rRect, const Point& rStartPt,
  2540.                              const Point& rEndPt );
  2541.     void            DrawPolyLine( const Polygon& rPoly );
  2542.     void            DrawPolygon( const Polygon& rPoly );
  2543.     void            DrawPolyPolygon( const PolyPolygon& rPolyPoly );
  2544.     void            DrawOutDev( const Point& rDestPt, const Size& rDestSize,
  2545.                                 const Point& rSrcPt,  const Size& rSrcSize,
  2546.                                 const OutputDevice& rOutDev );
  2547.     void            DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap );
  2548.     void            DrawBitmap( const Point& rDestPt, const Size& rDestSize,
  2549.                                 const Bitmap& rBitmap );
  2550.     void            DrawIcon( const Point& rPoint, const Icon& rIcon );
  2551.  
  2552.     void            InvertRect( const Rectangle& rRect );
  2553.     void            HighlightRect( const Rectangle& rRect );
  2554.  
  2555.     Color           GetPixel( const Point& rPt ) const;
  2556.     Bitmap          GetBitmap( const Point& rSrcPt, const Size& rSize ) const;
  2557.  
  2558.     Region          ChangeClipRegion();
  2559.     Region          ChangeClipRegion( const Region& rRegion );
  2560.     Region          MoveClipRegion( short nHorzMove, short nVertMove );
  2561.     Region          IntersectClipRegion( const Rectangle& rRect );
  2562.     Region          GetClipRegion() const;
  2563.     BOOL            IsClipRegion() const { return bClipRegion; }
  2564.  
  2565.     Pen             ChangePen( const Pen& rNewPen );
  2566.     const Pen&      GetPen() const { return aPen; }
  2567.     Font            ChangeFont( const Font& rNewFont );
  2568.     const Font&     GetFont() const { return aFont; }
  2569.     Brush           ChangeBackgroundBrush( const Brush& rNewBrush );
  2570.     const Brush&    GetBackgroundBrush() const { return aBackBrush; }
  2571.     Brush           ChangeFillInBrush( const Brush& rNewBrush );
  2572.     const Brush&    GetFillInBrush() const { return aFillInBrush; }
  2573.  
  2574.     MapMode         ChangeMapMode( const MapMode& rNewMapMode );
  2575.     const MapMode&  GetMapMode() const { return aMapMode; }
  2576.  
  2577.     Point           LogicToPixel( const Point& rLogicPt ) const;
  2578.     Size            LogicToPixel( const Size& rLogicSize ) const;
  2579.     Rectangle       LogicToPixel( const Rectangle& rLogicRect ) const;
  2580.     Polygon         LogicToPixel( const Polygon& rLogicPoly ) const;
  2581.     PolyPolygon     LogicToPixel( const PolyPolygon& rLogicPolyPoly ) const;
  2582.     Region          LogicToPixel( const Region& rLogicRegion )const;
  2583.     Point           LogicToPixel( const Point& rLogicPt,
  2584.                                   const MapMode& rMapMode ) const;
  2585.     Size            LogicToPixel( const Size& rLogicSize,
  2586.                                   const MapMode& rMapMode ) const;
  2587.     Rectangle       LogicToPixel( const Rectangle& rLogicRect,
  2588.                                   const MapMode& rMapMode ) const;
  2589.     Polygon         LogicToPixel( const Polygon& rLogicPoly,
  2590.                                   const MapMode& rMapMode ) const;
  2591.     PolyPolygon     LogicToPixel( const PolyPolygon& rLogicPolyPoly,
  2592.                                   const MapMode& rMapMode ) const;
  2593.     Region          LogicToPixel( const Region& rLogicRegion,
  2594.                                   const MapMode& rMapMode ) const;
  2595.     Point           PixelToLogic( const Point& rDevicePt ) const;
  2596.     Size            PixelToLogic( const Size& rDeviceSize ) const;
  2597.     Rectangle       PixelToLogic( const Rectangle& rDeviceRect ) const;
  2598.     Polygon         PixelToLogic( const Polygon& rDevicePoly ) const;
  2599.     PolyPolygon     PixelToLogic( const PolyPolygon& rDevicePolyPoly ) const;
  2600.     Region          PixelToLogic( const Region& rDeviceRegion ) const;
  2601.     Point           PixelToLogic( const Point& rDevicePt,
  2602.                                   const MapMode& rMapMode ) const;
  2603.     Size            PixelToLogic( const Size& rDeviceSize,
  2604.                                   const MapMode& rMapMode ) const;
  2605.     Rectangle       PixelToLogic( const Rectangle& rDeviceRect,
  2606.                                   const MapMode& rMapMode ) const;
  2607.     Polygon         PixelToLogic( const Polygon& rDevicePoly,
  2608.                                   const MapMode& rMapMode ) const;
  2609.     PolyPolygon     PixelToLogic( const PolyPolygon& rDevicePolyPoly,
  2610.                                   const MapMode& rMapMode ) const;
  2611.     Region          PixelToLogic( const Region& rDeviceRegion,
  2612.                                   const MapMode& rMapMode ) const;
  2613.  
  2614.     RasterOp        ChangeRasterOp( RasterOp aNewROP );
  2615.     RasterOp        GetRasterOp() const { return aRasterOp; }
  2616.  
  2617.     Size            GetOutputSize() const;
  2618.     virtual Size    GetOutputSizePixel() const;
  2619.  
  2620.     USHORT          GetDevFontCount() const;
  2621.     Font            GetDevFont( USHORT nDevFont ) const;
  2622.  
  2623.     USHORT          GetDevFontSizeCount( const Font& rFont ) const;
  2624.     Size            GetDevFontSize( const Font& rFont, USHORT nSize ) const;
  2625.  
  2626.     FontMetric      GetFontMetric() const;
  2627.     FontMetric      GetFontMetric( const Font& rFont ) const;
  2628.  
  2629.     Color           GetSolidColor( const Color& rColor ) const;
  2630.     ULONG           GetColorCount() const;
  2631.  
  2632.     void            Push();
  2633.     void            Pop();
  2634.  
  2635.     OutDevType      GetOutDevType() const { return eOutDevType; }
  2636. };
  2637.  
  2638. LPoint LongLogicToPixel( OutputDevice* pOutDev, const LPoint& rLPt );
  2639. LPoint LongPixelToLogic( OutputDevice* pOutDev, const LPoint& rLPt );
  2640.  
  2641. #endif 
  2642.  
  2643. #ifndef _SYSTEM_HXX
  2644. #define _SYSTEM_HXX
  2645.  
  2646. #ifndef _SV_H
  2647. #endif
  2648. #ifndef _GDIOBJ_HXX
  2649. #endif
  2650.  
  2651. enum SystemType   { SYSTEM_DONTKNOW,
  2652.                     SYSTEM_PC,          SYSTEM_MAC,         SYSTEM_SUN,
  2653.                     SYSTEM_RS6000,      SYSTEM_ALPHA,       SYSTEM_ALPHAPC,
  2654.                     SYSTEM_HP9000,      SYSTEM_AVIION,      SYSTEM_VAX };
  2655. enum CPUType      { CPU_DONTKNOW,
  2656.                     CPU_I286,           CPU_I386,           CPU_I486,
  2657.                     CPU_PENTIUM,
  2658.                     CPU_M68000,         CPU_M68010,         CPU_M68020,
  2659.                     CPU_M68030,         CPU_M68040,         CPU_POWERPC,
  2660.                     CPU_SPARC,          CPU_IBMPOWER,       CPU_ALPHA,
  2661.                     CPU_HPRISC,         CPU_M88000,         CPU_VAX,
  2662.                     CPU_MIPS4000 };
  2663. enum GUIType      { GUI_DONTKNOW,
  2664.                     GUI_WINDOWS,        GUI_PM,             GUI_MAC,
  2665.                     GUI_MOTIF,          GUI_OPENWINDOWS,    GUI_WINDOWSNT };
  2666.  
  2667. class System
  2668. {
  2669. public:
  2670.     static  SystemType      GetSystemType();
  2671.     static  CPUType         GetCPUType();
  2672.     static  GUIType         GetGUIType();
  2673.     static  String          GetGUIVersion();
  2674.  
  2675.     static  Size            GetScreenSizePixel();
  2676.     static  USHORT          GetMenuBarHeightPixel();
  2677.  
  2678.     static  BOOL            HasMouse();
  2679.     static  USHORT          GetMouseButtonCount();
  2680.  
  2681.     static  Font            GetSystemFont();
  2682.     static  CharSet         GetCharSet()  { return ::GetSystemCharSet();  }
  2683.     static  LineEnd         GetLineEnd()  { return ::GetSystemLineEnd();  }
  2684.  
  2685.     static  LanguageType    GetLanguage() { return ::GetSystemLanguage(); }
  2686.     static  CountryType     GetCountry()  { return ::GetSystemCountry();  }
  2687.  
  2688.     static  USHORT          GetPrinterCount();
  2689.     static  String          GetDefaultPrinterName();
  2690.     static  String          GetPrinterName( USHORT nPrinter );
  2691.  
  2692.     static  String          GetUserName();
  2693.     static  ULONG           GetFreeMemory();
  2694. };
  2695.  
  2696. #endif 
  2697.  
  2698. #ifndef _VIRDEV_HXX
  2699. #define _VIRDEV_HXX
  2700.  
  2701. #ifndef _SV_H
  2702. #endif
  2703. #ifndef _OUTDEV_HXX
  2704. #endif
  2705. #ifndef _VIRDEV_H
  2706. #endif
  2707.  
  2708. class VirtualDevice : public OutputDevice
  2709. {
  2710. protected:
  2711.     ImpVirtDevice   aImpVD;    
  2712.  
  2713. public:
  2714.                     VirtualDevice();
  2715.                     VirtualDevice( const OutputDevice& rCompDev );
  2716.                     ~VirtualDevice();
  2717.  
  2718.     BOOL            SetOutputSize( const Size& rNewSize, BOOL bErase = TRUE );
  2719.     BOOL            SetOutputSizePixel( const Size& rNewSize,
  2720.                                         BOOL bErase = TRUE );
  2721.     Size            GetOutputSizePixel() const;
  2722. };
  2723.  
  2724. #endif 
  2725.  
  2726. #ifndef _PRINT_HXX
  2727. #define _PRINT_HXX
  2728.  
  2729. #ifndef _SV_H
  2730. #endif
  2731. #ifndef _OUTDEV_HXX
  2732. #endif
  2733. #ifndef _SYSTEM_HXX
  2734. #endif
  2735.  
  2736. class Timer;
  2737. class AutoTimer;
  2738. class ImpPageQueue;
  2739. struct PageMetaFile;
  2740.  
  2741. enum Quality        { QUALITY_PROOF, QUALITY_DRAFT };
  2742. enum Orientation    { ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE };
  2743. enum Paper          { PAPER_A3, PAPER_A4, PAPER_A5, PAPER_B4, PAPER_B5,
  2744.                       PAPER_LETTER, PAPER_LEGAL, PAPER_TABLOID, PAPER_USER };
  2745. enum PrinterSupport { SUPPORT_SET_ORIENTATION, SUPPORT_SET_QUALITY,
  2746.                       SUPPORT_SET_PAPERBIN };
  2747.  
  2748. #ifndef _IMPPRN_H
  2749. #endif
  2750.  
  2751. #define PAGEQUEUE_ALLPAGES   0xFFFF
  2752.  
  2753. #define PRINTER_OK               0
  2754. #define PRINTER_ABORT            1
  2755. #define PRINTER_OUTOFMEMORY      2
  2756. #define PRINTER_GENERALERROR     3
  2757.  
  2758. class JobSetup
  2759. {
  2760. public:
  2761.     USHORT  nLen;
  2762.     short   eGUIType;
  2763.     char    cPrinterName[64];
  2764.     char    cDeviceName[32];
  2765.     char    cPortName[32];
  2766.     char    cDriverName[32];
  2767.     char    cDriverData[1];
  2768.  
  2769.             JobSetup();
  2770.  
  2771.     BOOL    operator==( const JobSetup& rJobSetup ) const;
  2772.     BOOL    operator!=( const JobSetup& rJobSetup ) const;
  2773. };
  2774.  
  2775. class Printer : public OutputDevice
  2776. {
  2777. protected:
  2778.     ImpPrinter          aImpPRN;
  2779.     ImpPageQueue*       pPageQueue;
  2780.     PageMetaFile*       pActPage;
  2781.     JobSetup*           pActSetup;
  2782.     Printer*            pQueuePrinter;
  2783.     Printer*            pParentPrinter;
  2784.     String              aPrinterName;
  2785.     String              aDeviceName;
  2786.     String              aPortName;
  2787.     String              aDriverName;
  2788.     String              aJobName;
  2789.     JobSetup*           pJobSetup;
  2790.     Point               aPageOffset;
  2791.     Size                aOutputSize;
  2792.     Size                aPaperSize;
  2793.     Paper               ePaper;
  2794.     Quality             eQuality;
  2795.     Orientation         eOrientation;
  2796.     USHORT              nPaperBins;
  2797.     USHORT              nPaperBin;
  2798.     USHORT              nPageQueueSize;
  2799.     USHORT              nCurPage;
  2800.     USHORT              nCurPrintPage;
  2801.     USHORT              nError;
  2802.     USHORT              nCopy;
  2803.     BOOL                bSorted;
  2804.     BOOL                bQueueSema;
  2805.     BOOL                bQueuePrinter;
  2806.     BOOL                bJobActive;
  2807.     BOOL                bPrinting;
  2808.     BOOL                bDefPrinter;
  2809.     Link                aErrorHdlLink;
  2810.     Link                aStartPrintHdlLink;
  2811.     Link                aEndPrintHdlLink;
  2812.     Link                aPrintPageHdlLink;
  2813.  
  2814.     void                QueueStartPrintHdl( Printer* pPrinter );
  2815.     void                QueueEndPrintHdl( Printer* pPrinter );
  2816.     void                QueuePrintPageHdl( Printer* pPrinter );
  2817.     virtual void        InsertNewPage( PageMetaFile* pPage );
  2818.     void                PrintTask( Timer* pTimer );
  2819.     void                EndPrintTimerHdl( Timer* pTimer );
  2820.  
  2821.     virtual void        Error();
  2822.     virtual void        StartPrint();
  2823.     virtual void        EndPrint();
  2824.     virtual void        PrintPage();
  2825.  
  2826. public:
  2827.                         Printer();
  2828.                         Printer( const String& rPrinterName );
  2829.     virtual             ~Printer();
  2830.  
  2831.     const String&       GetName() const       { return aPrinterName; }
  2832.     const String&       GetDeviceName() const { return aDeviceName;  }
  2833.     const String&       GetPortName() const   { return aPortName;    }
  2834.     const String&       GetDriverName() const { return aDriverName;  }
  2835.     BOOL                IsValid() const
  2836.                             { return ((aPrinterName.Len() != 0) ? TRUE : FALSE); }
  2837.     BOOL                IsDefPrinter() const { return bDefPrinter; }
  2838.  
  2839.     BOOL                HasSupport( PrinterSupport eFeature,
  2840.                                     BOOL bInJob = FALSE );
  2841.  
  2842.     BOOL                Setup();
  2843.     USHORT              GetJobSetupSize() const;
  2844.     BOOL                SetJobSetup( JobSetup* pSetup );
  2845.     BOOL                GetJobSetup( JobSetup* pSetup );
  2846.  
  2847.     BOOL                SetCopyCount( USHORT nCopy, BOOL bSorted=FALSE );
  2848.     USHORT              GetCopyCount() const { return nCopy; }
  2849.     BOOL                IsSorted() const { return bSorted; }
  2850.     BOOL                SetQuality( Quality eQuality );
  2851.     Quality             GetQuality() const { return eQuality; }
  2852.  
  2853.     BOOL                SetOrientation( Orientation eOrient );
  2854.     Orientation         GetOrientation() const { return eOrientation; }
  2855.  
  2856.     USHORT              GetPaperBinCount() const { return nPaperBins; }
  2857.     String              GetPaperBinName( USHORT nPaperBin ) const;
  2858.     USHORT              GetPaperBin() const { return nPaperBin; }
  2859.     BOOL                SetPaperBin( USHORT nPaperBin );
  2860.  
  2861.     Paper               GetPaper() const { return ePaper; }
  2862.     Size                GetPaperSize() const { return PixelToLogic( aPaperSize ); }
  2863.     Size                GetPaperSizePixel() const { return aPaperSize; }
  2864.     Point               GetPageOffset() const { return PixelToLogic( aPageOffset ); }
  2865.     Point               GetPageOffsetPixel() const { return aPageOffset; }
  2866.     Size                GetOutputSizePixel() const;
  2867.  
  2868.     virtual void        SetPageQueueSize( USHORT nPages );
  2869.     USHORT              GetPageQueueSize() const { return nPageQueueSize; }
  2870.  
  2871.     BOOL                StartJob( const String& rJobName );
  2872.     BOOL                EndJob();
  2873.     BOOL                AbortJob();
  2874.     String              GetCurJobName() const { return aJobName; }
  2875.     USHORT              GetCurPage() const { return nCurPage; }
  2876.     BOOL                IsJobActive() const { return bJobActive; }
  2877.     BOOL                StartPage();
  2878.     BOOL                EndPage();
  2879.  
  2880.     Link                ChangeErrorHdl( const Link& rLink );
  2881.     Link                GetErrorHdl() const { return aErrorHdlLink; }
  2882.  
  2883.     USHORT              GetErrorCode() const { return nError; }
  2884.  
  2885.     Link                ChangeStartPrintHdl( const Link& rLink );
  2886.     Link                GetStartPrintHdl() const { return aStartPrintHdlLink; }
  2887.     Link                ChangeEndPrintHdl( const Link& rLink );
  2888.     Link                GetEndPrintHdl() const   { return aEndPrintHdlLink;   }
  2889.     BOOL                IsPrinting() const { return bPrinting; }
  2890.     Link                ChangePrintPageHdl( const Link& rLink );
  2891.     Link                GetPrintPageHdl() const  { return aPrintPageHdlLink;  }
  2892.  
  2893.     USHORT              GetCurPrintPage() const { return nCurPrintPage; }
  2894.  
  2895.     BOOL                SetPrinterProps( const Printer* pPrinter );
  2896. };
  2897.  
  2898. inline Link Printer::ChangeErrorHdl( const Link& rLink )
  2899. {
  2900.     Link aOldLink = aErrorHdlLink;
  2901.     aErrorHdlLink = rLink;
  2902.     return aOldLink;
  2903. }
  2904.  
  2905. inline Link Printer::ChangeStartPrintHdl( const Link& rLink )
  2906. {
  2907.     Link aOldLink = aStartPrintHdlLink;
  2908.     aStartPrintHdlLink = rLink;
  2909.     return aOldLink;
  2910. }
  2911.  
  2912. inline Link Printer::ChangeEndPrintHdl( const Link& rLink )
  2913. {
  2914.     Link aOldLink = aEndPrintHdlLink;
  2915.     aEndPrintHdlLink = rLink;
  2916.     return aOldLink;
  2917. }
  2918.  
  2919. inline Link Printer::ChangePrintPageHdl( const Link& rLink )
  2920. {
  2921.     Link aOldLink = aPrintPageHdlLink;
  2922.     aPrintPageHdlLink = rLink;
  2923.     return aOldLink;
  2924. }
  2925.  
  2926. #endif 
  2927. #ifndef SV_NOWINDOW
  2928.  
  2929. #ifndef _WINDOW_HXX
  2930. #define _WINDOW_HXX
  2931.  
  2932. #ifndef _SV_H
  2933. #endif
  2934. #ifndef _WINBIT_HXX
  2935. #endif
  2936. #ifndef _RESID_HXX
  2937. #endif
  2938. #ifndef _OUTDEV_HXX
  2939. #endif
  2940. #ifndef _EVENT_HXX
  2941. #endif
  2942. #ifndef _WINDOW_H
  2943. #endif
  2944.  
  2945. class Cursor;
  2946. class Pointer;
  2947. class MouseEvent;
  2948. class KeyEvent;
  2949. class HelpEvent;
  2950. class ResOwner;
  2951. class DropEvent;
  2952.  
  2953. #define DRAG_MOVEABLE        0x0001
  2954. #define DRAG_COPYABLE         0x0002
  2955. #define DRAG_PRINTABLE         0x0004
  2956. #define DRAG_DISCARDABLE     0x0008
  2957. #define DRAG_ALL             0x000F
  2958.  
  2959. #define DRAG_DEF_COPYABLE    0x0020
  2960.  
  2961. class Window : public OutputDevice
  2962. {
  2963. private:
  2964.     ResOwner*       pAutoResObject;
  2965.  
  2966. protected:
  2967.     ImpWindow       aImpWnd;
  2968.  
  2969.                     Window( RESOURCE_TYPE nTyp, Window* pParent,
  2970.                             WinBits nWinStyle );
  2971.  
  2972.     virtual void    MouseMove( const MouseEvent& rMEvt );
  2973.     virtual void    MouseButtonDown( const MouseEvent& rMEvt );
  2974.     virtual void    MouseButtonUp( const MouseEvent& rMEvt );
  2975.     virtual void    KeyInput( const KeyEvent& rKEvent );
  2976.     virtual void    Paint( const Rectangle& rRect );
  2977.     virtual void    Resize();
  2978.     virtual void    Move();
  2979.     virtual void    GetFocus();
  2980.     virtual void    LoseFocus();
  2981.     virtual void    RequestHelp( const HelpEvent& rHEvt );
  2982.     virtual BOOL    Drop( const DropEvent& rEvt );
  2983.     virtual BOOL    QueryDrop( const DropEvent& rEvt );
  2984.  
  2985. public:
  2986.                     Window( Window* pParent, WinBits nWinStyle = 0 );
  2987.                     Window( Window* pParent, const ResId& rResId );
  2988.                     ~Window();
  2989.  
  2990.     Window*         ChangeParent( Window* pNewParent );
  2991.     Window*         GetParent() const;
  2992.  
  2993.     void            Show();
  2994.     void            Hide();
  2995.     BOOL            IsVisible() const;
  2996.  
  2997.     void            Enable();
  2998.     void            Disable();
  2999.     BOOL            IsEnabled() const;
  3000.  
  3001.     void            ToTop();
  3002.     Point           ChangePosPixel( const Point& rNewPos );
  3003.     Point           GetPosPixel() const;
  3004.     Size            ChangeSizePixel( const Size& rNewSize );
  3005.     Size            GetSizePixel() const;
  3006.     void            SetPosSizePixel( const Point& rNewPos,
  3007.                                      const Size& rNewSize );
  3008.  
  3009.     void            SetPosSize( const Point& rNewPos,
  3010.                                 const Size& rNewSize );
  3011.     Size            ChangeOutputSizePixel( const Size& rNewSize );
  3012.     Size            GetOutputSizePixel() const;
  3013.  
  3014.     Point           OutputToScreenPixel( const Point& rPt ) const;
  3015.     Point           ScreenToOutputPixel( const Point& rPt ) const;
  3016.  
  3017.     void            CaptureMouse();
  3018.     void            ReleaseMouse();
  3019.  
  3020.     void            GrabFocus();
  3021.     BOOL            HasFocus() const;
  3022.  
  3023.     void            Scroll( short nHorzScroll, short nVertScroll );
  3024.     void            Scroll( short nHorzScroll, short nVertScroll,
  3025.                             const Rectangle& rRect );
  3026.     void            Invalidate();
  3027.     void            Invalidate( const Rectangle& rRect );
  3028.     void            InvalidateForeground();
  3029.     void            InvalidateForeground( const Rectangle& rRect );
  3030.     void            Update();
  3031.     void            Flash();
  3032.  
  3033.     BOOL            ChangeUpdateMode( BOOL bUpdate );
  3034.     BOOL            GetUpdateMode() const;
  3035.  
  3036.     void            SetText( const String& rStr );
  3037.     String          GetText() const;
  3038.  
  3039.     Pointer         ChangePointer( const Pointer& rPointer );
  3040.     Pointer         GetPointer() const;
  3041.  
  3042.     Cursor*         ChangeCursor( Cursor* pCursor );
  3043.     Cursor*         GetCursor() const;
  3044.  
  3045.     void            SetHelpText( const String& rStr );
  3046.     String          GetHelpText() const;
  3047.  
  3048.     ULONG           ChangeHelpId( ULONG nHelpId );
  3049.     ULONG           GetHelpId() const;
  3050.  
  3051.     BOOL            IsSVLook() const;
  3052.  
  3053.     void            EnableDrop( BOOL bDrop = TRUE );
  3054.     BOOL            IsDropEnabled() const;
  3055.  
  3056.     DropAction      ExecuteDrag( const Pointer& rMovePtr,
  3057.                                  const Pointer& rCopyPtr,
  3058.                                        USHORT   nOptions = DRAG_ALL,
  3059.                                  const Region* pDropRegion = NULL );
  3060. };
  3061.  
  3062. #endif 
  3063.  
  3064. #ifndef _SYSWIN_HXX
  3065. #define _SYSWIN_HXX
  3066.  
  3067. #ifndef _SV_H
  3068. #endif
  3069. #ifndef _WINDOW_HXX
  3070. #endif
  3071. #ifndef _PAL_HXX
  3072. #endif
  3073. #ifndef _SYSWIN_H
  3074. #endif
  3075.  
  3076. class SystemWindow : public Window
  3077. {
  3078. protected:
  3079.    ImpSysWin        aImpSysWnd;
  3080.    Palette          aPalette;
  3081.  
  3082.                     SystemWindow( RESOURCE_TYPE nTyp, Window* pParent,
  3083.                                   WinBits nWinStyle );
  3084.  
  3085.                     SystemWindow( Window* pParent, const ResId& rResId );
  3086.  
  3087.     virtual void    Activate();
  3088.     virtual void    Deactivate();
  3089.  
  3090. public:
  3091.                     ~SystemWindow();
  3092.  
  3093.     virtual BOOL    Close();
  3094.  
  3095.     BOOL            IsActive() const;
  3096.  
  3097.     void            AnimatePalette( USHORT nStart, const Palette& rPal );
  3098.     Palette         ChangePalette( const Palette& rPal );
  3099.     const Palette&  GetPalette() const { return aPalette; }
  3100. };
  3101.  
  3102. #endif 
  3103.  
  3104. #ifndef _WRKWIN_HXX
  3105. #define _WRKWIN_HXX
  3106.  
  3107. #ifndef _SV_H
  3108. #endif
  3109. #ifndef _SYSWIN_HXX
  3110. #endif
  3111. #ifndef _WRKWIN_H
  3112. #endif
  3113.  
  3114. class Icon;
  3115.  
  3116. class WorkWindow : public SystemWindow
  3117. {
  3118. protected:
  3119.     ImpWorkWin  aImpWork;
  3120.  
  3121.                 WorkWindow( RESOURCE_TYPE nTyp, Window* pParent,
  3122.                             WinBits nWinStyle );
  3123.  
  3124. public:
  3125.                 WorkWindow( Window* pParent, WinBits nWinStyle = WB_STDWORK );
  3126.                 WorkWindow( Window* pParent, const ResId& rResId );
  3127.                 ~WorkWindow();
  3128.  
  3129.     void        Minimize();
  3130.     void        Maximize();
  3131.     void        Restore();
  3132.  
  3133.     BOOL        IsMinimized() const;
  3134.     BOOL        IsMaximized() const;
  3135.  
  3136.     Icon        ChangeIcon( const Icon& rNewIcon );
  3137.     Icon        GetIcon() const;
  3138.  
  3139.     Size        ChangeMinOutputSizePixel( const Size& rSize );
  3140.     Size        GetMinOutputSizePixel() const;
  3141.  
  3142.     Size        ChangeOptOutputSizePixel( const Size& rSize );
  3143.     Size        GetOptOutputSizePixel() const;
  3144. };
  3145.  
  3146. #endif 
  3147.  
  3148. #ifndef _MDIWIN_HXX
  3149. #define _MDIWIN_HXX
  3150.  
  3151. #ifndef _SV_H
  3152. #endif
  3153. #ifndef _WRKWIN_HXX
  3154. #endif
  3155. #ifndef _MDIWIN_H
  3156. #endif
  3157.  
  3158. class MDIWindow : public WorkWindow
  3159. {
  3160. protected:
  3161.     ImpMDIWin   aImpMDI;  
  3162.  
  3163. public:
  3164.                 MDIWindow( WorkWindow* pParent, WinBits nWinStyle = WB_STDMDI );
  3165.                 MDIWindow( WorkWindow* pParent, const ResId& rResId );
  3166.                 ~MDIWindow();
  3167.  
  3168.     BOOL        IsMDIActivate();
  3169. };
  3170.  
  3171. #endif 
  3172.  
  3173. #ifndef _FLOATWIN_HXX
  3174. #define _FLOATWIN_HXX
  3175.  
  3176. #ifndef _SV_H
  3177. #endif
  3178. #ifndef _SYSWIN_HXX
  3179. #endif
  3180. #ifndef _FLOATWIN_H
  3181. #endif
  3182.  
  3183. class FloatingWindow : public SystemWindow
  3184. {
  3185. protected:
  3186.     ImpFloatWin     aImpFltWin;         
  3187.  
  3188.     virtual void    Zoom();
  3189.  
  3190. public:
  3191.                     FloatingWindow( Window* pParent, WinBits nWinStyle = WB_STDFLOATWIN );
  3192.                     FloatingWindow( Window* pParent, const ResId& rResId );
  3193.                     ~FloatingWindow();
  3194.  
  3195.     void            ZoomIn();
  3196.     void            ZoomOut();
  3197.     BOOL            IsZoomedIn() const;
  3198.  
  3199.     Size            ChangeZoomInOutputSizePixel( const Size& rSize );
  3200.     Size            GetZoomInOutputSizePixel() const;
  3201. };
  3202.  
  3203. #endif 
  3204. #ifndef SV_NOCONTROL
  3205.  
  3206. #ifndef _CTRL_HXX
  3207. #define _CTRL_HXX
  3208.  
  3209. #ifndef _SV_H
  3210. #endif
  3211. #ifndef _WINDOW_HXX
  3212. #endif
  3213. #ifndef _CTRL_H
  3214. #endif
  3215.  
  3216. class Control : public Window
  3217. {
  3218. private:
  3219.     Link        aGetFcHdlLink;      
  3220.     Link        aLosFcHdlLink;      
  3221.  
  3222. protected:
  3223.     ImpControl  aImpCtrl;
  3224.  
  3225.                 Control( RESOURCE_TYPE nTyp, Window* pParent,
  3226.                          WinBits nWinStyle );
  3227.  
  3228.     void        GetFocus();
  3229.     void        LoseFocus();
  3230.  
  3231. public:
  3232.                 Control( Window* pWindow, WinBits nWinStyle = 0 );
  3233.                 Control( Window* pWindow, const ResId& rResId );
  3234.                 ~Control();
  3235.  
  3236.     void        ShowFocus( const Rectangle& rRect );
  3237.     void        HideFocus();
  3238.  
  3239.     void        DrawCtrlText( const Point& rPoint, const String& rStr,
  3240.                               USHORT nIndex = 0, USHORT nLen = STRING_LEN,
  3241.                               BOOL bDisable = FALSE );
  3242.     Size        GetCtrlTextSize( const String& rStr, USHORT nIndex = 0,
  3243.                                  USHORT nLen = STRING_LEN ) const;
  3244.  
  3245.     Link        ChangeGetFocusHdl( const Link& rLink );
  3246.     Link        GetGetFocusHdl() const   { return aGetFcHdlLink; }
  3247.     Link        ChangeLoseFocusHdl( const Link& rLink );
  3248.     Link        GetLoseFocusHdl() const { return aLosFcHdlLink; }
  3249. };
  3250.  
  3251. inline Link Control::ChangeGetFocusHdl( const Link& rLink )
  3252. {
  3253.     Link aOldLink = aGetFcHdlLink;
  3254.     aGetFcHdlLink = rLink;
  3255.     return aOldLink;
  3256. }
  3257.  
  3258. inline Link Control::ChangeLoseFocusHdl( const Link& rLink )
  3259. {
  3260.     Link aOldLink = aLosFcHdlLink;
  3261.     aLosFcHdlLink = rLink;
  3262.     return aOldLink;
  3263. }
  3264.  
  3265. #endif  
  3266.  
  3267. #ifndef _SCRBAR_HXX
  3268. #define _SCRBAR_HXX
  3269.  
  3270. #ifndef _SV_H
  3271. #endif
  3272. #ifndef _CTRL_HXX
  3273. #endif
  3274. #ifndef _SCRBAR_H
  3275. #endif
  3276.  
  3277. class ScrollBar : public Control
  3278. {
  3279. private:
  3280.     ImpScrBar       aImpScrBar;
  3281.     Link            aScrollHdlLink;
  3282.     Link            aEndScrollHdlLink;
  3283.  
  3284. public:
  3285.                     ScrollBar( Window* pParent, WinBits nWinStyle = WB_VSCROLL );
  3286.                     ScrollBar( Window* pParent, const ResId& rResId );
  3287.                     ~ScrollBar();
  3288.  
  3289.     virtual void    Scroll();
  3290.     virtual void    EndScroll();
  3291.  
  3292. public:
  3293.     Range           ChangeRange( const Range& rRange );
  3294.     Range           GetRange() const;
  3295.     short           ChangeThumbPos( short nThumbPos );
  3296.     short           GetThumbPos() const;
  3297.     short           ChangeLineSize( short nNewSize );
  3298.     short           GetLineSize() const;
  3299.     short           ChangePageSize( short nNewSize );
  3300.     short           GetPageSize() const;
  3301.     USHORT          ChangeVisibleSize( USHORT nNewSize );
  3302.     USHORT          GetVisibleSize() const;
  3303.  
  3304.     short           GetDelta() const;
  3305.     ScrollType      GetType() const;
  3306.  
  3307.     Link            ChangeScrollHdl( const Link& rLink );
  3308.     Link            GetScrollHdl() const        { return aScrollHdlLink;    }
  3309.     Link            ChangeEndScrollHdl( const Link& rLink );
  3310.     Link            GetEndScrollHdl() const     { return aEndScrollHdlLink; }
  3311. };
  3312.  
  3313. inline Link ScrollBar::ChangeScrollHdl( const Link& rLink )
  3314. {
  3315.     Link aOldLink = aScrollHdlLink;
  3316.     aScrollHdlLink = rLink;
  3317.     return aOldLink;
  3318. }
  3319.  
  3320. inline Link ScrollBar::ChangeEndScrollHdl( const Link& rLink )
  3321. {
  3322.     Link aOldLink = aEndScrollHdlLink;
  3323.     aEndScrollHdlLink = rLink;
  3324.     return aOldLink;
  3325. }
  3326.  
  3327. #endif 
  3328.  
  3329. #ifndef _BUTTON_HXX
  3330. #define _BUTTON_HXX
  3331.  
  3332. #ifndef _SV_H
  3333. #endif
  3334. #ifndef _CTRL_HXX
  3335. #endif
  3336. #ifndef _BUTTON_H
  3337. #endif
  3338.  
  3339. class Button : public Control
  3340. {
  3341. private:
  3342.     Link            aClkHdlLink;        
  3343.  
  3344. protected:
  3345.  
  3346.                     Button( RESOURCE_TYPE nTyp, Window* pParent,
  3347.                             WinBits nWinStyle );
  3348.  
  3349.     virtual void    Click();
  3350.  
  3351. public:
  3352.                     Button( Window* pParent, WinBits nWinStyle = 0 );
  3353.                     Button( Window* pParent, const ResId& rResId );
  3354.                     ~Button();
  3355.  
  3356.     Link            ChangeClickHdl( const Link& rLink );
  3357.     Link            GetClickHdl() const { return aClkHdlLink; }
  3358. };
  3359.  
  3360. inline Link Button::ChangeClickHdl( const Link& rLink )
  3361. {
  3362.     Link aOldLink = aClkHdlLink;
  3363.     aClkHdlLink = rLink;
  3364.     return aOldLink;
  3365. }
  3366.  
  3367. class PushButton : public Button
  3368. {
  3369. protected:
  3370.  
  3371.             PushButton( RESOURCE_TYPE nTyp, Window* pParent,
  3372.                         WinBits nWinStyle );
  3373.  
  3374. public:
  3375.             PushButton( Window* pParent, WinBits nWinStyle = 0 );
  3376.             PushButton( Window* pParent, const ResId& rResId );
  3377. };
  3378.  
  3379. class OKButton : public PushButton
  3380. {
  3381. protected:
  3382.     virtual void    Click();
  3383.  
  3384. public:
  3385.                     OKButton( Window* pParent,
  3386.                               WinBits nWinStyle = WB_DEFBUTTON );
  3387.                     OKButton( Window* pParent, const ResId& rResId );
  3388. };
  3389.  
  3390. class CancelButton : public PushButton
  3391. {
  3392. protected:
  3393.     virtual void    Click();
  3394.  
  3395. public:
  3396.                     CancelButton( Window* pParent, WinBits nWinStyle = 0 );
  3397.                     CancelButton( Window* pParent, const ResId& rResId );
  3398. };
  3399.  
  3400. class HelpButton : public PushButton
  3401. {
  3402. protected:
  3403.     virtual void    Click();
  3404.  
  3405. public:
  3406.                     HelpButton( Window* pParent, WinBits nWinStyle = 0 );
  3407.                     HelpButton( Window* pParent, const ResId& rResId );
  3408. };
  3409.  
  3410. class RadioButton : public Button
  3411. {
  3412. private:
  3413.     BOOL    bSaveValue;
  3414.  
  3415. public:
  3416.             RadioButton( Window* pParent, WinBits nWinStyle = 0 );
  3417.             RadioButton( Window* pParent, const ResId& rResId );
  3418.  
  3419.     void    Check( BOOL bCheck = TRUE );
  3420.     BOOL    IsChecked() const;
  3421.  
  3422.     void    SaveValue() { bSaveValue = IsChecked(); }
  3423.     BOOL    GetSavedValue() const { return bSaveValue; }
  3424. };
  3425.  
  3426. class CheckBox : public Button
  3427. {
  3428. private:
  3429.     BOOL    bSaveValue;
  3430.  
  3431. public:
  3432.             CheckBox( Window* pParent, WinBits nWinStyle = 0 );
  3433.             CheckBox( Window* pParent, const ResId& rResId );
  3434.  
  3435.     void    Check( BOOL bCheck = TRUE );
  3436.     BOOL    IsChecked() const;
  3437.  
  3438.     void    SaveValue() { bSaveValue = IsChecked(); }
  3439.     BOOL    GetSavedValue() const { return bSaveValue; }
  3440. };
  3441.  
  3442. class TriStateBox : public Button
  3443. {
  3444. private:
  3445.     TriState    eSaveValue;
  3446.  
  3447. protected:
  3448.     ImpTriBox   aImpTriBox;
  3449.  
  3450. public:
  3451.                 TriStateBox( Window* pParent, WinBits nWinStyle = 0 );
  3452.                 TriStateBox( Window* pParent, const ResId& rResId );
  3453.  
  3454.     TriState    ChangeState( TriState aState );
  3455.     TriState    GetState() const;
  3456.  
  3457.     void        EnableTriState( BOOL bTriState = TRUE );
  3458.     BOOL        IsTriStateEnabled() const;
  3459.  
  3460.     void        SaveValue() { eSaveValue = GetState(); }
  3461.     TriState    GetSavedValue() const { return eSaveValue; }
  3462. };
  3463.  
  3464. #endif  
  3465.  
  3466. #ifndef _MENUBTN_HXX
  3467. #define _MENUBTN_HXX
  3468.  
  3469. #ifndef _SV_H
  3470. #endif
  3471. #ifndef _CTRL_HXX
  3472. #endif
  3473.  
  3474. class PopupMenu;
  3475.  
  3476. class MenuButton : public Control
  3477. {
  3478. private:
  3479.     PopupMenu*      pOwnMenu;
  3480.     PopupMenu*      pMenu;
  3481.     Link            aSelectHdlLink;
  3482.     USHORT          nCurItemId;
  3483.  
  3484. protected:
  3485.  
  3486.                     MenuButton( RESOURCE_TYPE nTyp, Window* pParent,
  3487.                                 WinBits nWinStyle = 0 );
  3488.  
  3489.     virtual void    Select();
  3490.  
  3491. public:
  3492.                     MenuButton( Window* pParent, WinBits nWinStyle = 0 );
  3493.                     MenuButton( Window* pParent, const ResId& rResId );
  3494.                     ~MenuButton();
  3495.  
  3496.     PopupMenu*      ChangePopupMenu( PopupMenu* pNewMenu );
  3497.     PopupMenu*      GetPopupMenu() const { return pMenu; }
  3498.  
  3499.     USHORT          GetCurItemId() const { return nCurItemId; }
  3500.  
  3501.     Link            ChangeSelectHdl( const Link& rLink );
  3502.     Link            GetSelectHdl() const { return aSelectHdlLink; }
  3503. };
  3504.  
  3505. inline Link MenuButton::ChangeSelectHdl( const Link& rLink )
  3506. {
  3507.     Link aOldLink = aSelectHdlLink;
  3508.     aSelectHdlLink = rLink;
  3509.     return aOldLink;
  3510. }
  3511.  
  3512. #endif  
  3513.  
  3514. #ifndef _SYMBTN_HXX
  3515. #define _SYMBTN_HXX
  3516.  
  3517. #ifndef _SV_H
  3518. #endif
  3519. #ifndef _BITMAP_HXX
  3520. #endif
  3521. #ifndef _BUTTON_HXX
  3522. #endif
  3523. #ifndef _SYMBTN_H
  3524. #endif
  3525.  
  3526. class SymbolButton : public PushButton
  3527. {
  3528. private:
  3529.     SymbolType      eSymbol;
  3530.     ImpSymBtn       aImpSymBtn;
  3531.  
  3532. public:
  3533.                     SymbolButton( Window* pParent, WinBits nWinStyle = 0 );
  3534.                     SymbolButton( Window* pParent, const ResId& rResId );
  3535.                     ~SymbolButton();
  3536.  
  3537.     SymbolType      ChangeSymbol( SymbolType eNewSymbol );
  3538.     SymbolType      GetSymbol() const { return eSymbol; }
  3539. };
  3540.  
  3541. class BitmapButton : public PushButton
  3542. {
  3543. private:
  3544.     Bitmap          aBmp;
  3545.     ImpBmpBtn       aImpBmpBtn;
  3546.  
  3547. public:
  3548.                     BitmapButton( Window* pParent, WinBits nWinStyle = 0 );
  3549.                     BitmapButton( Window* pParent, const ResId& rResId );
  3550.                     ~BitmapButton();
  3551.  
  3552.     Bitmap          ChangeBitmap( const Bitmap& rBitmap );
  3553.     const Bitmap&   GetBitmap() const { return aBmp; }
  3554. };
  3555.  
  3556. #endif  
  3557.  
  3558. #ifndef _FIXED_HXX
  3559. #define _FIXED_HXX
  3560.  
  3561. #ifndef _SV_H
  3562. #endif
  3563. #ifndef _CTRL_HXX
  3564. #endif
  3565. #ifndef _BITMAP_HXX
  3566. #endif
  3567. #ifndef _ICON_HXX
  3568. #endif
  3569.  
  3570. class FixedText : public Control
  3571. {
  3572. public:
  3573.                     FixedText( Window* pParent, WinBits nWinStyle = WB_LEFT );
  3574.                     FixedText( Window* pParent, const ResId& rResId );
  3575.                     ~FixedText();
  3576. };
  3577.  
  3578. class FixedBitmap : public Control
  3579. {
  3580. private:
  3581.     Bitmap          aBmp;
  3582.  
  3583. protected:
  3584.     virtual void    Paint( const Rectangle& );
  3585.     virtual void    Resize();
  3586.  
  3587. public:
  3588.                     FixedBitmap( Window* pParent, WinBits nWinStyle = 0 );
  3589.                     FixedBitmap( Window* pParent, const ResId& rResId );
  3590.  
  3591.     Bitmap          ChangeBitmap( const Bitmap& rBitmap );
  3592.     const Bitmap&   GetBitmap() const { return aBmp; }
  3593. };
  3594.  
  3595. class FixedIcon : public Control
  3596. {
  3597. private:
  3598.     Icon            aIcon;
  3599.  
  3600. protected:
  3601.     virtual void    Paint( const Rectangle& );
  3602.     virtual void    Resize();
  3603.  
  3604. public:
  3605.                     FixedIcon( Window* pParent, WinBits nWinStyle = 0 );
  3606.                     FixedIcon( Window* pParent, const ResId& rResId );
  3607.  
  3608.     Icon            ChangeIcon( const Icon& rIcon );
  3609.     const Icon&     GetIcon() const { return aIcon; }
  3610. };
  3611.  
  3612. #endif 
  3613.  
  3614. #ifndef _GROUP_HXX
  3615. #define _GROUP_HXX
  3616.  
  3617. #ifndef _SV_H
  3618. #endif
  3619. #ifndef _CTRL_HXX
  3620. #endif
  3621.  
  3622. class GroupBox : public Control
  3623. {
  3624. public:
  3625.          GroupBox( Window* pParent );
  3626.          GroupBox( Window* pParent, const ResId& rResId );
  3627.          ~GroupBox();
  3628. };
  3629.  
  3630. #endif 
  3631.  
  3632. #ifndef _EDIT_HXX
  3633. #define _EDIT_HXX
  3634.  
  3635. #ifndef _SV_H
  3636. #endif
  3637. #ifndef _CTRL_HXX
  3638. #endif
  3639. #ifndef _EDIT_H
  3640. #endif
  3641.  
  3642. #define EDIT_NOLIMIT    0xFFFF
  3643.  
  3644. class Edit : public Control
  3645. {
  3646. private:
  3647.     ImpEdit         aImpEdit;           
  3648.     String          aSaveValue;
  3649.  
  3650.     Link            aModifyHdlLink;     
  3651.  
  3652. protected:
  3653.  
  3654.                     Edit( RESOURCE_TYPE nTyp, Window* pParent, WinBits nWinStyle );
  3655.  
  3656.     virtual void    Modify();
  3657.  
  3658. public:
  3659.                     Edit( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER );
  3660.                     Edit( Window* pParent, const ResId& rResId );
  3661.                     ~Edit();
  3662.  
  3663.     void            ClearModifyFlag();
  3664.     BOOL            IsModified() const;
  3665.  
  3666.     USHORT          ChangeMaxTextLen( USHORT nMaxLen = EDIT_NOLIMIT );
  3667.     USHORT          GetMaxTextLen() const;
  3668.  
  3669.     Selection       ChangeSelection( const Selection& rSelection );
  3670.     Selection       GetSelection() const;
  3671.  
  3672.     void            ReplaceSelected( const String& rStr );
  3673.     void            DeleteSelected();
  3674.     String          GetSelected() const;
  3675.  
  3676.     void            Cut();
  3677.     void            Copy();
  3678.     void            Paste();
  3679.  
  3680.     void            SaveValue() { aSaveValue = GetText(); }
  3681.     String          GetSavedValue() const { return aSaveValue; }
  3682.  
  3683.     Link            ChangeModifyHdl( const Link& rLink );
  3684.     Link            GetModifyHdl() const    { return aModifyHdlLink; }
  3685. };
  3686.  
  3687. inline Link Edit::ChangeModifyHdl( const Link& rLink )
  3688. {
  3689.     Link aTmpLink = aModifyHdlLink;
  3690.     aModifyHdlLink = rLink;
  3691.     return aTmpLink;
  3692. }
  3693.  
  3694. class MultiLineEdit : public Edit
  3695. {
  3696. public:
  3697.         MultiLineEdit( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER );
  3698.         MultiLineEdit( Window* pParent, const ResId& rResId );
  3699. };
  3700.  
  3701. #endif 
  3702.  
  3703. #ifndef _COMBOBOX_HXX
  3704. #define _COMBOBOX_HXX
  3705.  
  3706. #ifndef _SV_H
  3707. #endif
  3708. #ifndef _CTRL_HXX
  3709. #endif
  3710. #ifndef _EDIT_HXX
  3711. #endif
  3712. #ifndef _COMBOBOX_H
  3713. #endif
  3714.  
  3715. #define COMBOBOX_APPEND            ((USHORT)0xFFFF)
  3716. #define COMBOBOX_ENTRY_NOTFOUND    ((USHORT)0xFFFF)
  3717.  
  3718. class ComboBox : public Edit
  3719. {
  3720. private:
  3721.     Link            aSelectHdlLink;         
  3722.     Link            aDoubleClickHdlLink;    
  3723.  
  3724. protected:
  3725.     ImpComboBox     aImpComboBox;
  3726.  
  3727.                     ComboBox( RESOURCE_TYPE nTyp, Window* pParent,
  3728.                               WinBits nWinStyle );
  3729.  
  3730.     virtual void    Select();
  3731.     virtual void    DoubleClick();
  3732.  
  3733. public:
  3734.                     ComboBox( Window* pParent, WinBits nWinStyle = 0 );
  3735.                     ComboBox( Window* pParent, const ResId& rResId );
  3736.                     ~ComboBox();
  3737.  
  3738.     BOOL            InsertEntry( const String& rStr,
  3739.                                  USHORT nPos = COMBOBOX_APPEND );
  3740.     void            RemoveEntry( const String& rStr );
  3741.     void            RemoveEntry( USHORT nPos );
  3742.  
  3743.     USHORT          GetEntryPos( const String& rStr ) const;
  3744.     String          GetEntry( USHORT nPos ) const;
  3745.     USHORT          GetEntryCount() const;
  3746.  
  3747.     void            Clear();
  3748.  
  3749.     BOOL            IsTravelSelect() const;
  3750.  
  3751.     Link            ChangeSelectHdl( const Link& rLink );
  3752.     Link            GetSelectHdl() const      { return aSelectHdlLink;      }
  3753.     Link            ChangeDoubleClickHdl( const Link& rLink );
  3754.     Link            GetDoubleClickHdl() const { return aDoubleClickHdlLink; }
  3755. };
  3756.  
  3757. inline Link ComboBox::ChangeSelectHdl( const Link& rLink )
  3758. {
  3759.     Link aOldLink = aSelectHdlLink;
  3760.     aSelectHdlLink = rLink;
  3761.     return aOldLink;
  3762. }
  3763.  
  3764. inline Link ComboBox::ChangeDoubleClickHdl( const Link& rLink )
  3765. {
  3766.     Link aOldLink = aDoubleClickHdlLink;
  3767.     aDoubleClickHdlLink = rLink;
  3768.     return aOldLink;
  3769. }
  3770.  
  3771. #endif  
  3772.  
  3773. #ifndef _LSTBOX_HXX
  3774. #define _LSTBOX_HXX
  3775.  
  3776. #ifndef _SV_H
  3777. #endif
  3778. #ifndef _CTRL_HXX
  3779. #endif
  3780. #ifndef _LSTBOX_H
  3781. #endif
  3782.  
  3783. #define LISTBOX_APPEND            ((USHORT)0xFFFF)
  3784. #define LISTBOX_ENTRY_NOTFOUND    ((USHORT)0xFFFF)
  3785.  
  3786. class ListBox : public Control
  3787. {
  3788. private:
  3789.     ImpLstBox       aImpLB;                 
  3790.     USHORT          nSaveValue;
  3791.  
  3792.     Link            aSelectHdlLink;
  3793.     Link            aDoubleClickHdlLink;
  3794.  
  3795. protected:
  3796.  
  3797.                     ListBox( RESOURCE_TYPE nTyp, Window* pParent,
  3798.                              WinBits nWinStyle );
  3799.  
  3800.     virtual void    Select();
  3801.     virtual void    DoubleClick();
  3802.  
  3803. public:
  3804.                     ListBox( Window* pParent, WinBits nWinStyle = WB_BORDER );
  3805.                     ListBox( Window* pParent, const ResId& rResId );
  3806.                     ~ListBox();
  3807.  
  3808.     BOOL            InsertEntry( const String& rStr,
  3809.                                  USHORT nPos = LISTBOX_APPEND );
  3810.     BOOL            InsertEntry( const Bitmap& rBitmap,
  3811.                                  USHORT nPos = LISTBOX_APPEND );
  3812.     BOOL            InsertEntry( const String& rStr, const Bitmap& rBitmap,
  3813.                                  USHORT nPos = LISTBOX_APPEND );
  3814.     void            RemoveEntry( const String& rStr );
  3815.     void            RemoveEntry( USHORT nPos );
  3816.  
  3817.     void            Clear();
  3818.  
  3819.     USHORT          GetEntryPos( const String& rStr ) const;
  3820.     String          GetEntry( USHORT nPos ) const;
  3821.     USHORT          GetEntryCount() const;
  3822.  
  3823.     void            SelectEntry( const String& rStr, BOOL bSelect = TRUE );
  3824.     void            SelectEntryPos( USHORT nPos, BOOL bSelect = TRUE );
  3825.     USHORT          GetSelectEntryCount() const;
  3826.     String          GetSelectEntry( USHORT nSelIndex = 0 ) const;
  3827.     USHORT          GetSelectEntryPos( USHORT nSelIndex = 0 ) const;
  3828.     BOOL            IsEntrySelected( const String& rStr ) const;
  3829.     BOOL            IsEntryPosSelected( USHORT nPos ) const;
  3830.     void            SetNoSelection();
  3831.  
  3832.     void            SaveValue() { nSaveValue = GetSelectEntryPos(); }
  3833.     USHORT          GetSavedValue() const { return nSaveValue; }
  3834.  
  3835.     BOOL            IsTravelSelect() const;
  3836.  
  3837.     Link            ChangeSelectHdl( const Link& rLink );
  3838.     Link            GetSelectHdl() const      { return aSelectHdlLink; }
  3839.     Link            ChangeDoubleClickHdl( const Link& rLink );
  3840.     Link            GetDoubleClickHdl() const { return aDoubleClickHdlLink; }
  3841. };
  3842.  
  3843. inline Link ListBox::ChangeSelectHdl( const Link& rLink )
  3844. {
  3845.     Link aOldLink = aSelectHdlLink;
  3846.     aSelectHdlLink = rLink;
  3847.     return aOldLink;
  3848. }
  3849.  
  3850. inline Link ListBox::ChangeDoubleClickHdl( const Link& rLink )
  3851. {
  3852.     Link aOldLink = aDoubleClickHdlLink;
  3853.     aDoubleClickHdlLink = rLink;
  3854.     return aOldLink;
  3855. }
  3856.  
  3857. class MultiListBox : public ListBox
  3858. {
  3859. private:
  3860.     void            SaveValue();
  3861.     USHORT          GetSavedValue();
  3862.  
  3863. public:
  3864.                     MultiListBox( Window* pParent, WinBits nWinStyle = 0 );
  3865.                     MultiListBox( Window* pParent, const ResId& rResId );
  3866. };
  3867.  
  3868. #endif  
  3869.  
  3870. #ifndef _SPLIT_HXX
  3871. #define _SPLIT_HXX
  3872.  
  3873. #ifndef _SV_H
  3874. #endif
  3875. #ifndef _WINBIT_HXX
  3876. #endif
  3877. #ifndef _RESID_HXX
  3878. #endif
  3879. #ifndef _OUTDEV_HXX
  3880. #endif
  3881. #ifndef _WINDOW_HXX
  3882. #endif
  3883. #ifndef _CTRL_HXX
  3884. #endif
  3885. #ifndef _SCRBAR_HXX
  3886. #endif
  3887. #ifndef _SPLIT_H
  3888. #endif
  3889.  
  3890. class Splitter : public Window
  3891. {
  3892. protected:
  3893.     ImpSplitter     aImpSplit;
  3894.     BOOL            bHorzSplit;
  3895.     BOOL            bDrag;
  3896.     short           nSplitPos;
  3897.     Point           aDragPos;
  3898.     Rectangle       aDragRect;
  3899.     Window*         pRefWin;
  3900.     Link            aSplitHdlLink;
  3901.  
  3902.     void            MouseButtonDown( const MouseEvent& rMEvt );
  3903.     void            MouseButtonUp( const MouseEvent& rMEvt );
  3904.     void            MouseMove( const MouseEvent& rMEvt );
  3905.  
  3906.                     Splitter( RESOURCE_TYPE nTyp, Window* pParent,
  3907.                               WinBits nWinStyle = WB_VSCROLL );
  3908.  
  3909.     virtual void    Split();
  3910.  
  3911. public:
  3912.                     Splitter( Window* pParent, WinBits nWinStyle = WB_VSCROLL );
  3913.                     Splitter( Window* pParent, const ResId& rResId );
  3914.                     ~Splitter();
  3915.  
  3916.     void            StartDrag();
  3917.  
  3918.     Rectangle       ChangeDragRectPixel( const Rectangle& rDragRect,
  3919.                                          Window* pRefWin = NULL );
  3920.     Rectangle       GetDragRectPixel() const { return aDragRect; }
  3921.  
  3922.     virtual short   ChangeSplitPosPixel( short nPos );
  3923.     short           GetSplitPosPixel() const { return nSplitPos; }
  3924.  
  3925.     Link            ChangeSplitHdl( const Link& rLink );
  3926.     Link            GetSplitHdl() const { return aSplitHdlLink; }
  3927. };
  3928.  
  3929. inline Link Splitter::ChangeSplitHdl( const Link& rLink )
  3930. {
  3931.     Link aOldLink = aSplitHdlLink;
  3932.     aSplitHdlLink = rLink;
  3933.     return aOldLink;
  3934. }
  3935.  
  3936. class SplitBar : public Splitter
  3937. {
  3938. protected:
  3939.     ScrollBar*  pScroll1;
  3940.     ScrollBar*  pScroll2;
  3941.     BOOL        bPrivate1;
  3942.     BOOL        bPrivate2;
  3943.     USHORT      nSplitWidth;
  3944.     short       nWinSplitPos;
  3945.     short       nScrBarWinBits;
  3946.  
  3947.     void        Resize();
  3948.  
  3949. public:
  3950.                 SplitBar( Window* pParent, WinBits nWinStyle = WB_VSCROLL );
  3951.                 SplitBar( Window* pParent, const ResId& rResId );
  3952.                 ~SplitBar();
  3953.  
  3954.     short       ChangeSplitPosPixel( short nPos );
  3955.  
  3956.     USHORT      ChangeSplitWidthPixel( USHORT nWidth );
  3957.     USHORT      GetSplitWidthPixel() const { return nSplitWidth; }
  3958.  
  3959.     ScrollBar*  ChangeScrollBar1( ScrollBar* pScroll );
  3960.     ScrollBar*  GetScrollBar1() const { return pScroll1; }
  3961.     ScrollBar*  ChangeScrollBar2( ScrollBar* pScroll );
  3962.     ScrollBar*  GetScrollBar2() const { return pScroll2; }
  3963. };
  3964.  
  3965. #endif 
  3966.  
  3967. #ifndef _SPIN_HXX
  3968. #define _SPIN_HXX
  3969.  
  3970. #ifndef _SV_H
  3971. #endif
  3972. #ifndef _CTRL_HXX
  3973. #endif
  3974. #ifndef _TIMER_HXX
  3975. #endif
  3976.  
  3977. class SpinButton : public Control
  3978. {
  3979. protected:
  3980.     AutoTimer       aRepeatTimer;
  3981.     Link            aUpHdlLink;
  3982.     Link            aDownHdlLink;
  3983.     Rectangle       aUpperRect;
  3984.     Rectangle       aLowerRect;
  3985.     BOOL            bRepeat;
  3986.     BOOL            bUpperIn;
  3987.     BOOL            bLowerIn;
  3988.     BOOL            bInitialUp;
  3989.     BOOL            bInitialDown;
  3990.  
  3991.     void            Timeout( Timer* );
  3992.     void            Resize();
  3993.     void            Paint( const Rectangle& rRect );
  3994.     void            MouseButtonDown( const MouseEvent& rMEvt );
  3995.     void            MouseButtonUp( const MouseEvent& rMEvt );
  3996.     void            MouseMove( const MouseEvent& rMEvt );
  3997.     void            KeyInput( const KeyEvent& rKEvt );
  3998.  
  3999.     virtual void    Up();
  4000.     virtual void    Down();
  4001.  
  4002. public:
  4003.                     SpinButton( Window* pParent, WinBits nWinStyle = 0 );
  4004.                     SpinButton( Window* pParent, const ResId& rResId );
  4005.                     ~SpinButton();
  4006.  
  4007.     void            Enable();
  4008.     void            Disable();
  4009.  
  4010.     Link            ChangeUpHdl( const Link& rLink );
  4011.     Link            GetUpHdl() const   { return aUpHdlLink;   }
  4012.     Link            ChangeDownHdl( const Link& rLink );
  4013.     Link            GetDownHdl() const { return aDownHdlLink; }
  4014. };
  4015.  
  4016. inline Link SpinButton::ChangeUpHdl( const Link& rLink )
  4017. {
  4018.     Link aOldLink = aUpHdlLink;
  4019.     aUpHdlLink = rLink;
  4020.     return aOldLink;
  4021. }
  4022.  
  4023. inline Link SpinButton::ChangeDownHdl( const Link& rLink )
  4024. {
  4025.     Link aOldLink = aDownHdlLink;
  4026.     aDownHdlLink = rLink;
  4027.     return aOldLink;
  4028. }
  4029.  
  4030. #endif 
  4031.  
  4032. #ifndef _FIELD_HXX
  4033. #define _FIELD_HXX
  4034.  
  4035. #ifndef _SV_H
  4036. #endif
  4037. #ifndef _EVENT_HXX
  4038. #endif
  4039. #ifndef _CTRL_HXX
  4040. #endif
  4041. #ifndef _EDIT_HXX
  4042. #endif
  4043. #ifndef _COMBOBOX_HXX
  4044. #endif
  4045. #ifndef _TIMER_HXX
  4046. #endif
  4047.  
  4048. class SpinField : public Edit
  4049. {
  4050. protected:
  4051.     AutoTimer       aRepeatTimer;
  4052.     Link            aUpHdlLink;
  4053.     Link            aDownHdlLink;
  4054.     Link            aFirstHdlLink;
  4055.     Link            aLastHdlLink;
  4056.     Rectangle       aUpperRect;
  4057.     Rectangle       aLowerRect;
  4058.     KeyEvent        aKeyEvent;
  4059.     SpinField*      pParentField;
  4060.     BOOL            bRepeat:1,
  4061.                     bSpin:1,
  4062.                     bInitialUp:1,
  4063.                     bInitialDown:1,
  4064.                     bNoSelect:1,
  4065.                     bInGetFocus:1;
  4066.     BOOL            bUpperIn;
  4067.     BOOL            bLowerIn;
  4068.  
  4069.     void            MouseButtonDown( const MouseEvent& rMEvt );
  4070.     void            MouseButtonUp( const MouseEvent& rMEvt );
  4071.     void            MouseMove( const MouseEvent& rMEvt );
  4072.     void            KeyInput( const KeyEvent& rKEvt );
  4073.     void            Paint( const Rectangle& rRect );
  4074.     void            Resize();
  4075.     void            GetFocus();
  4076.     void            LoseFocus();
  4077.     void            Modify();
  4078.     void            Timeout( Timer* pTimer );
  4079.  
  4080.                     SpinField( RESOURCE_TYPE nTyp, Window* pParent,
  4081.                                WinBits nWinStyle );
  4082.  
  4083.     virtual void    Up();
  4084.     virtual void    Down();
  4085.     virtual void    First();
  4086.     virtual void    Last();
  4087.  
  4088. public:
  4089.                     SpinField( Window* pParent, WinBits nWinStyle = 0 );
  4090.                     SpinField( Window* pParent, const ResId& rResId );
  4091.                     ~SpinField();
  4092.  
  4093.     void            Enable();
  4094.     void            Disable();
  4095.  
  4096.     Link            ChangeUpHdl( const Link& rLink );
  4097.     Link            GetUpHdl() const    { return aUpHdlLink;    }
  4098.     Link            ChangeDownHdl( const Link& rLink );
  4099.     Link            GetDownHdl() const  { return aDownHdlLink;  }
  4100.     Link            ChangeFirstHdl( const Link& rLink );
  4101.     Link            GetFirstHdl() const { return aFirstHdlLink; }
  4102.     Link            ChangeLastHdl( const Link& rLink );
  4103.     Link            GetLastHdl() const  { return aLastHdlLink;  }
  4104. };
  4105.  
  4106. inline Link SpinField::ChangeUpHdl( const Link& rLink )
  4107. {
  4108.     Link aOldLink = aUpHdlLink;
  4109.     aUpHdlLink = rLink;
  4110.     return aOldLink;
  4111. }
  4112.  
  4113. inline Link SpinField::ChangeDownHdl( const Link& rLink )
  4114. {
  4115.     Link aOldLink = aDownHdlLink;
  4116.     aDownHdlLink = rLink;
  4117.     return aOldLink;
  4118. }
  4119.  
  4120. inline Link SpinField::ChangeFirstHdl( const Link& rLink )
  4121. {
  4122.     Link aOldLink = aFirstHdlLink;
  4123.     aFirstHdlLink = rLink;
  4124.     return aOldLink;
  4125. }
  4126.  
  4127. inline Link SpinField::ChangeLastHdl( const Link& rLink )
  4128. {
  4129.     Link aOldLink = aLastHdlLink;
  4130.     aLastHdlLink = rLink;
  4131.     return aOldLink;
  4132. }
  4133.  
  4134. class PatternFormatter
  4135. {
  4136. private:
  4137.     void            ImpInit();
  4138.  
  4139. protected:
  4140.     String          aFieldString;
  4141.     String          aEditMask;
  4142.     String          aLiteralMask;
  4143.     BOOL            bStrictFormat;
  4144.     Edit*           pField;
  4145.  
  4146.     virtual void    ReformatAll();
  4147.  
  4148.                     PatternFormatter();
  4149.                     PatternFormatter( const ResId & rResId );
  4150.  
  4151. public:
  4152.  
  4153.     BOOL            ChangeStrictFormat( BOOL bStrict );
  4154.     BOOL            GetStrictFormat() const { return bStrictFormat; }
  4155.  
  4156.     String          GetEditMask() { return aEditMask; }
  4157.     String          GetLiteralMask() { return aLiteralMask; }
  4158.     void            SetMask( const String& rEditMask,
  4159.                              const String& rLiteralMask );
  4160.  
  4161.     void            SetString( const String& rStr );
  4162.     String          GetString() const;
  4163.     BOOL            IsStringModified() const;
  4164.  
  4165.     virtual void    Reformat();
  4166. };
  4167.  
  4168. class NumericFormatter
  4169. {
  4170. private:
  4171.     void            ImpInit();
  4172.  
  4173. protected:
  4174.     long            nFieldValue;
  4175.     long            nLastValue;
  4176.     USHORT          nType;
  4177.     International   aInternational;
  4178.     USHORT          nDecDigits;
  4179.     long            nMin;
  4180.     long            nMax;
  4181.     BOOL            bStrictFormat;
  4182.     Edit*           pField;
  4183.  
  4184.     virtual void    ReformatAll();
  4185.  
  4186.                     NumericFormatter();
  4187.                     NumericFormatter( const ResId & rResId );
  4188.  
  4189. public:
  4190.     long            ChangeMin( long nNewMin );
  4191.     long            GetMin() const { return nMin; }
  4192.     long            ChangeMax( long nNewMax );
  4193.     long            GetMax() const { return nMax; }
  4194.  
  4195.     BOOL            ChangeStrictFormat( BOOL bStrict );
  4196.     BOOL            GetStrictFormat() const { return bStrictFormat; }
  4197.     International   ChangeInternational( const International& rInter );
  4198.     International   GetInternational() const { return aInternational; }
  4199.     USHORT          ChangeDecimalDigits( USHORT nDigits );
  4200.     USHORT          GetDecimalDigits() const { return nDecDigits; }
  4201.  
  4202.     void            SetValue( long nNewValue );
  4203.     long            GetValue() const;
  4204.     BOOL            IsValueModified() const;
  4205.  
  4206.     Fraction        ConvertToFraction( long nValue );
  4207.     long            ConvertToLong( const Fraction& rValue );
  4208.     long            Normalize( long nValue ) const;
  4209.     long            Denormalize( long nValue ) const;
  4210.  
  4211.     virtual void    Reformat();
  4212. };
  4213.  
  4214. class MetricFormatter : public NumericFormatter
  4215. {
  4216. private:
  4217.     void            ImpInit();
  4218.  
  4219. protected:
  4220.     FieldUnit       eUnit;
  4221.     String          aCustomUnitText;
  4222.     String          aCurUnitText;
  4223.     Link            aCustomConvertLink;
  4224.  
  4225.     virtual void    CustomConvert() = 0;
  4226.  
  4227.                     MetricFormatter();
  4228.                     MetricFormatter( const ResId & rResId );
  4229.  
  4230. public:
  4231.     FieldUnit       ChangeUnit( FieldUnit eUnit );
  4232.     FieldUnit       GetUnit() { return eUnit; }
  4233.     String          ChangeCustomUnitText( const String& rStr );
  4234.     String          GetCustomUnitText() const { return aCustomUnitText; }
  4235.     Link            ChangeCustomConvertHdl( const Link& rLink );
  4236.     Link            GetCustomConvertHdl() const { return aCustomConvertLink; }
  4237.  
  4238.     String          GetCurUnitText() const { return aCurUnitText; }
  4239.     void            SetValue( long nNewValue, FieldUnit eInUnit = FUNIT_NONE );
  4240.     long            GetValue( FieldUnit eOutUnit = FUNIT_NONE ) const;
  4241.     long            ChangeMax( long nNewMax, FieldUnit eInUnit = FUNIT_NONE );
  4242.     long            GetMax( FieldUnit eOutUnit = FUNIT_NONE ) const;
  4243.     long            ChangeMin( long nNewMin, FieldUnit eInUnit = FUNIT_NONE );
  4244.     long            GetMin( FieldUnit eOutUnit = FUNIT_NONE ) const;
  4245.  
  4246.     void            Reformat();
  4247. };
  4248.  
  4249. inline Link MetricFormatter::ChangeCustomConvertHdl( const Link& rLink )
  4250. {
  4251.     Link aOldLink = aCustomConvertLink;
  4252.     aCustomConvertLink = rLink;
  4253.     return aOldLink;
  4254. }
  4255.  
  4256. class CurrencyFormatter : public NumericFormatter
  4257. {
  4258. private:
  4259.     void            ImpInit();
  4260.  
  4261. protected:
  4262.                     CurrencyFormatter();
  4263.                     CurrencyFormatter( const ResId & rResId );
  4264.  
  4265. public:
  4266.     void            SetValue( long nNewValue );
  4267.     long            GetValue() const;
  4268.  
  4269.     void            Reformat();
  4270. };
  4271.  
  4272. class DateFormatter
  4273. {
  4274. private:
  4275.     void            ImpInit();
  4276.  
  4277. protected:
  4278.     Date            aFieldDate;
  4279.     Date            aLastDate;
  4280.     International   aInternational;
  4281.     Date            aMin;
  4282.     Date            aMax;
  4283.     BOOL            bLongFormat;
  4284.     BOOL            bStrictFormat;
  4285.     Edit*           pField;
  4286.  
  4287.     virtual void    ReformatAll();
  4288.  
  4289.                     DateFormatter();
  4290.                     DateFormatter( const ResId & rResId );
  4291.  
  4292. public:
  4293.     Date            ChangeMin( const Date& rNewMin );
  4294.     Date            GetMin() const { return aMin; }
  4295.     Date            ChangeMax( const Date& rNewMax );
  4296.     Date            GetMax() const { return aMax; }
  4297.  
  4298.     BOOL            ChangeLongFormat( BOOL bLong );
  4299.     BOOL            IsLongFormat() const { return bLongFormat; }
  4300.  
  4301.     BOOL            ChangeStrictFormat( BOOL bStrict );
  4302.     BOOL            GetStrictFormat() const { return bStrictFormat; }
  4303.     International   ChangeInternational( const International& rInter );
  4304.     International   GetInternational() const { return aInternational; }
  4305.  
  4306.     void            SetDate( const Date& rNewDate );
  4307.     Date            GetDate() const;
  4308.     BOOL            IsDateModified() const;
  4309.  
  4310.     virtual void    Reformat();
  4311. };
  4312.  
  4313. class TimeFormatter
  4314. {
  4315. private:
  4316.     void            ImpInit();
  4317.  
  4318. protected:
  4319.     Time            aFieldTime;
  4320.     Time            aLastTime;
  4321.     International   aInternational;
  4322.     Time            aMin;
  4323.     Time            aMax;
  4324.     TimeFieldFormat eFormat;
  4325.     BOOL            bDuration;
  4326.     BOOL            bStrictFormat;
  4327.     Edit*           pField;
  4328.  
  4329.     virtual void    ReformatAll();
  4330.  
  4331.                     TimeFormatter();
  4332.                     TimeFormatter( const ResId & rResId );
  4333.  
  4334. public:
  4335.     Time            ChangeMin( const Time& rNewMin );
  4336.     Time            GetMin() const { return aMin; }
  4337.     Time            ChangeMax( const Time& rNewMax );
  4338.     Time            GetMax() const { return aMax; }
  4339.  
  4340.     TimeFieldFormat ChangeFormat( TimeFieldFormat eNewFormat );
  4341.     TimeFieldFormat GetFormat() const { return eFormat; }
  4342.     BOOL            ChangeDuration( BOOL bDuration );
  4343.     BOOL            IsDuration() const { return bDuration; }
  4344.  
  4345.     BOOL            ChangeStrictFormat( BOOL bStrict );
  4346.     BOOL            GetStrictFormat() const { return bStrictFormat; }
  4347.     International   ChangeInternational( const International& rInter );
  4348.     International   GetInternational() const { return aInternational; }
  4349.  
  4350.     void            SetTime( const Time& rNewTime );
  4351.     Time            GetTime() const;
  4352.     BOOL            IsTimeModified() const;
  4353.  
  4354.     virtual void    Reformat();
  4355. };
  4356.  
  4357. class PatternField : public SpinField, public PatternFormatter
  4358. {
  4359. protected:
  4360.     BOOL            bReformat;
  4361.  
  4362.     void            KeyInput( const KeyEvent& rKEvt );
  4363.     void            GetFocus();
  4364.     void            LoseFocus();
  4365.     void            Modify();
  4366.  
  4367. public:
  4368.                     PatternField( Window* pParent, WinBits nWinStyle );
  4369.                     PatternField( Window* pParent, const ResId& rResId );
  4370. };
  4371.  
  4372. class NumericField : public SpinField, public NumericFormatter
  4373. {
  4374. protected:
  4375.     BOOL            bReformat;
  4376.     long            nSpinSize;
  4377.     long            nFirst;
  4378.     long            nLast;
  4379.  
  4380.     void            KeyInput( const KeyEvent& rKEvt );
  4381.     void            GetFocus();
  4382.     void            LoseFocus();
  4383.     void            Modify();
  4384.     void            Up();
  4385.     void            Down();
  4386.     void            First();
  4387.     void            Last();
  4388.  
  4389. public:
  4390.                     NumericField( Window* pParent, WinBits nWinStyle );
  4391.                     NumericField( Window* pParent, const ResId& rResId );
  4392.  
  4393.     long            ChangeFirst( long nNewFirst );
  4394.     long            GetFirst() const { return nFirst; }
  4395.     long            ChangeLast( long nNewLast );
  4396.     long            GetLast() const { return nLast; }
  4397.  
  4398.     long            ChangeSpinSize( long nSpinSize );
  4399.     long            GetSpinSize() const { return nSpinSize; }
  4400. };
  4401.  
  4402. inline long NumericField::ChangeFirst( long nNewFirst )
  4403. {
  4404.     long nOldFirst = nFirst;
  4405.     nFirst = nNewFirst;
  4406.     return nOldFirst;
  4407. }
  4408.  
  4409. inline long NumericField::ChangeLast( long nNewLast )
  4410. {
  4411.     long nOldLast = nLast;
  4412.     nLast = nNewLast;
  4413.     return nOldLast;
  4414. }
  4415.  
  4416. inline long NumericField::ChangeSpinSize( long nNewSize )
  4417. {
  4418.     long nOldSize = nSpinSize;
  4419.     nSpinSize = nNewSize;
  4420.     return nOldSize;
  4421. }
  4422.  
  4423. class MetricField : public SpinField, public MetricFormatter
  4424. {
  4425. protected:
  4426.     BOOL            bReformat;
  4427.     long            nSpinSize;
  4428.     long            nFirst;
  4429.     long            nLast;
  4430.  
  4431.     void            KeyInput( const KeyEvent& rKEvt );
  4432.     void            GetFocus();
  4433.     void            LoseFocus();
  4434.     void            Modify();
  4435.     void            Up();
  4436.     void            Down();
  4437.     void            First();
  4438.     void            Last();
  4439.     void            CustomConvert();
  4440.  
  4441. public:
  4442.                     MetricField( Window* pParent, WinBits nWinStyle );
  4443.                     MetricField( Window* pParent, const ResId& rResId );
  4444.  
  4445.     long            ChangeFirst( long nNewFirst, FieldUnit eInUnit=FUNIT_NONE );
  4446.     long            GetFirst( FieldUnit eOutUnit=FUNIT_NONE ) const;
  4447.     long            ChangeLast( long nNewLast, FieldUnit eInUnit=FUNIT_NONE );
  4448.     long            GetLast( FieldUnit eOutUnit=FUNIT_NONE ) const;
  4449.  
  4450.     long            ChangeSpinSize( long nNewSize );
  4451.     long            GetSpinSize() const { return nSpinSize; }
  4452. };
  4453.  
  4454. inline long MetricField::ChangeSpinSize( long nNewSize )
  4455. {
  4456.     long nOldSize = nSpinSize;
  4457.     nSpinSize = nNewSize;
  4458.     return nOldSize;
  4459. }
  4460.  
  4461. class CurrencyField : public SpinField, public CurrencyFormatter
  4462. {
  4463. protected:
  4464.     BOOL            bReformat;
  4465.     long            nSpinSize;
  4466.     long            nFirst;
  4467.     long            nLast;
  4468.  
  4469.     void            KeyInput( const KeyEvent& rKEvt );
  4470.     void            GetFocus();
  4471.     void            LoseFocus();
  4472.     void            Modify();
  4473.     void            Up();
  4474.     void            Down();
  4475.     void            First();
  4476.     void            Last();
  4477.  
  4478. public:
  4479.                     CurrencyField( Window* pParent, WinBits nWinStyle );
  4480.                     CurrencyField( Window* pParent, const ResId& rResId );
  4481.  
  4482.     long            ChangeFirst( long nNewFirst );
  4483.     long            GetFirst() const { return nFirst; }
  4484.     long            ChangeLast( long nNewLast );
  4485.     long            GetLast() const { return nLast; }
  4486.  
  4487.     long            ChangeSpinSize( long nNewSize );
  4488.     long            GetSpinSize() const { return nSpinSize; }
  4489. };
  4490.  
  4491. inline long CurrencyField::ChangeFirst( long nNewFirst )
  4492. {
  4493.     long nOldFirst = nFirst;
  4494.     nFirst = nNewFirst;
  4495.     return nOldFirst;
  4496. }
  4497.  
  4498. inline long CurrencyField::ChangeLast( long nNewLast )
  4499. {
  4500.     long nOldLast = nLast;
  4501.     nLast = nNewLast;
  4502.     return nOldLast;
  4503. }
  4504.  
  4505. inline long CurrencyField::ChangeSpinSize( long nNewSize )
  4506. {
  4507.     long nOldSize = nSpinSize;
  4508.     nSpinSize = nNewSize;
  4509.     return nOldSize;
  4510. }
  4511.  
  4512. class DateField : public SpinField, public DateFormatter
  4513. {
  4514. protected:
  4515.     BOOL            bReformat;
  4516.     Date            aFirst;
  4517.     Date            aLast;
  4518.  
  4519.     void            KeyInput( const KeyEvent& rKEvt );
  4520.     void            GetFocus();
  4521.     void            LoseFocus();
  4522.     void            Modify();
  4523.     void            Up();
  4524.     void            Down();
  4525.     void            First();
  4526.     void            Last();
  4527.  
  4528. public:
  4529.                     DateField( Window* pParent, WinBits nWinStyle );
  4530.                     DateField( Window* pParent, const ResId& rResId );
  4531.  
  4532.     Date            ChangeFirst( const Date& rNewFirst );
  4533.     Date            GetFirst() const { return aFirst; }
  4534.     Date            ChangeLast( const Date& rNewLast );
  4535.     Date            GetLast() const { return aLast; }
  4536.  
  4537. };
  4538.  
  4539. inline Date DateField::ChangeFirst( const Date& rNewFirst )
  4540. {
  4541.     Date aOldFirst = aFirst;
  4542.     aFirst = rNewFirst;
  4543.     return aOldFirst;
  4544. }
  4545.  
  4546. inline Date DateField::ChangeLast( const Date& rNewLast )
  4547. {
  4548.     Date aOldLast = aLast;
  4549.     aLast = rNewLast;
  4550.     return aOldLast;
  4551. }
  4552.  
  4553. class TimeField : public SpinField, public TimeFormatter
  4554. {
  4555. protected:
  4556.     BOOL            bReformat;
  4557.     Time            aFirst;
  4558.     Time            aLast;
  4559.  
  4560.     void            KeyInput( const KeyEvent& rKEvt );
  4561.     void            GetFocus();
  4562.     void            LoseFocus();
  4563.     void            Modify();
  4564.     void            Up();
  4565.     void            Down();
  4566.     void            First();
  4567.     void            Last();
  4568.  
  4569. public:
  4570.                     TimeField( Window* pParent, WinBits nWinStyle );
  4571.                     TimeField( Window* pParent, const ResId& rResId );
  4572.  
  4573.     Time            ChangeFirst( const Time& rNewFirst );
  4574.     Time            GetFirst() const { return aFirst; }
  4575.     Time            ChangeLast( const Time& rLast );
  4576.     Time            GetLast() const { return aLast; }
  4577. };
  4578.  
  4579. inline Time TimeField::ChangeFirst( const Time& rNewFirst )
  4580. {
  4581.     Time aOldFirst = aFirst;
  4582.     aFirst = rNewFirst;
  4583.     return aOldFirst;
  4584. }
  4585.  
  4586. inline Time TimeField::ChangeLast( const Time& rNewLast )
  4587. {
  4588.     Time aOldLast = aLast;
  4589.     aLast = rNewLast;
  4590.     return aOldLast;
  4591. }
  4592.  
  4593. class PatternBox : public ComboBox, public PatternFormatter
  4594. {
  4595. protected:
  4596.     BOOL            bReformat;
  4597.  
  4598.     void            KeyInput( const KeyEvent& rKEvt );
  4599.     void            GetFocus();
  4600.     void            LoseFocus();
  4601.     void            Modify();
  4602.     void            ReformatAll();
  4603.  
  4604. public:
  4605.                     PatternBox( Window* pParent, WinBits nWinStyle );
  4606.                     PatternBox( Window* pParent, const ResId& rResId );
  4607.  
  4608.     void            InsertString( const String& rStr,
  4609.                                   USHORT nPos = COMBOBOX_APPEND );
  4610.     void            RemoveString( const String& rStr );
  4611.     String          GetString( USHORT nPos ) const;
  4612.     USHORT          GetStringPos( const String& rStr ) const;
  4613. };
  4614.  
  4615. class NumericBox : public ComboBox, public NumericFormatter
  4616. {
  4617. protected:
  4618.     BOOL            bReformat;
  4619.  
  4620.     void            KeyInput( const KeyEvent& rKEvt );
  4621.     void            GetFocus();
  4622.     void            LoseFocus();
  4623.     void            Modify();
  4624.     void            ReformatAll();
  4625.  
  4626. public:
  4627.                     NumericBox( Window* pParent, WinBits nWinStyle );
  4628.                     NumericBox( Window* pParent, const ResId& rResId );
  4629.  
  4630.     void            InsertValue( long nValue,
  4631.                                  USHORT nPos = COMBOBOX_APPEND );
  4632.     void            RemoveValue( long nValue );
  4633.     long            GetValue() const
  4634.                         { return NumericFormatter::GetValue(); }
  4635.     long            GetValue( USHORT nPos ) const;
  4636.     USHORT          GetValuePos( long nPos ) const;
  4637. };
  4638.  
  4639. class MetricBox : public ComboBox, public MetricFormatter
  4640. {
  4641. protected:
  4642.     BOOL            bReformat;
  4643.  
  4644.     void            KeyInput( const KeyEvent& rKEvt );
  4645.     void            GetFocus();
  4646.     void            LoseFocus();
  4647.     void            Modify();
  4648.     void            CustomConvert();
  4649.     void            ReformatAll();
  4650.  
  4651. public:
  4652.                     MetricBox( Window* pParent, WinBits nWinStyle );
  4653.                     MetricBox( Window* pParent, const ResId& rResId );
  4654.  
  4655.     void            InsertValue( long nValue, FieldUnit eInUnit = FUNIT_NONE,
  4656.                                  USHORT nPos = COMBOBOX_APPEND );
  4657.     void            RemoveValue( long nValue, FieldUnit eInUnit = FUNIT_NONE );
  4658.     long            GetValue( FieldUnit eOutUnit = FUNIT_NONE ) const
  4659.                         { return MetricFormatter::GetValue( eOutUnit ); }
  4660.     long            GetValue( USHORT nPos, FieldUnit eOutUnit = FUNIT_NONE ) const;
  4661.     USHORT          GetValuePos( long nValue,
  4662.                                  FieldUnit eInUnit = FUNIT_NONE ) const;
  4663. };
  4664.  
  4665. class CurrencyBox : public ComboBox, public CurrencyFormatter
  4666. {
  4667. protected:
  4668.     BOOL            bReformat;
  4669.  
  4670.     void            KeyInput( const KeyEvent& rKEvt );
  4671.     void            GetFocus();
  4672.     void            LoseFocus();
  4673.     void            Modify();
  4674.     void            ReformatAll();
  4675.  
  4676. public:
  4677.                     CurrencyBox( Window* pParent, WinBits nWinStyle );
  4678.                     CurrencyBox( Window* pParent, const ResId& rResId );
  4679.  
  4680.     void            InsertValue( long nValue,
  4681.                                  USHORT nPos = COMBOBOX_APPEND );
  4682.     void            RemoveValue( long nValue );
  4683.     long            GetValue() const
  4684.                         { return CurrencyFormatter::GetValue(); }
  4685.     long            GetValue( USHORT nPos ) const;
  4686.     USHORT          GetValuePos( long nValue ) const;
  4687. };
  4688.  
  4689. class DateBox : public ComboBox, public DateFormatter
  4690. {
  4691. protected:
  4692.     BOOL            bReformat;
  4693.  
  4694.     void            KeyInput( const KeyEvent& rKEvt );
  4695.     void            GetFocus();
  4696.     void            LoseFocus();
  4697.     void            Modify();
  4698.     void            ReformatAll();
  4699.  
  4700. public:
  4701.                     DateBox( Window* pParent, WinBits nWinStyle );
  4702.                     DateBox( Window* pParent, const ResId& rResId );
  4703.  
  4704.     void            InsertDate( const Date& rDate,
  4705.                                 USHORT nPos = COMBOBOX_APPEND );
  4706.     void            RemoveDate( const Date& rDate );
  4707.     Date            GetDate( USHORT nPos ) const;
  4708.     USHORT          GetDatePos( const Date& rDate ) const;
  4709. };
  4710.  
  4711. class TimeBox : public ComboBox, public TimeFormatter
  4712. {
  4713. protected:
  4714.     BOOL            bReformat;
  4715.  
  4716.     void            KeyInput( const KeyEvent& rKEvt );
  4717.     void            GetFocus();
  4718.     void            LoseFocus();
  4719.     void            Modify();
  4720.     void            ReformatAll();
  4721.  
  4722. public:
  4723.                     TimeBox( Window* pParent, WinBits nWinStyle );
  4724.                     TimeBox( Window* pParent, const ResId& rResId );
  4725.  
  4726.     void            InsertTime( const Time& rTime,
  4727.                                 USHORT nPos = COMBOBOX_APPEND );
  4728.     void            RemoveTime( const Time& rTime );
  4729.     Time            GetTime( USHORT nPos ) const;
  4730.     USHORT          GetTimePos( const Time& rTime ) const;
  4731. };
  4732.  
  4733. #endif 
  4734.  
  4735. #ifndef _MOREBTN_HXX
  4736. #define _MOREBTN_HXX
  4737.  
  4738. #ifndef _SV_H
  4739. #endif
  4740. #ifndef _MAPMOD_HXX
  4741. #endif
  4742. #ifndef _BUTTON_HXX
  4743. #endif
  4744.  
  4745. class MoreWindowList;
  4746.  
  4747. class MoreButton : public PushButton
  4748. {
  4749. private:
  4750.     BOOL            bState;
  4751.     USHORT          nDelta;
  4752.     MapUnit         eUnit;
  4753.     MoreWindowList* pList;
  4754.  
  4755. protected:
  4756.     void            Click();
  4757.  
  4758. public:
  4759.                     MoreButton( Window* pParent, WinBits nWinStyle = 0 );
  4760.                     MoreButton( Window* pParent, const ResId& rResId );
  4761.                     ~MoreButton();
  4762.  
  4763.     void            AddWindow( Window* pWindow );
  4764.     void            RemoveWindow( Window* pWindow );
  4765.  
  4766.     USHORT          ChangeDelta( USHORT nNewDelta );
  4767.     USHORT          GetDelta() const { return nDelta; }
  4768.  
  4769.     MapUnit         ChangeMapUnit( MapUnit eNewUnit = MAP_PIXEL );
  4770.     MapUnit         GetMapUnit() const { return eUnit; }
  4771.  
  4772.     BOOL            ChangeState( BOOL bNewState = TRUE );
  4773.     BOOL            GetState() const { return bState; }
  4774.  
  4775.     void            SetText( const String& rNewText );
  4776.     String          GetText() const;
  4777. };
  4778.  
  4779. #endif 
  4780.  
  4781. #ifndef _TOOLBOX_HXX
  4782. #define _TOOLBOX_HXX
  4783.  
  4784. #ifndef _SV_H
  4785. #endif
  4786. #ifndef _CTRL_HXX
  4787. #endif
  4788. #ifndef _VIRDEV_HXX
  4789. #endif
  4790.  
  4791. class ToolItemList;
  4792. class ToolFormatList;
  4793.  
  4794. #define TOOLBOX_APPEND          ((USHORT)0xFFFF)
  4795. #define TOOLBOX_ITEM_NOTFOUND   ((USHORT)0xFFFF)
  4796.  
  4797. class ToolBox : public Control
  4798. {
  4799. private:
  4800.     ToolItemList*   pItemList;
  4801.     ToolFormatList* pFormatList;
  4802.     VirtualDevice   aBtn;
  4803.     ButtonType      eButtonType;
  4804.     ToolBoxAlign    eAlign;
  4805.     USHORT          nLines;
  4806.     Size            aBitmapSize;
  4807.     Size            aTextSize;
  4808.     USHORT          nCurItemId;
  4809.     USHORT          nCurPos;
  4810.     Link            aClickHdl;
  4811.     Link            aDoubleClickHdl;
  4812.     Link            aActivateHdl;
  4813.     Link            aDeactivateHdl;
  4814.     Link            aHighlightHdl;
  4815.     Link            aSelectHdl;
  4816.     Pen             a3DLightPen;
  4817.     Pen             a3DShadowPen;
  4818.     Pen             aBlackPen;
  4819.     Brush           aBkBrush;
  4820.     short           nDX;
  4821.     short           nDY;
  4822.     short           nDIX;
  4823.     short           nDIY;
  4824.     short           nDSX;
  4825.     short           nDSY;
  4826.     USHORT          nTop;
  4827.     USHORT          nCurLine;
  4828.     USHORT          nBreak;
  4829.     USHORT          nLastItemPos;
  4830.     USHORT          nLastItemLeft;
  4831.     USHORT          nLastItemTop;
  4832.     USHORT          nLastCurLine;
  4833.     Rectangle       aUpperRect;
  4834.     Rectangle       aLowerRect;
  4835.     WinBits         nWinBits;
  4836.     BOOL            bDrag;
  4837.     BOOL            bUpper;
  4838.     BOOL            bLower;
  4839.     BOOL            bIn;
  4840.     BOOL            bLastItemPos;
  4841.     BOOL            bUpdate;
  4842.     BOOL            bCalc;
  4843.     BOOL            bFormat;
  4844.  
  4845.     void            ImpCalcItemSize();
  4846.     void            ImpFormat();
  4847.     void            ImpDrawSpin( BOOL bUpperIn, BOOL bLowerIn );
  4848.     BOOL            ImpDrawItem( USHORT nPos, BOOL bHighlight = FALSE );
  4849.     Rectangle       ImpGetItemRectPos( USHORT nPos ) const;
  4850.  
  4851. protected:
  4852.     virtual void    Click();
  4853.     virtual void    DoubleClick();
  4854.     virtual void    Activate();
  4855.     virtual void    Deactivate();
  4856.     virtual void    Highlight();
  4857.     virtual void    Select();
  4858.     virtual void    RequestHelp( const HelpEvent& rHEvt );
  4859.  
  4860.     virtual void    MouseButtonDown( const MouseEvent& rMEvt );
  4861.     virtual void    MouseButtonUp( const MouseEvent& rMEvt );
  4862.     virtual void    MouseMove( const MouseEvent& rMEvt );
  4863.     virtual void    Paint( const Rectangle& rRect );
  4864.     virtual void    Resize();
  4865.  
  4866. public:
  4867.                     ToolBox( Window* pParent, WinBits nWinBits = 0 );
  4868.                     ToolBox( Window* pParent, const ResId& rResId );
  4869.                     ~ToolBox();
  4870.  
  4871.     BOOL            InsertItem( const ResId& rResId,
  4872.                                 USHORT nPos = TOOLBOX_APPEND );
  4873.     BOOL            InsertItem( USHORT nItemId, const Bitmap& rBitmap,
  4874.                                 USHORT nPos = TOOLBOX_APPEND );
  4875.     BOOL            InsertItem( USHORT nItemId, const Bitmap& rBitmap,
  4876.                                 const Bitmap& rDisableBitmap,
  4877.                                 USHORT nPos = TOOLBOX_APPEND );
  4878.     BOOL            InsertItem( USHORT nItemId, const Bitmap& rBitmap,
  4879.                                 const String& rText,
  4880.                                 USHORT nPos = TOOLBOX_APPEND );
  4881.     BOOL            InsertItem( USHORT nItemId, const Bitmap& rBitmap,
  4882.                                 const Bitmap& rDisableBitmap,
  4883.                                 const String& rText,
  4884.                                 USHORT nPos = TOOLBOX_APPEND );
  4885.     BOOL            InsertItem( USHORT nItemId, const String& rText,
  4886.                                 USHORT nPos = TOOLBOX_APPEND );
  4887.     void            InsertSpace( USHORT nPos = TOOLBOX_APPEND );
  4888.     void            InsertSeparator( USHORT nPos = TOOLBOX_APPEND );
  4889.     void            InsertBreak( USHORT nPos = TOOLBOX_APPEND );
  4890.     void            RemoveItem( USHORT nPos );
  4891.  
  4892.     ButtonType      ChangeButtonType( ButtonType eNewType = BUTTON_SYMBOL );
  4893.     ButtonType      GetButtonType() const { return eButtonType; }
  4894.  
  4895.     ToolBoxAlign    ChangeAlign( ToolBoxAlign eNewAlign = BOXALIGN_TOP );
  4896.     ToolBoxAlign    GetAlign() const { return eAlign; }
  4897.  
  4898.     USHORT          ChangeLineCount( USHORT nNewLines );
  4899.     USHORT          GetLineCount() const { return nLines; }
  4900.  
  4901.     void            CopyItems( const ToolBox& rToolBox );
  4902.     void            Clear();
  4903.  
  4904.     USHORT          GetItemCount() const;
  4905.     USHORT          GetItemPos( USHORT nItemId ) const;
  4906.     USHORT          GetItemId( USHORT nPos ) const;
  4907.     USHORT          GetItemId( const Point& rPos ) const;
  4908.     ToolBoxItemType GetItemType( USHORT nPos ) const;
  4909.     Rectangle       GetItemRect( USHORT nItemId ) const;
  4910.     USHORT          GetCurItemId() const { return nCurItemId; }
  4911.  
  4912.     void            CheckItem( USHORT nItemId, BOOL bCheck = TRUE );
  4913.     BOOL            IsItemChecked( USHORT nItemId ) const;
  4914.  
  4915.     void            EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
  4916.     BOOL            IsItemEnabled( USHORT nItemId ) const;
  4917.  
  4918.     void            SetItemBitmap( USHORT nItemId, const Bitmap& rBitmap );
  4919.     Bitmap          GetItemBitmap( USHORT nItemId ) const;
  4920.     void            SetItemDisableBitmap( USHORT nItemId,
  4921.                                           const Bitmap& rBitmap );
  4922.     Bitmap          GetItemDisableBitmap( USHORT nItemId ) const;
  4923.     void            SetItemText( USHORT nItemId, const String& rText );
  4924.     String          GetItemText( USHORT nItemId ) const;
  4925.  
  4926.     void            SetHelpText( USHORT nItemId, const String& rText );
  4927.     String          GetHelpText( USHORT nItemId ) const;
  4928.  
  4929.     ULONG           ChangeHelpId( USHORT nItemId, ULONG nHelpId );
  4930.     ULONG           GetHelpId( USHORT nItemId ) const;
  4931.  
  4932.     void            Show();
  4933.     void            Enable();
  4934.     void            Disable();
  4935.  
  4936.     void            SetHelpText( const String& rText )
  4937.                         { Control::SetHelpText( rText ); }
  4938.     String          GetHelpText() const
  4939.                         { return Control::GetHelpText(); }
  4940.  
  4941.     ULONG           ChangeHelpId( ULONG nHelpId )
  4942.                         { return Control::ChangeHelpId( nHelpId ); }
  4943.     ULONG           GetHelpId() const
  4944.                         { return Control::GetHelpId(); }
  4945.  
  4946.     Size            CalcWindowSizePixel() const;
  4947.  
  4948.     void            EndSelection();
  4949.  
  4950.     Link            ChangeClickHdl( const Link& rLink );
  4951.     Link            GetClickHdl() const { return aClickHdl; }
  4952.     Link            ChangeDoubleClickHdl( const Link& rLink );
  4953.     Link            GetDoubleClickHdl() const { return aDoubleClickHdl; }
  4954.     Link            ChangeActivateHdl( const Link& rLink );
  4955.     Link            GetActivateHdl() const { return aActivateHdl; }
  4956.     Link            ChangeDeactivateHdl( const Link& rLink );
  4957.     Link            GetDeactivateHdl() const { return aDeactivateHdl; }
  4958.     Link            ChangeHighlightHdl( const Link& rLink );
  4959.     Link            GetHighlightHdl() const { return aHighlightHdl; }
  4960.     Link            ChangeSelectHdl( const Link& rLink );
  4961.     Link            GetSelectHdl() const { return aSelectHdl; }
  4962. };
  4963.  
  4964. inline Link ToolBox::ChangeClickHdl( const Link& rLink )
  4965. {
  4966.     Link aOldLink = aClickHdl;
  4967.     aClickHdl = rLink;
  4968.     return aOldLink;
  4969. }
  4970.  
  4971. inline Link ToolBox::ChangeDoubleClickHdl( const Link& rLink )
  4972. {
  4973.     Link aOldLink = aDoubleClickHdl;
  4974.     aDoubleClickHdl = rLink;
  4975.     return aOldLink;
  4976. }
  4977.  
  4978. inline Link ToolBox::ChangeActivateHdl( const Link& rLink )
  4979. {
  4980.     Link aOldLink = aActivateHdl;
  4981.     aActivateHdl = rLink;
  4982.     return aOldLink;
  4983. }
  4984.  
  4985. inline Link ToolBox::ChangeDeactivateHdl( const Link& rLink )
  4986. {
  4987.     Link aOldLink = aDeactivateHdl;
  4988.     aDeactivateHdl = rLink;
  4989.     return aOldLink;
  4990. }
  4991.  
  4992. inline Link ToolBox::ChangeHighlightHdl( const Link& rLink )
  4993. {
  4994.     Link aOldLink = aHighlightHdl;
  4995.     aHighlightHdl = rLink;
  4996.     return aOldLink;
  4997. }
  4998.  
  4999. inline Link ToolBox::ChangeSelectHdl( const Link& rLink )
  5000. {
  5001.     Link aOldLink = aSelectHdl;
  5002.     aSelectHdl = rLink;
  5003.     return aOldLink;
  5004. }
  5005.  
  5006. #endif  
  5007.  
  5008. #ifndef _STATUS_HXX
  5009. #define _STATUS_HXX
  5010.  
  5011. #ifndef _SV_H
  5012. #endif
  5013. #ifndef _WINDOW_HXX
  5014. #endif
  5015.  
  5016. class StatusItemList;
  5017.  
  5018. enum StatusItemAlign { STATUSITEM_ALIGN_LEFT, STATUSITEM_ALIGN_CENTER,
  5019.                        STATUSITEM_ALIGN_RIGHT };
  5020.  
  5021. #define STATUSBAR_APPEND            ((USHORT)0xFFFF)
  5022. #define STATUSBAR_ITEM_NOTFOUND     ((USHORT)0xFFFF)
  5023. #define STATUSBAR_OFFSET            ((USHORT)5)
  5024.  
  5025. class StatusBar : public Window
  5026. {
  5027. private:
  5028.     Link            aClickHdl;
  5029.     Link            aDoubleClickHdl;
  5030.     StatusItemList* pItemList;
  5031.     Pen             a3DFacePen;
  5032.     Pen             a3DLightPen;
  5033.     Pen             a3DShadowPen;
  5034.     Pen             aBlackPen;
  5035.     Pen             aNullPen;
  5036.     Brush           a3DFaceBrush;
  5037.     WinBits         nWinBits;
  5038.     StatusBarAlign  eAlign;
  5039.     USHORT          nDX;
  5040.     USHORT          nDY;
  5041.     USHORT          nItemsWidth;
  5042.     USHORT          nCurItemId;
  5043.     BOOL            bVisibleItems;
  5044.     BOOL            bUpdate;
  5045.  
  5046.     void            ImpDrawItem( USHORT nPos,
  5047.                                  BOOL bOnlyText = FALSE, USHORT nOldWidth = 0 );
  5048.     Rectangle       ImpGetItemRectPos( USHORT nPos ) const;
  5049.  
  5050. protected:
  5051.     virtual void    Click();
  5052.     virtual void    DoubleClick();
  5053.  
  5054.     virtual void    MouseButtonDown( const MouseEvent& rMEvt );
  5055.     virtual void    Paint( const Rectangle& rRect );
  5056.     virtual void    Resize();
  5057.  
  5058. public:
  5059.                     StatusBar( Window* pParent, WinBits nWinBits = 0 );
  5060.                     StatusBar( Window* pParent, const ResId& rResId );
  5061.                     ~StatusBar();
  5062.  
  5063.     BOOL            InsertItem( USHORT nItemId, USHORT nWidth,
  5064.                                 StatusItemAlign eAlign = STATUSITEM_ALIGN_CENTER,
  5065.                                 USHORT nOffset = STATUSBAR_OFFSET,
  5066.                                 USHORT nPos = STATUSBAR_APPEND );
  5067.     void            RemoveItem( USHORT nItemId );
  5068.  
  5069.     StatusBarAlign  ChangeAlign( StatusBarAlign eNewAlign = STATUSBAR_ALIGN_RIGHT );
  5070.     StatusBarAlign  GetAlign() const { return eAlign; }
  5071.  
  5072.     void            ShowItems();
  5073.     void            HideItems();
  5074.     BOOL            AreItemsVisible() const { return bVisibleItems; }
  5075.  
  5076.     void            CopyItems( const StatusBar& rStatusBar );
  5077.     void            Clear();
  5078.  
  5079.     USHORT          GetItemCount() const;
  5080.     USHORT          GetItemId( USHORT nPos ) const;
  5081.     USHORT          GetItemPos( USHORT nItemId ) const;
  5082.     Rectangle       GetItemRect( USHORT nItemId ) const;
  5083.     USHORT          GetCurItemId() const { return nCurItemId; }
  5084.  
  5085.     void            SetItemText( USHORT nItemId, const String& rText );
  5086.     String          GetItemText( USHORT nItemId ) const;
  5087.  
  5088.     void            SetText( const String& rText );
  5089.  
  5090.     Link            ChangeClickHdl( const Link& rLink );
  5091.     Link            GetClickHdl() const { return aClickHdl; }
  5092.     Link            ChangeDoubleClickHdl( const Link& rLink );
  5093.     Link            GetDoubleClickHdl() const { return aDoubleClickHdl; }
  5094. };
  5095.  
  5096. inline Link StatusBar::ChangeClickHdl( const Link& rLink )
  5097. {
  5098.     Link aOldLink = aClickHdl;
  5099.     aClickHdl = rLink;
  5100.     return aOldLink;
  5101. }
  5102.  
  5103. inline Link StatusBar::ChangeDoubleClickHdl( const Link& rLink )
  5104. {
  5105.     Link aOldLink = aDoubleClickHdl;
  5106.     aDoubleClickHdl = rLink;
  5107.     return aOldLink;
  5108. }
  5109.  
  5110. #endif  
  5111. #endif
  5112. #ifndef SV_NODIALOG
  5113.  
  5114. #ifndef _DIALOG_HXX
  5115. #define _DIALOG_HXX
  5116.  
  5117. #ifndef _SV_H
  5118. #endif
  5119. #ifndef _SYSWIN_HXX
  5120. #endif
  5121. #ifndef _DIALOG_H
  5122. #endif
  5123.  
  5124. class Dialog : public SystemWindow
  5125. {
  5126. protected:
  5127.     ImpDlg  aImpDlg;       
  5128.  
  5129.             Dialog( Window* pParent, WinBits nWinStyle );
  5130.             Dialog( Window* pParent, const ResId& rResId );
  5131.             Dialog( RESOURCE_TYPE nTyp, Window* pParent, WinBits nWinStyle );
  5132.  
  5133. public:
  5134.             ~Dialog();
  5135. };
  5136.  
  5137. class ModelessDialog : public Dialog
  5138. {
  5139. public:
  5140.             ModelessDialog( Window* pParent,
  5141.                             WinBits nWinStyle = WB_STDMODELESS );
  5142.             ModelessDialog( Window* pParent, const ResId& rResId );
  5143.             ~ModelessDialog();
  5144.  
  5145.     BOOL    IsPinIn() const;
  5146. };
  5147.  
  5148. class ModalDialog : public Dialog
  5149. {
  5150. private:
  5151.     void      Show();
  5152.     void      Hide();
  5153.  
  5154. protected:
  5155.     ImpModalDlg aImpModalDlg;
  5156.  
  5157.                 ModalDialog( RESOURCE_TYPE nTyp, Window* pParent,
  5158.                              WinBits nStyle );
  5159.  
  5160.     BOOL        Close();
  5161.  
  5162. public:
  5163.                 ModalDialog( Window* pParent, WinBits nWinStyle = WB_STDMODAL );
  5164.                 ModalDialog( Window* pParent, const ResId& rResId );
  5165.                 ~ModalDialog();
  5166.  
  5167.     short       Execute();
  5168.     BOOL        IsInExecute() const;
  5169.  
  5170.     void        EndDialog( short nResult = 0 );
  5171. };
  5172.  
  5173. #endif  
  5174.  
  5175. #ifndef _MSGBOX_HXX
  5176. #define _MSGBOX_HXX
  5177.  
  5178. #ifndef _SV_H
  5179. #endif
  5180. #ifndef _DIALOG_HXX
  5181. #endif
  5182. #ifndef _MSGBOX_H
  5183. #endif
  5184.  
  5185. #define RET_OK               TRUE
  5186. #define RET_CANCEL           FALSE
  5187. #define RET_YES              2
  5188. #define RET_NO               3
  5189. #define RET_RETRY            4
  5190.  
  5191. class MessBox : public ModalDialog
  5192. {
  5193. protected:
  5194.     ImpMessBox  aImpMess;
  5195.                 MessBox( Window* pParent, WinBits nWinStyle,
  5196.                          const String& rTitle, const String& rMessage,
  5197.                          RESOURCE_TYPE nTyp );
  5198.  
  5199. #ifdef MAC
  5200.     void        Paint( const Rectangle& rRect );
  5201. #endif
  5202.  
  5203. public:
  5204.                 MessBox( Window* pParent, WinBits nWinStyle,
  5205.                          const String& rTitle, const String& rMessage );
  5206.                 MessBox( Window* pParent, const ResId& rResId );
  5207.                 ~MessBox();
  5208.  
  5209.     void        SetMessText( const String& rText );
  5210.     String      GetMessText() const;
  5211.  
  5212.     void        SetButtonText( USHORT nButtonType, const String& rText );
  5213.  
  5214.     short       Execute();
  5215. };
  5216.  
  5217. class InfoBox : public MessBox
  5218. {
  5219. public:
  5220.                 InfoBox( Window* pParent, const String& rMessage );
  5221.                 InfoBox( Window* pParent, const ResId & rResId );
  5222. };
  5223.  
  5224. class WarningBox : public MessBox
  5225. {
  5226. public:
  5227.                 WarningBox( Window* pParent, WinBits nWinStyle,
  5228.                             const String& rMessage );
  5229.                 WarningBox( Window* pParent, const ResId& rResId );
  5230. };
  5231.  
  5232. class ErrorBox : public MessBox
  5233. {
  5234. public:
  5235.                 ErrorBox( Window* pParent, WinBits nWinStyle,
  5236.                           const String& rMessage );
  5237.                 ErrorBox( Window* pParent, const ResId& rResId );
  5238. };
  5239.  
  5240. class QueryBox : public MessBox
  5241. {
  5242. public:
  5243.                 QueryBox( Window* pParent, WinBits nWinStyle,
  5244.                           const String& rMessage );
  5245.                 QueryBox( Window* pParent, const ResId& rResId );
  5246. };
  5247.  
  5248. #endif 
  5249.  
  5250. #ifndef _SYSDLG_HXX
  5251. #define _SYSDLG_HXX
  5252.  
  5253. #ifndef _SV_H
  5254. #endif
  5255. #ifndef _DIALOG_HXX
  5256. #endif
  5257. #ifndef _SYSDLG_H
  5258. #endif
  5259.  
  5260. class SystemDialog : public ModalDialog
  5261. {
  5262. protected:
  5263.     friend class        ImpSysDlg;          
  5264.     ImpSysDlg           aImpSysDlg;         
  5265.  
  5266.                         SystemDialog( RESOURCE_TYPE nTyp, Window* pParent,
  5267.                                       WinBits nWinStyle );
  5268.                         SystemDialog( Window* pParent, const ResId& rResId );
  5269.  
  5270. public:
  5271.                         ~SystemDialog();
  5272. };
  5273.  
  5274. #endif  
  5275.  
  5276. #ifndef _FILDLG_HXX
  5277. #define _FILDLG_HXX
  5278.  
  5279. #ifndef _SV_H
  5280. #endif
  5281. #ifndef _SYSDLG_HXX
  5282. #endif
  5283. #ifndef _FILDLG_H
  5284. #endif
  5285.  
  5286. class FileDialog : public SystemDialog
  5287. {
  5288. private:
  5289.     friend class        ImpFileDlg;     
  5290.     ImpFileDlg          aImpFileDlg;    
  5291.     String              aDfltExt;       
  5292.     Link                aOKHdlLink;     
  5293.     Link                aFileHdlLink;   
  5294.     Link                aFilterHdlLink; 
  5295.  
  5296. protected:
  5297.     virtual long        OK();
  5298.     virtual void        FileSelect();
  5299.     virtual void        FilterSelect();
  5300.  
  5301. public:
  5302.                         FileDialog( Window* pParent, WinBits nWinStyle );
  5303.                         FileDialog( Window* pParent, const ResId & rResId );
  5304.                         ~FileDialog();
  5305.  
  5306.     void                SetPath( const String& rNewPath );
  5307.     String              GetPath() const;
  5308.  
  5309.     void                SetDefaultExt( const String& rExt ) { aDfltExt = rExt; }
  5310.     const String&       GetDefaultExt() const { return aDfltExt; }
  5311.  
  5312.     void                AddFilter( const String& rFilter, const String& rType );
  5313.     void                RemoveFilter( const String& rFilter );
  5314.     void                RemoveAllFilter();
  5315.     void                SetCurFilter( const String& rFilter );
  5316.     String              GetCurFilter() const;
  5317.  
  5318.     Link                ChangeOKHdl( const Link& rLink );
  5319.     Link                GetOKHdl() const { return aOKHdlLink; }
  5320.     Link                ChangeFileSelectHdl( const Link& rLink );
  5321.     Link                GetFileSelectHdl() const { return aFileHdlLink; }
  5322.     Link                ChangeFilterSelectHdl( const Link& rLink );
  5323.     Link                GetFilterSelectHdl() const { return aFilterHdlLink; }
  5324.  
  5325.     short               Execute();
  5326. };
  5327.  
  5328. inline Link FileDialog::ChangeOKHdl( const Link& rLink )
  5329. {
  5330.     Link aOldLink = aOKHdlLink;
  5331.     aOKHdlLink = rLink;
  5332.     return aOldLink;
  5333. }
  5334.  
  5335. inline Link FileDialog::ChangeFileSelectHdl( const Link& rLink )
  5336. {
  5337.     Link aOldLink = aFileHdlLink;
  5338.     aFileHdlLink = rLink;
  5339.     return aOldLink;
  5340. }
  5341.  
  5342. inline Link FileDialog::ChangeFilterSelectHdl( const Link& rLink )
  5343. {
  5344.     Link aOldLink = aFilterHdlLink;
  5345.     aFilterHdlLink = rLink;
  5346.     return aOldLink;
  5347. }
  5348.  
  5349. #endif  
  5350.  
  5351. #ifndef _PRNDLG_HXX
  5352. #define _PRNDLG_HXX
  5353.  
  5354. #ifndef _SV_H
  5355. #endif
  5356. #ifndef _SYSDLG_HXX
  5357. #endif
  5358. #ifndef _PRNDLG_H
  5359. #endif
  5360.  
  5361. class Printer;
  5362.  
  5363. class PrinterSetupDialog : public SystemDialog
  5364. {
  5365. private:
  5366.     friend class        ImpPrnSetupDlg;     
  5367.     ImpPrnSetupDlg      aImpPrnSetupDlg;    
  5368.     Printer*            pPrinter;
  5369.  
  5370. public:
  5371.                         PrinterSetupDialog( Window* pParent, WinBits nWinStyle );
  5372.                         PrinterSetupDialog( Window* pParent, const ResId& rResId );
  5373.                         ~PrinterSetupDialog();
  5374.  
  5375.     Printer*            ChangePrinter( Printer* pPrinter );
  5376.     Printer*            GetPrinter() const { return pPrinter; }
  5377.  
  5378.     short               Execute();
  5379. };
  5380.  
  5381. inline Printer* PrinterSetupDialog::ChangePrinter( Printer* pNewPrinter )
  5382. {
  5383.     Printer* pOldPrn = pPrinter;
  5384.     pPrinter = pNewPrinter;
  5385.     return pOldPrn;
  5386. }
  5387.  
  5388. class PrintDialog : public SystemDialog
  5389. {
  5390. private:
  5391.     friend class        ImpPrintDlg;        
  5392.     ImpPrintDlg         aImpPrintDlg;       
  5393.     PrinterSetupDialog* pSetupDlg;
  5394.     Printer*            pPrinter;
  5395.     USHORT              nCopyCount;
  5396.     USHORT              nFirstPage;
  5397.     USHORT              nLastPage;
  5398.     BOOL                bPageFields;
  5399.     BOOL                bSelection;
  5400.     BOOL                bSelectionCheck;
  5401.     BOOL                bCollate;
  5402.     BOOL                bCollateCheck;
  5403.  
  5404. public:
  5405.                         PrintDialog( Window* pParent, WinBits nWinStyle );
  5406.                         PrintDialog( Window* pParent, const ResId& rResId );
  5407.                         ~PrintDialog();
  5408.  
  5409.     Printer*            ChangePrinter( Printer* pPrinter );
  5410.     Printer*            GetPrinter() const
  5411.                             { return pPrinter; }
  5412.  
  5413.     PrinterSetupDialog* ChangeSetupDialog( PrinterSetupDialog* pSetupDlg );
  5414.     PrinterSetupDialog* GetSetupDialog() const
  5415.                             { return pSetupDlg; }
  5416.  
  5417.     USHORT              ChangeCopyCount( USHORT nCopies = 1 );
  5418.     USHORT              GetCopyCount() const
  5419.                             { return nCopyCount; }
  5420.  
  5421.     USHORT              ChangeFirstPage( USHORT nPage = 1 );
  5422.     USHORT              GetFirstPage() const
  5423.                             { return nFirstPage; }
  5424.     USHORT              ChangeLastPage( USHORT nPage = 1 );
  5425.     USHORT              GetLastPage() const
  5426.                             { return nLastPage; }
  5427.  
  5428.     void                EnablePageFields( BOOL bEnable = TRUE )
  5429.                             { bPageFields = bEnable; }
  5430.     BOOL                IsPageFieldsEnabled() const
  5431.                             { return bPageFields; }
  5432.  
  5433.     void                EnableSelection( BOOL bEnable = TRUE )
  5434.                             { bSelection = bEnable; }
  5435.     BOOL                IsSelectionEnabled() const
  5436.                             { return bSelection; }
  5437.     void                CheckSelection( BOOL bCheck = TRUE )
  5438.                             { bSelectionCheck = bCheck; }
  5439.     BOOL                IsSelectionChecked() const
  5440.                             { return bSelectionCheck; }
  5441.  
  5442.     void                EnableCollate( BOOL bEnable = TRUE )
  5443.                             { bCollate = bEnable; }
  5444.     BOOL                IsCollateEnabled() const
  5445.                             { return bCollate; }
  5446.     void                CheckCollate( BOOL bCheck = TRUE )
  5447.                             { bCollateCheck = bCheck; }
  5448.     BOOL                IsCollateChecked() const
  5449.                             { return bCollateCheck; }
  5450.  
  5451.     short               Execute();
  5452. };
  5453.  
  5454. inline Printer* PrintDialog::ChangePrinter( Printer* pPrn )
  5455. {
  5456.     Printer* pOldPrn = pPrinter;
  5457.     pPrinter = pPrn;
  5458.     return pOldPrn;
  5459. }
  5460.  
  5461. inline PrinterSetupDialog* PrintDialog::ChangeSetupDialog( PrinterSetupDialog* pDlg )
  5462. {
  5463.     PrinterSetupDialog* pOldDlg = pSetupDlg;
  5464.     pSetupDlg = pDlg;
  5465.     return pOldDlg;
  5466. }
  5467.  
  5468. inline USHORT PrintDialog::ChangeCopyCount( USHORT nCopies )
  5469. {
  5470.     USHORT nOldCount = nCopyCount;
  5471.     nCopyCount = nCopies;
  5472.     return nOldCount;
  5473. }
  5474.  
  5475. inline USHORT PrintDialog::ChangeFirstPage( USHORT nPage )
  5476. {
  5477.     USHORT nOldPage = nFirstPage;
  5478.     nFirstPage = nPage;
  5479.     return nOldPage;
  5480. }
  5481.  
  5482. inline USHORT PrintDialog::ChangeLastPage( USHORT nPage )
  5483. {
  5484.     USHORT nOldPage = nLastPage;
  5485.     nLastPage = nPage;
  5486.     return nOldPage;
  5487. }
  5488.  
  5489. #endif  
  5490.  
  5491. #ifndef _COLDLG_HXX
  5492. #define _COLDLG_HXX
  5493.  
  5494. #ifndef _SV_H
  5495. #endif
  5496. #ifndef _COLOR_HXX
  5497. #endif
  5498. #ifndef _SYSDLG_HXX
  5499. #endif
  5500. #ifndef _COLDLG_H
  5501. #endif
  5502.  
  5503. class ColorDialog : public SystemDialog
  5504. {
  5505. private:
  5506.     friend class    ImpColorDlg;        
  5507.     ImpColorDlg     aImpColorDlg;       
  5508.     Color           aColor;
  5509.  
  5510. public:
  5511.                     ColorDialog( Window* pParent, WinBits nWinStyle );
  5512.                     ColorDialog( Window* pParent, const ResId& rResId );
  5513.                     ~ColorDialog();
  5514.  
  5515.     Color           ChangeColor( const Color& rColor );
  5516.     Color           GetColor() const { return aColor; }
  5517.  
  5518.     short           Execute();
  5519. };
  5520.  
  5521. #endif  
  5522.  
  5523. #ifndef _FONTDLG_HXX
  5524. #define _FONTDLG_HXX
  5525.  
  5526. #ifndef _SV_H
  5527. #endif
  5528. #ifndef _GDIOBJ_HXX
  5529. #endif
  5530. #ifndef _SYSDLG_HXX
  5531. #endif
  5532. #ifndef _FONTDLG_H
  5533. #endif
  5534.  
  5535. class Printer;
  5536.  
  5537. class FontDialog : public SystemDialog
  5538. {
  5539. private:
  5540.     friend class    ImpFontDlg;         
  5541.     friend class    OWFontDialog;       
  5542.     ImpFontDlg      aImpFontDlg;        
  5543.     Font            aFont;
  5544.     Printer*        pPrinter;
  5545.     BOOL            bFixedFontsOnly;
  5546.  
  5547. public:
  5548.                     FontDialog( Window* pParent, WinBits nWinStyle );
  5549.                     FontDialog( Window* pParent, const ResId& rResId );
  5550.                     ~FontDialog();
  5551.  
  5552.     Font            ChangeFont( const Font& rFont );
  5553.     Font            GetFont() const { return aFont; }
  5554.  
  5555.     Printer*        ChangePrinter( Printer* pNewPrinter );
  5556.     Printer*        GetPrinter() const { return pPrinter; }
  5557.  
  5558.     BOOL            ChangeFixedFontsOnly( BOOL bFixedOnly = TRUE );
  5559.     BOOL            GetFixedFontsOnly() const { return bFixedFontsOnly; }
  5560.  
  5561.     short           Execute();
  5562. };
  5563.  
  5564. #endif  
  5565. #endif
  5566. #endif
  5567. #ifndef SV_NOMISC
  5568.  
  5569. #ifndef _MENU_HXX
  5570. #define _MENU_HXX
  5571.  
  5572. #ifndef _SV_H
  5573. #endif
  5574. #ifndef _RESID_HXX
  5575. #endif
  5576. #ifndef _RC_HXX
  5577. #endif
  5578. #ifndef _MENU_H
  5579. #endif
  5580.  
  5581. class KeyCode;
  5582. class PopupMenu;
  5583. class Bitmap;
  5584. class HelpEvent;
  5585.  
  5586. #define MENU_APPEND         ((USHORT)0xFFFF)
  5587. #define MENU_ITEM_NOTFOUND  ((USHORT)0xFFFF)
  5588.  
  5589. enum MenuItemType { MENUITEM_DONTKNOW, MENUITEM_STRING, MENUITEM_BITMAP,
  5590.                     MENUITEM_SEPARATOR };
  5591.  
  5592. class Menu : public Resource
  5593. {
  5594. protected:
  5595.     ImpMenu         aImpMenu;               
  5596.  
  5597.                     Menu();
  5598.                     Menu( const ResId& );   
  5599.  
  5600.     virtual void    Activate();
  5601.     virtual void    Deactivate();
  5602.     virtual void    Highlight();
  5603.     virtual void    Select();
  5604.     virtual void    RequestHelp( const HelpEvent& rHEvt );
  5605.  
  5606. public:
  5607.     virtual         ~Menu();
  5608.  
  5609.     BOOL            InsertItem( const ResId& rResId, USHORT nPos = MENU_APPEND );
  5610.     BOOL            InsertItem( USHORT nItemId, const String& rStr,
  5611.                                 USHORT nPos = MENU_APPEND,
  5612.                                 MenuItemBits nItemStyle = 0 );
  5613.     BOOL            InsertItem( USHORT nItemId, const Bitmap& rBitmap,
  5614.                                 USHORT nPos = MENU_APPEND,
  5615.                                 MenuItemBits nItemStyle = 0 );
  5616.     void            InsertSeparator( USHORT nPos = MENU_APPEND );
  5617.     void            RemoveItem( USHORT nPos );
  5618.     void            Clear();
  5619.  
  5620.     USHORT          GetItemCount() const;
  5621.     USHORT          GetItemId( USHORT nPos ) const;
  5622.     USHORT          GetItemPos( USHORT nItemId ) const;
  5623.     MenuItemType    GetItemType( USHORT nPos ) const;
  5624.     USHORT          GetCurItemId() const;
  5625.  
  5626.     PopupMenu*      ChangePopupMenu( USHORT nItemId, PopupMenu* pMenu );
  5627.     PopupMenu*      GetPopupMenu( USHORT nItemId ) const;
  5628.  
  5629.     KeyCode         ChangeAccelKey( USHORT nItemId, const KeyCode& rKeyCode );
  5630.     KeyCode         GetAccelKey( USHORT nItemId ) const;
  5631.  
  5632.     void            CheckItem( USHORT nItemId, BOOL bCheck = TRUE );
  5633.     BOOL            IsItemChecked( USHORT nItemId ) const;
  5634.  
  5635.     void            EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
  5636.     BOOL            IsItemEnabled( USHORT nItemId ) const;
  5637.  
  5638.     void            SetItemText( USHORT nItemId, const String& rStr );
  5639.     String          GetItemText( USHORT nItemId ) const;
  5640.  
  5641.     void            SetItemBitmap( USHORT nItemId, const Bitmap& rBitmap );
  5642.     Bitmap          GetItemBitmap( USHORT nItemId ) const;
  5643.  
  5644.     void            SetHelpText( USHORT nItemId, const String& rString );
  5645.     String          GetHelpText( USHORT nItemId ) const;
  5646.  
  5647.     ULONG           ChangeHelpId( USHORT nItemId, ULONG nHelpId );
  5648.     ULONG           GetHelpId( USHORT nItemId ) const;
  5649.  
  5650.     void            PushActivateHdl( const Link& rLink );
  5651.     Link            PopActivateHdl();
  5652.     void            PushDeactivateHdl( const Link& rLink );
  5653.     Link            PopDeactivateHdl();
  5654.     void            PushHighlightHdl( const Link& rLink );
  5655.     Link            PopHighlightHdl();
  5656.     void            PushSelectHdl( const Link& rLink );
  5657.     Link            PopSelectHdl();
  5658.  
  5659.     Menu&           operator =( const Menu& rMenu );
  5660. };
  5661.  
  5662. class MenuBar : public Menu
  5663. {
  5664. public:
  5665.                 MenuBar();
  5666.                 MenuBar( const MenuBar& rMenu );
  5667.                 MenuBar( const ResId& rResId );
  5668.  
  5669.     MenuBar&    operator =( const MenuBar& rMenu )
  5670.                     { Menu::operator =( rMenu ); return *this; }
  5671. };
  5672.  
  5673. class PopupMenu : public Menu
  5674. {
  5675. public:
  5676.                 PopupMenu();
  5677.                 PopupMenu( const PopupMenu& rMenu );
  5678.                 PopupMenu( const ResId& rResId );
  5679.  
  5680.     void        SetText( const String& rTitle );
  5681.     String      GetText() const;
  5682.  
  5683.     USHORT      Execute( const Point& rPopupPos );
  5684.  
  5685.     PopupMenu&  operator =( const PopupMenu& rMenu )
  5686.                     { Menu::operator =( rMenu ); return *this; }
  5687. };
  5688.  
  5689. #endif 
  5690.  
  5691. #ifndef _GDIMTF_HXX
  5692. #define _GDIMTF_HXX
  5693.  
  5694. #ifndef _SV_H
  5695. #endif
  5696.  
  5697. #ifndef _MAPMOD_HXX
  5698. #endif
  5699. #ifndef _PAL_HXX
  5700. #endif
  5701.  
  5702. class OutputDevice;
  5703. class istream;
  5704. class ostream;
  5705. class ImpSysMetaFile;
  5706.  
  5707. class GDIMetaFile : public MetaFile
  5708. {
  5709. private:
  5710.     GDIMetaFile*    pPrev;
  5711.     GDIMetaFile*    pNext;
  5712.     Size            aPrefSize;
  5713.     MapMode         aPrefMapMode;
  5714.     Palette         aPrefPalette;
  5715.     ImpSysMetaFile* pSysMetaFile;
  5716.  
  5717. protected:
  5718.     void            AddGDIAction( MetaAction* pAction );
  5719.     void            Linker( void* pObject, BOOL bLink );
  5720.  
  5721. public:
  5722.                     GDIMetaFile();
  5723.                     GDIMetaFile( const GDIMetaFile& rMtf );
  5724.                     ~GDIMetaFile();
  5725.  
  5726.     void            Clear();
  5727.  
  5728.     void            Record( OutputDevice* pOutDev )
  5729.                         { MetaFile::Record( (void*)pOutDev ); }
  5730.     void            Play( OutputDevice* pOutDev, ULONG nPos = METAFILE_END );
  5731.     void            Play( GDIMetaFile& rMtf, ULONG nPos = METAFILE_END )
  5732.                         { MetaFile::Play( rMtf, nPos ); }
  5733.     void            Play( OutputDevice* pOutDev,
  5734.                           const Point& rPos, const Size& rSize,
  5735.                           ULONG nPos = METAFILE_END );
  5736.  
  5737.     Size            ChangePrefSize( const Size& rSize );
  5738.     const Size&     GetPrefSize() const { return aPrefSize; }
  5739.     MapMode         ChangePrefMapMode( const MapMode& eMapMode );
  5740.     const MapMode&  GetPrefMapMode() const { return aPrefMapMode; }
  5741.     Palette         ChangePrefPalette( const Palette& rPalette );
  5742.     const Palette&  GetPrefPalette() const { return aPrefPalette; }
  5743.  
  5744.     GDIMetaFile&    operator=( const GDIMetaFile& rMtf );
  5745.  
  5746.     BOOL            SaveStatus();
  5747.  
  5748.     friend istream& operator>>( istream& rIStream, GDIMetaFile& rGDIMetaFile );
  5749.     friend ostream& operator<<( ostream& rOStream, const GDIMetaFile& rGDIMetaFile );
  5750. };
  5751.  
  5752. #endif 
  5753.  
  5754. #ifndef _POLY_HXX
  5755. #define _POLY_HXX
  5756.  
  5757. #ifndef _SV_H
  5758. #endif
  5759.  
  5760. class ImpPolygon;
  5761. class ImpPolyPolygon;
  5762.  
  5763. class Polygon
  5764. {
  5765. protected:
  5766.  
  5767.     ImpPolygon* pImpPolygon;
  5768.  
  5769. public:
  5770.              Polygon( USHORT nSize = 16 );
  5771.              Polygon( USHORT nPoints, Point aPtAry[] );
  5772.              Polygon( const Rectangle& rRect );
  5773.              Polygon( const Polygon& rPoly );
  5774.              ~Polygon();
  5775.  
  5776.     Point    ChangePoint( const Point& rPt, USHORT nPos );
  5777.     Point    GetPoint( USHORT nPos ) const;
  5778.  
  5779.     USHORT   ChangeSize( USHORT nNewSize );
  5780.     USHORT   GetSize() const;
  5781.     void     Clear();
  5782.  
  5783.     Point    operator[]( USHORT nPos ) const;
  5784.     Point&   operator[]( USHORT nPos );
  5785.     Polygon& operator=( const Polygon& rPoly );
  5786.     BOOL     operator==( const Polygon& rPoly ) const;
  5787.     BOOL     operator!=( const Polygon& aPoly ) const;
  5788. };
  5789.  
  5790. #define POLYPOLY_APPEND     0xFFFF
  5791.  
  5792. class PolyPolygon
  5793. {
  5794. protected:
  5795.     ImpPolyPolygon* pImpPolyPolygon;
  5796.  
  5797. public:
  5798.  
  5799.              PolyPolygon( USHORT nInitSize = 16, USHORT nResize = 16 );
  5800.              PolyPolygon( const Polygon& rPoly );
  5801.              PolyPolygon( USHORT nPoly, USHORT nPointCountAry[], Point aPtAry[] );
  5802.              PolyPolygon( const PolyPolygon& rPolyPoly );
  5803.              ~PolyPolygon();
  5804.  
  5805.     void     Insert( const Polygon& rPoly, USHORT nPos = POLYPOLY_APPEND );
  5806.     Polygon  Remove( USHORT nPos );
  5807.     Polygon  Replace( const Polygon& rPoly, USHORT nPos );
  5808.     Polygon  GetObject( USHORT nPos ) const;
  5809.  
  5810.     void     Clear();
  5811.     USHORT   Count() const;
  5812.  
  5813.     PolyPolygon& operator=( const PolyPolygon& rPolyPoly );
  5814.     BOOL         operator==( const PolyPolygon& rPolyPoly ) const;
  5815.     BOOL         operator!=( const PolyPolygon& rPolyPoly ) const;
  5816. };
  5817.  
  5818. #endif  
  5819.  
  5820. #ifndef _CONFIG_HXX
  5821. #define _CONFIG_HXX
  5822.  
  5823. #ifndef _SV_H
  5824. #endif
  5825.  
  5826. class ConfigData;
  5827.  
  5828. class Config
  5829. {
  5830. protected:
  5831.     ConfigData* pData;
  5832.  
  5833. public:
  5834.                 Config();
  5835.                 Config( const String& rFileName );
  5836.                 Config( const Config& rConfig );
  5837.                 ~Config();
  5838.  
  5839.     String      GetPathName() const;
  5840.  
  5841.     void        SetGroup( const String& rGroup );
  5842.     String      GetGroup() const;
  5843.     void        DeleteGroup( const String& rGroup );
  5844.  
  5845.     String      ReadKey( const String& rKey ) const;
  5846.     String      ReadKey( const String& rKey, const String& rDefault ) const;
  5847.     void        WriteKey( const String& rKey, const String& rValue );
  5848.     void        DeleteKey( const String& rKey );
  5849.     USHORT      GetKeyCount() const;
  5850.     String      GetKeyName( USHORT nKey ) const;
  5851.     String      ReadKey( USHORT nKey ) const;
  5852.  
  5853.     Config&     operator = ( const Config& rConfig );
  5854.     BOOL        operator ==( const Config& rConfig ) const;
  5855.     BOOL        operator !=( const Config& rConfig ) const;
  5856. };
  5857.  
  5858. #endif 
  5859.  
  5860. #ifndef _CURSOR_HXX
  5861. #define _CURSOR_HXX
  5862.  
  5863. #ifndef _SV_H
  5864. #endif
  5865. #ifndef _CURSOR_H
  5866. #endif
  5867.  
  5868. class Cursor
  5869. {
  5870. protected:
  5871.     short     nSlant;           
  5872.     Size      aSize;            
  5873.     Point     aPos;             
  5874.     BOOL      bVisible;         
  5875.     ImpCursor aImpCursor;       
  5876.  
  5877. public:
  5878.               Cursor();
  5879.               Cursor( const Cursor& rCursor );
  5880.               ~Cursor();
  5881.  
  5882.     void      Show();
  5883.     void      Hide();
  5884.     BOOL      IsVisible() const { return bVisible; }
  5885.  
  5886.     Point     ChangePos( const Point& rNewPos );
  5887.     Point     GetPos() const { return aPos; }
  5888.  
  5889.     Size      ChangeSize( const Size& rNewSize );
  5890.     Size      GetSize() const { return aSize; }
  5891.  
  5892.     short     ChangeSlant( short nSlant = 0 );
  5893.     short     GetSlant() const { return nSlant; }
  5894.  
  5895.     Cursor&   operator=( const Cursor& rCursor );
  5896.  
  5897.     BOOL      operator==( const Cursor& rCursor ) const;
  5898.     BOOL      operator!=( const Cursor& rCursor ) const;
  5899. };
  5900.  
  5901. #endif 
  5902.  
  5903. #ifndef _CLIP_HXX
  5904. #define _CLIP_HXX
  5905.  
  5906. #ifndef _SV_H
  5907. #endif
  5908. #ifndef _BITMAP_HXX
  5909. #endif
  5910.  
  5911. class GDIMetaFile;
  5912.  
  5913. #define FORMAT_STRING         1
  5914. #define FORMAT_BITMAP         2
  5915. #define FORMAT_GDIMETAFILE    3
  5916. #define FORMAT_PRIVATE        4
  5917. #define FORMAT_FILE           5
  5918.  
  5919. class ImpExchange;
  5920.  
  5921. class Exchange
  5922. {
  5923. protected:
  5924.     Link            aRequestHdl;
  5925.  
  5926.     virtual void    Request();
  5927.  
  5928.                     Exchange();
  5929.                     ~Exchange();
  5930. public:
  5931.  
  5932.     static ULONG    RegisterFormatName( const String& rName );
  5933.     static String   GetFormatName( ULONG nFormat );
  5934.  
  5935.     Link            ChangeRequestHdl( const Link& rLink );
  5936.     Link            GetRequestHdl() const    { return aRequestHdl; }
  5937. };
  5938.  
  5939. inline Link Exchange::ChangeRequestHdl( const Link& rLink )
  5940. {
  5941.     Link aOldLink = aRequestHdl;
  5942.     aRequestHdl = rLink;
  5943.     return aOldLink;
  5944. }
  5945.  
  5946. class Clipboard : public Exchange
  5947. {
  5948. protected:
  5949.     Link            aClearedHdl;
  5950.  
  5951.     virtual void    Cleared();
  5952.  
  5953. public:
  5954.                     Clipboard();
  5955.                     ~Clipboard();
  5956.  
  5957.     static void     Clear();
  5958.  
  5959.     static BOOL     CopyString( const String& rStr );
  5960.     static BOOL     CopyBitmap( const Bitmap& rBitmap );
  5961.     static BOOL     CopyGDIMetaFile( const GDIMetaFile& rGDIMetaFile );
  5962.     static BOOL     CopyPrivateData( void* pData );
  5963.     static BOOL     CopyData( const void* pData, ULONG nLen,
  5964.                               ULONG nFormat, USHORT nTypeLen = 8 );
  5965.     static BOOL     CopyRequest( ULONG nFormat );
  5966.  
  5967.     static String   PasteString();
  5968.     static Bitmap   PasteBitmap();
  5969.     static BOOL     PasteGDIMetaFile( GDIMetaFile& rGDIMetaFile );
  5970.     static void*    PastePrivateData();
  5971.     static BOOL     PasteData( void* pBuf, ULONG nLen, ULONG nFormat );
  5972.     static ULONG    GetDataLen( ULONG nFormat );
  5973.  
  5974.     static USHORT   GetFormatCount();
  5975.     static ULONG    GetFormat( USHORT nPos );
  5976.     static BOOL     HasFormat( ULONG nFormat );
  5977.  
  5978.     static ULONG    GetRequestFormat();
  5979.  
  5980.     Link            ChangeClearedHdl( const Link& rLink );
  5981.     Link            GetClearedHdl() const    { return aClearedHdl; }
  5982. };
  5983.  
  5984. inline Link Clipboard::ChangeClearedHdl( const Link& rLink )
  5985. {
  5986.     Link aOldLink = aClearedHdl;
  5987.     aClearedHdl = rLink;
  5988.     return aOldLink;
  5989. }
  5990.  
  5991. class DragServer : public Exchange
  5992. {
  5993. public:
  5994.                     DragServer();
  5995.                     ~DragServer();
  5996.  
  5997.     static void     Clear();
  5998.  
  5999.     static void     NewItem();
  6000.     static BOOL     CopyString( const String& rStr );
  6001.     static BOOL     CopyBitmap( const Bitmap& rBitmap );
  6002.     static BOOL     CopyGDIMetaFile( const GDIMetaFile& rGDIMetaFile );
  6003.     static BOOL     CopyPrivateData( void* pData );
  6004.     static BOOL     CopyFile( const String& rStr );
  6005.     static BOOL     CopyData( const void* pData, ULONG nLen,
  6006.                               ULONG nFormat, USHORT nTypeLen = 8 );
  6007.     static BOOL     CopyRequest( ULONG nFormat );
  6008.  
  6009.     static USHORT   GetItemCount();
  6010.     static String   PasteString( USHORT nItem );
  6011.     static Bitmap   PasteBitmap( USHORT nItem );
  6012.     static BOOL     PasteGDIMetaFile( USHORT nItem, GDIMetaFile& rGDIMetaFile );
  6013.     static void*    PastePrivateData( USHORT nItem );
  6014.     static String   PasteFile( USHORT nItem );
  6015.     static BOOL     PasteData( USHORT nItem, void* pBuf,
  6016.                                ULONG nLen, ULONG nFormat );
  6017.     static ULONG    GetDataLen( USHORT nItem, ULONG nFormat );
  6018.  
  6019.     static USHORT   GetFormatCount( USHORT nItem );
  6020.     static ULONG    GetFormat( USHORT nItem, USHORT nPos );
  6021.     static BOOL     HasFormat( USHORT nItem, ULONG nFormat );
  6022.  
  6023.     static USHORT   GetRequestItem();
  6024.     static ULONG    GetRequestFormat();
  6025.  
  6026.     static String   GetTargetPrinterName();
  6027. };
  6028.  
  6029. #endif 
  6030.  
  6031. #ifndef _ACCEL_HXX
  6032. #define _ACCEL_HXX
  6033.  
  6034. #ifndef _SV_H
  6035. #endif
  6036. #ifndef _RESID_HXX
  6037. #endif
  6038. #ifndef _KEYCOD_HXX
  6039. #endif
  6040. #ifndef _APP_HXX
  6041. #endif
  6042. #ifndef _RC_HXX
  6043. #endif
  6044.  
  6045. class AccelData;
  6046. class AccelList;
  6047.  
  6048. class Accelerator : public Resource
  6049. {
  6050. private:
  6051.     AccelData*      pData;
  6052.     String          aHelpStr;
  6053.  
  6054.     KeyCode         aCurKeyCode;
  6055.     USHORT          nCurId;
  6056.     USHORT          nCurRepeat;
  6057.     AccelList*      pCurAccelList;
  6058.     BOOL            bIsCancel;
  6059.     AccelType       eType;
  6060.  
  6061. protected:
  6062.  
  6063.     virtual void    Activate();
  6064.     virtual void    Deactivate();
  6065.     virtual void    Select();
  6066.  
  6067. public:
  6068.                     Accelerator();
  6069.                     Accelerator( const Accelerator& rAccel );
  6070.                     Accelerator( const ResId& rResId );
  6071.     virtual         ~Accelerator();
  6072.  
  6073.     BOOL            InsertItem( USHORT nItemId, const KeyCode& rKeyCode );
  6074.     BOOL            InsertItem( const ResId& rResId );
  6075.     void            RemoveItem( USHORT nItemId );
  6076.     void            Clear();
  6077.  
  6078.     USHORT          GetCurItemId() const
  6079.                         { return nCurId; }
  6080.     KeyCode         GetCurKeyCode() const
  6081.                         { return aCurKeyCode; }
  6082.     USHORT          GetCurRepeat() const
  6083.                         { return nCurRepeat; }
  6084.     BOOL            IsCancel() const
  6085.                         { return bIsCancel; }
  6086.  
  6087.     USHORT          GetItemCount() const;
  6088.     USHORT          GetItemId( USHORT nPos ) const;
  6089.     USHORT          GetItemId( const KeyCode& rKeyCode ) const;
  6090.  
  6091.     Accelerator*    ChangeAccel( USHORT nItemId, Accelerator* pAccel );
  6092.     Accelerator*    GetAccel( USHORT nItemId ) const;
  6093.  
  6094.     BOOL            EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
  6095.     BOOL            IsItemEnabled( USHORT nItemId ) const;
  6096.  
  6097.     KeyCode         ChangeKeyCode( USHORT nItemId, const KeyCode& rKeyCode );
  6098.     KeyCode         GetKeyCode( USHORT nItemId ) const;
  6099.  
  6100.     void            SetHelpText( const String& rHelpText )
  6101.                         { aHelpStr = rHelpText; }
  6102.     String          GetHelpText() const
  6103.                         { return aHelpStr; }
  6104.  
  6105.     void            PushActivateHdl( const Link& rLink );
  6106.     Link            PopActivateHdl();
  6107.     void            PushDeactivateHdl( const Link& rLink );
  6108.     Link            PopDeactivateHdl();
  6109.     void            PushSelectHdl( const Link& rLink );
  6110.     Link            PopSelectHdl();
  6111.  
  6112.     Accelerator&    operator=( const Accelerator& rAccel );
  6113. };
  6114.  
  6115. #endif 
  6116.  
  6117. #ifndef _PRVWIN_HXX
  6118. #define _PRVWIN_HXX
  6119.  
  6120. #ifndef _PRINT_HXX
  6121. #endif
  6122. #ifndef _WINDOW_HXX
  6123. #endif
  6124.  
  6125. class Willy;
  6126.  
  6127. class Preview : public Window, public Printer
  6128. {
  6129.     friend class Willy;
  6130.  
  6131. protected:
  6132.     Willy*          pWilly;
  6133.     USHORT          nRequestPage;
  6134.     USHORT          nCurPage;
  6135.     PageMetaFile*   pCurPage;
  6136.     short           nMetaAction;
  6137.     Point           aPageOffset;
  6138.     Size            aPrinterPageSize;
  6139.     Size            aPrinterPageOffset;
  6140.     Size            aPrinterOutputSize;
  6141.     Region          aWinClipRegion;
  6142.     BOOL            bIsWinClipRegion;
  6143.     Fraction        aCurZoomFactor;
  6144.     Link            aRequestPageLink;
  6145.  
  6146.     void            Paint( const Rectangle& );
  6147.     void            InsertNewPage( PageMetaFile* pPage );
  6148.     long            PageHookHdl( MetaFile* pMetaFile );
  6149.  
  6150.     virtual void    RequestPage();
  6151.  
  6152. public:
  6153.                     Preview( Window* pParent, WinBits nWinStyle = 0 );
  6154.                     ~Preview();
  6155.  
  6156.     void            SetPageQueueSize( USHORT nPages );
  6157.  
  6158.     USHORT          ChangeCurPage( USHORT nCurPage = 1 );
  6159.     USHORT          GetCurPage() const { return nCurPage; }
  6160.  
  6161.     Fraction        ChangeZoomFactor( const Fraction& rFactor );
  6162.     Fraction        GetZoomFactor() const { return aCurZoomFactor; }
  6163.  
  6164.     Point           ChangePageOffset( const Point& rOffset );
  6165.     Point           GetPageOffset() const { return aPageOffset; }
  6166.     Size            GetVisibleSize() const;
  6167.  
  6168.     Size            CalcWindowSizePixel( const Size& rMaxSize ) const;
  6169.  
  6170.     Link            ChangeRequestPageHdl( const Link& rLink );
  6171.     Link            GetRequestPageHdl() const { return aRequestPageLink; }
  6172.  
  6173.     USHORT          GetRequestPage() const { return nRequestPage; }
  6174. };
  6175.  
  6176. inline Link Preview::ChangeRequestPageHdl( const Link& rLink )
  6177. {
  6178.     Link aOldLink = aRequestPageLink;
  6179.     aRequestPageLink = rLink;
  6180.     return aOldLink;
  6181. }
  6182.  
  6183. #endif  
  6184.  
  6185. #ifndef _GRAPH_HXX
  6186. #define _GRAPH_HXX
  6187.  
  6188. #ifndef _SV_H
  6189. #endif
  6190. #ifndef _MAPMOD_HXX
  6191. #endif
  6192. #ifndef _BITMAP_HXX
  6193. #endif
  6194. #ifndef _GDIMTF_HXX
  6195. #endif
  6196.  
  6197. class OutputDevice;
  6198. class ImpSwapFile;
  6199. class istream;
  6200. class ostream;
  6201.  
  6202. enum GraphicType { GRAPHIC_NONE, GRAPHIC_BITMAP, GRAPHIC_GDIMETAFILE,
  6203.                    GRAPHIC_WINMETAFILE, GRAPHIC_WNTMETAFILE,
  6204.                    GRAPHIC_OS2METAFILE, GRAPHIC_MACPICT };
  6205.  
  6206. class Graphic
  6207. {
  6208. protected:
  6209.     Bitmap          aBitmap;
  6210.     Size            aBitmapSize;
  6211.     GDIMetaFile     aMetaFile;
  6212.     ULONG           nOtherMetaFileLen;
  6213.     void*           pOtherMetaFile;
  6214.     Size            aOtherMetaFileSize;
  6215.     MapMode         aOtherMetaFileMapMode;
  6216.     GraphicType     eType;
  6217.     ImpSwapFile*    pSwapFile;
  6218.     String          aDocFileName;
  6219.     ULONG           nDocFilePos;
  6220.     BOOL            bSwapOut;
  6221.     BOOL            bSwapUnderway;
  6222.  
  6223.     BOOL            ImpIsSupportedGraphic( GraphicType eType ) const;
  6224.  
  6225. public:
  6226.                     Graphic();
  6227.                     Graphic( const Graphic& rGraphic );
  6228.                     Graphic( const Bitmap& rBmp );
  6229.                     Graphic( const GDIMetaFile& rMtf );
  6230.                     ~Graphic();
  6231.  
  6232.     void            Clear();
  6233.     GraphicType     GetType() const { return eType; }
  6234.     Bitmap          GetBitmap() const;
  6235.     GDIMetaFile     GetGDIMetaFile() const;
  6236.     BOOL            IsSupportedGraphic() const
  6237.                         { return ImpIsSupportedGraphic( eType ); }
  6238.  
  6239.     Size            GetPrefSize() const;
  6240.     MapMode         GetPrefMapMode() const;
  6241.  
  6242.     void            Draw( OutputDevice* pOutDev, const Point& rDestPt );
  6243.     void            Draw( OutputDevice* pOutDev,
  6244.                           const Point& rDestPt, const Size& rDestSize );
  6245.  
  6246.     BOOL            Copy();
  6247.     BOOL            Paste();
  6248.  
  6249.     Graphic&        operator=( const Graphic& rGraphic );
  6250.     BOOL            operator==( const Graphic& rGraphic ) const;
  6251.     BOOL            operator!=( const Graphic& rGraphic ) const;
  6252.  
  6253.     friend          istream& operator>>( istream& rIStream, Graphic& rGraphic );
  6254.     friend          ostream& operator<<( ostream& rOStream, const Graphic& rGraphic );
  6255.  
  6256.     BOOL            ReadEmbedded( istream& rIStream, BOOL bSwap=FALSE );
  6257.     BOOL            WriteEmbedded( ostream& rOStream );
  6258.  
  6259.     void            SetDocFileName( const String& rName, ULONG nFilePos );
  6260.     String          GetDocFileName() const { return aDocFileName; }
  6261.     ULONG           GetDocFilePos() const { return nDocFilePos; }
  6262.  
  6263.     BOOL            SwapOut();
  6264.     BOOL            SwapIn();
  6265.     BOOL            IsSwapOut() const { return bSwapOut; }
  6266. };
  6267.  
  6268. #endif  
  6269.  
  6270. #ifndef _SOUND_HXX
  6271. #define _SOUND_HXX
  6272.  
  6273. #ifndef _SV_H
  6274. #endif
  6275.  
  6276. enum SoundType { SOUND_DEFAULT, SOUND_INFO, SOUND_WARNING,
  6277.                  SOUND_ERROR, SOUND_QUERY };
  6278.  
  6279. class Sound
  6280. {
  6281. public:
  6282.     static void Beep( SoundType eType = SOUND_DEFAULT );
  6283. };
  6284.  
  6285. #endif 
  6286. #endif
  6287. #ifndef DBG_UTIL
  6288. void DebugPrintMsgBox( const char* pLine );
  6289. inline void DbgError( const char* pMsg, const char* = NULL, USHORT = 0 )
  6290. { DebugPrintMsgBox( pMsg ); }
  6291. #endif
  6292. #endif
  6293. #if defined( _MSC_VER ) || defined( __SC__ )
  6294. #undef protected
  6295. #endif
  6296. #if defined( ALPHA ) && defined( WNT )
  6297. #undef protected
  6298. #endif
  6299. #endif
  6300.