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

void OglGui::UpDownNumber::Init ( int  w,
int  h,
float  val,
bool  asInt,
int  upDownW,
bool  leftRight,
int  margin 
) [inline, private]

Definition at line 152 of file UpDownNumber.h.

References OglGui::B2B, OglGui::OglWindow::ConnectTo(), OglGui::L2L, mAsInt, mIncrement, mListener, mListenerData, mMaxVal, mMinVal, mStatTxt, mUpDownBtn, mValue, OglGui::R2R, OglGui::Window::ScaleChildren(), OglGui::Window::SetAllowScaling(), OglGui::OglWindow::SetBorderType(), OglGui::UpDownButton::SetDirectionFeedback(), OglGui::OglWindow::SetNoMouseInput(), OglGui::UpDownButton::SetRepeatMode(), OglGui::UpDownButton::SetUpDownButtonListener(), OglGui::T2T, and OglGui::TPARENT.

00154     {
00155         char    buf[40];
00156         int     m = margin;
00157 
00158         mListener = 0;
00159         mListenerData = 0;
00160         mValue = val;
00161         mAsInt = asInt;
00162         mIncrement = 1.0f;
00163         mMinVal = -1e10;
00164         mMaxVal = 1e10;
00165 
00166         if (m >= w/2)
00167             m = w/2-1;
00168         if (m >= h/2)
00169             m = h/2-1;
00170 
00171         mUpDownBtn = new UpDownButton(this, w-m-upDownW, m, upDownW, h-2*m,
00172                                       leftRight);
00173         mUpDownBtn->SetUpDownButtonListener(this);
00174         mUpDownBtn->SetRepeatMode(true);
00175 
00176         sprintf(buf, mAsInt ? "%.0f" : "%.2f", mValue);
00177         mStatTxt = new StaticText(this, m, m, w-2*m-upDownW, h-2*m, buf);
00178         mStatTxt->SetNoMouseInput();
00179 
00180         if (margin > 0)
00181             SetBorderType((margin<3) ? BEV_LINE : BEV_ETCHED);
00182 
00183         mUpDownBtn->SetDirectionFeedback(true);
00184 
00185         ScaleChildren(0,true);
00186 
00187         // Prevent others setting scaling as we allready scale
00188         mUpDownBtn->SetAllowScaling(false);
00189         mStatTxt->SetAllowScaling(false);
00190 
00191         // To prevent the margin becoming bigger when scaling
00192         if (margin>0)
00193         {
00194             mUpDownBtn->ConnectTo(this, T2T | B2B | R2R | TPARENT);
00195             mStatTxt->ConnectTo(this,   T2T | B2B | L2L | TPARENT);
00196         }
00197     }

Here is the call graph for this function:


Generated on Fri Mar 19 12:09:22 2010 for ImpalaSrc by  doxygen 1.5.1