Exemplo n.º 1
0
// ------------------------------------------------------------------------- RHTML_text_view - RHTMLtextview -
RHTMLtextview::RHTMLtextview(BRect fRect, RHTMLtext *target, uint ft): BTextView(fRect,"fTextView",BRect(3,3,fRect.right-32,fRect.bottom-fRect.top),B_FOLLOW_ALL,B_WILL_DRAW)
{
 SetWordWrap(fOptions->WordWrap);
 fFont=new BFont(fOptions->DefaultFont);
 fTarget=target;
 fUpdateTimer = new RTimer("TextViewTimer", this, new BMessage('TIMR'));
 
 fFileTypes = new RHTMLFileTypes(ft,this);
 
 MakeFocus(true);
 SetDoesUndo(true);
 SetStylable(true);

 rgb_color fekete={0,0,0};

 SetFontAndColor(fFont,B_FONT_ALL,&fekete);

 fTagMenu= new RHTMLTagMenu(this);
 fTagMenu->Show();
 fTagMenu->Activate(false);
// fTagMenu->Hide();
 Window()->Activate(true);
 MakeFocus(true);

 fTimer = new RTimer("PopUpTimer", this, new BMessage('PPOP'));
 }
Exemplo n.º 2
0
TipsterText::TipsterText(BMessage* data)
	:
	BTextView(data)
{
	SetText("");
	
	MakeEditable(false);
	SetStylable(true);
}
Exemplo n.º 3
0
TipsterText::TipsterText()
	:
	BTextView("TipsterTextView")
{
	SetText("");
	
	MakeEditable(false);
	SetStylable(true);
}
Exemplo n.º 4
0
URLInputGroup::URLTextView::URLTextView(URLInputGroup* parent)
	:
	BTextView("url"),
	fURLInputGroup(parent),
	fURLAutoCompleter(new TextViewCompleter(this,
		new BrowsingHistoryChoiceModel())),
	fPreviousText(""),
	fUpdateAutoCompleterChoices(true)
{
	MakeResizable(true);
	SetStylable(true);
	fURLAutoCompleter->SetModificationsReported(true);
}
Exemplo n.º 5
0
		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);
		}
Exemplo n.º 6
0
TexView::TexView(BRect frame, BRect textRect, Prefs* p) 
			:	BTextView(frame,"texview",textRect,B_FOLLOW_ALL_SIDES, B_WILL_DRAW|B_PULSE_NEEDED/*|B_NAVIGABLE*/)
{
	prefs = p;
	IsColSel = false;
	DontSel = false;
	BFont fontie(be_fixed_font);
	f = fontie;
	f.SetSize(prefs->FontSize);
	SetFontAndColor(0,1,&f,B_FONT_ALL,&prefs->fg_color);
	SetStylable(prefs->IsSyntax);
	SetAlignment(B_ALIGN_LEFT);
	SetDoesUndo(true);
	SetAutoindent(prefs->AutoIndent);
	//IsUndo = false;
	
	IsNormalFocus = false;
	HasAttachedFocus = false;
	//TextStyles
	green_matches.push_back("textbf");
	green_matches.push_back("textit");
	green_matches.push_back("textmd");
	green_matches.push_back("textrm");
	green_matches.push_back("textsc");
	green_matches.push_back("textsf");
	green_matches.push_back("textsl");
	green_matches.push_back("texttt");
	green_matches.push_back("textup");
	green_matches.push_back("emph");

	green_matches.push_back("bf");
	green_matches.push_back("it");
	green_matches.push_back("em");
	green_matches.push_back("rm");
	green_matches.push_back("sc");
	green_matches.push_back("sf");
	green_matches.push_back("sl");
	green_matches.push_back("tt");
	green_matches.push_back("up");	

	//TextSizes
	green_matches.push_back("tiny");
	green_matches.push_back("scriptsize");
	green_matches.push_back("footnotesize");
	green_matches.push_back("small");
	green_matches.push_back("normalsize");
	green_matches.push_back("large");
	green_matches.push_back("Large");
	green_matches.push_back("LARGE");
	green_matches.push_back("huge");
	green_matches.push_back("Huge");

    green_matches.push_back("mathbb");
    green_matches.push_back("mathbf");
    green_matches.push_back("mathcal");
    green_matches.push_back("mathfrak");
    green_matches.push_back("mathit");
    green_matches.push_back("mathnormal");
    green_matches.push_back("mathrm");
    green_matches.push_back("mathsf");
    green_matches.push_back("mathtt");

    green_matches.push_back("rmfamily");
    green_matches.push_back("sffamily");
    green_matches.push_back("ttfamily");

    green_matches.push_back("itshape");
    green_matches.push_back("scshape");
    green_matches.push_back("slshape");
    green_matches.push_back("upshape");

    green_matches.push_back("bfseries");
    green_matches.push_back("mdseries");
 	
	purple_matches.push_back("author");
	purple_matches.push_back("title");
	purple_matches.push_back("section");
	purple_matches.push_back("subsection");
	purple_matches.push_back("subsubsection");
	purple_matches.push_back("subsubsubsection");
	purple_matches.push_back("verb");
	
	IsShifting = false;
}