]> git.mxchange.org Git - flightgear.git/blobdiff - PUI/puButton.cxx
Incorporated next version of PUI.
[flightgear.git] / PUI / puButton.cxx
index 24a9802e14a1db1e3713e43f70c613a7c6ad86ed..66ded922b3eaa14a32293182c6965dd8ab887437 100644 (file)
@@ -1,4 +1,5 @@
 
+
 #include "puLocal.h"
 
 void puButton::draw ( int dx, int dy )
@@ -7,8 +8,15 @@ void puButton::draw ( int dx, int dy )
 
   /* If button is pushed or highlighted - use inverse style for button itself */
 
-  abox . draw ( dx, dy, ( getValue() ^ highlighted ) ? -style : style, colour,
-                                            isReturnDefault() ) ;
+  int tempStyle;
+
+  if ( parent && ( ( parent->getType() & PUCLASS_POPUPMENU ) ||
+                   ( parent->getType() & PUCLASS_MENUBAR   ) ) )
+    tempStyle =  ( getValue() ^ highlighted ) ? PUSTYLE_SMALL_SHADED : style ;
+  else
+    tempStyle =  ( getValue() ^ highlighted ) ? -style : style ;
+
+  abox . draw ( dx, dy, tempStyle, colour, isReturnDefault() ) ;
 
   /* If greyed out then halve the opacity when drawing the label and legend */
 
@@ -18,7 +26,7 @@ void puButton::draw ( int dx, int dy )
     glColor4f ( colour [ PUCOL_LEGEND ][0],
                 colour [ PUCOL_LEGEND ][1],
                 colour [ PUCOL_LEGEND ][2],
-                colour [ PUCOL_LEGEND ][3] / 2.0 ) ; /* 50% more transparent */
+                colour [ PUCOL_LEGEND ][3] / 2.0f ) ; /* 50% more transparent */
 
   int xx = ( abox.max[0] - abox.min[0] - puGetStringWidth(legendFont,legend) ) / 2 ;
   int yy = ( abox.max[1] - abox.min[1] - puGetStringHeight(legendFont) ) / 2 ;
@@ -33,6 +41,8 @@ void puButton::draw ( int dx, int dy )
 
 void puButton::doHit ( int button, int updown, int, int )
 {
+
+
   if ( button == PU_LEFT_BUTTON )
   {
     if ( updown == active_mouse_edge || active_mouse_edge == PU_UP_AND_DOWN )
@@ -48,3 +58,4 @@ void puButton::doHit ( int button, int updown, int, int )
     lowlight () ;
 }
 
+