Exemple #1
0
		void UpdateTitleBar(EditorTab tab) 
		{
			string title = "";
			if(tab != null) {
				if(tab.filename.Equals(""))
					title = tab.label.Text + " - " + ApplicationName;
				else
					title = tab.filename + " - " + ApplicationName;
			}
			else {
				title = ApplicationName;
			}
			win.Title = title;
		}
Exemple #2
0
		void RemoveEditorTab (EditorTab tab, int page) 
		{
			tab.editor.Clear();
			tab.editor.Tab = null;
			tab.editor = null;
			tab.label = null;
			editorTabs.Remove(tab);
			sourceFileNotebook.RemovePage (page);
			sourceFileNotebook.QueueDraw();
			tab = null;
		}
Exemple #3
0
		EditorTab NewEditorTab () 
		{
			SqlEditorSharp editor;
			editor = new SqlEditorSharp ();
			editor.UseSyntaxHiLighting = true;
			editor.View.Show ();
			editor.View.KeyPressEvent +=
				new GtkSharp.KeyPressEventHandler(OnKeyPressEventKey);

			lastUnknownFile ++;
			string unknownFile = "Unknown" + 
				lastUnknownFile.ToString() + ".sql";
			Label label = new Label(unknownFile);
			label.Show();
			sourceFileNotebook.AppendPage(editor, label);
			sourceFileNotebook.ShowAll ();
			sourceFileNotebook.ResizeChildren ();

			sourceFileNotebook.CurrentPage = -1;
			
			EditorTab tab = new EditorTab();
			tab.editor = editor;
			tab.label = label;
			tab.filename = "";
			tab.basefilename = unknownFile;
			tab.page = sourceFileNotebook.CurrentPage;
			editorTabs.Add(tab);
			editor.Tab = tab;
			UpdateTitleBar(tab);

			return tab;
		}