OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SellTabbedState.h
1 /*
2  * Copyright 2010-2012 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_SELLSTATE_H
20 #define OPENXCOM_SELLSTATE_H
21 
22 #include "../Engine/State.h"
23 #include <vector>
24 #include <string>
25 
26 namespace OpenXcom
27 {
28 
29 class TextButton;
30 class Window;
31 class Text;
32 class TextList;
33 class Timer;
34 class Base;
35 class Soldier;
36 class Craft;
37 
42 class SellState : public State
43 {
44 private:
45  Base *_base;
46  TextButton *_btnOk, *_btnCancel;
47  TextButton *_btnSellTab;
48  TextButton *_btnPersonnel, *_btnCraft, *_btnItems;
49  Window *_window;
50  Text *_txtTitle, *_txtSales, *_txtFunds, *_txtItem, *_txtQuantity, *_txtSell, *_txtValue, *_txtSpace;
51  Text *_txtSpaceUsed, *_txtSpaceUsedValue;
52  TextList *_lstPersonnel, *_lstCraft;
53  TextList *_lstItems;
54  std::vector<int> _qtys, _qtysPersonnel, _qtysCraft, _qtysItems;
55  std::vector<Soldier*> _soldiers;
56  std::vector<Craft*> _crafts;
57  std::vector<std::string> _items, _itemsCraft;
58  unsigned int _sel;
59  eSelectedTab _selTab;
60  int _total, _sOffset, _eOffset;
61  float _spaceChange;
62  Timer *_timerInc, *_timerDec;
64  int getPrice();
66  int getQuantity();
67 public:
69  SellState(Game *game, Base *base);
71  ~SellState();
73  void think();
75  void btnOkClick(Action *action);
77  void btnCancelClick(Action *action);
78 
80  void btnPersonnelClick(Action *action);
82  void btnCraftClick(Action *action);
84  void btnItemsClick(Action *action);
85 
87  void lstItemsLeftArrowPress(Action *action);
89  void lstItemsLeftArrowRelease(Action *action);
91  void lstItemsRightArrowPress(Action *action);
93  void lstItemsRightArrowRelease(Action *action);
95  void increase();
97  void decrease();
98 };
99 
100 
101 }
102 
103 #endif
SellState(Game *game, Base *base, OptionsOrigin origin=OPT_GEOSCAPE)
Creates the Sell state.
Definition: SellState.cpp:58
void lstItemsRightArrowPress(Action *action)
Handler for pressing a Decrease arrow in the list.
Definition: SellState.cpp:487
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: SellState.cpp:294
void think()
Runs the timers.
Definition: SellState.cpp:272
void decrease()
Decreases the quantity of an item by one.
Definition: SellState.cpp:684
void btnCancelClick(Action *action)
Handler for clicking the Cancel button.
Definition: SellState.cpp:440
void lstItemsRightArrowRelease(Action *action)
Handler for releasing a Decrease arrow in the list.
Definition: SellState.cpp:497
void btnCraftClick(Action *action)
Handler for clicking the Craft tab.
Definition: SellTabbedState.cpp:424
void increase()
Increases the quantity of an item by one.
Definition: SellState.cpp:615
void btnItemsClick(Action *action)
Handler for clicking the Items tab.
Definition: SellTabbedState.cpp:438
~SellState()
Cleans up the Sell state.
Definition: SellState.cpp:263
void lstItemsLeftArrowRelease(Action *action)
Handler for releasing an Increase arrow in the list.
Definition: SellState.cpp:459
void btnPersonnelClick(Action *action)
Handler for clicking the Personnel tab.
Definition: SellTabbedState.cpp:410
void lstItemsLeftArrowPress(Action *action)
Handler for pressing an Increase arrow in the list.
Definition: SellState.cpp:449