Пример #1
0
	LoadLayoutArchiveWindow(BRect frame) 
		:
		BWindow(frame, "Layout Loaded From Archive", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE
			| B_AUTO_UPDATE_SIZE_LIMITS)
	{
		fLayout = new BALMLayout(10, 10);
		BALM::BALMLayoutBuilder builder(this, fLayout);

		// Restore gui specifications. 
		BFile guiFile;
		_FindGUISpecifications(kGUIFileName, guiFile);

		LayoutArchive layoutArchive(fLayout);
		if (layoutArchive.RestoreFromFile(&guiFile) != B_OK) {
			BString text = "Can't find layout specification file: \"";
			text << kGUIFileName;
			text << "\"";
			BAlert* alert = new BAlert("Layout Specifications Not Found",
				text, "Quit");
			alert->Go();
			PostMessage(B_QUIT_REQUESTED);
		}

		// Access the views in the layout.

		BButton* button = layoutArchive.FindView<BButton>("ButtonTest");
		if (button != NULL)
			button->SetLabel("Hey");

		BRadioButton* radioButton
			= layoutArchive.FindView<BRadioButton>("RadioButtonTest");
		if (radioButton != NULL)
			radioButton->SetLabel("World");
	}
Пример #2
0
BRadioButton*
PrintOptionsWindow::AddRadioButton(const char* name,
                                   const char* label, uint32 what, bool selected)
{
    BRadioButton* button;
    button = new BRadioButton(name, label, new BMessage(what));
    button->SetValue(selected ? B_CONTROL_ON : B_CONTROL_OFF);
    return button;
}
Пример #3
0
void
BRadioButton::SetValue(int32 value)
{
	if (value != Value()) {
		BControl::SetValueNoUpdate(value);
		Invalidate(_KnobFrame());
	}

	if (value == 0)
		return;

	BView* parent = Parent();
	BView* child = NULL;

	if (parent != NULL) {
		// If the parent is a BBox, the group parent is the parent of the BBox
		BBox* box = dynamic_cast<BBox*>(parent);

		if (box != NULL && box->LabelView() == this)
			parent = box->Parent();

		if (parent != NULL) {
			BBox* box = dynamic_cast<BBox*>(parent);

			// If the parent is a BBox, skip the label if there is one
			if (box != NULL && box->LabelView())
				child = parent->ChildAt(1);
			else
				child = parent->ChildAt(0);
		} else
			child = Window()->ChildAt(0);
	} else if (Window() != NULL)
		child = Window()->ChildAt(0);

	while (child != NULL) {
		BRadioButton* radio = dynamic_cast<BRadioButton*>(child);

		if (radio != NULL && (radio != this))
			radio->SetValue(B_CONTROL_OFF);
		else {
			// If the child is a BBox, check if the label is a radiobutton
			BBox* box = dynamic_cast<BBox*>(child);

			if (box != NULL && box->LabelView()) {
				radio = dynamic_cast<BRadioButton*>(box->LabelView());

				if (radio != NULL && (radio != this))
					radio->SetValue(B_CONTROL_OFF);
			}
		}

		child = child->NextSibling();
	}

	ASSERT(Value() == B_CONTROL_ON);
}
Пример #4
0
BRadioButton* 
JobSetupView::CreatePageSelectionItem(const char* name, const char* label,
	JobData::PageSelection pageSelection)
{
	BRadioButton* button = new BRadioButton(name, label, NULL);
	if (fJobData->GetPageSelection() == pageSelection) {
		button->SetValue(B_CONTROL_ON);
	}
	return button;
}
void
AutomountSettingsPanel::_SendSettings(bool rescan)
{
	BMessage message(kSetAutomounterParams);

	message.AddBool("autoMountAll", (bool)fAutoMountAllCheck->Value());
	message.AddBool("autoMountAllBFS", (bool)fAutoMountAllBFSCheck->Value());
	if (fAutoMountAllBFSCheck->Value())
		message.AddBool("autoMountAllHFS", false);

	message.AddBool("suspended", (bool)fScanningDisabledCheck->Value());
	message.AddBool("rescanNow", rescan);

	message.AddBool("initialMountAll", (bool)fInitialMountAllCheck->Value());
	message.AddBool("initialMountAllBFS",
		(bool)fInitialMountAllBFSCheck->Value());
	message.AddBool("initialMountRestore",
		(bool)fInitialMountRestoreCheck->Value());
	if (fInitialDontMountCheck->Value())
		message.AddBool("initialMountAllHFS", false);

	message.AddBool("ejectWhenUnmounting",
		(bool)fEjectWhenUnmountingCheckBox->Value());

	fTarget.SendMessage(&message);
}
Пример #6
0
void
BRadioButton::SetValue(int32 value)
{
	if (value != Value()) {
		BControl::SetValueNoUpdate(value);
		Invalidate();

		if (value == B_CONTROL_ON) {
			for (BView *sibling = NextSibling(); sibling != NULL; sibling = sibling->NextSibling()) {
				BRadioButton *rbtn = cast_as(sibling, BRadioButton);
				if (rbtn != NULL) rbtn->SetValue(B_CONTROL_OFF);
			}
			for (BView *sibling = PreviousSibling(); sibling != NULL; sibling = sibling->PreviousSibling()) {
				BRadioButton *rbtn = cast_as(sibling, BRadioButton);
				if (rbtn != NULL) rbtn->SetValue(B_CONTROL_OFF);
			}
		}
	}
}
Пример #7
0
/////
// create all component
//
void MCColorView::createAllComponent()
{
	BStringView		*label;
	BRadioButton	*rbtn;

	// create information label
	label = new BStringView(BRect(15, 20, 105, 30), "info",
		"select chip-color :");
	this->AddChild(label);

	// create color-select button
	rbtn = new BRadioButton(BRect(20, 45, 110, 55), "white",
		"white", new BMessage(MSG_WHITE_SEL));
	if(COMPARECOLOR(this->selcolor, MCColorView::white))
	{
		rbtn->SetValue(B_CONTROL_ON);
	}
	this->AddChild(rbtn);
	rbtn = new BRadioButton(BRect(20, 70, 110, 80), "gray",
		"gray", new BMessage(MSG_GRAY_SEL));
	if(COMPARECOLOR(this->selcolor, MCColorView::gray))
	{
		rbtn->SetValue(B_CONTROL_ON);
	}
	this->AddChild(rbtn);
	rbtn = new BRadioButton(BRect(20, 95, 110, 105), "pink",
		"pink", new BMessage(MSG_PINK_SEL));
	if(COMPARECOLOR(this->selcolor, MCColorView::pink))
	{
		rbtn->SetValue(B_CONTROL_ON);
	}
	this->AddChild(rbtn);
	rbtn = new BRadioButton(BRect(20, 120, 110, 130), "yellow",
		"light yellow", new BMessage(MSG_YELLOW_SEL));
	if(COMPARECOLOR(this->selcolor, MCColorView::lightyellow))
	{
		rbtn->SetValue(B_CONTROL_ON);
	}
	this->AddChild(rbtn);
	rbtn = new BRadioButton(BRect(20, 145, 110, 155), "blue",
		"light blue", new BMessage(MSG_BLUE_SEL));
	if(COMPARECOLOR(this->selcolor, MCColorView::lightblue))
	{
		rbtn->SetValue(B_CONTROL_ON);
	}
	this->AddChild(rbtn);
	rbtn = new BRadioButton(BRect(20, 170, 110, 180), "green",
		"light green", new BMessage(MSG_GREEN_SEL));
	if(COMPARECOLOR(this->selcolor, MCColorView::lightgreen))
	{
		rbtn->SetValue(B_CONTROL_ON);
	}
	this->AddChild(rbtn);
}
void
AutomountSettingsPanel::AttachedToWindow()
{
	fInitialMountAllCheck->SetTarget(this);
	fInitialMountAllBFSCheck->SetTarget(this);
	fInitialMountRestoreCheck->SetTarget(this);
	fInitialDontMountCheck->SetTarget(this);

	fAutoMountAllCheck->SetTarget(this);
	fAutoMountAllBFSCheck->SetTarget(this);
	fScanningDisabledCheck->SetTarget(this);
	fEjectWhenUnmountingCheckBox->SetTarget(this);

	fDone->SetTarget(this);
	fMountAllNow->SetTarget(fTarget);
}
Пример #9
0
/////
// view attached to window
//
void MCColorView::AttachedToWindow()
{
	BRadioButton	*rbtn;

	// set view color to parent
	this->SetViewColor(this->Parent()->ViewColor());

	// set target
	rbtn = (BRadioButton *) this->FindView("white");
	rbtn->SetTarget(this);
	rbtn = (BRadioButton *) this->FindView("gray");
	rbtn->SetTarget(this);
	rbtn = (BRadioButton *) this->FindView("yellow");
	rbtn->SetTarget(this);
	rbtn = (BRadioButton *) this->FindView("pink");
	rbtn->SetTarget(this);
	rbtn = (BRadioButton *) this->FindView("blue");
	rbtn->SetTarget(this);
	rbtn = (BRadioButton *) this->FindView("green");
	rbtn->SetTarget(this);
}
Пример #10
0
BView* SeqPrefWin::NewFileView(BRect bounds, const BMessage& prefs) const
{
	BView*		v = new BView( bounds, FILE_STR, B_FOLLOW_ALL, 0 );
	if( !v ) return v;
	v->SetViewColor( Prefs().Color(AM_AUX_WINDOW_BG_C) );
	float		fh = view_font_height(v);
	float		bfh = bold_font_height();
	float		openH = bfh + 5 + fh + 5 + fh + 5 + fh;
	/* The Remember Open Songs preference.
	 */
	float		w = v->StringWidth("Remember open songs") + 25;
	BRect		f(bounds.left + 5, bounds.top + 5, bounds.left + 5 + w, bounds.top + 5 + fh);
	BCheckBox*	cb = new BCheckBox( f, REMEMBER_OPEN_STR, "Remember open songs", new BMessage(REMEMBER_OPEN_MSG) );
	if( cb ) {
		bool	b;
		if( prefs.FindBool(REMEBER_OPEN_SONGS_PREF, &b) != B_OK ) b = false;
		cb->SetValue( (b) ? B_CONTROL_ON : B_CONTROL_OFF );
		v->AddChild( cb );
	}
	/* The Skin preference.
	 */
	BMenu*		menu = new BMenu("skin_menu");
	BMessage	skinMsg(CHANGE_SKIN_MSG);
	BMenuItem*	item = new BMenuItem( "Default", new BMessage(CHANGE_SKIN_TO_DEFAULT_MSG) );
	item->SetMarked(true);
	menu->AddItem(item);
	menu->AddSeparatorItem();
	menu->SetLabelFromMarked(true);
	if( seq_make_skin_menu(menu, &skinMsg) == B_OK ) {
		const char*	label = "Choose skin:";
		f.Set(f.left, f.bottom + 8, bounds.right - 5, f.bottom + 8 + fh + 10);
		BMenuField*	field = new BMenuField(f, "skin_field", label, menu);
		if (field) {
			field->SetDivider( v->StringWidth(label) + 10 );
			v->AddChild(field);
		} else delete menu;
	} else delete menu;

	/* The Open New Songs preferences.
	 */
	f.Set(bounds.left + 5, f.bottom + 10, bounds.right - 5, f.bottom + 10 + openH + 10);
	BBox*		box = new BBox( f,
								"open_new_songs",
								B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
	if( box ) {
		box->SetLabel( "Open New Songs" );
		BRect		boxB = box->Bounds();
		BRect		sf(boxB.left + 5, boxB.top + 5 + bfh, boxB.right - 5, boxB.top + 5 + bfh + fh);
		const char*	choice;
		if( prefs.FindString(OPEN_NEW_SONG_PREF, &choice) != B_OK ) choice = 0;
		BRadioButton*	button = new BRadioButton( sf, OPEN_BLANK_STR, "Blank", new BMessage(OPEN_BLANK_MSG), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP );
		if( button ) {
			if( choice && strcmp(choice, "blank") == 0 ) button->SetValue( B_CONTROL_ON );
			box->AddChild( button );
		}
		sf.OffsetBy( 0, 5 + fh );
		button = new BRadioButton( sf, OPEN_FOUR_STR, "With two channels of each device", new BMessage(OPEN_FOUR_MSG), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP );
		if( button ) {
			if( choice && strcmp(choice, "channels") == 0 ) button->SetValue( B_CONTROL_ON );
			box->AddChild( button );
		}
		sf.OffsetBy( 0, 5 + fh );
		button = new BRadioButton( sf, OPEN_FILE_STR, "From file: <click to select>", new BMessage(OPEN_FILE_MSG), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP );
		if( button ) {
			if( choice && strcmp(choice, "file") == 0 ) button->SetValue( B_CONTROL_ON );
			entry_ref	ref;
			if( prefs.FindRef(OPEN_NEW_SONG_FILE_PREF, &ref) == B_OK )
				button->SetLabel( label_for_open_new_from_file(&ref).String() );
			box->AddChild( button );
		}
		v->AddChild( box );
		f.OffsetBy(0, f.bottom - f.top + 10 );
	}
	/* The Open From Query preferences
	 */
	f.bottom = bounds.bottom - 27;
	box = new BBox( f, "open_from_query", B_FOLLOW_ALL);
	if( box ) {
		box->SetLabel("Open From Query");

		BRect			boxB = box->Bounds();
		BRect			tableF(boxB.left + 5, boxB.top + 5 + bfh, boxB.right - 5, boxB.bottom - 35);
		mOwqTable = new _OwqList( tableF, mPreferences );
		if( mOwqTable ) {
			mOwqTable->SetLatchWidth( 0 );
			box->AddChild( mOwqTable );
			mOwqTable->AddColumn( new BStringColumn(ON_STR, 40, 20, 100, B_TRUNCATE_END), 0 );
			mOwqTable->AddColumn( new BStringColumn(NAME_STR, 100, 20, 150, B_TRUNCATE_END), 1 );
			mOwqTable->AddColumn( new BStringColumn(QUERY_STR, 180, 20, 450, B_TRUNCATE_MIDDLE), 2 );
//			mOwqTable->AddColumn( new BStringColumn(SKIP_TOP_LEVEL_STR, 100, 20, 250, B_TRUNCATE_END), 3 );
			mOwqTable->SetSortColumn(mOwqTable->ColumnAt(1), false, true);
//			mOwqTable->SetSortColumn(mOwqTable->ColumnAt(), true, true);
			mOwqTable->SetSelectionMode( B_SINGLE_SELECTION_LIST );

			BRect		bF(tableF.left, tableF.bottom + 5, tableF.left + 55, tableF.Height() - 10);
			BButton*	add = new BButton( bF, "owq_add", "Add", new BMessage(OWQ_INVOKE_ADD), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM );
			if( add ) box->AddChild( add );
			bF.OffsetBy( bF.Width() + 5, 0 );
			BButton*	change = new BButton( bF, "owq_change", "Change", new BMessage(OWQ_CHANGE), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM );
			if( change ) {
				change->SetEnabled( false );
				box->AddChild( change );
			}
			bF.OffsetBy( bF.Width() + 5, 0 );
			BButton*	remove = new BButton( bF, "owq_remove", "Remove", new BMessage(OWQ_REMOVE), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM );
			if( remove ) {
				remove->SetEnabled( false );
				box->AddChild( remove );
			}
			mOwqTable->SetButtons( add, change, remove );
		}
		v->AddChild( box );
	}
	return v;
}
Пример #11
0
void SeqPrefWin::SetOpenNewFromFileRef(const entry_ref* ref)
{
	SetRefPref(OPEN_NEW_SONG_FILE_PREF, ref);
	BRadioButton*	button = dynamic_cast<BRadioButton*>( FindView(OPEN_FILE_STR) );
	if( button ) button->SetLabel( label_for_open_new_from_file(ref).String() );
}
Пример #12
0
FindWindow::FindWindow(BMessenger messenger, const BString& str,
	bool findSelection, bool matchWord, bool matchCase, bool forwardSearch)
	:
	BWindow(kWindowFrame, B_TRANSLATE("Find"), B_FLOATING_WINDOW,
		B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_CLOSE_ON_ESCAPE
		| B_AUTO_UPDATE_SIZE_LIMITS),
	fFindDlgMessenger(messenger)
{
	SetLayout(new BGroupLayout(B_VERTICAL));

	BBox* separator = new BBox("separator");
	separator->SetExplicitMinSize(BSize(250.0, B_SIZE_UNSET));
	separator->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, 1.0));

	BRadioButton* useSelection = NULL;
	const float spacing = be_control_look->DefaultItemSpacing();
	AddChild(BGroupLayoutBuilder(B_VERTICAL, B_USE_SMALL_SPACING)
		.SetInsets(spacing, spacing, spacing, spacing)
		.Add(BGridLayoutBuilder(B_USE_SMALL_SPACING, B_USE_SMALL_SPACING)
			.Add(fTextRadio = new BRadioButton(B_TRANSLATE("Use text:"),
				new BMessage(TOGGLE_FIND_CONTROL)), 0, 0)
			.Add(fFindLabel = new BTextControl(NULL, NULL, NULL), 1, 0)
			.Add(useSelection = new BRadioButton(B_TRANSLATE("Use selection"),
				new BMessage(TOGGLE_FIND_CONTROL)), 0, 1))
		.Add(BSpaceLayoutItem::CreateVerticalStrut(spacing / 4))
		.Add(separator)
		.Add(BSpaceLayoutItem::CreateVerticalStrut(spacing / 4))
		.Add(fForwardSearchBox = new BCheckBox(B_TRANSLATE("Search forward")))
		.Add(fMatchCaseBox = new BCheckBox(B_TRANSLATE("Match case")))
		.Add(fMatchWordBox = new BCheckBox(B_TRANSLATE("Match word")))
		.AddGroup(B_HORIZONTAL)
			.AddGlue()
			.Add(fFindButton = new BButton(B_TRANSLATE("Find"),
				new BMessage(MSG_FIND)))
			.End()
		.TopView());

	fFindLabel->SetDivider(0.0);

	if (!findSelection) {
		fFindLabel->SetText(str.String());
		fFindLabel->MakeFocus(true);
	} else {
		fFindLabel->SetEnabled(false);
	}

	if (findSelection)
		useSelection->SetValue(B_CONTROL_ON);
	else
		fTextRadio->SetValue(B_CONTROL_ON);

	if (forwardSearch)
		fForwardSearchBox->SetValue(B_CONTROL_ON);

	if (matchCase)
		fMatchCaseBox->SetValue(B_CONTROL_ON);

	if (matchWord)
		fMatchWordBox->SetValue(B_CONTROL_ON);

	fFindButton->MakeDefault(true);

	AddShortcut((uint32)'W', B_COMMAND_KEY, new BMessage(MSG_FIND_HIDE));
}
Пример #13
0
// constructor
ObjectWindow::ObjectWindow(BRect frame, const char* name)
	: BWindow(frame, name, B_DOCUMENT_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
			  B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE)
{
	BRect b(Bounds());

	b.bottom = b.top + 8;
	BMenuBar* menuBar = new BMenuBar(b, "menu bar");
	AddChild(menuBar);

	BMenu* menu = new BMenu("File");
	menuBar->AddItem(menu);

	menu->AddItem(new BMenu("Submenu"));

	BMenuItem* menuItem = new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED),
										'Q');
	menu->AddItem(menuItem);

	b = Bounds();
	b.top = menuBar->Bounds().bottom + 1;
	b.right = ceilf((b.left + b.right) / 2.0);
	BBox* bg = new BBox(b, "bg box", B_FOLLOW_TOP_BOTTOM, B_WILL_DRAW,
		B_PLAIN_BORDER);

	AddChild(bg);
	bg->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));

	// object view occupies the right side of the window
	b.left = b.right + 1.0;
	b.right = Bounds().right - B_V_SCROLL_BAR_WIDTH;
	b.bottom -= B_H_SCROLL_BAR_HEIGHT;
	fObjectView = new ObjectView(b, "object view", B_FOLLOW_ALL,
								 B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE);
	// wrap a scroll view around the object view
	BScrollView* scrollView = new BScrollView("object scroller", fObjectView,
		B_FOLLOW_ALL, 0, true, true, B_NO_BORDER);

	if (BScrollBar* scrollBar = fObjectView->ScrollBar(B_VERTICAL)) {
		scrollBar->SetRange(0.0, fObjectView->Bounds().Height());
		scrollBar->SetProportion(0.5);
	}
	if (BScrollBar* scrollBar = fObjectView->ScrollBar(B_HORIZONTAL)) {
		scrollBar->SetRange(0.0, fObjectView->Bounds().Width());
		scrollBar->SetProportion(0.5);
	}
	AddChild(scrollView);

	b = bg->Bounds();
	// controls occupy the left side of the window
	b.InsetBy(5.0, 5.0);
	BBox* controlGroup = new BBox(b, "controls box",
		B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM, B_WILL_DRAW, B_FANCY_BORDER);

	controlGroup->SetLabel("Controls");
	bg->AddChild(controlGroup);

	b = controlGroup->Bounds();
	b.top += controlGroup->InnerFrame().top;
	b.bottom = b.top + 25.0;
	b.InsetBy(10.0, 10.0);
	b.right = b.left + b.Width() / 2.0 - 5.0;

	// new button
	fNewB = new BButton(b, "new button", "New Object",
		new BMessage(MSG_NEW_OBJECT));
	controlGroup->AddChild(fNewB);
	SetDefaultButton(fNewB);

	// clear button
	b.OffsetBy(0, fNewB->Bounds().Height() + 5.0);
	fClearB = new BButton(b, "clear button", "Clear", new BMessage(MSG_CLEAR));
	controlGroup->AddChild(fClearB);

	// object type radio buttons
	BMessage* message;
	BRadioButton* radioButton;

	b.OffsetBy(0, fClearB->Bounds().Height() + 5.0);
	message = new BMessage(MSG_SET_OBJECT_TYPE);
	message->AddInt32("type", OBJECT_LINE);
	radioButton = new BRadioButton(b, "radio 1", "Line", message);
	controlGroup->AddChild(radioButton);

	radioButton->SetValue(B_CONTROL_ON);

	b.OffsetBy(0, radioButton->Bounds().Height() + 5.0);
	message = new BMessage(MSG_SET_OBJECT_TYPE);
	message->AddInt32("type", OBJECT_RECT);
	radioButton = new BRadioButton(b, "radio 2", "Rect", message);
	controlGroup->AddChild(radioButton);

	b.OffsetBy(0, radioButton->Bounds().Height() + 5.0);
	message = new BMessage(MSG_SET_OBJECT_TYPE);
	message->AddInt32("type", OBJECT_ROUND_RECT);
	radioButton = new BRadioButton(b, "radio 3", "Round Rect", message);
	controlGroup->AddChild(radioButton);

	b.OffsetBy(0, radioButton->Bounds().Height() + 5.0);
	message = new BMessage(MSG_SET_OBJECT_TYPE);
	message->AddInt32("type", OBJECT_ELLIPSE);
	radioButton = new BRadioButton(b, "radio 4", "Ellipse", message);
	controlGroup->AddChild(radioButton);

	// drawing mode
	BPopUpMenu* popupMenu = new BPopUpMenu("<pick>");

	message = new BMessage(MSG_SET_DRAWING_MODE);
	message->AddInt32("mode", B_OP_COPY);
	popupMenu->AddItem(new BMenuItem("Copy", message));

	message = new BMessage(MSG_SET_DRAWING_MODE);
	message->AddInt32("mode", B_OP_OVER);
	popupMenu->AddItem(new BMenuItem("Over", message));

	message = new BMessage(MSG_SET_DRAWING_MODE);
	message->AddInt32("mode", B_OP_INVERT);
	popupMenu->AddItem(new BMenuItem("Invert", message));

	message = new BMessage(MSG_SET_DRAWING_MODE);
	message->AddInt32("mode", B_OP_BLEND);
	popupMenu->AddItem(new BMenuItem("Blend", message));

	message = new BMessage(MSG_SET_DRAWING_MODE);
	message->AddInt32("mode", B_OP_SELECT);
	popupMenu->AddItem(new BMenuItem("Select", message));

	message = new BMessage(MSG_SET_DRAWING_MODE);
	message->AddInt32("mode", B_OP_ERASE);
	popupMenu->AddItem(new BMenuItem("Erase", message));

	message = new BMessage(MSG_SET_DRAWING_MODE);
	message->AddInt32("mode", B_OP_ADD);
	popupMenu->AddItem(new BMenuItem("Add", message));

	message = new BMessage(MSG_SET_DRAWING_MODE);
	message->AddInt32("mode", B_OP_SUBTRACT);
	popupMenu->AddItem(new BMenuItem("Subtract", message));

	message = new BMessage(MSG_SET_DRAWING_MODE);
	message->AddInt32("mode", B_OP_MIN);
	popupMenu->AddItem(new BMenuItem("Min", message));

	message = new BMessage(MSG_SET_DRAWING_MODE);
	message->AddInt32("mode", B_OP_MAX);
	popupMenu->AddItem(new BMenuItem("Max", message));

	message = new BMessage(MSG_SET_DRAWING_MODE);
	message->AddInt32("mode", B_OP_ALPHA);
	BMenuItem* item = new BMenuItem("Alpha", message);
	item->SetMarked(true);
	popupMenu->AddItem(item);

	b.OffsetBy(0, radioButton->Bounds().Height() + 10.0);
	fDrawingModeMF = new BMenuField(b, "drawing mode field", "Mode:",
		popupMenu);

	controlGroup->AddChild(fDrawingModeMF);

	fDrawingModeMF->SetDivider(fDrawingModeMF->StringWidth(
		fDrawingModeMF->Label()) + 10.0);
	
	// color control
	b.OffsetBy(0, fDrawingModeMF->Bounds().Height() + 10.0);
	fColorControl = new BColorControl(b.LeftTop(), B_CELLS_16x16, 8,
		"color control", new BMessage(MSG_SET_COLOR));
	controlGroup->AddChild(fColorControl);
	
	// alpha text control
	b.OffsetBy(0, fColorControl-> Bounds().Height() + 5.0);
	fAlphaTC = new BTextControl(b, "alpha text control", "Alpha:", "",
		new BMessage(MSG_SET_COLOR));
	controlGroup->AddChild(fAlphaTC);

	// divide text controls the same
    float mWidth = fDrawingModeMF->StringWidth(fDrawingModeMF->Label());
    float aWidth = fAlphaTC->StringWidth(fAlphaTC->Label());
    
    float width = max_c(mWidth, aWidth) + 20.0;
	fDrawingModeMF->SetDivider(width);
	fAlphaTC->SetDivider(width);

	// fill check box
	b.OffsetBy(0, fAlphaTC->Bounds().Height() + 5.0);
	fFillCB = new BCheckBox(b, "fill check box", "Fill",
		new BMessage(MSG_SET_FILL_OR_STROKE));
	controlGroup->AddChild(fFillCB);

	// pen size text control
	b.OffsetBy(0, radioButton->Bounds().Height() + 5.0);
	b.bottom = b.top + 10.0;//35;
	fPenSizeS = new BSlider(b, "width slider", "Width:", NULL, 1, 100,
		B_TRIANGLE_THUMB);
	fPenSizeS->SetLimitLabels("1", "100");
	fPenSizeS->SetModificationMessage(new BMessage(MSG_SET_PEN_SIZE));
	fPenSizeS->SetHashMarks(B_HASH_MARKS_BOTTOM);
	fPenSizeS->SetHashMarkCount(10);

	controlGroup->AddChild(fPenSizeS);

	// list view with objects
	b = controlGroup->Bounds();
	b.top += controlGroup->InnerFrame().top;
	b.InsetBy(10.0, 10.0);
	b.left = b.left + b.Width() / 2.0 + 6.0;
	b.right -= B_V_SCROLL_BAR_WIDTH;
    b.bottom = fDrawingModeMF->Frame().top - 10.0;

	fObjectLV = new ObjectListView(b, "object list", B_SINGLE_SELECTION_LIST);
	fObjectLV->SetSelectionMessage(new BMessage(MSG_OBJECT_SELECTED));

	// wrap a scroll view around the list view
	scrollView = new BScrollView("list scroller", fObjectLV,
		B_FOLLOW_NONE, 0, false, true, B_FANCY_BORDER);
	controlGroup->AddChild(scrollView);

	// enforce some size limits
	float minWidth = controlGroup->Frame().Width() + 30.0;
	float minHeight = fPenSizeS->Frame().bottom
		+ menuBar->Bounds().Height() + 15.0;
	float maxWidth = minWidth * 4.0;
	float maxHeight = minHeight + 100;
	SetSizeLimits(minWidth, maxWidth, minHeight, maxHeight);

	ResizeTo(max_c(frame.Width(), minWidth), max_c(frame.Height(), minHeight));

	_UpdateControls();
}
Пример #14
0
void YabWindow::MessageReceived(BMessage *message)
{
	// if(message) message->PrintToStream();
	switch(message->what)
	{
		case YABBUTTON:
			{
				BString tmpMessage("");
                        	BButton *myButtonPressed;
                        	message->FindPointer("source",(void **) &myButtonPressed);
				tmpMessage += myButtonPressed->Name();
				tmpMessage += "|";
				messageString += tmpMessage;
			}
			break;
		case YABMENU:
			{
				BString tmpMessage("");
				BMenuItem *mySelectedMenu;
                        	message->FindPointer("source",(void **) &mySelectedMenu);
				BMenu *myMenu = mySelectedMenu->Menu();
				tmpMessage += ((BMenuBar*)myMenu->Supermenu())->Parent()->Name();
				tmpMessage += ":";
				tmpMessage += myMenu->Name();
				tmpMessage += ":";
                        	tmpMessage += mySelectedMenu->Label(); 
				tmpMessage += "|";
				messageString += tmpMessage;
			}
			break;
		case YABSUBMENU:
			{
				BString tmpMessage("");
				BMenuItem *mySelectedMenu;
                        	message->FindPointer("source",(void **) &mySelectedMenu);
				BMenu *myMenu = mySelectedMenu->Menu();
				tmpMessage += ((BMenuBar*)myMenu->Supermenu()->Supermenu())->Parent()->Name();
				tmpMessage += ":";
				tmpMessage += myMenu->Supermenu()->Name();
				tmpMessage += ":";
				tmpMessage += myMenu->Name();
				tmpMessage += ":";
                        	tmpMessage += mySelectedMenu->Label(); 
				tmpMessage += "|";
				messageString += tmpMessage;
			}
			break;
		case YABTEXTCONTROL:
			{
				BString tmpMessage("");
				BTextControl *myTextControl;
                        	message->FindPointer("source",(void **) &myTextControl);
				tmpMessage += myTextControl->Name();
				tmpMessage += ":";
				tmpMessage += myTextControl->Text();
				tmpMessage += "|";
				messageString += tmpMessage;
			}
			break;
		case YABCHECKBOX:
			{
				BString tmpMessage("");
				BCheckBox *myCheckBox;
                        	message->FindPointer("source",(void **) &myCheckBox);
				tmpMessage += myCheckBox->Name();
				tmpMessage += ":";
				if(myCheckBox->Value()==B_CONTROL_ON)
					tmpMessage += "ON|";
				else
					tmpMessage += "OFF|";
				messageString += tmpMessage;
			}
			break;
		case YABRADIOBUTTON:
			{
				BString tmpMessage("");
				BRadioButton *myRadioButton;
                        	message->FindPointer("source",(void **) &myRadioButton);
				tmpMessage += myRadioButton->Name();
				tmpMessage += "|";
				messageString += tmpMessage;
			}
			break;
		case YABLISTBOXINVOKE:
			{
				BListView *myList;
				message->FindPointer("source",(void **) &myList);
				int i = myList->CurrentSelection();
				if(i>=0)
				{
					BString tmpMessage("");
					tmpMessage += myList->Name();
					tmpMessage += ":_Invoke:";
					// tmpMessage += ((BStringItem*)(myList->ItemAt(i)))->Text();
					tmpMessage << i+1;
					tmpMessage += "|";
					messageString += tmpMessage;
				}
			}
			break;
		case YABLISTBOXSELECT:
			{
				BListView *myList;
				message->FindPointer("source",(void **) &myList);
				int i = myList->CurrentSelection();
				if(i>=0)
				{
					BString tmpMessage("");
					tmpMessage += myList->Name();
					tmpMessage += ":_Select:";
					// tmpMessage += ((BStringItem*)(myList->ItemAt(i)))->Text();
					tmpMessage << i+1;
					tmpMessage += "|";
					messageString += tmpMessage;
				}
			}
			break;
		case YABDROPBOX:
			{
				BString tmpMessage("");
				BMenuItem *myMenuItem;
				message->FindPointer("source",(void **) &myMenuItem);
				tmpMessage += (myMenuItem->Menu())->Supermenu()->Parent()->Name();
				tmpMessage += ":";
				tmpMessage += myMenuItem->Label();
				tmpMessage += "|";
				messageString += tmpMessage;
			}
			break;
		case YABSLIDER:
			{
				BString tmpMessage("");
                        	BSlider *mySlider;
                        	message->FindPointer("source",(void **) &mySlider);
				tmpMessage += mySlider->Name();
				tmpMessage += ":";
				tmpMessage << mySlider->Value();
				tmpMessage += "|";
				messageString += tmpMessage;
			}
			break;
		case YABCOLORCONTROL:
			{
				rgb_color col;
				BString tmpMessage("");
                        	BColorControl *myCControl;
                        	message->FindPointer("source",(void **) &myCControl);
				tmpMessage += myCControl->Name();
				tmpMessage += ":";
				col = myCControl->ValueAsColor();
				tmpMessage << col.red << ":" << col.green << ":" << col.blue;
				tmpMessage += "|";
				messageString += tmpMessage;
			}
			break;
		case YABTREEBOXINVOKE:
			{
				BOutlineListView *myList;
				message->FindPointer("source",(void **) &myList);
				int i = myList->FullListCurrentSelection();
				if(i>=0)
				{
					BString tmpMessage("");
					const char* txt = ((BStringItem*)(myList->FullListItemAt(i)))->Text();
					tmpMessage += myList->Name();
					tmpMessage += ":_Invoke:";
					tmpMessage << i+1;
					/*
					int n = tmpMessage.Length();
					BListItem *superitem = myList->Superitem(myList->FullListItemAt(i));
					while(superitem)
					{
						BString t("");
						t << ((BStringItem*)superitem)->Text() << ":";
						tmpMessage.Insert(t,n);
						superitem = myList->Superitem(superitem);
					}
					tmpMessage += txt;*/
					tmpMessage += "|";
					messageString += tmpMessage;
				}
			}
			break;
		case YABTREEBOXSELECT:
			{
				BOutlineListView *myList;
				message->FindPointer("source",(void **) &myList);
				int i = myList->FullListCurrentSelection();
				if(i>=0)
				{
					BString tmpMessage("");
					const char* txt = ((BStringItem*)(myList->FullListItemAt(i)))->Text();
					tmpMessage += myList->Name();
					tmpMessage += ":_Select:";
					tmpMessage << i+1;
					/*
					int n = tmpMessage.Length();
					BListItem *superitem = myList->Superitem(myList->FullListItemAt(i));
					while(superitem)
					{
						BString t("");
						t << ((BStringItem*)superitem)->Text() << ":";
						tmpMessage.Insert(t,n);
						superitem = myList->Superitem(superitem);
					}
					tmpMessage += txt;*/
					tmpMessage += "|";
					messageString += tmpMessage;
				}
			}
			break;
		case YABFILEBOXSELECT:
			{
				BColumnListView *myList;
				message->FindPointer("source",(void **) &myList);
				BRow *myRow = NULL;
				if(myList) myRow = myList->CurrentSelection();
				if(myRow)
				{
				//	if(!myList->IsFocus()) myList->MakeFocus();
					BString tmpMessage("");
					tmpMessage += myList->Name();
					tmpMessage += ":_Select:";
					tmpMessage << myList->IndexOf(myRow)+1; 
					tmpMessage += "|";
					messageString += tmpMessage;
				}
			}
			break;
		case YABFILEBOXINVOKE:
			{
				BColumnListView *myList;
				message->FindPointer("source",(void **) &myList);
				BRow *myRow = NULL;
				if(myList) myRow = myList->CurrentSelection();
				if(myRow)
				{
				//	if(!myList->IsFocus()) myList->MakeFocus();
					BString tmpMessage("");
					tmpMessage += myList->Name();
					tmpMessage += ":_Invoke:";
					tmpMessage << myList->IndexOf(myRow)+1; 
					tmpMessage += "|";
					messageString += tmpMessage;
				}
			}
			break;
		case YABSHORTCUT:
			{
				const char* myMsg;
				if(message->FindString("shortcut", &myMsg) == B_OK)
				{
					messageString += myMsg;
					messageString += "|";
				}
			}
			break;
		default:
			BWindow::MessageReceived(message);
			break;
	}
}
Пример #15
0
void 
JobSetupView::AttachedToWindow()
{
	// quality
	BBox* qualityBox = new BBox("quality");
	qualityBox->SetLabel("Quality");

	// color
	fColorType = new BPopUpMenu("color");
	fColorType->SetRadioMode(true);
	FillCapabilityMenu(fColorType, kMsgQuality, PrinterCap::kColor,
		fJobData->GetColor());
	BMenuField* colorMenuField = new BMenuField("color", "Color:", fColorType);
	fColorType->SetTargetForItems(this);
	
	if (IsHalftoneConfigurationNeeded())
		CreateHalftoneConfigurationUI();

	// page range

	BBox* pageRangeBox = new BBox("pageRange");
	pageRangeBox->SetLabel("Page Range");

	fAll = new BRadioButton("all", "Print all Pages", new BMessage(kMsgRangeAll));

	BRadioButton *range = new BRadioButton("selection", "Print selected Pages:",
		new BMessage(kMsgRangeSelection));

	fFromPage = new BTextControl("from", "From:", "", NULL);
	fFromPage->SetAlignment(B_ALIGN_LEFT, B_ALIGN_RIGHT);
	AllowOnlyDigits(fFromPage->TextView(), 6);

	fToPage = new BTextControl("to", "To:", "", NULL);
	fToPage->SetAlignment(B_ALIGN_LEFT, B_ALIGN_RIGHT);
	AllowOnlyDigits(fToPage->TextView(), 6);

	int first_page = fJobData->GetFirstPage();
	int last_page  = fJobData->GetLastPage();

	if (first_page <= 1 && last_page <= 0) {
		fAll->SetValue(B_CONTROL_ON);
	} else {
		range->SetValue(B_CONTROL_ON);
		if (first_page < 1)
			first_page = 1;
		if (first_page > last_page)
			last_page = -1;

		BString oss1;
		oss1 << first_page;
		fFromPage->SetText(oss1.String());

		BString oss2;
		oss2 << last_page;
		fToPage->SetText(oss2.String());
	}

	fAll->SetTarget(this);
	range->SetTarget(this);

	// paper source
	fPaperFeed = new BPopUpMenu("");
	fPaperFeed->SetRadioMode(true);
	FillCapabilityMenu(fPaperFeed, kMsgNone, PrinterCap::kPaperSource,
		fJobData->GetPaperSource());
	BMenuField* paperSourceMenufield = new BMenuField("paperSource",
		"Paper Source:", fPaperFeed);

	// Pages per sheet
	fNup = new BPopUpMenu("");
	fNup->SetRadioMode(true);
	FillCapabilityMenu(fNup, kMsgNone, gNups,
		sizeof(gNups) / sizeof(gNups[0]), (int)fJobData->GetNup());
	BMenuField* pagesPerSheet = new BMenuField("pagesPerSheet",
		"Pages Per Sheet:", fNup);

	// duplex
	if (fPrinterCap->Supports(PrinterCap::kPrintStyle)) {
		fDuplex = new BCheckBox("duplex", "Duplex",
			new BMessage(kMsgDuplexChanged));
		if (fJobData->GetPrintStyle() != JobData::kSimplex) {
			fDuplex->SetValue(B_CONTROL_ON);
		}
		fDuplex->SetTarget(this);
	} else {
		fDuplex = NULL;
	}

	// copies
	fCopies = new BTextControl("copies", "Number of Copies:", "", NULL);
	AllowOnlyDigits(fCopies->TextView(), 3);

	BString copies;
	copies << fJobData->GetCopies();
	fCopies->SetText(copies.String());

	// collate
	fCollate = new BCheckBox("collate", "Collate",
		new BMessage(kMsgCollateChanged));
	if (fJobData->GetCollate()) {
		fCollate->SetValue(B_CONTROL_ON);
	}
	fCollate->SetTarget(this);

	// reverse
	fReverse = new BCheckBox("reverse", "Reverse Order",
		new BMessage(kMsgReverseChanged));
	if (fJobData->GetReverse()) {
		fReverse->SetValue(B_CONTROL_ON);
	}
	fReverse->SetTarget(this);

	// pages view
	// TODO make layout API compatible
	fPages = new PagesView(BRect(0, 0, 150, 40), "pages", B_FOLLOW_ALL,
		B_WILL_DRAW);
	fPages->SetCollate(fJobData->GetCollate());
	fPages->SetReverse(fJobData->GetReverse());
	fPages->SetExplicitMinSize(BSize(150, 40));
	fPages->SetExplicitMaxSize(BSize(150, 40));
	
	// page selection
	BBox* pageSelectionBox = new BBox("pageSelection");
	pageSelectionBox->SetLabel("Page Selection");
	
	fAllPages = CreatePageSelectionItem("allPages", "All Pages",
		JobData::kAllPages);
	fOddNumberedPages = CreatePageSelectionItem("oddPages",
		"Odd-Numbered Pages", JobData::kOddNumberedPages);
	fEvenNumberedPages = CreatePageSelectionItem("evenPages",
		"Even-Numbered Pages", JobData::kEvenNumberedPages);

	fPreview = new BCheckBox("preview", "Show preview before printing", NULL);
	if (fJobData->GetShowPreview())
		fPreview->SetValue(B_CONTROL_ON);

	// separator line
	BBox *separator = new BBox("separator");
	separator->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, 1));

	// buttons
	BButton* cancel = new BButton("cancel", "Cancel",
		new BMessage(kMsgCancel));
	BButton* ok = new BButton("ok", "OK", new BMessage(kMsgOK));
	ok->MakeDefault(true);
	
	if (IsHalftoneConfigurationNeeded()) {
		BGroupView* halftoneGroup = new BGroupView(B_VERTICAL, 0);
		BGroupLayout* halftoneLayout = halftoneGroup->GroupLayout();
		halftoneLayout->AddView(fHalftone);
		fHalftoneBox->AddChild(halftoneGroup);
	}

	BGridView* qualityGrid = new BGridView();
	BGridLayout* qualityGridLayout = qualityGrid->GridLayout();
	qualityGridLayout->AddItem(colorMenuField->CreateLabelLayoutItem(), 0, 0);
	qualityGridLayout->AddItem(colorMenuField->CreateMenuBarLayoutItem(), 1, 0);
	if (IsHalftoneConfigurationNeeded()) {
		qualityGridLayout->AddItem(fDitherMenuField->CreateLabelLayoutItem(),
			0, 1);
		qualityGridLayout->AddItem(fDitherMenuField->CreateMenuBarLayoutItem(),
			1, 1);
		qualityGridLayout->AddView(fGamma, 0, 2, 2);
		qualityGridLayout->AddView(fInkDensity, 0, 3, 2);
		qualityGridLayout->AddView(fHalftoneBox, 0, 4, 2);
	} else {
		AddDriverSpecificSettings(qualityGridLayout, 1);
	}
	qualityGridLayout->SetSpacing(0, 0);
	qualityGridLayout->SetInsets(5, 5, 5, 5);
	qualityBox->AddChild(qualityGrid);
	// TODO put qualityGrid in a scroll view
	// the layout of the box surrounding the scroll view using the following
	// code is not correct; the box still has the size of the qualityGird;
	// and the scroll view is vertically centered inside the box!
	//BScrollView* qualityScroller = new BScrollView("qualityScroller",
	//	qualityGrid, 0, false, true);
	//qualityScroller->SetExplicitMaxSize(BSize(500, 500));
	//qualityBox->AddChild(qualityScroller);

	BGridView* pageRangeGrid = new BGridView();
	BGridLayout* pageRangeLayout = pageRangeGrid->GridLayout();
	pageRangeLayout->AddItem(fFromPage->CreateLabelLayoutItem(), 0, 0);
	pageRangeLayout->AddItem(fFromPage->CreateTextViewLayoutItem(), 1, 0);
	pageRangeLayout->AddItem(fToPage->CreateLabelLayoutItem(), 0, 1);
	pageRangeLayout->AddItem(fToPage->CreateTextViewLayoutItem(), 1, 1);
	pageRangeLayout->SetInsets(0, 0, 0, 0);
	pageRangeLayout->SetSpacing(0, 0);

	BGroupView* pageRangeGroup = new BGroupView(B_VERTICAL, 0);
	BGroupLayout* pageRangeGroupLayout = pageRangeGroup->GroupLayout();
	pageRangeGroupLayout->AddView(fAll);
	pageRangeGroupLayout->AddView(range);
	pageRangeGroupLayout->AddView(pageRangeGrid);
	pageRangeGroupLayout->SetInsets(5, 5, 5, 5);
	pageRangeBox->AddChild(pageRangeGroup);

	BGridView* settings = new BGridView();
	BGridLayout* settingsLayout = settings->GridLayout();
	settingsLayout->AddItem(paperSourceMenufield->CreateLabelLayoutItem(), 0,
		0);
	settingsLayout->AddItem(paperSourceMenufield->CreateMenuBarLayoutItem(), 1,
		0);
	settingsLayout->AddItem(pagesPerSheet->CreateLabelLayoutItem(), 0, 1);
	settingsLayout->AddItem(pagesPerSheet->CreateMenuBarLayoutItem(), 1, 1);
	int row = 2;
	if (fDuplex != NULL) {
		settingsLayout->AddView(fDuplex, 0, row, 2);
		row ++;
	}
	settingsLayout->AddItem(fCopies->CreateLabelLayoutItem(), 0, row);
	settingsLayout->AddItem(fCopies->CreateTextViewLayoutItem(), 1, row);
	settingsLayout->SetSpacing(0, 0);


	BGroupView* pageSelectionGroup = new BGroupView(B_VERTICAL, 0);
	BGroupLayout* groupLayout = pageSelectionGroup->GroupLayout();
	groupLayout->AddView(fAllPages);
	groupLayout->AddView(fOddNumberedPages);
	groupLayout->AddView(fEvenNumberedPages);
	groupLayout->SetInsets(5, 5, 5, 5);
	pageSelectionBox->AddChild(pageSelectionGroup);

	SetLayout(new BGroupLayout(B_VERTICAL));
	AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
		.AddGroup(B_HORIZONTAL, 10, 1.0f)
			.AddGroup(B_VERTICAL, 10, 1.0f)
				.Add(qualityBox)
				.Add(pageRangeBox)
				.AddGlue()
			.End()
			.AddGroup(B_VERTICAL, 0, 1.0f)
				.Add(settings)
				.AddStrut(5)
				.Add(fCollate)
				.Add(fReverse)
				.Add(fPages)
				.AddStrut(5)
				.Add(pageSelectionBox)
				.AddGlue()
			.End()
		.End()
		.Add(fPreview)
		.AddGlue()
		.Add(separator)
		.AddGroup(B_HORIZONTAL, 10, 1.0f)
			.AddGlue()
			.Add(cancel)
			.Add(ok)
		.End()
		.SetInsets(0, 0, 0, 0)
	);

	UpdateHalftonePreview();

	UpdateButtonEnabledState();
}
Пример #16
0
DataView::DataView(BRect size)
	:
	BView(size, "DataView", B_FOLLOW_NONE, B_WILL_DRAW)
{
	SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
	BRect r;
	r = Bounds();
	r.InsetBy(5.0, 5.0);
	r.bottom = 90;
	IconLabel* fileSystemLabel = new IconLabel(BRect(0, 0, 28 + be_bold_font->StringWidth(" Filesystem"), 19), " Filesystem", "datacd_16.png");
	fileSystemLabel->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
	fileSystemLabel->SetDrawingMode(B_OP_ALPHA);
	BBox* fileSystemBox = new BBox(r, "fFileSystemBox", B_FOLLOW_NONE, B_WILL_DRAW | B_FRAME_EVENTS, B_PLAIN_BORDER);
	fileSystemBox->SetLabel(fileSystemLabel);
	AddChild(fileSystemBox);
	r = fileSystemBox->Bounds();
	r.InsetBy(5.0, 5.0);
	r.top += 10;
	r.right = 220;
	r.bottom = 25;
	BRadioButton* ISO9660Radio = new BRadioButton(r, "ISO-9660", "ISO-9660", new BMessage(DATA_ISO9660));
	if (!strcmp(DATA_STRING, " ") && IMAGE_TYPE == 0)
		ISO9660Radio->SetValue(B_CONTROL_ON);
	fileSystemBox->AddChild(ISO9660Radio);


	r.bottom += 15;
	r.top += 15;
	BRadioButton* windowsRadio = new BRadioButton(r, "ISO-9660 with long filenames", "ISO-9660 with long filenames", new BMessage(DATA_WINDOWS));
	if (!strcmp(DATA_STRING, "-D -l") && IMAGE_TYPE == 0)
		windowsRadio->SetValue(B_CONTROL_ON);
	fileSystemBox->AddChild(windowsRadio);

	r.bottom += 15;
	r.top += 15;
	BRadioButton* jolietRadio = new BRadioButton(r, "fJolietRadio", "Windows (Joliet)", new BMessage(DATA_JOLIET));
	if (!strcmp(DATA_STRING, "-l -D -J") && IMAGE_TYPE == 0)
		jolietRadio->SetValue(B_CONTROL_ON);
	fileSystemBox->AddChild(jolietRadio);

	r.bottom += 15;
	r.top += 15;
	fBeOSRadio = new BRadioButton(r, "Haiku", "Haiku (bfs)", new BMessage(DATA_BFS));
	if (IMAGE_TYPE == 1)
		fBeOSRadio->SetValue(B_CONTROL_ON);

	fileSystemBox->AddChild(fBeOSRadio);


	r = fileSystemBox->Bounds();
	r.InsetBy(5.0, 5.0);
	r.top += 10;
	r.bottom = 25;
	r.left = 230;
	BRadioButton* rockRadio = new BRadioButton(r, "RockRidge (UNIX Multiuser)", "RockRidge (UNIX Singeluser)", new BMessage(DATA_ROCK));
	if (!strcmp(DATA_STRING, "-l -L -r") && IMAGE_TYPE == 0)
		rockRadio->SetValue(B_CONTROL_ON);
	fileSystemBox->AddChild(rockRadio);

	r.bottom += 15;
	r.top += 15;
	BRadioButton* realRockRadio = new BRadioButton(r, "Real RockRidge (UNIX Multiuser)", "Real RockRidge (UNIX Multiuser)", new BMessage(DATA_REALROCK));
	if (!strcmp(DATA_STRING, "-l -L -R") && IMAGE_TYPE == 0)
		realRockRadio->SetValue(B_CONTROL_ON);
	fileSystemBox->AddChild(realRockRadio);

	r.bottom += 15;
	r.top += 15;
	BRadioButton* macRadio = new BRadioButton(r, "fMacRadio", "Mac (hfs)", new BMessage(DATA_HFS));
	if (!strcmp(DATA_STRING, "-hfs") && IMAGE_TYPE == 0)
		macRadio->SetValue(B_CONTROL_ON);
	fileSystemBox->AddChild(macRadio);

	r.bottom += 15;
	r.top += 15;
	BRadioButton* ownRadio = new BRadioButton(r, "own", "Own (choose mkisofs options)", new BMessage(DATA_HFS));
//	if(!strcmp(DATA_STRING,"-hfs"))
//		fMacRadio->SetValue(B_CONTROL_ON);
	ownRadio->SetEnabled(false);
	fileSystemBox->AddChild(ownRadio);

	r = Bounds();
	r.InsetBy(5.0, 5.0);
	r.top = 95;
	r.right = r.right - 160;

	IconLabel* bootLabel = new IconLabel(BRect(0, 0, 19 + 
	                       be_bold_font->StringWidth(" El Torito Bootable CD"), 19), " El Torito Bootable CD", "bootcd_16.png");
	bootLabel->SetDrawingMode(B_OP_ALPHA);                       
	bootLabel->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
	BBox* bootBox = new BBox(r, "BootBox", B_FOLLOW_NONE, B_WILL_DRAW | B_FRAME_EVENTS, B_PLAIN_BORDER);
	bootBox->SetLabel(bootLabel);
	AddChild(bootBox);

	r = bootBox->Bounds();
	r.InsetBy(5.0, 5.0);
	r.top += 10;
	r.bottom = r.top + 15;
	fBootableCDCheckBox = new BCheckBox(r, "fBootableCDCheckBox", "Enable BootableCD", new BMessage(BOOT_CHECKED));
	if (BOOTABLE)
		fBootableCDCheckBox->SetValue(B_CONTROL_ON);
	if (!VRCD)
		fBootableCDCheckBox->SetEnabled(false);

	bootBox->AddChild(fBootableCDCheckBox);

	r = bootBox->Bounds();
	r.InsetBy(5.0, 5.0);
	r.top += 35;
	fChooseBootImageButton = new BButton(r, "fChooseBootImageButton", "Choose boot image", new BMessage(BOOT_FILE_PANEL));
	if (!BOOTABLE || !VRCD)
		fChooseBootImageButton->SetEnabled(false);
	bootBox->AddChild(fChooseBootImageButton);

	r = Bounds();
	r.InsetBy(5.0, 5.0);
	r.top = 135;
	r.left = r.right - 150;
	r.bottom = 165;

	AddChild(new BButton(r, "Change Volume Name", "Change Volume Name", new BMessage(CHANGE_VOL_NAME)));

	fFilePanel = new BFilePanel(B_OPEN_PANEL);
	fFilePanel->SetMessage(new BMessage(BOOT_CHANGE_IMAGE_NAME));
}