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

界面编程

开发平台:

Visual C++

  1. CExtGridCellPercentage * pCellPercentage7 =
  2. STATIC_DOWNCAST(
  3. CExtGridCellPercentage,
  4. m_wndGrid.GridCellGet( nColNo, 7L )
  5. );
  6. pCellPercentage7->_VariantAssign( 0.01 );
  7. CExtGridCellPercentage * pCellPercentage8 =
  8. STATIC_DOWNCAST(
  9. CExtGridCellPercentage,
  10. m_wndGrid.GridCellGet( nColNo, 8L )
  11. );
  12. pCellPercentage8->_VariantAssign( 0.005 );
  13. pCellPercentage2->SetPercentSignPos( 0 );
  14. CExtGridCellPercentage * pCellPercentage9 =
  15. STATIC_DOWNCAST(
  16. CExtGridCellPercentage,
  17. m_wndGrid.GridCellGet( nColNo, 9L )
  18. );
  19. pCellPercentage9->_VariantAssign( -0.002 );
  20. pCellPercentage9->SetPercentSignPos( 1 );
  21. }
  22. void CPageGrid::_InitColumnVariant( LONG nColNo, LONG nRowCount )
  23. {
  24. ASSERT_VALID( this );
  25. ASSERT_VALID( &m_wndGrid );
  26. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  27. {
  28. CExtGridCellVariant * pCellVariant =
  29. STATIC_DOWNCAST(
  30. CExtGridCellVariant,
  31. m_wndGrid.GridCellGet(
  32. nColNo,
  33. nRowNo,
  34. 0,
  35. 0,
  36. RUNTIME_CLASS(CExtGridCellVariant)
  37. )
  38. );
  39. pCellVariant->ModifyStyle( __EGCS_BUTTON_UPDOWN );
  40. }
  41. CExtGridCellVariant * pCellVariant0 =
  42. STATIC_DOWNCAST(
  43. CExtGridCellVariant,
  44. m_wndGrid.GridCellGet( nColNo, 0L )
  45. );
  46. pCellVariant0->_VariantAssign( 12345, VT_I4 );
  47. CExtGridCellVariant * pCellVariant1 =
  48. STATIC_DOWNCAST(
  49. CExtGridCellVariant,
  50. m_wndGrid.GridCellGet( nColNo, 1L )
  51. );
  52. pCellVariant1->_VariantAssign( 12345.12345, VT_R8 );
  53. CExtGridCellVariant * pCellVariant2 =
  54. STATIC_DOWNCAST(
  55. CExtGridCellVariant,
  56. m_wndGrid.GridCellGet( nColNo, 2L )
  57. );
  58. COleCurrency curA( 4, 500 ); // value: 4.0500
  59. pCellVariant2->_VariantAssign( curA );
  60. CExtGridCellVariant * pCellVariant3 =
  61. STATIC_DOWNCAST(
  62. CExtGridCellVariant,
  63. m_wndGrid.GridCellGet( nColNo, 3L )
  64. );
  65. pCellVariant3->_VariantAssign( DATE( COleDateTime::GetCurrentTime() ), VT_DATE );
  66. CExtGridCellVariant * pCellVariant4 =
  67. STATIC_DOWNCAST(
  68. CExtGridCellVariant,
  69. m_wndGrid.GridCellGet( nColNo, 4L )
  70. );
  71. USES_CONVERSION;
  72. //BSTR bstrCopy = ::SysAllocString( T2COLE(_T("BSTR String")) );
  73. // pCellVariant4->_VariantAssign( bstrCopy, VT_BSTR );
  74. pCellVariant4->_VariantClear(false);
  75. pCellVariant4->vt = VT_BSTR;
  76. pCellVariant4->bstrVal = ::SysAllocString( T2COLE(_T("BSTR String")) );
  77. CExtGridCellVariant * pCellVariant5 =
  78. STATIC_DOWNCAST(
  79. CExtGridCellVariant,
  80. m_wndGrid.GridCellGet( nColNo, 5L )
  81. );
  82. pCellVariant5->_VariantAssign( true );
  83. CExtGridCellVariant * pCellVariant6 =
  84. STATIC_DOWNCAST(
  85. CExtGridCellVariant,
  86. m_wndGrid.GridCellGet( nColNo, 6L )
  87. );
  88. pCellVariant6->_VariantAssign( USHORT(65535) );
  89. CExtGridCellVariant * pCellVariant7 =
  90. STATIC_DOWNCAST(
  91. CExtGridCellVariant,
  92. m_wndGrid.GridCellGet( nColNo, 7L )
  93. );
  94. pCellVariant7->_VariantAssign( FLOAT(-345.85) );
  95. CExtGridCellVariant * pCellVariant8 =
  96. STATIC_DOWNCAST(
  97. CExtGridCellVariant,
  98. m_wndGrid.GridCellGet( nColNo, 8L )
  99. );
  100. pCellVariant8->_VariantAssign( signed char(-128) );
  101. CExtGridCellVariant * pCellVariant9 =
  102. STATIC_DOWNCAST(
  103. CExtGridCellVariant,
  104. m_wndGrid.GridCellGet( nColNo, 9L )
  105. );
  106. pCellVariant9->_VariantAssign( unsigned char(255) );
  107. }
  108. void CPageGrid::_InitColumnUpDown( LONG nColNo, LONG nRowCount )
  109. {
  110. ASSERT_VALID( this );
  111. ASSERT_VALID( &m_wndGrid );
  112. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  113. {
  114. CExtGridCellUpDown * pCellUpDown =
  115. STATIC_DOWNCAST(
  116. CExtGridCellUpDown,
  117. m_wndGrid.GridCellGet(
  118. nColNo,
  119. nRowNo,
  120. 0,
  121. 0,
  122. RUNTIME_CLASS(CExtGridCellUpDown)
  123. )
  124. );
  125. UNREFERENCED_PARAMETER(pCellUpDown);
  126. }
  127. CExtGridCellUpDown * pCellUpDown0 =
  128. STATIC_DOWNCAST(
  129. CExtGridCellUpDown,
  130. m_wndGrid.GridCellGet( nColNo, 0L )
  131. );
  132. pCellUpDown0->_VariantAssign( 12345, VT_I4 );
  133. CExtGridCellUpDown * pCellUpDown1 =
  134. STATIC_DOWNCAST(
  135. CExtGridCellUpDown,
  136. m_wndGrid.GridCellGet( nColNo, 1L )
  137. );
  138. pCellUpDown1->_VariantAssign( 12345.12345, VT_R8 );
  139. CExtGridCellUpDown * pCellUpDown2 =
  140. STATIC_DOWNCAST(
  141. CExtGridCellUpDown,
  142. m_wndGrid.GridCellGet( nColNo, 2L )
  143. );
  144. COleCurrency curA( 4, 500 ); // value: 4.0500
  145. pCellUpDown2->_VariantAssign( curA );
  146. CExtGridCellUpDown * pCellUpDown3 =
  147. STATIC_DOWNCAST(
  148. CExtGridCellUpDown,
  149. m_wndGrid.GridCellGet( nColNo, 3L )
  150. );
  151. pCellUpDown3->_VariantAssign( 555 );
  152. CExtGridCellUpDown * pCellUpDown4 =
  153. STATIC_DOWNCAST(
  154. CExtGridCellUpDown,
  155. m_wndGrid.GridCellGet( nColNo, 4L )
  156. );
  157. pCellUpDown4->_VariantAssign( -555 );
  158. CExtGridCellUpDown * pCellUpDown5 =
  159. STATIC_DOWNCAST(
  160. CExtGridCellUpDown,
  161. m_wndGrid.GridCellGet( nColNo, 5L )
  162. );
  163. pCellUpDown5->_VariantAssign( true );
  164. CExtGridCellUpDown * pCellUpDown6 =
  165. STATIC_DOWNCAST(
  166. CExtGridCellUpDown,
  167. m_wndGrid.GridCellGet( nColNo, 6L )
  168. );
  169. pCellUpDown6->_VariantAssign( USHORT(65535) );
  170. CExtGridCellUpDown * pCellUpDown7 =
  171. STATIC_DOWNCAST(
  172. CExtGridCellUpDown,
  173. m_wndGrid.GridCellGet( nColNo, 7L )
  174. );
  175. pCellUpDown7->_VariantAssign( FLOAT(-345.85) );
  176. CExtGridCellUpDown * pCellUpDown8 =
  177. STATIC_DOWNCAST(
  178. CExtGridCellUpDown,
  179. m_wndGrid.GridCellGet( nColNo, 8L )
  180. );
  181. pCellUpDown8->_VariantAssign( signed char(-128) );
  182. CExtGridCellUpDown * pCellUpDown9 =
  183. STATIC_DOWNCAST(
  184. CExtGridCellUpDown,
  185. m_wndGrid.GridCellGet( nColNo, 9L )
  186. );
  187. pCellUpDown9->_VariantAssign( unsigned char(255) );
  188. }
  189. void CPageGrid::_InitColumnPicture( LONG nColNo, LONG nRowCount )
  190. {
  191. ASSERT_VALID( this );
  192. ASSERT_VALID( &m_wndGrid );
  193. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  194. {
  195. CExtGridCellPicture * pCellPicture =
  196. STATIC_DOWNCAST(
  197. CExtGridCellPicture,
  198. m_wndGrid.GridCellGet(
  199. nColNo,
  200. nRowNo,
  201. 0,
  202. 0,
  203. RUNTIME_CLASS(CExtGridCellPicture)
  204. )
  205. );
  206. UNREFERENCED_PARAMETER(pCellPicture);
  207. }
  208. CExtBitmap * pBmp = NULL;
  209. CExtGridCellPicture * pCellPicture0 =
  210. STATIC_DOWNCAST(
  211. CExtGridCellPicture,
  212. m_wndGrid.GridCellGet( nColNo, 0L )
  213. );
  214. pBmp = pCellPicture0->BitmapGetBuffer();
  215. VERIFY(
  216. pBmp->LoadBMP_Resource( 
  217. MAKEINTRESOURCE( IDB_BITMAP_VISTA1 ) 
  218. )
  219. );
  220. pCellPicture0->ImageModeSet( CExtGridCellPicture::eTouchOutside );
  221. CExtGridCellPicture * pCellPicture1 =
  222. STATIC_DOWNCAST(
  223. CExtGridCellPicture,
  224. m_wndGrid.GridCellGet( nColNo, 1L )
  225. );
  226. pBmp = pCellPicture1->BitmapGetBuffer();
  227. VERIFY(
  228. pBmp->LoadBMP_Resource( 
  229. MAKEINTRESOURCE( IDB_BITMAP_VISTA2 ) 
  230. )
  231. );
  232. CExtGridCellPicture * pCellPicture2 =
  233. STATIC_DOWNCAST(
  234. CExtGridCellPicture,
  235. m_wndGrid.GridCellGet( nColNo, 2L )
  236. );
  237. pBmp = pCellPicture2->BitmapGetBuffer();
  238. VERIFY(
  239. pBmp->LoadBMP_Resource( 
  240. MAKEINTRESOURCE( IDB_BITMAP_VISTA3 ) 
  241. )
  242. );
  243. pCellPicture2->ImageModeSet( CExtGridCellPicture::eStretch );
  244. CExtGridCellPicture * pCellPicture3 =
  245. STATIC_DOWNCAST(
  246. CExtGridCellPicture,
  247. m_wndGrid.GridCellGet( nColNo, 3L )
  248. );
  249. pBmp = pCellPicture3->BitmapGetBuffer();
  250. VERIFY(
  251. pBmp->LoadBMP_Resource( 
  252. MAKEINTRESOURCE( IDB_BITMAP_VISTA3 ) 
  253. )
  254. );
  255. pCellPicture3->ImageModeSet( CExtGridCellPicture::eTile );
  256. CExtGridCellPicture * pCellPicture4 =
  257. STATIC_DOWNCAST(
  258. CExtGridCellPicture,
  259. m_wndGrid.GridCellGet( nColNo, 4L )
  260. );
  261. pBmp = pCellPicture4->BitmapGetBuffer();
  262. VERIFY(
  263. pBmp->LoadBMP_Resource( 
  264. MAKEINTRESOURCE( IDB_BITMAP_VISTA4 ) 
  265. )
  266. );
  267. pCellPicture4->ImageModeSet( CExtGridCellPicture::eStretch );
  268. CExtGridCellPicture * pCellPicture5 =
  269. STATIC_DOWNCAST(
  270. CExtGridCellPicture,
  271. m_wndGrid.GridCellGet( nColNo, 5L )
  272. );
  273. pBmp = pCellPicture5->BitmapGetBuffer();
  274. VERIFY(
  275. pBmp->LoadBMP_Resource( 
  276. MAKEINTRESOURCE( IDB_BITMAP_VISTA5 ) 
  277. )
  278. );
  279. CExtGridCellPicture * pCellPicture6 =
  280. STATIC_DOWNCAST(
  281. CExtGridCellPicture,
  282. m_wndGrid.GridCellGet( nColNo, 6L )
  283. );
  284. pBmp = pCellPicture6->BitmapGetBuffer();
  285. VERIFY(
  286. pBmp->LoadBMP_Resource( 
  287. MAKEINTRESOURCE( IDB_BITMAP_VISTA6 ) 
  288. )
  289. );
  290. CExtGridCellPicture * pCellPicture7 =
  291. STATIC_DOWNCAST(
  292. CExtGridCellPicture,
  293. m_wndGrid.GridCellGet( nColNo, 7L )
  294. );
  295. pBmp = pCellPicture7->BitmapGetBuffer();
  296. VERIFY(
  297. pBmp->LoadBMP_Resource( 
  298. MAKEINTRESOURCE( IDB_BITMAP_VISTA6 ) 
  299. )
  300. );
  301. pCellPicture7->ImageModeSet( CExtGridCellPicture::eTile );
  302. CExtGridCellPicture * pCellPicture8 =
  303. STATIC_DOWNCAST(
  304. CExtGridCellPicture,
  305. m_wndGrid.GridCellGet( nColNo, 8L )
  306. );
  307. pBmp = pCellPicture8->BitmapGetBuffer();
  308. VERIFY(
  309. pBmp->LoadBMP_Resource( 
  310. MAKEINTRESOURCE( IDB_BITMAP_VISTA7 ) 
  311. )
  312. );
  313. CExtGridCellPicture * pCellPicture9 =
  314. STATIC_DOWNCAST(
  315. CExtGridCellPicture,
  316. m_wndGrid.GridCellGet( nColNo, 9L )
  317. );
  318. pBmp = pCellPicture9->BitmapGetBuffer();
  319. VERIFY(
  320. pBmp->LoadBMP_Resource( 
  321. MAKEINTRESOURCE( IDB_BITMAP_VISTA8 ) 
  322. )
  323. );
  324. pCellPicture9->ImageModeSet( CExtGridCellPicture::eTile );
  325. }
  326. void CPageGrid::_InitColumnProgress( LONG nColNo, LONG nRowCount )
  327. {
  328. ASSERT_VALID( this );
  329. ASSERT_VALID( &m_wndGrid );
  330. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  331. {
  332. CExtGridCellProgress * pCellProgress =
  333. STATIC_DOWNCAST(
  334. CExtGridCellProgress,
  335. m_wndGrid.GridCellGet(
  336. nColNo,
  337. nRowNo,
  338. 0,
  339. 0,
  340. RUNTIME_CLASS(CExtGridCellProgress)
  341. )
  342. );
  343. UNREFERENCED_PARAMETER(pCellProgress);
  344. }
  345. CExtGridCellProgress * pCellProgress0 =
  346. STATIC_DOWNCAST(
  347. CExtGridCellProgress,
  348. m_wndGrid.GridCellGet( nColNo, 0L )
  349. );
  350. pCellProgress0->SetRange( 0, 100 );
  351. pCellProgress0->SetStep( 2 );
  352. CExtGridCellProgress * pCellProgress1 =
  353. STATIC_DOWNCAST(
  354. CExtGridCellProgress,
  355. m_wndGrid.GridCellGet( nColNo, 1L )
  356. );
  357. pCellProgress1->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  358. pCellProgress1->SetRange( 0, 100 );
  359. pCellProgress1->SetStep( 4 );
  360. pCellProgress1->TextSet( _T("Done:") );
  361. pCellProgress1->TextModeSet( CExtGridCellProgress::eTextAndPercent );
  362. pCellProgress1->BarColorsSet(
  363. ::GetSysColor( COLOR_HIGHLIGHT ),
  364. ::GetSysColor( COLOR_HIGHLIGHT )
  365. );
  366. pCellProgress1->TextColorsSet(
  367. COLORREF( -1L ),
  368. ::GetSysColor( COLOR_HIGHLIGHTTEXT )
  369. );
  370. CExtGridCellProgress * pCellProgress2 =
  371. STATIC_DOWNCAST(
  372. CExtGridCellProgress,
  373. m_wndGrid.GridCellGet( nColNo, 2L )
  374. );
  375. pCellProgress2->ModifyStyle( __EGCS_TA_HORZ_LEFT );
  376. pCellProgress2->SetRange( 0, 100 );
  377. pCellProgress2->SetStep( 3 );
  378. pCellProgress2->TextModeSet( CExtGridCellProgress::ePercent );
  379. pCellProgress2->BarColorsSet(
  380. RGB(233,233,233),
  381. RGB(40,40,40)
  382. );
  383. pCellProgress2->TextColorsSet(
  384. COLORREF( -1L ),
  385. RGB(255,255,0)
  386. );
  387. pCellProgress2->InvertBarGradientSet( true );
  388. CExtGridCellProgress * pCellProgress3 =
  389. STATIC_DOWNCAST(
  390. CExtGridCellProgress,
  391. m_wndGrid.GridCellGet( nColNo, 3L )
  392. );
  393. pCellProgress3->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  394. pCellProgress3->SetRange( 0, 150 );
  395. pCellProgress3->SetStep( 2 );
  396. pCellProgress3->TextModeSet( CExtGridCellProgress::ePercent );
  397. pCellProgress3->TiedTextSet( true );
  398. pCellProgress3->BarColorsSet(
  399. RGB(80,167,255),
  400. RGB(0,0,150)
  401. );
  402. pCellProgress3->TextColorsSet(
  403. COLORREF( -1L ),
  404. RGB(255,255,255)
  405. );
  406. CExtGridCellProgress * pCellProgress4 =
  407. STATIC_DOWNCAST(
  408. CExtGridCellProgress,
  409. m_wndGrid.GridCellGet( nColNo, 4L )
  410. );
  411. pCellProgress4->ModifyStyle( __EGCS_TA_HORZ_RIGHT );
  412. pCellProgress4->SetRange( -100, 400 );
  413. pCellProgress4->SetStep( 10 );
  414. pCellProgress4->TextModeSet( CExtGridCellProgress::ePosition );
  415. pCellProgress4->TiedTextSet( true );
  416. pCellProgress4->BarColorsSet(
  417. RGB(255,255,0),
  418. RGB(255,0,0)
  419. );
  420. pCellProgress4->TextColorsSet(
  421. COLORREF( -1L ),
  422. RGB(255,255,0)
  423. );
  424. CExtGridCellProgress * pCellProgress5 =
  425. STATIC_DOWNCAST(
  426. CExtGridCellProgress,
  427. m_wndGrid.GridCellGet( nColNo, 5L )
  428. );
  429. pCellProgress5->ModifyStyle( __EGCS_TA_HORZ_LEFT );
  430. pCellProgress5->SetRange( 100, 250 );
  431. pCellProgress5->SetStep( 5 );
  432. pCellProgress5->TextSet( _T("Some text...") );
  433. pCellProgress5->TextModeSet( CExtGridCellProgress::eText );
  434. pCellProgress5->BarColorsSet(
  435. RGB(80,167,255),
  436. RGB(0,0,150)
  437. );
  438. pCellProgress5->TextColorsSet(
  439. COLORREF( -1L ),
  440. RGB(255,255,0)
  441. );
  442. pCellProgress5->InvertBarGradientSet( true );
  443. CExtGridCellProgress * pCellProgress6 =
  444. STATIC_DOWNCAST(
  445. CExtGridCellProgress,
  446. m_wndGrid.GridCellGet( nColNo, 6L )
  447. );
  448. pCellProgress6->ModifyStyle( __EGCS_TA_HORZ_LEFT );
  449. pCellProgress6->SetRange( -100, 400 );
  450. pCellProgress6->SetStep( 10 );
  451. pCellProgress6->TextModeSet( CExtGridCellProgress::ePercent );
  452. pCellProgress6->TiedTextSet( true );
  453. pCellProgress6->BarColorsSet(
  454. RGB(255,255,0),
  455. RGB(255,0,0)
  456. );
  457. pCellProgress6->TextColorsSet(
  458. COLORREF( -1L ),
  459. RGB(255,255,255)
  460. );
  461. pCellProgress6->InvertBarGradientSet( true );
  462. pCellProgress6->ReversedSet( true );
  463. CExtGridCellProgress * pCellProgress7 =
  464. STATIC_DOWNCAST(
  465. CExtGridCellProgress,
  466. m_wndGrid.GridCellGet( nColNo, 7L )
  467. );
  468. pCellProgress7->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  469. pCellProgress7->SetRange( -200, 200 );
  470. pCellProgress7->SetStep( 6 );
  471. pCellProgress7->TextSet( _T("Pos:") );
  472. pCellProgress7->TextModeSet( CExtGridCellProgress::eTextAndPosition );
  473. pCellProgress7->TiedTextSet( true );
  474. pCellProgress7->BarColorsSet(
  475. RGB(255,255,255),
  476. RGB(128,20,250)
  477. );
  478. pCellProgress7->TextColorsSet(
  479. COLORREF( -1L ),
  480. RGB(0,255,0)
  481. );
  482. pCellProgress7->InvertBarGradientSet( true );
  483. pCellProgress7->ReversedSet( true );
  484. CExtGridCellProgress * pCellProgress8 =
  485. STATIC_DOWNCAST(
  486. CExtGridCellProgress,
  487. m_wndGrid.GridCellGet( nColNo, 8L )
  488. );
  489. pCellProgress8->SetRange( 0, 100 );
  490. pCellProgress8->SetStep( 4 );
  491. pCellProgress8->TextModeSet( CExtGridCellProgress::eNone );
  492. pCellProgress8->BarColorsSet(
  493. RGB(255,255,255),
  494. RGB(0,0,0)
  495. );
  496. CExtGridCellProgress * pCellProgress9 =
  497. STATIC_DOWNCAST(
  498. CExtGridCellProgress,
  499. m_wndGrid.GridCellGet( nColNo, 9L )
  500. );
  501. pCellProgress9->ModifyStyle( __EGCS_TA_HORZ_RIGHT );
  502. pCellProgress9->SetRange( 0, 100 );
  503. pCellProgress9->SetStep( 2 );
  504. pCellProgress9->TextModeSet( CExtGridCellProgress::ePercent );
  505. }
  506. void CPageGrid::_InitColumnSlider( LONG nColNo, LONG nRowCount )
  507. {
  508. ASSERT_VALID( this );
  509. ASSERT_VALID( &m_wndGrid );
  510. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  511. {
  512. CExtGridCellSlider * pCellSlider =
  513. STATIC_DOWNCAST(
  514. CExtGridCellSlider,
  515. m_wndGrid.GridCellGet(
  516. nColNo,
  517. nRowNo,
  518. 0,
  519. 0,
  520. RUNTIME_CLASS(CExtGridCellSlider)
  521. )
  522. );
  523. UNREFERENCED_PARAMETER(pCellSlider);
  524. }
  525. CExtGridCellSlider * pCellSlider0 =
  526. STATIC_DOWNCAST(
  527. CExtGridCellSlider,
  528. m_wndGrid.GridCellGet( nColNo, 0L )
  529. );
  530. pCellSlider0->SetLineSize( 1 );
  531. pCellSlider0->SetPageSize( 20 );
  532. pCellSlider0->SetRange( 0, 100 );
  533. pCellSlider0->SetPos( 0 );
  534. CExtGridCellSlider * pCellSlider1 =
  535. STATIC_DOWNCAST(
  536. CExtGridCellSlider,
  537. m_wndGrid.GridCellGet( nColNo, 1L )
  538. );
  539. pCellSlider1->ModifyStyleEx( __EGCS_EX_NO_INPLACE_CONTROL_BORDER );
  540. pCellSlider1->SetLineSize( 5 );
  541. pCellSlider1->SetPageSize( 50 );
  542. pCellSlider1->SetRange( -100, 100 );
  543. pCellSlider1->SetPos( -50 );
  544. CExtGridCellSlider * pCellSlider2 =
  545. STATIC_DOWNCAST(
  546. CExtGridCellSlider,
  547. m_wndGrid.GridCellGet( nColNo, 2L )
  548. );
  549. pCellSlider2->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  550. pCellSlider2->SetLineSize( 2 );
  551. pCellSlider2->SetPageSize( 40 );
  552. pCellSlider2->SetRange( 0, 200 );
  553. pCellSlider2->SetPos( 150 );
  554. CExtGridCellSlider * pCellSlider3 =
  555. STATIC_DOWNCAST(
  556. CExtGridCellSlider,
  557. m_wndGrid.GridCellGet( nColNo, 3L )
  558. );
  559. pCellSlider3->ModifyStyleEx( __EGCS_EX_NO_INPLACE_CONTROL_BORDER );
  560. pCellSlider3->ModifyStyle( __EGCS_TA_HORZ_LEFT );
  561. pCellSlider3->SetLineSize( 10 );
  562. pCellSlider3->SetPageSize( 100 );
  563. pCellSlider3->SetRange( 0, 1000 );
  564. pCellSlider3->SetPos( 555 );
  565. CExtGridCellSlider * pCellSlider4 =
  566. STATIC_DOWNCAST(
  567. CExtGridCellSlider,
  568. m_wndGrid.GridCellGet( nColNo, 4L )
  569. );
  570. pCellSlider4->SetLineSize( 1 );
  571. pCellSlider4->SetPageSize( 20 );
  572. pCellSlider4->SetRange( -200, -100 );
  573. pCellSlider4->SetPos( -150 );
  574. CExtGridCellSlider * pCellSlider5 =
  575. STATIC_DOWNCAST(
  576. CExtGridCellSlider,
  577. m_wndGrid.GridCellGet( nColNo, 5L )
  578. );
  579. pCellSlider5->ModifyStyleEx( __EGCS_EX_NO_INPLACE_CONTROL_BORDER );
  580. pCellSlider5->SetLineSize( 1 );
  581. pCellSlider5->SetPageSize( 2 );
  582. pCellSlider5->SetRange( 0, 10 );
  583. pCellSlider5->SetPos( 2 );
  584. CExtGridCellSlider * pCellSlider6 =
  585. STATIC_DOWNCAST(
  586. CExtGridCellSlider,
  587. m_wndGrid.GridCellGet( nColNo, 6L )
  588. );
  589. pCellSlider6->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  590. pCellSlider6->SetLineSize( 1 );
  591. pCellSlider6->SetPageSize( 2 );
  592. pCellSlider6->SetRange( 0, 1 );
  593. pCellSlider6->SetPos( 1 );
  594. CExtGridCellSlider * pCellSlider7 =
  595. STATIC_DOWNCAST(
  596. CExtGridCellSlider,
  597. m_wndGrid.GridCellGet( nColNo, 7L )
  598. );
  599. pCellSlider7->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  600. pCellSlider7->SetLineSize( 1 );
  601. pCellSlider7->SetPageSize( 2 );
  602. pCellSlider7->SetRange( -1, 1 );
  603. pCellSlider7->SetPos( 0 );
  604. CExtGridCellSlider * pCellSlider8 =
  605. STATIC_DOWNCAST(
  606. CExtGridCellSlider,
  607. m_wndGrid.GridCellGet( nColNo, 8L )
  608. );
  609. pCellSlider8->SetLineSize( 1 );
  610. pCellSlider8->SetPageSize( 2 );
  611. pCellSlider8->SetRange( -10, 10 );
  612. pCellSlider8->SetPos( -9 );
  613. // pCellSlider8->BackColorSet( CExtGridCell::__ECS_ALL, RGB(255,0,0) );
  614. pCellSlider8->BackColorSet( CExtGridCell::__ECS_NORMAL, RGB(255,0,0) );
  615. pCellSlider8->BackColorSet( CExtGridCell::__ECS_SELECTED, RGB(128,0,0) );
  616. pCellSlider8->BackColorSet( CExtGridCell::__ECS_HOVERED, RGB(255,128,128) );
  617. pCellSlider8->BackColorSet( CExtGridCell::__ECS_HIGHLIGHT_BY_HOVER, RGB(255,192,192) );
  618. CExtGridCellSlider * pCellSlider9 =
  619. STATIC_DOWNCAST(
  620. CExtGridCellSlider,
  621. m_wndGrid.GridCellGet( nColNo, 9L )
  622. );
  623. pCellSlider9->ModifyStyleEx( __EGCS_EX_NO_INPLACE_CONTROL_BORDER );
  624. pCellSlider9->SetLineSize( 1 );
  625. pCellSlider9->SetPageSize( 20 );
  626. pCellSlider9->SetRange( -50, 50 );
  627. pCellSlider9->SetPos( 25 );
  628. // pCellSlider9->BackColorSet( CExtGridCell::__ECS_ALL, RGB(0,255,0) );
  629. pCellSlider9->BackColorSet( CExtGridCell::__ECS_NORMAL, RGB(0,255,0) );
  630. pCellSlider9->BackColorSet( CExtGridCell::__ECS_SELECTED, RGB(0,128,0) );
  631. pCellSlider9->BackColorSet( CExtGridCell::__ECS_HOVERED, RGB(128,255,128) );
  632. pCellSlider9->BackColorSet( CExtGridCell::__ECS_HIGHLIGHT_BY_HOVER, RGB(192,255,192) );
  633. }
  634. void CPageGrid::_InitColumnText( LONG nColNo, LONG nRowCount )
  635. {
  636. ASSERT_VALID( this );
  637. ASSERT_VALID( &m_wndGrid );
  638. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  639. {
  640. CExtGridCellString * pCellString =
  641. STATIC_DOWNCAST(
  642. CExtGridCellString,
  643. m_wndGrid.GridCellGet(
  644. nColNo,
  645. nRowNo,
  646. 0,
  647. 0,
  648. RUNTIME_CLASS(CExtGridCellString)
  649. )
  650. );
  651. UNREFERENCED_PARAMETER(pCellString);
  652. }
  653. CExtGridCellString * pCellString0 =
  654. STATIC_DOWNCAST(
  655. CExtGridCellString,
  656. m_wndGrid.GridCellGet( nColNo, 0L )
  657. );
  658. pCellString0->TextSet( _T("Cell1") );
  659. CExtGridCellString * pCellString1 =
  660. STATIC_DOWNCAST(
  661. CExtGridCellString,
  662. m_wndGrid.GridCellGet( nColNo, 1L )
  663. );
  664. pCellString1->TextSet( _T("Cell2 Line1rnCell2 Line2rnCell2 Line3") );
  665. pCellString1->ModifyStyleEx( __EGCS_EX_WRAP_TEXT );
  666. pCellString1->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  667. CExtGridCellString * pCellString2 =
  668. STATIC_DOWNCAST(
  669. CExtGridCellString,
  670. m_wndGrid.GridCellGet( nColNo, 2L )
  671. );
  672. pCellString2->TextSet( _T("Cell3") );
  673. CExtGridCellString * pCellString3 =
  674. STATIC_DOWNCAST(
  675. CExtGridCellString,
  676. m_wndGrid.GridCellGet( nColNo, 3L )
  677. );
  678. pCellString3->TextSet( _T("Cell4") );
  679. CExtGridCellString * pCellString4 =
  680. STATIC_DOWNCAST(
  681. CExtGridCellString,
  682. m_wndGrid.GridCellGet( nColNo, 4L )
  683. );
  684. pCellString4->TextSet( _T("Cell5 Line1rnCell5 Line2rnCell5 Line3") );
  685. pCellString4->ModifyStyleEx( __EGCS_EX_WRAP_TEXT );
  686. pCellString4->ModifyStyle( __EGCS_TA_HORZ_RIGHT );
  687. CExtGridCellString * pCellString5 =
  688. STATIC_DOWNCAST(
  689. CExtGridCellString,
  690. m_wndGrid.GridCellGet( nColNo, 5L )
  691. );
  692. pCellString5->TextSet( _T("Cell6") );
  693. CExtGridCellString * pCellString6 =
  694. STATIC_DOWNCAST(
  695. CExtGridCellString,
  696. m_wndGrid.GridCellGet( nColNo, 6L )
  697. );
  698. pCellString6->TextSet( _T("Cell7") );
  699. pCellString6->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  700. CExtGridCellString * pCellString7 =
  701. STATIC_DOWNCAST(
  702. CExtGridCellString,
  703. m_wndGrid.GridCellGet( nColNo, 7L )
  704. );
  705. pCellString7->TextSet( _T("Cell8 Line1rnCell8 Line2rnCell8 Line3") );
  706. pCellString7->ModifyStyleEx( __EGCS_EX_WRAP_TEXT );
  707. CExtGridCellString * pCellString8 =
  708. STATIC_DOWNCAST(
  709. CExtGridCellString,
  710. m_wndGrid.GridCellGet( nColNo, 8L )
  711. );
  712. pCellString8->TextSet( _T("Cell9") );
  713. CExtGridCellString * pCellString9 =
  714. STATIC_DOWNCAST(
  715. CExtGridCellString,
  716. m_wndGrid.GridCellGet( nColNo, 9L )
  717. );
  718. pCellString9->TextSet( _T("Cell10") );
  719. }
  720. void CPageGrid::_InitColumnPassword( LONG nColNo, LONG nRowCount )
  721. {
  722. ASSERT_VALID( this );
  723. ASSERT_VALID( &m_wndGrid );
  724. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  725. {
  726. CExtGridCellPassword * pCellPassword =
  727. STATIC_DOWNCAST(
  728. CExtGridCellPassword,
  729. m_wndGrid.GridCellGet(
  730. nColNo,
  731. nRowNo,
  732. 0,
  733. 0,
  734. RUNTIME_CLASS(CExtGridCellPassword)
  735. )
  736. );
  737. UNREFERENCED_PARAMETER(pCellPassword);
  738. }
  739. CExtGridCellPassword * pCellPassword0 =
  740. STATIC_DOWNCAST(
  741. CExtGridCellPassword,
  742. m_wndGrid.GridCellGet( nColNo, 0L )
  743. );
  744. pCellPassword0->TextSet( _T("Password1") );
  745. CExtGridCellPassword * pCellPassword1 =
  746. STATIC_DOWNCAST(
  747. CExtGridCellPassword,
  748. m_wndGrid.GridCellGet( nColNo, 1L )
  749. );
  750. pCellPassword1->TextSet( _T("Password2") );
  751. pCellPassword1->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  752. CExtGridCellPassword * pCellPassword2 =
  753. STATIC_DOWNCAST(
  754. CExtGridCellPassword,
  755. m_wndGrid.GridCellGet( nColNo, 2L )
  756. );
  757. pCellPassword2->TextSet( _T("Password3") );
  758. CExtGridCellPassword * pCellPassword3 =
  759. STATIC_DOWNCAST(
  760. CExtGridCellPassword,
  761. m_wndGrid.GridCellGet( nColNo, 3L )
  762. );
  763. pCellPassword3->TextSet( _T("Password4") );
  764. CExtGridCellPassword * pCellPassword4 =
  765. STATIC_DOWNCAST(
  766. CExtGridCellPassword,
  767. m_wndGrid.GridCellGet( nColNo, 4L )
  768. );
  769. pCellPassword4->TextSet( _T("Password5") );
  770. pCellPassword4->ModifyStyle( __EGCS_TA_HORZ_RIGHT );
  771. CExtGridCellPassword * pCellPassword5 =
  772. STATIC_DOWNCAST(
  773. CExtGridCellPassword,
  774. m_wndGrid.GridCellGet( nColNo, 5L )
  775. );
  776. pCellPassword5->TextSet( _T("Password6") );
  777. CExtGridCellPassword * pCellPassword6 =
  778. STATIC_DOWNCAST(
  779. CExtGridCellPassword,
  780. m_wndGrid.GridCellGet( nColNo, 6L )
  781. );
  782. pCellPassword6->TextSet( _T("Password7") );
  783. CExtGridCellPassword * pCellPassword7 =
  784. STATIC_DOWNCAST(
  785. CExtGridCellPassword,
  786. m_wndGrid.GridCellGet( nColNo, 7L )
  787. );
  788. pCellPassword7->TextSet( _T("Password8") );
  789. pCellPassword7->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  790. CExtGridCellPassword * pCellPassword8 =
  791. STATIC_DOWNCAST(
  792. CExtGridCellPassword,
  793. m_wndGrid.GridCellGet( nColNo, 8L )
  794. );
  795. pCellPassword8->TextSet( _T("Password9") );
  796. pCellPassword8->TextColorSet( CExtGridCell::__ECS_ALL, RGB(255,0,0) );
  797. CExtGridCellPassword * pCellPassword9 =
  798. STATIC_DOWNCAST(
  799. CExtGridCellPassword,
  800. m_wndGrid.GridCellGet( nColNo, 9L )
  801. );
  802. pCellPassword9->TextSet( _T("Password0") );
  803. pCellPassword9->TextColorSet( CExtGridCell::__ECS_ALL, RGB(0,255,0) );
  804. }
  805. void CPageGrid::_InitColumnFile( LONG nColNo, LONG nRowCount )
  806. {
  807. ASSERT_VALID( this );
  808. ASSERT_VALID( &m_wndGrid );
  809. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  810. {
  811. CExtGridCellFile * pCellFile =
  812. STATIC_DOWNCAST(
  813. CExtGridCellFile,
  814. m_wndGrid.GridCellGet(
  815. nColNo,
  816. nRowNo,
  817. 0,
  818. 0,
  819. RUNTIME_CLASS(CExtGridCellFile)
  820. )
  821. );
  822. UNREFERENCED_PARAMETER(pCellFile);
  823. }
  824. CExtGridCellFile * pCellFile0 =
  825. STATIC_DOWNCAST(
  826. CExtGridCellFile,
  827. m_wndGrid.GridCellGet( nColNo, 0L )
  828. );
  829. pCellFile0->TextSet( _T("C:\autoexec.bat") );
  830. pCellFile0->m_bOpenFileDialog = TRUE;
  831. CExtGridCellFile * pCellFile1 =
  832. STATIC_DOWNCAST(
  833. CExtGridCellFile,
  834. m_wndGrid.GridCellGet( nColNo, 1L )
  835. );
  836. pCellFile1->TextSet( _T("C:\Program Files\Microsoft Visual Studio\install.htm") );
  837. pCellFile1->m_bOpenFileDialog = TRUE;
  838. CExtGridCellFile * pCellFile2 =
  839. STATIC_DOWNCAST(
  840. CExtGridCellFile,
  841. m_wndGrid.GridCellGet( nColNo, 2L )
  842. );
  843. pCellFile2->TextSet( _T("C:\Windows\win.ini") );
  844. pCellFile2->m_bOpenFileDialog = FALSE;
  845. CExtGridCellFile * pCellFile3 =
  846. STATIC_DOWNCAST(
  847. CExtGridCellFile,
  848. m_wndGrid.GridCellGet( nColNo, 3L )
  849. );
  850. pCellFile3->TextSet( _T("C:\Windows\System32\win.com") );
  851. pCellFile3->m_bOpenFileDialog = FALSE;
  852. CExtGridCellFile * pCellFile4 =
  853. STATIC_DOWNCAST(
  854. CExtGridCellFile,
  855. m_wndGrid.GridCellGet( nColNo, 4L )
  856. );
  857. UNREFERENCED_PARAMETER(pCellFile4);
  858. CExtGridCellFile * pCellFile5 =
  859. STATIC_DOWNCAST(
  860. CExtGridCellFile,
  861. m_wndGrid.GridCellGet( nColNo, 5L )
  862. );
  863. UNREFERENCED_PARAMETER(pCellFile5);
  864. CExtGridCellFile * pCellFile6 =
  865. STATIC_DOWNCAST(
  866. CExtGridCellFile,
  867. m_wndGrid.GridCellGet( nColNo, 6L )
  868. );
  869. UNREFERENCED_PARAMETER(pCellFile6);
  870. CExtGridCellFile * pCellFile7 =
  871. STATIC_DOWNCAST(
  872. CExtGridCellFile,
  873. m_wndGrid.GridCellGet( nColNo, 7L )
  874. );
  875. UNREFERENCED_PARAMETER(pCellFile7);
  876. CExtGridCellFile * pCellFile8 =
  877. STATIC_DOWNCAST(
  878. CExtGridCellFile,
  879. m_wndGrid.GridCellGet( nColNo, 8L )
  880. );
  881. UNREFERENCED_PARAMETER(pCellFile8);
  882. CExtGridCellFile * pCellFile9 =
  883. STATIC_DOWNCAST(
  884. CExtGridCellFile,
  885. m_wndGrid.GridCellGet( nColNo, 9L )
  886. );
  887. UNREFERENCED_PARAMETER(pCellFile9);
  888. pCellFile9->ModifyStyle( __EGCS_READ_ONLY );
  889. }
  890. void CPageGrid::_InitColumnFileImage( LONG nColNo, LONG nRowCount )
  891. {
  892. ASSERT_VALID( this );
  893. ASSERT_VALID( &m_wndGrid );
  894. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  895. {
  896. CExtGridCellFileImage * pCellFileImage =
  897. STATIC_DOWNCAST(
  898. CExtGridCellFileImage,
  899. m_wndGrid.GridCellGet(
  900. nColNo,
  901. nRowNo,
  902. 0,
  903. 0,
  904. RUNTIME_CLASS(CExtGridCellFileImage)
  905. )
  906. );
  907. UNREFERENCED_PARAMETER(pCellFileImage);
  908. }
  909. CExtGridCellFileImage * pCellFileImage0 =
  910. STATIC_DOWNCAST(
  911. CExtGridCellFileImage,
  912. m_wndGrid.GridCellGet( nColNo, 0L )
  913. );
  914. UNREFERENCED_PARAMETER(pCellFileImage0);
  915. CExtGridCellFileImage * pCellFileImage1 =
  916. STATIC_DOWNCAST(
  917. CExtGridCellFileImage,
  918. m_wndGrid.GridCellGet( nColNo, 1L )
  919. );
  920. UNREFERENCED_PARAMETER(pCellFileImage1);
  921. CExtGridCellFileImage * pCellFileImage2 =
  922. STATIC_DOWNCAST(
  923. CExtGridCellFileImage,
  924. m_wndGrid.GridCellGet( nColNo, 2L )
  925. );
  926. UNREFERENCED_PARAMETER(pCellFileImage2);
  927. CExtGridCellFileImage * pCellFileImage3 =
  928. STATIC_DOWNCAST(
  929. CExtGridCellFileImage,
  930. m_wndGrid.GridCellGet( nColNo, 3L )
  931. );
  932. UNREFERENCED_PARAMETER(pCellFileImage3);
  933. CExtGridCellFileImage * pCellFileImage4 =
  934. STATIC_DOWNCAST(
  935. CExtGridCellFileImage,
  936. m_wndGrid.GridCellGet( nColNo, 4L )
  937. );
  938. UNREFERENCED_PARAMETER(pCellFileImage4);
  939. CExtGridCellFileImage * pCellFileImage5 =
  940. STATIC_DOWNCAST(
  941. CExtGridCellFileImage,
  942. m_wndGrid.GridCellGet( nColNo, 5L )
  943. );
  944. UNREFERENCED_PARAMETER(pCellFileImage5);
  945. CExtGridCellFileImage * pCellFileImage6 =
  946. STATIC_DOWNCAST(
  947. CExtGridCellFileImage,
  948. m_wndGrid.GridCellGet( nColNo, 6L )
  949. );
  950. UNREFERENCED_PARAMETER(pCellFileImage6);
  951. CExtGridCellFileImage * pCellFileImage7 =
  952. STATIC_DOWNCAST(
  953. CExtGridCellFileImage,
  954. m_wndGrid.GridCellGet( nColNo, 7L )
  955. );
  956. UNREFERENCED_PARAMETER(pCellFileImage7);
  957. CExtGridCellFileImage * pCellFileImage8 =
  958. STATIC_DOWNCAST(
  959. CExtGridCellFileImage,
  960. m_wndGrid.GridCellGet( nColNo, 8L )
  961. );
  962. UNREFERENCED_PARAMETER(pCellFileImage8);
  963. CExtGridCellFileImage * pCellFileImage9 =
  964. STATIC_DOWNCAST(
  965. CExtGridCellFileImage,
  966. m_wndGrid.GridCellGet( nColNo, 9L )
  967. );
  968. UNREFERENCED_PARAMETER(pCellFileImage9);
  969. pCellFileImage9->ModifyStyle( __EGCS_READ_ONLY );
  970. }
  971. void CPageGrid::_InitColumnFolder( LONG nColNo, LONG nRowCount )
  972. {
  973. ASSERT_VALID( this );
  974. ASSERT_VALID( &m_wndGrid );
  975. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  976. {
  977. CExtGridCellFolder * pCellFolder =
  978. STATIC_DOWNCAST(
  979. CExtGridCellFolder,
  980. m_wndGrid.GridCellGet(
  981. nColNo,
  982. nRowNo,
  983. 0,
  984. 0,
  985. RUNTIME_CLASS(CExtGridCellFolder)
  986. )
  987. );
  988. UNREFERENCED_PARAMETER(pCellFolder);
  989. }
  990. CExtGridCellFolder * pCellFolder0 =
  991. STATIC_DOWNCAST(
  992. CExtGridCellFolder,
  993. m_wndGrid.GridCellGet( nColNo, 0L )
  994. );
  995. pCellFolder0->TextSet( _T("C:\") );
  996. CExtGridCellFolder * pCellFolder1 =
  997. STATIC_DOWNCAST(
  998. CExtGridCellFolder,
  999. m_wndGrid.GridCellGet( nColNo, 1L )
  1000. );
  1001. pCellFolder1->TextSet( _T("C:\Program Files\") );
  1002. CExtGridCellFolder * pCellFolder2 =
  1003. STATIC_DOWNCAST(
  1004. CExtGridCellFolder,
  1005. m_wndGrid.GridCellGet( nColNo, 2L )
  1006. );
  1007. pCellFolder2->TextSet( _T("C:\Windows") );
  1008. CExtGridCellFolder * pCellFolder3 =
  1009. STATIC_DOWNCAST(
  1010. CExtGridCellFolder,
  1011. m_wndGrid.GridCellGet( nColNo, 3L )
  1012. );
  1013. pCellFolder3->TextSet( _T("C:\Windows\System32") );
  1014. CExtGridCellFolder * pCellFolder4 =
  1015. STATIC_DOWNCAST(
  1016. CExtGridCellFolder,
  1017. m_wndGrid.GridCellGet( nColNo, 4L )
  1018. );
  1019. UNREFERENCED_PARAMETER(pCellFolder4);
  1020. CExtGridCellFolder * pCellFolder5 =
  1021. STATIC_DOWNCAST(
  1022. CExtGridCellFolder,
  1023. m_wndGrid.GridCellGet( nColNo, 5L )
  1024. );
  1025. UNREFERENCED_PARAMETER(pCellFolder5);
  1026. CExtGridCellFolder * pCellFolder6 =
  1027. STATIC_DOWNCAST(
  1028. CExtGridCellFolder,
  1029. m_wndGrid.GridCellGet( nColNo, 6L )
  1030. );
  1031. UNREFERENCED_PARAMETER(pCellFolder6);
  1032. CExtGridCellFolder * pCellFolder7 =
  1033. STATIC_DOWNCAST(
  1034. CExtGridCellFolder,
  1035. m_wndGrid.GridCellGet( nColNo, 7L )
  1036. );
  1037. UNREFERENCED_PARAMETER(pCellFolder7);
  1038. CExtGridCellFolder * pCellFolder8 =
  1039. STATIC_DOWNCAST(
  1040. CExtGridCellFolder,
  1041. m_wndGrid.GridCellGet( nColNo, 8L )
  1042. );
  1043. UNREFERENCED_PARAMETER(pCellFolder8);
  1044. CExtGridCellFolder * pCellFolder9 =
  1045. STATIC_DOWNCAST(
  1046. CExtGridCellFolder,
  1047. m_wndGrid.GridCellGet( nColNo, 9L )
  1048. );
  1049. UNREFERENCED_PARAMETER(pCellFolder9);
  1050. pCellFolder9->ModifyStyle( __EGCS_READ_ONLY );
  1051. }
  1052. void CPageGrid::_InitColumnFont( LONG nColNo, LONG nRowCount )
  1053. {
  1054. ASSERT_VALID( this );
  1055. ASSERT_VALID( &m_wndGrid );
  1056. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1057. {
  1058. CExtGridCellFont * pCellFont =
  1059. STATIC_DOWNCAST(
  1060. CExtGridCellFont,
  1061. m_wndGrid.GridCellGet(
  1062. nColNo,
  1063. nRowNo,
  1064. 0,
  1065. 0,
  1066. RUNTIME_CLASS(CExtGridCellFont)
  1067. )
  1068. );
  1069. UNREFERENCED_PARAMETER(pCellFont);
  1070. }
  1071. LOGFONT lf;
  1072. ::memset( &lf, 0, sizeof(LOGFONT) );
  1073. CExtGridCellFont * pCellFont0 =
  1074. STATIC_DOWNCAST(
  1075. CExtGridCellFont,
  1076. m_wndGrid.GridCellGet( nColNo, 0L )
  1077. );
  1078. ::memset( &lf, 0, sizeof(LOGFONT) );
  1079. lf.lfHeight = -18;
  1080. lf.lfWeight = FW_BOLD;
  1081. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, _T("Arial") );
  1082. pCellFont0->DataSet( lf );
  1083. CExtGridCellFont * pCellFont1 =
  1084. STATIC_DOWNCAST(
  1085. CExtGridCellFont,
  1086. m_wndGrid.GridCellGet( nColNo, 1L )
  1087. );
  1088. ::memset( &lf, 0, sizeof(LOGFONT) );
  1089. lf.lfHeight = -12;
  1090. lf.lfItalic = 1;
  1091. lf.lfWeight = FW_BOLD;
  1092. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, _T("MS Sans Serif") );
  1093. pCellFont1->DataSet( lf );
  1094. CExtGridCellFont * pCellFont2 =
  1095. STATIC_DOWNCAST(
  1096. CExtGridCellFont,
  1097. m_wndGrid.GridCellGet( nColNo, 2L )
  1098. );
  1099. ::memset( &lf, 0, sizeof(LOGFONT) );
  1100. lf.lfHeight = -14;
  1101. lf.lfItalic = 1;
  1102. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, _T("Tahoma") );
  1103. pCellFont2->DataSet( lf );
  1104. CExtGridCellFont * pCellFont3 =
  1105. STATIC_DOWNCAST(
  1106. CExtGridCellFont,
  1107. m_wndGrid.GridCellGet( nColNo, 3L )
  1108. );
  1109. ::memset( &lf, 0, sizeof(LOGFONT) );
  1110. lf.lfHeight = -10;
  1111. lf.lfStrikeOut = 1;
  1112. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, _T("Courier") );
  1113. pCellFont3->DataSet( lf );
  1114. CExtGridCellFont * pCellFont4 =
  1115. STATIC_DOWNCAST(
  1116. CExtGridCellFont,
  1117. m_wndGrid.GridCellGet( nColNo, 4L )
  1118. );
  1119. ::memset( &lf, 0, sizeof(LOGFONT) );
  1120. lf.lfHeight = -8;
  1121. lf.lfStrikeOut = 1;
  1122. lf.lfWeight = FW_BOLD;
  1123. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, _T("Courier New") );
  1124. pCellFont4->DataSet( lf );
  1125. CExtGridCellFont * pCellFont5 =
  1126. STATIC_DOWNCAST(
  1127. CExtGridCellFont,
  1128. m_wndGrid.GridCellGet( nColNo, 5L )
  1129. );
  1130. ::memset( &lf, 0, sizeof(LOGFONT) );
  1131. lf.lfHeight = -20;
  1132. lf.lfStrikeOut = 1;
  1133. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, _T("Times New Roman") );
  1134. pCellFont5->DataSet( lf );
  1135. CExtGridCellFont * pCellFont6 =
  1136. STATIC_DOWNCAST(
  1137. CExtGridCellFont,
  1138. m_wndGrid.GridCellGet( nColNo, 6L )
  1139. );
  1140. ::memset( &lf, 0, sizeof(LOGFONT) );
  1141. lf.lfHeight = -16;
  1142. lf.lfUnderline = 1;
  1143. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, _T("System") );
  1144. pCellFont6->DataSet( lf );
  1145. CExtGridCellFont * pCellFont7 =
  1146. STATIC_DOWNCAST(
  1147. CExtGridCellFont,
  1148. m_wndGrid.GridCellGet( nColNo, 7L )
  1149. );
  1150. ::memset( &lf, 0, sizeof(LOGFONT) );
  1151. lf.lfHeight = -14;
  1152. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, _T("Marlett") );
  1153. pCellFont7->DataSet( lf );
  1154. CExtGridCellFont * pCellFont8 =
  1155. STATIC_DOWNCAST(
  1156. CExtGridCellFont,
  1157. m_wndGrid.GridCellGet( nColNo, 8L )
  1158. );
  1159. ::memset( &lf, 0, sizeof(LOGFONT) );
  1160. lf.lfHeight = -12;
  1161. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, _T("Symbol") );
  1162. pCellFont8->DataSet( lf );
  1163. CExtGridCellFont * pCellFont9 =
  1164. STATIC_DOWNCAST(
  1165. CExtGridCellFont,
  1166. m_wndGrid.GridCellGet( nColNo, 9L )
  1167. );
  1168. ::memset( &lf, 0, sizeof(LOGFONT) );
  1169. lf.lfHeight = -18;
  1170. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, _T("Verdana") );
  1171. pCellFont9->DataSet( lf );
  1172. pCellFont9->ModifyStyle( __EGCS_READ_ONLY );
  1173. }
  1174. void CPageGrid::_InitColumnFontFaceName( LONG nColNo, LONG nRowCount )
  1175. {
  1176. ASSERT_VALID( this );
  1177. ASSERT_VALID( &m_wndGrid );
  1178. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1179. {
  1180. CExtGridCellFontFaceName * pCellFontFaceName =
  1181. STATIC_DOWNCAST(
  1182. CExtGridCellFontFaceName,
  1183. m_wndGrid.GridCellGet(
  1184. nColNo,
  1185. nRowNo,
  1186. 0,
  1187. 0,
  1188. RUNTIME_CLASS(CExtGridCellFontFaceName)
  1189. )
  1190. );
  1191. UNREFERENCED_PARAMETER(pCellFontFaceName);
  1192. }
  1193. CExtGridCellFontFaceName * pCellFontFaceName0 =
  1194. STATIC_DOWNCAST(
  1195. CExtGridCellFontFaceName,
  1196. m_wndGrid.GridCellGet( nColNo, 0L )
  1197. );
  1198. pCellFontFaceName0->SelectString( _T("Arial") );
  1199. CExtGridCellFontFaceName * pCellFontFaceName1 =
  1200. STATIC_DOWNCAST(
  1201. CExtGridCellFontFaceName,
  1202. m_wndGrid.GridCellGet( nColNo, 1L )
  1203. );
  1204. pCellFontFaceName1->SelectString( _T("MS Sans Serif") );
  1205. CExtGridCellFontFaceName * pCellFontFaceName2 =
  1206. STATIC_DOWNCAST(
  1207. CExtGridCellFontFaceName,
  1208. m_wndGrid.GridCellGet( nColNo, 2L )
  1209. );
  1210. pCellFontFaceName2->SelectString( _T("Tahoma") );
  1211. CExtGridCellFontFaceName * pCellFontFaceName3 =
  1212. STATIC_DOWNCAST(
  1213. CExtGridCellFontFaceName,
  1214. m_wndGrid.GridCellGet( nColNo, 3L )
  1215. );
  1216. pCellFontFaceName3->SelectString( _T("Courier") );
  1217. CExtGridCellFontFaceName * pCellFontFaceName4 =
  1218. STATIC_DOWNCAST(
  1219. CExtGridCellFontFaceName,
  1220. m_wndGrid.GridCellGet( nColNo, 4L )
  1221. );
  1222. pCellFontFaceName4->SelectString( _T("Courier New") );
  1223. CExtGridCellFontFaceName * pCellFontFaceName5 =
  1224. STATIC_DOWNCAST(
  1225. CExtGridCellFontFaceName,
  1226. m_wndGrid.GridCellGet( nColNo, 5L )
  1227. );
  1228. pCellFontFaceName5->SelectString( _T("Times New Roman") );
  1229. CExtGridCellFontFaceName * pCellFontFaceName6 =
  1230. STATIC_DOWNCAST(
  1231. CExtGridCellFontFaceName,
  1232. m_wndGrid.GridCellGet( nColNo, 6L )
  1233. );
  1234. pCellFontFaceName6->SelectString( _T("System") );
  1235. CExtGridCellFontFaceName * pCellFontFaceName7 =
  1236. STATIC_DOWNCAST(
  1237. CExtGridCellFontFaceName,
  1238. m_wndGrid.GridCellGet( nColNo, 7L )
  1239. );
  1240. pCellFontFaceName7->SelectString( _T("Marlett") );
  1241. CExtGridCellFontFaceName * pCellFontFaceName8 =
  1242. STATIC_DOWNCAST(
  1243. CExtGridCellFontFaceName,
  1244. m_wndGrid.GridCellGet( nColNo, 8L )
  1245. );
  1246. pCellFontFaceName8->SelectString( _T("Symbol") );
  1247. CExtGridCellFontFaceName * pCellFontFaceName9 =
  1248. STATIC_DOWNCAST(
  1249. CExtGridCellFontFaceName,
  1250. m_wndGrid.GridCellGet( nColNo, 9L )
  1251. );
  1252. pCellFontFaceName9->SelectString( _T("Verdana") );
  1253. pCellFontFaceName9->ModifyStyle( __EGCS_READ_ONLY );
  1254. }
  1255. void CPageGrid::_InitColumnFontWeight( LONG nColNo, LONG nRowCount )
  1256. {
  1257. ASSERT_VALID( this );
  1258. ASSERT_VALID( &m_wndGrid );
  1259. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1260. {
  1261. CExtGridCellUpDownFontWeight * pCellFontWeight =
  1262. STATIC_DOWNCAST(
  1263. CExtGridCellUpDownFontWeight,
  1264. m_wndGrid.GridCellGet(
  1265. nColNo,
  1266. nRowNo,
  1267. 0,
  1268. 0,
  1269. RUNTIME_CLASS(CExtGridCellUpDownFontWeight)
  1270. )
  1271. );
  1272. UNREFERENCED_PARAMETER(pCellFontWeight);
  1273. }
  1274. CExtGridCellUpDownFontWeight * pCellFontWeight0 =
  1275. STATIC_DOWNCAST(
  1276. CExtGridCellUpDownFontWeight,
  1277. m_wndGrid.GridCellGet( nColNo, 0L )
  1278. );
  1279. pCellFontWeight0->_VariantAssign( FW_DONTCARE );
  1280. CExtGridCellUpDownFontWeight * pCellFontWeight1 =
  1281. STATIC_DOWNCAST(
  1282. CExtGridCellUpDownFontWeight,
  1283. m_wndGrid.GridCellGet( nColNo, 1L )
  1284. );
  1285. pCellFontWeight1->_VariantAssign( FW_THIN );
  1286. CExtGridCellUpDownFontWeight * pCellFontWeight2 =
  1287. STATIC_DOWNCAST(
  1288. CExtGridCellUpDownFontWeight,
  1289. m_wndGrid.GridCellGet( nColNo, 2L )
  1290. );
  1291. pCellFontWeight2->_VariantAssign( FW_EXTRALIGHT );
  1292. CExtGridCellUpDownFontWeight * pCellFontWeight3 =
  1293. STATIC_DOWNCAST(
  1294. CExtGridCellUpDownFontWeight,
  1295. m_wndGrid.GridCellGet( nColNo, 3L )
  1296. );
  1297. pCellFontWeight3->_VariantAssign( FW_LIGHT );
  1298. CExtGridCellUpDownFontWeight * pCellFontWeight4 =
  1299. STATIC_DOWNCAST(
  1300. CExtGridCellUpDownFontWeight,
  1301. m_wndGrid.GridCellGet( nColNo, 4L )
  1302. );
  1303. pCellFontWeight4->_VariantAssign( FW_NORMAL );
  1304. CExtGridCellUpDownFontWeight * pCellFontWeight5 =
  1305. STATIC_DOWNCAST(
  1306. CExtGridCellUpDownFontWeight,
  1307. m_wndGrid.GridCellGet( nColNo, 5L )
  1308. );
  1309. pCellFontWeight5->_VariantAssign( FW_MEDIUM );
  1310. CExtGridCellUpDownFontWeight * pCellFontWeight6 =
  1311. STATIC_DOWNCAST(
  1312. CExtGridCellUpDownFontWeight,
  1313. m_wndGrid.GridCellGet( nColNo, 6L )
  1314. );
  1315. pCellFontWeight6->_VariantAssign( FW_SEMIBOLD );
  1316. CExtGridCellUpDownFontWeight * pCellFontWeight7 =
  1317. STATIC_DOWNCAST(
  1318. CExtGridCellUpDownFontWeight,
  1319. m_wndGrid.GridCellGet( nColNo, 7L )
  1320. );
  1321. pCellFontWeight7->_VariantAssign( FW_BOLD );
  1322. CExtGridCellUpDownFontWeight * pCellFontWeight8 =
  1323. STATIC_DOWNCAST(
  1324. CExtGridCellUpDownFontWeight,
  1325. m_wndGrid.GridCellGet( nColNo, 8L )
  1326. );
  1327. pCellFontWeight8->_VariantAssign( FW_EXTRABOLD );
  1328. CExtGridCellUpDownFontWeight * pCellFontWeight9 =
  1329. STATIC_DOWNCAST(
  1330. CExtGridCellUpDownFontWeight,
  1331. m_wndGrid.GridCellGet( nColNo, 9L )
  1332. );
  1333. pCellFontWeight9->_VariantAssign( FW_HEAVY );
  1334. pCellFontWeight9->ModifyStyle( __EGCS_READ_ONLY );
  1335. }
  1336. void CPageGrid::_InitColumnColorPart( LONG nColNo, LONG nRowCount )
  1337. {
  1338. ASSERT_VALID( this );
  1339. ASSERT_VALID( &m_wndGrid );
  1340. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1341. {
  1342. CExtGridCellUpDownColorPart * pCellColorPart =
  1343. STATIC_DOWNCAST(
  1344. CExtGridCellUpDownColorPart,
  1345. m_wndGrid.GridCellGet(
  1346. nColNo,
  1347. nRowNo,
  1348. 0,
  1349. 0,
  1350. RUNTIME_CLASS(CExtGridCellUpDownColorPart)
  1351. )
  1352. );
  1353. UNREFERENCED_PARAMETER(pCellColorPart);
  1354. }
  1355. CExtGridCellUpDownColorPart * pCellColorPart0 =
  1356. STATIC_DOWNCAST(
  1357. CExtGridCellUpDownColorPart,
  1358. m_wndGrid.GridCellGet( nColNo, 0L )
  1359. );
  1360. pCellColorPart0->_VariantAssign( 0 );
  1361. pCellColorPart0->m_eCPT = CExtGridCellUpDownColorPart::__ECPT_UNKNOWN;
  1362. CExtGridCellUpDownColorPart * pCellColorPart1 =
  1363. STATIC_DOWNCAST(
  1364. CExtGridCellUpDownColorPart,
  1365. m_wndGrid.GridCellGet( nColNo, 1L )
  1366. );
  1367. pCellColorPart1->_VariantAssign( 32 );
  1368. pCellColorPart1->m_eCPT = CExtGridCellUpDownColorPart::__ECPT_RED;
  1369. CExtGridCellUpDownColorPart * pCellColorPart2 =
  1370. STATIC_DOWNCAST(
  1371. CExtGridCellUpDownColorPart,
  1372. m_wndGrid.GridCellGet( nColNo, 2L )
  1373. );
  1374. pCellColorPart2->_VariantAssign( 64 );
  1375. pCellColorPart2->m_eCPT = CExtGridCellUpDownColorPart::__ECPT_GREEN;
  1376. CExtGridCellUpDownColorPart * pCellColorPart3 =
  1377. STATIC_DOWNCAST(
  1378. CExtGridCellUpDownColorPart,
  1379. m_wndGrid.GridCellGet( nColNo, 3L )
  1380. );
  1381. pCellColorPart3->_VariantAssign( 96 );
  1382. pCellColorPart3->m_eCPT = CExtGridCellUpDownColorPart::__ECPT_BLUE;
  1383. CExtGridCellUpDownColorPart * pCellColorPart4 =
  1384. STATIC_DOWNCAST(
  1385. CExtGridCellUpDownColorPart,
  1386. m_wndGrid.GridCellGet( nColNo, 4L )
  1387. );
  1388. pCellColorPart4->_VariantAssign( 128 );
  1389. pCellColorPart4->m_eCPT = CExtGridCellUpDownColorPart::__ECPT_UNKNOWN;
  1390. CExtGridCellUpDownColorPart * pCellColorPart5 =
  1391. STATIC_DOWNCAST(
  1392. CExtGridCellUpDownColorPart,
  1393. m_wndGrid.GridCellGet( nColNo, 5L )
  1394. );
  1395. pCellColorPart5->_VariantAssign( 160 );
  1396. pCellColorPart5->m_eCPT = CExtGridCellUpDownColorPart::__ECPT_RED;
  1397. CExtGridCellUpDownColorPart * pCellColorPart6 =
  1398. STATIC_DOWNCAST(
  1399. CExtGridCellUpDownColorPart,
  1400. m_wndGrid.GridCellGet( nColNo, 6L )
  1401. );
  1402. pCellColorPart6->_VariantAssign( 192 );
  1403. pCellColorPart6->m_eCPT = CExtGridCellUpDownColorPart::__ECPT_GREEN;
  1404. CExtGridCellUpDownColorPart * pCellColorPart7 =
  1405. STATIC_DOWNCAST(
  1406. CExtGridCellUpDownColorPart,
  1407. m_wndGrid.GridCellGet( nColNo, 7L )
  1408. );
  1409. pCellColorPart7->_VariantAssign( 224 );
  1410. pCellColorPart7->m_eCPT = CExtGridCellUpDownColorPart::__ECPT_BLUE;
  1411. CExtGridCellUpDownColorPart * pCellColorPart8 =
  1412. STATIC_DOWNCAST(
  1413. CExtGridCellUpDownColorPart,
  1414. m_wndGrid.GridCellGet( nColNo, 8L )
  1415. );
  1416. pCellColorPart8->_VariantAssign( 240 );
  1417. pCellColorPart8->m_eCPT = CExtGridCellUpDownColorPart::__ECPT_RED;
  1418. CExtGridCellUpDownColorPart * pCellColorPart9 =
  1419. STATIC_DOWNCAST(
  1420. CExtGridCellUpDownColorPart,
  1421. m_wndGrid.GridCellGet( nColNo, 9L )
  1422. );
  1423. pCellColorPart9->_VariantAssign( 255 );
  1424. pCellColorPart9->m_eCPT = CExtGridCellUpDownColorPart::__ECPT_GREEN;
  1425. }
  1426. void CPageGrid::_InitColumnRectPart( LONG nColNo, LONG nRowCount )
  1427. {
  1428. ASSERT_VALID( this );
  1429. ASSERT_VALID( &m_wndGrid );
  1430. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1431. {
  1432. CExtGridCellUpDownRectPart * pCellRectPart =
  1433. STATIC_DOWNCAST(
  1434. CExtGridCellUpDownRectPart,
  1435. m_wndGrid.GridCellGet(
  1436. nColNo,
  1437. nRowNo,
  1438. 0,
  1439. 0,
  1440. RUNTIME_CLASS(CExtGridCellUpDownRectPart)
  1441. )
  1442. );
  1443. UNREFERENCED_PARAMETER(pCellRectPart);
  1444. }
  1445. CExtGridCellUpDownRectPart * pCellRectPart0 =
  1446. STATIC_DOWNCAST(
  1447. CExtGridCellUpDownRectPart,
  1448. m_wndGrid.GridCellGet( nColNo, 0L )
  1449. );
  1450. pCellRectPart0->_VariantAssign( 0 );
  1451. pCellRectPart0->m_eCPT = CExtGridCellUpDownRectPart::__ECPT_UNKNOWN;
  1452. CExtGridCellUpDownRectPart * pCellRectPart1 =
  1453. STATIC_DOWNCAST(
  1454. CExtGridCellUpDownRectPart,
  1455. m_wndGrid.GridCellGet( nColNo, 1L )
  1456. );
  1457. pCellRectPart1->_VariantAssign( 32 );
  1458. pCellRectPart1->m_eCPT = CExtGridCellUpDownRectPart::__ECPT_X;
  1459. CExtGridCellUpDownRectPart * pCellRectPart2 =
  1460. STATIC_DOWNCAST(
  1461. CExtGridCellUpDownRectPart,
  1462. m_wndGrid.GridCellGet( nColNo, 2L )
  1463. );
  1464. pCellRectPart2->_VariantAssign( 64 );
  1465. pCellRectPart2->m_eCPT = CExtGridCellUpDownRectPart::__ECPT_Y;
  1466. CExtGridCellUpDownRectPart * pCellRectPart3 =
  1467. STATIC_DOWNCAST(
  1468. CExtGridCellUpDownRectPart,
  1469. m_wndGrid.GridCellGet( nColNo, 3L )
  1470. );
  1471. pCellRectPart3->_VariantAssign( 96 );
  1472. pCellRectPart3->m_eCPT = CExtGridCellUpDownRectPart::__ECPT_WIDTH;
  1473. CExtGridCellUpDownRectPart * pCellRectPart4 =
  1474. STATIC_DOWNCAST(
  1475. CExtGridCellUpDownRectPart,
  1476. m_wndGrid.GridCellGet( nColNo, 4L )
  1477. );
  1478. pCellRectPart4->_VariantAssign( 128 );
  1479. pCellRectPart4->m_eCPT = CExtGridCellUpDownRectPart::__ECPT_HEIGHT;
  1480. CExtGridCellUpDownRectPart * pCellRectPart5 =
  1481. STATIC_DOWNCAST(
  1482. CExtGridCellUpDownRectPart,
  1483. m_wndGrid.GridCellGet( nColNo, 5L )
  1484. );
  1485. pCellRectPart5->_VariantAssign( 160 );
  1486. pCellRectPart5->m_eCPT = CExtGridCellUpDownRectPart::__ECPT_UNKNOWN;
  1487. CExtGridCellUpDownRectPart * pCellRectPart6 =
  1488. STATIC_DOWNCAST(
  1489. CExtGridCellUpDownRectPart,
  1490. m_wndGrid.GridCellGet( nColNo, 6L )
  1491. );
  1492. pCellRectPart6->_VariantAssign( 192 );
  1493. pCellRectPart6->m_eCPT = CExtGridCellUpDownRectPart::__ECPT_X;
  1494. CExtGridCellUpDownRectPart * pCellRectPart7 =
  1495. STATIC_DOWNCAST(
  1496. CExtGridCellUpDownRectPart,
  1497. m_wndGrid.GridCellGet( nColNo, 7L )
  1498. );
  1499. pCellRectPart7->_VariantAssign( 224 );
  1500. pCellRectPart7->m_eCPT = CExtGridCellUpDownRectPart::__ECPT_Y;
  1501. CExtGridCellUpDownRectPart * pCellRectPart8 =
  1502. STATIC_DOWNCAST(
  1503. CExtGridCellUpDownRectPart,
  1504. m_wndGrid.GridCellGet( nColNo, 8L )
  1505. );
  1506. pCellRectPart8->_VariantAssign( 240 );
  1507. pCellRectPart8->m_eCPT = CExtGridCellUpDownRectPart::__ECPT_WIDTH;
  1508. CExtGridCellUpDownRectPart * pCellRectPart9 =
  1509. STATIC_DOWNCAST(
  1510. CExtGridCellUpDownRectPart,
  1511. m_wndGrid.GridCellGet( nColNo, 9L )
  1512. );
  1513. pCellRectPart9->_VariantAssign( 255 );
  1514. pCellRectPart9->m_eCPT = CExtGridCellUpDownRectPart::__ECPT_HEIGHT;
  1515. }
  1516. void CPageGrid::_InitColumnInplaceSlider( LONG nColNo, LONG nRowCount, bool bSliderMode /*= true*/ )
  1517. {
  1518. ASSERT_VALID( this );
  1519. ASSERT_VALID( &m_wndGrid );
  1520. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1521. {
  1522. CExtGridCellInplaceSlider * pCell =
  1523. STATIC_DOWNCAST(
  1524. CExtGridCellInplaceSlider,
  1525. m_wndGrid.GridCellGet(
  1526. nColNo,
  1527. nRowNo,
  1528. 0,
  1529. 0,
  1530. RUNTIME_CLASS(CExtGridCellInplaceSlider)
  1531. )
  1532. );
  1533. //pCell->ModifyStyleEx( 0, __EGCS_EX_EMPTY );
  1534. pCell->ScrollTotalRangeSet( 100 );
  1535. if( bSliderMode )
  1536. {
  1537. if( nRowNo > 5 )
  1538. {
  1539. pCell->ScrollPageSizeSet( ::rand() % 40 );
  1540. pCell->ScrollPosSet( ::rand() % 60 );
  1541. }
  1542. else
  1543. {
  1544. pCell->ScrollPageSizeSet( 0 );
  1545. pCell->ScrollPosSet( ::rand() % 100 );
  1546. }
  1547. }
  1548. else
  1549. {
  1550. if( nRowNo <= 2 )
  1551. {
  1552. pCell->ScrollPageSizeSet( 0 );
  1553. pCell->ScrollPosSet( ::rand() % 100 );
  1554. }
  1555. else
  1556. {
  1557. ULONG nScrollPageSize = ::rand() % 50;
  1558. pCell->ScrollPageSizeSet( nScrollPageSize );
  1559. pCell->ScrollPosSet( ::rand() % ( 100 - nScrollPageSize ) );
  1560. }
  1561. pCell->ScrollButtonExtentHorzSet( ( ::rand() % 20 ) + 10 );
  1562. }
  1563. if( nRowNo == 0 || nRowNo == 6 )
  1564. {
  1565. pCell->ModifyStyle( __EGCS_READ_ONLY );
  1566. if( nRowNo == 6 )
  1567. pCell->TextSet( _T("Read-only: ") );
  1568. }
  1569. if( nRowNo == 0 )
  1570. {
  1571. pCell->TextSet( _T("First: ") );
  1572. //pCell->ModifyStyle( __EGCS_BUTTON_DROPDOWN|__EGCS_BUTTON_ELLIPSIS );
  1573. }
  1574. else if( nRowNo == 1 )
  1575. {
  1576. pCell->TextSet( _T("Second: ") );
  1577. }
  1578. else if( nRowNo == 2 )
  1579. {
  1580. pCell->TextSet( _T("Third: ") );
  1581. //pCell->ModifyStyle( __EGCS_BUTTON_DROPDOWN );
  1582. }
  1583. //  else if( nRowNo == 3 )
  1584. //  pCell->ModifyStyle( __EGCS_BUTTON_ELLIPSIS );
  1585. //  else if( nRowNo == 4 )
  1586. //  pCell->ModifyStyle( __EGCS_BUTTON_DROPDOWN );
  1587. //  else if( nRowNo == 7 )
  1588. //  pCell->ModifyStyle( __EGCS_BUTTON_DROPDOWN|__EGCS_BUTTON_ELLIPSIS );
  1589. }
  1590. }
  1591. void CPageGrid::_InitColumnInplaceScrollBar( LONG nColNo, LONG nRowCount )
  1592. {
  1593. ASSERT_VALID( this );
  1594. ASSERT_VALID( &m_wndGrid );
  1595. _InitColumnInplaceSlider( nColNo, nRowCount, false );
  1596. }
  1597. void CPageGrid::_InitColumnHotKey( LONG nColNo, LONG nRowCount )
  1598. {
  1599. ASSERT_VALID( this );
  1600. ASSERT_VALID( &m_wndGrid );
  1601. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1602. {
  1603. CExtGridCellHotKey * pCellHotKey =
  1604. STATIC_DOWNCAST(
  1605. CExtGridCellHotKey,
  1606. m_wndGrid.GridCellGet(
  1607. nColNo,
  1608. nRowNo,
  1609. 0,
  1610. 0,
  1611. RUNTIME_CLASS(CExtGridCellHotKey)
  1612. )
  1613. );
  1614. UNREFERENCED_PARAMETER(pCellHotKey);
  1615. }
  1616. CExtGridCellHotKey * pCellHotKey0 =
  1617. STATIC_DOWNCAST(
  1618. CExtGridCellHotKey,
  1619. m_wndGrid.GridCellGet( nColNo, 0L )
  1620. );
  1621. pCellHotKey0->SetHotKey(
  1622. MAKELONG( 'P', FCONTROL|FVIRTKEY )
  1623. );
  1624. CExtGridCellHotKey * pCellHotKey1 =
  1625. STATIC_DOWNCAST(
  1626. CExtGridCellHotKey,
  1627. m_wndGrid.GridCellGet( nColNo, 1L )
  1628. );
  1629. pCellHotKey1->SetHotKey(
  1630. MAKELONG( 'S', FCONTROL|FSHIFT|FVIRTKEY )
  1631. );
  1632. CExtGridCellHotKey * pCellHotKey2 =
  1633. STATIC_DOWNCAST(
  1634. CExtGridCellHotKey,
  1635. m_wndGrid.GridCellGet( nColNo, 2L )
  1636. );
  1637. pCellHotKey2->SetHotKey(
  1638. MAKELONG( 'X', FALT|FVIRTKEY )
  1639. );
  1640. CExtGridCellHotKey * pCellHotKey3 =
  1641. STATIC_DOWNCAST(
  1642. CExtGridCellHotKey,
  1643. m_wndGrid.GridCellGet( nColNo, 3L )
  1644. );
  1645. pCellHotKey3->SetHotKey(
  1646. MAKELONG( VK_F1, FSHIFT|FVIRTKEY)
  1647. );
  1648. CExtGridCellHotKey * pCellHotKey4 =
  1649. STATIC_DOWNCAST(
  1650. CExtGridCellHotKey,
  1651. m_wndGrid.GridCellGet( nColNo, 4L )
  1652. );
  1653. pCellHotKey4->SetHotKey(
  1654. VK_F12, 
  1655. FCONTROL|FVIRTKEY
  1656. );
  1657. CExtGridCellHotKey * pCellHotKey5 =
  1658. STATIC_DOWNCAST(
  1659. CExtGridCellHotKey,
  1660. m_wndGrid.GridCellGet( nColNo, 5L )
  1661. );
  1662. pCellHotKey5->SetHotKey(
  1663. 'S', 
  1664. FALT|FSHIFT|FCONTROL|FVIRTKEY
  1665. );
  1666. CExtGridCellHotKey * pCellHotKey6 =
  1667. STATIC_DOWNCAST(
  1668. CExtGridCellHotKey,
  1669. m_wndGrid.GridCellGet( nColNo, 6L )
  1670. );
  1671. pCellHotKey6->SetHotKey(
  1672. VK_ADD, 
  1673. FVIRTKEY
  1674. );
  1675. CExtGridCellHotKey * pCellHotKey7 =
  1676. STATIC_DOWNCAST(
  1677. CExtGridCellHotKey,
  1678. m_wndGrid.GridCellGet( nColNo, 7L )
  1679. );
  1680. pCellHotKey7->SetHotKey(
  1681. '1', 
  1682. FALT|FVIRTKEY
  1683. );
  1684. CExtGridCellHotKey * pCellHotKey8 =
  1685. STATIC_DOWNCAST(
  1686. CExtGridCellHotKey,
  1687. m_wndGrid.GridCellGet( nColNo, 8L )
  1688. );
  1689. pCellHotKey8->SetHotKey(
  1690. '2', 
  1691. FSHIFT|FVIRTKEY
  1692. );
  1693. CExtGridCellHotKey * pCellHotKey9 =
  1694. STATIC_DOWNCAST(
  1695. CExtGridCellHotKey,
  1696. m_wndGrid.GridCellGet( nColNo, 9L )
  1697. );
  1698. pCellHotKey9->SetHotKey(
  1699. VK_F10, 
  1700. FVIRTKEY
  1701. );
  1702. }
  1703. void CPageGrid::_InitColumnButton( LONG nColNo, LONG nRowCount )
  1704. {
  1705. ASSERT_VALID( this );
  1706. ASSERT_VALID( &m_wndGrid );
  1707. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1708. {
  1709. CExtGridCellButton * pCellButton =
  1710. STATIC_DOWNCAST(
  1711. CExtGridCellButton,
  1712. m_wndGrid.GridCellGet(
  1713. nColNo,
  1714. nRowNo,
  1715. 0,
  1716. 0,
  1717. RUNTIME_CLASS(CExtGridCellButton)
  1718. )
  1719. );
  1720. UNREFERENCED_PARAMETER(pCellButton);
  1721. }
  1722. CExtGridCellButton * pCellButton0 =
  1723. STATIC_DOWNCAST(
  1724. CExtGridCellButton,
  1725. m_wndGrid.GridCellGet( nColNo, 0L )
  1726. );
  1727. pCellButton0->TextSet( _T("Cell1") );
  1728. pCellButton0->IconIndexSet( 0 );
  1729. CExtGridCellButton * pCellButton1 =
  1730. STATIC_DOWNCAST(
  1731. CExtGridCellButton,
  1732. m_wndGrid.GridCellGet( nColNo, 1L )
  1733. );
  1734. pCellButton1->TextSet( _T("Cell2 Line1rnCell2 Line2rnCell2 Line3") );
  1735. pCellButton1->ModifyStyleEx( __EGCS_EX_WRAP_TEXT );
  1736. pCellButton1->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  1737. pCellButton1->IconIndexSet( 1 );
  1738. CExtGridCellButton * pCellButton2 =
  1739. STATIC_DOWNCAST(
  1740. CExtGridCellButton,
  1741. m_wndGrid.GridCellGet( nColNo, 2L )
  1742. );
  1743. pCellButton2->TextSet( _T("Cell3") );
  1744. CExtGridCellButton * pCellButton3 =
  1745. STATIC_DOWNCAST(
  1746. CExtGridCellButton,
  1747. m_wndGrid.GridCellGet( nColNo, 3L )
  1748. );
  1749. pCellButton3->TextSet( _T("Cell4") );
  1750. pCellButton3->ModifyStyle( __EGCS_CHK_CHECK );
  1751. pCellButton3->IconIndexSet( 2 );
  1752. CExtGridCellButton * pCellButton4 =
  1753. STATIC_DOWNCAST(
  1754. CExtGridCellButton,
  1755. m_wndGrid.GridCellGet( nColNo, 4L )
  1756. );
  1757. pCellButton4->TextSet( _T("Cell5 Line1rnCell5 Line2rnCell5 Line3") );
  1758. pCellButton4->ModifyStyleEx( __EGCS_EX_WRAP_TEXT );
  1759. pCellButton4->ModifyStyle( __EGCS_TA_HORZ_RIGHT );
  1760. pCellButton4->IconIndexSet( 3 );
  1761. CExtGridCellButton * pCellButton5 =
  1762. STATIC_DOWNCAST(
  1763. CExtGridCellButton,
  1764. m_wndGrid.GridCellGet( nColNo, 5L )
  1765. );
  1766. pCellButton5->TextSet( _T("Cell6") );
  1767. pCellButton5->IconIndexSet( 4 );
  1768. CExtGridCellButton * pCellButton6 =
  1769. STATIC_DOWNCAST(
  1770. CExtGridCellButton,
  1771. m_wndGrid.GridCellGet( nColNo, 6L )
  1772. );
  1773. pCellButton6->TextSet( _T("Cell7") );
  1774. pCellButton6->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  1775. pCellButton6->IconIndexSet( 5 );
  1776. CExtGridCellButton * pCellButton7 =
  1777. STATIC_DOWNCAST(
  1778. CExtGridCellButton,
  1779. m_wndGrid.GridCellGet( nColNo, 7L )
  1780. );
  1781. pCellButton7->TextSet( _T("Cell8 Line1rnCell8 Line2rnCell8 Line3") );
  1782. pCellButton7->ModifyStyleEx( __EGCS_EX_WRAP_TEXT );
  1783. pCellButton7->IconIndexSet( 6 );
  1784. CExtGridCellButton * pCellButton8 =
  1785. STATIC_DOWNCAST(
  1786. CExtGridCellButton,
  1787. m_wndGrid.GridCellGet( nColNo, 8L )
  1788. );
  1789. pCellButton8->TextSet( _T("Cell9") );
  1790. pCellButton8->IconIndexSet( 7 );
  1791. pCellButton8->ModifyStyle( __EGCS_CHK_CHECK );
  1792. CExtGridCellButton * pCellButton9 =
  1793. STATIC_DOWNCAST(
  1794. CExtGridCellButton,
  1795. m_wndGrid.GridCellGet( nColNo, 9L )
  1796. );
  1797. pCellButton9->TextSet( _T("Cell10") );
  1798. pCellButton9->ModifyStyle( __EGCS_CHK_CHECK );
  1799. }
  1800. void CPageGrid::_InitColumnObjectSize( LONG nColNo, LONG nRowCount )
  1801. {
  1802. ASSERT_VALID( this );
  1803. ASSERT_VALID( &m_wndGrid );
  1804. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1805. {
  1806. CExtGridCellObjectSize * pCellObjectSize =
  1807. STATIC_DOWNCAST(
  1808. CExtGridCellObjectSize,
  1809. m_wndGrid.GridCellGet(
  1810. nColNo,
  1811. nRowNo,
  1812. 0,
  1813. 0,
  1814. RUNTIME_CLASS(CExtGridCellObjectSize)
  1815. )
  1816. );
  1817. UNREFERENCED_PARAMETER(pCellObjectSize);
  1818. }
  1819. CExtGridCellObjectSize * pCellObjectSize0 =
  1820. STATIC_DOWNCAST(
  1821. CExtGridCellObjectSize,
  1822. m_wndGrid.GridCellGet( nColNo, 0L )
  1823. );
  1824. pCellObjectSize0->SetMode( CExtGridCellObjectSize::eAuto );
  1825. pCellObjectSize0->_VariantAssign( 7486347 );
  1826. CExtGridCellObjectSize * pCellObjectSize1 =
  1827. STATIC_DOWNCAST(
  1828. CExtGridCellObjectSize,
  1829. m_wndGrid.GridCellGet( nColNo, 1L )
  1830. );
  1831. pCellObjectSize1->SetMode( CExtGridCellObjectSize::eBytes );
  1832. pCellObjectSize1->_VariantAssign( 1579 );
  1833. CExtGridCellObjectSize * pCellObjectSize2 =
  1834. STATIC_DOWNCAST(
  1835. CExtGridCellObjectSize,
  1836. m_wndGrid.GridCellGet( nColNo, 2L )
  1837. );
  1838. pCellObjectSize2->SetMode( CExtGridCellObjectSize::eKilobytes );
  1839. pCellObjectSize2->_VariantAssign( 36864 );
  1840. CExtGridCellObjectSize * pCellObjectSize3 =
  1841. STATIC_DOWNCAST(
  1842. CExtGridCellObjectSize,
  1843. m_wndGrid.GridCellGet( nColNo, 3L )
  1844. );
  1845. pCellObjectSize3->SetMode( CExtGridCellObjectSize::eMegabytes );
  1846. pCellObjectSize3->_VariantAssign( 1425917184 );
  1847. CExtGridCellObjectSize * pCellObjectSize4 =
  1848. STATIC_DOWNCAST(
  1849. CExtGridCellObjectSize,
  1850. m_wndGrid.GridCellGet( nColNo, 4L )
  1851. );
  1852. pCellObjectSize4->SetMode( CExtGridCellObjectSize::eGigabytes );
  1853. pCellObjectSize4->_VariantAssign( 370348935 );
  1854. CExtGridCellObjectSize * pCellObjectSize5 =
  1855. STATIC_DOWNCAST(
  1856. CExtGridCellObjectSize,
  1857. m_wndGrid.GridCellGet( nColNo, 5L )
  1858. );
  1859. pCellObjectSize5->SetMode( CExtGridCellObjectSize::eTerabytes );
  1860. pCellObjectSize5->_VariantAssign( 24234539196416 );
  1861. CExtGridCellObjectSize * pCellObjectSize6 =
  1862. STATIC_DOWNCAST(
  1863. CExtGridCellObjectSize,
  1864. m_wndGrid.GridCellGet( nColNo, 6L )
  1865. );
  1866. pCellObjectSize6->SetMode( CExtGridCellObjectSize::ePetabytes );
  1867. pCellObjectSize6->_VariantAssign( DOUBLE( DOUBLE(6.5) * DOUBLE( ::pow( DOUBLE(2), DOUBLE(50) ) ) ), VT_R8 );
  1868. CExtGridCellObjectSize * pCellObjectSize7 =
  1869. STATIC_DOWNCAST(
  1870. CExtGridCellObjectSize,
  1871. m_wndGrid.GridCellGet( nColNo, 7L )
  1872. );
  1873. pCellObjectSize7->SetMode( CExtGridCellObjectSize::eExabytes );
  1874. pCellObjectSize7->_VariantAssign( DOUBLE( DOUBLE(2.45) * DOUBLE( ::pow( DOUBLE(2), DOUBLE(60) ) ) ), VT_R8 );
  1875. CExtGridCellObjectSize * pCellObjectSize8 =
  1876. STATIC_DOWNCAST(
  1877. CExtGridCellObjectSize,
  1878. m_wndGrid.GridCellGet( nColNo, 8L )
  1879. );
  1880. pCellObjectSize8->SetMode( CExtGridCellObjectSize::eAuto );
  1881. pCellObjectSize8->_VariantAssign( 10490037248 );
  1882. CExtGridCellObjectSize * pCellObjectSize9 =
  1883. STATIC_DOWNCAST(
  1884. CExtGridCellObjectSize,
  1885. m_wndGrid.GridCellGet( nColNo, 9L )
  1886. );
  1887. pCellObjectSize9->SetMode( CExtGridCellObjectSize::eAuto );
  1888. pCellObjectSize9->_VariantAssign( 814804992 );
  1889. }
  1890. void CPageGrid::_InitColumnGeographic( LONG nColNo, LONG nRowCount )
  1891. {
  1892. ASSERT_VALID( this );
  1893. ASSERT_VALID( &m_wndGrid );
  1894. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  1895. {
  1896. CExtGridCellLL * pCellLL =
  1897. STATIC_DOWNCAST(
  1898. CExtGridCellLL,
  1899. m_wndGrid.GridCellGet(
  1900. nColNo,
  1901. nRowNo,
  1902. 0,
  1903. 0,
  1904. RUNTIME_CLASS(CExtGridCellLL)
  1905. )
  1906. );
  1907. UNREFERENCED_PARAMETER(pCellLL);
  1908. }
  1909. CExtGridCellLL * pCellLL0 =
  1910. STATIC_DOWNCAST(
  1911. CExtGridCellLL,
  1912. m_wndGrid.GridCellGet( nColNo, 0L )
  1913. );
  1914. pCellLL0->SetMode( CExtLLBaseControlProperties::longitude_latitude );
  1915. pCellLL0->ModifyStyleEx( 0, __EGCS_EX_EMPTY );
  1916. CExtLongitude _Longitude0( CExtLongitude::hemisphere_east, 20, 30, 40 );
  1917. pCellLL0->LongitudeSet( _Longitude0, true );
  1918. CExtLatitude _Latitude0( CExtLatitude::hemisphere_north, 50, 40, 30 );
  1919. pCellLL0->LatitudeSet( _Latitude0, true );
  1920. CExtGridCellLL * pCellLL1 =
  1921. STATIC_DOWNCAST(
  1922. CExtGridCellLL,
  1923. m_wndGrid.GridCellGet( nColNo, 1L )
  1924. );
  1925. pCellLL1->SetMode( CExtLLBaseControlProperties::latitude_longitude );
  1926. pCellLL1->ModifyStyleEx( 0, __EGCS_EX_EMPTY );
  1927. CExtLongitude _Longitude1( CExtLongitude::hemisphere_west, 44, 33, 22 );
  1928. pCellLL1->LongitudeSet( _Longitude0, true );
  1929. CExtLatitude _Latitude1( CExtLatitude::hemisphere_south, 55, 44, 11 );
  1930. pCellLL1->LatitudeSet( _Latitude0, true );
  1931. CExtGridCellLL * pCellLL2 =
  1932. STATIC_DOWNCAST(
  1933. CExtGridCellLL,
  1934. m_wndGrid.GridCellGet( nColNo, 2L )
  1935. );
  1936. pCellLL2->SetMode( CExtLLBaseControlProperties::longitude );
  1937. pCellLL2->ModifyStyleEx( 0, __EGCS_EX_EMPTY );
  1938. CExtGridCellLL * pCellLL3 =
  1939. STATIC_DOWNCAST(
  1940. CExtGridCellLL,
  1941. m_wndGrid.GridCellGet( nColNo, 3L )
  1942. );
  1943. pCellLL3->SetMode( CExtLLBaseControlProperties::latitude );
  1944. pCellLL3->ModifyStyleEx( 0, __EGCS_EX_EMPTY );
  1945. CExtGridCellLL * pCellLL4 =
  1946. STATIC_DOWNCAST(
  1947. CExtGridCellLL,
  1948. m_wndGrid.GridCellGet( nColNo, 4L )
  1949. );
  1950. pCellLL4->SetMode( CExtLLBaseControlProperties::longitude_latitude );
  1951. pCellLL4->ModifyStyleEx( 0, __EGCS_EX_EMPTY );
  1952. pCellLL4->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
  1953. pCellLL4->m_bMapDisplayMarkers = pCellLL4->m_bMapDisplayMarkerTips = pCellLL4->m_bMapDisplayCurrentLocationTip = true;
  1954. pCellLL4->m_bMapHR = true;
  1955. CExtGridCellLL * pCellLL5 =
  1956. STATIC_DOWNCAST(
  1957. CExtGridCellLL,
  1958. m_wndGrid.GridCellGet( nColNo, 5L )
  1959. );
  1960. pCellLL5->SetMode( CExtLLBaseControlProperties::latitude_longitude );
  1961. pCellLL5->ModifyStyleEx( 0, __EGCS_EX_EMPTY );
  1962. pCellLL5->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
  1963. pCellLL5->m_bMapDisplayMarkers = pCellLL5->m_bMapDisplayMarkerTips = pCellLL5->m_bMapDisplayCurrentLocationTip = true;
  1964. pCellLL5->m_bMapHR = true;
  1965. CExtGridCellLL * pCellLL6 =
  1966. STATIC_DOWNCAST(
  1967. CExtGridCellLL,
  1968. m_wndGrid.GridCellGet( nColNo, 6L )
  1969. );
  1970. pCellLL6->SetMode( CExtLLBaseControlProperties::longitude );
  1971. pCellLL6->ModifyStyleEx( 0, __EGCS_EX_EMPTY );
  1972. pCellLL6->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
  1973. pCellLL6->m_bMapHighlightTimeZones = pCellLL6->m_bMapDisplayTimeZoneTips = pCellLL6->m_bMapDisplayLocalDate = pCellLL6->m_bMapDisplayLocalTime = true;
  1974. pCellLL6->m_bMapHR = true;
  1975. CExtGridCellLL * pCellLL7 =
  1976. STATIC_DOWNCAST(
  1977. CExtGridCellLL,
  1978. m_wndGrid.GridCellGet( nColNo, 7L )
  1979. );
  1980. pCellLL7->SetMode( CExtLLBaseControlProperties::latitude );
  1981. pCellLL7->ModifyStyleEx( 0, __EGCS_EX_EMPTY );
  1982. pCellLL7->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
  1983. //pCellLL7->m_bMapHR = true;
  1984. CExtGridCellLL * pCellLL8 =
  1985. STATIC_DOWNCAST(
  1986. CExtGridCellLL,
  1987. m_wndGrid.GridCellGet( nColNo, 8L )
  1988. );
  1989. pCellLL8->SetMode( CExtLLBaseControlProperties::longitude_latitude );
  1990. pCellLL8->ModifyStyleEx( 0, __EGCS_EX_EMPTY );
  1991. //pCellLL8->ModifyStyle( __EGCS_READ_ONLY );
  1992. pCellLL8->m_bMapDisplayMarkers = pCellLL8->m_bMapDisplayMarkerTips = pCellLL8->m_bMapDisplayCurrentLocationTip = true;
  1993. pCellLL8->m_bMapHighlightTimeZones = pCellLL8->m_bMapDisplayTimeZoneTips = pCellLL8->m_bMapDisplayLocalDate = pCellLL8->m_bMapDisplayLocalTime = true;
  1994. pCellLL8->m_bMapHR = true;
  1995. CExtGridCellLL * pCellLL9 =
  1996. STATIC_DOWNCAST(
  1997. CExtGridCellLL,
  1998. m_wndGrid.GridCellGet( nColNo, 9L )
  1999. );
  2000. pCellLL9->SetMode( CExtLLBaseControlProperties::latitude_longitude );
  2001. pCellLL9->ModifyStyleEx( 0, __EGCS_EX_EMPTY );
  2002. pCellLL9->ModifyStyle( __EGCS_READ_ONLY );
  2003. }
  2004. void CPageGrid::_InitColumnStringMasked( LONG nColNo, LONG nRowCount )
  2005. {
  2006. ASSERT_VALID( this );
  2007. ASSERT_VALID( &m_wndGrid );
  2008. // default mask symbol number
  2009. CExtEditWithBehavior::CBehaviorMasked::CharRule _rule1( RGB(164,0,0), _T('#'), (CExtEditWithBehavior::CBehaviorMasked::CharRule::ValidationFunction)_istdigit );
  2010. // default mask symbol letter
  2011. CExtEditWithBehavior::CBehaviorMasked::CharRule _rule2( RGB(0,164,0), _T('@'), (CExtEditWithBehavior::CBehaviorMasked::CharRule::ValidationFunction)_istalpha );
  2012. // default mask symbol number and letter
  2013. CExtEditWithBehavior::CBehaviorMasked::CharRule _rule3( RGB(0,0,164), _T('$'), (CExtEditWithBehavior::CBehaviorMasked::CharRule::ValidationFunction)_istalnum );
  2014. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  2015. {
  2016. CExtGridCellStringMasked * pCellStringMasked =
  2017. STATIC_DOWNCAST(
  2018. CExtGridCellStringMasked,
  2019. m_wndGrid.GridCellGet(
  2020. nColNo,
  2021. nRowNo,
  2022. 0,
  2023. 0,
  2024. RUNTIME_CLASS(CExtGridCellStringMasked)
  2025. )
  2026. );
  2027. CExtEditWithBehavior::CBehaviorMasked::CharRuleArray & _arrRules = pCellStringMasked->GetSymbolArray();
  2028. _arrRules.Add( _rule1 );
  2029. _arrRules.Add( _rule2 );
  2030. _arrRules.Add( _rule3 );
  2031. }
  2032. CExtGridCellStringMasked * pCellStringMasked0 = STATIC_DOWNCAST( CExtGridCellStringMasked, m_wndGrid.GridCellGet( nColNo, 0L ) );
  2033. pCellStringMasked0->MaskSet( _T("($)$$ ####-@@@@ ($$y$$)") );
  2034. pCellStringMasked0->TextSet( _T("(_)__ ____-____ (__y__)") );
  2035. pCellStringMasked0->NullableModeSet( true );
  2036. CExtGridCellStringMasked * pCellStringMasked1 = STATIC_DOWNCAST( CExtGridCellStringMasked, m_wndGrid.GridCellGet( nColNo, 1L ) );
  2037. pCellStringMasked1->MaskSet( _T("(####)-##-####-###") );
  2038. pCellStringMasked1->TextSet( _T("(____)-__-____-___") );
  2039. pCellStringMasked1->NullableModeSet( false );
  2040. CExtGridCellStringMasked * pCellStringMasked2 = STATIC_DOWNCAST( CExtGridCellStringMasked, m_wndGrid.GridCellGet( nColNo, 2L ) );
  2041. pCellStringMasked2->MaskSet( _T("AnyChars-$$$$-ThenNumber-####") );
  2042. pCellStringMasked2->TextSet( _T("AnyChars-____-ThenNumber-____") );
  2043. pCellStringMasked2->InsertModeSet( false );
  2044. CExtGridCellStringMasked * pCellStringMasked3 = STATIC_DOWNCAST( CExtGridCellStringMasked, m_wndGrid.GridCellGet( nColNo, 3L ) );
  2045. pCellStringMasked3->MaskSet( _T("Number-###-ThenLetters-@@@@@") );
  2046. pCellStringMasked3->TextSet( _T("Number-___-ThenLetters-_____") );
  2047. CExtGridCellStringMasked * pCellStringMasked4 = STATIC_DOWNCAST( CExtGridCellStringMasked, m_wndGrid.GridCellGet( nColNo, 4L ) );
  2048. pCellStringMasked4->MaskSet( _T("Tel. (###) ### ## ##") );
  2049. pCellStringMasked4->TextSet( _T("Tel. (^^^) ^^^ ^^ ^^") );
  2050. pCellStringMasked4->NullCharSet( _T('^') );
  2051. pCellStringMasked4->InsertModeSet( false );
  2052. CExtGridCellStringMasked * pCellStringMasked5 = STATIC_DOWNCAST( CExtGridCellStringMasked, m_wndGrid.GridCellGet( nColNo, 5L ) );
  2053. pCellStringMasked5->MaskSet( _T("Postal index: ## ###") );
  2054. pCellStringMasked5->TextSet( _T("Postal index: xx xxx") );
  2055. pCellStringMasked5->NullCharSet( _T('x') );
  2056. CExtGridCellStringMasked * pCellStringMasked6 = STATIC_DOWNCAST( CExtGridCellStringMasked, m_wndGrid.GridCellGet( nColNo, 6L ) );
  2057. pCellStringMasked6->MaskSet( _T("Date: ## / ## / ####") );
  2058. pCellStringMasked6->TextSet( _T("Date: -- / -- / ----") );
  2059. pCellStringMasked6->NullCharSet( _T('-') );
  2060. CExtGridCellStringMasked * pCellStringMasked7 = STATIC_DOWNCAST( CExtGridCellStringMasked, m_wndGrid.GridCellGet( nColNo, 7L ) );
  2061. pCellStringMasked7->MaskSet( _T("Five letter code: @@@@@") );
  2062. pCellStringMasked7->TextSet( _T("Five letter code: *****") );
  2063. pCellStringMasked7->NullCharSet( _T('*') );
  2064. CExtGridCellStringMasked * pCellStringMasked8 = STATIC_DOWNCAST( CExtGridCellStringMasked, m_wndGrid.GridCellGet( nColNo, 8L ) );
  2065. pCellStringMasked8->MaskSet( _T("Number is ##") );
  2066. pCellStringMasked8->TextSet( _T("Number is ~~") );
  2067. pCellStringMasked8->ModifyStyle( __EGCS_TA_HORZ_RIGHT );
  2068. pCellStringMasked8->NullCharSet( _T('~') );
  2069. CExtGridCellStringMasked * pCellStringMasked9 = STATIC_DOWNCAST( CExtGridCellStringMasked, m_wndGrid.GridCellGet( nColNo, 9L ) );
  2070. pCellStringMasked9->MaskSet( _T("C++ ? # : #") );
  2071. pCellStringMasked9->TextSet( _T("C++ ? 1 : 0") );
  2072. pCellStringMasked9->ModifyStyle( __EGCS_TA_HORZ_CENTER );
  2073. }
  2074. void CPageGrid::_InitColumnSystemNumber( LONG nColNo, LONG nRowCount )
  2075. {
  2076. ASSERT_VALID( this );
  2077. ASSERT_VALID( &m_wndGrid );
  2078. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  2079. {
  2080. CExtGridCellSystemNumber * pCellSystemNumber =
  2081. STATIC_DOWNCAST(
  2082. CExtGridCellSystemNumber,
  2083. m_wndGrid.GridCellGet( nColNo, nRowNo, 0, 0, RUNTIME_CLASS(CExtGridCellSystemNumber) )
  2084. );
  2085. pCellSystemNumber->ModifyStyleEx( __EGCS_EX_INPLACE_RICH_EDIT );
  2086. pCellSystemNumber->LongDoubleSet( ((long double)::rand()) + ((long double)::rand())/1000 );
  2087. pCellSystemNumber->NumberColorSet( RGB(80,80,164) );
  2088. pCellSystemNumber->FractionColorSet( RGB(80,164,80) );
  2089. pCellSystemNumber->GroupSeparatorColorSet( RGB(128,128,128) );
  2090. pCellSystemNumber->DecimalSeparatorColorSet( RGB(128,128,128) );
  2091. pCellSystemNumber->SignColorSet( RGB(192,0,0) );
  2092. pCellSystemNumber->BracketsColorSet( RGB(164,164,164) );
  2093. }
  2094. }
  2095. void CPageGrid::_InitColumnSystemCurrency( LONG nColNo, LONG nRowCount )
  2096. {
  2097. ASSERT_VALID( this );
  2098. ASSERT_VALID( &m_wndGrid );
  2099. for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
  2100. {
  2101. CExtGridCellSystemCurrency * pCellSystemCurrency =
  2102. STATIC_DOWNCAST(
  2103. CExtGridCellSystemCurrency,
  2104. m_wndGrid.GridCellGet( nColNo, nRowNo, 0, 0, RUNTIME_CLASS(CExtGridCellSystemCurrency) )
  2105. );
  2106. pCellSystemCurrency->ModifyStyleEx( __EGCS_EX_INPLACE_RICH_EDIT );
  2107. pCellSystemCurrency->LongDoubleSet( ((long double)::rand()) + ((long double)::rand())/1000 );
  2108. pCellSystemCurrency->NumberColorSet( RGB(80,80,164) );
  2109. pCellSystemCurrency->FractionColorSet( RGB(80,164,80) );
  2110. pCellSystemCurrency->GroupSeparatorColorSet( RGB(128,128,128) );
  2111. pCellSystemCurrency->DecimalSeparatorColorSet( RGB(128,128,128) );
  2112. pCellSystemCurrency->SignColorSet( RGB(192,0,0) );
  2113. pCellSystemCurrency->BracketsColorSet( RGB(164,164,164) );
  2114. }
  2115. }
  2116. void CPageGrid::OnTimer( __EXT_MFC_UINT_PTR nIDEvent )
  2117. {
  2118. if( nIDEvent == 987 )
  2119. {
  2120. if( IsWindowVisible() )
  2121. {
  2122. if( m_wndGrid.IsPrintPreviewMode() )
  2123. m_wndGrid.SendMessage( WM_IDLEUPDATECMDUI, 1 );
  2124. else
  2125. for( LONG nRowNo = 0L; nRowNo < 10L; nRowNo++ ) 
  2126. {
  2127. CExtGridCellProgress * pCellProgress =
  2128. STATIC_DOWNCAST(
  2129. CExtGridCellProgress ,
  2130. m_wndGrid.GridCellGet(
  2131. __COLUMN_NUM_PROGRESS,
  2132. nRowNo
  2133. )
  2134. );
  2135. if( pCellProgress != NULL )
  2136. {
  2137. pCellProgress->StepIt();
  2138. CRect rcCellExtra;    
  2139. if( m_wndGrid.GridCellRectsGet( __COLUMN_NUM_PROGRESS, nRowNo, 0, 0, NULL, &rcCellExtra ) )
  2140. m_wndGrid.InvalidateRect( &rcCellExtra );
  2141. }
  2142. }
  2143. }
  2144. return;
  2145. }
  2146. CPageBase::OnTimer(nIDEvent);
  2147. }
  2148. BOOL CPageGrid::OnCmdMsg(UINT nID, INT nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
  2149. {
  2150. if( m_wndGrid.OnCmdMsg( nID, nCode, pExtra, pHandlerInfo) )
  2151. return TRUE;
  2152. if( nCode == CN_COMMAND )
  2153. {
  2154. LONG nColNo = -1L;
  2155. switch( nID )
  2156. {
  2157. case IDC_CELL_BOOLEAN:
  2158. nColNo = __COLUMN_NUM_BOOLEAN;
  2159. break;
  2160. case IDC_CELL_CHECKBOX:
  2161. nColNo = __COLUMN_NUM_CHECKBOX;
  2162. break;
  2163. case IDC_CELL_CHECKCOMBOBOX:
  2164. nColNo = __COLUMN_NUM_CHECKCOMBOBOX;
  2165. break;
  2166. case IDC_CELL_COLOR:
  2167. nColNo = __COLUMN_NUM_COLOR;
  2168. break;
  2169. case IDC_CELL_COLORPART:
  2170. nColNo = __COLUMN_NUM_COLORPART;
  2171. break;
  2172. case IDC_CELL_COMBOBOX:
  2173. nColNo = __COLUMN_NUM_COMBOBOX;
  2174. break;
  2175. case IDC_CELL_CURRENCY:
  2176. nColNo = __COLUMN_NUM_CURRENCY;
  2177. break;
  2178. case IDC_CELL_DATETIME:
  2179. nColNo = __COLUMN_NUM_DATETIME;
  2180. break;
  2181. case IDC_CELL_DURATION:
  2182. nColNo = __COLUMN_NUM_DURATION;
  2183. break;
  2184. case IDC_CELL_FILE:
  2185. nColNo = __COLUMN_NUM_FILE;
  2186. break;
  2187. case IDC_CELL_FILEIMAGE:
  2188. nColNo = __COLUMN_NUM_FILEIMAGE;
  2189. break;
  2190. case IDC_CELL_FOLDER:
  2191. nColNo = __COLUMN_NUM_FOLDER;
  2192. break;
  2193. case IDC_CELL_FONT:
  2194. nColNo = __COLUMN_NUM_FONT;
  2195. break;
  2196. case IDC_CELL_FONTFACENAME:
  2197. nColNo = __COLUMN_NUM_FONTFACENAME;
  2198. break;
  2199. case IDC_CELL_FONTWEIGHT:
  2200. nColNo = __COLUMN_NUM_FONTWEIGHT;
  2201. break;
  2202. case IDC_CELL_FRACTION:
  2203. nColNo = __COLUMN_NUM_FRACTION;
  2204. break;
  2205. case IDC_CELL_HYPERLINK:
  2206. nColNo = __COLUMN_NUM_HYPERLINK;
  2207. break;
  2208. case IDC_CELL_IPADDRESS:
  2209. nColNo = __COLUMN_NUM_IPADDRESS;
  2210. break;
  2211. case IDC_CELL_NUMBER:
  2212. nColNo = __COLUMN_NUM_NUMBER;
  2213. break;
  2214. case IDC_CELL_PASSWORD:
  2215. nColNo = __COLUMN_NUM_PASSWORD;
  2216. break;
  2217. case IDC_CELL_PERCENTAGE:
  2218. nColNo = __COLUMN_NUM_PERCENTAGE;
  2219. break;
  2220. case IDC_CELL_PICTURE:
  2221. nColNo = __COLUMN_NUM_PICTURE;
  2222. break;
  2223. case IDC_CELL_PROGRESS:
  2224. nColNo = __COLUMN_NUM_PROGRESS;
  2225. break;
  2226. case IDC_CELL_RADIOBUTTON:
  2227. nColNo = __COLUMN_NUM_RADIOBUTTON;
  2228. break;
  2229. case IDC_CELL_RECTPART:
  2230. nColNo = __COLUMN_NUM_RECTPART;
  2231. break;
  2232. case IDC_CELL_INPLACE_SLIDER:
  2233. nColNo = __COLUMN_NUM_INPLACE_SLIDER;
  2234. break;
  2235. case IDC_CELL_INPLACE_SCROLLBAR:
  2236. nColNo = __COLUMN_NUM_INPLACE_SCROLLBAR;
  2237. break;
  2238. case IDC_CELL_SCIENTIFIC:
  2239. nColNo = __COLUMN_NUM_SCIENTIFIC;
  2240. break;
  2241. case IDC_CELL_SLIDER:
  2242. nColNo = __COLUMN_NUM_SLIDER;
  2243. break;
  2244. case IDC_CELL_TEXT:
  2245. nColNo = __COLUMN_NUM_TEXT;
  2246. break;
  2247. case IDC_CELL_UPDOWN:
  2248. nColNo = __COLUMN_NUM_UPDOWN;
  2249. break;
  2250. case IDC_CELL_VARIANT:
  2251. nColNo = __COLUMN_NUM_VARIANT;
  2252. break;
  2253. case IDC_CELL_HOTKEY:
  2254. nColNo = __COLUMN_NUM_HOTKEY;
  2255. break;
  2256. case IDC_CELL_BUTTON:
  2257. nColNo = __COLUMN_NUM_BUTTON;
  2258. break;
  2259. case IDC_CELL_OBJECT_SIZE:
  2260. nColNo = __COLUMN_NUM_OBJECT_SIZE;
  2261. break;
  2262. case IDC_CELL_GEOGRAPHIC:
  2263. nColNo = __COLUMN_NUM_GEOGRAPHIC;
  2264. break;
  2265. case IDC_CELL_MASKED_STRING:
  2266. nColNo = __COLUMN_NUM_MASKED_STRING;
  2267. break;
  2268. case IDC_CELL_SYSTEM_NUMBER:
  2269. nColNo = __COLUMN_NUM_SYSTEM_NUMBER;
  2270. break;
  2271. case IDC_CELL_SYSTEM_CURRENCY:
  2272. nColNo = __COLUMN_NUM_SYSTEM_CURRENCY;
  2273. break;
  2274. default:
  2275. return CPageBase::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
  2276. }
  2277. if( nColNo >= 0L 
  2278. && m_wndGrid.m_hWnd != NULL
  2279. && ::IsWindow( m_wndGrid.m_hWnd )
  2280. )
  2281. {
  2282. m_wndGrid.FocusSet( CPoint( nColNo, 0 ), true, true, true, false );
  2283. m_wndGrid.SelectionSet( CRect( nColNo, 0, nColNo, m_wndGrid.RowCountGet() - 1 ), true, true, true );
  2284. m_wndGrid.SetFocus();
  2285. }
  2286. return TRUE;
  2287. }
  2288. return CPageBase::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
  2289. }
  2290. #endif // #if (!defined __EXT_MFC_NO_GRIDWND)