ParameterCtrls.h 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  1. /*
  2. ** Command & Conquer Renegade(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. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : LevelEdit *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/LevelEdit/ParameterCtrls.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 1/22/01 3:14p $*
  29. * *
  30. * $Revision:: 25 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __PARAMETER_CTRLS_H
  39. #define __PARAMETER_CTRLS_H
  40. #include "presetpicker.h"
  41. #include "filepicker.h"
  42. #include "presetpicker.h"
  43. #include "stringpicker.h"
  44. #include "parameter.h"
  45. #include "simpleparameter.h"
  46. #include "ntree.h"
  47. #include "bittype.h"
  48. #include "definitionclassids.h"
  49. #include "icons.h"
  50. #include "combatchunkid.h"
  51. ///////////////////////////////////////////////////////////////////////
  52. // Forward declarations
  53. ///////////////////////////////////////////////////////////////////////
  54. class PresetClass;
  55. class SpecSheetClass;
  56. ///////////////////////////////////////////////////////////////////////
  57. //
  58. // ParameterCtrlClass
  59. //
  60. ///////////////////////////////////////////////////////////////////////
  61. class ParameterCtrlClass
  62. {
  63. public:
  64. ////////////////////////////////////////////////////////////////////
  65. // Public constructors/destructors
  66. ////////////////////////////////////////////////////////////////////
  67. ParameterCtrlClass (void)
  68. : m_IsTemp (false),
  69. m_IsReadOnly (false) { }
  70. virtual ~ParameterCtrlClass (void) { }
  71. ////////////////////////////////////////////////////////////////////
  72. // Public methods
  73. ////////////////////////////////////////////////////////////////////
  74. virtual ParameterClass::Type Get_Type (void) const = 0;
  75. virtual int Create (HWND parent_wnd, int id_start, LPRECT pos) = 0;
  76. virtual void Resize (const CRect &rect) = 0;
  77. virtual void Read_Data (HWND parent_wnd) { };
  78. virtual bool On_Command (HWND parent_wnd, WPARAM wparam, LPARAM lparam) { return false; }
  79. virtual bool On_DrawItem (HWND parent_wnd, WPARAM wparam, LPARAM lparam) { return false; }
  80. virtual void On_Destroy (void) { };
  81. virtual ParameterClass * Get_Parameter (void) const = 0;
  82. // Accessors
  83. bool Is_Temp (void) const { return m_IsTemp; }
  84. void Set_Is_Temp (bool is_temp) { m_IsTemp = is_temp; }
  85. bool Is_Read_Only (void) const { return m_IsReadOnly; }
  86. virtual void Set_Read_Only (bool onoff) { m_IsReadOnly = onoff; }
  87. virtual bool Is_Modified (void) const { return true; }
  88. virtual void Set_Spec_Sheet (SpecSheetClass *sheet) { m_SpecSheet = sheet; }
  89. virtual SpecSheetClass * Get_Spec_Sheet (void) const { return m_SpecSheet; }
  90. protected:
  91. ////////////////////////////////////////////////////////////////////
  92. // Protected member data
  93. ////////////////////////////////////////////////////////////////////
  94. bool m_IsTemp;
  95. bool m_IsReadOnly;
  96. SpecSheetClass * m_SpecSheet;
  97. };
  98. ///////////////////////////////////////////////////////////////////////
  99. //
  100. // StringParameterCtrlClass
  101. //
  102. ///////////////////////////////////////////////////////////////////////
  103. class StringParameterCtrlClass : public ParameterCtrlClass
  104. {
  105. public:
  106. ////////////////////////////////////////////////////////////////////
  107. // Public constructors/destructors
  108. ////////////////////////////////////////////////////////////////////
  109. StringParameterCtrlClass (StringParameterClass *param)
  110. : m_Parameter (param) { }
  111. virtual ~StringParameterCtrlClass (void) { }
  112. ////////////////////////////////////////////////////////////////////
  113. // Public methods
  114. ////////////////////////////////////////////////////////////////////
  115. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_STRING; }
  116. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  117. void Resize (const CRect &rect);
  118. void Read_Data (HWND parent_wnd);
  119. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  120. private:
  121. ////////////////////////////////////////////////////////////////////
  122. // Private member data
  123. ////////////////////////////////////////////////////////////////////
  124. CStatic m_StaticText;
  125. CEdit m_EditCtrl;
  126. StringParameterClass * m_Parameter;
  127. };
  128. ///////////////////////////////////////////////////////////////////////
  129. //
  130. // FileParameterCtrlClass
  131. //
  132. ///////////////////////////////////////////////////////////////////////
  133. class FileParameterCtrlClass : public ParameterCtrlClass
  134. {
  135. public:
  136. ////////////////////////////////////////////////////////////////////
  137. // Public constructors/destructors
  138. ////////////////////////////////////////////////////////////////////
  139. FileParameterCtrlClass (FilenameParameterClass *param)
  140. : m_Parameter (param) { }
  141. virtual ~FileParameterCtrlClass (void) { }
  142. ////////////////////////////////////////////////////////////////////
  143. // Public methods
  144. ////////////////////////////////////////////////////////////////////
  145. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_FILENAME; }
  146. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  147. void Resize (const CRect &rect);
  148. void Read_Data (HWND parent_wnd);
  149. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  150. void Get_Current_Value (CString &value) const;
  151. bool Is_Modified (void) const;
  152. FilePickerClass & Get_File_Picker (void) { return m_FilePicker; }
  153. protected:
  154. ////////////////////////////////////////////////////////////////////
  155. // Protected member data
  156. ////////////////////////////////////////////////////////////////////
  157. CStatic m_StaticText;
  158. FilePickerClass m_FilePicker;
  159. FilenameParameterClass * m_Parameter;
  160. };
  161. ///////////////////////////////////////////////////////////////////////
  162. //
  163. // StringsDBEntryParameterCtrlClass
  164. //
  165. ///////////////////////////////////////////////////////////////////////
  166. class StringsDBEntryParameterCtrlClass : public ParameterCtrlClass
  167. {
  168. public:
  169. ////////////////////////////////////////////////////////////////////
  170. // Public constructors/destructors
  171. ////////////////////////////////////////////////////////////////////
  172. StringsDBEntryParameterCtrlClass (StringsDBEntryParameterClass *param)
  173. : m_Parameter (param) { }
  174. virtual ~StringsDBEntryParameterCtrlClass (void) { }
  175. ////////////////////////////////////////////////////////////////////
  176. // Public methods
  177. ////////////////////////////////////////////////////////////////////
  178. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_STRINGSDB_ID; }
  179. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  180. void Resize (const CRect &rect);
  181. void Read_Data (HWND parent_wnd);
  182. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  183. protected:
  184. ////////////////////////////////////////////////////////////////////
  185. // Protected member data
  186. ////////////////////////////////////////////////////////////////////
  187. CStatic m_StaticText;
  188. StringPickerClass m_StringPicker;
  189. StringsDBEntryParameterClass * m_Parameter;
  190. };
  191. ///////////////////////////////////////////////////////////////////////
  192. //
  193. // SoundFileParameterCtrlClass
  194. //
  195. ///////////////////////////////////////////////////////////////////////
  196. class SoundFileParameterCtrlClass : public FileParameterCtrlClass
  197. {
  198. public:
  199. ////////////////////////////////////////////////////////////////////
  200. // Public constructors/destructors
  201. ////////////////////////////////////////////////////////////////////
  202. SoundFileParameterCtrlClass (SoundFilenameParameterClass *param)
  203. : FileParameterCtrlClass (param) { }
  204. virtual ~SoundFileParameterCtrlClass (void) { }
  205. ////////////////////////////////////////////////////////////////////
  206. // Public methods
  207. ////////////////////////////////////////////////////////////////////
  208. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_SOUND_FILENAME; }
  209. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  210. };
  211. ///////////////////////////////////////////////////////////////////////
  212. //
  213. // IntParameterCtrlClass
  214. //
  215. ///////////////////////////////////////////////////////////////////////
  216. class IntParameterCtrlClass : public ParameterCtrlClass
  217. {
  218. public:
  219. ////////////////////////////////////////////////////////////////////
  220. // Public constructors/destructors
  221. ////////////////////////////////////////////////////////////////////
  222. IntParameterCtrlClass (IntParameterClass *param)
  223. : m_Parameter (param) { }
  224. virtual ~IntParameterCtrlClass (void) { }
  225. ////////////////////////////////////////////////////////////////////
  226. // Public methods
  227. ////////////////////////////////////////////////////////////////////
  228. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_INT; }
  229. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  230. void Resize (const CRect &rect);
  231. void Read_Data (HWND parent_wnd);
  232. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  233. private:
  234. ////////////////////////////////////////////////////////////////////
  235. // Private member data
  236. ////////////////////////////////////////////////////////////////////
  237. CStatic m_StaticText1;
  238. CStatic m_StaticText2;
  239. CEdit m_EditCtrl;
  240. CSpinButtonCtrl m_SpinCtrl;
  241. IntParameterClass * m_Parameter;
  242. };
  243. ///////////////////////////////////////////////////////////////////////
  244. //
  245. // FloatParameterCtrlClass
  246. //
  247. ///////////////////////////////////////////////////////////////////////
  248. class FloatParameterCtrlClass : public ParameterCtrlClass
  249. {
  250. public:
  251. ////////////////////////////////////////////////////////////////////
  252. // Public constructors/destructors
  253. ////////////////////////////////////////////////////////////////////
  254. FloatParameterCtrlClass (FloatParameterClass *param)
  255. : m_Parameter (param) { }
  256. virtual ~FloatParameterCtrlClass (void) { }
  257. ////////////////////////////////////////////////////////////////////
  258. // Public methods
  259. ////////////////////////////////////////////////////////////////////
  260. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_FLOAT; }
  261. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  262. void Resize (const CRect &rect);
  263. void Read_Data (HWND parent_wnd);
  264. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  265. private:
  266. ////////////////////////////////////////////////////////////////////
  267. // Private member data
  268. ////////////////////////////////////////////////////////////////////
  269. CStatic m_StaticText1;
  270. CStatic m_StaticText2;
  271. CEdit m_EditCtrl;
  272. CSpinButtonCtrl m_SpinCtrl;
  273. FloatParameterClass * m_Parameter;
  274. };
  275. ///////////////////////////////////////////////////////////////////////
  276. //
  277. // AngleParameterCtrlClass
  278. //
  279. ///////////////////////////////////////////////////////////////////////
  280. class AngleParameterCtrlClass : public ParameterCtrlClass
  281. {
  282. public:
  283. ////////////////////////////////////////////////////////////////////
  284. // Public constructors/destructors
  285. ////////////////////////////////////////////////////////////////////
  286. AngleParameterCtrlClass (AngleParameterClass *param)
  287. : m_Parameter (param) { }
  288. virtual ~AngleParameterCtrlClass (void) { }
  289. ////////////////////////////////////////////////////////////////////
  290. // Public methods
  291. ////////////////////////////////////////////////////////////////////
  292. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_ANGLE; }
  293. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  294. void Resize (const CRect &rect);
  295. void Read_Data (HWND parent_wnd);
  296. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  297. private:
  298. ////////////////////////////////////////////////////////////////////
  299. // Private member data
  300. ////////////////////////////////////////////////////////////////////
  301. CStatic m_StaticText1;
  302. CStatic m_StaticText2;
  303. CEdit m_EditCtrl;
  304. CSpinButtonCtrl m_SpinCtrl;
  305. AngleParameterClass * m_Parameter;
  306. };
  307. ///////////////////////////////////////////////////////////////////////
  308. //
  309. // BoolParameterCtrlClass
  310. //
  311. ///////////////////////////////////////////////////////////////////////
  312. class BoolParameterCtrlClass : public ParameterCtrlClass
  313. {
  314. public:
  315. ////////////////////////////////////////////////////////////////////
  316. // Public constructors/destructors
  317. ////////////////////////////////////////////////////////////////////
  318. BoolParameterCtrlClass (BoolParameterClass *param)
  319. : m_Parameter (param) { }
  320. virtual ~BoolParameterCtrlClass (void) { }
  321. ////////////////////////////////////////////////////////////////////
  322. // Public methods
  323. ////////////////////////////////////////////////////////////////////
  324. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_BOOL; }
  325. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  326. void Resize (const CRect &rect);
  327. void Read_Data (HWND parent_wnd);
  328. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  329. private:
  330. ////////////////////////////////////////////////////////////////////
  331. // Private member data
  332. ////////////////////////////////////////////////////////////////////
  333. CButton m_CheckBoxCtrl;
  334. BoolParameterClass * m_Parameter;
  335. };
  336. ///////////////////////////////////////////////////////////////////////
  337. //
  338. // Vector3ParameterCtrlClass
  339. //
  340. ///////////////////////////////////////////////////////////////////////
  341. class Vector3ParameterCtrlClass : public ParameterCtrlClass
  342. {
  343. public:
  344. ////////////////////////////////////////////////////////////////////
  345. // Public constructors/destructors
  346. ////////////////////////////////////////////////////////////////////
  347. Vector3ParameterCtrlClass (Vector3ParameterClass *param)
  348. : m_Parameter (param) { }
  349. virtual ~Vector3ParameterCtrlClass (void) { }
  350. ////////////////////////////////////////////////////////////////////
  351. // Public methods
  352. ////////////////////////////////////////////////////////////////////
  353. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_VECTOR3; }
  354. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  355. void Resize (const CRect &rect);
  356. void Read_Data (HWND parent_wnd);
  357. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  358. private:
  359. ////////////////////////////////////////////////////////////////////
  360. // Private member data
  361. ////////////////////////////////////////////////////////////////////
  362. CStatic m_TextCtrls[3];
  363. CEdit m_EditCtrls[3];
  364. CSpinButtonCtrl m_SpinCtrls[3];
  365. CButton m_GroupBox;
  366. Vector3ParameterClass * m_Parameter;
  367. };
  368. ///////////////////////////////////////////////////////////////////////
  369. //
  370. // Vector2ParameterCtrlClass
  371. //
  372. ///////////////////////////////////////////////////////////////////////
  373. class Vector2ParameterCtrlClass : public ParameterCtrlClass
  374. {
  375. public:
  376. ////////////////////////////////////////////////////////////////////
  377. // Public constructors/destructors
  378. ////////////////////////////////////////////////////////////////////
  379. Vector2ParameterCtrlClass (Vector2ParameterClass *param)
  380. : m_Parameter (param) { }
  381. virtual ~Vector2ParameterCtrlClass (void) { }
  382. ////////////////////////////////////////////////////////////////////
  383. // Public methods
  384. ////////////////////////////////////////////////////////////////////
  385. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_VECTOR2; }
  386. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  387. void Resize (const CRect &rect);
  388. void Read_Data (HWND parent_wnd);
  389. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  390. private:
  391. ////////////////////////////////////////////////////////////////////
  392. // Private member data
  393. ////////////////////////////////////////////////////////////////////
  394. CStatic m_TextCtrls[2];
  395. CEdit m_EditCtrls[2];
  396. CSpinButtonCtrl m_SpinCtrls[2];
  397. CButton m_GroupBox;
  398. Vector2ParameterClass * m_Parameter;
  399. };
  400. ///////////////////////////////////////////////////////////////////////
  401. //
  402. // RectParameterCtrlClass
  403. //
  404. ///////////////////////////////////////////////////////////////////////
  405. class RectParameterCtrlClass : public ParameterCtrlClass
  406. {
  407. public:
  408. ////////////////////////////////////////////////////////////////////
  409. // Public constructors/destructors
  410. ////////////////////////////////////////////////////////////////////
  411. RectParameterCtrlClass (RectParameterClass *param)
  412. : m_Parameter (param) {}
  413. virtual ~RectParameterCtrlClass (void) {}
  414. ////////////////////////////////////////////////////////////////////
  415. // Public methods
  416. ////////////////////////////////////////////////////////////////////
  417. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_RECT; }
  418. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  419. void Resize (const CRect &rect);
  420. void Read_Data (HWND parent_wnd);
  421. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  422. private:
  423. ////////////////////////////////////////////////////////////////////
  424. // Private member data
  425. ////////////////////////////////////////////////////////////////////
  426. CStatic m_TextCtrls[4];
  427. CEdit m_EditCtrls[4];
  428. CSpinButtonCtrl m_SpinCtrls[4];
  429. CButton m_GroupBox;
  430. RectParameterClass * m_Parameter;
  431. };
  432. ///////////////////////////////////////////////////////////////////////
  433. //
  434. // EnumParameterCtrlClass
  435. //
  436. ///////////////////////////////////////////////////////////////////////
  437. class EnumParameterCtrlClass : public ParameterCtrlClass
  438. {
  439. public:
  440. ////////////////////////////////////////////////////////////////////
  441. // Public constructors/destructors
  442. ////////////////////////////////////////////////////////////////////
  443. EnumParameterCtrlClass (EnumParameterClass *param)
  444. : m_Parameter (param) { }
  445. virtual ~EnumParameterCtrlClass (void) { }
  446. ////////////////////////////////////////////////////////////////////
  447. // Public methods
  448. ////////////////////////////////////////////////////////////////////
  449. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_ENUM; }
  450. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  451. void Resize (const CRect &rect);
  452. void Read_Data (HWND parent_wnd);
  453. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  454. private:
  455. ////////////////////////////////////////////////////////////////////
  456. // Private member data
  457. ////////////////////////////////////////////////////////////////////
  458. CStatic m_StaticText;
  459. CComboBox m_ComboBox;
  460. EnumParameterClass * m_Parameter;
  461. };
  462. ///////////////////////////////////////////////////////////////////////
  463. //
  464. // ColorParameterCtrlClass
  465. //
  466. ///////////////////////////////////////////////////////////////////////
  467. class ColorParameterCtrlClass : public ParameterCtrlClass
  468. {
  469. public:
  470. ////////////////////////////////////////////////////////////////////
  471. // Public constructors/destructors
  472. ////////////////////////////////////////////////////////////////////
  473. ColorParameterCtrlClass (ColorParameterClass *param)
  474. : m_Parameter (param),
  475. m_ButtonID (0) { }
  476. virtual ~ColorParameterCtrlClass (void) { }
  477. ////////////////////////////////////////////////////////////////////
  478. // Public methods
  479. ////////////////////////////////////////////////////////////////////
  480. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_COLOR; }
  481. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  482. void Resize (const CRect &rect);
  483. void Read_Data (HWND parent_wnd);
  484. bool On_Command (HWND parent_wnd, WPARAM wparam, LPARAM lparam);
  485. bool On_DrawItem (HWND parent_wnd, WPARAM wparam, LPARAM lparam);
  486. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  487. private:
  488. ////////////////////////////////////////////////////////////////////
  489. // Private member data
  490. ////////////////////////////////////////////////////////////////////
  491. CStatic m_StaticText;
  492. CButton m_Button;
  493. ColorParameterClass * m_Parameter;
  494. int m_ButtonID;
  495. };
  496. ///////////////////////////////////////////////////////////////////////
  497. //
  498. // PhysDefParameterCtrlClass
  499. //
  500. ///////////////////////////////////////////////////////////////////////
  501. class PhysDefParameterCtrlClass : public ParameterCtrlClass
  502. {
  503. public:
  504. ////////////////////////////////////////////////////////////////////
  505. // Public constructors/destructors
  506. ////////////////////////////////////////////////////////////////////
  507. PhysDefParameterCtrlClass (PhysDefParameterClass *param)
  508. : m_Parameter (param),
  509. m_ButtonID (0) { }
  510. virtual ~PhysDefParameterCtrlClass (void) { }
  511. ////////////////////////////////////////////////////////////////////
  512. // Public methods
  513. ////////////////////////////////////////////////////////////////////
  514. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_PHYSDEFINITIONID; }
  515. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  516. void Resize (const CRect &rect);
  517. void Read_Data (HWND parent_wnd);
  518. bool On_Command (HWND parent_wnd, WPARAM wparam, LPARAM lparam);
  519. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  520. private:
  521. ////////////////////////////////////////////////////////////////////
  522. // Private member data
  523. ////////////////////////////////////////////////////////////////////
  524. CStatic m_StaticText;
  525. CButton m_Button;
  526. PhysDefParameterClass * m_Parameter;
  527. int m_ButtonID;
  528. };
  529. ///////////////////////////////////////////////////////////////////////
  530. //
  531. // DefParameterCtrlClass
  532. //
  533. ///////////////////////////////////////////////////////////////////////
  534. class DefParameterCtrlClass : public ParameterCtrlClass
  535. {
  536. public:
  537. ////////////////////////////////////////////////////////////////////
  538. // Public constructors/destructors
  539. ////////////////////////////////////////////////////////////////////
  540. DefParameterCtrlClass (DefParameterClass *param)
  541. : m_Parameter (param),
  542. m_ButtonID (0) { }
  543. virtual ~DefParameterCtrlClass (void) { }
  544. ////////////////////////////////////////////////////////////////////
  545. // Public methods
  546. ////////////////////////////////////////////////////////////////////
  547. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  548. void Resize (const CRect &rect);
  549. void On_Destroy (void);
  550. void Read_Data (HWND parent_wnd);
  551. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  552. protected:
  553. ////////////////////////////////////////////////////////////////////
  554. // Protected methods
  555. ////////////////////////////////////////////////////////////////////
  556. virtual uint32 Get_Def_Class_ID (void) = 0;
  557. virtual int Get_Def_Icon (void) = 0;
  558. ////////////////////////////////////////////////////////////////////
  559. // Protected member data
  560. ////////////////////////////////////////////////////////////////////
  561. CStatic m_StaticText;
  562. PresetPickerClass m_PresetPicker;
  563. CComboBoxEx m_ComboBox;
  564. int m_ButtonID;
  565. DefParameterClass * m_Parameter;
  566. };
  567. ///////////////////////////////////////////////////////////////////////
  568. //
  569. // GenericDefParameterCtrlClass
  570. //
  571. ///////////////////////////////////////////////////////////////////////
  572. class GenericDefParameterCtrlClass : public DefParameterCtrlClass
  573. {
  574. public:
  575. ////////////////////////////////////////////////////////////////////
  576. // Public constructors/destructors
  577. ////////////////////////////////////////////////////////////////////
  578. GenericDefParameterCtrlClass (GenericDefParameterClass *param)
  579. : DefParameterCtrlClass (param) { }
  580. virtual ~GenericDefParameterCtrlClass (void) { }
  581. ////////////////////////////////////////////////////////////////////
  582. // Public methods
  583. ////////////////////////////////////////////////////////////////////
  584. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_GENERICDEFINITIONID; }
  585. protected:
  586. ////////////////////////////////////////////////////////////////////
  587. // Protected methods
  588. ////////////////////////////////////////////////////////////////////
  589. virtual uint32 Get_Def_Class_ID (void) { return ((GenericDefParameterClass *)m_Parameter)->Get_Class_ID (); }
  590. virtual int Get_Def_Icon (void) { return OBJECT_ICON; }
  591. };
  592. ///////////////////////////////////////////////////////////////////////
  593. //
  594. // GameObjDefParameterCtrlClass
  595. //
  596. ///////////////////////////////////////////////////////////////////////
  597. class GameObjDefParameterCtrlClass : public DefParameterCtrlClass
  598. {
  599. public:
  600. ////////////////////////////////////////////////////////////////////
  601. // Public constructors/destructors
  602. ////////////////////////////////////////////////////////////////////
  603. GameObjDefParameterCtrlClass (GameObjDefParameterClass *param)
  604. : DefParameterCtrlClass (param) { }
  605. virtual ~GameObjDefParameterCtrlClass (void) { }
  606. ////////////////////////////////////////////////////////////////////
  607. // Public methods
  608. ////////////////////////////////////////////////////////////////////
  609. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_GAMEOBJDEFINITIONID; }
  610. protected:
  611. ////////////////////////////////////////////////////////////////////
  612. // Protected methods
  613. ////////////////////////////////////////////////////////////////////
  614. virtual uint32 Get_Def_Class_ID (void) { return CLASSID_GAME_OBJECTS; }
  615. virtual int Get_Def_Icon (void) { return OBJECT_ICON; }
  616. };
  617. ///////////////////////////////////////////////////////////////////////
  618. //
  619. // WeaponObjDefParameterCtrlClass
  620. //
  621. ///////////////////////////////////////////////////////////////////////
  622. class WeaponObjDefParameterCtrlClass : public GameObjDefParameterCtrlClass
  623. {
  624. public:
  625. ////////////////////////////////////////////////////////////////////
  626. // Public constructors/destructors
  627. ////////////////////////////////////////////////////////////////////
  628. WeaponObjDefParameterCtrlClass (WeaponObjDefParameterClass *param)
  629. : GameObjDefParameterCtrlClass (param) { }
  630. virtual ~WeaponObjDefParameterCtrlClass (void) { }
  631. ////////////////////////////////////////////////////////////////////
  632. // Public methods
  633. ////////////////////////////////////////////////////////////////////
  634. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_WEAPONOBJDEFINITIONID; }
  635. protected:
  636. ////////////////////////////////////////////////////////////////////
  637. // Protected methods
  638. ////////////////////////////////////////////////////////////////////
  639. virtual uint32 Get_Def_Class_ID (void) { return CLASSID_DEF_WEAPON; }
  640. virtual int Get_Def_Icon (void) { return OBJECT_ICON; }
  641. };
  642. ///////////////////////////////////////////////////////////////////////
  643. //
  644. // AmmoObjDefParameterCtrlClass
  645. //
  646. ///////////////////////////////////////////////////////////////////////
  647. class AmmoObjDefParameterCtrlClass : public GameObjDefParameterCtrlClass
  648. {
  649. public:
  650. ////////////////////////////////////////////////////////////////////
  651. // Public constructors/destructors
  652. ////////////////////////////////////////////////////////////////////
  653. AmmoObjDefParameterCtrlClass (AmmoObjDefParameterClass *param)
  654. : GameObjDefParameterCtrlClass (param) { }
  655. virtual ~AmmoObjDefParameterCtrlClass (void) { }
  656. ////////////////////////////////////////////////////////////////////
  657. // Public methods
  658. ////////////////////////////////////////////////////////////////////
  659. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_AMMOOBJDEFINITIONID; }
  660. protected:
  661. ////////////////////////////////////////////////////////////////////
  662. // Protected methods
  663. ////////////////////////////////////////////////////////////////////
  664. virtual uint32 Get_Def_Class_ID (void) { return CLASSID_DEF_AMMO; }
  665. virtual int Get_Def_Icon (void) { return OBJECT_ICON; }
  666. };
  667. ///////////////////////////////////////////////////////////////////////
  668. //
  669. // ExplosionObjDefParameterCtrlClass
  670. //
  671. ///////////////////////////////////////////////////////////////////////
  672. class ExplosionObjDefParameterCtrlClass : public GameObjDefParameterCtrlClass
  673. {
  674. public:
  675. ////////////////////////////////////////////////////////////////////
  676. // Public constructors/destructors
  677. ////////////////////////////////////////////////////////////////////
  678. ExplosionObjDefParameterCtrlClass (ExplosionObjDefParameterClass *param)
  679. : GameObjDefParameterCtrlClass (param) { }
  680. virtual ~ExplosionObjDefParameterCtrlClass (void) { }
  681. ////////////////////////////////////////////////////////////////////
  682. // Public methods
  683. ////////////////////////////////////////////////////////////////////
  684. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_EXPLOSIONDEFINITIONID; }
  685. protected:
  686. ////////////////////////////////////////////////////////////////////
  687. // Protected methods
  688. ////////////////////////////////////////////////////////////////////
  689. virtual uint32 Get_Def_Class_ID (void) { return CLASSID_DEF_EXPLOSION; }
  690. virtual int Get_Def_Icon (void) { return OBJECT_ICON; }
  691. };
  692. ///////////////////////////////////////////////////////////////////////
  693. //
  694. // SoundDefParameterCtrlClass
  695. //
  696. ///////////////////////////////////////////////////////////////////////
  697. class SoundDefParameterCtrlClass : public DefParameterCtrlClass
  698. {
  699. public:
  700. ////////////////////////////////////////////////////////////////////
  701. // Public constructors/destructors
  702. ////////////////////////////////////////////////////////////////////
  703. SoundDefParameterCtrlClass (SoundDefParameterClass *param)
  704. : m_Parameter (param),
  705. DefParameterCtrlClass (param) { }
  706. virtual ~SoundDefParameterCtrlClass (void) { }
  707. ////////////////////////////////////////////////////////////////////
  708. // Public methods
  709. ////////////////////////////////////////////////////////////////////
  710. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_SOUNDDEFINITIONID; }
  711. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  712. protected:
  713. ////////////////////////////////////////////////////////////////////
  714. // Protected methods
  715. ////////////////////////////////////////////////////////////////////
  716. virtual uint32 Get_Def_Class_ID (void) { return CLASSID_SOUND; }
  717. virtual int Get_Def_Icon (void) { return SOUND_ICON; }
  718. ////////////////////////////////////////////////////////////////////
  719. // Protected member data
  720. ////////////////////////////////////////////////////////////////////
  721. SoundDefParameterClass * m_Parameter;
  722. };
  723. ///////////////////////////////////////////////////////////////////////
  724. //
  725. // ScriptParameterCtrlClass
  726. //
  727. ///////////////////////////////////////////////////////////////////////
  728. class ScriptParameterCtrlClass : public ParameterCtrlClass
  729. {
  730. public:
  731. ////////////////////////////////////////////////////////////////////
  732. // Public constructors/destructors
  733. ////////////////////////////////////////////////////////////////////
  734. ScriptParameterCtrlClass (ScriptParameterClass *param)
  735. : m_Parameter (param),
  736. m_ButtonID (0) { }
  737. virtual ~ScriptParameterCtrlClass (void) { }
  738. ////////////////////////////////////////////////////////////////////
  739. // Public methods
  740. ////////////////////////////////////////////////////////////////////
  741. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_SCRIPT; }
  742. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  743. void Resize (const CRect &rect);
  744. void Read_Data (HWND parent_wnd);
  745. bool On_Command (HWND parent_wnd, WPARAM wparam, LPARAM lparam);
  746. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  747. protected:
  748. ////////////////////////////////////////////////////////////////////
  749. // Protected methods
  750. ////////////////////////////////////////////////////////////////////
  751. void Fill_Combo (void);
  752. private:
  753. ////////////////////////////////////////////////////////////////////
  754. // Private member data
  755. ////////////////////////////////////////////////////////////////////
  756. CButton m_Button;
  757. CButton m_CheckBoxCtrl;
  758. ScriptParameterClass * m_Parameter;
  759. int m_ButtonID;
  760. };
  761. ///////////////////////////////////////////////////////////////////////
  762. //
  763. // DefIDListParameterCtrlClass
  764. //
  765. ///////////////////////////////////////////////////////////////////////
  766. class DefIDListParameterCtrlClass : public ParameterCtrlClass
  767. {
  768. public:
  769. ////////////////////////////////////////////////////////////////////
  770. // Public constructors/destructors
  771. ////////////////////////////////////////////////////////////////////
  772. DefIDListParameterCtrlClass (DefIDListParameterClass *param)
  773. : m_Parameter (param),
  774. m_ButtonID (0) { }
  775. virtual ~DefIDListParameterCtrlClass (void) { }
  776. ////////////////////////////////////////////////////////////////////
  777. // Public methods
  778. ////////////////////////////////////////////////////////////////////
  779. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_DEFINITIONIDLIST; }
  780. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  781. void Resize (const CRect &rect);
  782. void Read_Data (HWND parent_wnd);
  783. bool On_Command (HWND parent_wnd, WPARAM wparam, LPARAM lparam);
  784. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  785. private:
  786. ////////////////////////////////////////////////////////////////////
  787. // Private member data
  788. ////////////////////////////////////////////////////////////////////
  789. CButton m_Button;
  790. CStatic m_StaticText;
  791. DefIDListParameterClass * m_Parameter;
  792. int m_ButtonID;
  793. };
  794. ///////////////////////////////////////////////////////////////////////
  795. //
  796. // ZoneParameterCtrlClass
  797. //
  798. ///////////////////////////////////////////////////////////////////////
  799. class ZoneParameterCtrlClass : public ParameterCtrlClass
  800. {
  801. public:
  802. ////////////////////////////////////////////////////////////////////
  803. // Public constructors/destructors
  804. ////////////////////////////////////////////////////////////////////
  805. ZoneParameterCtrlClass (ZoneParameterClass *param)
  806. : m_Parameter (param),
  807. m_ButtonID (0) { }
  808. virtual ~ZoneParameterCtrlClass (void) { }
  809. ////////////////////////////////////////////////////////////////////
  810. // Public methods
  811. ////////////////////////////////////////////////////////////////////
  812. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_ZONE; }
  813. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  814. void Resize (const CRect &rect);
  815. void Read_Data (HWND parent_wnd);
  816. bool On_Command (HWND parent_wnd, WPARAM wparam, LPARAM lparam);
  817. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  818. private:
  819. ////////////////////////////////////////////////////////////////////
  820. // Private member data
  821. ////////////////////////////////////////////////////////////////////
  822. CButton m_Button;
  823. CStatic m_StaticText;
  824. ZoneParameterClass * m_Parameter;
  825. int m_ButtonID;
  826. };
  827. ///////////////////////////////////////////////////////////////////////
  828. //
  829. // FilenameListParameterCtrlClass
  830. //
  831. ///////////////////////////////////////////////////////////////////////
  832. class FilenameListParameterCtrlClass : public ParameterCtrlClass
  833. {
  834. public:
  835. ////////////////////////////////////////////////////////////////////
  836. // Public constructors/destructors
  837. ////////////////////////////////////////////////////////////////////
  838. FilenameListParameterCtrlClass (FilenameListParameterClass *param)
  839. : m_Parameter (param),
  840. m_ButtonID (0) { }
  841. virtual ~FilenameListParameterCtrlClass (void) { }
  842. ////////////////////////////////////////////////////////////////////
  843. // Public methods
  844. ////////////////////////////////////////////////////////////////////
  845. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_FILENAMELIST; }
  846. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  847. void Resize (const CRect &rect);
  848. void Read_Data (HWND parent_wnd);
  849. bool On_Command (HWND parent_wnd, WPARAM wparam, LPARAM lparam);
  850. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  851. private:
  852. ////////////////////////////////////////////////////////////////////
  853. // Private member data
  854. ////////////////////////////////////////////////////////////////////
  855. CButton m_Button;
  856. CStatic m_StaticText;
  857. FilenameListParameterClass * m_Parameter;
  858. int m_ButtonID;
  859. };
  860. ///////////////////////////////////////////////////////////////////////
  861. //
  862. // SeparatorParameterCtrlClass
  863. //
  864. ///////////////////////////////////////////////////////////////////////
  865. class SeparatorParameterCtrlClass : public ParameterCtrlClass
  866. {
  867. public:
  868. ////////////////////////////////////////////////////////////////////
  869. // Public constructors/destructors
  870. ////////////////////////////////////////////////////////////////////
  871. SeparatorParameterCtrlClass (SeparatorParameterClass *param)
  872. : m_Parameter (param) { }
  873. virtual ~SeparatorParameterCtrlClass (void) { }
  874. ////////////////////////////////////////////////////////////////////
  875. // Public methods
  876. ////////////////////////////////////////////////////////////////////
  877. ParameterClass::Type Get_Type (void) const { return ParameterClass::TYPE_SEPARATOR; }
  878. int Create (HWND parent_wnd, int id_start, LPRECT pos);
  879. void Resize (const CRect &rect);
  880. ParameterClass * Get_Parameter (void) const { return m_Parameter; };
  881. private:
  882. ////////////////////////////////////////////////////////////////////
  883. // Private member data
  884. ////////////////////////////////////////////////////////////////////
  885. CStatic m_FrameCtrl;
  886. CStatic m_TextCtrl;
  887. SeparatorParameterClass * m_Parameter;
  888. };
  889. #endif //__PARAMETER_CTRLS_H