Author: matt
Date: 2012-08-16 14:41:30 -0700 (Thu, 16 Aug 2012)
New Revision: 9669
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-3.0/src/fltk3/MenuButton.cxx

Modified: branches/branch-3.0/src/fltk3/MenuButton.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/MenuButton.cxx        2012-08-16 21:35:14 UTC 
(rev 9668)
+++ branches/branch-3.0/src/fltk3/MenuButton.cxx        2012-08-16 21:41:30 UTC 
(rev 9669)
@@ -36,10 +36,10 @@
 void fltk3::MenuButton::draw() {
   if (!box() || type()) return;
   int H = (labelsize()-3)&-2;
-  int X = w()-H*2;
+  int X = w()-H-fltk3::box_dx(box())-fltk3::box_dw(box())-1;
   int Y = (h()-H)/2;
   draw_box(pressed_menu_button_ == this ? fltk3::down(box()) : box(), color());
-  draw_label(fltk3::box_dx(box()), 0, X-fltk3::box_dw(box()), h());
+  draw_label(fltk3::box_dx(box()), 0, X, h());
   if (fltk3::focus() == this) draw_focus();
   // ** if (box() == fltk3::FLAT_BOX) return; // for XForms compatibility
   fltk3::color(active_r() ? fltk3::DARK3 : fltk3::inactive(fltk3::DARK3));
@@ -48,6 +48,7 @@
   fltk3::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

Reply via email to