当前位置: 首页>>代码示例>>C#>>正文


C# TextView.Show方法代码示例

本文整理汇总了C#中Gtk.TextView.Show方法的典型用法代码示例。如果您正苦于以下问题:C# TextView.Show方法的具体用法?C# TextView.Show怎么用?C# TextView.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.TextView的用法示例。


在下文中一共展示了TextView.Show方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UMLEditableField

        public UMLEditableField(UMLEntry entry, bool resizable)
            : base((CanvasGroup) entry)
        {
            _textwidget = new CanvasWidget ((CanvasGroup) entry);
            _entry = entry;
            _is_resizable = resizable;
            _textview = new TextView ();
            TextBuffer tb = _textview.Buffer;
            tb.Text = _entry.Text;

            double x = entry.TextX, y = entry.TextY;
            _textwidget.W2i (ref x, ref y);
            X = x + entry.X;
            Y = y + entry.Y;

            _textwidget.Widget = _textview;
            _textwidget.Width = entry.TextWidth + 10;//FIXME?
            _textwidget.Height = entry.TextHeight + 10; //FIXME?
            _textview.KeyReleaseEvent += LookingEsc;
            _textview.Show ();
            Width = _textwidget.Width;
            Height = _textwidget.Height;
            //TODO: Dejar esto como estaba
            //CreateUMLControlPointGroup ();

            Resized += ElementResized;
            _entry.Root.CanvasEvent += ClickCanvasEvent;
        }
开发者ID:MonoBrasil,项目名称:historico,代码行数:28,代码来源:UMLEditableField.cs

示例2: StatusView

        public StatusView(string filepath, VersionControlSystem vc)
            : base(Path.GetFileName(filepath) + " Status")
        {
            this.vc = vc;
            this.filepath = filepath;

            main = new VBox(false, 5);
            widget = main;
            main.Show();

            commandbar = new HBox(false, 5);
            main.PackStart(commandbar, false, false, 5);

            showRemoteStatus = new Button("Show Remote Status");
            commandbar.PackEnd(showRemoteStatus, false, false, 0);
            showRemoteStatus.Clicked += new EventHandler(OnShowRemoteStatusClicked);

            buttonCommit = new Button("Commit...");
            commandbar.PackEnd(buttonCommit, false, false, 0);
            buttonCommit.Clicked += new EventHandler(OnCommitClicked);

            boxCommit = new VBox(false, 2);
            textCommitMessage = new TextView();
            HBox boxCommitButtons = new HBox(false, 2);
            buttonCommitCancel = new Button("Cancel");
            buttonCommitCommit = new Button("Commit");
            textCommitMessage.Show();
            buttonCommitCancel.Show();
            buttonCommitCommit.Show();
            boxCommit.PackStart(textCommitMessage, true, true, 0);
            boxCommit.PackStart(boxCommitButtons, false, false, 0);
            boxCommitButtons.PackEnd(buttonCommitCancel, false, false, 0);
            boxCommitButtons.PackEnd(buttonCommitCommit, false, false, 0);
            buttonCommitCancel.Clicked += new EventHandler(OnCommitCancelClicked);
            buttonCommitCommit.Clicked += new EventHandler(OnCommitCommitClicked);

            ScrolledWindow scroller = new ScrolledWindow();
            Viewport viewport = new Viewport();
            box = new VBox(false, 5);
            main.Add(scroller);

            viewport.Add(box);
            scroller.Add(viewport);

            main.ShowAll();

            StartUpdate();
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:48,代码来源:Statuses.cs

示例3: TaskOptionsDialog

		public TaskOptionsDialog(Gtk.Window parent,
		                         Gtk.DialogFlags flags,
		                         Task task)
: base (Catalog.GetString ("Task Options"), parent, flags)
		{
			HasSeparator = false;
			//BorderWidth = 0;
			Resizable = false;
			//Decorated = false;
			this.SetDefaultSize (400, 300);
			this.task = task;

//   Frame frame = new Frame();
//   frame.Shadow = ShadowType.Out;
//   frame.Show();
//   VBox.PackStart (frame, true, true, 0);

			VBox vbox = new VBox (false, 6);
			vbox.BorderWidth = 6;
			vbox.Show ();
			VBox.PackStart (vbox, true, true, 0);
//   frame.Add (vbox);

			ActionArea.Layout = Gtk.ButtonBoxStyle.End;

			accel_group = new Gtk.AccelGroup ();
			AddAccelGroup (accel_group);

//   Gtk.Label l = new Gtk.Label (
//     string.Format (
//      "<span weight=\"bold\">{0}</span>",
//      Catalog.GetString ("Task Options")));
//   l.UseMarkup = true;
//   l.Show ();
//   vbox.PackStart (l, false, false, 0);

			///
			/// Summary
			///
			Gtk.Label l = new Label (Catalog.GetString ("_Summary:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			summary_entry = new Gtk.Entry ();
			l.MnemonicWidget = summary_entry;
			summary_entry.Text = task.Summary;
			summary_entry.Show ();
			vbox.PackStart (summary_entry, false, false, 0);

			///
			/// Details
			///
			l = new Label (Catalog.GetString ("_Details:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			details_text_view = new TextView ();
			l.MnemonicWidget = details_text_view;
			details_text_view.WrapMode = WrapMode.Word;
			details_text_view.Show ();

			ScrolledWindow sw = new ScrolledWindow ();
			sw.ShadowType = Gtk.ShadowType.EtchedIn;
			sw.Add (details_text_view);
			sw.Show ();

			vbox.PackStart (sw, true, true, 0);

			///
			/// Completion Checkbox
			///
			HBox hbox = new Gtk.HBox (false, 4);

			completed_check_button = new Gtk.CheckButton (
			        task.IsComplete ?
			        Catalog.GetString ("_Completed:") :
			        Catalog.GetString ("_Complete"));
			if (task.IsComplete)
				completed_check_button.Active = true;
			completed_check_button.UseUnderline = true;
			completed_check_button.Toggled += OnCompletedCheckButtonToggled;
			completed_check_button.Show ();
			hbox.PackStart (completed_check_button, false, false, 0);

			completed_label = new Gtk.Label (
			        task.IsComplete ?
			        GuiUtils.GetPrettyPrintDate (task.CompletionDate, true) :
			        string.Empty);
			completed_label.Xalign = 0;
			completed_label.Show ();
			hbox.PackStart (completed_label, true, true, 0);

			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			///
			/// Due Date
			///
//.........这里部分代码省略.........
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:101,代码来源:TaskOptionsDialog.cs

示例4: NoteWindow

		//
		// Construct a window to display a note
		//
		// Currently a toolbar with Link, Search, Text, Delete buttons
		// and a Gtk.TextView as the body.
		//

		public NoteWindow (Note note)
			: base (note.Title)
		{
			this.note = note;
			this.IconName = "tomboy";
			this.SetDefaultSize (450, 360);
			Resizable = true;

			accel_group = new Gtk.AccelGroup ();
			AddAccelGroup (accel_group);

			text_menu = new NoteTextMenu (accel_group, note.Buffer, note.Buffer.Undoer);

			// Add the Find menu item to the toolbar Text menu.  It
			// should only show up in the toplevel Text menu, since
			// the context menu already has a Find submenu.

			Gtk.SeparatorMenuItem spacer = new Gtk.SeparatorMenuItem ();
			spacer.Show ();
			text_menu.Append (spacer);

			Gtk.ImageMenuItem find_item =
			        new Gtk.ImageMenuItem (Catalog.GetString("Find in This Note"));
			find_item.Image = new Gtk.Image (Gtk.Stock.Find, Gtk.IconSize.Menu);
			find_item.Activated += FindActivate;
			find_item.AddAccelerator ("activate",
			                          accel_group,
			                          (uint) Gdk.Key.f,
			                          Gdk.ModifierType.ControlMask,
			                          Gtk.AccelFlags.Visible);
			find_item.Show ();
			text_menu.Append (find_item);

			plugin_menu = MakePluginMenu ();

			toolbar = MakeToolbar ();
			toolbar.Show ();


			template_widget = MakeTemplateBar ();

			// The main editor widget
			editor = new NoteEditor (note.Buffer);
			editor.PopulatePopup += OnPopulatePopup;
			editor.Show ();

			// Sensitize the Link toolbar button on text selection
			mark_set_timeout = new InterruptableTimeout();
			mark_set_timeout.Timeout += UpdateLinkButtonSensitivity;
			note.Buffer.MarkSet += OnSelectionMarkSet;

			// FIXME: I think it would be really nice to let the
			//        window get bigger up till it grows more than
			//        60% of the screen, and then show scrollbars.
			editor_window = new Gtk.ScrolledWindow ();
			editor_window.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			editor_window.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			editor_window.Add (editor);
			editor_window.Show ();

			FocusChild = editor;

			find_bar = new NoteFindBar (note);
			find_bar.Visible = false;
			find_bar.NoShowAll = true;
			find_bar.Hidden += FindBarHidden;

			Gtk.VBox box = new Gtk.VBox (false, 2);
			box.PackStart (toolbar, false, false, 0);
			box.PackStart (template_widget, false, false, 0);
			box.PackStart (editor_window, true, true, 0);
			box.PackStart (find_bar, false, false, 0);

			box.Show ();

			// Don't set up Ctrl-W or Ctrl-N if Emacs is in use
			bool using_emacs = false;
			string gtk_key_theme = (string)
				Preferences.Get ("/desktop/gnome/interface/gtk_key_theme");
			if (gtk_key_theme != null && gtk_key_theme.CompareTo ("Emacs") == 0)
				using_emacs = true;

			// NOTE: Since some of our keybindings are only
			// available in the context menu, and the context menu
			// is created on demand, register them with the
			// global keybinder
			global_keys = new GlobalKeybinder (accel_group);

			// Close window (Ctrl-W)
			if (!using_emacs)
				global_keys.AddAccelerator (new EventHandler (CloseWindowHandler),
				                            (uint) Gdk.Key.w,
				                            Gdk.ModifierType.ControlMask,
//.........这里部分代码省略.........
开发者ID:oluc,项目名称:tomboy,代码行数:101,代码来源:NoteWindow.cs


注:本文中的Gtk.TextView.Show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。