PageGrid.cpp
上传用户:sesekoo
上传日期:2020-07-18
资源大小:21543k
文件大小:151k
源码类别:

界面编程

开发平台:

Visual C++

  1. // PageGrid.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "profuis_controls.h"
  5. #include "PageGrid.h"
  6. #if (!defined __EXT_MFC_NO_GRIDWND)
  7. IMPLEMENT_SERIAL( CExtGridCellCheckBoxEye, CExtGridCellCheckBox, VERSIONABLE_SCHEMA|1 );
  8. #endif // (!defined __EXT_MFC_NO_GRIDWND)
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14. #if (!defined __EXT_MFC_NO_GRIDWND)
  15. #define __COLUMN_NUM_BOOLEAN              0L
  16. #define __COLUMN_NUM_CHECKBOX             1L
  17. #define __COLUMN_NUM_RADIOBUTTON          2L
  18. #define __COLUMN_NUM_COLOR                3L
  19. #define __COLUMN_NUM_COMBOBOX             4L
  20. #define __COLUMN_NUM_CHECKCOMBOBOX        5L
  21. #define __COLUMN_NUM_DATETIME             6L
  22. #define __COLUMN_NUM_DURATION             7L
  23. #define __COLUMN_NUM_PROGRESS             8L
  24. #define __COLUMN_NUM_HYPERLINK            9L
  25. #define __COLUMN_NUM_IPADDRESS           10L
  26. #define __COLUMN_NUM_NUMBER              11L
  27. #define __COLUMN_NUM_CURRENCY            12L
  28. #define __COLUMN_NUM_SCIENTIFIC          13L
  29. #define __COLUMN_NUM_FRACTION            14L
  30. #define __COLUMN_NUM_PERCENTAGE          15L
  31. #define __COLUMN_NUM_VARIANT             16L
  32. #define __COLUMN_NUM_UPDOWN              17L
  33. #define __COLUMN_NUM_PICTURE             18L
  34. #define __COLUMN_NUM_SLIDER              19L
  35. #define __COLUMN_NUM_TEXT                20L
  36. #define __COLUMN_NUM_PASSWORD            21L
  37. #define __COLUMN_NUM_FILE                22L
  38. #define __COLUMN_NUM_FILEIMAGE           23L
  39. #define __COLUMN_NUM_FOLDER              24L
  40. #define __COLUMN_NUM_FONT                25L
  41. #define __COLUMN_NUM_FONTFACENAME        26L
  42. #define __COLUMN_NUM_FONTWEIGHT          27L
  43. #define __COLUMN_NUM_COLORPART           28L
  44. #define __COLUMN_NUM_RECTPART            29L
  45. #define __COLUMN_NUM_INPLACE_SLIDER      30L
  46. #define __COLUMN_NUM_INPLACE_SCROLLBAR   31L
  47. #define __COLUMN_NUM_HOTKEY  32L
  48. #define __COLUMN_NUM_BUTTON  33L
  49. #define __COLUMN_NUM_OBJECT_SIZE  34L
  50. #define __COLUMN_NUM_GEOGRAPHIC  35L
  51. #define __COLUMN_NUM_MASKED_STRING  36L
  52. #define __COLUMN_NUM_SYSTEM_NUMBER  37L
  53. #define __COLUMN_NUM_SYSTEM_CURRENCY  38L
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CPageGrid dialog
  56. CPageGrid::CPageGrid(CWnd* pParent /*=NULL*/)
  57. : CPageBase(CPageGrid::IDD, pParent)
  58. {
  59. //{{AFX_DATA_INIT(CPageGrid)
  60. //}}AFX_DATA_INIT
  61. }
  62. void CPageGrid::DoDataExchange(CDataExchange* pDX)
  63. {
  64. CPageBase::DoDataExchange(pDX);
  65. //{{AFX_DATA_MAP(CPageGrid)
  66. DDX_Control(pDX, IDC_CELL_BOOLEAN, m_wndCellBoolean);
  67. DDX_Control(pDX, IDC_CELL_CHECKBOX, m_wndCellCheckBox);
  68. DDX_Control(pDX, IDC_CELL_RADIOBUTTON, m_wndCellRadioButton);
  69. DDX_Control(pDX, IDC_CELL_COLOR, m_wndCellColor);
  70. DDX_Control(pDX, IDC_CELL_COMBOBOX, m_wndCellComboBox);
  71. DDX_Control(pDX, IDC_CELL_CHECKCOMBOBOX, m_wndCellCheckComboBox);
  72. DDX_Control(pDX, IDC_CELL_DATETIME, m_wndCellDateTime);
  73. DDX_Control(pDX, IDC_CELL_DURATION, m_wndCellDuration);
  74. DDX_Control(pDX, IDC_CELL_PROGRESS, m_wndCellProgress);
  75. DDX_Control(pDX, IDC_CELL_HYPERLINK, m_wndCellHyperlink);
  76. DDX_Control(pDX, IDC_CELL_IPADDRESS, m_wndCellIPAddress);
  77. DDX_Control(pDX, IDC_CELL_NUMBER, m_wndCellNumber);
  78. DDX_Control(pDX, IDC_CELL_CURRENCY, m_wndCellCurrency);
  79. DDX_Control(pDX, IDC_CELL_SCIENTIFIC, m_wndCellScientific);
  80. DDX_Control(pDX, IDC_CELL_FRACTION, m_wndCellFraction);
  81. DDX_Control(pDX, IDC_CELL_PERCENTAGE, m_wndCellPercentage);
  82. DDX_Control(pDX, IDC_CELL_VARIANT, m_wndCellVariant);
  83. DDX_Control(pDX, IDC_CELL_UPDOWN, m_wndCellUpDown);
  84. DDX_Control(pDX, IDC_CELL_PICTURE, m_wndCellPicture);
  85. DDX_Control(pDX, IDC_CELL_SLIDER, m_wndCellSlider);
  86. DDX_Control(pDX, IDC_CELL_TEXT, m_wndCellText);
  87. DDX_Control(pDX, IDC_CELL_PASSWORD, m_wndCellPassword);
  88. DDX_Control(pDX, IDC_CELL_FILE, m_wndCellFile);
  89. DDX_Control(pDX, IDC_CELL_FILEIMAGE, m_wndCellFileImage);
  90. DDX_Control(pDX, IDC_CELL_FOLDER, m_wndCellFolder);
  91. DDX_Control(pDX, IDC_CELL_FONT, m_wndCellFont);
  92. DDX_Control(pDX, IDC_CELL_FONTFACENAME, m_wndCellFontFaceName);
  93. DDX_Control(pDX, IDC_CELL_FONTWEIGHT, m_wndCellFontWeight);
  94. DDX_Control(pDX, IDC_CELL_COLORPART, m_wndCellColorPart);
  95. DDX_Control(pDX, IDC_CELL_RECTPART, m_wndCellRectPart);
  96. DDX_Control(pDX, IDC_CELL_INPLACE_SLIDER, m_wndCellInplaceSlider);
  97. DDX_Control(pDX, IDC_CELL_INPLACE_SCROLLBAR, m_wndCellInplaceScrollBar);
  98. DDX_Control(pDX, IDC_CELL_HOTKEY, m_wndCellHotKey);
  99. DDX_Control(pDX, IDC_CELL_BUTTON, m_wndCellButton);
  100. DDX_Control(pDX, IDC_CELL_OBJECT_SIZE, m_wndCellObjectSize);
  101. DDX_Control(pDX, IDC_CELL_GEOGRAPHIC, m_wndCellGeographic);
  102. DDX_Control(pDX, IDC_CELL_MASKED_STRING, m_wndCellMaskedString);
  103. DDX_Control(pDX, IDC_CELL_SYSTEM_NUMBER, m_wndCellSystemNumber);
  104. DDX_Control(pDX, IDC_CELL_SYSTEM_CURRENCY, m_wndCellSystemCurrency);
  105. DDX_Control(pDX, ID_FILE_PRINT_PREVIEW, m_btnPPV );
  106. //}}AFX_DATA_MAP
  107. DDX_Control(pDX, IDC_GRID, m_wndGrid);
  108. }
  109. BEGIN_MESSAGE_MAP(CPageGrid, CPageBase)
  110. //{{AFX_MSG_MAP(CPageGrid)
  111. //}}AFX_MSG_MAP
  112. ON_WM_TIMER()
  113. END_MESSAGE_MAP()
  114. /////////////////////////////////////////////////////////////////////////////
  115. // CPageGrid message handlers
  116. BOOL CPageGrid::OnInitDialog() 
  117. {
  118. CPageBase::OnInitDialog();
  119. AddAnchor( IDC_GRID, __RDA_LT, __RDA_RB );
  120. AddAnchor( ID_FILE_PRINT_PREVIEW, __RDA_RB );
  121. AddAnchor( IDC_CELL_BOOLEAN, __RDA_LB );
  122. AddAnchor( IDC_CELL_CHECKBOX, __RDA_LB );
  123. AddAnchor( IDC_CELL_CHECKCOMBOBOX, __RDA_LB );
  124. AddAnchor( IDC_CELL_COLOR, __RDA_LB );
  125. AddAnchor( IDC_CELL_COLORPART, __RDA_LB );
  126. AddAnchor( IDC_CELL_COMBOBOX, __RDA_LB );
  127. AddAnchor( IDC_CELL_CURRENCY, __RDA_LB );
  128. AddAnchor( IDC_CELL_DATETIME, __RDA_LB );
  129. AddAnchor( IDC_CELL_DURATION, __RDA_LB );
  130. AddAnchor( IDC_CELL_FILE, __RDA_LB );
  131. AddAnchor( IDC_CELL_FILEIMAGE, __RDA_LB );
  132. AddAnchor( IDC_CELL_FOLDER, __RDA_LB );
  133. AddAnchor( IDC_CELL_FONT, __RDA_LB );
  134. AddAnchor( IDC_CELL_FONTFACENAME, __RDA_LB );
  135. AddAnchor( IDC_CELL_FONTWEIGHT, __RDA_LB );
  136. AddAnchor( IDC_CELL_FRACTION, __RDA_LB );
  137. AddAnchor( IDC_CELL_HYPERLINK, __RDA_LB );
  138. AddAnchor( IDC_CELL_IPADDRESS, __RDA_LB );
  139. AddAnchor( IDC_CELL_NUMBER, __RDA_LB );
  140. AddAnchor( IDC_CELL_PASSWORD, __RDA_LB );
  141. AddAnchor( IDC_CELL_PERCENTAGE, __RDA_LB );
  142. AddAnchor( IDC_CELL_PICTURE, __RDA_LB );
  143. AddAnchor( IDC_CELL_PROGRESS, __RDA_LB );
  144. AddAnchor( IDC_CELL_RADIOBUTTON, __RDA_LB );
  145. AddAnchor( IDC_CELL_RECTPART, __RDA_LB );
  146. AddAnchor( IDC_CELL_INPLACE_SLIDER, __RDA_LB );
  147. AddAnchor( IDC_CELL_INPLACE_SCROLLBAR, __RDA_LB );
  148. AddAnchor( IDC_CELL_SCIENTIFIC, __RDA_LB );
  149. AddAnchor( IDC_CELL_SLIDER, __RDA_LB );
  150. AddAnchor( IDC_CELL_TEXT, __RDA_LB );
  151. AddAnchor( IDC_CELL_UPDOWN, __RDA_LB );
  152. AddAnchor( IDC_CELL_VARIANT, __RDA_LB );
  153. AddAnchor( IDC_CELL_HOTKEY, __RDA_LB );
  154. AddAnchor( IDC_CELL_BUTTON, __RDA_LB );
  155. AddAnchor( IDC_CELL_OBJECT_SIZE, __RDA_LB );
  156. AddAnchor( IDC_CELL_GEOGRAPHIC, __RDA_LB );
  157. AddAnchor( IDC_CELL_MASKED_STRING, __RDA_LB );
  158. AddAnchor( IDC_CELL_SYSTEM_NUMBER, __RDA_LB );
  159. AddAnchor( IDC_CELL_SYSTEM_CURRENCY, __RDA_LB );
  160. m_btnPPV.SetTooltipText( _T("Print and Print Preview") );
  161. m_btnPPV.m_icon.m_bmpNormal.LoadBMP_Resource( MAKEINTRESOURCE( IDB_PRINT_PREVIEW ) );
  162. m_btnPPV.m_rcFocusRectPadding.SetRect( 0, 0, 0, 0 );
  163. m_wndGrid.OuterRowCountTopSet( 1L, false );
  164. m_wndGrid.OuterRowCountBottomSet( 1L, false );
  165. m_wndGrid.OuterColumnCountLeftSet( 1L, false );
  166. m_wndGrid.OuterColumnCountRightSet( 1L, false );
  167. m_wndGrid.OuterColumnWidthSet( true, 0L, 14 );
  168. m_wndGrid.OuterColumnWidthSet( false, 0L, 14 );
  169. m_wndGrid.NoHideSelectionSet( true, false );
  170. m_wndGrid.SubtractSelectionAreasSet( true, false );
  171. m_wndGrid.LbExtSelectionSet( true );
  172. m_wndGrid.GridLinesHorzSet( true, false );
  173. m_wndGrid.GridLinesVertSet( true, false );
  174. m_wndGrid.HoverEventsSet( true, true );
  175. m_wndGrid.MultiAreaSelectionSet( true );
  176. m_wndGrid.HoverHighlightSet( true, false, true, true, true, true );
  177. m_wndGrid.SiwModifyStyle(
  178.   (__ESIS_STH_PIXEL|__ESIS_STV_ITEM) // item scroll window styles
  179. | __EGBS_SFB_CELLS // selection/focus type
  180. | __EGBS_RESIZING_CELLS_OUTER // enable row/column resizing
  181. | __EGBS_RESIZING_CELLS_INNER
  182. | __EGBS_DYNAMIC_RESIZING // resize rows/columns on-the-fly
  183. //|__ESIS_DISABLE_AUTOHIDE_SB_H|__ESIS_DISABLE_AUTOHIDE_SB_V
  184. ,
  185. 0,
  186. false
  187. );
  188. m_wndGrid.BseModifyStyleEx(
  189.   __EGBS_BSE_EX_DBLCLK_BEST_FIT_ROW // do best fit sizing on double clicks over column divider
  190. | __EGBS_BSE_EX_DBLCLK_BEST_FIT_COLUMN // do best fit sizing on double clicks over row divider
  191. ,
  192. __EGWS_BSE_EX_DEFAULT,
  193. false
  194. );
  195. m_wndGrid.BseModifyStyle( 
  196. __EGWS_BSE_SORT_COLUMNS, 
  197. 0, 
  198. false 
  199. );
  200. m_wndGrid.SiwModifyStyleEx(
  201.   __EGBS_EX_CELL_TOOLTIPS_INNER
  202. | __EGBS_EX_CELL_EXPANDING_INNER
  203. | __EGWS_EX_PM_COLORS
  204. | __EGBS_EX_CORNER_AREAS_3D
  205. ,
  206. 0,
  207. false
  208. );
  209. static struct
  210. {
  211. LPCTSTR m_strText;
  212. INT m_nWidth;
  213. DWORD m_dwStyle;
  214. }
  215. g_arrHeaderDefinitions[] =
  216. {
  217. { _T("Boolean"),           85, __EGCS_TA_HORZ_LEFT },
  218. { _T("CheckBox"),          85, __EGCS_TA_HORZ_LEFT },
  219. { _T("RadioButton"),       85, __EGCS_TA_HORZ_LEFT },
  220. { _T("Color"),            110, __EGCS_TA_HORZ_LEFT },
  221. { _T("ComboBox"),          95, __EGCS_TA_HORZ_LEFT },
  222. { _T("CheckComboBox"),    160, __EGCS_TA_HORZ_LEFT },
  223. { _T("DateTime"),         140, __EGCS_TA_HORZ_LEFT },
  224. { _T("Duration"),         110, __EGCS_TA_HORZ_LEFT },
  225. { _T("Progress"),         160, __EGCS_TA_HORZ_LEFT },
  226. { _T("HyperLink"),        130, __EGCS_TA_HORZ_LEFT },
  227. { _T("IPAddress"),        120, __EGCS_TA_HORZ_LEFT },
  228. { _T("Number"),           100, __EGCS_TA_HORZ_LEFT },
  229. { _T("Currency"),         120, __EGCS_TA_HORZ_LEFT },
  230. { _T("Scientific"),        85, __EGCS_TA_HORZ_LEFT },
  231. { _T("Fraction"),          75, __EGCS_TA_HORZ_LEFT },
  232. { _T("Percentage"),        75, __EGCS_TA_HORZ_LEFT },
  233. { _T("Variant"),          140, __EGCS_TA_HORZ_LEFT },
  234. { _T("UpDown"),            95, __EGCS_TA_HORZ_LEFT },
  235. { _T("Picture"),           50, __EGCS_TA_HORZ_LEFT },
  236. { _T("Slider"),            85, __EGCS_TA_HORZ_LEFT },
  237. { _T("Text"),              85, __EGCS_TA_HORZ_LEFT },
  238. { _T("Password"),          85, __EGCS_TA_HORZ_LEFT },
  239. { _T("File"),             160, __EGCS_TA_HORZ_LEFT },
  240. { _T("FileImage"),        160, __EGCS_TA_HORZ_LEFT },
  241. { _T("Folder"),           160, __EGCS_TA_HORZ_LEFT },
  242. { _T("Font"),             130, __EGCS_TA_HORZ_LEFT },
  243. { _T("FontFaceName"),     140, __EGCS_TA_HORZ_LEFT },
  244. { _T("FontWeight"),        90, __EGCS_TA_HORZ_LEFT },
  245. { _T("ColorPart"),         90, __EGCS_TA_HORZ_LEFT },
  246. { _T("RectPart"),          90, __EGCS_TA_HORZ_LEFT },
  247. { _T("InplaceSlider"),    120, __EGCS_TA_HORZ_LEFT },
  248. { _T("InplaceScrollBar"), 200, __EGCS_TA_HORZ_LEFT },
  249. { _T("HotKey"),    90, __EGCS_TA_HORZ_LEFT },
  250. { _T("Button"),    90, __EGCS_TA_HORZ_LEFT },
  251. { _T("ObjectSize"),    80, __EGCS_TA_HORZ_LEFT },
  252. { _T("Geographic"),   200, __EGCS_TA_HORZ_LEFT },
  253. { _T("StringMasked"),   250, __EGCS_TA_HORZ_LEFT },
  254. { _T("SystemNumber"),   100, __EGCS_TA_HORZ_LEFT },
  255. { _T("SystemCurrency"),   100, __EGCS_TA_HORZ_LEFT },
  256. };
  257. LONG nColNo, nColCount = sizeof(g_arrHeaderDefinitions) / sizeof(g_arrHeaderDefinitions[0]);
  258. m_wndGrid.ColumnAdd( nColCount, false );
  259. for( nColNo = 0L; nColNo < nColCount; nColNo++ )
  260. {
  261. CExtGridCellHeader * pCellHeaderAtTop =
  262. STATIC_DOWNCAST(
  263. CExtGridCellHeader,
  264. m_wndGrid.GridCellGetOuterAtTop(
  265. nColNo,
  266. 0L,
  267. RUNTIME_CLASS(CExtGridCellHeader)
  268. )
  269. );
  270. ASSERT_VALID( pCellHeaderAtTop );
  271. CExtGridCellHeader * pCellHeaderAtBottom =
  272. STATIC_DOWNCAST(
  273. CExtGridCellHeader,
  274. m_wndGrid.GridCellGetOuterAtBottom(
  275. nColNo,
  276. 0L,
  277. RUNTIME_CLASS(CExtGridCellHeader)
  278. )
  279. );
  280. ASSERT_VALID( pCellHeaderAtBottom );
  281. pCellHeaderAtTop -> TextSet( g_arrHeaderDefinitions[nColNo].m_strText );
  282. pCellHeaderAtBottom -> TextSet( g_arrHeaderDefinitions[nColNo].m_strText );
  283. pCellHeaderAtTop -> ExtentSet( g_arrHeaderDefinitions[nColNo].m_nWidth );
  284. pCellHeaderAtBottom -> ExtentSet( g_arrHeaderDefinitions[nColNo].m_nWidth );
  285. pCellHeaderAtTop -> ModifyStyle( g_arrHeaderDefinitions[nColNo].m_dwStyle|__EGCS_HDR_FOCUS_ARROW_DISPLAY );
  286. pCellHeaderAtBottom -> ModifyStyle( g_arrHeaderDefinitions[nColNo].m_dwStyle|__EGCS_HDR_FOCUS_ARROW_DISPLAY );
  287. pCellHeaderAtTop -> FontWeightSet( FW_BOLD );
  288. pCellHeaderAtBottom -> FontWeightSet( FW_BOLD );
  289. } // for( nColNo = 0L; nColNo < nColCount; nColNo++ )
  290. LONG nRowNo, nRowCount = 10;
  291. m_wndGrid.RowAdd( 10, false );
  292. for( nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  293. {
  294. CExtGridCellHeader * pCellLeft =
  295. STATIC_DOWNCAST(
  296. CExtGridCellHeader,
  297. m_wndGrid.GridCellGetOuterAtLeft(
  298. 0L,
  299. nRowNo,
  300. RUNTIME_CLASS(CExtGridCellHeader)
  301. )
  302. );
  303. pCellLeft->ExtentSet( 20 );
  304. pCellLeft->ModifyStyle(
  305. __EGCS_HDR_FOCUS_ARROW_RESERVE_SPACE
  306. |__EGCS_HDR_FOCUS_ARROW_DISPLAY
  307. |__EGCS_TA_HORZ_RIGHT
  308. );
  309. CExtGridCellHeader * pCellRight =
  310. STATIC_DOWNCAST(
  311. CExtGridCellHeader,
  312. m_wndGrid.GridCellGetOuterAtRight(
  313. 0L,
  314. nRowNo,
  315. RUNTIME_CLASS(CExtGridCellHeader)
  316. )
  317. );
  318. pCellRight->ModifyStyle(
  319. __EGCS_HDR_FOCUS_ARROW_RESERVE_SPACE
  320. |__EGCS_HDR_FOCUS_ARROW_DISPLAY
  321. |__EGCS_TA_HORZ_RIGHT
  322. );
  323. }
  324. m_wndGrid.GridIconRemove();
  325. CBitmap bmpIcons;
  326. VERIFY( bmpIcons.LoadBitmap( IDB_BITMAP_GRID_ICONS ) );
  327. BITMAP bmpInfo;
  328. ::memset( &bmpInfo, 0, sizeof(BITMAP) );
  329. bmpIcons.GetBitmap( &bmpInfo );
  330. INT nIconWidth = 16;
  331. INT nIconCount = bmpInfo.bmWidth / nIconWidth;
  332. CRect rcIcon( 0, 0, nIconWidth, bmpInfo.bmHeight );
  333. for( INT nIconIndex = 0; nIconIndex < nIconCount; nIconIndex++, rcIcon.OffsetRect(nIconWidth,0) )
  334. {
  335. CExtCmdIcon _icon;
  336. _icon.AssignFromHBITMAP(
  337. (HBITMAP)bmpIcons.GetSafeHandle(),
  338. RGB(255,0,255),
  339. &rcIcon
  340. );
  341. ASSERT( !_icon.IsEmpty() );
  342. m_wndGrid.GridIconInsert( &_icon );
  343. }
  344. nColNo = 0L;
  345. _InitColumnBoolean( nColNo++, nRowCount );
  346. _InitColumnCheckBox( nColNo++, nRowCount );
  347. _InitColumnRadioButton( nColNo++, nRowCount );
  348. _InitColumnColor( nColNo++, nRowCount );
  349. _InitColumnComboBox( nColNo++, nRowCount );
  350. _InitColumnCheckComboBox( nColNo++, nRowCount );
  351. _InitColumnDateTime( nColNo++, nRowCount );
  352. _InitColumnDuration( nColNo++, nRowCount );
  353. _InitColumnProgress( nColNo++, nRowCount );
  354. _InitColumnHyperLink( nColNo++, nRowCount );
  355. _InitColumnIPAddress( nColNo++, nRowCount );
  356. _InitColumnNumber( nColNo++, nRowCount );
  357. _InitColumnCurrency( nColNo++, nRowCount );
  358. _InitColumnScientific( nColNo++, nRowCount );
  359. _InitColumnFraction( nColNo++, nRowCount );
  360. _InitColumnPercentage( nColNo++, nRowCount );
  361. _InitColumnVariant( nColNo++, nRowCount );
  362. _InitColumnUpDown( nColNo++, nRowCount );
  363. _InitColumnPicture( nColNo++, nRowCount );
  364. _InitColumnSlider( nColNo++, nRowCount );
  365. _InitColumnText( nColNo++, nRowCount );
  366. _InitColumnPassword( nColNo++, nRowCount );
  367. _InitColumnFile( nColNo++, nRowCount );
  368. _InitColumnFileImage( nColNo++, nRowCount );
  369. _InitColumnFolder( nColNo++, nRowCount );
  370. _InitColumnFont( nColNo++, nRowCount );
  371. _InitColumnFontFaceName( nColNo++, nRowCount );
  372. _InitColumnFontWeight( nColNo++, nRowCount );
  373. _InitColumnColorPart( nColNo++, nRowCount );
  374. _InitColumnRectPart( nColNo++, nRowCount );
  375. _InitColumnInplaceSlider( nColNo++, nRowCount );
  376. _InitColumnInplaceScrollBar( nColNo++, nRowCount );
  377. _InitColumnHotKey( nColNo++, nRowCount );
  378. _InitColumnButton( nColNo++, nRowCount );
  379. _InitColumnObjectSize( nColNo++, nRowCount );
  380. _InitColumnGeographic( nColNo++, nRowCount );
  381. _InitColumnStringMasked( nColNo++, nRowCount );
  382. _InitColumnSystemNumber( nColNo++, nRowCount );
  383. _InitColumnSystemCurrency( nColNo++, nRowCount );
  384. m_wndGrid.OnSwUpdateScrollBars();
  385. m_wndGrid.OnSwInvalidate( false );
  386. m_wndCellBoolean.SetTooltipText( 
  387. _T("The CExtGridCellBool class implements a boolean cell.") 
  388. );
  389.   m_wndCellCheckBox.SetTooltipText( 
  390. _T("The CExtGridCellCheckBox class implements a three-state check box button cell.") 
  391. );
  392. m_wndCellRadioButton.SetTooltipText( 
  393. _T("The CExtGridCellRadioButton class implements a radio button cell.") 
  394. );
  395.   m_wndCellColor.SetTooltipText( 
  396. _T("The CExtGridCellColor class implements a simple color cell that is able to track the n")
  397. _T("CExtPopupColorMenuWnd color picker menu when the built-in button is clicked.n") 
  398. _T("It also allows you to display the CExtColorDlg color picker dialog.") 
  399. );
  400. m_wndCellComboBox.SetTooltipText( 
  401. _T("The CExtGridCellComboBox class implements a drop-down combo box cell.n")
  402. _T("The class implements the most useful methods of the CComboBox class.") 
  403. );
  404.   m_wndCellCheckComboBox.SetTooltipText( 
  405. _T("The CExtGridCellCheckListComboBox class implements n")
  406. _T("a combo box cell with a pop-up list box that contains items n")
  407. _T("with a check box next to each item in the list.") 
  408. );
  409.   m_wndCellDateTime.SetTooltipText( 
  410. _T("The CExtGridCellDateTime class implements the date and time cell.n") 
  411. _T("This cell displays hours, minutes, seconds and a time designator in its time part and day, n")
  412. _T("month and year in its date part. n")
  413. _T("You can use different modes of the cell (e.g., by displaying only date, only time or date n")
  414. _T("and time together). n")
  415. _T("With the Drop Down button you can invoke the embedded pop-up date picker n")
  416. _T("for selecting dates in a handy way.") 
  417. );
  418. m_wndCellDuration.SetTooltipText( 
  419. _T("The CExtGridCellDuration class implements a duration cell.") 
  420. );
  421. m_wndCellProgress.SetTooltipText( 
  422. _T("The CExtGridCellProgress class implements a progress bar inside a cell. n")
  423. _T("In addition to all the features of the standard progress bar control, n")
  424. _T("the progress cell supports the following text formats:n")
  425. _T("  -  No text n")
  426. _T("  -  Custom text n")
  427. _T("  -  Current position in percents n")
  428. _T("  -  Current position n")
  429. _T("  -  Custom text and current position in percents n")
  430. _T("  -  Custom text and current position n")
  431. _T("You can also make the progress bar grow in a reverse direction n")
  432. _T("(from right to left) and vertically, make the text tied, and specify any n")
  433. _T("color both for the text and for the progress bar.") 
  434. );
  435. m_wndCellHyperlink.SetTooltipText( 
  436. _T("The CExtGridCellHyperLink class implements a hyperlink cell.") 
  437. );
  438. m_wndCellIPAddress.SetTooltipText( 
  439. _T("The CExtGridCellIPAddress class implements an IP address cell.") 
  440. );
  441. m_wndCellNumber.SetTooltipText( 
  442. _T("The CExtGridCellNumber class implements a numeric cell. n")
  443. _T("By default, the numeric value is formatted according to the locale's settings n")
  444. _T("but you can specify a custom format by modifying the following properties:n")
  445. _T("  -  Number of fractional digits n")
  446. _T("  -  Number of leading zeroes n")
  447. _T("  -  Format for negative values n")
  448. _T("  -  Size of each group of digits to the left of the decimal point n")
  449. _T("  -  Decimal separator n")
  450. _T("  -  Thousand separator ") 
  451. );
  452. m_wndCellCurrency.SetTooltipText( 
  453. _T("The CExtGridCellCurrency class implements a currency cell.n")
  454. _T("By default, the currency value is formatted according to the locale's settings n")
  455. _T("but you can specify a custom format by modifying the following properties:n")
  456. _T("  -  Monetary symbol and its position n")
  457. _T("  -  Number of fractional digits n")
  458. _T("  -  Number of leading zeroes n")
  459. _T("  -  Format for negative values n")
  460. _T("  -  Format for positive values n")
  461. _T("  -  Size of each group of digits to the left of the decimal point n")
  462. _T("  -  Decimal separator n")
  463. _T("  -  Thousand separator n")
  464. );
  465.   m_wndCellScientific.SetTooltipText( 
  466. _T("The CExtGridCellScientific class implements an exponential cell, n")
  467. _T("which displays a floating-point number in the exponential form.") 
  468. );
  469. m_wndCellFraction.SetTooltipText( 
  470. _T("The CExtGridCellFraction class implements a fraction cell, n")
  471. _T("which displays the cell floating-point value as a fraction. n")
  472. _T("You can customize fraction representation using several predefined constants.") 
  473. );
  474. m_wndCellPercentage.SetTooltipText( 
  475. _T("The CExtGridCellPercentage class implements a percentage cell: n")
  476. _T("the cell value is multiplied by 100 and the result is displayed with a percent symbol. n")
  477. _T("You can additionally specify a position for the percent sign.") 
  478. );
  479. m_wndCellVariant.SetTooltipText( 
  480. _T("The CExtGridCellVariant class implements n")
  481. _T("the cell which stores a value of the VARIANT type.") 
  482. );
  483. m_wndCellUpDown.SetTooltipText( 
  484. _T("The CExtGridCellUpDown class implements a spin edit cell.") 
  485. );
  486. m_wndCellPicture.SetTooltipText( 
  487. _T("The CExtGridCellPicture class is designed for displaying a bitmap in a cell. n")
  488. _T("The bitmap can be aligned, tiled, or stretched n")
  489. _T("The class is based on CExtBitmap, which allows you to use 32-bit bitmaps n")
  490. _T("with alpha channel.") 
  491. );
  492. m_wndCellSlider.SetTooltipText( 
  493. _T("The CExtGridCellSlider class implements a slider cell, n")
  494. _T("which is useful when you want the user to select a discrete n")
  495. _T("value or a set of consecutive values in a range.") 
  496. );
  497. m_wndCellText.SetTooltipText( 
  498. _T("The CExtGridCellString class implements a text cell n")
  499. _T("which keeps text data in the CString property.n")
  500. _T("The text can be single line or multi-linen")
  501. );
  502. m_wndCellPassword.SetTooltipText( 
  503. _T("The CExtGridCellPassword class implements a password cell.") 
  504. );
  505.   m_wndCellFile.SetTooltipText( 
  506. _T("The CExtGridCellFile class implements a cell which stores n")
  507. _T("the path to a particular file. n")
  508. _T("You can set the path by typing it or with the Open dialog n")
  509. _T("that pops up when you click the cell ellipsis button.") 
  510. );
  511.   m_wndCellFileImage.SetTooltipText( 
  512. _T("The CExtGridCellFileImage class implements a cell which stores n")
  513. _T("the path to a particular icon file and displays its thumbnail image. n")
  514. _T("You can set the path by typing it or with the Open dialog n")
  515. _T("that pops up when you click the cell ellipsis button.") 
  516. );
  517. m_wndCellFolder.SetTooltipText( 
  518. _T("The CExtGridCellFolder class implements a cell which n")
  519. _T("stores the path to a particular folder. n")
  520. _T("With the Browse button you can display a folder-selection dialog box n")
  521. _T("which allows you to select a particular folder.") 
  522. );
  523. m_wndCellFont.SetTooltipText( 
  524. _T("The CExtGridCellFont class implements a font cell which stores n")
  525. _T("the LOGFONT structure that contains information about the current font. n")
  526. _T("You can select a particular font and set its attributes with the Font dialog n")
  527. _T("that pops up when you click the cell ellipsis button.") 
  528. );
  529. m_wndCellFontFaceName.SetTooltipText( 
  530. _T("The CExtGridCellFontFaceName class implements n")
  531. _T("an extended version of the combo box grid cell for displaying n")
  532. _T("the list of the fonts installed in the system. n")
  533. );
  534. m_wndCellFontWeight.SetTooltipText( 
  535. _T("The CExtGridCellUpDownFontWeight class implements an up-down n")
  536. _T("grid cell for selecting the font weight. n")
  537. _T("This cell displays a drop-down list box with a list of n")
  538. _T("commonly used font weights including: n")
  539. _T("  -  100 (Thin), n")
  540. _T("  -  200 (Ultra Light), n")
  541. _T("  -  300 (Light), n")
  542. _T("  -  400 (Normal), n")
  543. _T("  -  500 (Medium), n")
  544. _T("  -  600 (Semi Bold), n")
  545. _T("  -  700 (Bold), n")
  546. _T("  -  800 (Ultra Bold), n")
  547. _T("  -  900 (Heavy)")
  548. );
  549. m_wndCellColorPart.SetTooltipText( 
  550. _T("The CExtGridCellUpDownColorPart class implements an extended version n")
  551. _T("of the up-down grid cell for displaying the red, greed and blue part of a color value. n")
  552. _T("This cell class features a small color icon and a drop-down menu. n")
  553. _T("The latter is handy editing color values.") 
  554. );
  555. m_wndCellRectPart.SetTooltipText( 
  556. _T("The CExtGridCellUpDownRectPart class implements an extended version n")
  557. _T("of an up-down grid cell for displaying X, Y, Width and Height parts n")
  558. _T("of the rectangle data type.") 
  559. );
  560. m_wndCellInplaceSlider.SetTooltipText( 
  561. _T("The CExtGridCellInplaceSlider class implements n")
  562. _T("an always visible slider/scroll bar in a grid cell.") 
  563. );
  564.   m_wndCellInplaceScrollBar.SetTooltipText( 
  565. _T("The CExtGridCellInplaceSlider class implements n")
  566. _T("an always visible slider/scroll bar in a grid cell.") 
  567. );
  568.   m_wndCellHotKey.SetTooltipText( 
  569. _T("The CExtGridCellHotKey class implements a hot key in a grid cell. n")
  570. _T("It displays a text representation of the key combination the user types into it.") 
  571. );
  572.   m_wndCellButton.SetTooltipText( 
  573. _T("The CExtGridCellButton class implements a button in a grid cell. n")
  574. );
  575.   m_wndCellObjectSize.SetTooltipText( 
  576. _T("The CExtGridCellObjectSize class implements an object size grid cell. n")
  577. );
  578.   m_wndCellGeographic.SetTooltipText( 
  579. _T("The CExtGridCellLL class implements an longitude/latitude grid cell. n")
  580. );
  581.   m_wndCellMaskedString.SetTooltipText( 
  582. _T("The CExtGridCellStringMasked class implements a text grid cellnwith masked input validation. n")
  583. );
  584.   m_wndCellSystemNumber.SetTooltipText( 
  585. _T("The CExtGridCellSystemNumber class implements a numeric value input grid cellndisplaying number formatted according Windows locale settings. n")
  586. );
  587.   m_wndCellSystemCurrency.SetTooltipText( 
  588. _T("The CExtGridCellSystemCurrency class implements a currency value input grid cellndisplaying currency formatted according Windows locale settings. n")
  589. );
  590. SetTimer( 987, 200, NULL );
  591. return TRUE;  // return TRUE unless you set the focus to a control
  592.               // EXCEPTION: OCX Property Pages should return FALSE
  593. }
  594. void CPageGrid::_InitColumnBoolean( LONG nColNo, LONG nRowCount )
  595. {
  596. ASSERT_VALID( this );
  597. ASSERT_VALID( &m_wndGrid );
  598. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  599. {
  600. CExtGridCellBool * pCellBool =
  601. STATIC_DOWNCAST(
  602. CExtGridCellBool,
  603. m_wndGrid.GridCellGet(
  604. nColNo,
  605. nRowNo,
  606. 0,
  607. 0,
  608. RUNTIME_CLASS(CExtGridCellBool)
  609. )
  610. );
  611. pCellBool->DataSet( false );
  612. }
  613. CExtGridCellBool * pCellBool0 =
  614. STATIC_DOWNCAST(
  615. CExtGridCellBool,
  616. m_wndGrid.GridCellGet( nColNo, 0L )
  617. );
  618. pCellBool0->DataSet( true );
  619. CExtGridCellBool * pCellBool1 =
  620. STATIC_DOWNCAST(
  621. CExtGridCellBool,
  622. m_wndGrid.GridCellGet( nColNo, 1L )
  623. );
  624. pCellBool1->DataSet( false );
  625. pCellBool1->ModifyStyle( __EGCS_BUTTON_UPDOWN, __EGCS_BUTTON_DROPDOWN );
  626. CExtGridCellBool * pCellBool2 =
  627. STATIC_DOWNCAST(
  628. CExtGridCellBool,
  629. m_wndGrid.GridCellGet( nColNo, 2L )
  630. );
  631. pCellBool2->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
  632. pCellBool2->DataSet( true );
  633. pCellBool2->LabelTextSet( true, _T("Yes") );
  634. pCellBool2->LabelTextSet( false, _T("No") );
  635. pCellBool2->ModifyStyle(
  636. __EGCS_CHK_CHECK
  637. |__EGCS_ICA_HORZ_CENTER
  638. |__EGCS_ICA_VERT_MIDDLE
  639. |__EGCS_NO_INPLACE_CONTROL
  640. |__EGCS_BUTTON_UPDOWN
  641. );
  642. pCellBool2->TextColorSet( CExtGridCell::__ECS_ALL, RGB(255,0,0) );
  643. CExtGridCellBool * pCellBool3 =
  644. STATIC_DOWNCAST(
  645. CExtGridCellBool,
  646. m_wndGrid.GridCellGet( nColNo, 3L )
  647. );
  648. pCellBool3->TextColorSet( CExtGridCell::__ECS_NORMAL, RGB(0,255,0) );
  649. CExtGridCellBool * pCellBool4 =
  650. STATIC_DOWNCAST(
  651. CExtGridCellBool,
  652. m_wndGrid.GridCellGet( nColNo, 4L )
  653. );
  654. pCellBool4->DataSet( true );
  655. pCellBool4->LabelTextSet( true, _T("Available") );
  656. pCellBool4->LabelTextSet( false, _T("Unavailable") );
  657. pCellBool4->ModifyStyle( __EGCS_BUTTON_UPDOWN, __EGCS_BUTTON_DROPDOWN );
  658. pCellBool4->TextColorSet( CExtGridCell::__ECS_NORMAL, RGB(0,0,255) );
  659. pCellBool4->TextColorSet( CExtGridCell::__ECS_HOVERED, RGB(255,0,255) );
  660. CExtGridCellBool * pCellBool5 =
  661. STATIC_DOWNCAST(
  662. CExtGridCellBool,
  663. m_wndGrid.GridCellGet( nColNo, 5L )
  664. );
  665. pCellBool5->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  666. CExtGridCellBool * pCellBool6 =
  667. STATIC_DOWNCAST(
  668. CExtGridCellBool,
  669. m_wndGrid.GridCellGet( nColNo, 6L )
  670. );
  671. pCellBool6->ModifyStyle( __EGCS_TA_HORZ_RIGHT );
  672. CExtGridCellBool * pCellBool7 =
  673. STATIC_DOWNCAST(
  674. CExtGridCellBool,
  675. m_wndGrid.GridCellGet( nColNo, 7L )
  676. );
  677. pCellBool7->DataSet( true );
  678. pCellBool7->LabelTextSet( true, _T("") );
  679. pCellBool7->LabelTextSet( false, _T("") );
  680. pCellBool7->ModifyStyle(
  681. __EGCS_CHK_CHECK
  682. |__EGCS_ICA_HORZ_CENTER
  683. |__EGCS_ICA_VERT_MIDDLE
  684. |__EGCS_NO_INPLACE_CONTROL
  685. ,
  686. __EGCS_BUTTON_DROPDOWN
  687. );
  688. CExtGridCellBool * pCellBool8 =
  689. STATIC_DOWNCAST(
  690. CExtGridCellBool,
  691. m_wndGrid.GridCellGet( nColNo, 8L )
  692. );
  693. pCellBool8->ModifyStyle(
  694. __EGCS_CHK_CHECK
  695. |__EGCS_ICA_HORZ_CENTER
  696. |__EGCS_ICA_VERT_MIDDLE
  697. |__EGCS_NO_INPLACE_CONTROL
  698. |__EGCS_BUTTON_UPDOWN
  699. ,
  700. __EGCS_BUTTON_DROPDOWN
  701. );
  702. pCellBool8->LabelTextSet( true, _T("") );
  703. pCellBool8->LabelTextSet( false, _T("") );
  704. CExtGridCellBool * pCellBool9 =
  705. STATIC_DOWNCAST(
  706. CExtGridCellBool,
  707. m_wndGrid.GridCellGet( nColNo, 9L )
  708. );
  709. pCellBool9->DataSet( true );
  710. }
  711. void CPageGrid::_InitColumnCheckBox( LONG nColNo, LONG nRowCount )
  712. {
  713. ASSERT_VALID( this );
  714. ASSERT_VALID( &m_wndGrid );
  715. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  716. {
  717. if( nRowNo == 1 || nRowNo == 3 )
  718. {
  719. CExtGridCellCheckBox * pCellCheckBox =
  720. STATIC_DOWNCAST( CExtGridCellCheckBox, m_wndGrid.GridCellGet( nColNo, nRowNo, 0, 0, RUNTIME_CLASS(CExtGridCellCheckBoxEye) ) );
  721. ASSERT_VALID( pCellCheckBox );
  722. pCellCheckBox;
  723. continue;
  724. }
  725. CExtGridCellCheckBox * pCellCheckBox =
  726. STATIC_DOWNCAST( CExtGridCellCheckBox, m_wndGrid.GridCellGet( nColNo, nRowNo, 0, 0, RUNTIME_CLASS(CExtGridCellCheckBox) ) );
  727. ASSERT_VALID( pCellCheckBox );
  728. CString sText;
  729. sText.Format( _T("Check%d"), nRowNo );
  730. pCellCheckBox->TextSet( __EXT_MFC_SAFE_LPCTSTR( sText ) );
  731. }
  732. CExtGridCellCheckBox * pCellCheckBox0 =
  733. STATIC_DOWNCAST(
  734. CExtGridCellCheckBox,
  735. m_wndGrid.GridCellGet( nColNo, 0L )
  736. );
  737. pCellCheckBox0->SetCheck( 1 );
  738. CExtGridCellCheckBox * pCellCheckBox1 =
  739. STATIC_DOWNCAST(
  740. CExtGridCellCheckBox,
  741. m_wndGrid.GridCellGet( nColNo, 1L )
  742. );
  743. pCellCheckBox1->Set3StateMode( true );
  744. pCellCheckBox1->SetCheck( 2 );
  745. CExtGridCellCheckBox * pCellCheckBox2 =
  746. STATIC_DOWNCAST(
  747. CExtGridCellCheckBox,
  748. m_wndGrid.GridCellGet( nColNo, 2L )
  749. );
  750. pCellCheckBox2->SetAutoTextMode( true );
  751. pCellCheckBox2->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
  752. pCellCheckBox2->TextColorSet( CExtGridCell::__ECS_ALL, RGB(255,0,0) );
  753. pCellCheckBox2->LabelTextSet( 0, _T("Available") );
  754. pCellCheckBox2->LabelTextSet( 1, _T("Unavailable") );
  755. CExtGridCellCheckBox * pCellCheckBox3 =
  756. STATIC_DOWNCAST(
  757. CExtGridCellCheckBox,
  758. m_wndGrid.GridCellGet( nColNo, 3L )
  759. );
  760. pCellCheckBox3->TextColorSet( CExtGridCell::__ECS_ALL, RGB(0,255,0) );
  761. pCellCheckBox3->SetCheck( 1 );
  762. CExtGridCellCheckBox * pCellCheckBox4 =
  763. STATIC_DOWNCAST(
  764. CExtGridCellCheckBox,
  765. m_wndGrid.GridCellGet( nColNo, 4L )
  766. ); 
  767. pCellCheckBox4->TextColorSet( CExtGridCell::__ECS_NORMAL, RGB(0,0,255) );
  768. pCellCheckBox4->TextColorSet( CExtGridCell::__ECS_HOVERED, RGB(255,0,255) );
  769. pCellCheckBox4->SetAutoTextMode( true );
  770. pCellCheckBox4->Set3StateMode( true );
  771. pCellCheckBox4->LabelTextSet( 0, _T("Yes") );
  772. pCellCheckBox4->LabelTextSet( 1, _T("No") );
  773. pCellCheckBox4->LabelTextSet( 2, _T("N/A") );
  774. pCellCheckBox4->SetCheck( 2 );
  775. CExtGridCellCheckBox * pCellCheckBox5 =
  776. STATIC_DOWNCAST(
  777. CExtGridCellCheckBox,
  778. m_wndGrid.GridCellGet( nColNo, 5L )
  779. );
  780. pCellCheckBox5->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  781. CExtGridCellCheckBox * pCellCheckBox6 =
  782. STATIC_DOWNCAST(
  783. CExtGridCellCheckBox,
  784. m_wndGrid.GridCellGet( nColNo, 6L )
  785. );
  786. pCellCheckBox6->SetCheck( 1 );
  787. pCellCheckBox6->ModifyStyle( __EGCS_TA_HORZ_RIGHT );
  788. CExtGridCellCheckBox * pCellCheckBox7 =
  789. STATIC_DOWNCAST(
  790. CExtGridCellCheckBox,
  791. m_wndGrid.GridCellGet( nColNo, 7L )
  792. );
  793. pCellCheckBox7->Set3StateMode( true );
  794. pCellCheckBox7->SetCheck( 2 );
  795. CExtGridCellCheckBox * pCellCheckBox8 =
  796. STATIC_DOWNCAST(
  797. CExtGridCellCheckBox,
  798. m_wndGrid.GridCellGet( nColNo, 8L )
  799. );
  800. pCellCheckBox8->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
  801. pCellCheckBox8->SetAutoTextMode( true );
  802. pCellCheckBox8->SetCheck( 1 );
  803. CExtGridCellCheckBox * pCellCheckBox9 =
  804. STATIC_DOWNCAST(
  805. CExtGridCellCheckBox,
  806. m_wndGrid.GridCellGet( nColNo, 9L )
  807. );
  808. pCellCheckBox9->SetAutoTextMode();
  809. pCellCheckBox9->Set3StateMode();
  810. pCellCheckBox9->SetCheck( 0 );
  811. pCellCheckBox9->LabelTextSet( 0, _T("Limited") );
  812. pCellCheckBox9->LabelTextSet( 1, _T("Unlimited") );
  813. pCellCheckBox9->LabelTextSet( 2, _T("Unknown") );
  814. }
  815. void CPageGrid::_InitColumnRadioButton( LONG nColNo, LONG nRowCount )
  816. {
  817. ASSERT_VALID( this );
  818. ASSERT_VALID( &m_wndGrid );
  819. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  820. {
  821. CExtGridCellRadioButton * pCellRadioButton =
  822. STATIC_DOWNCAST(
  823. CExtGridCellRadioButton,
  824. m_wndGrid.GridCellGet(
  825. nColNo,
  826. nRowNo,
  827. 0,
  828. 0,
  829. RUNTIME_CLASS(CExtGridCellRadioButton)
  830. )
  831. );
  832. CString sText;
  833. sText.Format( _T("Radio%d"), nRowNo );
  834. pCellRadioButton->TextSet( __EXT_MFC_SAFE_LPCTSTR( sText ) );
  835. }
  836. CExtGridCellRadioButton * pCellRadioButton0 =
  837. STATIC_DOWNCAST(
  838. CExtGridCellRadioButton,
  839. m_wndGrid.GridCellGet( nColNo, 0L )
  840. );
  841. pCellRadioButton0->SetCheck( 1 );
  842. CExtGridCellRadioButton * pCellRadioButton1 =
  843. STATIC_DOWNCAST(
  844. CExtGridCellRadioButton,
  845. m_wndGrid.GridCellGet( nColNo, 1L )
  846. );
  847. pCellRadioButton1->SetCheck( 0 );
  848. CExtGridCellRadioButton * pCellRadioButton2 =
  849. STATIC_DOWNCAST(
  850. CExtGridCellRadioButton,
  851. m_wndGrid.GridCellGet( nColNo, 2L )
  852. );
  853. pCellRadioButton2->SetCheck( 1 );
  854. pCellRadioButton2->TextColorSet( CExtGridCell::__ECS_ALL, RGB(255,0,0) );
  855. CExtGridCellRadioButton * pCellRadioButton3 =
  856. STATIC_DOWNCAST(
  857. CExtGridCellRadioButton,
  858. m_wndGrid.GridCellGet( nColNo, 3L )
  859. );
  860. pCellRadioButton3->TextColorSet( CExtGridCell::__ECS_NORMAL, RGB(0,255,0) );
  861. CExtGridCellRadioButton * pCellRadioButton4 =
  862. STATIC_DOWNCAST(
  863. CExtGridCellRadioButton,
  864. m_wndGrid.GridCellGet( nColNo, 4L )
  865. );
  866. pCellRadioButton4->TextColorSet( CExtGridCell::__ECS_NORMAL, RGB(0,0,255) );
  867. pCellRadioButton4->TextColorSet( CExtGridCell::__ECS_HOVERED, RGB(255,0,255) );
  868. CExtGridCellRadioButton * pCellRadioButton5 =
  869. STATIC_DOWNCAST(
  870. CExtGridCellRadioButton,
  871. m_wndGrid.GridCellGet( nColNo, 5L )
  872. );
  873. pCellRadioButton5->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  874. CExtGridCellRadioButton * pCellRadioButton6 =
  875. STATIC_DOWNCAST(
  876. CExtGridCellRadioButton,
  877. m_wndGrid.GridCellGet( nColNo, 6L )
  878. );
  879. pCellRadioButton6->ModifyStyle( __EGCS_TA_HORZ_RIGHT );
  880. CExtGridCellRadioButton * pCellRadioButton7 =
  881. STATIC_DOWNCAST(
  882. CExtGridCellRadioButton,
  883. m_wndGrid.GridCellGet( nColNo, 7L )
  884. );
  885. pCellRadioButton7->SetCheck( 1 );
  886. CExtGridCellRadioButton * pCellRadioButton8 =
  887. STATIC_DOWNCAST(
  888. CExtGridCellRadioButton,
  889. m_wndGrid.GridCellGet( nColNo, 8L )
  890. );
  891. pCellRadioButton8->SetCheck( 0 );
  892. CExtGridCellRadioButton * pCellRadioButton9 =
  893. STATIC_DOWNCAST(
  894. CExtGridCellRadioButton,
  895. m_wndGrid.GridCellGet( nColNo, 9L )
  896. );
  897. pCellRadioButton9->SetCheck( 1 );
  898. }
  899. void CPageGrid::_InitColumnColor( LONG nColNo, LONG nRowCount )
  900. {
  901. ASSERT_VALID( this );
  902. ASSERT_VALID( &m_wndGrid );
  903. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  904. {
  905. CExtGridCellColor * pCellColor =
  906. STATIC_DOWNCAST(
  907. CExtGridCellColor,
  908. m_wndGrid.GridCellGet(
  909. nColNo,
  910. nRowNo,
  911. 0,
  912. 0,
  913. RUNTIME_CLASS(CExtGridCellColor)
  914. )
  915. );
  916. pCellColor;
  917. }
  918. COLORREF clrLimeGreen = RGB(50,205,50);
  919. COLORREF clrYellow = RGB(255,255,0);
  920. COLORREF clrRed = RGB(255,0,0);
  921. COLORREF clrBlue = RGB(0,0,255);
  922. CExtGridCellColor * pCellColor0 =
  923. STATIC_DOWNCAST(
  924. CExtGridCellColor,
  925. m_wndGrid.GridCellGet( nColNo, 0L )
  926. );
  927. pCellColor0->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
  928. pCellColor0->SetMode( CExtGridCellColor::eNone );
  929. pCellColor0->SetColor( clrBlue );
  930. pCellColor0->m_bEnableButtonDefaultColor = true;
  931. pCellColor0->m_clrDefault = clrBlue;
  932. CExtGridCellColor * pCellColor1 =
  933. STATIC_DOWNCAST(
  934. CExtGridCellColor,
  935. m_wndGrid.GridCellGet( nColNo, 1L )
  936. );
  937. pCellColor1->SetMode( CExtGridCellColor::eRGB );
  938. pCellColor1->SetColor( clrLimeGreen );
  939. pCellColor1->m_bEnableButtonDefaultColor = true;
  940. pCellColor1->m_clrDefault = clrLimeGreen;
  941. CExtGridCellColor * pCellColor2 =
  942. STATIC_DOWNCAST(
  943. CExtGridCellColor,
  944. m_wndGrid.GridCellGet( nColNo, 2L )
  945. );
  946. pCellColor2->SetMode( CExtGridCellColor::eRGBName );
  947. pCellColor2->SetColor( clrLimeGreen );
  948. pCellColor2->m_bEnableButtonDefaultColor = true;
  949. pCellColor2->m_clrDefault = clrLimeGreen;
  950. CExtGridCellColor * pCellColor3 =
  951. STATIC_DOWNCAST(
  952. CExtGridCellColor,
  953. m_wndGrid.GridCellGet( nColNo, 3L )
  954. );
  955. pCellColor3->SetMode( CExtGridCellColor::eRGBHex );
  956. pCellColor3->SetColor( clrLimeGreen );
  957. pCellColor3->m_bEnableButtonRandomColor = true;
  958. CExtGridCellColor * pCellColor4 =
  959. STATIC_DOWNCAST(
  960. CExtGridCellColor,
  961. m_wndGrid.GridCellGet( nColNo, 4L )
  962. );
  963. pCellColor4->SetMode( CExtGridCellColor::eRGB );
  964. pCellColor4->SetColor( clrYellow );
  965. pCellColor4->m_bEnableButtonDefaultColor = true;
  966. pCellColor4->m_clrDefault = clrYellow;
  967. CExtGridCellColor * pCellColor5 =
  968. STATIC_DOWNCAST(
  969. CExtGridCellColor,
  970. m_wndGrid.GridCellGet( nColNo, 5L )
  971. );
  972. pCellColor5->SetMode( CExtGridCellColor::eRGBName );
  973. pCellColor5->SetColor( clrYellow );
  974. pCellColor5->m_bEnableButtonDefaultColor = true;
  975. pCellColor5->m_clrDefault = clrYellow;
  976. CExtGridCellColor * pCellColor6 =
  977. STATIC_DOWNCAST(
  978. CExtGridCellColor,
  979. m_wndGrid.GridCellGet( nColNo, 6L )
  980. );
  981. pCellColor6->SetMode( CExtGridCellColor::eRGBAName );
  982. pCellColor6->SetColor( clrYellow );
  983. pCellColor6->m_bEnableButtonRandomColor = true;
  984. CExtGridCellColor * pCellColor7 =
  985. STATIC_DOWNCAST(
  986. CExtGridCellColor,
  987. m_wndGrid.GridCellGet( nColNo, 7L )
  988. );
  989. pCellColor7->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
  990. pCellColor7->SetMode( CExtGridCellColor::eNone );
  991. pCellColor7->m_bEnableButtonDefaultColor = true;
  992. pCellColor7->m_clrDefault = clrRed;
  993. pCellColor7->SetColor( clrRed );
  994. CExtGridCellColor * pCellColor8 =
  995. STATIC_DOWNCAST(
  996. CExtGridCellColor,
  997. m_wndGrid.GridCellGet( nColNo, 8L )
  998. );
  999. pCellColor8->SetMode( CExtGridCellColor::eRGBHex );
  1000. pCellColor8->SetColor( clrRed );
  1001. pCellColor8->m_bEnableButtonDefaultColor = true;
  1002. pCellColor8->m_clrDefault = clrRed;
  1003. CExtGridCellColor * pCellColor9 =
  1004. STATIC_DOWNCAST(
  1005. CExtGridCellColor,
  1006. m_wndGrid.GridCellGet( nColNo, 9L )
  1007. );
  1008. pCellColor9->SetMode( CExtGridCellColor::eCMY );
  1009. pCellColor9->SetColor( clrRed );
  1010. pCellColor9->m_bEnableButtonRandomColor = true;
  1011. }
  1012. void CPageGrid::_InitColumnComboBox( LONG nColNo, LONG nRowCount )
  1013. {
  1014. ASSERT_VALID( this );
  1015. ASSERT_VALID( &m_wndGrid );
  1016. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1017. {
  1018. CExtGridCellComboBox * pCellComboBox =
  1019. STATIC_DOWNCAST(
  1020. CExtGridCellComboBox,
  1021. m_wndGrid.GridCellGet(
  1022. nColNo,
  1023. nRowNo,
  1024. 0,
  1025. 0,
  1026. RUNTIME_CLASS(CExtGridCellComboBox)
  1027. )
  1028. );
  1029. pCellComboBox;
  1030. }
  1031. CExtImageList ilComboCell;
  1032. ilComboCell.Load( IDB_COMBO_CELL_IMAGES, RGB(255,0,255), 16 );
  1033. LONG nItem;
  1034. CExtGridCellComboBox::ITEM_INFO itemInfo;
  1035. CExtGridCellComboBox * pCellComboBox0 =
  1036. STATIC_DOWNCAST(
  1037. CExtGridCellComboBox,
  1038. m_wndGrid.GridCellGet( nColNo, 0L )
  1039. );
  1040. pCellComboBox0->SetEnumMode( true );
  1041. pCellComboBox0->AddString( _T("Item1") );
  1042. pCellComboBox0->AddString( _T("Item2") );
  1043. pCellComboBox0->AddString( _T("Item3") );
  1044. pCellComboBox0->AddString( _T("Item4") );
  1045. pCellComboBox0->AddString( _T("Item5") );
  1046. pCellComboBox0->AddString( _T("Item6") );
  1047. pCellComboBox0->AddString( _T("Item7") );
  1048. pCellComboBox0->SetCurSel( 2 );
  1049. pCellComboBox0->TextColorSet( CExtGridCell::__ECS_ALL, RGB(255,0,0) );
  1050. //pCellComboBox0->SortItems( false );
  1051. CExtGridCellComboBox * pCellComboBox1 =
  1052. STATIC_DOWNCAST(
  1053. CExtGridCellComboBox,
  1054. m_wndGrid.GridCellGet( nColNo, 1L )
  1055. );
  1056. nItem = pCellComboBox1->AddString( _T("Item1") );
  1057. pCellComboBox1->SetItemIndent( nItem, 0 );
  1058. nItem = pCellComboBox1->AddString( _T("Item2") );
  1059. pCellComboBox1->SetItemIndent( nItem, 1 );
  1060. nItem = pCellComboBox1->AddString( _T("Item3") );
  1061. pCellComboBox1->SetItemIndent( nItem, 2 );
  1062. nItem = pCellComboBox1->AddString( _T("Item4") );
  1063. pCellComboBox1->SetItemIndent( nItem, 0 );
  1064. nItem = pCellComboBox1->AddString( _T("Item5") );
  1065. pCellComboBox1->SetItemIndent( nItem, 1 );
  1066. nItem = pCellComboBox1->AddString( _T("Item6") );
  1067. pCellComboBox1->SetItemIndent( nItem, 2 );
  1068. nItem = pCellComboBox1->AddString( _T("Item7") );
  1069. pCellComboBox1->SetItemIndent( nItem, 3 );
  1070. pCellComboBox1->SetCurSel( 4 );
  1071. pCellComboBox1->TextColorSet( CExtGridCell::__ECS_ALL, RGB(0,255,0) );
  1072. CExtGridCellComboBox * pCellComboBox2 =
  1073. STATIC_DOWNCAST(
  1074. CExtGridCellComboBox,
  1075. m_wndGrid.GridCellGet( nColNo, 2L )
  1076. );
  1077. pCellComboBox2->SetEnumMode( true );
  1078. pCellComboBox2->SetImageList( &ilComboCell );
  1079. nItem = pCellComboBox2->AddString( _T("Item1") );
  1080. pCellComboBox2->SetItemImages( nItem, 1, 1, 1 );
  1081. nItem = pCellComboBox2->AddString( _T("Item2") );
  1082. pCellComboBox2->SetItemImages( nItem, 2, 2, 2 );
  1083. nItem = pCellComboBox2->AddString( _T("Item3") );
  1084. pCellComboBox2->SetItemImages( nItem, 3, 3, 3 );
  1085. nItem = pCellComboBox2->AddString( _T("Item4") );
  1086. pCellComboBox2->SetItemImages( nItem, 4, 4, 4 );
  1087. nItem = pCellComboBox2->AddString( _T("Item5") );
  1088. pCellComboBox2->SetItemImages( nItem, 5, 5, 5 );
  1089. nItem = pCellComboBox2->AddString( _T("Item6") );
  1090. pCellComboBox2->SetItemImages( nItem, 6, 6, 6 );
  1091. nItem = pCellComboBox2->AddString( _T("Item7") );
  1092. pCellComboBox2->SetItemImages( nItem, 7, 7, 7 );
  1093. pCellComboBox2->SetCurSel( 1 );
  1094. CExtGridCellComboBox * pCellComboBox3 =
  1095. STATIC_DOWNCAST(
  1096. CExtGridCellComboBox,
  1097. m_wndGrid.GridCellGet( nColNo, 3L )
  1098. );
  1099. pCellComboBox3->SetImageList( &ilComboCell );
  1100. nItem = pCellComboBox3->AddString( _T("Item1") );
  1101. pCellComboBox3->SetItemIndent( nItem, 0 );
  1102. pCellComboBox3->SetItemImages( nItem, 1, 1, 1 );
  1103. nItem = pCellComboBox3->AddString( _T("Item2") );
  1104. pCellComboBox3->SetItemIndent( nItem, 1 );
  1105. pCellComboBox3->SetItemImages( nItem, 2, 2, 2 );
  1106. nItem = pCellComboBox3->AddString( _T("Item3") );
  1107. pCellComboBox3->SetItemIndent( nItem, 2 );
  1108. pCellComboBox3->SetItemImages( nItem, 3, 3, 3 );
  1109. nItem = pCellComboBox3->AddString( _T("Item4") );
  1110. pCellComboBox3->SetItemIndent( nItem, 0 );
  1111. pCellComboBox3->SetItemImages( nItem, 4, 4, 4 );
  1112. nItem = pCellComboBox3->AddString( _T("Item5") );
  1113. pCellComboBox3->SetItemIndent( nItem, 1 );
  1114. pCellComboBox3->SetItemImages( nItem, 5, 5, 5 );
  1115. nItem = pCellComboBox3->AddString( _T("Item6") );
  1116. pCellComboBox3->SetItemIndent( nItem, 2 );
  1117. pCellComboBox3->SetItemImages( nItem, 6, 6, 6 );
  1118. nItem = pCellComboBox3->AddString( _T("Item7") );
  1119. pCellComboBox3->SetItemIndent( nItem, 3 );
  1120. pCellComboBox3->SetItemImages( nItem, 7, 7, 7 );
  1121. pCellComboBox3->SetCurSel( 4 );
  1122. CExtGridCellComboBox * pCellComboBox4 =
  1123. STATIC_DOWNCAST(
  1124. CExtGridCellComboBox,
  1125. m_wndGrid.GridCellGet( nColNo, 4L )
  1126. );
  1127. pCellComboBox4->SetEnumMode( true );
  1128. pCellComboBox4->SetImageList( &ilComboCell );
  1129. pCellComboBox4->ModifyStyle( __EGCS_BUTTON_UPDOWN );
  1130. pCellComboBox4->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
  1131. itemInfo.m_sString = _T("Item1");
  1132. itemInfo.m_nImage = 0;
  1133. itemInfo.m_nSelectedImage = 1;
  1134. itemInfo.m_nOverlayImage = 2;
  1135. pCellComboBox4->AddItem( &itemInfo );
  1136. itemInfo.m_sString = _T("Item2");
  1137. itemInfo.m_nImage = 1;
  1138. itemInfo.m_nSelectedImage = 2;
  1139. itemInfo.m_nOverlayImage = 3;
  1140. pCellComboBox4->AddItem( &itemInfo );
  1141. itemInfo.m_sString = _T("Item3");
  1142. itemInfo.m_nImage = 2;
  1143. itemInfo.m_nSelectedImage = 3;
  1144. itemInfo.m_nOverlayImage = 4;
  1145. pCellComboBox4->AddItem( &itemInfo );
  1146. itemInfo.m_sString = _T("Item4");
  1147. itemInfo.m_nImage = 3;
  1148. itemInfo.m_nSelectedImage = 4;
  1149. itemInfo.m_nOverlayImage = 5;
  1150. pCellComboBox4->AddItem( &itemInfo );
  1151. itemInfo.m_sString = _T("Item5");
  1152. itemInfo.m_nImage = 4;
  1153. itemInfo.m_nSelectedImage = 5;
  1154. itemInfo.m_nOverlayImage = 6;
  1155. pCellComboBox4->AddItem( &itemInfo );
  1156. itemInfo.m_sString = _T("Item6");
  1157. itemInfo.m_nImage = 5;
  1158. itemInfo.m_nSelectedImage = 6;
  1159. itemInfo.m_nOverlayImage = 7;
  1160. pCellComboBox4->AddItem( &itemInfo );
  1161. itemInfo.m_sString = _T("Item7");
  1162. itemInfo.m_nImage = 6;
  1163. itemInfo.m_nSelectedImage = 7;
  1164. itemInfo.m_nOverlayImage = 8;
  1165. pCellComboBox4->AddItem( &itemInfo );
  1166. pCellComboBox4->SetCurSel( 6 );
  1167. CExtGridCellComboBox * pCellComboBox5 =
  1168. STATIC_DOWNCAST(
  1169. CExtGridCellComboBox,
  1170. m_wndGrid.GridCellGet( nColNo, 5L )
  1171. );
  1172. pCellComboBox5->SetImageList( &ilComboCell );
  1173. nItem = pCellComboBox5->AddString( _T("Item1") );
  1174. pCellComboBox5->SetItemIndent( nItem, 0 );
  1175. pCellComboBox5->SetItemImages( nItem, 3, 7, 9 );
  1176. nItem = pCellComboBox5->AddString( _T("Item2") );
  1177. pCellComboBox5->SetItemIndent( nItem, 1 );
  1178. pCellComboBox5->SetItemImages( nItem, 4, 2, 0 );
  1179. nItem = pCellComboBox5->AddString( _T("Item3") );
  1180. pCellComboBox5->SetItemIndent( nItem, 2 );
  1181. pCellComboBox5->SetItemImages( nItem, 5, 4, 11 );
  1182. nItem = pCellComboBox5->AddString( _T("Item4") );
  1183. pCellComboBox5->SetItemIndent( nItem, 3 );
  1184. pCellComboBox5->SetItemImages( nItem, 6, 1, 3 );
  1185. nItem = pCellComboBox5->AddString( _T("Item5") );
  1186. pCellComboBox5->SetItemIndent( nItem, 4 );
  1187. pCellComboBox5->SetItemImages( nItem, 7, 9, 2 );
  1188. nItem = pCellComboBox5->AddString( _T("Item6") );
  1189. pCellComboBox5->SetItemIndent( nItem, 5 );
  1190. pCellComboBox5->SetItemImages( nItem, 8, 10, 5 );
  1191. nItem = pCellComboBox5->AddString( _T("Item7") );
  1192. pCellComboBox5->SetItemIndent( nItem, 6 );
  1193. pCellComboBox5->SetItemImages( nItem, 9, 11, 6 );
  1194. pCellComboBox5->SetCurSel( 3 );
  1195. CExtGridCellComboBox * pCellComboBox6 =
  1196. STATIC_DOWNCAST(
  1197. CExtGridCellComboBox,
  1198. m_wndGrid.GridCellGet( nColNo, 6L )
  1199. );
  1200. pCellComboBox6->SetEnumMode( true );
  1201. pCellComboBox6->AddString( _T("Item1") );
  1202. pCellComboBox6->AddString( _T("Item2") );
  1203. pCellComboBox6->AddString( _T("Item3") );
  1204. pCellComboBox6->AddString( _T("Item4") );
  1205. pCellComboBox6->AddString( _T("Item5") );
  1206. pCellComboBox6->AddString( _T("Item6") );
  1207. pCellComboBox6->AddString( _T("Item7") );
  1208. pCellComboBox6->SetCurSel( 6 );
  1209. pCellComboBox6->ModifyStyle( __EGCS_BUTTON_UPDOWN );
  1210. CExtGridCellComboBox * pCellComboBox7 =
  1211. STATIC_DOWNCAST(
  1212. CExtGridCellComboBox,
  1213. m_wndGrid.GridCellGet( nColNo, 7L )
  1214. );
  1215. pCellComboBox7->SetEnumMode( true );
  1216. pCellComboBox7->AddString( _T("Item1") );
  1217. pCellComboBox7->AddString( _T("Item2") );
  1218. pCellComboBox7->AddString( _T("Item3") );
  1219. pCellComboBox7->AddString( _T("Item4") );
  1220. pCellComboBox7->AddString( _T("Item5") );
  1221. pCellComboBox7->AddString( _T("Item6") );
  1222. pCellComboBox7->AddString( _T("Item7") );
  1223. pCellComboBox7->SetCurSel( 4 );
  1224. pCellComboBox7->ModifyStyle( __EGCS_BUTTON_UPDOWN, __EGCS_BUTTON_DROPDOWN );
  1225. CExtGridCellComboBox * pCellComboBox8 =
  1226. STATIC_DOWNCAST(
  1227. CExtGridCellComboBox,
  1228. m_wndGrid.GridCellGet( nColNo, 8L )
  1229. );
  1230. pCellComboBox8->TextSet( _T("Custom Text") );
  1231. pCellComboBox8->AddString( _T("Item1") );
  1232. pCellComboBox8->AddString( _T("Item2") );
  1233. pCellComboBox8->AddString( _T("Item3") );
  1234. pCellComboBox8->AddString( _T("Item4") );
  1235. pCellComboBox8->AddString( _T("Item5") );
  1236. pCellComboBox8->AddString( _T("Item6") );
  1237. pCellComboBox8->AddString( _T("Item7") );
  1238. CExtGridCellComboBox * pCellComboBox9 =
  1239. STATIC_DOWNCAST(
  1240. CExtGridCellComboBox,
  1241. m_wndGrid.GridCellGet( nColNo, 9L )
  1242. );
  1243. pCellComboBox9->TextSet( _T("Empty") );
  1244. }
  1245. void CPageGrid::_InitColumnCheckComboBox( LONG nColNo, LONG nRowCount )
  1246. {
  1247. ASSERT_VALID( this );
  1248. ASSERT_VALID( &m_wndGrid );
  1249. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1250. {
  1251. CExtGridCellCheckListComboBox * pCellComboBox =
  1252. STATIC_DOWNCAST(
  1253. CExtGridCellCheckListComboBox,
  1254. m_wndGrid.GridCellGet(
  1255. nColNo,
  1256. nRowNo,
  1257. 0,
  1258. 0,
  1259. RUNTIME_CLASS(CExtGridCellCheckListComboBox)
  1260. )
  1261. );
  1262. pCellComboBox;
  1263. }
  1264. CExtImageList ilComboCell;
  1265. ilComboCell.Load( IDB_COMBO_CELL_IMAGES, RGB(255,0,255), 16 );
  1266. LONG nItem = 0L;
  1267. CExtGridCellComboBox::ITEM_INFO itemInfo;
  1268. CExtGridCellCheckListComboBox * pCellComboBox0 =
  1269. STATIC_DOWNCAST(
  1270. CExtGridCellCheckListComboBox,
  1271. m_wndGrid.GridCellGet( nColNo, 0L )
  1272. );
  1273. pCellComboBox0->AddString( _T("Windows 98") );
  1274. pCellComboBox0->AddString( _T("Windows NT") );
  1275. pCellComboBox0->AddString( _T("Windows 2000") );
  1276. pCellComboBox0->AddString( _T("Windows XP") );
  1277. pCellComboBox0->AddString( _T("Windows Vista") );
  1278. pCellComboBox0->ItemCheckSet( 0, 1 );
  1279. pCellComboBox0->ItemCheckSet( 3, 1 );
  1280. CExtGridCellCheckListComboBox * pCellComboBox1 =
  1281. STATIC_DOWNCAST(
  1282. CExtGridCellCheckListComboBox,
  1283. m_wndGrid.GridCellGet( nColNo, 1L )
  1284. );
  1285. nItem = pCellComboBox1->AddString( _T("Item1") );
  1286. pCellComboBox1->SetItemIndent( nItem, 0 );
  1287. nItem = pCellComboBox1->AddString( _T("Item2") );
  1288. pCellComboBox1->SetItemIndent( nItem, 1 );
  1289. nItem = pCellComboBox1->AddString( _T("Item3") );
  1290. pCellComboBox1->SetItemIndent( nItem, 2 );
  1291. nItem = pCellComboBox1->AddString( _T("Item4") );
  1292. pCellComboBox1->SetItemIndent( nItem, 0 );
  1293. nItem = pCellComboBox1->AddString( _T("Item5") );
  1294. pCellComboBox1->SetItemIndent( nItem, 1 );
  1295. nItem = pCellComboBox1->AddString( _T("Item6") );
  1296. pCellComboBox1->SetItemIndent( nItem, 2 );
  1297. nItem = pCellComboBox1->AddString( _T("Item7") );
  1298. pCellComboBox1->SetItemIndent( nItem, 3 );
  1299. pCellComboBox1->ItemCheckSet( 0, 1 );
  1300. pCellComboBox1->ItemCheckSet( 4, 1 );
  1301. CExtGridCellCheckListComboBox * pCellComboBox2 =
  1302. STATIC_DOWNCAST(
  1303. CExtGridCellCheckListComboBox,
  1304. m_wndGrid.GridCellGet( nColNo, 2L )
  1305. );
  1306. pCellComboBox2->SetImageList( &ilComboCell );
  1307. nItem = pCellComboBox2->AddString( _T("Item1") );
  1308. pCellComboBox2->SetItemImages( nItem, 1, 1, 1 );
  1309. nItem = pCellComboBox2->AddString( _T("Item2") );
  1310. pCellComboBox2->SetItemImages( nItem, 2, 2, 2 );
  1311. nItem = pCellComboBox2->AddString( _T("Item3") );
  1312. pCellComboBox2->SetItemImages( nItem, 3, 3, 3 );
  1313. nItem = pCellComboBox2->AddString( _T("Item4") );
  1314. pCellComboBox2->SetItemImages( nItem, 4, 4, 4 );
  1315. nItem = pCellComboBox2->AddString( _T("Item5") );
  1316. pCellComboBox2->SetItemImages( nItem, 5, 5, 5 );
  1317. nItem = pCellComboBox2->AddString( _T("Item6") );
  1318. pCellComboBox2->SetItemImages( nItem, 6, 6, 6 );
  1319. nItem = pCellComboBox2->AddString( _T("Item7") );
  1320. pCellComboBox2->SetItemImages( nItem, 7, 7, 7 );
  1321. pCellComboBox2->ItemCheckSet( 1, 1 );
  1322. CExtGridCellCheckListComboBox * pCellComboBox3 =
  1323. STATIC_DOWNCAST(
  1324. CExtGridCellCheckListComboBox,
  1325. m_wndGrid.GridCellGet( nColNo, 3L )
  1326. );
  1327. pCellComboBox3->SetImageList( &ilComboCell );
  1328. nItem = pCellComboBox3->AddString( _T("Item1") );
  1329. pCellComboBox3->SetItemIndent( nItem, 0 );
  1330. pCellComboBox3->SetItemImages( nItem, 1, 1, 1 );
  1331. nItem = pCellComboBox3->AddString( _T("Item2") );
  1332. pCellComboBox3->SetItemIndent( nItem, 1 );
  1333. pCellComboBox3->SetItemImages( nItem, 2, 2, 2 );
  1334. nItem = pCellComboBox3->AddString( _T("Item3") );
  1335. pCellComboBox3->SetItemIndent( nItem, 2 );
  1336. pCellComboBox3->SetItemImages( nItem, 3, 3, 3 );
  1337. nItem = pCellComboBox3->AddString( _T("Item4") );
  1338. pCellComboBox3->SetItemIndent( nItem, 0 );
  1339. pCellComboBox3->SetItemImages( nItem, 4, 4, 4 );
  1340. nItem = pCellComboBox3->AddString( _T("Item5") );
  1341. pCellComboBox3->SetItemIndent( nItem, 1 );
  1342. pCellComboBox3->SetItemImages( nItem, 5, 5, 5 );
  1343. nItem = pCellComboBox3->AddString( _T("Item6") );
  1344. pCellComboBox3->SetItemIndent( nItem, 2 );
  1345. pCellComboBox3->SetItemImages( nItem, 6, 6, 6 );
  1346. nItem = pCellComboBox3->AddString( _T("Item7") );
  1347. pCellComboBox3->SetItemIndent( nItem, 3 );
  1348. pCellComboBox3->SetItemImages( nItem, 7, 7, 7 );
  1349. pCellComboBox3->ItemCheckSet( 1, 1 );
  1350. pCellComboBox3->ItemCheckSet( 3, 1 );
  1351. pCellComboBox3->ItemCheckSet( 5, 1 );
  1352. CExtGridCellCheckListComboBox * pCellComboBox4 =
  1353. STATIC_DOWNCAST(
  1354. CExtGridCellCheckListComboBox,
  1355. m_wndGrid.GridCellGet( nColNo, 4L )
  1356. );
  1357. pCellComboBox4->SetImageList( &ilComboCell );
  1358. pCellComboBox4->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
  1359. itemInfo.m_sString = _T("Item1");
  1360. itemInfo.m_nImage = 0;
  1361. itemInfo.m_nSelectedImage = 1;
  1362. itemInfo.m_nOverlayImage = 2;
  1363. pCellComboBox4->AddItem( &itemInfo );
  1364. itemInfo.m_sString = _T("Item2");
  1365. itemInfo.m_nImage = 1;
  1366. itemInfo.m_nSelectedImage = 2;
  1367. itemInfo.m_nOverlayImage = 3;
  1368. pCellComboBox4->AddItem( &itemInfo );
  1369. itemInfo.m_sString = _T("Item3");
  1370. itemInfo.m_nImage = 2;
  1371. itemInfo.m_nSelectedImage = 3;
  1372. itemInfo.m_nOverlayImage = 4;
  1373. pCellComboBox4->AddItem( &itemInfo );
  1374. itemInfo.m_sString = _T("Item4");
  1375. itemInfo.m_nImage = 3;
  1376. itemInfo.m_nSelectedImage = 4;
  1377. itemInfo.m_nOverlayImage = 5;
  1378. pCellComboBox4->AddItem( &itemInfo );
  1379. itemInfo.m_sString = _T("Item5");
  1380. itemInfo.m_nImage = 4;
  1381. itemInfo.m_nSelectedImage = 5;
  1382. itemInfo.m_nOverlayImage = 6;
  1383. pCellComboBox4->AddItem( &itemInfo );
  1384. itemInfo.m_sString = _T("Item6");
  1385. itemInfo.m_nImage = 5;
  1386. itemInfo.m_nSelectedImage = 6;
  1387. itemInfo.m_nOverlayImage = 7;
  1388. pCellComboBox4->AddItem( &itemInfo );
  1389. itemInfo.m_sString = _T("Item7");
  1390. itemInfo.m_nImage = 6;
  1391. itemInfo.m_nSelectedImage = 7;
  1392. itemInfo.m_nOverlayImage = 8;
  1393. pCellComboBox4->AddItem( &itemInfo );
  1394. pCellComboBox4->ItemCheckSet( 5, 1 );
  1395. pCellComboBox4->ItemCheckSet( 6, 1 );
  1396. CExtGridCellCheckListComboBox * pCellComboBox5 =
  1397. STATIC_DOWNCAST(
  1398. CExtGridCellCheckListComboBox,
  1399. m_wndGrid.GridCellGet( nColNo, 5L )
  1400. );
  1401. pCellComboBox5->SetImageList( &ilComboCell );
  1402. nItem = pCellComboBox5->AddString( _T("Item1") );
  1403. pCellComboBox5->SetItemIndent( nItem, 0 );
  1404. pCellComboBox5->SetItemImages( nItem, 3, 7, 9 );
  1405. nItem = pCellComboBox5->AddString( _T("Item2") );
  1406. pCellComboBox5->SetItemIndent( nItem, 1 );
  1407. pCellComboBox5->SetItemImages( nItem, 4, 2, 0 );
  1408. nItem = pCellComboBox5->AddString( _T("Item3") );
  1409. pCellComboBox5->SetItemIndent( nItem, 2 );
  1410. pCellComboBox5->SetItemImages( nItem, 5, 4, 11 );
  1411. nItem = pCellComboBox5->AddString( _T("Item4") );
  1412. pCellComboBox5->SetItemIndent( nItem, 3 );
  1413. pCellComboBox5->SetItemImages( nItem, 6, 1, 3 );
  1414. nItem = pCellComboBox5->AddString( _T("Item5") );
  1415. pCellComboBox5->SetItemIndent( nItem, 4 );
  1416. pCellComboBox5->SetItemImages( nItem, 7, 9, 2 );
  1417. nItem = pCellComboBox5->AddString( _T("Item6") );
  1418. pCellComboBox5->SetItemIndent( nItem, 5 );
  1419. pCellComboBox5->SetItemImages( nItem, 8, 10, 5 );
  1420. nItem = pCellComboBox5->AddString( _T("Item7") );
  1421. pCellComboBox5->SetItemIndent( nItem, 6 );
  1422. pCellComboBox5->SetItemImages( nItem, 9, 11, 6 );
  1423. pCellComboBox5->ItemCheckSet( 3, 1 );
  1424. pCellComboBox5->ItemCheckSet( 5, 1 );
  1425. CExtGridCellCheckListComboBox * pCellComboBox6 =
  1426. STATIC_DOWNCAST(
  1427. CExtGridCellCheckListComboBox,
  1428. m_wndGrid.GridCellGet( nColNo, 6L )
  1429. );
  1430. pCellComboBox6->AddString( _T("Item1") );
  1431. pCellComboBox6->AddString( _T("Item2") );
  1432. pCellComboBox6->AddString( _T("Item3") );
  1433. pCellComboBox6->AddString( _T("Item4") );
  1434. pCellComboBox6->AddString( _T("Item5") );
  1435. pCellComboBox6->AddString( _T("Item6") );
  1436. pCellComboBox6->AddString( _T("Item7") );
  1437. pCellComboBox6->ItemCheckSet( 6, 1 );
  1438. CExtGridCellCheckListComboBox * pCellComboBox7 =
  1439. STATIC_DOWNCAST(
  1440. CExtGridCellCheckListComboBox,
  1441. m_wndGrid.GridCellGet( nColNo, 7L )
  1442. );
  1443. pCellComboBox7->AddString( _T("Item1") );
  1444. pCellComboBox7->AddString( _T("Item2") );
  1445. pCellComboBox7->AddString( _T("Item3") );
  1446. pCellComboBox7->AddString( _T("Item4") );
  1447. pCellComboBox7->AddString( _T("Item5") );
  1448. pCellComboBox7->AddString( _T("Item6") );
  1449. pCellComboBox7->AddString( _T("Item7") );
  1450. pCellComboBox7->ItemCheckSet( 0, 1 );
  1451. pCellComboBox7->ItemCheckSet( 2, 1 );
  1452. pCellComboBox7->ItemCheckSet( 4, 1 );
  1453. pCellComboBox7->ItemCheckSet( 6, 1 );
  1454. CExtGridCellCheckListComboBox * pCellComboBox8 =
  1455. STATIC_DOWNCAST(
  1456. CExtGridCellCheckListComboBox,
  1457. m_wndGrid.GridCellGet( nColNo, 8L )
  1458. );
  1459. pCellComboBox8->AddString( _T("Item1") );
  1460. pCellComboBox8->AddString( _T("Item2") );
  1461. pCellComboBox8->AddString( _T("Item3") );
  1462. pCellComboBox8->AddString( _T("Item4") );
  1463. pCellComboBox8->AddString( _T("Item5") );
  1464. pCellComboBox8->AddString( _T("Item6") );
  1465. pCellComboBox8->AddString( _T("Item7") );
  1466. CExtGridCellCheckListComboBox * pCellComboBox9 =
  1467. STATIC_DOWNCAST(
  1468. CExtGridCellCheckListComboBox,
  1469. m_wndGrid.GridCellGet( nColNo, 9L )
  1470. );
  1471. pCellComboBox9->TextSet( _T("") );
  1472. }
  1473. void CPageGrid::_InitColumnDateTime( LONG nColNo, LONG nRowCount )
  1474. {
  1475. ASSERT_VALID( this );
  1476. ASSERT_VALID( &m_wndGrid );
  1477. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1478. {
  1479. CExtGridCellDateTime * pCellDateTime =
  1480. STATIC_DOWNCAST(
  1481. CExtGridCellDateTime,
  1482. m_wndGrid.GridCellGet(
  1483. nColNo,
  1484. nRowNo,
  1485. 0,
  1486. 0,
  1487. RUNTIME_CLASS(CExtGridCellDateTime)
  1488. )
  1489. );
  1490. pCellDateTime->SetDateTime( COleDateTime::GetCurrentTime() );
  1491. }
  1492. CExtGridCellDateTime * pCellDateTime0 =
  1493. STATIC_DOWNCAST(
  1494. CExtGridCellDateTime,
  1495. m_wndGrid.GridCellGet( nColNo, 0L )
  1496. );
  1497. pCellDateTime0->SetMode( CExtGridCellDateTime::all );
  1498. pCellDateTime0->SetTimeFormat( CExtGridCellDateTime::automatic );
  1499. pCellDateTime0->ModifyStyle( __EGCS_BUTTON_UPDOWN, __EGCS_BUTTON_ELLIPSIS | __EGCS_BUTTON_DROPDOWN );
  1500. CExtGridCellDateTime * pCellDateTime1 =
  1501. STATIC_DOWNCAST(
  1502. CExtGridCellDateTime,
  1503. m_wndGrid.GridCellGet( nColNo, 1L )
  1504. );
  1505. pCellDateTime1->SetMode( CExtGridCellDateTime::date );
  1506. pCellDateTime1->SetTimeFormat( CExtGridCellDateTime::automatic );
  1507. pCellDateTime1->ModifyStyle( __EGCS_BUTTON_UPDOWN, __EGCS_BUTTON_ELLIPSIS | __EGCS_BUTTON_DROPDOWN );
  1508. pCellDateTime1->ModifyStyle( __EGCS_READ_ONLY, 0 );
  1509. pCellDateTime1->IconIndexSet( 7 );
  1510. CExtGridCellDateTime * pCellDateTime2 =
  1511. STATIC_DOWNCAST(
  1512. CExtGridCellDateTime,
  1513. m_wndGrid.GridCellGet( nColNo, 2L )
  1514. );
  1515. pCellDateTime2->SetMode( CExtGridCellDateTime::time );
  1516. pCellDateTime2->SetTimeFormat( CExtGridCellDateTime::automatic );
  1517. pCellDateTime2->ModifyStyle( 0, __EGCS_BUTTON_DROPDOWN );
  1518. CExtGridCellDateTime * pCellDateTime3 =
  1519. STATIC_DOWNCAST(
  1520. CExtGridCellDateTime,
  1521. m_wndGrid.GridCellGet( nColNo, 3L )
  1522. );
  1523. pCellDateTime3->SetMode( CExtGridCellDateTime::all );
  1524. pCellDateTime3->SetTimeFormat( CExtGridCellDateTime::h24 );
  1525. CExtGridCellDateTime * pCellDateTime4 =
  1526. STATIC_DOWNCAST(
  1527. CExtGridCellDateTime,
  1528. m_wndGrid.GridCellGet( nColNo, 4L )
  1529. );
  1530. pCellDateTime4->SetMode( CExtGridCellDateTime::all );
  1531. pCellDateTime4->SetTimeFormat( CExtGridCellDateTime::h12 );
  1532. CExtGridCellDateTime * pCellDateTime5 =
  1533. STATIC_DOWNCAST(
  1534. CExtGridCellDateTime,
  1535. m_wndGrid.GridCellGet( nColNo, 5L )
  1536. );
  1537. pCellDateTime5->SetMode( CExtGridCellDateTime::time );
  1538. pCellDateTime5->SetTimeFormat( CExtGridCellDateTime::h24 );
  1539. pCellDateTime5->ModifyStyle( 0, __EGCS_BUTTON_DROPDOWN );
  1540. CExtGridCellDateTime * pCellDateTime6 =
  1541. STATIC_DOWNCAST(
  1542. CExtGridCellDateTime,
  1543. m_wndGrid.GridCellGet( nColNo, 6L )
  1544. );
  1545. pCellDateTime6->SetMode( CExtGridCellDateTime::time );
  1546. pCellDateTime6->SetTimeFormat( CExtGridCellDateTime::h12 );
  1547. pCellDateTime6->ModifyStyle( 0, __EGCS_BUTTON_DROPDOWN );
  1548. CExtGridCellDateTime * pCellDateTime7 =
  1549. STATIC_DOWNCAST(
  1550. CExtGridCellDateTime,
  1551. m_wndGrid.GridCellGet( nColNo, 7L )
  1552. );
  1553. pCellDateTime7->SetMode( CExtGridCellDateTime::date );
  1554. pCellDateTime7->SetTimeFormat( CExtGridCellDateTime::automatic );
  1555. CExtGridCellDateTime * pCellDateTime8 =
  1556. STATIC_DOWNCAST(
  1557. CExtGridCellDateTime,
  1558. m_wndGrid.GridCellGet( nColNo, 8L )
  1559. );
  1560. pCellDateTime8->SetMode( CExtGridCellDateTime::time );
  1561. pCellDateTime8->SetTimeFormat( CExtGridCellDateTime::automatic );
  1562. pCellDateTime8->ModifyStyle( 0, __EGCS_BUTTON_DROPDOWN );
  1563. CExtGridCellDateTime * pCellDateTime9 =
  1564. STATIC_DOWNCAST(
  1565. CExtGridCellDateTime,
  1566. m_wndGrid.GridCellGet( nColNo, 9L )
  1567. );
  1568. pCellDateTime9->SetMode( CExtGridCellDateTime::all );
  1569. pCellDateTime9->SetTimeFormat( CExtGridCellDateTime::automatic );
  1570. }
  1571. void CPageGrid::_InitColumnDuration( LONG nColNo, LONG nRowCount )
  1572. {
  1573. ASSERT_VALID( this );
  1574. ASSERT_VALID( &m_wndGrid );
  1575. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1576. {
  1577. CExtGridCellDuration * pCellDuration =
  1578. STATIC_DOWNCAST(
  1579. CExtGridCellDuration,
  1580. m_wndGrid.GridCellGet(
  1581. nColNo,
  1582. nRowNo,
  1583. 0,
  1584. 0,
  1585. RUNTIME_CLASS(CExtGridCellDuration)
  1586. )
  1587. );
  1588. pCellDuration->ModifyStyle( 0, __EGCS_BUTTON_DROPDOWN );
  1589. }
  1590. CExtGridCellDuration * pCellDuration0 =
  1591. STATIC_DOWNCAST(
  1592. CExtGridCellDuration,
  1593. m_wndGrid.GridCellGet( nColNo, 0L )
  1594. );
  1595. pCellDuration0->DurationSet( 1, 2, 3, 4 );
  1596. CExtGridCellDuration * pCellDuration1 =
  1597. STATIC_DOWNCAST(
  1598. CExtGridCellDuration,
  1599. m_wndGrid.GridCellGet( nColNo, 1L )
  1600. );
  1601. pCellDuration1->DurationSet( 10, 5, 25, 50 );
  1602. pCellDuration1->ContinuousScrollingSet( true );
  1603. pCellDuration1->ModifyStyle( __EGCS_BUTTON_UPDOWN, __EGCS_BUTTON_ELLIPSIS | __EGCS_BUTTON_DROPDOWN );
  1604. CExtGridCellDuration * pCellDuration2 =
  1605. STATIC_DOWNCAST(
  1606. CExtGridCellDuration,
  1607. m_wndGrid.GridCellGet( nColNo, 2L )
  1608. );
  1609. pCellDuration2->DurationSet( 2, 10, 0, 0 );
  1610. CExtGridCellDuration * pCellDuration3 =
  1611. STATIC_DOWNCAST(
  1612. CExtGridCellDuration,
  1613. m_wndGrid.GridCellGet( nColNo, 3L )
  1614. );
  1615. pCellDuration3->DurationSet( 10000L );
  1616. pCellDuration3->ContinuousScrollingSet( true );
  1617. pCellDuration3->ModifyStyle( __EGCS_BUTTON_UPDOWN, __EGCS_BUTTON_ELLIPSIS | __EGCS_BUTTON_DROPDOWN );
  1618. CExtGridCellDuration * pCellDuration4 =
  1619. STATIC_DOWNCAST(
  1620. CExtGridCellDuration,
  1621. m_wndGrid.GridCellGet( nColNo, 4L )
  1622. );
  1623. pCellDuration4->DurationSet( 10, 1, 0, 0 );
  1624. CExtGridCellDuration * pCellDuration5 =
  1625. STATIC_DOWNCAST(
  1626. CExtGridCellDuration,
  1627. m_wndGrid.GridCellGet( nColNo, 5L )
  1628. );
  1629. pCellDuration5->DurationSet( COleDateTimeSpan( 5, 0, 0, 0 ) );
  1630. pCellDuration5->ContinuousScrollingSet( true );
  1631. pCellDuration5->ModifyStyle( __EGCS_BUTTON_UPDOWN, __EGCS_BUTTON_ELLIPSIS | __EGCS_BUTTON_DROPDOWN );
  1632. CExtGridCellDuration * pCellDuration6 =
  1633. STATIC_DOWNCAST(
  1634. CExtGridCellDuration,
  1635. m_wndGrid.GridCellGet( nColNo, 6L )
  1636. );
  1637. pCellDuration6->DurationSet( 365, 12, 0, 0 );
  1638. CExtGridCellDuration * pCellDuration7 =
  1639. STATIC_DOWNCAST(
  1640. CExtGridCellDuration,
  1641. m_wndGrid.GridCellGet( nColNo, 7L )
  1642. );
  1643. pCellDuration7->DurationSet( 100.9573 );
  1644. pCellDuration7->ContinuousScrollingSet( true );
  1645. pCellDuration7->ModifyStyle( __EGCS_BUTTON_UPDOWN, __EGCS_BUTTON_ELLIPSIS | __EGCS_BUTTON_DROPDOWN );
  1646. CExtGridCellDuration * pCellDuration8 =
  1647. STATIC_DOWNCAST(
  1648. CExtGridCellDuration,
  1649. m_wndGrid.GridCellGet( nColNo, 8L )
  1650. );
  1651. pCellDuration8->DurationSet( 12345L );
  1652. CExtGridCellDuration * pCellDuration9 =
  1653. STATIC_DOWNCAST(
  1654. CExtGridCellDuration,
  1655. m_wndGrid.GridCellGet( nColNo, 9L )
  1656. );
  1657. pCellDuration9->DurationSet( COleDateTimeSpan( 5.05 ) );
  1658. pCellDuration9->ContinuousScrollingSet( true );
  1659. }
  1660. void CPageGrid::_InitColumnHyperLink( LONG nColNo, LONG nRowCount )
  1661. {
  1662. ASSERT_VALID( this );
  1663. ASSERT_VALID( &m_wndGrid );
  1664. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1665. {
  1666. CExtGridCellHyperLink * pCellHyperLink =
  1667. STATIC_DOWNCAST(
  1668. CExtGridCellHyperLink,
  1669. m_wndGrid.GridCellGet(
  1670. nColNo,
  1671. nRowNo,
  1672. 0,
  1673. 0,
  1674. RUNTIME_CLASS(CExtGridCellHyperLink)
  1675. )
  1676. );
  1677. UNREFERENCED_PARAMETER(pCellHyperLink);
  1678. }
  1679. CExtGridCellHyperLink * pCellHyperLink0 =
  1680. STATIC_DOWNCAST(
  1681. CExtGridCellHyperLink,
  1682. m_wndGrid.GridCellGet( nColNo, 0L )
  1683. );
  1684. pCellHyperLink0->TextSet( _T("www.prof-uis.com") );
  1685. CExtGridCellHyperLink * pCellHyperLink1 =
  1686. STATIC_DOWNCAST(
  1687. CExtGridCellHyperLink,
  1688. m_wndGrid.GridCellGet( nColNo, 1L )
  1689. );
  1690. pCellHyperLink1->SetURL( _T("mailto:info@prof-uis.com") );
  1691. pCellHyperLink1->TextSet( _T("Mail to Prof-UIS Team") );
  1692. pCellHyperLink1->SetAllowVisitedState( FALSE );
  1693. CExtGridCellHyperLink * pCellHyperLink2 =
  1694. STATIC_DOWNCAST(
  1695. CExtGridCellHyperLink,
  1696. m_wndGrid.GridCellGet( nColNo, 2L )
  1697. );
  1698. pCellHyperLink2->SetURL( _T("www.prof-uis.com") );
  1699. pCellHyperLink2->TextSet( _T("Prof-UIS Home") );
  1700. pCellHyperLink2->SetTextHoverUnderline( FALSE );
  1701. pCellHyperLink2->SetTextColorVisited( RGB(255,0,0) );
  1702. CExtGridCellHyperLink * pCellHyperLink3 =
  1703. STATIC_DOWNCAST(
  1704. CExtGridCellHyperLink,
  1705. m_wndGrid.GridCellGet( nColNo, 3L )
  1706. );
  1707. pCellHyperLink3->SetURL( _T("http://www.prof-uis.com/elegantgridnet.aspx") );
  1708. pCellHyperLink3->TextSet( _T("Prof-UIS Elegant Grid") );
  1709. CExtGridCellHyperLink * pCellHyperLink4 =
  1710. STATIC_DOWNCAST(
  1711. CExtGridCellHyperLink,
  1712. m_wndGrid.GridCellGet( nColNo, 4L )
  1713. );
  1714. pCellHyperLink4->SetURL( _T("http://www.prof-uis.com/Overview.aspx?view=FrameFeatures") );
  1715. pCellHyperLink4->TextSet( _T("Prof-UIS Frame Features") );
  1716. pCellHyperLink4->SetTextHoverUnderline( FALSE );
  1717. CExtGridCellHyperLink * pCellHyperLink5 =
  1718. STATIC_DOWNCAST(
  1719. CExtGridCellHyperLink,
  1720. m_wndGrid.GridCellGet( nColNo, 5L )
  1721. );
  1722. pCellHyperLink5->SetURL( _T("http://www.prof-uis.com/Forum.aspx") );
  1723. pCellHyperLink5->TextSet( _T("Prof-UIS Forum") );
  1724. pCellHyperLink5->SetAllowVisitedState( FALSE );
  1725. CExtGridCellHyperLink * pCellHyperLink6 =
  1726. STATIC_DOWNCAST(
  1727. CExtGridCellHyperLink,
  1728. m_wndGrid.GridCellGet( nColNo, 6L )
  1729. );
  1730. pCellHyperLink6->SetURL( _T("http://www.prof-uis.com/VersionHistory.aspx") );
  1731. pCellHyperLink6->TextSet( _T("Prof-UIS Version History") );
  1732. pCellHyperLink6->SetTextHoverUnderline( FALSE );
  1733. CExtGridCellHyperLink * pCellHyperLink7 =
  1734. STATIC_DOWNCAST(
  1735. CExtGridCellHyperLink,
  1736. m_wndGrid.GridCellGet( nColNo, 7L )
  1737. );
  1738. pCellHyperLink7->SetURL( _T("http://www.prof-uis.com/download.aspx") );
  1739. pCellHyperLink7->TextSet( _T("Download") );
  1740. pCellHyperLink7->SetTextHoverUnderline( FALSE );
  1741. CExtGridCellHyperLink * pCellHyperLink8 =
  1742. STATIC_DOWNCAST(
  1743. CExtGridCellHyperLink,
  1744. m_wndGrid.GridCellGet( nColNo, 8L )
  1745. );
  1746. pCellHyperLink8->SetURL( _T("http://www.prof-uis.com/purchase.aspx") );
  1747. pCellHyperLink8->TextSet( _T("Purchase") );
  1748. pCellHyperLink8->SetTextColorVisited( RGB(0,255,0) );
  1749. CExtGridCellHyperLink * pCellHyperLink9 =
  1750. STATIC_DOWNCAST(
  1751. CExtGridCellHyperLink,
  1752. m_wndGrid.GridCellGet( nColNo, 9L )
  1753. );
  1754. pCellHyperLink9->SetURL( _T("http://www.prof-uis.com/WhatsNew.aspx") );
  1755. pCellHyperLink9->TextSet( _T("What's New") );
  1756. pCellHyperLink9->SetTextColorVisited( RGB(0,255,255) );
  1757. }
  1758. void CPageGrid::_InitColumnIPAddress( LONG nColNo, LONG nRowCount )
  1759. {
  1760. ASSERT_VALID( this );
  1761. ASSERT_VALID( &m_wndGrid );
  1762. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1763. {
  1764. CExtGridCellIPAddress * pCellIPAddress =
  1765. STATIC_DOWNCAST(
  1766. CExtGridCellIPAddress,
  1767. m_wndGrid.GridCellGet(
  1768. nColNo,
  1769. nRowNo,
  1770. 0,
  1771. 0,
  1772. RUNTIME_CLASS(CExtGridCellIPAddress)
  1773. )
  1774. );
  1775. UNREFERENCED_PARAMETER(pCellIPAddress);
  1776. }
  1777. CExtGridCellIPAddress * pCellIPAddress0 =
  1778. STATIC_DOWNCAST(
  1779. CExtGridCellIPAddress,
  1780. m_wndGrid.GridCellGet( nColNo, 0L )
  1781. );
  1782. pCellIPAddress0->TextSet( _T("202.212.5.30") );
  1783. CExtGridCellIPAddress * pCellIPAddress1 =
  1784. STATIC_DOWNCAST(
  1785. CExtGridCellIPAddress,
  1786. m_wndGrid.GridCellGet( nColNo, 1L )
  1787. );
  1788. pCellIPAddress1->SetAddress( 207, 126, 239, 224 );
  1789. CExtGridCellIPAddress * pCellIPAddress2 =
  1790. STATIC_DOWNCAST(
  1791. CExtGridCellIPAddress,
  1792. m_wndGrid.GridCellGet( nColNo, 2L )
  1793. );
  1794. pCellIPAddress2->TextSet( _T("209.67.206.126") );
  1795. CExtGridCellIPAddress * pCellIPAddress3 =
  1796. STATIC_DOWNCAST(
  1797. CExtGridCellIPAddress,
  1798. m_wndGrid.GridCellGet( nColNo, 3L )
  1799. );
  1800. pCellIPAddress3->SetAddress( 213, 216, 143, 37 );
  1801. CExtGridCellIPAddress * pCellIPAddress4 =
  1802. STATIC_DOWNCAST(
  1803. CExtGridCellIPAddress,
  1804. m_wndGrid.GridCellGet( nColNo, 4L )
  1805. );
  1806. pCellIPAddress4->TextSet( _T("62.172.199.20") );
  1807. CExtGridCellIPAddress * pCellIPAddress5 =
  1808. STATIC_DOWNCAST(
  1809. CExtGridCellIPAddress,
  1810. m_wndGrid.GridCellGet( nColNo, 5L )
  1811. );
  1812. pCellIPAddress5->SetAddress( MAKEIPADDRESS( 62, 27, 59, 245 ) );
  1813. CExtGridCellIPAddress * pCellIPAddress6 =
  1814. STATIC_DOWNCAST(
  1815. CExtGridCellIPAddress,
  1816. m_wndGrid.GridCellGet( nColNo, 6L )
  1817. );
  1818. pCellIPAddress6->SetAddress( MAKEIPADDRESS( 64, 75, 36, 80 ) );
  1819. CExtGridCellIPAddress * pCellIPAddress7 =
  1820. STATIC_DOWNCAST(
  1821. CExtGridCellIPAddress,
  1822. m_wndGrid.GridCellGet( nColNo, 7L )
  1823. );
  1824. pCellIPAddress7->TextSet( _T("68.142.195.80") );
  1825. CExtGridCellIPAddress * pCellIPAddress8 =
  1826. STATIC_DOWNCAST(
  1827. CExtGridCellIPAddress,
  1828. m_wndGrid.GridCellGet( nColNo, 8L )
  1829. );
  1830. pCellIPAddress8->SetAddress( 207, 46, 130, 108 );
  1831. CExtGridCellIPAddress * pCellIPAddress9 =
  1832. STATIC_DOWNCAST(
  1833. CExtGridCellIPAddress,
  1834. m_wndGrid.GridCellGet( nColNo, 9L )
  1835. );
  1836. pCellIPAddress9->TextSet( _T("195.128.127.200") );
  1837. }
  1838. void CPageGrid::_InitColumnNumber( LONG nColNo, LONG nRowCount )
  1839. {
  1840. ASSERT_VALID( this );
  1841. ASSERT_VALID( &m_wndGrid );
  1842. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1843. {
  1844. CExtGridCellNumber * pCellNumber =
  1845. STATIC_DOWNCAST(
  1846. CExtGridCellNumber,
  1847. m_wndGrid.GridCellGet(
  1848. nColNo,
  1849. nRowNo,
  1850. 0,
  1851. 0,
  1852. RUNTIME_CLASS(CExtGridCellNumber)
  1853. )
  1854. );
  1855. UNREFERENCED_PARAMETER(pCellNumber);
  1856. }
  1857. CExtGridCellNumber * pCellNumber0 =
  1858. STATIC_DOWNCAST(
  1859. CExtGridCellNumber,
  1860. m_wndGrid.GridCellGet( nColNo, 0L )
  1861. );
  1862. pCellNumber0->_VariantAssign( 0.005 );
  1863. pCellNumber0->SetAutoNumDigits( true );
  1864. pCellNumber0->SetLeadingZero( 0 );
  1865. CExtGridCellNumber * pCellNumber1 =
  1866. STATIC_DOWNCAST(
  1867. CExtGridCellNumber,
  1868. m_wndGrid.GridCellGet( nColNo, 1L )
  1869. );
  1870. pCellNumber1->_VariantAssign( 123456 );
  1871. CExtGridCellNumber * pCellNumber2 =
  1872. STATIC_DOWNCAST(
  1873. CExtGridCellNumber,
  1874. m_wndGrid.GridCellGet( nColNo, 2L )
  1875. );
  1876. pCellNumber2->_VariantAssign( 123456.123456789 );
  1877. pCellNumber2->SetAutoNumDigits( true );
  1878. CExtGridCellNumber * pCellNumber3 =
  1879. STATIC_DOWNCAST(
  1880. CExtGridCellNumber,
  1881. m_wndGrid.GridCellGet( nColNo, 3L )
  1882. );
  1883. pCellNumber3->_VariantAssign( -12345667890L );
  1884. CExtGridCellNumber * pCellNumber4 =
  1885. STATIC_DOWNCAST(
  1886. CExtGridCellNumber,
  1887. m_wndGrid.GridCellGet( nColNo, 4L )
  1888. );
  1889. pCellNumber4->_VariantAssign( 123456678901L );
  1890. CExtGridCellNumber * pCellNumber5 =
  1891. STATIC_DOWNCAST(
  1892. CExtGridCellNumber,
  1893. m_wndGrid.GridCellGet( nColNo, 5L )
  1894. );
  1895. pCellNumber5->_VariantAssign( -458.46 );
  1896. pCellNumber5->SetNegativeOrder( 0 ); // Example: (1.1)
  1897. CExtGridCellNumber * pCellNumber6 =
  1898. STATIC_DOWNCAST(
  1899. CExtGridCellNumber,
  1900. m_wndGrid.GridCellGet( nColNo, 6L )
  1901. );
  1902. pCellNumber6->_VariantAssign( -56789217L );
  1903. pCellNumber6->SetNegativeOrder( 3 ); // Example: 1.1-
  1904. CExtGridCellNumber * pCellNumber7 =
  1905. STATIC_DOWNCAST(
  1906. CExtGridCellNumber,
  1907. m_wndGrid.GridCellGet( nColNo, 7L )
  1908. );
  1909. pCellNumber7->_VariantAssign( 54761.458 );
  1910. CExtGridCellNumber * pCellNumber8 =
  1911. STATIC_DOWNCAST(
  1912. CExtGridCellNumber,
  1913. m_wndGrid.GridCellGet( nColNo, 8L )
  1914. );
  1915. pCellNumber8->_VariantAssign( 547614584167L );
  1916. pCellNumber8->SetGrouping( _T("3;2;0") );
  1917. pCellNumber8->SetThousandSeparator( _T("'") );
  1918. CExtGridCellNumber * pCellNumber9 =
  1919. STATIC_DOWNCAST(
  1920. CExtGridCellNumber,
  1921. m_wndGrid.GridCellGet( nColNo, 9L )
  1922. );
  1923. pCellNumber9->_VariantAssign( 18.0005 );
  1924. pCellNumber9->SetAutoNumDigits( true );
  1925. pCellNumber9->SetDecimalSeparator( _T("^") );
  1926. }
  1927. void CPageGrid::_InitColumnCurrency( LONG nColNo, LONG nRowCount )
  1928. {
  1929. ASSERT_VALID( this );
  1930. ASSERT_VALID( &m_wndGrid );
  1931. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1932. {
  1933. CExtGridCellCurrency * pCellCurrency =
  1934. STATIC_DOWNCAST(
  1935. CExtGridCellCurrency,
  1936. m_wndGrid.GridCellGet(
  1937. nColNo,
  1938. nRowNo,
  1939. 0,
  1940. 0,
  1941. RUNTIME_CLASS(CExtGridCellCurrency)
  1942. )
  1943. );
  1944. UNREFERENCED_PARAMETER(pCellCurrency);
  1945. }
  1946. TCHAR szEuro[2] = { TCHAR(-120), 0 };
  1947. CExtGridCellCurrency * pCellCurrency0 =
  1948. STATIC_DOWNCAST(
  1949. CExtGridCellCurrency,
  1950. m_wndGrid.GridCellGet( nColNo, 0L )
  1951. );
  1952. pCellCurrency0->_VariantAssign( 0.005 );
  1953. pCellCurrency0->SetLeadingZero( 0 );
  1954. pCellCurrency0->SetNumDigits( 4 );
  1955. CExtGridCellCurrency * pCellCurrency1 =
  1956. STATIC_DOWNCAST(
  1957. CExtGridCellCurrency,
  1958. m_wndGrid.GridCellGet( nColNo, 1L )
  1959. );
  1960. pCellCurrency1->_VariantAssign( 123456 );
  1961. pCellCurrency1->SetPositiveOrder( 1 ); // Example: 1.1$
  1962. pCellCurrency1->SetCurrencySymbol( _T("$") );
  1963. pCellCurrency1->SetAutoNumDigits( false );
  1964. pCellCurrency1->SetAllowTrailingZeroes( true );
  1965. pCellCurrency1->SetNumDigits( 9 );
  1966. CExtGridCellCurrency * pCellCurrency2 =
  1967. STATIC_DOWNCAST(
  1968. CExtGridCellCurrency,
  1969. m_wndGrid.GridCellGet( nColNo, 2L )
  1970. );
  1971. pCellCurrency2->_VariantAssign( 123456.123456789 );
  1972. pCellCurrency2->SetPositiveOrder( 3 ); // Example: 1.1 $
  1973. pCellCurrency2->SetCurrencySymbol( szEuro );
  1974. CExtGridCellCurrency * pCellCurrency3 =
  1975. STATIC_DOWNCAST(
  1976. CExtGridCellCurrency,
  1977. m_wndGrid.GridCellGet( nColNo, 3L )
  1978. );
  1979. pCellCurrency3->_VariantAssign( -12345667890L );
  1980. CExtGridCellCurrency * pCellCurrency4 =
  1981. STATIC_DOWNCAST(
  1982. CExtGridCellCurrency,
  1983. m_wndGrid.GridCellGet( nColNo, 4L )
  1984. );
  1985. pCellCurrency4->_VariantAssign( 123456678901L );
  1986. CExtGridCellCurrency * pCellCurrency5 =
  1987. STATIC_DOWNCAST(
  1988. CExtGridCellCurrency,
  1989. m_wndGrid.GridCellGet( nColNo, 5L )
  1990. );
  1991. pCellCurrency5->_VariantAssign( -458.46 );
  1992. pCellCurrency5->SetNegativeOrder( 0 ); // Example: ($1.1)
  1993. pCellCurrency5->SetCurrencySymbol( szEuro );
  1994. CExtGridCellCurrency * pCellCurrency6 =
  1995. STATIC_DOWNCAST(
  1996. CExtGridCellCurrency,
  1997. m_wndGrid.GridCellGet( nColNo, 6L )
  1998. );
  1999. pCellCurrency6->_VariantAssign( -56789217L );
  2000. pCellCurrency6->SetNegativeOrder( 3 ); // Example: $1.1-
  2001. CExtGridCellCurrency * pCellCurrency7 =
  2002. STATIC_DOWNCAST(
  2003. CExtGridCellCurrency,
  2004. m_wndGrid.GridCellGet( nColNo, 7L )
  2005. );
  2006. pCellCurrency7->_VariantAssign( 54761.458 );
  2007. pCellCurrency7->SetPositiveOrder( 2 ); // Example: $ 1.1
  2008. pCellCurrency7->SetCurrencySymbol( _T("$") );
  2009. CExtGridCellCurrency * pCellCurrency8 =
  2010. STATIC_DOWNCAST(
  2011. CExtGridCellCurrency,
  2012. m_wndGrid.GridCellGet( nColNo, 8L )
  2013. );
  2014. pCellCurrency8->_VariantAssign( 547614584167L );
  2015. pCellCurrency8->SetGrouping( _T("3;2;0") );
  2016. pCellCurrency8->SetThousandSeparator( _T("'") );
  2017. CExtGridCellCurrency * pCellCurrency9 =
  2018. STATIC_DOWNCAST(
  2019. CExtGridCellCurrency,
  2020. m_wndGrid.GridCellGet( nColNo, 9L )
  2021. );
  2022. pCellCurrency9->_VariantAssign( 18.0005 );
  2023. pCellCurrency9->SetDecimalSeparator( _T("^") );
  2024. pCellCurrency9->SetCurrencySymbol( szEuro );
  2025. }
  2026. void CPageGrid::_InitColumnScientific( LONG nColNo, LONG nRowCount )
  2027. {
  2028. ASSERT_VALID( this );
  2029. ASSERT_VALID( &m_wndGrid );
  2030. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  2031. {
  2032. CExtGridCellScientific * pCellScientific =
  2033. STATIC_DOWNCAST(
  2034. CExtGridCellScientific,
  2035. m_wndGrid.GridCellGet(
  2036. nColNo,
  2037. nRowNo,
  2038. 0,
  2039. 0,
  2040. RUNTIME_CLASS(CExtGridCellScientific)
  2041. )
  2042. );
  2043. UNREFERENCED_PARAMETER(pCellScientific);
  2044. }
  2045. CExtGridCellScientific * pCellScientific0 =
  2046. STATIC_DOWNCAST(
  2047. CExtGridCellScientific,
  2048. m_wndGrid.GridCellGet( nColNo, 0L )
  2049. );
  2050. pCellScientific0->_VariantAssign( 0.005 );
  2051. pCellScientific0->SetDecimalPlaces( 0 );
  2052. CExtGridCellScientific * pCellScientific1 =
  2053. STATIC_DOWNCAST(
  2054. CExtGridCellScientific,
  2055. m_wndGrid.GridCellGet( nColNo, 1L )
  2056. );
  2057. pCellScientific1->_VariantAssign( 123456 );
  2058. pCellScientific1->SetDecimalPlaces( 3 );
  2059. CExtGridCellScientific * pCellScientific2 =
  2060. STATIC_DOWNCAST(
  2061. CExtGridCellScientific,
  2062. m_wndGrid.GridCellGet( nColNo, 2L )
  2063. );
  2064. pCellScientific2->_VariantAssign( 123456.123456789 );
  2065. pCellScientific2->SetDecimalPlaces( 4 );
  2066. CExtGridCellScientific * pCellScientific3 =
  2067. STATIC_DOWNCAST(
  2068. CExtGridCellScientific,
  2069. m_wndGrid.GridCellGet( nColNo, 3L )
  2070. );
  2071. pCellScientific3->_VariantAssign( -12345667890L );
  2072. CExtGridCellScientific * pCellScientific4 =
  2073. STATIC_DOWNCAST(
  2074. CExtGridCellScientific,
  2075. m_wndGrid.GridCellGet( nColNo, 4L )
  2076. );
  2077. pCellScientific4->_VariantAssign( 123456678901L );
  2078. CExtGridCellScientific * pCellScientific5 =
  2079. STATIC_DOWNCAST(
  2080. CExtGridCellScientific,
  2081. m_wndGrid.GridCellGet( nColNo, 5L )
  2082. );
  2083. pCellScientific5->_VariantAssign( -458.46 );
  2084. CExtGridCellScientific * pCellScientific6 =
  2085. STATIC_DOWNCAST(
  2086. CExtGridCellScientific,
  2087. m_wndGrid.GridCellGet( nColNo, 6L )
  2088. );
  2089. pCellScientific6->_VariantAssign( -56789217L );
  2090. CExtGridCellScientific * pCellScientific7 =
  2091. STATIC_DOWNCAST(
  2092. CExtGridCellScientific,
  2093. m_wndGrid.GridCellGet( nColNo, 7L )
  2094. );
  2095. pCellScientific7->_VariantAssign( 54761.458 );
  2096. pCellScientific7->SetDecimalPlaces( 4 );
  2097. CExtGridCellScientific * pCellScientific8 =
  2098. STATIC_DOWNCAST(
  2099. CExtGridCellScientific,
  2100. m_wndGrid.GridCellGet( nColNo, 8L )
  2101. );
  2102. pCellScientific8->_VariantAssign( 547614584167L );
  2103. CExtGridCellScientific * pCellScientific9 =
  2104. STATIC_DOWNCAST(
  2105. CExtGridCellScientific,
  2106. m_wndGrid.GridCellGet( nColNo, 9L )
  2107. );
  2108. pCellScientific9->_VariantAssign( 18.0005 );
  2109. pCellScientific9->SetDecimalPlaces( 5 );
  2110. }
  2111. void CPageGrid::_InitColumnFraction( LONG nColNo, LONG nRowCount )
  2112. {
  2113. ASSERT_VALID( this );
  2114. ASSERT_VALID( &m_wndGrid );
  2115. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  2116. {
  2117. CExtGridCellFraction * pCellFraction =
  2118. STATIC_DOWNCAST(
  2119. CExtGridCellFraction,
  2120. m_wndGrid.GridCellGet(
  2121. nColNo,
  2122. nRowNo,
  2123. 0,
  2124. 0,
  2125. RUNTIME_CLASS(CExtGridCellFraction)
  2126. )
  2127. );
  2128. UNREFERENCED_PARAMETER(pCellFraction);
  2129. }
  2130. CExtGridCellFraction * pCellFraction0 =
  2131. STATIC_DOWNCAST(
  2132. CExtGridCellFraction,
  2133. m_wndGrid.GridCellGet( nColNo, 0L )
  2134. );
  2135. pCellFraction0->_VariantAssign( 1.5 );
  2136. CExtGridCellFraction * pCellFraction1 =
  2137. STATIC_DOWNCAST(
  2138. CExtGridCellFraction,
  2139. m_wndGrid.GridCellGet( nColNo, 1L )
  2140. );
  2141. pCellFraction1->_VariantAssign( -102.25 );
  2142. CExtGridCellFraction * pCellFraction2 =
  2143. STATIC_DOWNCAST(
  2144. CExtGridCellFraction,
  2145. m_wndGrid.GridCellGet( nColNo, 2L )
  2146. );
  2147. pCellFraction2->_VariantAssign( 125.125 );
  2148. CExtGridCellFraction * pCellFraction3 =
  2149. STATIC_DOWNCAST(
  2150. CExtGridCellFraction,
  2151. m_wndGrid.GridCellGet( nColNo, 3L )
  2152. );
  2153. pCellFraction3->_VariantAssign( -100.005 );
  2154. CExtGridCellFraction * pCellFraction4 =
  2155. STATIC_DOWNCAST(
  2156. CExtGridCellFraction,
  2157. m_wndGrid.GridCellGet( nColNo, 4L )
  2158. );
  2159. pCellFraction4->_VariantAssign( 0.0025 );
  2160. CExtGridCellFraction * pCellFraction5 =
  2161. STATIC_DOWNCAST(
  2162. CExtGridCellFraction,
  2163. m_wndGrid.GridCellGet( nColNo, 5L )
  2164. );
  2165. pCellFraction5->_VariantAssign( -2.99 );
  2166. CExtGridCellFraction * pCellFraction6 =
  2167. STATIC_DOWNCAST(
  2168. CExtGridCellFraction,
  2169. m_wndGrid.GridCellGet( nColNo, 6L )
  2170. );
  2171. pCellFraction6->_VariantAssign( 50.3 );
  2172. CExtGridCellFraction * pCellFraction7 =
  2173. STATIC_DOWNCAST(
  2174. CExtGridCellFraction,
  2175. m_wndGrid.GridCellGet( nColNo, 7L )
  2176. );
  2177. pCellFraction7->_VariantAssign( 85.655 );
  2178. CExtGridCellFraction * pCellFraction8 =
  2179. STATIC_DOWNCAST(
  2180. CExtGridCellFraction,
  2181. m_wndGrid.GridCellGet( nColNo, 8L )
  2182. );
  2183. pCellFraction8->_VariantAssign( -0.8 );
  2184. CExtGridCellFraction * pCellFraction9 =
  2185. STATIC_DOWNCAST(
  2186. CExtGridCellFraction,
  2187. m_wndGrid.GridCellGet( nColNo, 9L )
  2188. );
  2189. pCellFraction9->_VariantAssign( 1.33 );
  2190. }
  2191. void CPageGrid::_InitColumnPercentage( LONG nColNo, LONG nRowCount )
  2192. {
  2193. ASSERT_VALID( this );
  2194. ASSERT_VALID( &m_wndGrid );
  2195. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  2196. {
  2197. CExtGridCellPercentage * pCellPercentage =
  2198. STATIC_DOWNCAST(
  2199. CExtGridCellPercentage,
  2200. m_wndGrid.GridCellGet(
  2201. nColNo,
  2202. nRowNo,
  2203. 0,
  2204. 0,
  2205. RUNTIME_CLASS(CExtGridCellPercentage)
  2206. )
  2207. );
  2208. UNREFERENCED_PARAMETER(pCellPercentage);
  2209. }
  2210. CExtGridCellPercentage * pCellPercentage0 =
  2211. STATIC_DOWNCAST(
  2212. CExtGridCellPercentage,
  2213. m_wndGrid.GridCellGet( nColNo, 0L )
  2214. );
  2215. pCellPercentage0->_VariantAssign( 0.6 );
  2216. pCellPercentage0->SetPercentSignPos( 0 );
  2217. CExtGridCellPercentage * pCellPercentage1 =
  2218. STATIC_DOWNCAST(
  2219. CExtGridCellPercentage,
  2220. m_wndGrid.GridCellGet( nColNo, 1L )
  2221. );
  2222. pCellPercentage1->_VariantAssign( 0.7 );
  2223. pCellPercentage1->SetPercentSignPos( 1 );
  2224. CExtGridCellPercentage * pCellPercentage2 =
  2225. STATIC_DOWNCAST(
  2226. CExtGridCellPercentage,
  2227. m_wndGrid.GridCellGet( nColNo, 2L )
  2228. );
  2229. pCellPercentage2->_VariantAssign( 1.9 );
  2230. pCellPercentage2->SetPercentSignPos( 2 );
  2231. CExtGridCellPercentage * pCellPercentage3 =
  2232. STATIC_DOWNCAST(
  2233. CExtGridCellPercentage,
  2234. m_wndGrid.GridCellGet( nColNo, 3L )
  2235. );
  2236. pCellPercentage3->_VariantAssign( 0.04 );
  2237. pCellPercentage3->SetPercentSignPos( 3 );
  2238. CExtGridCellPercentage * pCellPercentage4 =
  2239. STATIC_DOWNCAST(
  2240. CExtGridCellPercentage,
  2241. m_wndGrid.GridCellGet( nColNo, 4L )
  2242. );
  2243. pCellPercentage4->_VariantAssign( -0.05 );
  2244. CExtGridCellPercentage * pCellPercentage5 =
  2245. STATIC_DOWNCAST(
  2246. CExtGridCellPercentage,
  2247. m_wndGrid.GridCellGet( nColNo, 5L )
  2248. );
  2249. pCellPercentage5->_VariantAssign( 5.2 );
  2250. pCellPercentage5->SetPercentSignPos( 1 );
  2251. CExtGridCellPercentage * pCellPercentage6 =
  2252. STATIC_DOWNCAST(
  2253. CExtGridCellPercentage,
  2254. m_wndGrid.GridCellGet( nColNo, 6L )
  2255. );
  2256. pCellPercentage6->_VariantAssign( -1.25 );
  2257. pCellPercentage6->SetPercentSignPos( 2 );