AllShowingTextView::AllShowingTextView(const char* name) : BTextView(name, B_WILL_DRAW) { MakeEditable(false); MakeSelectable(false); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); }
AboutTextView(BRect rect) : BTextView(rect,NULL,rect.OffsetToCopy(B_ORIGIN),B_FOLLOW_NONE,B_WILL_DRAW) { int32 major = 0,middle = 0,minor = 0,variety = 0,internal = 1; // get version information for app app_info appInfo; if (be_app->GetAppInfo(&appInfo) == B_OK) { BFile file(&appInfo.ref,B_READ_ONLY); if (file.InitCheck() == B_OK) { BAppFileInfo info(&file); if (info.InitCheck() == B_OK) { version_info versionInfo; if (info.GetVersionInfo(&versionInfo,B_APP_VERSION_KIND) == B_OK) { major = versionInfo.major; middle = versionInfo.middle; minor = versionInfo.minor; variety = versionInfo.variety; internal = versionInfo.internal; } } } } // prepare version variety string const char *varietyStrings[] = {"Development","Alpha","Beta","Gamma","Golden master","Final"}; char varietyString[32]; strcpy(varietyString,varietyStrings[variety % 6]); if (variety < 5) sprintf(varietyString + strlen(varietyString),"/%li",internal); char s[512]; sprintf(s, "Mail Daemon Replacement\n\n" "by Dr. Zoidberg Enterprises. All rights reserved.\n\n" "Version %ld.%ld.%ld %s\n\n" "See LICENSE file included in the installation package for more information.\n\n\n\n" "You can contact us at:\n" "%s\n\n" "Please submit bug reports using the %s\n\n" "Project homepage at:\n%s", major,middle,minor,varietyString, kEMail,kBugsitePretty,kWebsite); SetText(s); MakeEditable(false); MakeSelectable(false); SetAlignment(B_ALIGN_CENTER); SetStylable(true); // aethetical changes BFont font; GetFont(&font); font.SetSize(24); SetFontAndColor(0,23,&font,B_FONT_SIZE); // center the view vertically rect = TextRect(); rect.OffsetTo(0,(Bounds().Height() - TextHeight(0,42)) / 2); SetTextRect(rect); // set the link regions int start = strstr(s,kEMail) - s; int finish = start + strlen(kEMail); GetTextRegion(start,finish,&fMail); SetFontAndColor(start,finish,NULL,0,&kLinkColor); start = strstr(s,kBugsitePretty) - s; finish = start + strlen(kBugsitePretty); GetTextRegion(start,finish,&fBugsite); SetFontAndColor(start,finish,NULL,0,&kLinkColor); start = strstr(s,kWebsite) - s; finish = start + strlen(kWebsite); GetTextRegion(start,finish,&fWebsite); SetFontAndColor(start,finish,NULL,0,&kLinkColor); }