当前位置: 首页>>代码示例>>C++>>正文


C++ BTextView类代码示例

本文整理汇总了C++中BTextView的典型用法代码示例。如果您正苦于以下问题:C++ BTextView类的具体用法?C++ BTextView怎么用?C++ BTextView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BTextView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BAlert

void
VirtualMemory::AboutRequested()
{
	BAlert* alert = new BAlert("about", TR("VirtualMemory\n"
		"\twritten by Axel Dörfler\n"
		"\tCopyright 2005, Antares.\n"), TR("OK"));
	BTextView* view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE); 			
	view->SetFontAndColor(0, 13, &font);

	alert->Go();
}
开发者ID:mmanley,项目名称:Antares,代码行数:18,代码来源:VirtualMemory.cpp

示例2: BAlert

/*static*/ void
Debugger::ShowAbout()
{
    BAlert *alert = new BAlert("about", "Debugger\n"
        "\twritten by Philippe Houdoin\n"
        "\tCopyright 2009, Haiku, Inc.\n", "OK");
    BTextView *view = alert->TextView();
    BFont font;

    view->SetStylable(true);

    view->GetFont(&font);
    font.SetSize(18);
    font.SetFace(B_BOLD_FACE);
    view->SetFontAndColor(0, 15, &font);

    alert->Go();
}
开发者ID:mariuz,项目名称:haiku,代码行数:18,代码来源:hdb.cpp

示例3: BAlert

void
InstallerApp::AboutRequested()
{
	BAlert *alert = new BAlert("about", B_TRANSLATE("Installer\n"
		"\twritten by Jérôme Duval and Stephan Aßmus\n"
		"\tCopyright 2005-2010, Haiku.\n\n"), B_TRANSLATE("OK"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 9, &font);

	alert->Go();
}
开发者ID:nielx,项目名称:haiku-serviceskit,代码行数:18,代码来源:InstallerApp.cpp

示例4: BAlert

void
DataTranslationsApplication::AboutRequested()
{
	BAlert* alert = new BAlert("about", "DataTranslations\n\twritten by Oliver "
		"Siebenmarck and others\n\tCopyright 2002-2010, Haiku Inc. All rights "
		"reserved.\n", "OK");

	BTextView* view = alert->TextView();
	view->SetStylable(true);

	BFont font;
	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 16, &font);

	alert->Go();
}
开发者ID:mariuz,项目名称:haiku,代码行数:18,代码来源:DataTranslations.cpp

示例5: copy_font

void ArpTextControl::copy_font(BView* v)
{
	// Make no assumptions about the structure of the children.
	if( !v ) return;
	int32 num = v->CountChildren();
	for( int32 i=0; i<num; i++ ) {
		BView* child = v->ChildAt(i);
		if( child ) {
			copy_font(child);
			BTextView* text = dynamic_cast<BTextView*>(child);
			if( text ) {
				text->SetFontAndColor(&PV_FillFont);
			} else {
				child->SetFont(&PV_FillFont);
			}
		}
	}
}
开发者ID:HaikuArchives,项目名称:Sequitur,代码行数:18,代码来源:ViewStubs.cpp

示例6: BAlert

void
CharacterMap::AboutRequested()
{
	BAlert *alert = new BAlert("about", "CharacterMap\n"
		"\twritten by Axel Dörfler\n"
		"\tCopyright 2009, Antares, Inc.\n", "OK");
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 12, &font);

	alert->Go();
}
开发者ID:mmanley,项目名称:Antares,代码行数:18,代码来源:CharacterMap.cpp

示例7: switch

void
THeaderView::MessageReceived(BMessage *msg)
{
	switch (msg->what) {
		case B_SIMPLE_DATA:
		{
			BTextView *textView = dynamic_cast<BTextView *>(Window()->CurrentFocus());
			if (dynamic_cast<TTextControl *>(textView->Parent()) != NULL)
				textView->Parent()->MessageReceived(msg);
			else {
				BMessage message(*msg);
				message.what = REFS_RECEIVED;
				Window()->PostMessage(&message, Window());
			}
			break;
		}

		case kMsgFrom:
		{
			BMenuItem *item;
			if (msg->FindPointer("source", (void **)&item) >= B_OK)
				item->SetMarked(true);

			uint32 chain;
			if (msg->FindInt32("id",(int32 *)&chain) >= B_OK)
				fChain = chain;
			break;
		}

		case kMsgEncoding:
		{
			BMessage message(*msg);
			int32 charSet;

			if (msg->FindInt32("charset", &charSet) == B_OK)
				fCharacterSetUserSees = charSet;

			message.what = CHARSET_CHOICE_MADE;
			message.AddInt32 ("charset", fCharacterSetUserSees);
			Window()->PostMessage (&message, Window());
			break;
		}
	}
}
开发者ID:mmanley,项目名称:Antares,代码行数:44,代码来源:Header.cpp

示例8: TextViewFilter

static filter_result
TextViewFilter(BMessage *message, BHandler **, BMessageFilter *filter)
{
	uchar key;
	if (message->FindInt8("byte", (int8 *)&key) != B_OK)
		return B_DISPATCH_MESSAGE;

	BPoseView *poseView = dynamic_cast<BContainerWindow*>(filter->Looper())->
		PoseView();

	if (key == B_RETURN || key == B_ESCAPE) {
		poseView->CommitActivePose(key == B_RETURN);
		return B_SKIP_MESSAGE;
	}

	if (key == B_TAB) {
		if (poseView->ActivePose()) {
			if (message->FindInt32("modifiers") & B_SHIFT_KEY)
				poseView->ActivePose()->EditPreviousWidget(poseView);
			else
				poseView->ActivePose()->EditNextWidget(poseView);
		}

		return B_SKIP_MESSAGE;
	}

	// the BTextView doesn't respect window borders when resizing itself;
	// we try to work-around this "bug" here.

	// find the text editing view
	BView *scrollView = poseView->FindView("BorderView");
	if (scrollView != NULL) {
		BTextView *textView = dynamic_cast<BTextView *>(scrollView->FindView("WidgetTextView"));
		if (textView != NULL) {
			BRect rect = scrollView->Frame();

			if (rect.right + 3 > poseView->Bounds().right
				|| rect.left - 3 < 0)
				textView->MakeResizable(true, NULL);
		}
	}

	return B_DISPATCH_MESSAGE;
}
开发者ID:mariuz,项目名称:haiku,代码行数:44,代码来源:TextWidget.cpp

示例9: BAlert

void
PowerStatusReplicant::_AboutRequested()
{
	BAlert* alert = new BAlert(B_TRANSLATE("About"),
		B_TRANSLATE("PowerStatus\n"
			"written by Axel Dörfler, Clemens Zeidler\n"
			"Copyright 2006, Haiku, Inc.\n"), B_TRANSLATE("OK"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, strlen(B_TRANSLATE("PowerStatus")), &font);

	alert->Go();
}
开发者ID:RTOSkit,项目名称:haiku,代码行数:19,代码来源:PowerStatusView.cpp

示例10: BAlert

void
StatusView::_AboutRequested()
{
	BAlert *alert = new BAlert("about", B_TRANSLATE("CPUFrequency\n"
			"\twritten by Clemens Zeidler\n"
			"\tCopyright 2009, Haiku, Inc.\n"),
		B_TRANSLATE("Ok"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 13, &font);

	alert->Go();
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:19,代码来源:StatusView.cpp

示例11: copy_colors

void ArpTextControl::copy_colors(BView* v)
{
	// Make no assumptions about the structure of the children.
	if( !v ) return;
	int32 num = v->CountChildren();
	for( int32 i=0; i<num; i++ ) {
		BView* child = v->ChildAt(i);
		if( child ) {
			copy_colors(child);
			BTextView* text = dynamic_cast<BTextView*>(child);
			if( text ) {
				text->SetFontAndColor(NULL, B_FONT_ALL, &PV_FillForeColor);
			}
			child->SetViewColor(PV_FillBackColor);
			child->SetLowColor(PV_FillBackColor);
			child->SetHighColor(PV_FillForeColor);
			child->Invalidate();
		}
	}
}
开发者ID:HaikuArchives,项目名称:Sequitur,代码行数:20,代码来源:ViewStubs.cpp

示例12: BAlert

void
OverlayView::OverlayAboutRequested()
{
	BAlert *alert = new BAlert("about",
		"OverlayImage\n"
		"Copyright 1999-2010\n\n\t"
		"originally by Seth Flaxman\n\t"
		"modified by Hartmuth Reh\n\t"
		"further modified by Humdinger\n",
		"OK");	
	BTextView *view = alert->TextView();
	BFont font;
	view->SetStylable(true);
	view->GetFont(&font);
	font.SetSize(font.Size() + 7.0f);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 12, &font);
	alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);	
	alert->Go();
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:20,代码来源:OverlayView.cpp

示例13: BAlert

void
WorkspacesView::_AboutRequested()
{
	BAlert *alert = new BAlert("about", "Workspaces\n"
		"written by François Revol, Axel Dörfler, and Matt Madia.\n\n"
		"Copyright 2002-2008, Antares.\n\n"
		"Send windows behind using the Option key. "
		"Move windows to front using the Control key.\n", "OK");
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 10, &font);

	alert->Go();
}
开发者ID:mmanley,项目名称:Antares,代码行数:20,代码来源:Workspaces.cpp

示例14: aboutText

void
FileTypes::AboutRequested()
{
	BString aboutText(B_TRANSLATE("FileTypes"));
	int32 titleLength = aboutText.Length();
	aboutText << "\n";
	aboutText << B_TRANSLATE("\twritten by Axel Dörfler\n"
		"\tCopyright 2006-2007, Haiku.\n");
	BAlert *alert = new BAlert("about", aboutText.String(), B_TRANSLATE("OK"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, titleLength, &font);

	alert->Go();
}
开发者ID:mariuz,项目名称:haiku,代码行数:21,代码来源:FileTypes.cpp

示例15: ShowAboutWindow

void ShowAboutWindow(void)
{
	char str[512];
	sprintf(str,
		"Basilisk II\nVersion %d.%d\n\n"
		"Copyright " B_UTF8_COPYRIGHT " 1997-2008 Christian Bauer et al.\n"
		"E-mail: [email protected]\n"
		"http://www.uni-mainz.de/~bauec002/B2Main.html\n\n"
		"Basilisk II comes with ABSOLUTELY NO\n"
		"WARRANTY. This is free software, and\n"
		"you are welcome to redistribute it\n"
		"under the terms of the GNU General\n"
		"Public License.\n",
		VERSION_MAJOR, VERSION_MINOR
	);
	BAlert *about = new BAlert("", str, GetString(STR_OK_BUTTON), NULL, NULL, B_WIDTH_FROM_LABEL);
	BTextView *theText = about->TextView();
	if (theText) {
		theText->SetStylable(true);
		theText->Select(0, 11);
		BFont ourFont;
		theText->SetFontAndColor(be_bold_font);
		theText->GetFontAndColor(2, &ourFont, NULL);
		ourFont.SetSize(24);
		theText->SetFontAndColor(&ourFont);
	}
	about->Go();
}
开发者ID:DavidLudwig,项目名称:macemu,代码行数:28,代码来源:about_window.cpp


注:本文中的BTextView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。