Imported files from OT-current:

* ExpandoMenuBar.cpp 1.18
* CalendarMenuItem.cpp 1.6
* WindowMenu.cpp 1.3
* TimeView.cpp 1.14
* StatusView.cpp 1.18
* BarWindow.cpp 1.8


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18482 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-08-11 13:24:57 +00:00
parent 4f459891dd
commit a5210ab17d
6 changed files with 41 additions and 31 deletions

View File

@ -144,10 +144,10 @@ TBarWindow::MenusEnded()
{
BWindow::MenusEnded();
if (!sBeMenu->LockLooper()) {
// TODO: is this ok?
return;
}
if (!sBeMenu->LockLooper()) {
// TODO: is this ok?
return;
}
BMenuItem *item = NULL;
while ((item = sBeMenu->RemoveItem((int32)0)) != NULL)

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Copyright 2005-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Distributed under the terms of the MIT License.
*/
@ -13,7 +13,7 @@
#include <time.h>
static const int32 kDaysPerMonth[] = {31, 28, 31, 30, 31, 30, 30, 31, 30, 31, 30, 31};
static const int32 kDaysPerMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
// Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
static const int32 kTitleFontSize = 9;

View File

@ -402,8 +402,8 @@ TExpandoMenuBar::MouseMoved(BPoint where, uint32 code, const BMessage *message)
uint32 buttons;
if (!(Window()->CurrentMessage())
|| Window()->CurrentMessage()->FindInt32("buttons", (int32*)&buttons) < B_OK)
buttons = 0;
|| Window()->CurrentMessage()->FindInt32("buttons", (int32*)&buttons) < B_OK)
buttons = 0;
switch (code) {
case B_ENTERED_VIEW:
@ -438,13 +438,13 @@ TExpandoMenuBar::InBeMenu(BPoint loc) const
TBarWindow *window = dynamic_cast<TBarWindow*>(Window());
if (window) {
if (TBeMenu *bemenu = window->BeMenu()) {
bool inBeMenu = false;
if (bemenu->LockLooper()) {
inBeMenu = bemenu->Frame().Contains(loc);
bemenu->UnlockLooper();
}
return inBeMenu;
}
bool inBeMenu = false;
if (bemenu->LockLooper()) {
inBeMenu = bemenu->Frame().Contains(loc);
bemenu->UnlockLooper();
}
return inBeMenu;
}
}
}

View File

@ -300,8 +300,7 @@ TReplicantTray::AdjustPlacement()
{
// called when an add-on has been added or removed
// need to resize the parent of this accordingly
//
// call to Parent will call ResizeToPreferred
BRect bounds = Bounds();
float width, height;
GetPreferredSize(&width, &height);
@ -348,7 +347,7 @@ TReplicantTray::MessageReceived(BMessage *message)
AdjustPlacement();
break;
case 'trfm':
case 'Trfm':
// time string reformat -> realign
DealWithClock(fBarView->ShowingClock());
RealignReplicants();
@ -1065,22 +1064,33 @@ TReplicantTray::AddIcon(BMessage *icon, int32 *id, const entry_ref *addOn)
if (icon->what == B_ARCHIVED_OBJECT)
icon->what = 0;
BRect originalBounds = icon->FindRect("_frame");
// this is a work-around for buggy replicants that change their
// size in AttachedToWindow() (such as "SVM")
// !! check for name collisions?
status = fShelf->AddReplicant(icon, BPoint(1, 1));
if (status != B_OK)
return status;
int32 count = fShelf->CountReplicants();
BView *view;
fShelf->ReplicantAt(count - 1, &view, (uint32 *)id, NULL);
if (originalBounds != view->Bounds()) {
// The replicant changed its size when added to the window, so we need
// to recompute all over again (it's already done once via BShelf::AddReplicant()
// and TReplicantShelf::CanAcceptReplicantView())
RealignReplicants();
}
float oldWidth = Bounds().Width();
float oldHeight = Bounds().Height();
float width, height;
GetPreferredSize(&width, &height);
if (oldWidth != width || oldHeight != height)
if (oldWidth != width || oldHeight != height)
AdjustPlacement();
int32 count = fShelf->CountReplicants();
BView *view;
fShelf->ReplicantAt(count-1, &view, (uint32 *)id, NULL);
// add the item to the add-on list
AddItem(*id, nodeRef, entry, addOn != NULL);

View File

@ -49,6 +49,11 @@ All rights reserved.
#include <string.h>
const char *kShortDateFormat = "%m/%d/%y";
const char *kShortEuroDateFormat = "%d/%m/%y";
const char *kLongDateFormat = "%a, %B %d, %Y";
const char *kLongEuroDateFormat = "%a, %d %B, %Y";
static const char * const kMinString = "99:99 AM";
@ -263,12 +268,6 @@ TTimeView::GetCurrentTime()
}
const char *kShortDateFormat = "%m/%d/%y";
const char *kShortEuroDateFormat = "%d/%m/%y";
const char *kLongDateFormat = "%a, %B %d, %Y";
const char *kLongEuroDateFormat = "%a, %d %B, %Y";
void
TTimeView::GetCurrentDate()
{
@ -477,7 +476,8 @@ TTimeView::Update()
CalculateTextPlacement();
if (fParent) {
fParent->MessageReceived(new BMessage('trfm'));
BMessage reformat('Trfm');
fParent->MessageReceived(&reformat);
// time string format realign
fParent->Invalidate();
}

View File

@ -174,7 +174,7 @@ TWindowMenu::AttachedToWindow()
// if an application has no windows, this feature makes it easy to quit it.
// (but we only add this option if the application is not Tracker.)
if (fApplicationSignature.Compare(kTrackerSignature) != 0) {
if (fApplicationSignature.ICompare(kTrackerSignature) != 0) {
AddSeparatorItem();
AddItem(new TShowHideMenuItem("Quit Application", fTeam, B_QUIT_REQUESTED));
}