Compatibility changes

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1935 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Marc Flerackers
2002-11-14 15:48:57 +00:00
parent 16cedc602f
commit f45d1cc7e4
4 changed files with 28 additions and 36 deletions
+21 -16
View File
@@ -62,7 +62,7 @@ BButton::BButton(BMessage *archive)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BArchivable *BButton::Instantiate ( BMessage *archive ) BArchivable *BButton::Instantiate ( BMessage *archive )
{ {
if ( validate_instantiation(archive, "BButton")) if (validate_instantiation(archive, "BButton"))
return new BButton(archive); return new BButton(archive);
else else
return NULL; return NULL;
@@ -274,7 +274,7 @@ void BButton::AttachedToWindow()
BControl::AttachedToWindow(); BControl::AttachedToWindow();
if (IsDefault()) if (IsDefault())
Window()->SetDefaultButton((BButton*)this); Window()->SetDefaultButton(this);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BButton::KeyDown ( const char *bytes, int32 numBytes ) void BButton::KeyDown ( const char *bytes, int32 numBytes )
@@ -306,23 +306,22 @@ void BButton::MakeDefault(bool flag)
fDrawAsDefault = flag; fDrawAsDefault = flag;
BWindow *window = Window(); BWindow *window = Window();
if (window)
{
BButton *button = (BButton*)(window->DefaultButton());
if (flag) if (flag)
{ {
ResizeBy(6.0f, 6.0f); ResizeBy(6.0f, 6.0f);
MoveBy(-3.0f, -3.0f); MoveBy(-3.0f, -3.0f);
if (window)
window->SetDefaultButton((BButton*)this); window->SetDefaultButton((BButton*)this);
} }
else else
{ {
ResizeBy(-6.0f, -6.0f); ResizeBy(-6.0f, -6.0f);
MoveBy(3.0f, 3.0f); MoveBy(3.0f, 3.0f);
if (window)
window->SetDefaultButton(NULL); window->SetDefaultButton(NULL);
}
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@@ -397,6 +396,12 @@ void BButton::GetPreferredSize (float *width, float *height)
if (*width < 75.0f) if (*width < 75.0f)
*width = 75.0f; *width = 75.0f;
if (fDrawAsDefault)
{
*width += 6.0f;
*height += 6.0f;
}
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BButton::ResizeToPreferred() void BButton::ResizeToPreferred()
-19
View File
@@ -301,25 +301,6 @@ void BControl::KeyDown(const char *bytes, int32 numBytes)
{ {
switch (bytes[0]) 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_ENTER:
case B_SPACE: case B_SPACE:
if (Value()) if (Value())
+3
View File
@@ -373,6 +373,9 @@ void BStatusBar::Update(float delta, const char *text, const char *trailingText)
{ {
fCurrent += delta; fCurrent += delta;
if (fCurrent > fMax)
fCurrent = fMax;
if (fText) if (fText)
free(fText); free(fText);
+4 -1
View File
@@ -569,7 +569,10 @@ BRect BTabView::DrawTabs()
(i == fSelection) ? B_TAB_FRONT : (i == 0) ? B_TAB_FIRST : B_TAB_ANY, (i == fSelection) ? B_TAB_FRONT : (i == 0) ? B_TAB_FIRST : B_TAB_ANY,
(i + 1 != fSelection)); (i + 1 != fSelection));
return TabFrame(fSelection); if (fSelection > -1)
return TabFrame(fSelection);
else
return BRect();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BTabView::DrawBox(BRect selTabRect) void BTabView::DrawBox(BRect selTabRect)