コード例 #1
0
ファイル: editvalue.cpp プロジェクト: ManuelBlanc/colobot
bool CEditValue::Create(Math::Point pos, Math::Point dim, int icon, EventType eventType)
{
    Ui::CEdit*      pe;
    Ui::CButton*    pc;

    if ( eventType == EVENT_NULL )  eventType = GetUniqueEventType();
    CControl::Create(pos, dim, icon, eventType);

    GlintDelete();

    m_edit = new Ui::CEdit();
    pe = static_cast<Ui::CEdit*>(m_edit);
    pe->Create(pos, dim, 0, EVENT_NULL);
    pe->SetMaxChar(4);

    m_buttonUp = new Ui::CButton();
    pc = static_cast<Ui::CButton*>(m_buttonUp);
    pc->Create(pos, dim, 49, EVENT_NULL);  // ^
    pc->SetRepeat(true);

    m_buttonDown = new Ui::CButton();
    pc = static_cast<Ui::CButton*>(m_buttonDown);
    pc->Create(pos, dim, 50, EVENT_NULL);  // v
    pc->SetRepeat(true);

    MoveAdjust();
    return true;
}
コード例 #2
0
ファイル: editvalue.cpp プロジェクト: Grunaka/colobot
bool CEditValue::Create(Math::Point pos, Math::Point dim, int icon, EventType eventType)
{
    if ( eventType == EVENT_NULL )  eventType = GetUniqueEventType();
    CControl::Create(pos, dim, icon, eventType);

    GlintDelete();

    m_edit = MakeUnique<Ui::CEdit>();
    m_edit->Create(pos, dim, 0, EVENT_NULL);
    m_edit->SetMaxChar(4);

    m_buttonUp = MakeUnique<Ui::CButton>();
    m_buttonUp->Create(pos, dim, 49, EVENT_NULL);  // ^
    m_buttonUp->SetRepeat(true);

    m_buttonDown = MakeUnique<Ui::CButton>();
    m_buttonDown->Create(pos, dim, 50, EVENT_NULL);  // v
    m_buttonDown->SetRepeat(true);

    MoveAdjust();
    return true;
}