OptionsArea.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. #ifndef OPTIONSAREA_H
  2. #define OPTIONSAREA_H
  3. /*************************************************************************************************\
  4. OptionsArea.h : Interface for the OptionsArea component.
  5. //---------------------------------------------------------------------------//
  6. // Copyright (C) Microsoft Corporation. All rights reserved. //
  7. //===========================================================================//
  8. \*************************************************************************************************/
  9. //*************************************************************************************************
  10. #ifndef LOGISTICSSCREEN_H
  11. #include "LogisticsScreen.h"
  12. #endif
  13. #ifndef SIMPLECAMERA_H
  14. #include "SimpleCamera.h"
  15. #endif
  16. #include "aListBox.h"
  17. #include "AttributeMeter.h"
  18. class aButton;
  19. class CPrefs;
  20. class OptionsXScreen : public LogisticsScreen
  21. {
  22. public:
  23. OptionsXScreen();
  24. virtual ~OptionsXScreen();
  25. void init(FitIniFile* file);
  26. bool isDone();
  27. virtual void render();
  28. virtual void update();
  29. virtual int handleMessage( unsigned long, unsigned long );
  30. void updateOptions(); // put into inventory
  31. bool bDone;
  32. private:
  33. int indexOfButtonWithID(int id);
  34. LogisticsScreen* tabAreas[4];
  35. int curTab;
  36. bool bShowWarning;
  37. };
  38. class ScrollX : public aObject
  39. {
  40. public:
  41. ScrollX();
  42. long init(aButton* pLeft, aButton* pRight, aButton* pTab );
  43. virtual void update();
  44. virtual int handleMessage( unsigned long message, unsigned long fromWho );
  45. void SetScrollMax(float newMax);
  46. void SetScrollPos(float newPos);
  47. float GetScrollMax(void){return scrollMax;};
  48. float GetScrollPos(void){return scrollPos;};
  49. long SetSrollInc( long newInc ){ scrollInc = (float)newInc; } // amount you move for one arrow click
  50. long SetScrollPage(long newInc){ pageInc = (float)newInc;} // amount you move if you click on the bar itself
  51. void ScrollUp(void);
  52. void ScrollPageUp(void);
  53. void ScrollDown(void);
  54. void ScrollPageDown(void);
  55. void SetScroll( long newScrollPos );
  56. void Enable( bool enable );
  57. private:
  58. void ResizeAreas();
  59. aButton* buttons[3];
  60. float scrollMax;
  61. float scrollPos;
  62. float scrollInc;
  63. float pageInc;
  64. long lastX;
  65. };
  66. class OptionsGraphics : public LogisticsScreen
  67. {
  68. public:
  69. void init(long xOffset, long yOffset);
  70. virtual void render();
  71. virtual void update();
  72. virtual void begin();
  73. virtual void end();
  74. void reset( const CPrefs& newPrefs);
  75. virtual int handleMessage( unsigned long message, unsigned long fromWho );
  76. private:
  77. aDropList resolutionList;
  78. aDropList cardList;
  79. bool bExpanded;
  80. };
  81. class OptionsAudio : public LogisticsScreen
  82. {
  83. public:
  84. void init(long xOffset, long yOffset);
  85. virtual void render();
  86. virtual void update();
  87. virtual void begin();
  88. virtual void end();
  89. void reset(const CPrefs& newPrefs);
  90. virtual int handleMessage( unsigned long message, unsigned long fromWho );
  91. private:
  92. ScrollX scrollBars[5];
  93. };
  94. class OptionsHotKeys : public LogisticsScreen
  95. {
  96. public:
  97. void init(long xOffset, long yOffset);
  98. virtual void render();
  99. virtual void update();
  100. virtual void begin();
  101. virtual void end();
  102. void reset(bool bUseOld);
  103. virtual int handleMessage( unsigned long message, unsigned long fromWho );
  104. private:
  105. static void makeKeyString( long hotKey, char* buffer );
  106. static int makeInputKeyString( long& hotKey, char* buffer );
  107. aListBox hotKeyList;
  108. bool bShowDlg;
  109. long curHotKey;
  110. };
  111. class OptionsGamePlay : public LogisticsScreen
  112. {
  113. public:
  114. void init(long xOffset, long yOffset);
  115. virtual void render();
  116. virtual void update();
  117. virtual void begin();
  118. virtual void end();
  119. void reset(const CPrefs& newPrefs);
  120. virtual int handleMessage( unsigned long message, unsigned long fromWho );
  121. void resetCamera();
  122. private:
  123. SimpleCamera camera;
  124. };
  125. class HotKeyListItem : public aListItem
  126. {
  127. public:
  128. static void init();
  129. virtual void render();
  130. virtual void update();
  131. void setDescription( const char* pText );
  132. void setKey( const char* pText );
  133. HotKeyListItem( );
  134. ~HotKeyListItem();
  135. void setHotKey( long lNew ){ hotKey = lNew; }
  136. void setCommand( long lCommand ) { command = lCommand; }
  137. long getCommand() const { return command; }
  138. long getHotKey() const { return hotKey; }
  139. private:
  140. aText description;
  141. aText text;
  142. aAnimGroup animations[3];
  143. aRect rects[2];
  144. long hotKey;
  145. long command;
  146. static HotKeyListItem* s_item;
  147. };
  148. //*************************************************************************************************
  149. #endif // end of file ( OptionsArea.h )