<smacks forehead> Kevin's changes also affected the ScrollBar prefs. Fixed build. *sigh*

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9384 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2004-10-16 23:05:05 +00:00
parent 720dc8a4d1
commit a0fdabc807

View File

@ -2,12 +2,7 @@
#include "messages.h" #include "messages.h"
// our own homegrown private cheat function for controlling scrollbars // our own homegrown private cheat function for controlling scrollbars
status_t control_scrollbar(int8 command, void *data, BScrollBar *sb); status_t control_scrollbar(scroll_bar_info *info, BScrollBar *sb);
// Magic numbers for control_scrollbar()
#define CONTROL_SET_DOUBLE 1
#define CONTROL_SET_PROPORTIONAL 2
#define CONTROL_SET_STYLE 3
ScrollBarView::ScrollBarView(void) ScrollBarView::ScrollBarView(void)
: BView(BRect(0,0,348,280),"scrollbarview", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW) : BView(BRect(0,0,348,280),"scrollbarview", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW)
@ -18,25 +13,35 @@ ScrollBarView::ScrollBarView(void)
arrowstyleBox->SetLabel( "Arrow Style" ); arrowstyleBox->SetLabel( "Arrow Style" );
float doubleWidth = StringWidth("Double:"); float doubleWidth = StringWidth("Double:");
int32 tempint;
bool tempbool; bool tempbool;
int8 tempint; scroll_bar_info sbi;
// We're going to need the basics here
get_scroll_bar_info(&sbi);
// save this for later use
tempbool=sbi.double_arrows;
doubleStringView = new BStringView( BRect(25,20,25+doubleWidth,38), "doubleStringView", "Double:"); doubleStringView = new BStringView( BRect(25,20,25+doubleWidth,38), "doubleStringView", "Double:");
sbdouble=new BScrollBar(BRect(12,38,145,58),"doublearrowsbar",NULL,0,100,B_HORIZONTAL); sbdouble=new BScrollBar(BRect(12,38,145,58),"doublearrowsbar",NULL,0,100,B_HORIZONTAL);
arrowstyleBox->AddChild( sbdouble ); arrowstyleBox->AddChild( sbdouble );
tempbool=true; sbi.double_arrows=true;
control_scrollbar(CONTROL_SET_DOUBLE,&tempbool,sbdouble); control_scrollbar(&sbi,sbdouble);
float singleWidth = StringWidth("Single:"); float singleWidth = StringWidth("Single:");
singleStringView = new BStringView( BRect(25,60,25+singleWidth,87), "singleStringView", "Single:"); singleStringView = new BStringView( BRect(25,60,25+singleWidth,87), "singleStringView", "Single:");
sbsingle=new BScrollBar(BRect(12,82,145,102),"singlearrowsbar",NULL,0,100,B_HORIZONTAL); sbsingle=new BScrollBar(BRect(12,82,145,102),"singlearrowsbar",NULL,0,100,B_HORIZONTAL);
arrowstyleBox->AddChild( sbsingle ); arrowstyleBox->AddChild( sbsingle );
tempbool=false; sbi.double_arrows=false;
control_scrollbar(CONTROL_SET_DOUBLE,&tempbool,sbsingle); control_scrollbar(&sbi,sbsingle);
// Restore the original value so we don't screw up the other ones
sbi.double_arrows=tempbool;
tempbool=sbi.proportional;
knobtypeBox = new BBox( BRect( 180, 7, 338, 119) ); knobtypeBox = new BBox( BRect( 180, 7, 338, 119) );
knobtypeBox->SetLabel( "Knob Type" ); knobtypeBox->SetLabel( "Knob Type" );
@ -46,38 +51,40 @@ ScrollBarView::ScrollBarView(void)
sbproportional=new BScrollBar(BRect(12,38,145,58),"proportionalbar",NULL,0,100,B_HORIZONTAL); sbproportional=new BScrollBar(BRect(12,38,145,58),"proportionalbar",NULL,0,100,B_HORIZONTAL);
knobtypeBox->AddChild( sbproportional ); knobtypeBox->AddChild( sbproportional );
tempbool=true; sbi.proportional=true;
control_scrollbar(CONTROL_SET_PROPORTIONAL, &tempbool,sbdouble); control_scrollbar(&sbi,sbproportional);
float fixedWidth = StringWidth("Fixed"); float fixedWidth = StringWidth("Fixed");
fixedStringView = new BStringView( BRect(193,60,193+fixedWidth,87), "fixedStringView", "Fixed" ); fixedStringView = new BStringView( BRect(193,60,193+fixedWidth,87), "fixedStringView", "Fixed" );
sbfixed=new BScrollBar(BRect(12,87,145,105),"fixedbar",NULL,0,100,B_HORIZONTAL); sbfixed=new BScrollBar(BRect(12,87,145,105),"fixedbar",NULL,0,100,B_HORIZONTAL);
knobtypeBox->AddChild( sbfixed ); knobtypeBox->AddChild( sbfixed );
tempbool=false; sbi.proportional=false;
control_scrollbar(CONTROL_SET_PROPORTIONAL,&tempbool,sbfixed); control_scrollbar(&sbi,sbfixed);
minknobsizeBox = new BBox( BRect( 12, 123, 169, 232) ); minknobsizeBox = new BBox( BRect( 12, 123, 169, 232) );
minknobsizeBox->SetLabel( "Minimum Knob Size" ); minknobsizeBox->SetLabel( "Minimum Knob Size" );
sbi.proportional=tempbool;
knobstyleBox = new BBox( BRect( 180, 123, 338, 232) ); knobstyleBox = new BBox( BRect( 180, 123, 338, 232) );
knobstyleBox->SetLabel( "Knob Style" ); knobstyleBox->SetLabel( "Knob Style" );
tempint=sbi.knob;
sbflat=new BScrollBar(BRect(12,22,145,42),"flatbar",NULL,0,100,B_HORIZONTAL); sbflat=new BScrollBar(BRect(12,22,145,42),"flatbar",NULL,0,100,B_HORIZONTAL);
knobstyleBox->AddChild( sbflat ); knobstyleBox->AddChild( sbflat );
tempint=0; sbi.knob=0;
control_scrollbar(CONTROL_SET_STYLE,&tempbool,sbflat); control_scrollbar(&sbi,sbflat);
sbdots=new BScrollBar(BRect(12,52,145,72),"dotbar",NULL,0,100,B_HORIZONTAL); sbdots=new BScrollBar(BRect(12,52,145,72),"dotbar",NULL,0,100,B_HORIZONTAL);
knobstyleBox->AddChild( sbdots ); knobstyleBox->AddChild( sbdots );
tempint=1; sbi.knob=1;
control_scrollbar(CONTROL_SET_STYLE,&tempbool,sbdots); control_scrollbar(&sbi,sbdots);
sblines=new BScrollBar(BRect(12,82,145,102),"linebar",NULL,0,100,B_HORIZONTAL); sblines=new BScrollBar(BRect(12,82,145,102),"linebar",NULL,0,100,B_HORIZONTAL);
knobstyleBox->AddChild( sblines ); knobstyleBox->AddChild( sblines );
tempint=2; sbi.knob=2;
control_scrollbar(CONTROL_SET_STYLE,&tempbool,sblines); control_scrollbar(&sbi,sblines);
defaultsButton = new BButton( BRect( 10, 242, 85, 265), "defaultsButton", "Defaults", NULL ); defaultsButton = new BButton( BRect( 10, 242, 85, 265), "defaultsButton", "Defaults", NULL );