aboutsummaryrefslogtreecommitdiff
path: root/src/Windowmenu.cc
diff options
context:
space:
mode:
authorunknown <unknown>2002-01-11 11:59:54 (GMT)
committerunknown <unknown>2002-01-11 11:59:54 (GMT)
commit61661d638e34b3ce6c986d5a53b8c08c1051d422 (patch)
treef0b87676e95070afee163f76902efd0c4d5b5fe6 /src/Windowmenu.cc
parentf98c3c9045397bd9497621deb55b310366f8a5de (diff)
parenta3d2a1cf0a5ab724e19a91915fe97842f52260d5 (diff)
downloadfluxbox-c325ffaa4e094163340f957e87463c8a526b4d5b.zip
fluxbox-c325ffaa4e094163340f957e87463c8a526b4d5b.tar.bz2
This commit was manufactured by cvs2svn to create tagRelease-0_1_6
'Release-0_1_6'.
Diffstat (limited to 'src/Windowmenu.cc')
-rw-r--r--src/Windowmenu.cc67
1 files changed, 37 insertions, 30 deletions
diff --git a/src/Windowmenu.cc b/src/Windowmenu.cc
index 159f090..c776981 100644
--- a/src/Windowmenu.cc
+++ b/src/Windowmenu.cc
@@ -79,7 +79,7 @@ Windowmenu::Windowmenu(FluxboxWindow *win) : Basemenu(win->getScreen()) {
79 0, 0, 79 0, 0,
80#endif // NLS 80#endif // NLS
81 "Shade"), 81 "Shade"),
82 BScreen::WindowShade); 82 BScreen::WINDOWSHADE);
83 insert(i18n->getMessage( 83 insert(i18n->getMessage(
84#ifdef NLS 84#ifdef NLS
85 WindowmenuSet, WindowmenuIconify, 85 WindowmenuSet, WindowmenuIconify,
@@ -87,7 +87,7 @@ Windowmenu::Windowmenu(FluxboxWindow *win) : Basemenu(win->getScreen()) {
87 0, 0, 87 0, 0,
88#endif // NLS 88#endif // NLS
89 "Iconify"), 89 "Iconify"),
90 BScreen::WindowIconify); 90 BScreen::WINDOWICONIFY);
91 insert(i18n->getMessage( 91 insert(i18n->getMessage(
92#ifdef NLS 92#ifdef NLS
93 WindowmenuSet, WindowmenuMaximize, 93 WindowmenuSet, WindowmenuMaximize,
@@ -95,7 +95,7 @@ Windowmenu::Windowmenu(FluxboxWindow *win) : Basemenu(win->getScreen()) {
95 0, 0, 95 0, 0,
96#endif // NLS 96#endif // NLS
97 "Maximize"), 97 "Maximize"),
98 BScreen::WindowMaximize); 98 BScreen::WINDOWMAXIMIZE);
99 insert(i18n->getMessage( 99 insert(i18n->getMessage(
100#ifdef NLS 100#ifdef NLS
101 WindowmenuSet, WindowmenuRaise, 101 WindowmenuSet, WindowmenuRaise,
@@ -103,7 +103,7 @@ Windowmenu::Windowmenu(FluxboxWindow *win) : Basemenu(win->getScreen()) {
103 0, 0, 103 0, 0,
104#endif // NLS 104#endif // NLS
105 "Raise"), 105 "Raise"),
106 BScreen::WindowRaise); 106 BScreen::WINDOWRAISE);
107 insert(i18n->getMessage( 107 insert(i18n->getMessage(
108#ifdef NLS 108#ifdef NLS
109 WindowmenuSet, WindowmenuLower, 109 WindowmenuSet, WindowmenuLower,
@@ -111,7 +111,7 @@ Windowmenu::Windowmenu(FluxboxWindow *win) : Basemenu(win->getScreen()) {
111 0, 0, 111 0, 0,
112#endif // NLS 112#endif // NLS
113 "Lower"), 113 "Lower"),
114 BScreen::WindowLower); 114 BScreen::WINDOWLOWER);
115 insert(i18n->getMessage( 115 insert(i18n->getMessage(
116#ifdef NLS 116#ifdef NLS
117 WindowmenuSet, WindowmenuStick, 117 WindowmenuSet, WindowmenuStick,
@@ -119,7 +119,7 @@ Windowmenu::Windowmenu(FluxboxWindow *win) : Basemenu(win->getScreen()) {
119 0, 0, 119 0, 0,
120#endif // NLS 120#endif // NLS
121 "Stick"), 121 "Stick"),
122 BScreen::WindowStick); 122 BScreen::WINDOWSTICK);
123 insert(i18n->getMessage( 123 insert(i18n->getMessage(
124#ifdef NLS 124#ifdef NLS
125 WindowmenuSet, WindowmenuKillClient, 125 WindowmenuSet, WindowmenuKillClient,
@@ -127,7 +127,7 @@ Windowmenu::Windowmenu(FluxboxWindow *win) : Basemenu(win->getScreen()) {
127 0, 0, 127 0, 0,
128#endif // NLS 128#endif // NLS
129 "Kill Client"), 129 "Kill Client"),
130 BScreen::WindowKill); 130 BScreen::WINDOWKILL);
131 insert(i18n->getMessage( 131 insert(i18n->getMessage(
132#ifdef NLS 132#ifdef NLS
133 WindowmenuSet, WindowmenuClose, 133 WindowmenuSet, WindowmenuClose,
@@ -135,18 +135,24 @@ Windowmenu::Windowmenu(FluxboxWindow *win) : Basemenu(win->getScreen()) {
135 0, 0, 135 0, 0,
136#endif // NLS 136#endif // NLS
137 "Close"), 137 "Close"),
138 BScreen::WindowClose); 138 BScreen::WINDOWCLOSE);
139 insert(i18n->getMessage(
140#ifdef NLS
141 WindowmenuSet, WindowmenuTab,
142#else // !NLS
143 0, 0,
144#endif // NLS
145 "Tab"),
146 BScreen::WINDOWTAB);
139 147
140 //TODO: nls
141 insert("Tab", BScreen::WindowTab);
142
143 update(); 148 update();
144 149
145 setItemEnabled(1, window->hasTitlebar()); 150 setItemEnabled(2, window->hasTitlebar());
146 setItemEnabled(2, window->isIconifiable()); 151 setItemEnabled(3, window->isIconifiable());
147 setItemEnabled(3, window->isMaximizable()); 152 setItemEnabled(4, window->isMaximizable());
148 setItemEnabled(8, window->isClosable()); 153 setItemEnabled(9, window->isClosable());
149 setItemEnabled(9, window->hasTab()); 154 setItemEnabled(10, window->hasTab());
155
150} 156}
151 157
152 158
@@ -157,9 +163,9 @@ Windowmenu::~Windowmenu(void) {
157 163
158 164
159void Windowmenu::show(void) { 165void Windowmenu::show(void) {
160 if (isItemEnabled(1)) setItemSelected(1, window->isShaded()); 166 if (isItemEnabled(2)) setItemSelected(2, window->isShaded());
161 if (isItemEnabled(3)) setItemSelected(3, window->isMaximized()); 167 if (isItemEnabled(4)) setItemSelected(4, window->isMaximized());
162 if (isItemEnabled(6)) setItemSelected(6, window->isStuck()); 168 if (isItemEnabled(7)) setItemSelected(7, window->isStuck());
163 169
164 Basemenu::show(); 170 Basemenu::show();
165} 171}
@@ -169,49 +175,50 @@ void Windowmenu::itemSelected(int button, int index) {
169 BasemenuItem *item = find(index); 175 BasemenuItem *item = find(index);
170 176
171 switch (item->function()) { 177 switch (item->function()) {
172 case BScreen::WindowShade: 178 case BScreen::WINDOWSHADE:
173 hide(); 179 hide();
174 if (window->getTab()) 180
175 window->getTab()->shade();
176 window->shade(); 181 window->shade();
182 if (window->hasTab())
183 window->getTab()->shade();
177 break; 184 break;
178 185
179 case BScreen::WindowIconify: 186 case BScreen::WINDOWICONIFY:
180 hide(); 187 hide();
181 window->iconify(); 188 window->iconify();
182 break; 189 break;
183 190
184 case BScreen::WindowMaximize: 191 case BScreen::WINDOWMAXIMIZE:
185 hide(); 192 hide();
186 window->maximize((unsigned int) button); 193 window->maximize((unsigned int) button);
187 break; 194 break;
188 195
189 case BScreen::WindowClose: 196 case BScreen::WINDOWCLOSE:
190 hide(); 197 hide();
191 window->close(); 198 window->close();
192 break; 199 break;
193 200
194 case BScreen::WindowRaise: 201 case BScreen::WINDOWRAISE:
195 hide(); 202 hide();
196 screen->getWorkspace(window->getWorkspaceNumber())->raiseWindow(window); 203 screen->getWorkspace(window->getWorkspaceNumber())->raiseWindow(window);
197 break; 204 break;
198 205
199 case BScreen::WindowLower: 206 case BScreen::WINDOWLOWER:
200 hide(); 207 hide();
201 screen->getWorkspace(window->getWorkspaceNumber())->lowerWindow(window); 208 screen->getWorkspace(window->getWorkspaceNumber())->lowerWindow(window);
202 break; 209 break;
203 210
204 case BScreen::WindowStick: 211 case BScreen::WINDOWSTICK:
205 hide(); 212 hide();
206 window->stick(); 213 window->stick();
207 break; 214 break;
208 215
209 case BScreen::WindowKill: 216 case BScreen::WINDOWKILL:
210 hide(); 217 hide();
211 XKillClient(screen->getBaseDisplay()->getXDisplay(), 218 XKillClient(screen->getBaseDisplay()->getXDisplay(),
212 window->getClientWindow()); 219 window->getClientWindow());
213 break; 220 break;
214 case BScreen::WindowTab: 221 case BScreen::WINDOWTAB:
215 hide(); 222 hide();
216 window->setTab(!window->hasTab()); 223 window->setTab(!window->hasTab());
217 break; 224 break;