Beispiel #1
0
void Clock::StartConfig(BView *view)
{
	tview = new BStringView(BRect(10, 10, 200, 35), B_EMPTY_STRING, "Simple Clock");
	tview->SetFont(be_bold_font);
	tview->SetFontSize(15);
	view->AddChild(tview);
	view->AddChild(new BStringView(BRect(10, 40, 200, 65), B_EMPTY_STRING, " Ver 0.1, ©3dEyes**"));
}
Beispiel #2
0
AttribFill::AttribFill ()
: AttribView (BRect (0, 0, 146, 146), lstring (24, "Fill"))
{
	SetViewColor (LightGrey);
	BBox *tolSets = new BBox (BRect (4, 4, 142, 142), "tol");
	tolSets->SetLabel (lstring (338, "Tolerance"));
	AddChild (tolSets);
	tol = new BRadioButton (BRect (8, 13, 124, 30), "tol", lstring (339, "Visual Distance"), new BMessage ('AFtV'));
	rgb = new BRadioButton (BRect (8, 30, 124, 46), "rgb", lstring (340, "Absolute RGB"), new BMessage ('AFtS'));
	tol->SetValue (B_CONTROL_ON);
	tolSets->AddChild (tol);
	tolSets->AddChild (rgb);
	TabView *bgTab = new TabView (BRect (4, 50, 132, 134), "AttribFill Tab");
	tolSets->AddChild (bgTab);
	BView *tolTab = new BView (BRect (2, TAB_HEIGHT + 4, 126, TAB_HEIGHT + 63), "tol View", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
	BView *rgbTab = new BView (BRect (2, TAB_HEIGHT + 4, 126, TAB_HEIGHT + 63), "rgb View", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
	tolTab->SetViewColor (LightGrey);
	rgbTab->SetViewColor (LightGrey);
	bgTab->AddView (tolTab, lstring (341, "Visual"));
	bgTab->AddView (rgbTab, lstring (342, "RGB"));
	BStringView *explD = new BStringView (BRect (2, 8, 122, 20), "explD", lstring (343, "Visual Factors:"));
	BStringView *facD = new BStringView (BRect (2, 20, 122, 32), "facD", lstring (344, "R: 0.213 G: 0.715 B: 0.072"));
	explD->SetFontSize (10);
	facD->SetFontSize (10);
	sT = new Slider (BRect (4, 42, 122, 58), 10, "D", 0, 255, 1, new BMessage ('AFcT'));
	sR = new Slider (BRect (4,  2, 122, 18), 10, "R", 0, 255, 1, new BMessage ('AFcR'));
	sG = new Slider (BRect (4, 22, 122, 38), 10, "G", 0, 255, 1, new BMessage ('AFcG'));
	sB = new Slider (BRect (4, 42, 122, 58), 10, "B", 0, 255, 1, new BMessage ('AFcB'));
	tolTab->AddChild (sT);
	tolTab->AddChild (explD);
	tolTab->AddChild (facD);
	rgbTab->AddChild (sR);
	rgbTab->AddChild (sG);
	rgbTab->AddChild (sB);
	fTolMode = FILLTOL_TOL;
	fTolerance = 0;
	fToleranceRGB.red = 0;
	fToleranceRGB.green = 0;
	fToleranceRGB.blue = 0;
	fCurrentProperty = 0;
}
Beispiel #3
0
HighScores::HighScores(Hall& H, BMessage *m, BLooper *l):
        BWindow(BRect(100, 100, 820, 500), "BShisen High Scores",
                B_TITLED_WINDOW,
                B_NOT_RESIZABLE | /*B_NOT_CLOSABLE |*/ B_NOT_ZOOMABLE)
{
BView *back;
BListView *LV;
BScrollView *SV;
BRect r;
BStringView *str;


	loop = l;
	msg = m;
	
	back = new BView(Bounds(), "BackGround", B_FOLLOW_ALL, B_WILL_DRAW); 

        back->SetViewColor(216, 216, 216);  

	AddChild(back);

	str = new BStringView(BRect(10, 10, 190, 25), "", "Name");
	str->SetHighColor(0, 0, 0);
	str->SetFontSize(14);
	str->SetFont(be_bold_font);
	back->AddChild(str);


	str = new BStringView(BRect(200, 10, 290, 25), "", "Time");
	str->SetHighColor(0, 0, 0);
	str->SetFontSize(14);
	str->SetFont(be_bold_font);
	back->AddChild(str);

	str = new BStringView(BRect(300, 10, 390, 25), "", "Game Size");
	str->SetHighColor(0, 0, 0);
	str->SetFontSize(14);
	str->SetFont(be_bold_font);
	back->AddChild(str);

	str = new BStringView(BRect(400, 10, 490, 25), "", "Game Number");
	str->SetHighColor(0, 0, 0);
	str->SetFontSize(14);
	str->SetFont(be_bold_font);
	back->AddChild(str);

	str = new BStringView(BRect(500, 10, 590, 25), "", "Date");
	str->SetHighColor(0, 0, 0);
	str->SetFontSize(14);
	str->SetFont(be_bold_font);
	back->AddChild(str);

	str = new BStringView(BRect(600, 10, 720, 25), "", "Tiles Per Minute");
	str->SetHighColor(0, 0, 0);
	str->SetFontSize(14);
	str->SetFont(be_bold_font);
	back->AddChild(str);


	r = Bounds();
	r.right -= 14;
	r.top += 30;

	LV = new BListView(r, "");
	SV = new BScrollView("", LV, B_FOLLOW_ALL, 0, false, true);

	LV->AddList(H.List);
	LV->AddList(H.List1);
	LV->AddList(H.List2);
	LV->AddList(H.List3);
	LV->AddList(H.List4);
	LV->AddList(H.List5);

	back->AddChild(SV);

}
Beispiel #4
0
void Shisen::AboutRequested(void)
{
BWindow *about = NULL;
thread_id id;


	id = find_thread("w>About BShisen");
	if (id != B_NAME_NOT_FOUND)
	{
		about = (BWindow *)LooperForThread(id);
	}

	if (about)
	{
		about->SetWorkspaces(B_CURRENT_WORKSPACE);
		about->Activate();
	}
	else
	{
		BView *back;
		BStringView *str;
		BBitmap *bmap;
		
		about = new BWindow(BRect(50, 50, 360, 190), 
			_("ABOUT_BSHISEN","About BShisen"),
			B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE);
		
		back = new BView(about->Bounds(), NULL, B_FOLLOW_NONE, B_WILL_DRAW);
		back->SetViewColor(0, 0, 0);	//black background
		about->AddChild(back);
	
	
		str = new BStringView(BRect(100, 10, 310, 30), NULL, "BShisen 1.5.0-alpha");
		str->SetFontSize(14);
		str->SetHighColor(0,255,0);
		back->AddChild(str);
	
		str = new BStringView(BRect(100, 35, 310, 55), NULL,
			"(c) 1999-2014 Kelvin W Sherlock"
						);
		str->SetFontSize(12);
		str->SetHighColor(0,255,0);
		back->AddChild(str);
	
		str = new BStringView(BRect(100, 60, 310, 80), NULL,
			"Maintainer: [email protected]");
		str->SetFontSize(10);
		str->SetHighColor(0,255,0);
		back->AddChild(str);


#if BUILD == SHAREWARE	
		if (!REGISTERED) //70, 90
		{
			str = new BStringView(BRect(30, 85, 310, 105), NULL, "UNREGISTERED - PLEASE REGISTER");
			str->SetFontSize(12);
			str->SetHighColor(255,0,0);
			back->AddChild(str);
		}
#endif

#if BUILD == BEGROOVY
	{
			str = new BStringView(BRect(100, 95, 310, 110), NULL, 
				"Get your groove on - BeGroovy");
			str->SetFontSize(12);
			str->SetHighColor(255,0,0);
			back->AddChild(str);
			
			str = new BStringView(BRect(100, 110, 310, 130), NULL, 
				"www.BeGroovy.com");
			str->SetFontSize(14);
			str->SetHighColor(255,0,0);
			back->AddChild(str);
	
	}
#endif

#if BUILD == CUSTOM
	{
			str = new BStringView(BRect(100, 95, 310, 110), NULL, 
				B_UTF8_OPEN_QUOTE "It's the same train, but it's different."B_UTF8_CLOSE_QUOTE);
			str->SetFontSize(10);
			str->SetHighColor(255,0,0);
			back->AddChild(str);
			
			str = new BStringView(BRect(100, 110, 310, 130), NULL, 
				 B_UTF8_OPEN_QUOTE "Based on 1.2pre sources (Released 2014)" B_UTF8_CLOSE_QUOTE);
			str->SetFontSize(10);
			str->SetHighColor(255,0,0);
			back->AddChild(str);
	
	}
#endif

//		Pistooli: Again too lazy to search for ABOUT_PIC_ID, put TIFF into Resource File
		bmap = BTranslationUtils::GetBitmap(B_TIFF_FORMAT, 1);		
//		bmap = BTranslationUtils::GetBitmap(B_RAW_TYPE, ABOUT_PIC_ID);
		if (bmap)
		{
			back->SetViewBitmap(bmap, B_FOLLOW_ALL, 0);
			free(bmap);
		}
		about->Flush();
		about->Show();	
	}
	/* Add window controls */
}
Beispiel #5
0
FilePermissionsView::FilePermissionsView(BRect rect, Model* model)
	:
	BView(rect, "FilePermissionsView", B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW),
	fModel(model)
{
	SetViewUIColor(B_PANEL_BACKGROUND_COLOR);

	// Constants for the column labels: "User", "Group" and "Other".
	const float kColumnLabelMiddle = 77, kColumnLabelTop = 0,
		kColumnLabelSpacing = 37, kColumnLabelBottom = 39,
		kColumnLabelWidth = 80, kAttribFontHeight = 10;

	BStringView* strView;

	strView = new RotatedStringView(
		BRect(kColumnLabelMiddle - kColumnLabelWidth / 2,
			kColumnLabelTop,
			kColumnLabelMiddle + kColumnLabelWidth / 2,
			kColumnLabelBottom),
		"", B_TRANSLATE("Owner"));
	AddChild(strView);
	strView->SetFontSize(kAttribFontHeight);

	strView = new RotatedStringView(
		BRect(kColumnLabelMiddle - kColumnLabelWidth / 2
				+ kColumnLabelSpacing,
			kColumnLabelTop,
			kColumnLabelMiddle + kColumnLabelWidth / 2 + kColumnLabelSpacing,
			kColumnLabelBottom),
		"", B_TRANSLATE("Group"));
	AddChild(strView);
	strView->SetFontSize(kAttribFontHeight);

	strView = new RotatedStringView(
		BRect(kColumnLabelMiddle - kColumnLabelWidth / 2
				+ 2 * kColumnLabelSpacing,
			kColumnLabelTop,
			kColumnLabelMiddle + kColumnLabelWidth / 2
				+ 2 * kColumnLabelSpacing,
			kColumnLabelBottom),
		"", B_TRANSLATE("Other"));
	AddChild(strView);
	strView->SetFontSize(kAttribFontHeight);

	// Constants for the row labels: "Read", "Write" and "Execute".
	const float kRowLabelLeft = 10, kRowLabelTop = kColumnLabelBottom + 5,
		kRowLabelVerticalSpacing = 18, kRowLabelRight = kColumnLabelMiddle
		- kColumnLabelSpacing / 2 - 5, kRowLabelHeight = 14;

	strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop,
			kRowLabelRight, kRowLabelTop + kRowLabelHeight),
		"", B_TRANSLATE("Read"));
	AddChild(strView);
	strView->SetAlignment(B_ALIGN_RIGHT);
	strView->SetFontSize(kAttribFontHeight);

	strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop
			+ kRowLabelVerticalSpacing, kRowLabelRight, kRowLabelTop
			+ kRowLabelVerticalSpacing + kRowLabelHeight),
		"", B_TRANSLATE("Write"));
	AddChild(strView);
	strView->SetAlignment(B_ALIGN_RIGHT);
	strView->SetFontSize(kAttribFontHeight);

	strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop
			+ 2 * kRowLabelVerticalSpacing, kRowLabelRight, kRowLabelTop
			+ 2 * kRowLabelVerticalSpacing + kRowLabelHeight),
		"", B_TRANSLATE("Execute"));
	AddChild(strView);
	strView->SetAlignment(B_ALIGN_RIGHT);
	strView->SetFontSize(kAttribFontHeight);

	// Constants for the 3x3 check box array.
	const float kLeftMargin = kRowLabelRight + 5,
		kTopMargin = kRowLabelTop - 2,
		kHorizontalSpacing = kColumnLabelSpacing,
		kVerticalSpacing = kRowLabelVerticalSpacing,
		kCheckBoxWidth = 18, kCheckBoxHeight = 18;

	BCheckBox** checkBoxArray[3][3] = {
		{
			&fReadUserCheckBox,
			&fReadGroupCheckBox,
			&fReadOtherCheckBox
		},
		{
			&fWriteUserCheckBox,
			&fWriteGroupCheckBox,
			&fWriteOtherCheckBox
		},
		{
			&fExecuteUserCheckBox,
			&fExecuteGroupCheckBox,
			&fExecuteOtherCheckBox
		}
	};

	for (int32 x = 0; x < 3; x++) {
		for (int32 y = 0; y < 3; y++) {
			*checkBoxArray[y][x] =
				new BCheckBox(BRect(kLeftMargin + kHorizontalSpacing * x,
						kTopMargin + kVerticalSpacing * y,
						kLeftMargin + kHorizontalSpacing * x + kCheckBoxWidth,
						kTopMargin + kVerticalSpacing * y + kCheckBoxHeight),
					"", "", new BMessage(kPermissionsChanged));
			AddChild(*checkBoxArray[y][x]);
		}
	}

	const float kTextControlLeft = 170, kTextControlRight = 270,
		kTextControlTop = kRowLabelTop - 29,
		kTextControlHeight = 14, kTextControlSpacing = 16;

	strView = new BStringView(BRect(kTextControlLeft, kTextControlTop,
		kTextControlRight, kTextControlTop + kTextControlHeight), "",
		B_TRANSLATE("Owner"));
	strView->SetAlignment(B_ALIGN_CENTER);
	strView->SetFontSize(kAttribFontHeight);
	AddChild(strView);

	fOwnerTextControl = new BTextControl(
		BRect(kTextControlLeft,
			kTextControlTop - 2 + kTextControlSpacing,
			kTextControlRight,
			kTextControlTop + kTextControlHeight - 2 + kTextControlSpacing),
		"", "", "", new BMessage(kNewOwnerEntered));
	fOwnerTextControl->SetDivider(0);
	AddChild(fOwnerTextControl);

	strView = new BStringView(BRect(kTextControlLeft,
			kTextControlTop + 11 + 2 * kTextControlSpacing,
			kTextControlRight,
			kTextControlTop + 11 + 2 * kTextControlSpacing
				+ kTextControlHeight),
		"", B_TRANSLATE("Group"));
	strView->SetAlignment(B_ALIGN_CENTER);
	strView->SetFontSize(kAttribFontHeight);
	AddChild(strView);

	fGroupTextControl = new BTextControl(BRect(kTextControlLeft,
			kTextControlTop + 10 + 3 * kTextControlSpacing,
			kTextControlRight,
			kTextControlTop + 10 + 3 * kTextControlSpacing + kTextControlHeight),
		"", "", "", new BMessage(kNewGroupEntered));
	fGroupTextControl->SetDivider(0);
	AddChild(fGroupTextControl);

	ModelChanged(model);
}