Reimplemented from OglGui::Window. Definition at line 55 of file ProgressBar.h. References OglGui::OglWindow::GetBorderType(), OglGui::OglWindow::GetRoundness(), OglGui::OglWindow::IsRounded(), mEndColor, OglGui::Window::mForeGroundColor, mHorizontal, OglGui::OglWindow::mOglWnd, mPercentage, mShowPercentage, mStartColor, OglGui::OglWindow::WndHeight(), and OglGui::OglWindow::WndWidth(). 00056 { 00057 OGC myOGC; 00058 ULONG opaq = 0xff000000; 00059 int bInfo[3]; 00060 int w = WndWidth(), h = WndHeight(); 00061 float mrg = 3; 00062 00063 mPercentage = (mPercentage > 100.0f) ? 100.0f : mPercentage; 00064 if (mPercentage <= 0.0f) 00065 return; 00066 00067 if (GetBorderType() < 2 ) 00068 mrg--; 00069 if( w < 4 || h < 4 ) 00070 mrg = 0.0f; 00071 00072 w = (mHorizontal ? mPercentage/100.0f : 1.0f) * (w-2*mrg); 00073 h = (mHorizontal ? 1.0f : mPercentage/100.0f) * (h-2*mrg); 00074 00075 OGCSave(&myOGC); 00076 00077 if ( (mStartColor & opaq) != opaq || (mEndColor & opaq) != opaq ) 00078 oglSys.StartBlend(bInfo); 00079 00080 if (mHorizontal) 00081 SetFillColors(mStartColor, mEndColor, mEndColor, mStartColor, 0); 00082 else 00083 SetFillColors(mEndColor, mEndColor, mStartColor, mStartColor, 0); 00084 00085 if (IsRounded() ) 00086 { 00087 float r0,r1,r2,r3; 00088 GetRoundness(r0,r1,r2,r3); 00089 FillRoundRectExt(mrg, mrg, w, h, r0, r1, r2, r3 ); 00090 } 00091 else 00092 FillRectangle(mrg, mrg, w, h); 00093 00094 if (mShowPercentage) 00095 oglSys.PosColPrintf(mOglWnd, 0, mrg, mForeGroundColor, 00096 "%3.0f%s", mPercentage,"%"); 00097 00098 if ( (mStartColor & opaq) != opaq || (mEndColor & opaq) != opaq ) 00099 oglSys.EndBlend(bInfo); 00100 00101 OGCRestore(&myOGC); 00102 }
Here is the call graph for this function:
|