src/window_gui.h
changeset 10596 0ee9eba64c9c
parent 10595 7957c71b0dfe
child 10597 d50861a6c96b
equal deleted inserted replaced
10595:7957c71b0dfe 10596:0ee9eba64c9c
   512 	PickerWindowBase(const WindowDesc *desc) : Window(desc) {}; // nothing special yet, just propagation
   512 	PickerWindowBase(const WindowDesc *desc) : Window(desc) {}; // nothing special yet, just propagation
   513 
   513 
   514 	virtual ~PickerWindowBase();
   514 	virtual ~PickerWindowBase();
   515 };
   515 };
   516 
   516 
   517 enum SortListFlags {
       
   518 	VL_NONE    = 0,      ///< no sort
       
   519 	VL_DESC    = 1 << 0, ///< sort descending or ascending
       
   520 	VL_RESORT  = 1 << 1, ///< instruct the code to resort the list in the next loop
       
   521 	VL_REBUILD = 1 << 2, ///< create sort-listing to use for qsort and friends
       
   522 	VL_END     = 1 << 3,
       
   523 };
       
   524 DECLARE_ENUM_AS_BIT_SET(SortListFlags);
       
   525 
       
   526 struct Listing {
       
   527 	bool order;    ///< Ascending/descending
       
   528 	byte criteria; ///< Sorting criteria
       
   529 };
       
   530 
       
   531 template <typename T>
       
   532 struct GUIList {
       
   533 	T* sort_list;        ///< The items to sort.
       
   534 	SortListFlags flags; ///< used to control sorting/resorting/etc.
       
   535 	uint16 list_length;  ///< length of the list being sorted
       
   536 	uint16 resort_timer; ///< resort list after a given amount of ticks if set
       
   537 	byte sort_type;      ///< what criteria to sort on
       
   538 };
       
   539 
       
   540 /****************** THESE ARE NOT WIDGET TYPES!!!!! *******************/
   517 /****************** THESE ARE NOT WIDGET TYPES!!!!! *******************/
   541 enum WindowWidgetBehaviours {
   518 enum WindowWidgetBehaviours {
   542 	WWB_PUSHBUTTON  = 1 << 5,
   519 	WWB_PUSHBUTTON  = 1 << 5,
   543 
   520 
   544 	WWB_MASK        = 0xE0,
   521 	WWB_MASK        = 0xE0,