Author: gs Date: Wed Sep 26 10:17:03 2007 New Revision: 41100 URL: http://svn.opensuse.org/viewcvs/yast?rev=41100&view=rev Log: create NCPopupMenu with 'new' Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc?rev=41100&r1=41099&r2=41100&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc Wed Sep 26 10:17:03 2007 @@ -193,18 +193,22 @@ NCursesEvent NCMenuButton::postMenu() { wpos at( ScreenPos() + wpos( win->height(), 0 ) ); - NCPopupMenu dialog( at, *getToplevelMenu() ); - int selection = dialog.post(); + NCPopupMenu * dialog = new NCPopupMenu( at, *getToplevelMenu() ); + int selection = dialog->post(); - if ( selection < 0 ) + if ( selection < 0 ) { + YDialog::deleteTopmostDialog(); return NCursesEvent::none; - + } + NCursesEvent ret = NCursesEvent::menu; - // FIXME + // FIXME - check this YCPValue value = indexToId( selection ); YStringWidgetID * selectionID = new YStringWidgetID( value->toString()); ret.selection = selectionID; + YDialog::deleteTopmostDialog(); + return ret; } Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc?rev=41100&r1=41099&r2=41100&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc Wed Sep 26 10:17:03 2007 @@ -103,8 +103,9 @@ if ( menu.itemList()[selection]->hasChildren() ) { // post submenu wpos at( ScreenPos() + wpos( selection, inparent.Sze.W - 1 ) ); - NCPopupMenu dialog( at, *menu.itemList()[selection] ); - again = (dialog.post( &postevent ) == NCursesEvent::CONTINUE); + NCPopupMenu * dialog = new NCPopupMenu( at, *menu.itemList()[selection] ); + again = (dialog->post( &postevent ) == NCursesEvent::CONTINUE); + YDialog::deleteTopmostDialog(); } else { // store selection postevent.detail = menu.itemList()[selection]->getIndex(); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org