コード例 #1
0
// Constructor
//-----------------------------------------------------------------------------
CPUTCheckbox::CPUTCheckbox(const cString ControlText, CPUTControlID id, CPUTFont *pFont):
    mbMouseInside(false),
    mbStartedClickInside(false),
    mVertexStride(0),
    mVertexOffset(0),
    mpCheckboxText(NULL),
    mpFont(pFont)
{
    // initialize the state variables
    InitialStateSet();

    // save the control ID for callbacks
    mcontrolID = id;

    // store the font to be used by this control
    mpFont = pFont;

    // set as enabled
    CPUTControl::SetEnable(true);

    // register all the instance resources
    RegisterInstanceResources();

    // set the control's text string
    SetText(ControlText);
}
コード例 #2
0
// Constructor
//-----------------------------------------------------------------------------
CPUTText::CPUTText(const cString String, CPUTControlID id, CPUTFont *pFont):mVertexStride(0),
    mVertexOffset(0),
    mpMirrorBuffer(NULL),
    mNumCharsInString(0),
    mZDepth(1.0f),
    mpFont(pFont)
{
    // initialize the state variables
    InitialStateSet();

    // save the control ID for callbacks
    mcontrolID = id;

    // set as enabled
    CPUTControl::SetEnable(true);

    // reset position/sizes
    mQuadSize.height=0; mQuadSize.width=0;
    mPosition.x=0; mPosition.y=0;

    // set the text
    SetText(String);

    // store the control id
    mcontrolID = id;

}
コード例 #3
0
// Constructor
//------------------------------------------------------------------------------
CPUTSlider::CPUTSlider(const cString ControlText, CPUTControlID id, CPUTFont *pFont, float scale):    mpControlText(NULL),
    mpMirrorBufferActive(NULL),
    mpMirrorBufferPressed(NULL),
    mpMirrorBufferDisabled(NULL),
    mSliderNubTickLocation(0),
    mSliderNubLocation(0.0f),
    mbMouseInside(false),
    mbStartedClickInside(false),
    mbDrawTicks(true),
    mpFont(pFont),
    mScale(scale)
{
    // initialize the state variables
    InitialStateSet();

    // save the control ID for callbacks
    mcontrolID = id;

    // set as enabled
    CPUTControl::SetEnable(true);

    // default to an active control
    mControlState = CPUT_CONTROL_ACTIVE;

    // save the control ID
    mcontrolID = id;

    // set the string to display with the slider
    mpControlText = new CPUTText(mpFont);
    mpControlText->SetText(ControlText);
   
    // set default scale/start/end values
    SetScale(mSliderStartValue, mSliderEndValue, mSliderNumberOfSteps);
    RecalculateSizes();
}
コード例 #4
0
// Constructor
//------------------------------------------------------------------------------
CPUTText::CPUTText(CPUTFont *pFont):mVertexStride(0),
    mVertexOffset(0),
    mpMirrorBuffer(NULL),
    mNumCharsInString(0),
    mZDepth(1.0f),
    mpFont(pFont)
{
    // initialize the state variables
    InitialStateSet();

    mQuadSize.height=0; mQuadSize.width=0;
    mPosition.x=0; mPosition.y=0;
    mStaticText.clear();
}
コード例 #5
0
// Constructor
//-----------------------------------------------------------------------------
CPUTDropdown::CPUTDropdown(const cString ControlName, CPUTControlID id, CPUTFont *pFont):mVertexStride(0),
    mVertexOffset(0),
    mSelectedItemIndex(0),
    mbSizeDirty(false),
    mbMouseInside(false),
    mbStartedClickInside(false),
    mbStartedClickInsideTray(false),
    mRevertItem((UINT)-1),

    mpMirrorBufferActive(NULL),
    mpMirrorBufferDisabled(NULL),
    mpButtonText(NULL),
    mpFont(pFont)
{
    // initialize the state variables
    InitialStateSet();

    // save the control ID for callbacks
    mcontrolID = id;

    // set as enabled
    CPUTControl::SetEnable(true);

    // this is a copy of whatever item is selected
    mpSelectedItemCopy = new CPUTText(pFont);

        // clear the button selected area rect
    mButtonRect.x=0; mButtonRect.y=0; mButtonRect.width=0; mButtonRect.height=0;
    mTrayDimensions.x=0; mTrayDimensions.y=0; mTrayDimensions.width=0; mTrayDimensions.height=0;

    // set the string to display with the slider
    AddSelectionItem(ControlName, true);


    // Register any instance resources
    RegisterInstanceResources();
}