82 explicit cxMenu(
cxWindow *pParentWindow =
nullptr,
int pRow = 0,
int pCol = 0,
84 const std::string& pTitle =
"",
cxWindow *pExtTitleWindow =
nullptr,
85 cxWindow *pExtStatusWindow =
nullptr,
114 virtual void append(
const std::string& pDisplayText,
long pReturnCode,
115 const std::string& pHelpString =
"",
117 bool pResize =
false,
const std::string& pItemText =
"");
128 const std::string& pHelpString =
"",
129 bool pResize =
false);
140 const std::string& pHelpString =
"",
bool pResize =
false);
152 virtual bool remove(
unsigned pItemIndex,
bool pResize =
false,
153 bool pRefresh =
false);
169 virtual bool remove(
const std::string& pItemText,
bool pUseDisplayText =
true,
170 bool pResize =
false,
bool pRefresh =
false);
182 bool pRefresh =
false);
190 virtual void removeAllItems(
bool pResize =
false,
bool pRefresh =
false);
199 virtual void clear(
bool pRefresh =
false)
override;
216 virtual long showModal(
bool pShowSelf =
true,
bool pBringToTop =
true,
217 bool pShowSubwindows =
true)
override;
240 virtual void scrollItems(
int pScrollAmt,
bool pRefresh =
false);
262 virtual void setTopItem(
unsigned pTopItem,
bool pRefresh =
false);
270 virtual void setTopItem(
const std::string& pItemText,
bool pRefresh =
false);
278 virtual void setBottomItem(
unsigned pItemIndex,
bool pRefresh =
false);
288 virtual bool move(
int pNewRow,
int pNewCol,
bool pRefresh =
true)
override;
303 virtual void resize(
int pNewHeight,
int pNewWidth,
bool pRefresh =
false)
override;
320 virtual long show(
bool pBringToTop =
true,
bool pShowSubwindows =
true)
override;
325 virtual void erase(
bool pEraseSubwindows =
true)
override;
368 virtual long getReturnCode(
const std::string& pItemText,
bool pUseDisplayText =
true)
const;
387 virtual std::string
getItemText(
int pIndex,
bool pGetDisplayText =
true)
const;
492 virtual void setStatus(
const std::string& pStatus,
bool pRefreshStatus =
true)
override;
532 bool pSetAll =
false,
bool pRefresh =
false);
545 bool pRefresh =
false);
564 virtual bool itemExists(
const std::string& pItemText,
bool pUseDisplayText =
true)
const;
854 virtual std::string
cxTypeStr()
const override;
917 void *p2,
void *p3,
void *p4,
919 bool pRunOnLeaveFunction);
936 void *p2,
bool pExitAfterRun,
937 bool pRunOnLeaveFunction);
953 bool pRunOnLeaveFunction);
1027 WINDOW *mSubWindow =
nullptr;
1030 int mCurrentMenuItem = 0;
1031 int mTopMenuItem = 0;
1035 std::string mSearchText;
1036 std::string mLastSearchText;
1037 bool mClearOnSearch =
false;
1038 bool mCaseSensitiveSearch =
false;
1041 bool mCustomStatus =
false;
1042 bool mAllowQuit =
true;
1043 bool mAllowExit =
true;
1044 bool mSelectableItemExists =
false;
1046 bool mWaitForInputIfEmpty =
true;
1048 std::vector<long> mReturnCodes;
1049 std::vector<std::string> mHelpStrings;
1050 std::vector<cxMenuItemType> mItemTypes;
1051 std::vector<std::string> mAltItemText;
1055 std::map<int, cxMenu*> mSubMenus;
1056 std::set<unsigned> mUnselectableItems;
1059 std::shared_ptr<cxFunction> mLoopStartFunction;
1060 std::shared_ptr<cxFunction> mLoopEndFunction;
1064 std::shared_ptr<cxFunction> mOnSelectItemFunction;
1067 std::multimap<char, int> mItemHotkeys;
1075 unsigned int mItemHotkeyIndex = 0;
1078 int mLastItemHotkey =
NOKEY;
1082 bool mExitWhenLeaveFirst =
false;
1083 bool mExitWhenLeaveLast =
false;
1086 bool mRefreshItemsWhenModal =
false;
1090 int mNumParentMenus = 0;
1093 bool mExitOnOutsideClick =
false;
1096 bool mLastInputWasMouseEvent =
false;
1101 inline int getBottomItemIndex();
1106 inline long doSubmenu();
1115 void drawMenuItem(
int pItemIndex,
int pSubWinRow,
bool pRefreshSubwindow,
1116 bool pHighlight =
false);
1120 void addHotKey(
const std::string& pItemText);
1128 inline void useHelpAsStatus(
bool pRefreshStatus =
false);
1133 void fitItemsToWidth();
1139 void goToSelectableItem(
bool pForward,
bool pBringToTop);
1149 void scrollUpOne(
bool& pContinueOn);
1156 void scrollDownOne(
bool& pContinueOn);
1159 inline void doPgUp();
1162 inline void doPgDown();
1165 inline void reCreateSubWindow();
1168 inline void freeSubWindow();
1172 bool lookForSelectableItem();
1190 int firstSelectableItem()
const;
1194 int lastSelectableItem()
const;
1200 void highlightItem(
int pItemIndex);
1203 void freeOnSelectItemFunction();
1212 void runOnSelectItemFunction(
bool& pExitAfterRun,
1213 bool& pRunOnLeaveFunction);
1222 void checkEventFunctionPointers(
const cxMenu& pMenu);
Represents a text-based window on the screen. Can contain a title, status, and a message to appear wi...
Definition cxWindow.h:195
std::string(* funcPtr4)(void *p1, void *p2, void *p3, void *p4)
Definition cxFunction.h:21