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


C# Toolbar.Show方法代码示例

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


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

示例1: CreateToolBar

		public Toolbar CreateToolBar (string name)
		{
			main_toolbar = new Toolbar ();
			main_toolbar.Name = name;

			menu_layout.PackStart (main_toolbar, false, false, 0);
			main_toolbar.Show ();

			return main_toolbar;
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:10,代码来源:WindowShell.cs

示例2: BuildHeader

        private void BuildHeader ()
        {
            header_table = new Table (2, 2, false);
            header_table.Show ();
            primary_vbox.PackStart (header_table, false, false, 0);

            main_menu = new MainMenu ();

            if (!PlatformDetection.IsMac && !PlatformDetection.IsMeeGo) {
                main_menu.Show ();
                header_table.Attach (main_menu, 0, 1, 0, 1,
                    AttachOptions.Expand | AttachOptions.Fill,
                    AttachOptions.Shrink, 0, 0);
            }

            Alignment toolbar_alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            toolbar_alignment.TopPadding = PlatformDetection.IsMeeGo ? 0u : 3u;
            toolbar_alignment.BottomPadding = PlatformDetection.IsMeeGo ? 0u : 3u;

            header_toolbar = (Toolbar)ActionService.UIManager.GetWidget ("/HeaderToolbar");
            header_toolbar.ShowArrow = false;
            header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            header_toolbar.Show ();

            if (PlatformDetection.IsMeeGo) {
                header_toolbar.IconSize = IconSize.LargeToolbar;
                header_toolbar.Name = "meego-toolbar";
            }

            toolbar_alignment.Add (header_toolbar);
            toolbar_alignment.Show ();

            header_table.Attach (toolbar_alignment, 0, 2, 1, 2,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);

            var next_button = new NextButton (ActionService, PlatformDetection.IsMeeGo);
            next_button.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/NextArrowButton", next_button);

            seek_slider = new ConnectedSeekSlider () { Resizable = ShowSeekSliderResizer.Get () };
            seek_slider.SeekSlider.WidthRequest = SeekSliderWidth.Get ();
            seek_slider.SeekSlider.SizeAllocated += (o, a) => {
                SeekSliderWidth.Set (seek_slider.SeekSlider.Allocation.Width);
            };
            seek_slider.ShowAll ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider);

            var track_info_display = new ClassicTrackInfoDisplay ();
            track_info_display.Show ();
            track_info_container = TrackInfoDisplay.GetEditable (track_info_display);
            track_info_container.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_container, true);

            if (PlatformDetection.IsMeeGo) {
                track_info_display.ArtworkSpacing = 5;
                seek_slider.LeftPadding = 20;
                seek_slider.RightPadding = 20;

                var menu = (Menu)(ActionService.UIManager.GetWidget ("/ToolbarMenu"));
                var menu_button = new Hyena.Widgets.MenuButton (new Image (Stock.Preferences, IconSize.LargeToolbar), menu, true);
                menu_button.Show ();
                ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ToolbarMenuPlaceholder", menu_button);

                var close_button = new Button (Image.NewFromIconName ("window-close", IconSize.LargeToolbar)) {
                    TooltipText = Catalog.GetString ("Close")
                };

                close_button.Clicked += (o, e) => Hide ();
                close_button.ShowAll ();
                ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ClosePlaceholder", close_button);
            } else {
                var volume_button = new ConnectedVolumeButton ();
                volume_button.Show ();
                ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/VolumeButton", volume_button);
            }
        }
开发者ID:petejohanson,项目名称:banshee,代码行数:77,代码来源:PlayerInterface.cs

示例3: CreateToolBar

        public Toolbar CreateToolBar(string name)
        {
            m_mainToolbar = new Toolbar();
            m_mainToolbar.Name = name;

            m_menuLayout.PackStart (m_mainToolbar, false, false, 0);
            m_mainToolbar.Show();

            return m_mainToolbar;
        }
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:10,代码来源:WindowShell.cs

示例4: CheckCreateSubViewToolbar

		void CheckCreateSubViewToolbar ()
		{
			if (subViewToolbar != null)
				return;
			
			subViewToolbar = new Toolbar ();
			subViewToolbar.IconSize = IconSize.SmallToolbar;
			subViewToolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
			subViewToolbar.ShowArrow = false;
			subViewToolbar.Show ();
			
			CheckCreateToolbarBox ();
			toolbarBox.PackStart (subViewToolbar, false, false, 0);
		}
开发者ID:acken,项目名称:monodevelop,代码行数:14,代码来源:SdiWorkspaceWindow.cs

示例5: BuildHeader

        private void BuildHeader()
        {
            header_table = new Table (2, 2, false);
            header_table.Show ();
            header_table.Vexpand = false;
            primary_vbox.PackStart (header_table, false, false, 0);

            main_menu = new MainMenu ();

            if (!PlatformDetection.IsMac) {
                main_menu.Show ();
                header_table.Attach (main_menu, 0, 1, 0, 1,
                    AttachOptions.Expand | AttachOptions.Fill,
                    AttachOptions.Shrink, 0, 0);
            }

            Alignment toolbar_alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            toolbar_alignment.TopPadding = 3u;
            toolbar_alignment.BottomPadding = 3u;

            header_toolbar = (Toolbar)ActionService.UIManager.GetWidget ("/HeaderToolbar");
            header_toolbar.ShowArrow = false;
            header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            header_toolbar.Show ();

            toolbar_alignment.Add (header_toolbar);
            toolbar_alignment.Show ();

            header_table.Attach (toolbar_alignment, 0, 2, 1, 2,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);

            var next_button = new NextButton (ActionService);
            next_button.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/NextArrowButton", next_button);

            seek_slider = new ConnectedSeekSlider () { Resizable = ShowSeekSliderResizer.Get () };
            seek_slider.SeekSlider.WidthRequest = SeekSliderWidth.Get ();
            seek_slider.SeekSlider.SizeAllocated += (o, a) => {
                SeekSliderWidth.Set (seek_slider.SeekSlider.Allocation.Width);
            };
            seek_slider.ShowAll ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider);

            var track_info_display = new ClassicTrackInfoDisplay ();
            track_info_display.Show ();
            track_info_container = TrackInfoDisplay.GetEditable (track_info_display);
            track_info_container.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_container, true);

            var volume_button = new ConnectedVolumeButton ();
            volume_button.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/VolumeButton", volume_button);
        }
开发者ID:dufoli,项目名称:banshee,代码行数:54,代码来源:PlayerInterface.cs

示例6: 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

示例7: SqlQueryView

        public SqlQueryView()
            : base()
        {
            control = new Frame ();
            control.Show ();

            VBox vbox = new VBox ();
            vbox.Show ();

            Tooltips tips = new Tooltips ();

            Toolbar toolbar = new Toolbar ();
            vbox.PackStart 	(toolbar, false, true, 0);
            toolbar.Show ();

            Image image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.Execute");
            image.Show ();

            Button execute = new Button (image);
            execute.Clicked += new EventHandler (OnExecute);
            execute.Relief = ReliefStyle.None;
            tips.SetTip (execute, "Execute", "");
            toolbar.Add (execute);
            execute.Show ();

            image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.RunFromCursor");
            image.Show ();

            Button run = new Button (image);
            run.Clicked += new EventHandler (OnRunFromCursor);
            run.Relief = ReliefStyle.None;
            tips.SetTip (run, "Run from cursor", "");
            toolbar.Add (run);
            run.Show ();

            image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.Explain");
            image.Show ();

            Button explain = new Button (image);
            explain.Clicked += new EventHandler (OnExplain);
            explain.Relief = ReliefStyle.None;
            tips.SetTip (explain, "Explain query", "");
            toolbar.Add (explain);
            explain.Show ();

            image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.Stop");
            image.Show ();

            Button stop = new Button (image);
            stop.Clicked += new EventHandler (OnStop);
            stop.Relief = ReliefStyle.None;
            stop.Sensitive = false;
            tips.SetTip (stop, "Stop", "");
            toolbar.Add (stop);
            stop.Show ();

            VSeparator sep = new VSeparator ();
            toolbar.Add (sep);
            sep.Show ();

            model = new ListStore (typeof (string), typeof (DbProviderBase));

            providers = new ComboBox ();
            providers.Model = model;
            CellRendererText ctext = new CellRendererText ();
            providers.PackStart (ctext, true);
            providers.AddAttribute (ctext, "text", 0);
            toolbar.Add (providers);
            providers.Show ();

            SourceLanguagesManager lm = new SourceLanguagesManager ();
            SourceLanguage lang = lm.GetLanguageFromMimeType ("text/x-sql");
            SourceBuffer buf = new SourceBuffer (lang);
            buf.Highlight = true;
            sourceView = new SourceView (buf);
            sourceView.ShowLineNumbers = true;
            sourceView.Show ();

            ScrolledWindow scroller = new ScrolledWindow ();
            scroller.Add (sourceView);
            scroller.Show ();
            vbox.PackStart (scroller, true, true, 0);

            control.Add (vbox);

            service = (MonoQueryService)
                ServiceManager.GetService (typeof (MonoQueryService));
            changedHandler
                 = (EventHandler) Runtime.DispatchService.GuiDispatch (
                    new EventHandler (OnProvidersChanged));
            service.Providers.Changed += changedHandler;

            foreach (DbProviderBase p in service.Providers) {
                model.AppendValues (p.Name, p);
            }
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:100,代码来源:SqlQueryView.cs


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