-
-
-
-
-
-
-
-
-
-
-
BC_TumbleTextBoxText::BC_TumbleTextBoxText(BC_TumbleTextBox *popup,
int64_t default_value, int x, int y)
: BC_TextBox(x, y, popup->text_w, 1, default_value)
-
BC_TumbleTextBox::BC_TumbleTextBox(BC_WindowBase *parent_window,
- int64_t default_value,
- int64_t min,
- int64_t max,
- int x,
- int y,
- int text_w)
+ int64_t default_value, int64_t min, int64_t max,
+ int x, int y, int text_w)
{
reset();
this->x = x;
}
BC_TumbleTextBox::BC_TumbleTextBox(BC_WindowBase *parent_window,
- int default_value,
- int min,
- int max,
- int x,
- int y,
- int text_w)
+ int default_value, int min, int max,
+ int x, int y, int text_w)
{
reset();
this->x = x;
}
BC_TumbleTextBox::BC_TumbleTextBox(BC_WindowBase *parent_window,
- float default_value_f,
- float min_f,
- float max_f,
- int x,
- int y,
- int text_w)
+ float default_value_f, float min_f, float max_f,
+ int x, int y, int text_w, int precision)
{
reset();
this->x = x;
this->max_f = max_f;
this->default_value_f = default_value_f;
this->text_w = text_w;
+ this->precision = precision;
this->parent_window = parent_window;
use_float = 1;
- precision = 4;
increment = 1;
}
x += textbox->get_w();
tumbler = use_float ?
- (BC_Tumbler *)new BC_FTumbler(textbox, min_f, max_f, x, y) :
- (BC_Tumbler *)new BC_ITumbler(textbox, min, max, x, y);
+ (BC_Tumbler *)new BC_FTextTumbler(this, min_f, max_f, x, y) :
+ (BC_Tumbler *)new BC_ITextTumbler(this, min, max, x, y);
parent_window->add_subwindow(tumbler);
tumbler->set_increment(increment);
return 0;
}
+int BC_TumbleTextBox::handle_up_event()
+{
+ return use_float ?
+ ((BC_FTumbler *)tumbler)->BC_FTumbler::handle_up_event() :
+ ((BC_ITumbler *)tumbler)->BC_ITumbler::handle_up_event() ;
+}
+
+int BC_TumbleTextBox::handle_down_event()
+{
+ return use_float ?
+ ((BC_FTumbler *)tumbler)->BC_FTumbler::handle_down_event() :
+ ((BC_ITumbler *)tumbler)->BC_ITumbler::handle_down_event() ;
+}
+
const char* BC_TumbleTextBox::get_text()
{
return textbox->get_text();