开发者

Embed textbox in menu item

this is a proof of concept question. I am designing a GUI for way point editing of air traffic participants in a flight simulation application. In the current concept parameters of a selected way point are shown in bunch of text boxes. This input mask serves as both a view into the data as well as an edit mask. Once fields have been edited the user can either:

  • save changes to the way point
  • create a new way point based on the input

This design avoids reentering data if only some subset of parameters need to be changed for the new way point.

There is only one problem: where to insert the way point? My answer is a drop down menu on the "Save as new"-button having the following menu items:

开发者_高级运维
  • as first way point of Flight Plan
  • previous to selected way point
  • after selected way point
  • as last way point of flight plan
  • at index position

The last item is the tricky one. The index position needs to be entered by the user and I would like to avoid a popup window only asking for a single value.

My idea is this: embed a textbox into the menu item.

Is this aproach feasible in QT or wxWidgets? What do you think about the GUI desing?

Regards, Arne

PS: note that this is all at concept stage. The group has not even decided on the GUI framework to use: Qt or wxWidgets.


your approach is completely feasible in QT. You can have controls\widgets as QMenu items using QWidgetAction. Below is an example:

QPushButton *button = new QPushButton("test button", this);
QMenu *menu = new QMenu(button);
QLineEdit *edit = new QLineEdit(menu);
QAction *action0 = new QAction("menu item", this);
QWidgetAction *action1 = new QWidgetAction(menu);

button->setMenu(menu);
action1->setDefaultWidget(edit);

menu->addAction(action0);
menu->addAction(action1);

hope this helps, regards


This is definitely not possible with any Mac OS X native API, so no, it's not possible with any official wxWidgets API (though it might be with wxFlatMenuBar).

Either way, if you plan on releasing on OSX (as assumed since you're considering wx or qt), you really should be aware that your OSX users are going to despise you for putting a text input control on a menu where it doesn't belong. Your Windows users will be much more forgiving. I would urge you to take the time to come up with a better, more standard UI design for this action, I guarantee there's one out there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜