Skip to content

Commit ea96674

Browse files
committed
added addItems
1 parent 629a0b3 commit ea96674

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

src/YMGANCMenuBar.cc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,14 @@ void YMGANCMenuBar::addItem(YItem* item)
266266
assignUniqueIndex( item->childrenBegin(), item->childrenEnd() );
267267
}
268268

269+
void YMGANCMenuBar::addItems(const YItemCollection& itemCollection)
270+
{
271+
YSelectionWidget::addItems(itemCollection);
272+
273+
wRedraw();
274+
}
275+
276+
269277
void YMGANCMenuBar::wRedraw()
270278
{
271279
if ( !win )
@@ -355,12 +363,6 @@ void YMGANCMenuBar::wRedraw()
355363
}
356364

357365

358-
void YMGANCMenuBar::rebuildMenuTree()
359-
{
360-
// NOP
361-
}
362-
363-
364366
NCursesEvent YMGANCMenuBar::postMenu()
365367
{
366368
if (!d->selected)

src/YMGANCMenuBar.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,9 @@ class YMGANCMenuBar : public YMGAMenuBar, public NCWidget
5959

6060
virtual void setSize( int newWidth, int newHeight );
6161

62-
virtual void rebuildMenuTree();
63-
6462
virtual NCursesEvent wHandleHotkey( wint_t key );
6563
virtual NCursesEvent wHandleInput( wint_t key );
6664

67-
6865
virtual bool setKeyboardFocus()
6966
{
7067
if ( !grabFocus() )
@@ -82,6 +79,14 @@ class YMGANCMenuBar : public YMGAMenuBar, public NCWidget
8279
**/
8380
virtual void addItem( YItem * item );
8481

82+
/**
83+
* Add multiple items. For some UIs, this can be more efficient than
84+
* calling addItem() multiple times.
85+
*
86+
* Reimplemented from YSelectionWidget.
87+
**/
88+
virtual void addItems( const YItemCollection & itemCollection );
89+
8590
/**
8691
* Reimplemnted to check all the hotkeys from YMenuItems
8792
*

0 commit comments

Comments
 (0)