Definition at line 141 of file UpDownButton.h. References OglGui::B2B, OglGui::OglWindow::ConnectTo(), OglGui::L2L, mDownButton, mLeftRight, mListener, mUpButton, OglGui::R2R, OglGui::Window::ScaleChildren(), OglGui::Window::SetAllowScaling(), OglGui::OglWindow::SetBorderType(), OglGui::Button::SetButtonListener(), SetDirectionFeedback(), OglGui::T2T, and OglGui::TPARENT. 00142 { 00143 int m = margin; 00144 00145 if (m >= w/2) 00146 m = w/2-1; 00147 if (m >= h/2) 00148 m = h/2-1; 00149 00150 mLeftRight = leftRight; 00151 mListener = 0; 00152 00153 if (!leftRight) 00154 { 00155 mUpButton = new DirectionButton(this, m, h/2, w-2*m, h/2-m, 1.0f); 00156 mDownButton = new DirectionButton(this, m, m, w-2*m, h/2-m, 3.0f); 00157 } 00158 else 00159 { 00160 mUpButton = new DirectionButton(this, w/2, m, w/2-m, h-2*m, 0.0f); 00161 mDownButton = new DirectionButton(this, m, m, w/2-m, h-2*m, 2.0f); 00162 } 00163 00164 mUpButton->SetButtonListener(this, (void*)1); 00165 mDownButton->SetButtonListener(this, (void*)-1); 00166 00167 // If user indicated a margin than provide suitable default border 00168 if (margin > 0) 00169 SetBorderType((margin<3) ? BEV_LINE : BEV_ETCHED); 00170 00171 SetDirectionFeedback(true); 00172 00173 ScaleChildren(0,true); 00174 00175 // Prevent others setting scaling as we allready scale 00176 mUpButton->SetAllowScaling(false); 00177 mDownButton->SetAllowScaling(false); 00178 00179 // To prevent the margin becoming bigger when scaling 00180 if (margin>0) 00181 { 00182 if (!leftRight) 00183 { 00184 mUpButton->ConnectTo(this, T2T | R2R | L2L | TPARENT); 00185 mDownButton->ConnectTo(this, B2B | R2R | L2L | TPARENT); 00186 } 00187 else 00188 { 00189 mUpButton->ConnectTo(this, B2B | T2T | R2R | TPARENT); 00190 mDownButton->ConnectTo(this, B2B | T2T | L2L | TPARENT); 00191 } 00192 } 00193 }
Here is the call graph for this function:
|