本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
}
}
}
示例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();
}
示例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;
}
}
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}