2008-01-14 05:00:42 +03:00
|
|
|
//HACK :P
|
|
|
|
#define private public
|
|
|
|
#include <Alert.h>
|
|
|
|
#undef private
|
|
|
|
|
2008-01-11 22:04:19 +03:00
|
|
|
#include "TextInputAlert.h"
|
|
|
|
|
2008-01-14 05:00:42 +03:00
|
|
|
#define TEXT_HEIGHT 25
|
|
|
|
|
2008-01-11 22:04:19 +03:00
|
|
|
|
|
|
|
TextInputAlert::TextInputAlert(const char *title,
|
|
|
|
const char *text,
|
|
|
|
const char *initial, /* initial input value */
|
|
|
|
const char *button0Label,
|
|
|
|
const char *button1Label,
|
|
|
|
const char *button2Label,
|
|
|
|
button_width widthStyle,
|
|
|
|
alert_type type)
|
|
|
|
: BAlert(title, text, button0Label, button1Label, button2Label, widthStyle, type)
|
|
|
|
{
|
2008-01-14 05:00:42 +03:00
|
|
|
ResizeBy(0,TEXT_HEIGHT);
|
|
|
|
BRect f = Bounds();
|
|
|
|
f.InsetBySelf(TEXT_HEIGHT, f.Height()/4 - TEXT_HEIGHT/2);
|
|
|
|
f.left *= 3;
|
|
|
|
fText = new BTextControl(f, "text", "Name:", initial, NULL);
|
|
|
|
fText->SetDivider(f.Width()/3);
|
|
|
|
ChildAt(0)->AddChild(fText);
|
|
|
|
TextView()->Hide();
|
|
|
|
fText->SetViewColor(ChildAt(0)->ViewColor());
|
|
|
|
fText->SetLowColor(ChildAt(0)->LowColor());
|
|
|
|
fText->TextView()->SelectAll();
|
2008-01-11 22:04:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TextInputAlert::~TextInputAlert()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-14 05:00:42 +03:00
|
|
|
void
|
|
|
|
TextInputAlert::Show()
|
|
|
|
{
|
|
|
|
BAlert::Show();
|
|
|
|
}
|
|
|
|
|
|
|
|
|