|
From: CVS C. to T. <the...@li...> - 2010-08-24 19:25:22
|
Revision: 548
http://themis.svn.sourceforge.net/themis/?rev=548&view=rev
Author: mark_hellegers
Date: 2010-08-24 19:25:15 +0000 (Tue, 24 Aug 2010)
Log Message:
-----------
Changed the styling to be more compact.
Modified Paths:
--------------
trunk/themis/framework/PrefsWin.cpp
trunk/themis/framework/PrefsWin.h
Modified: trunk/themis/framework/PrefsWin.cpp
===================================================================
--- trunk/themis/framework/PrefsWin.cpp 2010-08-24 19:24:27 UTC (rev 547)
+++ trunk/themis/framework/PrefsWin.cpp 2010-08-24 19:25:15 UTC (rev 548)
@@ -34,39 +34,36 @@
};
-PrefsWin::PrefsWin(
- BRect frame )
- : BWindow(
- frame,
- "Preferences",
- B_TITLED_WINDOW_LOOK,
- B_NORMAL_WINDOW_FEEL,
- B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS | B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE ),
- fCurrentPrefsView( NULL ),
- fLastSelection( -1 ),
- fViewFrame( 0, 0, 0, 0 )
-{
+PrefsWin :: PrefsWin(BRect frame)
+ : BWindow(frame,
+ "Preferences",
+ B_TITLED_WINDOW_LOOK,
+ B_NORMAL_WINDOW_FEEL,
+ B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS | B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE),
+ fCurrentPrefsView(NULL),
+ fLastSelection(-1),
+ fViewFrame(0, 0, 0, 0) {
+
/* set up the background view */
fBackgroundView = new BView(
Bounds(),
"BackgroundView",
B_FOLLOW_ALL,
0 );
- AddChild( fBackgroundView );
- fBackgroundView->SetViewColor( ui_color( B_PANEL_BACKGROUND_COLOR ) );
+ AddChild(fBackgroundView);
+ fBackgroundView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
/* add the listview */
BRect rect = Bounds();
- rect.InsetBy( kItemSpacing, kItemSpacing );
+ rect.InsetBy(kItemSpacing, kItemSpacing);
rect.right = rect.left + 100;
- fPrefsListView = new PrefsListView(
- rect );
- fBackgroundView->AddChild( fPrefsListView );
+ fPrefsListView = new PrefsListView(rect);
+ fBackgroundView->AddChild(fPrefsListView);
/* calculate the view frame */
rect = Bounds();
- rect.InsetBy( kItemSpacing, kItemSpacing );
+ rect.InsetBy(kItemSpacing, kItemSpacing);
rect.left = fPrefsListView->Frame().right + kItemSpacing;
fViewFrame = rect;
@@ -74,14 +71,10 @@
}
-void
-PrefsWin::MessageReceived(
- BMessage* msg )
-{
- switch( msg->what )
- {
- case LIST_SELECTION_CHANGED :
- {
+void PrefsWin :: MessageReceived(BMessage* msg) {
+
+ switch(msg->what) {
+ case LIST_SELECTION_CHANGED: {
int32 selection = fPrefsListView->CurrentSelection();
/*
@@ -89,77 +82,69 @@
* but the BListView does take away the focus from the curent
* selected item. So reselect it again. :/
*/
- if( selection < 0 )
- fPrefsListView->Select( fLastSelection );
+ if(selection < 0)
+ fPrefsListView->Select(fLastSelection);
- if( selection == fLastSelection )
+ if(selection == fLastSelection)
break;
else
fLastSelection = selection;
- if( fCurrentPrefsView )
- {
+ if(fCurrentPrefsView) {
fCurrentPrefsView->RemoveSelf();
delete fCurrentPrefsView;
fCurrentPrefsView = NULL;
}
/* find the prefs_view_const */
- enum prefs_view_const pvconst = kPrefsItems[ selection ].pvconst;
+ enum prefs_view_const pvconst = kPrefsItems[selection].pvconst;
- switch( pvconst )
- {
- case PREFSVIEW_WINDOW :
- {
+ switch(pvconst) {
+ case PREFSVIEW_WINDOW: {
fCurrentPrefsView = new WindowPrefsView(
fViewFrame,
- kPrefsItems[ selection ].name );
- fBackgroundView->AddChild( fCurrentPrefsView );
+ kPrefsItems[selection].name);
+ fBackgroundView->AddChild(fCurrentPrefsView);
break;
}
- case PREFSVIEW_NETWORK :
- {
+ case PREFSVIEW_NETWORK: {
fCurrentPrefsView = new NetworkPrefsView(
fViewFrame,
- kPrefsItems[ selection ].name );
- fBackgroundView->AddChild( fCurrentPrefsView );
+ kPrefsItems[selection].name);
+ fBackgroundView->AddChild(fCurrentPrefsView);
break;
}
- case PREFSVIEW_PRIVACY :
- {
+ case PREFSVIEW_PRIVACY: {
fCurrentPrefsView = new PrivacyPrefsView(
fViewFrame,
- kPrefsItems[ selection ].name );
- fBackgroundView->AddChild( fCurrentPrefsView );
+ kPrefsItems[selection].name);
+ fBackgroundView->AddChild(fCurrentPrefsView);
break;
}
- case PREFSVIEW_HTMLPARSER :
- {
+ case PREFSVIEW_HTMLPARSER: {
fCurrentPrefsView = new HTMLParserPrefsView(
fViewFrame,
- kPrefsItems[ selection ].name );
- fBackgroundView->AddChild( fCurrentPrefsView );
+ kPrefsItems[selection].name);
+ fBackgroundView->AddChild(fCurrentPrefsView);
break;
}
- case PREFSVIEW_CSSPARSER :
- {
+ case PREFSVIEW_CSSPARSER: {
fCurrentPrefsView = new CSSParserPrefsView(
fViewFrame,
- kPrefsItems[ selection ].name );
- fBackgroundView->AddChild( fCurrentPrefsView );
+ kPrefsItems[selection].name);
+ fBackgroundView->AddChild(fCurrentPrefsView);
break;
}
- case PREFSVIEW_RENDERER :
- {
+ case PREFSVIEW_RENDERER: {
fCurrentPrefsView = new RendererPrefsView(
fViewFrame,
- kPrefsItems[ selection ].name );
- fBackgroundView->AddChild( fCurrentPrefsView );
+ kPrefsItems[selection].name);
+ fBackgroundView->AddChild(fCurrentPrefsView);
break;
}
@@ -167,30 +152,26 @@
break;
}
- case HOMEPAGE_CHANGED :
- {
- printf( "PREFS: HOMEPAGE_CHANGED\n" );
+ case HOMEPAGE_CHANGED: {
+ printf("PREFS: HOMEPAGE_CHANGED\n");
- BTextControl* ctrl;
- msg->FindPointer( "source", ( void** )&ctrl );
- if( ctrl )
- {
- AppSettings->ReplaceString( kPrefsHomePage, ctrl->Text() );
+ BTextControl * ctrl;
+ msg->FindPointer("source", (void**)&ctrl);
+ if(ctrl) {
+ AppSettings->ReplaceString(kPrefsHomePage, ctrl->Text());
}
SaveAppSettings();
break;
}
- case SET_BLANK_PAGE :
- {
- printf( "PREFS: SET_BLANK_PAGE\n" );
+ case SET_BLANK_PAGE: {
+ printf("PREFS: SET_BLANK_PAGE\n");
BTextControl* ctrl;
- msg->FindPointer( "homepagecontrol", ( void** )&ctrl );
- if( ctrl )
- {
- ctrl->SetText( kAboutBlankPage );
+ msg->FindPointer("homepagecontrol", (void**)&ctrl);
+ if(ctrl) {
+ ctrl->SetText(kAboutBlankPage);
}
/*
* We don't need to save the setting here, as HOMEPAGE_CHANGED is
@@ -199,17 +180,16 @@
break;
}
- case IZ_CHECKBOX :
- {
- printf( "PREFS: IZ_CHECKBOX\n" );
+ case IZ_CHECKBOX: {
+ printf("PREFS: IZ_CHECKBOX\n");
BCheckBox* cbox;
- msg->FindPointer( "source", ( void** )&cbox );
+ msg->FindPointer("source", ( void** )&cbox);
bool value = false;
- if( cbox->Value() == 1 )
+ if(cbox->Value() == 1)
value = true;
- AppSettings->ReplaceBool( kPrefsIntelligentZoom, value );
+ AppSettings->ReplaceBool(kPrefsIntelligentZoom, value);
SaveAppSettings();
@@ -217,219 +197,201 @@
}
case SHOWTYPEAHEAD_CHECKBOX :
{
- printf( "PREFS: SHOWTYPEAHEAD_CHECKBOX\n" );
+ printf("PREFS: SHOWTYPEAHEAD_CHECKBOX\n");
BCheckBox* cbox;
- msg->FindPointer( "source", ( void** )&cbox );
+ msg->FindPointer("source", ( void** )&cbox);
bool value = false;
- if( cbox->Value() == 1 )
+ if(cbox->Value() == 1)
value = true;
- AppSettings->ReplaceBool( kPrefsShowTypeAheadWindow, value );
+ AppSettings->ReplaceBool(kPrefsShowTypeAheadWindow, value);
SaveAppSettings();
break;
}
- case SHOWTABS_CHECKBOX :
- {
- printf( "PREFS: SHOWTABS_CHECKBOX\n" );
+ case SHOWTABS_CHECKBOX: {
+ printf("PREFS: SHOWTABS_CHECKBOX\n");
BCheckBox* cbox;
- msg->FindPointer( "source", ( void** )&cbox );
+ msg->FindPointer("source", ( void** )&cbox);
bool value = false;
- if( cbox->Value() == 1 )
+ if(cbox->Value() == 1)
value = true;
- AppSettings->ReplaceBool( kPrefsShowTabsAtStartup, value );
+ AppSettings->ReplaceBool(kPrefsShowTabsAtStartup, value);
SaveAppSettings();
break;
}
- case TABSBACKGROUND_CHECKBOX :
- {
- printf( "PREFS: TABSBACKGROUND_CHECKBOX\n" );
+ case TABSBACKGROUND_CHECKBOX: {
+ printf("PREFS: TABSBACKGROUND_CHECKBOX\n");
BCheckBox* cbox;
- msg->FindPointer( "source", ( void** )&cbox );
+ msg->FindPointer("source", ( void** )&cbox);
bool value = false;
- if( cbox->Value() == 1 )
+ if(cbox->Value() == 1)
value = true;
- AppSettings->ReplaceBool( kPrefsOpenTabsInBackground, value );
+ AppSettings->ReplaceBool(kPrefsOpenTabsInBackground, value);
SaveAppSettings();
break;
}
- case TABSBLANK_CHECKBOX :
- {
- printf( "PREFS: TABSBACKGROUND_CHECKBOX\n" );
+ case TABSBLANK_CHECKBOX: {
+ printf("PREFS: TABSBACKGROUND_CHECKBOX\n");
BCheckBox* cbox;
- msg->FindPointer( "source", ( void** )&cbox );
+ msg->FindPointer("source", ( void** )&cbox);
bool value = false;
- if( cbox->Value() == 1 )
+ if(cbox->Value() == 1)
value = true;
- AppSettings->ReplaceBool( kPrefsOpenBlankTargetInTab, value );
+ AppSettings->ReplaceBool(kPrefsOpenBlankTargetInTab, value);
SaveAppSettings();
break;
}
- case NEW_WINDOW_START_PAGE :
- {
- printf( "PREFS: NEW_WINDOW_START_PAGE\n" );
+ case NEW_WINDOW_START_PAGE: {
+ printf("PREFS: NEW_WINDOW_START_PAGE\n");
int8 value;
- msg->FindInt8( "newpagemode", &value );
- AppSettings->ReplaceInt8( kPrefsNewWindowStartPage, value );
+ msg->FindInt8("newpagemode", &value);
+ AppSettings->ReplaceInt8(kPrefsNewWindowStartPage, value);
SaveAppSettings();
break;
}
- case HISTORY_CHANGED :
- {
- printf( "PREFS: HISTORY_CHANGED\n" );
+ case HISTORY_CHANGED: {
+ printf("PREFS: HISTORY_CHANGED\n");
int8 setdepth = 0;
BTextControl* ctrl;
- msg->FindPointer( "source", ( void** )&ctrl );
- BString string( ctrl->Text() );
+ msg->FindPointer("source", (void**)&ctrl);
+ BString string(ctrl->Text());
- if( string.Length() == 0 )
+ if(string.Length() == 0)
break;
- int32 newdepth = atoi( string.String() );
- if( newdepth > 127 || newdepth == 0 )
- {
+ int32 newdepth = atoi(string.String());
+ if(newdepth > 127 || newdepth == 0) {
setdepth = 10;
- ctrl->SetText( "10" );
- ctrl->TextView()->Select( 2, 2 );
+ ctrl->SetText("10");
+ ctrl->TextView()->Select(2, 2);
}
else
- setdepth = ( int8 )newdepth;
+ setdepth = (int8)newdepth;
int8 which = 0;
- msg->FindInt8( "which", &which );
+ msg->FindInt8("which", &which);
- switch( which )
- {
- case 0 :
- {
- AppSettings->ReplaceInt8( kPrefsGlobalHistoryDepthInDays, setdepth );
+ switch(which) {
+ case 0: {
+ AppSettings->ReplaceInt8(kPrefsGlobalHistoryDepthInDays, setdepth);
break;
}
- case 1 :
- {
- AppSettings->ReplaceInt8( kPrefsGlobalHistoryFreeURLCount, setdepth );
+ case 1: {
+ AppSettings->ReplaceInt8(kPrefsGlobalHistoryFreeURLCount, setdepth);
break;
}
- case 2 :
- {
- AppSettings->ReplaceInt8( kPrefsTabHistoryDepth, setdepth );
+ case 2: {
+ AppSettings->ReplaceInt8(kPrefsTabHistoryDepth, setdepth);
break;
}
}
SaveAppSettings();
- if( which < 2 )
- {
+ if(which < 2) {
/* tell GlobalHistory abouts its new depth */
int8 depth;
- AppSettings->FindInt8( kPrefsGlobalHistoryDepthInDays, &depth );
- ( ( App* )be_app )->GetGlobalHistory()->SetDepth( depth );
+ AppSettings->FindInt8(kPrefsGlobalHistoryDepthInDays, &depth);
+ ((App*)be_app)->GetGlobalHistory()->SetDepth(depth);
}
- else
- {
+ else {
/* tell all windows to update their tab history depths */
- Win* win = ( ( App* )be_app )->FirstWindow();
+ Win* win = ((App*)be_app)->FirstWindow();
- if( win == NULL )
- {
- printf( "PREFS: First Window not valid anymore!\n" );
+ if(win == NULL) {
+ printf("PREFS: First Window not valid anymore!\n");
break;
}
- BMessenger* msgr = new BMessenger( NULL, win, NULL );
- msgr->SendMessage( RE_INIT_TABHISTORY );
+ BMessenger* msgr = new BMessenger(NULL, win, NULL);
+ msgr->SendMessage(RE_INIT_TABHISTORY);
- while( win->NextWindow() != NULL )
- {
+ while(win->NextWindow() != NULL) {
win = win->NextWindow();
delete msgr;
- msgr = new BMessenger( NULL, win, NULL );
- msgr->SendMessage( RE_INIT_TABHISTORY );
+ msgr = new BMessenger(NULL, win, NULL);
+ msgr->SendMessage(RE_INIT_TABHISTORY);
}
delete msgr;
}
break;
}
- case DTD_SELECTED :
- {
- printf( "PREFS: DTD_SELECTED\n" );
+ case DTD_SELECTED: {
+ printf("PREFS: DTD_SELECTED\n");
BString str;
- msg->FindString( "DTDFileString", &str );
+ msg->FindString("DTDFileString", &str);
- AppSettings->ReplaceString( kPrefsActiveDTDPath, str.String() );
+ AppSettings->ReplaceString(kPrefsActiveDTDPath, str.String());
SaveAppSettings();
/*
* use the app to tell html parser about the DTD change.
*/
- be_app_messenger.SendMessage( DTD_CHANGED );
+ be_app_messenger.SendMessage(DTD_CHANGED);
break;
}
- case CSS_SELECTED :
- {
- printf( "PREFS: CSS_SELECTED\n" );
+ case CSS_SELECTED: {
+ printf("PREFS: CSS_SELECTED\n");
BString str;
- msg->FindString( "CSSFileString", &str );
+ msg->FindString("CSSFileString", &str);
- AppSettings->ReplaceString( kPrefsActiveCSSPath, str.String() );
+ AppSettings->ReplaceString(kPrefsActiveCSSPath, str.String());
SaveAppSettings();
/*
* use the app to tell css parser about the CSS change.
*/
- be_app_messenger.SendMessage( CSS_CHANGED );
+ be_app_messenger.SendMessage(CSS_CHANGED);
break;
}
default :
- BWindow::MessageReceived( msg );
+ BWindow::MessageReceived(msg);
}
}
-void
-PrefsWin::SaveAppSettings()
-{
- be_app_messenger.SendMessage( SAVE_APP_SETTINGS );
+void PrefsWin :: SaveAppSettings() {
+
+ be_app_messenger.SendMessage(SAVE_APP_SETTINGS);
}
-bool
-PrefsWin::QuitRequested()
-{
- BPoint point( Frame().LeftTop() );
- AppSettings->ReplacePoint( kPrefsPrefWindowPoint, point );
+bool PrefsWin :: QuitRequested() {
+
+ BPoint point(Frame().LeftTop());
+ AppSettings->ReplacePoint(kPrefsPrefWindowPoint, point);
- AppSettings->ReplaceInt32( kPrefsLastSelectedItem, fPrefsListView->CurrentSelection() );
+ AppSettings->ReplaceInt32(kPrefsLastSelectedItem, fPrefsListView->CurrentSelection());
/* Settings get saved once again when handling the following message. */
- be_app_messenger.SendMessage( PREFSWIN_CLOSE );
+ be_app_messenger.SendMessage(PREFSWIN_CLOSE);
return true;
}
@@ -439,26 +401,22 @@
*/
-PrefsListView::PrefsListView(
- BRect frame )
- : BView(
- frame,
- "PrefsListView",
- 0,
- 0 )
-{
+PrefsListView :: PrefsListView(BRect frame)
+ : BView(frame,
+ "PrefsListView",
+ 0,
+ 0) {
}
-void
-PrefsListView::AttachedToWindow()
-{
- SetViewColor( ui_color( B_PANEL_BACKGROUND_COLOR ) );
+void PrefsListView :: AttachedToWindow() {
+
+ SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
/* add the surrounding box */
BRect rect = Bounds();
- fBox = new BBox( rect, "Box" );
- AddChild( fBox );
+ fBox = new BBox(rect, "Box");
+ AddChild(fBox);
/* add the listview */
rect.InsetBy( 2, 2 );
@@ -467,52 +425,47 @@
"ListView",
B_SINGLE_SELECTION_LIST,
B_FOLLOW_ALL,
- B_WILL_DRAW | B_NAVIGABLE );
- fBox->AddChild( fListView );
+ B_WILL_DRAW | B_NAVIGABLE);
+ fBox->AddChild(fListView);
/* I want a font size of 12.0 */
fListView->SetFontSize( 12.0 );
/* add the list items */
int32 i = 0;
- while( kPrefsItems[ i ].name != NULL )
- {
+ while(kPrefsItems[i].name != NULL) {
fListView->AddItem(
new PrefsListItem(
- kPrefsItems[ i ].name,
- kPrefsItems[ i ].bitmap ) );
+ kPrefsItems[i].name,
+ kPrefsItems[i].bitmap));
i++;
}
- fListView->SetSelectionMessage( new BMessage( LIST_SELECTION_CHANGED ) );
- fListView->MakeFocus( true );
+ fListView->SetSelectionMessage(new BMessage(LIST_SELECTION_CHANGED));
+ fListView->MakeFocus(true);
/* find last selected prefs item */
int32 last_item = 0;
- AppSettings->FindInt32( kPrefsLastSelectedItem, &last_item );
- if( last_item > fListView->CountItems() - 1 )
- {
- fListView->Select( 0 );
- AppSettings->ReplaceInt32( kPrefsLastSelectedItem, 0 );
+ AppSettings->FindInt32(kPrefsLastSelectedItem, &last_item);
+ if(last_item > fListView->CountItems() - 1) {
+ fListView->Select(0);
+ AppSettings->ReplaceInt32(kPrefsLastSelectedItem, 0);
}
else
- fListView->Select( last_item );
+ fListView->Select(last_item);
}
-int32
-PrefsListView::CurrentSelection()
-{
+int32 PrefsListView :: CurrentSelection() {
+
return fListView->CurrentSelection();
}
-void
-PrefsListView::Select(
- int32 which )
-{
- fListView->Select( which );
+void PrefsListView :: Select(int32 which) {
+
+ fListView->Select(which);
}
@@ -520,37 +473,34 @@
* PrefsListItem
*/
-PrefsListItem::PrefsListItem(
- const char* name,
- const uint8* bitmapdata )
- : BListItem(),
- fName( name )
-{
+PrefsListItem :: PrefsListItem(const char* name,
+ const uint8* bitmapdata)
+ : BListItem(),
+ fName(name) {
+
fBitmap = new BBitmap(
BRect(
0,
0,
kPrefsIconSize - 1,
- kPrefsIconSize - 1 ),
- B_RGB32 );
+ kPrefsIconSize - 1),
+ B_RGB32);
memcpy(
fBitmap->Bits(),
bitmapdata,
- kPrefsIconSize * kPrefsIconSize * 4 );
+ kPrefsIconSize * kPrefsIconSize * 4);
}
-PrefsListItem::~PrefsListItem()
-{
+PrefsListItem::~PrefsListItem() {
+
delete fBitmap;
}
-void
-PrefsListItem::DrawItem(
- BView* owner,
- BRect itemRect,
- bool drawEverything = 0 )
+void PrefsListItem :: DrawItem(BView* owner,
+ BRect itemRect,
+ bool drawEverything = 0)
{
/* remember colors */
rgb_color hi = owner->HighColor();
@@ -558,8 +508,8 @@
/* draw outer rect */
BRect rect = itemRect;
- rect.InsetBy( 3, 3 );
- owner->SetLowColor( 216, 216, 216, 255 );
+ rect.InsetBy(3, 3);
+ owner->SetLowColor(216, 216, 216, 255);
owner->StrokeRoundRect(
rect,
4.0,
@@ -567,52 +517,49 @@
B_SOLID_LOW );
/* check if we are selected, and draw bounding rect */
- if( IsSelected() )
- owner->SetLowColor( 224, 224, 224, 255 );
+ if(IsSelected())
+ owner->SetLowColor(224, 224, 224, 255);
else
- owner->SetLowColor( 255, 255, 255, 255 );
+ owner->SetLowColor(255, 255, 255, 255);
/* fill area of rect according to selected state */
- rect.InsetBy( 1, 1 );
+ rect.InsetBy(1, 1);
owner->FillRoundRect(
rect,
4.0,
4.0,
- B_SOLID_LOW );
+ B_SOLID_LOW);
/* end of rect drawing */
/* draw bitmap */
- owner->SetDrawingMode( B_OP_ALPHA );
+ owner->SetDrawingMode(B_OP_ALPHA);
owner->DrawBitmap(
fBitmap,
BPoint(
itemRect.Width() / 2 - kPrefsIconSize / 2,
- itemRect.top + 5 ) );
- owner->SetDrawingMode( B_OP_COPY );
+ itemRect.top + 5));
+ owner->SetDrawingMode(B_OP_COPY);
/* draw name */
owner->DrawString(
fName,
BPoint(
- itemRect.Width() / 2 - owner->StringWidth( fName ) / 2,
- itemRect.top + 5 + kPrefsIconSize + fFontHeight ) );
+ itemRect.Width() / 2 - owner->StringWidth(fName) / 2,
+ itemRect.top + 5 + kPrefsIconSize + fFontHeight));
/* reset colors */
- owner->SetHighColor( hi );
- owner->SetLowColor( lo );
+ owner->SetHighColor(hi);
+ owner->SetLowColor(lo);
}
-void
-PrefsListItem::Update(
- BView* owner,
- const BFont* font )
-{
+void PrefsListItem :: Update(BView* owner, const BFont* font) {
+
font_height fh;
- font->GetHeight( &fh );
+ font->GetHeight(&fh);
fFontHeight = fh.leading + fh.ascent + fh.descent;
- SetHeight( kPrefsIconSize + 10 + fFontHeight );
- SetWidth( owner->Bounds().Width() );
+ SetHeight(kPrefsIconSize + 10 + fFontHeight);
+ SetWidth(owner->Bounds().Width());
}
Modified: trunk/themis/framework/PrefsWin.h
===================================================================
--- trunk/themis/framework/PrefsWin.h 2010-08-24 19:24:27 UTC (rev 547)
+++ trunk/themis/framework/PrefsWin.h 2010-08-24 19:25:15 UTC (rev 548)
@@ -12,30 +12,22 @@
class PrefsListView;
+class PrefsWin : public BWindow {
-class PrefsWin : public BWindow
-{
+ private:
+ BView * fBackgroundView;
+ PrefsListView * fPrefsListView;
+ BView * fCurrentPrefsView;
+ int32 fLastSelection;
+ BRect fViewFrame;
+
+ void SaveAppSettings();
+
public:
- PrefsWin(
- BRect frame );
+ PrefsWin(BRect frame);
+ virtual void MessageReceived(BMessage* msg);
+ virtual bool QuitRequested();
- virtual void MessageReceived(
- BMessage* msg );
-
- virtual bool QuitRequested();
-
- private:
- void SaveAppSettings();
-
- BView* fBackgroundView;
-
- PrefsListView* fPrefsListView;
-
- BView* fCurrentPrefsView;
-
- int32 fLastSelection;
-
- BRect fViewFrame;
};
#endif
@@ -51,22 +43,18 @@
#include <ListView.h>
-class PrefsListView : public BView
-{
+class PrefsListView : public BView {
+
+ private:
+ BListView * fListView;
+ BBox * fBox;
+
public:
- PrefsListView(
- BRect frame );
-
- virtual void AttachedToWindow();
-
- int32 CurrentSelection();
-
- void Select(
- int32 which );
+ PrefsListView(BRect frame);
+ virtual void AttachedToWindow();
+ int32 CurrentSelection();
+ void Select(int32 which);
- private:
- BListView* fListView;
- BBox* fBox;
};
#endif
@@ -82,29 +70,23 @@
#include <Bitmap.h>
#include <ListItem.h>
-class PrefsListItem : public BListItem
-{
+class PrefsListItem : public BListItem {
+
+ private:
+ const char * fName;
+ BBitmap * fBitmap;
+ float fFontHeight;
+
public:
- PrefsListItem(
- const char* name,
- const uint8* bitmapdata );
-
- ~PrefsListItem();
-
- virtual void DrawItem(
- BView* owner,
- BRect itemRect,
- bool drawEverything = false );
-
- virtual void Update(
- BView* owner,
- const BFont* font );
+ PrefsListItem(const char* name,
+ const uint8* bitmapdata);
+ ~PrefsListItem();
+ virtual void DrawItem(BView * owner,
+ BRect itemRect,
+ bool drawEverything = false);
+ virtual void Update(BView* owner,
+ const BFont* font);
- private:
- const char* fName;
- BBitmap* fBitmap;
-
- float fFontHeight;
};
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|