[bt-devel] question
Troy A. Griffitts
bt-devel@crosswire.org
Fri, 17 May 2002 08:52:49 -0700
Martin,
You could have a look at my qpsword app at:
http://www.crosswire.org/feeds/arm/qpsword-1.5.0-src.tar.gz
Here is an excerpt from: qpsword.cpp/QPSword::showTextContextMenu()
...
QPopupMenu * m = new QPopupMenu( this );
QPSword *app = (QPSword *)this->topLevelWidget();
int id = 0;
modsPopup = new QPopupMenu( this );
SWModule *module = 0;
for (ModMap::iterator it = mgr->Modules.begin(); it !=
mgr->Modules.end(); it++) {
module = it->second;
id = modsPopup->insertItem( module->Name(), app, SLOT(
chooseModule(int) ) );
modsPopup->setItemChecked(id, ((module == currentText)||(module
== currentLD)));
}
m->insertItem( tr( "Choose Module" ), modsPopup );
...
Hope this helps.
-Troy.
Martin Gruner wrote:
>
> Hm. Can somebody help me? How do I insert submenus in Popup menus? Is this
> possible easily?
>
> Martin
>
> Am Freitag, 17. Mai 2002 14:40 schrieb Martin Gruner:
> > I want to group the items in the module choosing popup, because the module
> > list already fills my whole screen. They should be put in submenus.
> >
> > Should I group them according to the first letter (A,B,...) or to the
> > language (de,en,...)? I'd suggest according to language.
> >
> > Martin
> >
> > Examples
> >
> >
> > A
> > ACV
> > ALB
> > ASV
> > B
> > ...
> >
> > ---
> >
> > de
> > GERLUT
> > GERELB
> > GERHOF
> > en
> > NIV
> > KJV
> > ....