Qt string requestor

Some enhancements to the widget used to get player input for
getline() and also menu search and text window search.

give caller control of [cancel] and [okay] button names;
give caller a say in how wide the string input box should be
  instead of basing that on the length of the prompt string
  (needs more work...);
use fixed-width font for displaying the user's input;
clean up the widget layout a little bit.

src/Makefile needs a dependency update for Qt (not included).
This commit is contained in:
PatR
2020-11-05 14:36:13 -08:00
parent 702e52b431
commit 24ec7f232c
3 changed files with 41 additions and 30 deletions
+7 -4
View File
@@ -19,10 +19,13 @@ private:
QPushButton* cancel;
public:
NetHackQtStringRequestor(QWidget *parent, const char* p,const char* cancelstr="Cancel");
void SetDefault(const char*);
bool Get(char* buffer, int maxchar=80);
virtual void resizeEvent(QResizeEvent*);
NetHackQtStringRequestor(QWidget *parent, const char *p,
const char *cancelstr = "Cancel",
const char *okaystr = "Okay");
void SetDefault(const char *);
// maxchar is size of buffer[], minchar is size of line edit widget
bool Get(char *buffer, int maxchar = 80, int minchar = 20);
virtual void resizeEvent(QResizeEvent *);
};
} // namespace nethack_qt_