Fix for Curtis so that the height of a title of a popup menu is not

affected by the height of the Fl_Menu_Button.


git-svn-id: file:///fltk/svn/fltk/trunk@340 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Bill Spitzak 1999-02-25 19:09:11 +00:00
parent 38d8473088
commit 82877b2eb6
3 changed files with 12 additions and 11 deletions

View File

@ -60,7 +60,7 @@ Widgets</A></B>
<UL> <UL>
<LI><A HREF=fluid.html#widget_attributes>Widget Attributes</A></LI> <LI><A HREF=fluid.html#widget_attributes>Widget Attributes</A></LI>
<LI><A HREF=fluid.html#widget_attributes>Selecting Moving Widgets</A></LI> <LI><A HREF=fluid.html#widget_attributes>Selecting Moving Widgets</A></LI>
<LI><A HREF=drawing.html#images>Image Labels</A></LI> <LI><A HREF=fluid.html#images>Image Labels</A></LI>
</UL> </UL>
<B><A HREF=opengl.html#opengl>9 - Using OpenGL</A></B> <B><A HREF=opengl.html#opengl>9 - Using OpenGL</A></B>
<BR> <BR>

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Menu.cxx,v 1.16 1999/02/19 15:34:08 mike Exp $" // "$Id: Fl_Menu.cxx,v 1.17 1999/02/25 19:09:10 bill Exp $"
// //
// Menu code for the Fast Light Tool Kit (FLTK). // Menu code for the Fast Light Tool Kit (FLTK).
// //
@ -92,7 +92,7 @@ public:
const Fl_Menu_Item* menu; const Fl_Menu_Item* menu;
menuwindow(const Fl_Menu_Item* m, int X, int Y, int W, int H, menuwindow(const Fl_Menu_Item* m, int X, int Y, int W, int H,
const Fl_Menu_Item* picked, const Fl_Menu_Item* title, const Fl_Menu_Item* picked, const Fl_Menu_Item* title,
int menubar = 0); int menubar = 0, int menubar_title = 0);
~menuwindow(); ~menuwindow();
void set_selected(int); void set_selected(int);
int find_selected(int mx, int my); int find_selected(int mx, int my);
@ -191,7 +191,7 @@ menutitle::menutitle(int X, int Y, int W, int H, const Fl_Menu_Item* L) :
menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp, menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp,
const Fl_Menu_Item* picked, const Fl_Menu_Item* t, const Fl_Menu_Item* picked, const Fl_Menu_Item* t,
int menubar) int menubar, int menubar_title)
: Fl_Menu_Window(X, Y, Wp, Hp, 0) : Fl_Menu_Window(X, Y, Wp, Hp, 0)
{ {
end(); end();
@ -252,8 +252,7 @@ menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp,
if (m) y(Y-1); else {y(Y-3); w(1); h(1);} if (m) y(Y-1); else {y(Y-3); w(1); h(1);}
if (t) { if (t) {
int ht = button && button->h() <= 100 ? button->h()-6 int ht = menubar_title ? button->h()-6 : Htitle+2*BW+3;
: Htitle+2*BW+3;
title = new menutitle(X, Y-ht-3, Wtitle, ht, t); title = new menutitle(X, Y-ht-3, Wtitle, ht, t);
} else } else
title = 0; title = 0;
@ -655,7 +654,8 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown(
} else { } else {
// delete all the old menus and create new one: // delete all the old menus and create new one:
while (p.nummenus > p.menu_number+1) delete p.p[--p.nummenus]; while (p.nummenus > p.menu_number+1) delete p.p[--p.nummenus];
p.p[p.nummenus++]= new menuwindow(menutable,nX,nY,title?1:0,0,0,title); p.p[p.nummenus++]= new menuwindow(menutable, nX, nY,
title?1:0, 0, 0, title, 0, menubar);
} }
} else { // !m->submenu(): } else { // !m->submenu():
while (p.nummenus > p.menu_number+1) delete p.p[--p.nummenus]; while (p.nummenus > p.menu_number+1) delete p.p[--p.nummenus];
@ -664,7 +664,7 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown(
fakemenu = new menuwindow(0, fakemenu = new menuwindow(0,
cw.x()+cw.titlex(p.item_number), cw.x()+cw.titlex(p.item_number),
cw.y()+cw.h(), 0, 0, cw.y()+cw.h(), 0, 0,
0, m); 0, m, 0, 1);
fakemenu->title->show(); fakemenu->title->show();
} }
} }
@ -710,5 +710,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
} }
// //
// End of "$Id: Fl_Menu.cxx,v 1.16 1999/02/19 15:34:08 mike Exp $". // End of "$Id: Fl_Menu.cxx,v 1.17 1999/02/25 19:09:10 bill Exp $".
// //

View File

@ -1,5 +1,5 @@
// //
// "$Id: menubar.cxx,v 1.5 1999/01/07 19:17:58 mike Exp $" // "$Id: menubar.cxx,v 1.6 1999/02/25 19:09:11 bill Exp $"
// //
// Menubar test program for the Fast Light Tool Kit (FLTK). // Menubar test program for the Fast Light Tool Kit (FLTK).
// //
@ -207,11 +207,12 @@ int main(int argc, char **argv) {
Fl_Toggle_Button t(250,50,150,25,"MicroSoft Style"); Fl_Toggle_Button t(250,50,150,25,"MicroSoft Style");
t.callback(button_cb); t.callback(button_cb);
window.resizable(&mb); window.resizable(&mb);
window.size_range(300,20);
window.end(); window.end();
window.show(argc, argv); window.show(argc, argv);
return Fl::run(); return Fl::run();
} }
// //
// End of "$Id: menubar.cxx,v 1.5 1999/01/07 19:17:58 mike Exp $". // End of "$Id: menubar.cxx,v 1.6 1999/02/25 19:09:11 bill Exp $".
// //