libyui-ncurses
Loading...
Searching...
No Matches
NCMenuBar.h
1
/*
2
Copyright (C) 2020 SUSE LLC
3
This library is free software; you can redistribute it and/or modify
4
it under the terms of the GNU Lesser General Public License as
5
published by the Free Software Foundation; either version 2.1 of the
6
License, or (at your option) version 3.0 of the License. This library
7
is distributed in the hope that it will be useful, but WITHOUT ANY
8
WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10
License for more details. You should have received a copy of the GNU
11
Lesser General Public License along with this library; if not, write
12
to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13
Floor, Boston, MA 02110-1301 USA
14
*/
15
16
17
/*-/
18
19
File: NCMenuBar.h
20
21
Author: Jose Iván López <jlopez@suse.de>
22
23
/-*/
24
25
26
#ifndef NCMenuBar_h
27
#define NCMenuBar_h
28
29
#include <yui/YMenuBar.h>
30
#include "NCWidget.h"
31
#include "CyclicContainer.h"
32
33
class
NCMenuBar
:
public
YMenuBar,
public
NCWidget
34
{
35
public
:
39
NCMenuBar
( YWidget * parent );
40
44
virtual
~NCMenuBar
();
45
51
virtual
void
rebuildMenuTree
();
52
58
virtual
void
setItemEnabled
( YMenuItem * item,
bool
enabled );
59
65
virtual
void
setItemVisible
( YMenuItem * item,
bool
visible );
66
75
virtual
void
activateItem
( YMenuItem * item );
76
81
virtual
NCursesEvent
wHandleInput
( wint_t key );
82
87
virtual
int
preferredWidth
();
88
93
virtual
int
preferredHeight
();
94
99
virtual
void
setSize
(
int
newWidth,
int
newHeight );
100
105
virtual
void
setEnabled
(
bool
enabled );
106
111
virtual
bool
setKeyboardFocus
();
112
117
virtual
NCursesEvent
wHandleHotkey
( wint_t key );
118
123
virtual
bool
HasHotkey
(
int
key ) ;
124
130
virtual
void
shortcutChanged
();
131
132
protected
:
133
137
void
clear
();
138
139
virtual
const
char
* location()
const
{
return
"NCMenuBar"
; }
140
144
virtual
void
wRedraw
();
145
150
NCursesEvent
postMenu
();
151
152
private
:
153
154
struct
Menu
;
155
156
friend
std::ostream & operator<<( std::ostream & str,
157
const
NCMenuBar
& obj );
158
159
// Disable assignment operator and copy constructor
160
161
NCMenuBar
& operator=(
const
NCMenuBar
& );
162
NCMenuBar
(
const
NCMenuBar
& );
163
168
NCursesEvent
handlePostMenu(
const
NCursesEvent
& event );
169
173
Menu
* selectedMenu();
174
178
void
selectNextMenu();
179
183
void
selectPreviousMenu();
184
189
CyclicContainer<Menu>::Iterator findMenuWithHotkey( wint_t key );
190
196
const
NCstyle::StWidget
& menuStyle(
const
Menu
* menu );
197
203
CyclicContainer<Menu> _menus;
204
205
};
// NCMenuBar
206
207
#endif
// NCMenuBar_h
NCMenuBar
Definition
NCMenuBar.h:34
NCMenuBar::HasHotkey
virtual bool HasHotkey(int key)
Definition
NCMenuBar.cc:295
NCMenuBar::wHandleInput
virtual NCursesEvent wHandleInput(wint_t key)
Definition
NCMenuBar.cc:220
NCMenuBar::clear
void clear()
Definition
NCMenuBar.cc:88
NCMenuBar::setKeyboardFocus
virtual bool setKeyboardFocus()
Definition
NCMenuBar.cc:285
NCMenuBar::preferredWidth
virtual int preferredWidth()
Definition
NCMenuBar.cc:256
NCMenuBar::setSize
virtual void setSize(int newWidth, int newHeight)
Definition
NCMenuBar.cc:270
NCMenuBar::wHandleHotkey
virtual NCursesEvent wHandleHotkey(wint_t key)
Definition
NCMenuBar.cc:305
NCMenuBar::postMenu
NCursesEvent postMenu()
Definition
NCMenuBar.cc:165
NCMenuBar::NCMenuBar
NCMenuBar(YWidget *parent)
Definition
NCMenuBar.cc:74
NCMenuBar::shortcutChanged
virtual void shortcutChanged()
Definition
NCMenuBar.cc:320
NCMenuBar::setEnabled
virtual void setEnabled(bool enabled)
Definition
NCMenuBar.cc:277
NCMenuBar::setItemEnabled
virtual void setItemEnabled(YMenuItem *item, bool enabled)
Definition
NCMenuBar.cc:187
NCMenuBar::wRedraw
virtual void wRedraw()
Definition
NCMenuBar.cc:137
NCMenuBar::activateItem
virtual void activateItem(YMenuItem *item)
Definition
NCMenuBar.cc:205
NCMenuBar::rebuildMenuTree
virtual void rebuildMenuTree()
Definition
NCMenuBar.cc:100
NCMenuBar::preferredHeight
virtual int preferredHeight()
Definition
NCMenuBar.cc:263
NCMenuBar::~NCMenuBar
virtual ~NCMenuBar()
Definition
NCMenuBar.cc:81
NCMenuBar::setItemVisible
virtual void setItemVisible(YMenuItem *item, bool visible)
Definition
NCMenuBar.cc:196
NCWidget
Definition
NCWidget.h:46
NCursesEvent
Definition
NCurses.h:73
NCMenuBar::Menu
Definition
NCMenuBar.cc:44
NCstyle::StWidget
Definition
NCstyle.h:358
src
NCMenuBar.h
Generated by
1.10.0