MenuField layouts the menu bar better with respect to fDivider, it aligns better with other controls. fDivider in TextControl is an integer number now, small fix and small cleanup in Menu, Window::InitData takes an optional BBitmap token to construct an offscreen window, fixed PrivateScreen IndexForColor, View prevents being located at fractional coordinates as in R5, BBitmap unlocks its offscreen window since it is never Show()n and needs manual unlocking, fixed Slider offscreen window mode and improved triange thumb drawing, ScrollView would not crash when passing a NULL target just for kicks, the private MenuBar class now implements Draw to draw itself a little differently inside the BMenuField (dark right and bottom side) - though how it currently sets the clipping region prevents the text controls to draw in Playground, needs fixing

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13450 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2005-07-05 16:30:53 +00:00
parent b2086a9ba0
commit 2e6a5805ba
14 changed files with 227 additions and 108 deletions
+26 -19
View File
@@ -5,6 +5,7 @@
* Authors:
* Adrian Oanca <[email protected]>
* Axel Dörfler, [email protected]
* Stephan Aßmus, <[email protected]>
*/
@@ -189,14 +190,13 @@ BWindow::BWindow(BMessage* data)
}
BWindow::BWindow(BRect frame, color_space depth,
uint32 bitmapFlags, int32 rowBytes)
BWindow::BWindow(BRect frame, int32 bitmapToken)
:
BLooper("offscreen bitmap")
{
// TODO: Implement for real
decomposeType(B_UNTYPED_WINDOW, &fLook, &fFeel);
InitData(frame, "offscreen", fLook, fFeel, 0, 0);
InitData(frame, "offscreen", fLook, fFeel, 0, 0, bitmapToken);
}
@@ -1418,12 +1418,12 @@ BWindow::Title() const
void
BWindow::SetTitle(const char *title)
{
free(fTitle);
fTitle = strdup(title);
if (title == NULL)
title = "";
free(fTitle);
fTitle = strdup(title);
// we will change BWindow's thread name to "w>window title"
char threadName[B_OS_NAME_LENGTH];
@@ -1437,19 +1437,20 @@ BWindow::SetTitle(const char *title)
threadName[length + 2] = '\0';
#endif
// change the handler's name
SetName(threadName);
// if the message loop has been started...
if (Thread() >= B_OK) {
rename_thread(Thread(), threadName);
// we notify the app_server so we can actually see the change
Lock();
fLink->StartMessage(AS_WINDOW_TITLE);
fLink->AttachString(title);
fLink->Flush();
Unlock();
if (Lock()) {
fLink->StartMessage(AS_WINDOW_TITLE);
fLink->AttachString(fTitle);
fLink->Flush();
Unlock();
}
}
}
@@ -1964,7 +1965,7 @@ BWindow::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier,
void
BWindow::InitData(BRect frame, const char* title, window_look look,
window_feel feel, uint32 flags, uint32 workspace)
window_feel feel, uint32 flags, uint32 workspace, int32 bitmapToken)
{
STRACE(("BWindow::InitData()\n"));
@@ -2042,10 +2043,6 @@ BWindow::InitData(BRect frame, const char* title, window_look look,
STRACE(("BWindow::InitData(): contacting app_server...\n"));
// let app_server to know that a window has been created.
fLink = new BPrivate::PortLink(
BApplication::Private::ServerLink()->SenderPort(), receivePort);
// HERE we are in BApplication's thread, so for locking we use be_app variable
// we'll lock the be_app to be sure we're the only one writing at BApplication's server port
bool locked = false;
@@ -2054,7 +2051,17 @@ BWindow::InitData(BRect frame, const char* title, window_look look,
locked = true;
}
fLink->StartMessage(AS_CREATE_WINDOW);
// let app_server to know that a window has been created.
fLink = new BPrivate::PortLink(
BApplication::Private::ServerLink()->SenderPort(), receivePort);
if (bitmapToken < 0) {
fLink->StartMessage(AS_CREATE_WINDOW);
} else {
fLink->StartMessage(AS_CREATE_OFFSCREEN_WINDOW);
fLink->Attach<int32>(bitmapToken);
}
fLink->Attach<BRect>(fFrame);
fLink->Attach<int32>((int32)fLook);
fLink->Attach<int32>((int32)fFeel);
@@ -2850,7 +2857,7 @@ BWindow::DoUpdate(BView *view, BRect &area)
} else {
// The code below is certainly not correct, because
// it redoes what the app_server already did
// Find out what happens if a view has ViewColor() =
// Find out what happens on R5 if a view has ViewColor() =
// B_TRANSPARENT_COLOR but not B_WILL_DRAW
/* rgb_color c = aView->HighColor();
aView->SetHighColor(aView->ViewColor());