Пример #1
0
void Ide::SetMain(const String& package)
{
	FlushFile();
	SaveWorkspace();
	transferfilecache.Clear();
	main = package;
	export_dir = GetHomeDirFile(main);
	mainconfigname.Clear();
	mainconfigparam.Clear();
	ScanWorkspace();
	LoadFromFile(THISBACK(SerializeWorkspace), WorkspaceFile());
	editorsplit.Zoom(0);
	UpdateFormat();
	String e = editfile;
	editfile.Clear();
	MakeTitle();
	MakeIcon();
	SyncMainConfigList();
	AdjustMainConfig();
	SyncBuildMode();
	SetHdependDirs();
	SetBar();
	HideBottom();
	SyncUsc();
	NewCodeBase();
	if(IsNull(e))
		e = GetFirstFile();
	EditFile(e);
}
Пример #2
0
void CFontsPage::OnSelendokFontsize() 
{
CString tmp;
	m_SizeCtl.GetLBText(m_SizeCtl.GetCurSel(),tmp);
	m_SizeCtl.SetWindowText(tmp);
	UpdateFormat(TRUE);
}
Пример #3
0
INT WinGHCiColor(INT Color)
{
    INT PrevColor = NowFormat.ForeColor;
    FormatChanged = TRUE;
    //NowFormat = DefFormat;
    NowFormat.ForeColor = Color;
    // InEscBuf = FALSE;
    UpdateFormat();

    return PrevColor;
}
Пример #4
0
BOOL WinGHCiBold(BOOL Bold)
{
    BOOL PrevBold = NowFormat.Bold;
    FormatChanged = TRUE;
    //NowFormat = DefFormat;
    NowFormat.Bold = Bold;

    // InEscBuf = FALSE;
    UpdateFormat();

    return PrevBold;
}
Пример #5
0
void Ide::UpdateFormat() {
	SetupEditor();	
	UpdateFormat(editor);
	UpdateFormat(editor2);
	console.SetFont(consolefont);
	console.WrapText(wrap_console_text);
	statusbar.Show(show_status_bar);
	SetupBars();
	
	if(!designer) {
		if(filetabs >=0) {
			tabs.SetAlign(filetabs);
			editpane.SetFrame(tabs);
		} else {
			editpane.SetFrame(ViewFrame());
		}
	}
	
	tabs.Grouping(tabs_grouping);
	tabs.Stacking(tabs_stacking);
	tabs.FileIcons(tabs_icons, false);
	tabs.Crosses(tabs_crosses >= 0, tabs_crosses);	
}
Пример #6
0
// need to copy from s to Buf
VOID AddToBufferExt(LPCTSTR s, INT numChars)
{
    UpdateFormat();

    if (InEscBuf) {
        for (; numChars>0; s++, numChars--) {
            if (*s == TEXT('m')) {
                Format f = NowFormat;
                if (ParseEscapeCode(&f)) {
                    FormatChanged = TRUE;
                    NowFormat = f;
                }
                InEscBuf = FALSE;
                AddToBufferExt(s+1,numChars-1);
                return;
            } else if ((*s >= TEXT('0') && *s <= TEXT('9')) ||
                       (*s == TEXT(';')) || (*s == TEXT('['))) {
                EscBuf[EscBufPos++] = *s;
                EscBufPos = min(EscBufPos, MAX_ESC_BUFSIZE);
            } else {
                InEscBuf = FALSE;
                AddToBufferExt(EscBuf,StringLen(EscBuf));
                break;
            }
        }
    }

    for (; numChars>0; s++, numChars--) {
        if (*s == TEXT('\b')) {
            if (BufPos == 0) {
                OutputPos--;
            } else
                BufPos--;
        } else if (*s == TEXT('\07')) {
            Beep( 750, 150 );
        } else if (*s == TEXT('\033')) {
            InEscBuf = TRUE;
            EscBufPos = 0;
            AddToBufferExt(s+1,numChars-1);
            return;
        } else {
            if (BufLen >= BufSize)
                FlushBuffer(TRUE);
            Buf[BufPos++] = *s;
            BufLen = max(BufLen, BufPos);
        }
    }
}
Пример #7
0
void CFontsPage::OnSelchangeFormatname() 
{
CFontFormat* fmt = (CFontFormat*)m_FormatsCtl.GetItemData(m_FormatsCtl.GetCurSel());
	if(m_fmtLast){
		memmove(&m_fmtLast->m_fmtChar,&m_fmtChar,sizeof(m_fmtLast->m_fmtChar));
		if(m_fmtLast->m_Flags&CFontFormat::flagBGColor)
			m_fmtLast->m_bgColor = m_bgColorCtl.m_Color;
	}
BOOL bBG = fmt->m_Flags&CFontFormat::flagBGColor;
	m_bgColorCtl.EnableWindow(bBG);
	m_TipCtl.SetWindowText(fmt->m_Tip);
	m_fmtLast = fmt;
	memmove(&m_fmtChar,&m_fmtLast->m_fmtChar,sizeof(m_fmtChar));
	if(bBG){
		m_bgColorCtl.m_Color = m_fmtLast->m_bgColor;
		m_bgColorCtl.Invalidate();
	}
	UpdateFormat(FALSE);
	UpdateSample();
}
Пример #8
0
void Ide::LoadConfig()
{
	if(!LoadFromFile(*this) && GetIniKey("DebugClipboard") == "1") {
		Exclamation("LoadConfig has failed!");
		if(!LoadFromFile(*this, ConfigFile() + ".bak")) {
			Exclamation("LoadConfig .bak has failed!");
			if(!LoadFromFile(*this, ConfigFile() + ".bak1"))
				Exclamation("LoadConfig .bak1 has failed!");
		}
	}
	RestoreKeys(LoadFile(ConfigFile("ide.key")));
	editor.LoadHlStyles(LoadFile(ConfigFile("ide.colors")));
	config_time = FileGetTime(ConfigFile());
	UpdateFormat();
	if(filelist.IsCursor()) {
		FlushFile();
		FileCursor();
	}
	SaveLoadPackage();
	SyncCh();
}
Пример #9
0
void CFontsPage::OnSelendokCharset() 
{
	UpdateFormat(TRUE);
}
Пример #10
0
void CFontsPage::OnUnderline() 
{
	UpdateFormat(TRUE);
}
Пример #11
0
void CFontsPage::OnStrikeout() 
{
	UpdateFormat(TRUE);
}
Пример #12
0
void CFontsPage::OnItalic() 
{
	UpdateFormat(TRUE);
}
Пример #13
0
void CFontsPage::OnBold() 
{
	UpdateFormat(TRUE);
}
Пример #14
0
void Ide::SetupFormat() {
	FormatDlg dlg;
	dlg.Title("Format setup");
	WithSetupFontLayout<ParentCtrl> fnt;
	WithSetupHlLayout<ParentCtrl> hlt;
	WithSetupEditorLayout<ParentCtrl> edt;
	WithSetupIdeLayout<ParentCtrl> ide;
	WithSetupAssistLayout<ParentCtrl> assist;
	WithSetupMobilePlatformsLayout<ParentCtrl> mobile;
	AStyleSetupDialog ast(this);
#ifdef PLATFORM_WIN32
	ide.console_txt.Hide();
	ide.console.Hide();
	ide.kde.Hide();
	ide.gnome.Hide();
	ide.xterm.Hide();
	ide.mate.Hide();
	
#endif
	ide.kde <<= callback2(SetConsole, &ide.console, "/usr/bin/konsole -e");
	ide.gnome <<= callback2(SetConsole, &ide.console, "/usr/bin/gnome-terminal -x");
	ide.mate <<= callback2(SetConsole, &ide.console, "/usr/bin/mate-terminal -x");
	ide.xterm <<= callback2(SetConsole, &ide.console, "/usr/bin/xterm -e");
	
	edt.lineends
		.Add(LF, "LF")
		.Add(CRLF, "CRLF")
		.Add(DETECT_LF, "Detect with default LF")
		.Add(DETECT_CRLF, "Detect with default CRLF");
	
	edt.filetabs
		.Add(AlignedFrame::LEFT, "Left")
		.Add(AlignedFrame::TOP, "Top")
		.Add(AlignedFrame::RIGHT, "Right")
		.Add(AlignedFrame::BOTTOM, "Bottom")
		.Add(-1, "Off");
		
	edt.tabs_crosses
		.Add(AlignedFrame::LEFT, "Left")
		.Add(AlignedFrame::RIGHT, "Right")
		.Add(-1, "Off");
	
	dlg.Add(fnt, "Fonts");
	dlg.Add(hlt, "Syntax highlighting");
	dlg.Add(edt, "Editor");
	dlg.Add(assist, "Assist");
	dlg.Add(ide, "IDE");
	dlg.Add(ast, "Code formatting");
	dlg.Add(mobile, "Mobile platforms");
	dlg.WhenClose = dlg.Acceptor(IDEXIT);
	FontSelectManager ed, vf, con, f1, f2, tf;
	ed.Set(fnt.face, fnt.height, fnt.bold, fnt.italic, fnt.naa);
	vf.Set(fnt.vface, fnt.vheight, fnt.vbold, fnt.vitalic, fnt.vnaa);
	con.Set(fnt.cface, fnt.cheight, fnt.cbold, fnt.citalic, fnt.cnaa);
	tf.Set(fnt.tface, fnt.theight, fnt.tbold, fnt.titalic, fnt.tnaa);
	f1.Set(fnt.face1, fnt.height1, fnt.bold1, fnt.italic1, fnt.naa1);
	f2.Set(fnt.face2, fnt.height2, fnt.bold2, fnt.italic2, fnt.naa2);
	ed.Set(editorfont);
	vf.Set(veditorfont);
	con.Set(consolefont);
	tf.Set(tfont);
	f1.Set(font1);
	f2.Set(font2);
	DlCharset(edt.charset);
	edt.tabsize.MinMax(1, 100).NotNull();
	edt.tabsize <<= editortabsize;
	edt.indent_amount.MinMax(1, 100).NotNull();
	edt.indent_amount <<= indent_spaces ? indent_amount : editortabsize;
	edt.indent_amount.Enable(indent_spaces);
	CtrlRetriever rtvr;
	int hs = hilite_scope;
	rtvr
		(hlt.hilite_scope, hs)
		(hlt.hilite_bracket, hilite_bracket)
		(hlt.hilite_ifdef, hilite_ifdef)
		(hlt.hilite_if_endif, hilite_if_endif)
		(hlt.thousands_separator, thousands_separator)
		(hlt.hline, hline)

		(edt.indent_spaces, indent_spaces)
		(edt.no_parenthesis_indent, no_parenthesis_indent)
		(edt.showtabs, show_tabs)
		(edt.warnwhitespace, warnwhitespace)
		(edt.lineends, line_endings)
		(edt.numbers, line_numbers)
		(edt.bookmark_pos, bookmark_pos)
		(edt.bordercolumn, bordercolumn)
		(edt.bordercolor, bordercolor)
		(edt.findpicksel, find_pick_sel)
		(edt.findpicktext, find_pick_text)
		(edt.deactivate_save, deactivate_save)
		(edt.filetabs, filetabs)
		(edt.tabs_icons, tabs_icons)
		(edt.tabs_crosses, tabs_crosses)
		(edt.tabs_grouping, tabs_grouping)
		(edt.tabs_stacking, tabs_stacking)
		(edt.tabs_serialize, tabs_serialize)
		(edt.persistent_find_replace, persistent_find_replace)
		(edt.find_replace_restore_pos, find_replace_restore_pos)

		(assist.barline, barline)
		(assist.auto_enclose, auto_enclose)
		(assist.commentdp, editor.commentdp)
		(assist.header_guards, header_guards)
		(assist.insert_include, insert_include)
		(assist.mark_lines, mark_lines)
		(assist.qtfsel, qtfsel)
		(assist.assist, editor.auto_assist)

		(ide.showtime, showtime)
		(ide.show_status_bar, show_status_bar)
		(ide.toolbar_in_row, toolbar_in_row)
		(ide.splash_screen, splash_screen)
		(ide.sort, sort)
		(ide.mute_sounds, mute_sounds)
		(ide.wrap_console_text, wrap_console_text)
		(ide.hydra1_threads, hydra1_threads)
		(ide.gdbSelector, gdbSelector)
		(ide.chstyle, chstyle)
		(ide.console, LinuxHostConsole)
		(ide.output_per_assembly, output_per_assembly)

		(ast.BracketIndent,					astyle_BracketIndent)
		(ast.NamespaceIndent,               astyle_NamespaceIndent)
		(ast.BlockIndent,                   astyle_BlockIndent)
		(ast.CaseIndent,                    astyle_CaseIndent)
		(ast.ClassIndent,                   astyle_ClassIndent)
		(ast.LabelIndent,                   astyle_LabelIndent)
		(ast.SwitchIndent,                  astyle_SwitchIndent)
		(ast.PreprocessorIndent,            astyle_PreprocessorIndent)
		(ast.MinInStatementIndentLength,    astyle_MinInStatementIndentLength)
		(ast.MaxInStatementIndentLength,    astyle_MaxInStatementIndentLength)
		(ast.BreakClosingHeaderBracketsMode,astyle_BreakClosingHeaderBracketsMode)
		(ast.BreakElseIfsMode,              astyle_BreakElseIfsMode)
		(ast.BreakOneLineBlocksMode,        astyle_BreakOneLineBlocksMode)
		(ast.SingleStatementsMode,          astyle_SingleStatementsMode)
		(ast.BreakBlocksMode,               astyle_BreakBlocksMode)
		(ast.BreakClosingHeaderBlocksMode,  astyle_BreakClosingHeaderBlocksMode)
		(ast.BracketFormatMode,             astyle_BracketFormatMode)
		(ast.ParensPaddingMode,             astyle_ParensPaddingMode)
		(ast.ParensUnPaddingMode,           astyle_ParensUnPaddingMode)
		(ast.OperatorPaddingMode,           astyle_OperatorPaddingMode)
		(ast.EmptyLineFill,                 astyle_EmptyLineFill)
		(ast.TabSpaceConversionMode,        astyle_TabSpaceConversionMode)
		(ast.TestBox,						astyle_TestBox)
		
		(mobile.AndroidSDKPath, androidSDKPath)
	;
	hlt.hlstyle.AddColumn("Style");
	hlt.hlstyle.AddColumn("Color").Ctrls(HlPusherFactory);
	hlt.hlstyle.AddColumn("Bold").Ctrls<Option>();
	hlt.hlstyle.AddColumn("Italic").Ctrls<Option>();
	hlt.hlstyle.AddColumn("Underline").Ctrls<Option>();
	hlt.hlstyle.ColumnWidths("211 80 45 45 80");
	hlt.hlstyle.EvenRowColor().NoHorzGrid().SetLineCy(EditField::GetStdHeight() + 2);
	ReadHlStyles(hlt.hlstyle);
	edt.charset <<= (int)default_charset;
	edt.tabsize <<= rtvr <<=
		hlt.hlstyle.WhenCtrlsAction = ed.WhenAction = tf.WhenAction =
		con.WhenAction = f1.WhenAction = f2.WhenAction = dlg.Breaker(222);
	ide.showtimeafter <<= Nvl((Date)FileGetTime(ConfigFile("version")), GetSysDate() - 1);
	hlt.hl_restore <<= dlg.Breaker(333);
	ide.chstyle.Add(0, "Host platform");
	ide.chstyle.Add(1, "Standard");
	ide.chstyle.Add(2, "Classic");
	ide.chstyle.Add(3, "Host platform, blue bars");
	ide.chstyle.Add(4, "Standard, blue bars");

	FrameRight<Button> uscBrowse;
	uscBrowse.SetImage(CtrlImg::right_arrow());
	uscBrowse <<= callback1(AddPath, &ide.uscpath);
	ide.uscpath.AddFrame(uscBrowse);
	ide.uscpath <<= LoadFile(GetHomeDirFile("usc.path"));
	
	FrameRight<Button> androidSDKDownload;
	androidSDKDownload.SetImage(IdeImg::DownloadBlack());
	androidSDKDownload.Tip("Download");
	androidSDKDownload <<= callback1(LaunchWebBrowser, AndroidSDK::GetDownloadUrl());
	mobile.AndroidSDKPath.AddFrame(androidSDKDownload);
	
	FrameRight<Button> androidSDKBrowse;
	androidSDKBrowse.SetImage(CtrlImg::right_arrow());
	androidSDKBrowse.Tip("Select directory");
	androidSDKBrowse <<= callback1(InsertPath, &mobile.AndroidSDKPath);
	mobile.AndroidSDKPath.AddFrame(androidSDKBrowse);
	mobile.AndroidSDKPath <<= androidSDKPath;
	
	for(;;) {
		int c = dlg.Run();
		Upp::SaveFile(GetHomeDirFile("usc.path"), ~ide.uscpath);
		editorfont = ed.Get();
		tfont = tf.Get();
		veditorfont = vf.Get();
		consolefont = con.Get();
		font1 = f1.Get();
		font2 = f2.Get();
		editortabsize = Nvl((int)~edt.tabsize, 4);
		rtvr.Retrieve();
		console.SetSlots(minmax(hydra1_threads, 1, 256));
		hilite_scope = hs;
		if(indent_spaces)
			indent_amount = ~edt.indent_amount;
		else {
			indent_amount = editortabsize;
			edt.indent_amount <<= editortabsize;
		}
		edt.indent_amount.Enable(indent_spaces);
		default_charset = (byte)(int)~edt.charset;
		for(int i = 0; i < CodeEditor::HL_COUNT; i++)
			editor.SetHlStyle(i, hlt.hlstyle.Get(i, 1), hlt.hlstyle.Get(i, 2),
			                     hlt.hlstyle.Get(i, 3), hlt.hlstyle.Get(i, 4));
		UpdateFormat();
		if(c == IDEXIT)
			break;
		if(c == 333 && PromptYesNo("Restore default highlighting colors?")) {
			editor.DefaultHlStyles();
			ReadHlStyles(hlt.hlstyle);
		}
	}
	FileSetTime(ConfigFile("version"), ToTime(~ide.showtimeafter));
	FinishConfig();
	SaveConfig();
}
Пример #15
0
void CFontsPage::OnSelendokFaces() 
{
	UpdateFormat(TRUE);
	FillCharsets();
}
Пример #16
0
void CFontsPage::OnBackcolor() 
{
	m_bgColorCtl.SetColor();
	UpdateFormat(TRUE);
}
Пример #17
0
void CFontsPage::OnForecolor() 
{
	m_fgColorCtl.SetColor();
	UpdateFormat(TRUE);
}
Пример #18
0
void CFontsPage::OnEditchangeFontsize() 
{
	UpdateFormat(TRUE);	
}