27 |
*/ |
*/ |
28 |
|
|
29 |
#include "pgspinnerbox.h" |
#include "pgspinnerbox.h" |
30 |
|
#include "pgmaskedit.h" |
31 |
|
#include "pglineedit.h" |
32 |
|
#include "pgbutton.h" |
33 |
|
|
34 |
/** |
/** |
35 |
*@author Atani - Mike Dunston |
*@author Atani - Mike Dunston |
51 |
down_rect.SetRect( box_rect.my_width, my_height - (my_height/2), (my_height/2), (my_height/2)); |
down_rect.SetRect( box_rect.my_width, my_height - (my_height/2), (my_height/2), (my_height/2)); |
52 |
|
|
53 |
m_pEditBox = new PG_MaskEdit( this, box_rect, style ); |
m_pEditBox = new PG_MaskEdit( this, box_rect, style ); |
54 |
m_pEditBox->sigEditEnd.connect(slot(*this, &PG_SpinnerBox::handle_editend)); |
m_pEditBox->sigEditEnd.connect(slot(*this, &PG_SpinnerBox::handleEditEnd)); |
55 |
|
|
56 |
m_pButtonUp = new PG_Button( this, PG_IDSPINNERBOX_UP, up_rect, "" ); |
m_pButtonUp = new PG_Button( this, PG_IDSPINNERBOX_UP, up_rect, "" ); |
57 |
m_pButtonUp->sigClick.connect(slot(*this, &PG_SpinnerBox::handleButtonClick)); |
m_pButtonUp->sigClick.connect(slot(*this, &PG_SpinnerBox::handleButtonClick)); |
121 |
Show(); |
Show(); |
122 |
} |
} |
123 |
|
|
124 |
bool PG_SpinnerBox::handle_editend(PG_LineEdit* edit) { |
bool PG_SpinnerBox::handleEditEnd(PG_LineEdit* edit) { |
125 |
const char* text = m_pEditBox->GetText(); |
const char* text = m_pEditBox->GetText(); |
126 |
m_iValue = (text != NULL) ? atoi(text) : 0; |
m_iValue = (text != NULL) ? atoi(text) : 0; |
127 |
|
|
137 |
SetTextValue(); |
SetTextValue(); |
138 |
return true; |
return true; |
139 |
} |
} |
140 |
|
|
141 |
|
void PG_SpinnerBox::SetMask( const char *value ) { |
142 |
|
strcpy( m_sMask, value ); |
143 |
|
m_pEditBox->SetMask( m_sMask ); |
144 |
|
AdjustSize(); |
145 |
|
} |