haiku/3rdparty/mmu_man/themes/TextInputAlert.cpp
François Revol d1854cb931 * Fix use of FindData(), now we can find colors and fonts!
* Implemented a text input box to name a new theme.
* Made loading of themes asynchronous in a thread, controls are disabled but at least the window appears ASAP.
* fixed app sig
* Implemented setting colors and fonts on Haiku.
* Implemented setting the window decor, but doesn't work as we don't have any decorator installed.
* Enable all addons.
TODO: forbid quitting while themes are loading!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23508 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-14 02:00:42 +00:00

47 lines
975 B
C++

//HACK :P
#define private public
#include <Alert.h>
#undef private
#include "TextInputAlert.h"
#define TEXT_HEIGHT 25
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)
{
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();
}
TextInputAlert::~TextInputAlert()
{
}
void
TextInputAlert::Show()
{
BAlert::Show();
}