Reimplemented from OglGui::Button. Definition at line 66 of file DirectionButton.h. References OglGui::Button::DisplayFunc(), OglGui::Window::GetState(), OglGui::Button::IsPressed(), mDirection, mDirectionFeedback, mDoDrawDirection, mFeedbackColor, mFixedArrowSize, OglGui::Window::mForeGroundColor, mIsClosed, mIsFilled, mMargin, OglGui::OglWindow::WndHeight(), and OglGui::OglWindow::WndWidth(). 00067 { 00068 float coords[6]; 00069 float hW = WndWidth()/2.0f; 00070 float hH = WndHeight()/2.0f; 00071 ULONG col = mForeGroundColor; 00072 int marginW = mMargin; 00073 int marginH = mMargin; 00074 OGC myOGC; 00075 00076 Button::DisplayFunc(); 00077 00078 if (!mDoDrawDirection) // Enable the user to choose text instead 00079 return; 00080 00081 marginW = (int) ((marginW < hW/2) ? marginW : hW/2); 00082 marginH = (int) ((marginH < hH/2) ? marginH : hH/2); 00083 00084 OGCSave(&myOGC); 00085 glPushMatrix(); 00086 00087 OGCSetPolyFillMode(theOGC,3); 00088 00089 glTranslatef(hW+(IsPressed()?1:0), hH+(IsPressed()?-1:0), 0.0f); 00090 if ((mDirection%4) != 0) 00091 glRotatef(mDirection*90.0f, 0.0f, 0.0f, 1.0f); 00092 00093 if (mDirection%2) 00094 { 00095 hH = hW; 00096 hW = WndHeight()/2.0f; 00097 } 00098 if (mFixedArrowSize>0) 00099 { 00100 hH = hW = mFixedArrowSize/2; 00101 marginH = marginW = 0; 00102 } 00103 coords[0] = -hW+marginH; 00104 coords[1] = -hH+marginW; 00105 00106 coords[2] = hW-marginH; 00107 coords[3] = 0; 00108 00109 coords[4] = -hW+marginH; 00110 coords[5] = hH-marginW; 00111 00112 if (mIsFilled || (mDirectionFeedback && GetState()==2)) 00113 { 00114 col = (mDirectionFeedback && GetState()==2) ? 00115 mFeedbackColor : mForeGroundColor; 00116 if (!GetState()) 00117 col = oglLIGHTGREY; 00118 SetSolidFillColor(col); 00119 FillTriangles(coords,3); 00120 } 00121 else 00122 { 00123 if (!GetState()) 00124 col = oglLIGHTGREY; 00125 SetSolidLineColor(col); 00126 if (mIsClosed) 00127 DrawTriangles(coords,3); 00128 else 00129 DrawLineStrip(coords,3); 00130 } 00131 00132 glPopMatrix(); 00133 OGCRestore(&myOGC); 00134 }
Here is the call graph for this function:
|