Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

virtual void OglGui::Slider::DisplayFunc (  )  [inline, virtual]

Reimplemented from OglGui::Window.

Definition at line 144 of file Slider.h.

References OglGui::Window::DisplayFunc(), OglGui::Window::GetState(), HorBackDrawing(), mDrawBlendedThumb, mHorizontal, mIsPressed, mMaxVal, mMinVal, OglGui::OglWindow::mOglWnd, mPrecisionIdx, mShowVal, mShowValNeedle, OglGui::Window::mStateFeedbackColor, mThumbH, mThumbR, mThumbW, mTickInterval, mUpsideDown, mVal, and VerBackDrawing().

00145     {
00146         int     wndW = mOglWnd->width, wndH = mOglWnd->height;
00147         int     x, y, tW, tH;
00148         INT     bInfo[3];
00149         char    buf[25], format[10];
00150 
00151         Window::DisplayFunc();
00152 
00153         OGC oldOGC;
00154 
00155         if (GetState() == 0) return;
00156         OGCSave(&oldOGC);
00157 
00158         if (mTickInterval < 1)
00159             mTickInterval = 1;
00160 
00161         if (mHorizontal){
00162             x = (int) (mThumbW/2 + ((mVal-mMinVal) / (float) (mMaxVal-mMinVal))
00163                       * (wndW-mThumbW));
00164             y = (int) (mUpsideDown ? wndH - mThumbH / 2 - 2: mThumbH / 2 + 2);
00165             HorBackDrawing(y, wndW, wndH);
00166         }
00167         else {
00168             y = (int) (mThumbH/2 + ((mVal-mMinVal) / (float) (mMaxVal-mMinVal))
00169                       * (wndH-mThumbH));
00170             x = (int) (mUpsideDown ? wndW - mThumbW / 2: mThumbW / 2);
00171             VerBackDrawing(x, wndW, wndH);
00172         }
00173 
00174         if (mDrawBlendedThumb) oglSys.StartBlend(bInfo);
00175 
00176         if (mShowValNeedle){
00177             SetSolidLineColor(oglTrDARKGREY);
00178             if (mHorizontal)
00179                 DrawLine(x, 3, x, wndH - 2);
00180             else
00181                 DrawLine(3, y, wndW - 2, y);
00182         }
00183 
00184         if (mShowVal){
00185             ULONG col = mIsPressed ? oglTrGREY : oglTrLIGHTGREY;
00186             col |= (GetState()==2) ? mStateFeedbackColor : 0;
00187             SetSolidFillColor(col);
00188 
00189             if (mThumbR != 0.0f){
00190                 FillRoundRectExt(x-mThumbW/2, y-mThumbH/2, mThumbW, mThumbH,
00191                                  mThumbR, mThumbR, mThumbR, mThumbR);
00192                 DrawBevRoundRectExt(mIsPressed ? BEV_SUNKEN : BEV_RAISED,
00193                                     x-mThumbW/2, y-mThumbH/2, mThumbW, mThumbH,
00194                                     mThumbR, mThumbR, mThumbR, mThumbR);
00195             }
00196             else {
00197                 FillRectangle(x - mThumbW/2, y - mThumbH/2, mThumbW, mThumbH);
00198                 DrawBevRect(mIsPressed ? BEV_SUNKEN : BEV_RAISED,
00199                             x-mThumbW/2, y - mThumbH/2, mThumbW, mThumbH);
00200             }
00201         }
00202 
00203         if (mDrawBlendedThumb)
00204             oglSys.EndBlend(bInfo);
00205 
00206         if (mShowVal)
00207         {
00208             sprintf(format, "%%.%df", mPrecisionIdx);
00209             sprintf(buf, format, mVal / pow(10.0,mPrecisionIdx));
00210             oglSys.GetTextExtent(mOglWnd, buf, &tW, &tH);
00211             oglSys.ShadowPrintf(mOglWnd, x - tW/2 - 1, y - tH/2 + 2,
00212                                 oglWHITE, oglBLACK, "%s", buf);
00213         }
00214 
00215         OGCRestore(&oldOGC);
00216     }

Here is the call graph for this function:


Generated on Fri Mar 19 12:06:10 2010 for ImpalaSrc by  doxygen 1.5.1