diff options
Diffstat (limited to 'src/Fl_Menu.cxx')
| -rw-r--r-- | src/Fl_Menu.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index c574d32b1..acddc4e91 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -345,7 +345,8 @@ public: \return 1 if the coordinates are inside any of the menuwindows */ bool Menu_State::is_inside(int mx, int my) { - for (menu_index_t i=num_menus-1; i>=0; i--) { + menu_index_t i; + for (i =num_menus-1; i>=0; i--) { if (menu_window[i]->is_inside(mx, my)) { return true; } @@ -434,7 +435,8 @@ bool Menu_State::prev_item(menu_index_t menu) { // previous item in menu menu if \return 1 if the shortcut was found in the menu and handled. */ int Menu_State::handle_shortcut() { - for (menu_index_t mymenu = num_menus; mymenu--;) { + menu_index_t mymenu; + for (mymenu = num_menus; mymenu--;) { Menu_Window &mw = *(menu_window[mymenu]); int item; const Fl_Menu_Item* m = mw.menu->find_shortcut(&item); @@ -672,7 +674,8 @@ bool Menu_State::create_submenu(const Fl_Rect &r, Menu_Window& cw, const Fl_Menu int dx = n->x()-nX; int waX, waY, waW, waH; Fl_Window_Driver::driver(n)->menu_window_area(waX, waY, waW, waH, Fl::screen_num(r.x(), r.y())); - for (menu_index_t menu = 0; menu <= current_menu_ix; menu++) { + menu_index_t menu; + for (menu = 0; menu <= current_menu_ix; menu++) { Menu_Window* tt = menu_window[menu]; int nx = tt->x()+dx; if (nx < waX) {nx = waX; dx = -tt->x() + waX;} int ny = tt->y()+dy; if (ny < waY) {ny = waY; dy = -tt->y() + waY;} @@ -1411,7 +1414,8 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( button = pbutton; if (pbutton && pbutton->window()) { Menu_Window::parent_ = pbutton->top_window(); - for (Fl_Window* w = pbutton->window(); w; w = w->window()) { + Fl_Window *w; + for (w = pbutton->window(); w; w = w->window()) { X += w->x(); Y += w->y(); } @@ -1464,7 +1468,8 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( // make sure all the menus are shown: { - for (menu_index_t k = menubar ? 1 : 0; k < pp.num_menus; k++) { + menu_index_t k; + for (k = menubar ? 1 : 0; k < pp.num_menus; k++) { if (!pp.menu_window[k]->shown()) { if (pp.menu_window[k]->title) pp.menu_window[k]->title->show(); pp.menu_window[k]->show(); |
