示例#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;
		}
示例#2
0
		ScrolledWindow CreateOutputResultsTextView (EditorTab tab) 
		{
			ScrolledWindow sw;
			sw = new ScrolledWindow (
				new Adjustment (0.0, 0.0, 0.0, 0.0, 0.0, 0.0), 
				new Adjustment (0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
			sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			sw.ShadowType = Gtk.ShadowType.In;		
			
			tab.textView = new TextView ();
			tab.textView.Editable = false;
			tab.textView.ModifyFont (Pango.FontDescription.FromString ("courier new"));
			sw.Add (tab.textView);		

			return sw;
		}
示例#3
0
		void RemoveEditorTab (EditorTab tab, int page) 
		{
			tab.editor.Clear();
			tab.editor.View.KeyPressEvent -=
				new Gtk.KeyPressEventHandler(OnKeyPressEventKey);
			tab.editor.Tab = null;
			tab.editor = null;
			tab.label = null;
			tab.grid = null;
			editorTabs.Remove(tab);
			sourceFileNotebook.RemovePage (page);
			sourceFileNotebook.QueueDraw();
			tab = null;
		}
示例#4
0
		public EditorTab NewEditorTab () 
		{
			EditorTab tab = new EditorTab();		
			editorTabs.Add(tab);
			
			currentEditorTab = tab;

			// top pane - sql editor

			SqlEditorSharp editor;
			editor = new SqlEditorSharp ();
			editor.Tab = tab;
			editor.UseSyntaxHiLighting = false;
			editor.View.Show ();
			editor.View.KeyPressEvent +=
				new Gtk.KeyPressEventHandler(OnKeyPressEventKey);

			lastUnknownFile ++;
			string unknownFile = "Unknown" + 
				lastUnknownFile.ToString() + ".sql";
			Label label = new Label(unknownFile);
			label.Show();

			// bottom pane - output results
			Notebook resultsNotebook = new Notebook();
			tab.resultsNotebook = resultsNotebook;
			resultsNotebook.TabPos = PositionType.Bottom;
			resultsNotebook.SwitchPage += new 
				Gtk.SwitchPageHandler(OnResultsNotebookSwitched);
			
			DataGrid grid = CreateOutputResultsDataGrid ();
			grid.View.Selection.Mode = SelectionMode.Multiple;
			tab.grid = grid;
			grid.Show();
			Label label2 = new Label("Grid");
			label2.Show();
			
			ScrolledWindow swin = CreateOutputResultsTextView (tab);
			swin.Show();

			tab.editor = editor;
			tab.label = label;
			tab.filename = "";
			tab.basefilename = unknownFile;

			Label label3 = new Label("Log");
			label3.Show();

			// finish the notebooks

			tab.frame = new Frame();
			tab.frame.ShadowType = ShadowType.None;
			tab.frame.Add (grid);
			tab.GridPage = resultsNotebook.AppendPage(tab.frame, label2);
			tab.LogPage = resultsNotebook.AppendPage(swin, label3);

			resultsNotebook.ShowAll ();
			resultsNotebook.ResizeChildren ();

			if (outputResults == OutputResults.TextView)
				resultsNotebook.CurrentPage = 1;
			else if (outputResults == OutputResults.DataGrid)
				resultsNotebook.CurrentPage = 0;

			tab.Add1 (editor);
			tab.Add2 (resultsNotebook);

			sourceFileNotebook.AppendPage(tab, label);

			sourceFileNotebook.ShowAll ();
			sourceFileNotebook.ResizeChildren ();

			sourceFileNotebook.CurrentPage = -1;

			tab.page = sourceFileNotebook.CurrentPage;
			UpdateTitleBar(tab);

			SetFocusToEditor ();

			return tab;
		}
示例#5
0
		void OnEditorTabSwitched (object o, Gtk.SwitchPageArgs args) 
		{
			int page = (int) args.PageNum;
			currentEditorTab = FindEditorTab(page);
			UpdateTitleBar (currentEditorTab);
			DoEvents ();
			SetFocusToEditor ();
		}