Compatibility changes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1935 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
16cedc602f
commit
f45d1cc7e4
@ -62,7 +62,7 @@ BButton::BButton(BMessage *archive)
|
||||
//------------------------------------------------------------------------------
|
||||
BArchivable *BButton::Instantiate ( BMessage *archive )
|
||||
{
|
||||
if ( validate_instantiation(archive, "BButton"))
|
||||
if (validate_instantiation(archive, "BButton"))
|
||||
return new BButton(archive);
|
||||
else
|
||||
return NULL;
|
||||
@ -274,7 +274,7 @@ void BButton::AttachedToWindow()
|
||||
BControl::AttachedToWindow();
|
||||
|
||||
if (IsDefault())
|
||||
Window()->SetDefaultButton((BButton*)this);
|
||||
Window()->SetDefaultButton(this);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BButton::KeyDown ( const char *bytes, int32 numBytes )
|
||||
@ -306,23 +306,22 @@ void BButton::MakeDefault(bool flag)
|
||||
|
||||
fDrawAsDefault = flag;
|
||||
BWindow *window = Window();
|
||||
|
||||
if (window)
|
||||
{
|
||||
BButton *button = (BButton*)(window->DefaultButton());
|
||||
|
||||
if (flag)
|
||||
{
|
||||
ResizeBy(6.0f, 6.0f);
|
||||
MoveBy(-3.0f, -3.0f);
|
||||
if (flag)
|
||||
{
|
||||
ResizeBy(6.0f, 6.0f);
|
||||
MoveBy(-3.0f, -3.0f);
|
||||
|
||||
if (window)
|
||||
window->SetDefaultButton((BButton*)this);
|
||||
}
|
||||
else
|
||||
{
|
||||
ResizeBy(-6.0f, -6.0f);
|
||||
MoveBy(3.0f, 3.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
ResizeBy(-6.0f, -6.0f);
|
||||
MoveBy(3.0f, 3.0f);
|
||||
|
||||
if (window)
|
||||
window->SetDefaultButton(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
@ -397,6 +396,12 @@ void BButton::GetPreferredSize (float *width, float *height)
|
||||
|
||||
if (*width < 75.0f)
|
||||
*width = 75.0f;
|
||||
|
||||
if (fDrawAsDefault)
|
||||
{
|
||||
*width += 6.0f;
|
||||
*height += 6.0f;
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BButton::ResizeToPreferred()
|
||||
|
@ -301,25 +301,6 @@ void BControl::KeyDown(const char *bytes, int32 numBytes)
|
||||
{
|
||||
switch (bytes[0])
|
||||
{
|
||||
case B_UP_ARROW:
|
||||
message->ReplaceInt64("when", (int64)system_time());
|
||||
message->ReplaceInt32("key", 38);
|
||||
message->ReplaceInt32("raw_char", B_TAB);
|
||||
message->ReplaceInt32("modifiers", B_SCROLL_LOCK | B_SHIFT_KEY);
|
||||
message->ReplaceInt8("byte", B_TAB);
|
||||
message->ReplaceString("bytes", "");
|
||||
Looper()->PostMessage(message);
|
||||
break;
|
||||
|
||||
case B_DOWN_ARROW:
|
||||
message->ReplaceInt64("when", (int64)system_time());
|
||||
message->ReplaceInt32("key", 38);
|
||||
message->ReplaceInt32("raw_char", B_TAB);
|
||||
message->ReplaceInt8("byte", B_TAB);
|
||||
message->ReplaceString("bytes", "");
|
||||
Looper()->PostMessage(message);
|
||||
break;
|
||||
|
||||
case B_ENTER:
|
||||
case B_SPACE:
|
||||
if (Value())
|
||||
|
@ -373,6 +373,9 @@ void BStatusBar::Update(float delta, const char *text, const char *trailingText)
|
||||
{
|
||||
fCurrent += delta;
|
||||
|
||||
if (fCurrent > fMax)
|
||||
fCurrent = fMax;
|
||||
|
||||
if (fText)
|
||||
free(fText);
|
||||
|
||||
|
@ -569,7 +569,10 @@ BRect BTabView::DrawTabs()
|
||||
(i == fSelection) ? B_TAB_FRONT : (i == 0) ? B_TAB_FIRST : B_TAB_ANY,
|
||||
(i + 1 != fSelection));
|
||||
|
||||
return TabFrame(fSelection);
|
||||
if (fSelection > -1)
|
||||
return TabFrame(fSelection);
|
||||
else
|
||||
return BRect();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BTabView::DrawBox(BRect selTabRect)
|
||||
|
Loading…
Reference in New Issue
Block a user