11 #define max(a,b) (((a) > (b)) ? (a) : (b))
15 #define min(a,b) (((a) < (b)) ? (a) : (b))
32 unsigned int centerx,
unsigned int centery,
int windowWidth,
int windowHeight)
35 this->centerx = centerx;
36 this->centery = centery;
39 this->windowWidth = windowWidth;
40 this->windowHeight = windowHeight;
41 this->outerBorder = outerBorder;
42 this->innerBorder = innerBorder;
44 memcpy(mouseOverColor,colorYellow,4*
sizeof(GLfloat));
45 memcpy(normalColor,colorGreen,4*
sizeof(GLfloat));
46 memcpy(inactiveColor,colorWhite,4*
sizeof(GLfloat));
48 memcpy(normalFrameColor,colorLightGrey,4*
sizeof(GLfloat));
49 memcpy(clickedFrameColor,colorBlue,4*
sizeof(GLfloat));
50 memcpy(inactiveFrameColor,colorDarkblue,4*
sizeof(GLfloat));
56 messageWidth = (
max(text.length(),minLength)+1)*(tf->
getWidth());
70 this->centerx = centerx;
71 this->centery = centery;
76 this->windowWidth = wwidth;
77 this->windowHeight = wheight;
82 if (!on)
return false;
92 if (!on || !active)
return;
99 return 2*innerBorder+2*outerBorder+messageWidth;
104 return 2*innerBorder+2*outerBorder+messageHeight;
114 return messageHeight;
123 glPushAttrib( GL_ALL_ATTRIB_BITS );
125 glDisable( GL_TEXTURE_2D);
126 glDisable( GL_LIGHTING );
127 glDisable( GL_BLEND );
129 glColor3fv( colorDarkGrey );
130 Shapes::drawRect( centerx, centery, 0, messageWidth+2*innerBorder+2*outerBorder, messageHeight+2*innerBorder+2*outerBorder );
132 glColor3fv( normalFrameColor);
135 glColor3fv( clickedFrameColor);
138 glColor3fv( inactiveFrameColor);
140 Shapes::drawRect( centerx, centery, 0, messageWidth+2*innerBorder, messageHeight+2*innerBorder);
142 glColor3fv( colorBlack );
145 glColor3fv(normalColor);
148 glColor3fv(mouseOverColor);
150 glColor3fv(inactiveColor);
153 const char * chartext = text.c_str();
154 glEnable( GL_BLEND );
155 glEnable( GL_TEXTURE_2D );
157 tf->
print(centerx-messageWidth/2, centery-messageHeight/2, chartext);
165 return (on && active && clicked);