TabControlProperties.cpp 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. //-----------------------------------------------------------------------------
  24. //
  25. // Westwood Studios Pacific.
  26. //
  27. // Confidential Information
  28. // Copyright (C) 2001 - All Rights Reserved
  29. //
  30. //-----------------------------------------------------------------------------
  31. //
  32. // Project: GUIEdit
  33. //
  34. // File name: C:\projects\RTS\code\Tools\GUIEdit\Source\Dialog Procedures\TabControlProperties.cpp
  35. //
  36. // Created: Graham Smallwood, November 2001
  37. //
  38. // Desc: Tab Control properties
  39. //
  40. //-----------------------------------------------------------------------------
  41. ///////////////////////////////////////////////////////////////////////////////
  42. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  43. #include <stdlib.h>
  44. #include <stdio.h>
  45. // USER INCLUDES //////////////////////////////////////////////////////////////
  46. #include "Common/NameKeyGenerator.h"
  47. #include "GameClient/GameWindowManager.h"
  48. #include "GUIEdit.h"
  49. #include "HierarchyView.h"
  50. #include "Properties.h"
  51. #include "Resource.h"
  52. #include "GameClient/GadgetTabControl.h"
  53. #include "GameClient/Gadget.h"
  54. // DEFINES ////////////////////////////////////////////////////////////////////
  55. // PRIVATE TYPES //////////////////////////////////////////////////////////////
  56. ///////////////////////////////////////////////////////////////////////////////
  57. // PRIVATE DATA ///////////////////////////////////////////////////////////////
  58. ///////////////////////////////////////////////////////////////////////////////
  59. // PUBLIC DATA ////////////////////////////////////////////////////////////////
  60. // PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
  61. ///////////////////////////////////////////////////////////////////////////////
  62. // PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
  63. ///////////////////////////////////////////////////////////////////////////////
  64. ///< Pane names are derived off the Tab Control's name.
  65. static void GadgetTabControlUpdatePaneNames( GameWindow *tabControl )
  66. {
  67. TabControlData *tabData = (TabControlData *)tabControl->winGetUserData();
  68. WinInstanceData *controlInstData = tabControl->winGetInstanceData();
  69. for( Int paneIndex = 0; paneIndex < NUM_TAB_PANES; paneIndex++ )
  70. {
  71. WinInstanceData *paneInstData = tabData->subPanes[paneIndex]->winGetInstanceData();
  72. char buffer[128];//legal limit is 64, which will be checked at save.
  73. sprintf( buffer, "%s Pane %d", controlInstData->m_decoratedNameString.str() ,paneIndex );
  74. paneInstData->m_decoratedNameString = buffer;
  75. if( TheHierarchyView )
  76. TheHierarchyView->updateWindowName( tabData->subPanes[paneIndex] );
  77. }
  78. }
  79. // radioButtonPropertiesCallback ==============================================
  80. /** Dialog callback for properties */
  81. //=============================================================================
  82. static LRESULT CALLBACK tabControlPropertiesCallback( HWND hWndDialog,
  83. UINT message,
  84. WPARAM wParam,
  85. LPARAM lParam )
  86. {
  87. Int returnCode;
  88. //
  89. // handle any common messages between all property dialogs cause they
  90. // are designed to have controls doing the same functionality
  91. // and names
  92. //
  93. if( HandleCommonDialogMessages( hWndDialog, message,
  94. wParam, lParam, &returnCode ) == TRUE )
  95. return returnCode;
  96. switch( message )
  97. {
  98. // ------------------------------------------------------------------------
  99. case WM_COMMAND:
  100. {
  101. // Int notifyCode = HIWORD( wParam ); // notification code
  102. Int controlID = LOWORD( wParam ); // control ID
  103. // HWND hWndControl = (HWND)lParam; // control window handle
  104. switch( controlID )
  105. {
  106. // --------------------------------------------------------------------
  107. case IDOK:
  108. {
  109. GameWindow *tabControl = TheEditor->getPropertyTarget();
  110. // sanity
  111. if( tabControl )
  112. {
  113. // save the common properties
  114. if( SaveCommonDialogProperties( hWndDialog, tabControl ) == FALSE )
  115. break;
  116. ImageAndColorInfo *info;
  117. info = GetStateInfo( TC_TAB_0_ENABLED );
  118. GadgetTabControlSetEnabledImageTabZero( tabControl, info->image );
  119. GadgetTabControlSetEnabledColorTabZero( tabControl, info->color );
  120. GadgetTabControlSetEnabledBorderColorTabZero( tabControl, info->borderColor );
  121. info = GetStateInfo( TC_TAB_1_ENABLED );
  122. GadgetTabControlSetEnabledImageTabOne( tabControl, info->image );
  123. GadgetTabControlSetEnabledColorTabOne( tabControl, info->color );
  124. GadgetTabControlSetEnabledBorderColorTabOne( tabControl, info->borderColor );
  125. info = GetStateInfo( TC_TAB_2_ENABLED );
  126. GadgetTabControlSetEnabledImageTabTwo( tabControl, info->image );
  127. GadgetTabControlSetEnabledColorTabTwo( tabControl, info->color );
  128. GadgetTabControlSetEnabledBorderColorTabTwo( tabControl, info->borderColor );
  129. info = GetStateInfo( TC_TAB_3_ENABLED );
  130. GadgetTabControlSetEnabledImageTabThree( tabControl, info->image );
  131. GadgetTabControlSetEnabledColorTabThree( tabControl, info->color );
  132. GadgetTabControlSetEnabledBorderColorTabThree( tabControl, info->borderColor );
  133. info = GetStateInfo( TC_TAB_4_ENABLED );
  134. GadgetTabControlSetEnabledImageTabFour( tabControl, info->image );
  135. GadgetTabControlSetEnabledColorTabFour( tabControl, info->color );
  136. GadgetTabControlSetEnabledBorderColorTabFour( tabControl, info->borderColor );
  137. info = GetStateInfo( TC_TAB_5_ENABLED );
  138. GadgetTabControlSetEnabledImageTabFive( tabControl, info->image );
  139. GadgetTabControlSetEnabledColorTabFive( tabControl, info->color );
  140. GadgetTabControlSetEnabledBorderColorTabFive( tabControl, info->borderColor );
  141. info = GetStateInfo( TC_TAB_6_ENABLED );
  142. GadgetTabControlSetEnabledImageTabSix( tabControl, info->image );
  143. GadgetTabControlSetEnabledColorTabSix( tabControl, info->color );
  144. GadgetTabControlSetEnabledBorderColorTabSix( tabControl, info->borderColor );
  145. info = GetStateInfo( TC_TAB_7_ENABLED );
  146. GadgetTabControlSetEnabledImageTabSeven( tabControl, info->image );
  147. GadgetTabControlSetEnabledColorTabSeven( tabControl, info->color );
  148. GadgetTabControlSetEnabledBorderColorTabSeven( tabControl, info->borderColor );
  149. info = GetStateInfo( TAB_CONTROL_ENABLED );
  150. GadgetTabControlSetEnabledImageBackground( tabControl, info->image );
  151. GadgetTabControlSetEnabledColorBackground( tabControl, info->color );
  152. GadgetTabControlSetEnabledBorderColorBackground( tabControl, info->borderColor );
  153. info = GetStateInfo( TC_TAB_0_DISABLED );
  154. GadgetTabControlSetDisabledImageTabZero( tabControl, info->image );
  155. GadgetTabControlSetDisabledColorTabZero( tabControl, info->color );
  156. GadgetTabControlSetDisabledBorderColorTabZero( tabControl, info->borderColor );
  157. info = GetStateInfo( TC_TAB_1_DISABLED );
  158. GadgetTabControlSetDisabledImageTabOne( tabControl, info->image );
  159. GadgetTabControlSetDisabledColorTabOne( tabControl, info->color );
  160. GadgetTabControlSetDisabledBorderColorTabOne( tabControl, info->borderColor );
  161. info = GetStateInfo( TC_TAB_2_DISABLED );
  162. GadgetTabControlSetDisabledImageTabTwo( tabControl, info->image );
  163. GadgetTabControlSetDisabledColorTabTwo( tabControl, info->color );
  164. GadgetTabControlSetDisabledBorderColorTabTwo( tabControl, info->borderColor );
  165. info = GetStateInfo( TC_TAB_3_DISABLED );
  166. GadgetTabControlSetDisabledImageTabThree( tabControl, info->image );
  167. GadgetTabControlSetDisabledColorTabThree( tabControl, info->color );
  168. GadgetTabControlSetDisabledBorderColorTabThree( tabControl, info->borderColor );
  169. info = GetStateInfo( TC_TAB_4_DISABLED );
  170. GadgetTabControlSetDisabledImageTabFour( tabControl, info->image );
  171. GadgetTabControlSetDisabledColorTabFour( tabControl, info->color );
  172. GadgetTabControlSetDisabledBorderColorTabFour( tabControl, info->borderColor );
  173. info = GetStateInfo( TC_TAB_5_DISABLED );
  174. GadgetTabControlSetDisabledImageTabFive( tabControl, info->image );
  175. GadgetTabControlSetDisabledColorTabFive( tabControl, info->color );
  176. GadgetTabControlSetDisabledBorderColorTabFive( tabControl, info->borderColor );
  177. info = GetStateInfo( TC_TAB_6_DISABLED );
  178. GadgetTabControlSetDisabledImageTabSix( tabControl, info->image );
  179. GadgetTabControlSetDisabledColorTabSix( tabControl, info->color );
  180. GadgetTabControlSetDisabledBorderColorTabSix( tabControl, info->borderColor );
  181. info = GetStateInfo( TC_TAB_7_DISABLED );
  182. GadgetTabControlSetDisabledImageTabSeven( tabControl, info->image );
  183. GadgetTabControlSetDisabledColorTabSeven( tabControl, info->color );
  184. GadgetTabControlSetDisabledBorderColorTabSeven( tabControl, info->borderColor );
  185. info = GetStateInfo( TAB_CONTROL_DISABLED );
  186. GadgetTabControlSetDisabledImageBackground( tabControl, info->image );
  187. GadgetTabControlSetDisabledColorBackground( tabControl, info->color );
  188. GadgetTabControlSetDisabledBorderColorBackground( tabControl, info->borderColor );
  189. info = GetStateInfo( TC_TAB_0_HILITE );
  190. GadgetTabControlSetHiliteImageTabZero( tabControl, info->image );
  191. GadgetTabControlSetHiliteColorTabZero( tabControl, info->color );
  192. GadgetTabControlSetHiliteBorderColorTabZero( tabControl, info->borderColor );
  193. info = GetStateInfo( TC_TAB_1_HILITE );
  194. GadgetTabControlSetHiliteImageTabOne( tabControl, info->image );
  195. GadgetTabControlSetHiliteColorTabOne( tabControl, info->color );
  196. GadgetTabControlSetHiliteBorderColorTabOne( tabControl, info->borderColor );
  197. info = GetStateInfo( TC_TAB_2_HILITE );
  198. GadgetTabControlSetHiliteImageTabTwo( tabControl, info->image );
  199. GadgetTabControlSetHiliteColorTabTwo( tabControl, info->color );
  200. GadgetTabControlSetHiliteBorderColorTabTwo( tabControl, info->borderColor );
  201. info = GetStateInfo( TC_TAB_3_HILITE );
  202. GadgetTabControlSetHiliteImageTabThree( tabControl, info->image );
  203. GadgetTabControlSetHiliteColorTabThree( tabControl, info->color );
  204. GadgetTabControlSetHiliteBorderColorTabThree( tabControl, info->borderColor );
  205. info = GetStateInfo( TC_TAB_4_HILITE );
  206. GadgetTabControlSetHiliteImageTabFour( tabControl, info->image );
  207. GadgetTabControlSetHiliteColorTabFour( tabControl, info->color );
  208. GadgetTabControlSetHiliteBorderColorTabFour( tabControl, info->borderColor );
  209. info = GetStateInfo( TC_TAB_5_HILITE );
  210. GadgetTabControlSetHiliteImageTabFive( tabControl, info->image );
  211. GadgetTabControlSetHiliteColorTabFive( tabControl, info->color );
  212. GadgetTabControlSetHiliteBorderColorTabFive( tabControl, info->borderColor );
  213. info = GetStateInfo( TC_TAB_6_HILITE );
  214. GadgetTabControlSetHiliteImageTabSix( tabControl, info->image );
  215. GadgetTabControlSetHiliteColorTabSix( tabControl, info->color );
  216. GadgetTabControlSetHiliteBorderColorTabSix( tabControl, info->borderColor );
  217. info = GetStateInfo( TC_TAB_7_HILITE );
  218. GadgetTabControlSetHiliteImageTabSeven( tabControl, info->image );
  219. GadgetTabControlSetHiliteColorTabSeven( tabControl, info->color );
  220. GadgetTabControlSetHiliteBorderColorTabSeven( tabControl, info->borderColor );
  221. info = GetStateInfo( TAB_CONTROL_HILITE );
  222. GadgetTabControlSetHiliteImageBackground( tabControl, info->image );
  223. GadgetTabControlSetHiliteColorBackground( tabControl, info->color );
  224. GadgetTabControlSetHiliteBorderColorBackground( tabControl, info->borderColor );
  225. TabControlData *tabData = (TabControlData *)tabControl->winGetUserData();
  226. tabData->tabWidth = GetDlgItemInt( hWndDialog, TAB_WIDTH, NULL, FALSE );
  227. tabData->tabHeight = GetDlgItemInt(hWndDialog, TAB_HEIGHT, NULL, FALSE );
  228. tabData->tabCount = GetDlgItemInt(hWndDialog, TAB_COUNT, NULL, FALSE );
  229. tabData->paneBorder = GetDlgItemInt(hWndDialog, BORDER_WIDTH, NULL, FALSE );
  230. tabData->activeTab = GetDlgItemInt(hWndDialog, ACTIVE_TAB, NULL, FALSE );
  231. if( IsDlgButtonChecked( hWndDialog, DISABLE_TAB_0 ) )
  232. tabData->subPaneDisabled[0] = TRUE;
  233. else
  234. tabData->subPaneDisabled[0] = FALSE;
  235. if( IsDlgButtonChecked( hWndDialog, DISABLE_TAB_1 ) )
  236. tabData->subPaneDisabled[1] = TRUE;
  237. else
  238. tabData->subPaneDisabled[1] = FALSE;
  239. if( IsDlgButtonChecked( hWndDialog, DISABLE_TAB_2 ) )
  240. tabData->subPaneDisabled[2] = TRUE;
  241. else
  242. tabData->subPaneDisabled[2] = FALSE;
  243. if( IsDlgButtonChecked( hWndDialog, DISABLE_TAB_3 ) )
  244. tabData->subPaneDisabled[3] = TRUE;
  245. else
  246. tabData->subPaneDisabled[3] = FALSE;
  247. if( IsDlgButtonChecked( hWndDialog, DISABLE_TAB_4 ) )
  248. tabData->subPaneDisabled[4] = TRUE;
  249. else
  250. tabData->subPaneDisabled[4] = FALSE;
  251. if( IsDlgButtonChecked( hWndDialog, DISABLE_TAB_5 ) )
  252. tabData->subPaneDisabled[5] = TRUE;
  253. else
  254. tabData->subPaneDisabled[5] = FALSE;
  255. if( IsDlgButtonChecked( hWndDialog, DISABLE_TAB_6 ) )
  256. tabData->subPaneDisabled[6] = TRUE;
  257. else
  258. tabData->subPaneDisabled[6] = FALSE;
  259. if( IsDlgButtonChecked( hWndDialog, DISABLE_TAB_7 ) )
  260. tabData->subPaneDisabled[7] = TRUE;
  261. else
  262. tabData->subPaneDisabled[7] = FALSE;
  263. if( IsDlgButtonChecked( hWndDialog, LEFT_JUSTIFY) )
  264. tabData->tabOrientation = TP_TOPLEFT;
  265. else if( IsDlgButtonChecked( hWndDialog, CENTER_JUSTIFY ) )
  266. tabData->tabOrientation = TP_CENTER;
  267. else if( IsDlgButtonChecked( hWndDialog, RIGHT_JUSTIFY ) )
  268. tabData->tabOrientation = TP_BOTTOMRIGHT;
  269. if( IsDlgButtonChecked( hWndDialog, TOP_SIDE ) )
  270. tabData->tabEdge = TP_TOP_SIDE;
  271. else if( IsDlgButtonChecked( hWndDialog, RIGHT_SIDE ) )
  272. tabData->tabEdge = TP_RIGHT_SIDE;
  273. else if( IsDlgButtonChecked( hWndDialog, LEFT_SIDE ) )
  274. tabData->tabEdge = TP_LEFT_SIDE;
  275. else if( IsDlgButtonChecked( hWndDialog, BOTTOM_SIDE ) )
  276. tabData->tabEdge = TP_BOTTOM_SIDE;
  277. //safeties
  278. tabData->tabCount = max( tabData->tabCount, 1 );
  279. tabData->tabCount = min( tabData->tabCount, NUM_TAB_PANES );
  280. GadgetTabControlComputeTabRegion( tabControl );
  281. GadgetTabControlResizeSubPanes( tabControl );
  282. GadgetTabControlShowSubPane( tabControl, tabData->activeTab );
  283. GadgetTabControlUpdatePaneNames( tabControl );
  284. } // end if
  285. DestroyWindow( hWndDialog );
  286. break;
  287. } // end OK
  288. // --------------------------------------------------------------------
  289. case IDCANCEL:
  290. {
  291. DestroyWindow( hWndDialog );
  292. break;
  293. } // end cancel
  294. } // end switch( LOWORD( wParam ) )
  295. return 0;
  296. } // end of WM_COMMAND
  297. // ------------------------------------------------------------------------
  298. case WM_CLOSE:
  299. {
  300. DestroyWindow( hWndDialog );
  301. return 0;
  302. } // end close
  303. // ------------------------------------------------------------------------
  304. default:
  305. return 0;
  306. } // end of switch
  307. } // end tabControlPropertiesCallback
  308. ///////////////////////////////////////////////////////////////////////////////
  309. // PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
  310. ///////////////////////////////////////////////////////////////////////////////
  311. // InitTabControlPropertiesDialog ============================================
  312. /** Bring up the tab control properties dialog */
  313. //=============================================================================
  314. HWND InitTabControlPropertiesDialog( GameWindow *tabControl )
  315. {
  316. HWND dialog;
  317. // create the dialog box
  318. dialog = CreateDialog( TheEditor->getInstance(),
  319. (LPCTSTR)TAB_CONTROL_PROPERTIES_DIALOG,
  320. TheEditor->getWindowHandle(),
  321. (DLGPROC)tabControlPropertiesCallback );
  322. if( dialog == NULL )
  323. return NULL;
  324. // do the common initialization
  325. CommonDialogInitialize( tabControl, dialog );
  326. //
  327. // store in the image and color table the values for this button
  328. //
  329. const Image *image;
  330. Color color, borderColor;
  331. image = GadgetTabControlGetEnabledImageTabZero( tabControl );
  332. color = GadgetTabControlGetEnabledColorTabZero( tabControl );
  333. borderColor = GadgetTabControlGetEnabledBorderColorTabZero( tabControl );
  334. StoreImageAndColor( TC_TAB_0_ENABLED, image, color, borderColor );
  335. image = GadgetTabControlGetEnabledImageTabOne( tabControl );
  336. color = GadgetTabControlGetEnabledColorTabOne( tabControl );
  337. borderColor = GadgetTabControlGetEnabledBorderColorTabOne( tabControl );
  338. StoreImageAndColor( TC_TAB_1_ENABLED, image, color, borderColor );
  339. image = GadgetTabControlGetEnabledImageTabTwo( tabControl );
  340. color = GadgetTabControlGetEnabledColorTabTwo( tabControl );
  341. borderColor = GadgetTabControlGetEnabledBorderColorTabTwo( tabControl );
  342. StoreImageAndColor( TC_TAB_2_ENABLED, image, color, borderColor );
  343. image = GadgetTabControlGetEnabledImageTabThree( tabControl );
  344. color = GadgetTabControlGetEnabledColorTabThree( tabControl );
  345. borderColor = GadgetTabControlGetEnabledBorderColorTabThree( tabControl );
  346. StoreImageAndColor( TC_TAB_3_ENABLED, image, color, borderColor );
  347. image = GadgetTabControlGetEnabledImageTabFour( tabControl );
  348. color = GadgetTabControlGetEnabledColorTabFour( tabControl );
  349. borderColor = GadgetTabControlGetEnabledBorderColorTabFour( tabControl );
  350. StoreImageAndColor( TC_TAB_4_ENABLED, image, color, borderColor );
  351. image = GadgetTabControlGetEnabledImageTabFive( tabControl );
  352. color = GadgetTabControlGetEnabledColorTabFive( tabControl );
  353. borderColor = GadgetTabControlGetEnabledBorderColorTabFive( tabControl );
  354. StoreImageAndColor( TC_TAB_5_ENABLED, image, color, borderColor );
  355. image = GadgetTabControlGetEnabledImageTabSix( tabControl );
  356. color = GadgetTabControlGetEnabledColorTabSix( tabControl );
  357. borderColor = GadgetTabControlGetEnabledBorderColorTabSix( tabControl );
  358. StoreImageAndColor( TC_TAB_6_ENABLED, image, color, borderColor );
  359. image = GadgetTabControlGetEnabledImageTabSeven( tabControl );
  360. color = GadgetTabControlGetEnabledColorTabSeven( tabControl );
  361. borderColor = GadgetTabControlGetEnabledBorderColorTabSeven( tabControl );
  362. StoreImageAndColor( TC_TAB_7_ENABLED, image, color, borderColor );
  363. image = GadgetTabControlGetEnabledImageBackground( tabControl );
  364. color = GadgetTabControlGetEnabledColorBackground( tabControl );
  365. borderColor = GadgetTabControlGetEnabledBorderColorBackground( tabControl );
  366. StoreImageAndColor( TAB_CONTROL_ENABLED, image, color, borderColor );
  367. image = GadgetTabControlGetDisabledImageTabZero( tabControl );
  368. color = GadgetTabControlGetDisabledColorTabZero( tabControl );
  369. borderColor = GadgetTabControlGetDisabledBorderColorTabZero( tabControl );
  370. StoreImageAndColor( TC_TAB_0_DISABLED, image, color, borderColor );
  371. image = GadgetTabControlGetDisabledImageTabOne( tabControl );
  372. color = GadgetTabControlGetDisabledColorTabOne( tabControl );
  373. borderColor = GadgetTabControlGetDisabledBorderColorTabOne( tabControl );
  374. StoreImageAndColor( TC_TAB_1_DISABLED, image, color, borderColor );
  375. image = GadgetTabControlGetDisabledImageTabTwo( tabControl );
  376. color = GadgetTabControlGetDisabledColorTabTwo( tabControl );
  377. borderColor = GadgetTabControlGetDisabledBorderColorTabTwo( tabControl );
  378. StoreImageAndColor( TC_TAB_2_DISABLED, image, color, borderColor );
  379. image = GadgetTabControlGetDisabledImageTabThree( tabControl );
  380. color = GadgetTabControlGetDisabledColorTabThree( tabControl );
  381. borderColor = GadgetTabControlGetDisabledBorderColorTabThree( tabControl );
  382. StoreImageAndColor( TC_TAB_3_DISABLED, image, color, borderColor );
  383. image = GadgetTabControlGetDisabledImageTabFour( tabControl );
  384. color = GadgetTabControlGetDisabledColorTabFour( tabControl );
  385. borderColor = GadgetTabControlGetDisabledBorderColorTabFour( tabControl );
  386. StoreImageAndColor( TC_TAB_4_DISABLED, image, color, borderColor );
  387. image = GadgetTabControlGetDisabledImageTabFive( tabControl );
  388. color = GadgetTabControlGetDisabledColorTabFive( tabControl );
  389. borderColor = GadgetTabControlGetDisabledBorderColorTabFive( tabControl );
  390. StoreImageAndColor( TC_TAB_5_DISABLED, image, color, borderColor );
  391. image = GadgetTabControlGetDisabledImageTabSix( tabControl );
  392. color = GadgetTabControlGetDisabledColorTabSix( tabControl );
  393. borderColor = GadgetTabControlGetDisabledBorderColorTabSix( tabControl );
  394. StoreImageAndColor( TC_TAB_6_DISABLED, image, color, borderColor );
  395. image = GadgetTabControlGetDisabledImageTabSeven( tabControl );
  396. color = GadgetTabControlGetDisabledColorTabSeven( tabControl );
  397. borderColor = GadgetTabControlGetDisabledBorderColorTabSeven( tabControl );
  398. StoreImageAndColor( TC_TAB_7_DISABLED, image, color, borderColor );
  399. image = GadgetTabControlGetDisabledImageBackground( tabControl );
  400. color = GadgetTabControlGetDisabledColorBackground( tabControl );
  401. borderColor = GadgetTabControlGetDisabledBorderColorBackground( tabControl );
  402. StoreImageAndColor( TAB_CONTROL_DISABLED, image, color, borderColor );
  403. image = GadgetTabControlGetHiliteImageTabZero( tabControl );
  404. color = GadgetTabControlGetHiliteColorTabZero( tabControl );
  405. borderColor = GadgetTabControlGetHiliteBorderColorTabZero( tabControl );
  406. StoreImageAndColor( TC_TAB_0_HILITE, image, color, borderColor );
  407. image = GadgetTabControlGetHiliteImageTabOne( tabControl );
  408. color = GadgetTabControlGetHiliteColorTabOne( tabControl );
  409. borderColor = GadgetTabControlGetHiliteBorderColorTabOne( tabControl );
  410. StoreImageAndColor( TC_TAB_1_HILITE, image, color, borderColor );
  411. image = GadgetTabControlGetHiliteImageTabTwo( tabControl );
  412. color = GadgetTabControlGetHiliteColorTabTwo( tabControl );
  413. borderColor = GadgetTabControlGetHiliteBorderColorTabTwo( tabControl );
  414. StoreImageAndColor( TC_TAB_2_HILITE, image, color, borderColor );
  415. image = GadgetTabControlGetHiliteImageTabThree( tabControl );
  416. color = GadgetTabControlGetHiliteColorTabThree( tabControl );
  417. borderColor = GadgetTabControlGetHiliteBorderColorTabThree( tabControl );
  418. StoreImageAndColor( TC_TAB_3_HILITE, image, color, borderColor );
  419. image = GadgetTabControlGetHiliteImageTabFour( tabControl );
  420. color = GadgetTabControlGetHiliteColorTabFour( tabControl );
  421. borderColor = GadgetTabControlGetHiliteBorderColorTabFour( tabControl );
  422. StoreImageAndColor( TC_TAB_4_HILITE, image, color, borderColor );
  423. image = GadgetTabControlGetHiliteImageTabFive( tabControl );
  424. color = GadgetTabControlGetHiliteColorTabFive( tabControl );
  425. borderColor = GadgetTabControlGetHiliteBorderColorTabFive( tabControl );
  426. StoreImageAndColor( TC_TAB_5_HILITE, image, color, borderColor );
  427. image = GadgetTabControlGetHiliteImageTabSix( tabControl );
  428. color = GadgetTabControlGetHiliteColorTabSix( tabControl );
  429. borderColor = GadgetTabControlGetHiliteBorderColorTabSix( tabControl );
  430. StoreImageAndColor( TC_TAB_6_HILITE, image, color, borderColor );
  431. image = GadgetTabControlGetHiliteImageTabSeven( tabControl );
  432. color = GadgetTabControlGetHiliteColorTabSeven( tabControl );
  433. borderColor = GadgetTabControlGetHiliteBorderColorTabSeven( tabControl );
  434. StoreImageAndColor( TC_TAB_7_HILITE, image, color, borderColor );
  435. image = GadgetTabControlGetHiliteImageBackground( tabControl );
  436. color = GadgetTabControlGetHiliteColorBackground( tabControl );
  437. borderColor = GadgetTabControlGetHiliteBorderColorBackground( tabControl );
  438. StoreImageAndColor( TAB_CONTROL_HILITE, image, color, borderColor );
  439. // tab data
  440. TabControlData *tabData = (TabControlData *)tabControl->winGetUserData();
  441. //
  442. // initialize the dialog with values from the window
  443. //
  444. SetDlgItemInt(dialog, TAB_WIDTH, tabData->tabWidth, FALSE);
  445. SetDlgItemInt(dialog, TAB_HEIGHT, tabData->tabHeight, FALSE);
  446. SetDlgItemInt(dialog, TAB_COUNT, tabData->tabCount, FALSE);
  447. SetDlgItemInt(dialog, BORDER_WIDTH, tabData->paneBorder, FALSE);
  448. SetDlgItemInt(dialog, ACTIVE_TAB, tabData->activeTab, FALSE);
  449. if( tabData->subPaneDisabled[0] )
  450. CheckDlgButton( dialog, DISABLE_TAB_0, BST_CHECKED );
  451. else
  452. CheckDlgButton( dialog, DISABLE_TAB_0, BST_UNCHECKED );
  453. if( tabData->subPaneDisabled[1] )
  454. CheckDlgButton( dialog, DISABLE_TAB_1, BST_CHECKED );
  455. else
  456. CheckDlgButton( dialog, DISABLE_TAB_1, BST_UNCHECKED );
  457. if( tabData->subPaneDisabled[2] )
  458. CheckDlgButton( dialog, DISABLE_TAB_2, BST_CHECKED );
  459. else
  460. CheckDlgButton( dialog, DISABLE_TAB_2, BST_UNCHECKED );
  461. if( tabData->subPaneDisabled[3] )
  462. CheckDlgButton( dialog, DISABLE_TAB_3, BST_CHECKED );
  463. else
  464. CheckDlgButton( dialog, DISABLE_TAB_3, BST_UNCHECKED );
  465. if( tabData->subPaneDisabled[4] )
  466. CheckDlgButton( dialog, DISABLE_TAB_4, BST_CHECKED );
  467. else
  468. CheckDlgButton( dialog, DISABLE_TAB_4, BST_UNCHECKED );
  469. if( tabData->subPaneDisabled[5] )
  470. CheckDlgButton( dialog, DISABLE_TAB_5, BST_CHECKED );
  471. else
  472. CheckDlgButton( dialog, DISABLE_TAB_5, BST_UNCHECKED );
  473. if( tabData->subPaneDisabled[6] )
  474. CheckDlgButton( dialog, DISABLE_TAB_6, BST_CHECKED );
  475. else
  476. CheckDlgButton( dialog, DISABLE_TAB_6, BST_UNCHECKED );
  477. if( tabData->subPaneDisabled[7] )
  478. CheckDlgButton( dialog, DISABLE_TAB_7, BST_CHECKED );
  479. else
  480. CheckDlgButton( dialog, DISABLE_TAB_7, BST_UNCHECKED );
  481. if( tabData->tabOrientation == TP_TOPLEFT )
  482. CheckDlgButton( dialog, LEFT_JUSTIFY, BST_CHECKED );
  483. else if( tabData->tabOrientation == TP_CENTER )
  484. CheckDlgButton( dialog, CENTER_JUSTIFY, BST_CHECKED );
  485. else if( tabData->tabOrientation == TP_BOTTOMRIGHT )
  486. CheckDlgButton( dialog, RIGHT_JUSTIFY, BST_CHECKED );
  487. if( tabData->tabEdge == TP_TOP_SIDE )
  488. CheckDlgButton( dialog, TOP_SIDE, BST_CHECKED );
  489. else if( tabData->tabEdge == TP_RIGHT_SIDE )
  490. CheckDlgButton( dialog, RIGHT_SIDE, BST_CHECKED );
  491. else if( tabData->tabEdge == TP_LEFT_SIDE )
  492. CheckDlgButton( dialog, LEFT_SIDE, BST_CHECKED );
  493. else if( tabData->tabEdge == TP_BOTTOM_SIDE )
  494. CheckDlgButton( dialog, BOTTOM_SIDE, BST_CHECKED );
  495. return dialog;
  496. } // end InitTabControlPropertiesDialog