Author: matt
Date: 2012-08-16 14:35:14 -0700 (Thu, 16 Aug 2012)
New Revision: 9668
Log:
STR 2711: another try at fixing the text position in Menu_Button. The label
does move a little bit to the left, so it may be necessary to make these
buttons larger for long text. It does reduce the risk of overlapping text
though.
Modified:
branches/branch-1.3/src/Fl_Menu_Button.cxx
Modified: branches/branch-1.3/src/Fl_Menu_Button.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Menu_Button.cxx 2012-08-16 21:02:23 UTC (rev
9667)
+++ branches/branch-1.3/src/Fl_Menu_Button.cxx 2012-08-16 21:35:14 UTC (rev
9668)
@@ -23,21 +23,23 @@
static Fl_Menu_Button *pressed_menu_button_ = 0;
+
void Fl_Menu_Button::draw() {
if (!box() || type()) return;
+ int H = (labelsize()-3)&-2;
+ int X = x()+w()-H-Fl::box_dx(box())-Fl::box_dw(box())-1;
+ int Y = y()+(h()-H)/2;
draw_box(pressed_menu_button_ == this ? fl_down(box()) : box(), color());
- draw_label();
+ draw_label(x()+Fl::box_dx(box()), y(), X-x()+2, h());
if (Fl::focus() == this) draw_focus();
// ** if (box() == FL_FLAT_BOX) return; // for XForms compatibility
- int H = (labelsize()-3)&-2;
- int X = x()+w()-H*2;
- int Y = y()+(h()-H)/2;
fl_color(active_r() ? FL_DARK3 : fl_inactive(FL_DARK3));
fl_line(X+H/2, Y+H, X, Y, X+H, Y);
fl_color(active_r() ? FL_LIGHT3 : fl_inactive(FL_LIGHT3));
fl_line(X+H, Y, X+H/2, Y+H);
}
+
/**
Act exactly as though the user clicked the button or typed the
shortcut key. The menu appears, it waits for the user to pick an item,
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit