add support for MENU_ITEMFLAGS_SKIPINVERT
Able to test: win/tty win/win32 win/curses Unable to test: win/X11 win/Qt win/Qt3 win/gem win/gnome
This commit is contained in:
+2
-3
@@ -376,13 +376,12 @@ void NetHackQtBind::qt_start_menu(winid wid)
|
||||
|
||||
void NetHackQtBind::qt_add_menu(winid wid, int glyph,
|
||||
const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr,
|
||||
const char *str, unsigned int itemflags)
|
||||
const char *str, unsigned itemflags)
|
||||
{
|
||||
boolean presel = ((itemflags & MENU_ITEMFLAGS_SELECTED) != 0);
|
||||
NetHackQtWindow* window=id_to_window[(int)wid];
|
||||
window->AddMenu(glyph, identifier, ch, gch, attr,
|
||||
QString::fromLatin1(str),
|
||||
presel);
|
||||
itemflags);
|
||||
}
|
||||
|
||||
void NetHackQtBind::qt_end_menu(winid wid, const char *prompt)
|
||||
|
||||
+3
-1
@@ -160,8 +160,9 @@ NetHackQtMenuWindow::MenuItem::~MenuItem()
|
||||
}
|
||||
|
||||
void NetHackQtMenuWindow::AddMenu(int glyph, const ANY_P* identifier,
|
||||
char ch, char gch, int attr, const QString& str, bool presel)
|
||||
char ch, char gch, int attr, const QString& str, unsigned itemflags)
|
||||
{
|
||||
bool presel = (itemflags & MENU_ITEMFLAGS_SELECTED) != 0;
|
||||
if (!ch && identifier->a_void!=0) {
|
||||
// Supply a keyboard accelerator. Limited supply.
|
||||
static char accel[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
@@ -180,6 +181,7 @@ void NetHackQtMenuWindow::AddMenu(int glyph, const ANY_P* identifier,
|
||||
itemlist[itemcount].attr=attr;
|
||||
itemlist[itemcount].str=str;
|
||||
itemlist[itemcount].selected=presel;
|
||||
itemlist[itemcount].itemflags=itemflags;
|
||||
itemlist[itemcount].count=-1;
|
||||
itemlist[itemcount].color = -1;
|
||||
// Display the boulder symbol correctly
|
||||
|
||||
+3
-2
@@ -55,7 +55,7 @@ public:
|
||||
|
||||
virtual void StartMenu();
|
||||
virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
|
||||
const QString& str, bool presel);
|
||||
const QString& str, unsigned itemflags);
|
||||
virtual void EndMenu(const QString& prompt);
|
||||
virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
|
||||
|
||||
@@ -85,6 +85,7 @@ private:
|
||||
char ch;
|
||||
char gch;
|
||||
bool selected;
|
||||
unsigned itemflags;
|
||||
unsigned color;
|
||||
|
||||
bool Selectable() const { return identifier.a_void!=0; }
|
||||
@@ -172,7 +173,7 @@ public:
|
||||
// Menu
|
||||
virtual void StartMenu();
|
||||
virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
|
||||
const QString& str, bool presel);
|
||||
const QString& str, unsigned itemflags);
|
||||
virtual void EndMenu(const QString& prompt);
|
||||
virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user