29 #ifndef _CEGUICombobox_h_
30 #define _CEGUICombobox_h_
32 #include "CEGUI/Base.h"
33 #include "CEGUI/Window.h"
34 #include "CEGUI/RegexMatcher.h"
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
50 class CEGUIEXPORT Combobox :
public Window
55 static const String EventNamespace;
56 static const String WidgetTypeName;
67 static const String EventReadOnlyModeChanged;
73 static const String EventValidationStringChanged;
79 static const String EventMaximumTextLengthChanged;
93 static const String EventTextValidityChanged;
99 static const String EventCaretMoved;
105 static const String EventTextSelectionChanged;
112 static const String EventEditboxFull;
119 static const String EventTextAccepted;
127 static const String EventListContentsChanged;
138 static const String EventListSelectionChanged;
144 static const String EventSortModeChanged;
151 static const String EventVertScrollbarModeChanged;
158 static const String EventHorzScrollbarModeChanged;
166 static const String EventDropListDisplayed;
172 static const String EventDropListRemoved;
178 static const String EventListSelectionAccepted;
183 static const String EditboxName;
184 static const String DropListName;
185 static const String ButtonName;
188 bool isHit(
const Vector2f& position,
189 const bool allow_disabled =
false)
const;
199 bool getSingleClickEnabled(
void)
const;
209 bool isDropDownListVisible(
void)
const;
222 Editbox* getEditbox()
const;
234 PushButton* getPushButton()
const;
247 ComboDropList* getDropList()
const;
250 bool getAutoSizeListHeightToContent()
const;
253 bool getAutoSizeListWidthToContent()
const;
265 bool hasInputFocus(
void)
const;
276 bool isReadOnly(
void)
const;
293 MatchState getTextMatchState()
const;
307 const String& getValidationString(
void)
const;
317 size_t getCaretIndex(
void)
const;
328 size_t getSelectionStartIndex(
void)
const;
339 size_t getSelectionEndIndex(
void)
const;
349 size_t getSelectionLength(
void)
const;
363 size_t getMaxTextLength(
void)
const;
376 size_t getItemCount(
void)
const;
387 ListboxItem* getSelectedItem(
void)
const;
402 ListboxItem* getListboxItemFromIndex(
size_t index)
const;
417 size_t getItemIndex(
const ListboxItem* item)
const;
427 bool isSortEnabled(
void)
const;
442 bool isItemSelected(
size_t index)
const;
462 ListboxItem* findItemWithText(
const String& text,
const ListboxItem* start_item);
472 bool isListboxItemInList(
const ListboxItem* item)
const;
483 bool isVertScrollbarAlwaysShown(
void)
const;
494 bool isHorzScrollbarAlwaysShown(
void)
const;
510 virtual void initialiseComponents(
void);
520 void showDropList(
void);
530 void hideDropList(
void);
544 void setSingleClickEnabled(
bool setting);
547 void selectListItemWithEditboxText();
554 void setAutoSizeListHeightToContent(
bool auto_size);
561 void setAutoSizeListWidthToContent(
bool auto_size);
564 void updateAutoSizedDropList();
580 void setReadOnly(
bool setting);
597 void setValidationString(
const String& validation_string);
611 void setCaretIndex(
size_t caret_pos);
629 void setSelection(
size_t start_pos,
size_t end_pos);
641 void setSelectionStart(
size_t start_pos);
653 void setSelectionLength(
size_t length);
669 void setMaxTextLength(
size_t max_len);
679 void activateEditbox(
void);
691 void resetList(
void);
705 void addItem(ListboxItem* item);
725 void insertItem(ListboxItem* item,
const ListboxItem* position);
739 void removeItem(
const ListboxItem* item);
749 void clearAllSelections(
void);
762 void setSortingEnabled(
bool setting);
776 void setShowVertScrollbar(
bool setting);
790 void setShowHorzScrollbar(
bool setting);
812 void setItemSelectState(ListboxItem* item,
bool state);
834 void setItemSelectState(
size_t item_index,
bool state);
849 void handleUpdatedListItemData(
void);
859 Combobox(
const String& type,
const String& name);
866 virtual ~Combobox(
void);
877 bool button_PressHandler(
const EventArgs& e);
884 bool droplist_SelectionAcceptedHandler(
const EventArgs& e);
891 bool droplist_HiddenHandler(
const EventArgs& e);
898 bool editbox_MouseDownHandler(
const EventArgs& e);
905 void itemSelectChangeTextUpdate(
const ListboxItem*
const item,
906 bool new_state,
bool old_state);
911 bool editbox_ReadOnlyChangedHandler(
const EventArgs& e);
912 bool editbox_ValidationStringChangedHandler(
const EventArgs& e);
913 bool editbox_MaximumTextLengthChangedHandler(
const EventArgs& e);
914 bool editbox_TextValidityChangedHandler(
const EventArgs& e);
915 bool editbox_CaretMovedHandler(
const EventArgs& e);
916 bool editbox_TextSelectionChangedHandler(
const EventArgs& e);
917 bool editbox_EditboxFullEventHandler(
const EventArgs& e);
918 bool editbox_TextAcceptedEventHandler(
const EventArgs& e);
919 bool editbox_TextChangedEventHandler(
const EventArgs& e);
920 bool listbox_ListContentsChangedHandler(
const EventArgs& e);
921 bool listbox_ListSelectionChangedHandler(
const EventArgs& e);
922 bool listbox_SortModeChangedHandler(
const EventArgs& e);
923 bool listbox_VertScrollModeChangedHandler(
const EventArgs& e);
924 bool listbox_HorzScrollModeChangedHandler(
const EventArgs& e);
934 virtual void onReadOnlyChanged(WindowEventArgs& e);
941 virtual void onValidationStringChanged(WindowEventArgs& e);
948 virtual void onMaximumTextLengthChanged(WindowEventArgs& e);
956 virtual void onTextValidityChanged(RegexMatchStateEventArgs& e);
963 virtual void onCaretMoved(WindowEventArgs& e);
970 virtual void onTextSelectionChanged(WindowEventArgs& e);
977 virtual void onEditboxFullEvent(WindowEventArgs& e);
984 virtual void onTextAcceptedEvent(WindowEventArgs& e);
991 virtual void onListContentsChanged(WindowEventArgs& e);
999 virtual void onListSelectionChanged(WindowEventArgs& e);
1006 virtual void onSortModeChanged(WindowEventArgs& e);
1014 virtual void onVertScrollbarModeChanged(WindowEventArgs& e);
1022 virtual void onHorzScrollbarModeChanged(WindowEventArgs& e);
1029 virtual void onDropListDisplayed(WindowEventArgs& e);
1036 virtual void onDroplistRemoved(WindowEventArgs& e);
1043 virtual void onListSelectionAccepted(WindowEventArgs& e);
1049 virtual void onFontChanged(WindowEventArgs& e);
1050 virtual void onTextChanged(WindowEventArgs& e);
1051 virtual void onActivated(ActivationEventArgs& e);
1052 void onSized(ElementEventArgs& e);
1058 bool d_singleClickOperation;
1059 bool d_autoSizeHeight;
1060 bool d_autoSizeWidth;
1066 void addComboboxProperties(
void);
1071 #if defined(_MSC_VER)
1072 # pragma warning(pop)
1075 #endif // end of guard _CEGUICombobox_h_
Main namespace for Crazy Eddie's GUI Library.
Definition: cegui/include/CEGUI/Affector.h:42
MatchState
Enumeration of possible states when cosidering a regex match.
Definition: cegui/include/CEGUI/RegexMatcher.h:44