even more style changes

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20182 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2007-02-20 14:50:40 +00:00
parent b5a3387b08
commit e44561b2e9
7 changed files with 42 additions and 52 deletions
+7 -1
View File
@@ -5,7 +5,6 @@
#include <Alert.h> #include <Alert.h>
#include <OS.h> #include <OS.h>
#include <stdio.h>
#include "BaseView.h" #include "BaseView.h"
#include "TimeMessages.h" #include "TimeMessages.h"
@@ -33,6 +32,13 @@ TTimeBaseView::Pulse()
} }
void
TTimeBaseView::AttachedToWindow()
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
}
void void
TTimeBaseView::SetGMTime(bool gmt) TTimeBaseView::SetGMTime(bool gmt)
{ {
+2 -1
View File
@@ -11,7 +11,8 @@ class TTimeBaseView: public BView {
virtual ~TTimeBaseView(); virtual ~TTimeBaseView();
virtual void Pulse(); virtual void Pulse();
virtual void AttachedToWindow();
void ChangeTime(BMessage *); void ChangeTime(BMessage *);
void SetGMTime(bool); void SetGMTime(bool);
protected: protected:
+23 -28
View File
@@ -8,25 +8,28 @@
#include <Message.h> #include <Message.h>
#include <Screen.h> #include <Screen.h>
#include <TabView.h> #include <TabView.h>
#include <stdio.h> #include <stdio.h>
#include "BaseView.h" #include "BaseView.h"
#include "SettingsView.h"
#include "Time.h" #include "Time.h"
#include "TimeMessages.h" #include "TimeMessages.h"
#include "TimeWindow.h" #include "TimeWindow.h"
#include "TimeSettings.h"
#include "ZoneView.h"
#define TIME_WINDOW_RIGHT 361 //332 #define TIME_WINDOW_RIGHT 361 //332
#define TIME_WINDOW_BOTTOM 227 //208 #define TIME_WINDOW_BOTTOM 227 //208
TTimeWindow::TTimeWindow() TTimeWindow::TTimeWindow()
: BWindow(BRect(0,0,TIME_WINDOW_RIGHT,TIME_WINDOW_BOTTOM), : BWindow(BRect(0, 0, TIME_WINDOW_RIGHT, TIME_WINDOW_BOTTOM),
"Time & Date", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE ) "Time & Date", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE )
{ {
BScreen screen;
MoveTo(dynamic_cast<TimeApplication *>(be_app)->WindowCorner()); MoveTo(dynamic_cast<TimeApplication *>(be_app)->WindowCorner());
BScreen screen;
// Code to make sure that the window doesn't get drawn off screen... // Code to make sure that the window doesn't get drawn off screen...
if (!(screen.Frame().right >= Frame().right && screen.Frame().bottom >= Frame().bottom)) if (!(screen.Frame().right >= Frame().right && screen.Frame().bottom >= Frame().bottom))
MoveTo((screen.Frame().right-Bounds().right)*.5,(screen.Frame().bottom-Bounds().bottom)*.5); MoveTo((screen.Frame().right-Bounds().right)*.5,(screen.Frame().bottom-Bounds().bottom)*.5);
@@ -36,11 +39,6 @@ TTimeWindow::TTimeWindow()
} }
TTimeWindow::~TTimeWindow()
{
}
void void
TTimeWindow::MessageReceived(BMessage *message) TTimeWindow::MessageReceived(BMessage *message)
{ {
@@ -49,12 +47,12 @@ TTimeWindow::MessageReceived(BMessage *message)
{ {
bool istime; bool istime;
if (message->FindBool("time", &istime) == B_OK) if (message->FindBool("time", &istime) == B_OK)
f_BaseView->ChangeTime(message); fBaseView->ChangeTime(message);
break; break;
} }
case H_RTC_CHANGE: case H_RTC_CHANGE:
f_BaseView->SetGMTime(f_TimeSettings->GMTime()); fBaseView->SetGMTime(fTimeSettings->GMTime());
break; break;
default: default:
@@ -69,12 +67,12 @@ TTimeWindow::QuitRequested()
{ {
dynamic_cast<TimeApplication *>(be_app)->SetWindowCorner(BPoint(Frame().left,Frame().top)); dynamic_cast<TimeApplication *>(be_app)->SetWindowCorner(BPoint(Frame().left,Frame().top));
f_BaseView->StopWatchingAll(f_TimeSettings); fBaseView->StopWatchingAll(fTimeSettings);
f_BaseView->StopWatchingAll(f_TimeZones); fBaseView->StopWatchingAll(fTimeZones);
be_app->PostMessage(B_QUIT_REQUESTED); be_app->PostMessage(B_QUIT_REQUESTED);
return(true); return BWindow::QuitRequested();
} }
@@ -84,9 +82,8 @@ TTimeWindow::InitWindow()
{ {
BRect bounds(Bounds()); BRect bounds(Bounds());
f_BaseView = new TTimeBaseView(bounds, "background view"); fBaseView = new TTimeBaseView(bounds, "background view");
f_BaseView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); AddChild(fBaseView);
AddChild(f_BaseView);
bounds.top = 9; bounds.top = 9;
BTabView *tabview = new BTabView(bounds, "tab_view"); BTabView *tabview = new BTabView(bounds, "tab_view");
@@ -95,24 +92,22 @@ TTimeWindow::InitWindow()
bounds.InsetBy(4, 6); bounds.InsetBy(4, 6);
bounds.bottom -= tabview->TabHeight(); bounds.bottom -= tabview->TabHeight();
f_TimeSettings = new TSettingsView(bounds); fTimeSettings = new TSettingsView(bounds);
if (f_BaseView->StartWatchingAll(f_TimeSettings) != B_OK) if (fBaseView->StartWatchingAll(fTimeSettings) != B_OK)
printf("StartWatchingAll(TimeSettings) failed!!!\n"); printf("StartWatchingAll(TimeSettings) failed!!!\n");
f_TimeZones = new TZoneView(bounds); fTimeZones = new TZoneView(bounds);
if (f_BaseView->StartWatchingAll(f_TimeZones) != B_OK) if (fBaseView->StartWatchingAll(fTimeZones) != B_OK)
printf("TimeZones->StartWatchingAll(TimeZone) failed!!!\n"); printf("TimeZones->StartWatchingAll(TimeZone) failed!!!\n");
// add tabs // add tabs
BTab *tab; BTab *tab = new BTab();
tab = new BTab(); tabview->AddTab(fTimeSettings, tab);
tabview->AddTab(f_TimeSettings, tab);
tab->SetLabel("Settings"); tab->SetLabel("Settings");
tab = new BTab(); tab = new BTab();
tabview->AddTab(f_TimeZones, tab); tabview->AddTab(fTimeZones, tab);
tab->SetLabel("Time Zone"); tab->SetLabel("Time Zone");
f_BaseView->AddChild(tabview); fBaseView->AddChild(tabview);
f_BaseView->Pulse();
} }
+7 -10
View File
@@ -3,24 +3,21 @@
#include <Window.h> #include <Window.h>
#include "BaseView.h" class TSettingsView;
#include "SettingsView.h" class TTimeBaseView;
#include "TimeSettings.h" class TZoneView;
#include "ZoneView.h"
class TTimeWindow : public BWindow { class TTimeWindow : public BWindow {
public: public:
TTimeWindow(); TTimeWindow();
~TTimeWindow();
bool QuitRequested(); bool QuitRequested();
void MessageReceived(BMessage *message); virtual void MessageReceived(BMessage *message);
private: private:
void InitWindow(); void InitWindow();
TTimeBaseView *f_BaseView; TTimeBaseView *fBaseView;
TSettingsView *f_TimeSettings; TSettingsView *fTimeSettings;
TZoneView *f_TimeZones; TZoneView *fTimeZones;
}; };
#endif #endif
+2 -2
View File
@@ -89,8 +89,8 @@ TZoneView::AttachedToWindow()
if (Parent()) if (Parent())
SetViewColor(Parent()->ViewColor()); SetViewColor(Parent()->ViewColor());
if (f_first) // stupid hack if (f_first) {
{ // stupid hack
f_regionpopup->SetTargetForItems(this); f_regionpopup->SetTargetForItems(this);
f_setzone->SetTarget(this); f_setzone->SetTarget(this);
f_citylist->SetTarget(this); f_citylist->SetTarget(this);
+1 -1
View File
@@ -29,7 +29,7 @@ class TZoneItem: public BStringItem {
class TZoneView: public BView{ class TZoneView: public BView {
public: public:
TZoneView(BRect frame); TZoneView(BRect frame);
virtual ~TZoneView(); virtual ~TZoneView();
-9
View File
@@ -1,9 +0,0 @@
Time --
TimeWindow
-- TimeBaseView
-- SettingsView
-- TDateEdit
-- TTimeEdit
-- TCalendarView
-- TAnalogClock
-- ZoneView