2#ifndef __CXCOMBOBOX_H__
3#define __CXCOMBOBOX_H__
84 int pRow = 0,
int pCol = 0,
87 const std::string& pLabel =
"",
91 std::string *pExtValue =
nullptr,
bool pMenuEnabled =
true,
92 int pRightLabelOffset = 0,
93 int pRightLabelHeight = 1,
94 int pRightLabelWidth = 5,
95 bool pShowRightLabel =
false);
115 virtual long showModal(
bool pShowSelf =
true,
bool pBringToTop =
true,
116 bool pShowSubwindows =
true)
override;
129 virtual void resize(
int pNewHeight,
int pNewWidth,
bool pRefresh =
true)
override;
140 virtual bool move(
int pNewRow,
int pNewCol,
bool pRefresh =
true)
override;
147 virtual void erase(
bool pEraseSubwindows =
true)
override;
154 virtual void hide(
bool pHideSubwindows =
true)
override;
161 virtual void unhide(
bool pUnhideSubwindows =
true)
override;
173 virtual void appendToMenu(
const std::string& pDisplayText,
174 const std::string& pItemText =
"",
175 bool pRefresh =
false,
bool pBringToTop =
false);
185 virtual bool removeFromMenu(
unsigned pItemIndex,
bool pRefresh =
false);
199 bool pDisplayText =
true,
200 bool pRefresh =
false);
213 virtual void showMenu(
bool pBringToTop =
false);
240 virtual int height()
const override;
247 virtual int width()
const override;
288 virtual void setMenuHeight(
int pNewHeight,
bool pRefresh =
false);
298 virtual void toggleMenu(
bool pEnableMenu,
bool pRefresh =
true);
314 virtual std::string
cxTypeStr()
const override;
415 long doInputLoop(
bool pShowSelf,
bool& pRunOnLeaveFunction);
433 bool mUseAltMenuItemText =
false;
434 set<int> mDropDownKeys;
439 bool mRunValidatorFunction =
true;
453 long showMenuModal(
bool pShowMenu,
bool& pContinueOn);
A text box that also has a drop-down box with a list of items that the user can choose from.
Definition cxComboBox.h:50
void copyCxComboBoxStuff(const cxComboBox *pThatComboBox)
Makes a copy of a cxComboBox's member variables.
Definition cxComboBox.cpp:643
virtual bool removeFromMenu(const std::string &pItemText, bool pDisplayText=true, bool pRefresh=false)
Removes a menu item from the menu.
virtual void addDropDownKey(int pKey)
Adds a key that will show the drop-down menu.
Definition cxComboBox.cpp:499
virtual void showMenu(bool pBringToTop=false)
Shows the drop-down menu.
Definition cxComboBox.cpp:362
virtual int menuWidth() const
Returns the width of the menu portion of.
Definition cxComboBox.cpp:426
virtual void resize(int pNewHeight, int pNewWidth, bool pRefresh=true) override
Changes window's width and height. The window's upper-left.
Definition cxComboBox.cpp:232
virtual int inputWidth() const
Returns the width of the input portion of.
Definition cxComboBox.cpp:416
virtual bool getUseValidatorFunction() const override
Returns whether or not the validator function should be used.
Definition cxComboBox.cpp:524
virtual void unhide(bool pUnhideSubwindows=true) override
Un-hides the window.
Definition cxComboBox.cpp:321
virtual void removeAllItemsFromMenu()
Removes all items from the menu.
Definition cxComboBox.cpp:355
virtual void appendToMenu(const std::string &pDisplayText, const std::string &pItemText="", bool pRefresh=false, bool pBringToTop=false)
Adds a string item to the end of the menu.
Definition cxComboBox.cpp:330
virtual int menuHeight() const
Returns the height of the menu portion of.
Definition cxComboBox.cpp:421
virtual bool hasDropDownKey(int pKey) const
Returns whether or not a key is in the list of drop-down keys.
Definition cxComboBox.cpp:514
long doInputLoop(bool pShowSelf, bool &pRunOnLeaveFunction)
Handles the input loop. Returns cxID_QUIT or cxID_EXIT,.
Definition cxComboBox.cpp:543
virtual bool getUseAltMenuItemText() const
Returns whether or not the alternate text of the drop-down menu.
Definition cxComboBox.cpp:534
virtual bool move(int pNewRow, int pNewCol, bool pRefresh=true) override
Changes the window's position, based on a new upper-left corner.
Definition cxComboBox.cpp:272
virtual void setDropDownKey(int pKey)
Sets a single key that will show the drop-down menu.
Definition cxComboBox.cpp:493
virtual void setMenuHeight(int pNewHeight, bool pRefresh=false)
Allows the height of the menu portion to be changed.
Definition cxComboBox.cpp:431
virtual void erase(bool pEraseSubwindows=true) override
Erases the window.
Definition cxComboBox.cpp:309
bool menuIsModal() const
Returns whether or not the drop-down menu is modal.
Definition cxComboBox.cpp:666
virtual bool menuIsEnabled() const
Returns whether or not the menu is enabled.
Definition cxComboBox.cpp:478
virtual unsigned numMenuItems() const
Returns the number of items on the menu.
Definition cxComboBox.cpp:372
virtual void setUseAltMenuItemText(bool pUseAltMenuItemText)
Sets whether or not to use the alternate text for all items on.
Definition cxComboBox.cpp:529
virtual void hideMenu()
Hides the drop-down menu.
Definition cxComboBox.cpp:367
virtual void toggleMenu(bool pEnableMenu, bool pRefresh=true)
Enables or disables the menu.
Definition cxComboBox.cpp:436
virtual bool removeFromMenu(unsigned pItemIndex, bool pRefresh=false)
Removes a menu item from the menu.
Definition cxComboBox.cpp:344
virtual void removeDropDownKey(int pKey)
Removes a key from the list of keys that will show the.
Definition cxComboBox.cpp:509
virtual int height() const override
Returns the total height of the combo box, including.
Definition cxComboBox.cpp:382
virtual void setDropDownKeys(const set< int > &pKeys)
Sets the keys that will show the drop-down menu.
Definition cxComboBox.cpp:504
virtual int width() const override
Returns the width of the combo box.
Definition cxComboBox.cpp:404
virtual void toggleValidatorFunction(bool pRunValidatorFunction) override
Sets whether or not the validator function should be used.
Definition cxComboBox.cpp:519
cxMenu * getMenu()
Returns a pointer to the drop-down menu.
Definition cxComboBox.cpp:488
virtual ~cxComboBox()
Definition cxComboBox.cpp:85
virtual long showModal(bool pShowSelf=true, bool pBringToTop=true, bool pShowSubwindows=true) override
Shows the window and waits for input.
Definition cxComboBox.cpp:89
virtual std::string cxTypeStr() const override
Returns the name of the cxWidgets class. This can be used to.
Definition cxComboBox.cpp:483
virtual void hide(bool pHideSubwindows=true) override
Hides the window.
Definition cxComboBox.cpp:315
cxComboBox(cxWindow *pParentWindow=nullptr, int pRow=0, int pCol=0, int pHeight=DEFAULT_HEIGHT, int pWidth=DEFAULT_WIDTH, const std::string &pLabel="", eBorderStyle pBorderStyle=eBS_NOBORDER, eInputOptions pInputOption=eINPUT_EDITABLE, eInputTypes pInputType=eINPUT_TYPE_TEXT, std::string *pExtValue=nullptr, bool pMenuEnabled=true, int pRightLabelOffset=0, int pRightLabelHeight=1, int pRightLabelWidth=5, bool pShowRightLabel=false)
Default constructor.
virtual int inputHeight() const
Returns the height of the input portion of.
Definition cxComboBox.cpp:411
virtual std::string getItemText(int pIndex) const
Definition cxComboBox.cpp:377
Represents a text-based window on the screen. Can contain a title, status, and a message to appear wi...
Definition cxWindow.h:195
#define DEFAULT_HEIGHT
Definition cxWindow.h:68
#define DEFAULT_WIDTH
Definition cxWindow.h:69
cxBorderChars.h - Defines border characters to be used in drawing a box (i.e., in cxWindow and all it...
Definition cxApp.cpp:5
eInputTypes
Definition cxInputTypes.h:20
@ eINPUT_TYPE_TEXT
Definition cxInputTypes.h:21
eInputOptions
Definition cxInputOptions.h:20
@ eINPUT_EDITABLE
Definition cxInputOptions.h:21
eBorderStyle
Definition cxBorderStyles.h:26
@ eBS_NOBORDER
Definition cxBorderStyles.h:27