本文整理汇总了C#中Gtk.Toolbar.AppendSpace方法的典型用法代码示例。如果您正苦于以下问题:C# Toolbar.AppendSpace方法的具体用法?C# Toolbar.AppendSpace怎么用?C# Toolbar.AppendSpace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Toolbar
的用法示例。
在下文中一共展示了Toolbar.AppendSpace方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static Gtk.Window Create()
{
window = new Window ("Toolbar");
window.Resizable = false;
toolbar = new Toolbar ();
toolbar.InsertStock (Stock.New, "Stock icon: New", "Toolbar/New",
new SignalFunc (set_small_icon), IntPtr.Zero, -1);
toolbar.InsertStock (Stock.Open, "Stock icon: Open", "Toolbar/Open",
new SignalFunc (set_large_icon), IntPtr.Zero, -1);
toolbar.AppendSpace ();
toolbar.AppendItem ("Toggle tooltips", "toggle showing of tooltips", "Toolbar/Tooltips",
new Image (Stock.DialogInfo, IconSize.LargeToolbar),
new SignalFunc (toggle_tooltips));
toolbar.AppendSpace ();
toolbar.AppendItem ("Horizontal", "Horizontal layout", "Toolbar/Horizontal",
new Image (Stock.GoForward, IconSize.LargeToolbar),
new SignalFunc (set_horizontal));
toolbar.AppendItem ("Vertical", "Vertical layout", "Toolbar/Vertical",
new Image (Stock.GoUp, IconSize.LargeToolbar),
new SignalFunc (set_vertical));
toolbar.AppendSpace ();
toolbar.AppendItem ("Icons", "Only show icons", "Toolbar/IconsOnly",
new Image (Stock.Home, IconSize.LargeToolbar),
new SignalFunc (set_icon_only));
toolbar.AppendItem ("Text", "Only show Text", "Toolbar/TextOnly",
new Image (Stock.JustifyFill, IconSize.LargeToolbar),
new SignalFunc (set_text_only));
toolbar.AppendItem ("Both", "Show both Icon & Text", "Toolbar/Both",
new Image (Stock.Index, IconSize.LargeToolbar),
new SignalFunc (set_both));
toolbar.AppendItem ("Both (Horizontal)", "Show Icon & Text horizontally", "Toolbar/BothHoriz",
new Image (Stock.Index, IconSize.LargeToolbar),
new SignalFunc (set_both_horiz));
toolbar.AppendSpace ();
toolbar.InsertStock (Stock.Close, "Stock icon: Close", "Toolbar/Close",
new SignalFunc (Close_Button), IntPtr.Zero, -1);
window.Add (toolbar);
window.ShowAll ();
return window;
}
示例2: BuildToolBar
private Toolbar BuildToolBar()
{
Toolbar t = new Toolbar();
Gtk.Widget new_ = BuildToolbarButton("gtk-new");
Gtk.Widget open = BuildToolbarButton("gtk-open");
Gtk.Widget save = BuildToolbarButton("gtk-save");
Gtk.Widget save_as = BuildToolbarButton("gtk-save-as");
new_.ButtonPressEvent += new ButtonPressEventHandler(OnNew);
open.ButtonPressEvent += new ButtonPressEventHandler(OnOpen);
save.ButtonPressEvent += new ButtonPressEventHandler(OnSave);
save_as.ButtonPressEvent += new ButtonPressEventHandler(OnSaveAs);
t.AppendWidget(new_, "New", "New");
t.AppendSpace();
t.AppendWidget(open, "Open", "Open");
t.AppendWidget(save, "Save", "Save");
t.AppendWidget(save_as, "Save as", "Save as");
return t;
}
示例3: SingleView
public SingleView (Uri [] uris)
{
string glade_name = "single_view";
this.uri = uris [0];
System.Console.WriteLine ("uri = {0}", uri.ToString ());
xml = new Glade.XML (null, "f-spot.glade", glade_name, "f-spot");
xml.Autoconnect (this);
window = (Gtk.Window) xml.GetWidget (glade_name);
LoadPreference (Preferences.VIEWER_WIDTH);
LoadPreference (Preferences.VIEWER_MAXIMIZED);
Gtk.Toolbar toolbar = new Gtk.Toolbar ();
toolbar_hbox.PackStart (toolbar);
Widget rl_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-rotate-270", new System.EventHandler (HandleRotate270Command));
SetTip (rl_button, Catalog.GetString ("Rotate photo left"));
Widget rr_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-rotate-90", new System.EventHandler (HandleRotate90Command));
SetTip (rr_button, Catalog.GetString ("Rotate photo right"));
toolbar.AppendSpace ();
Widget fs_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-fullscreen", new System.EventHandler (HandleViewFullscreen));
SetTip (fs_button, Catalog.GetString ("View photos fullscreen"));
Widget ss_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-slideshow", new System.EventHandler (HandleViewSlideshow));
SetTip (ss_button, Catalog.GetString ("View photos in a slideshow"));
collection = new UriCollection (uris);
TargetEntry [] dest_table = { new TargetEntry ("text/uri-list", 0, 0),
new TargetEntry ("text/plain", 0, 1)};
directory_view = new IconView (collection);
directory_view.Selection.Changed += HandleSelectionChanged;
directory_view.DragDataReceived += HandleDragDataReceived;
Gtk.Drag.DestSet (directory_view, DestDefaults.All, dest_table,
DragAction.Copy | DragAction.Move);
directory_view.DisplayTags = false;
directory_view.DisplayDates = false;
directory_scrolled.Add (directory_view);
ThumbnailGenerator.Default.OnPixbufLoaded += delegate { directory_view.QueueDraw (); };
image_view = new PhotoImageView (collection);
FSpot.Global.ModifyColors (image_view);
FSpot.Global.ModifyColors (image_scrolled);
image_view.ZoomChanged += HandleZoomChanged;
image_view.Item.Changed += HandleItemChanged;
image_view.ButtonPressEvent += HandleImageViewButtonPressEvent;
image_view.DragDataReceived += HandleDragDataReceived;
Gtk.Drag.DestSet (image_view, DestDefaults.All, dest_table,
DragAction.Copy | DragAction.Move);
image_scrolled.Add (image_view);
Window.ShowAll ();
zoom_scale.ValueChanged += HandleZoomScaleValueChanged;
LoadPreference (Preferences.VIEWER_SHOW_TOOLBAR);
LoadPreference (Preferences.VIEWER_INTERPOLATION);
LoadPreference (Preferences.VIEWER_TRANSPARENCY);
LoadPreference (Preferences.VIEWER_TRANS_COLOR);
ShowSidebar = collection.Count > 1;
near_image.SetFromStock ("f-spot-stock_near", Gtk.IconSize.SmallToolbar);
far_image.SetFromStock ("f-spot-stock_far", Gtk.IconSize.SmallToolbar);
slide_delay = new FSpot.Delay (new GLib.IdleHandler (SlideShow));
LoadPreference (Preferences.VIEWER_SHOW_FILENAMES);
Preferences.SettingChanged += OnPreferencesChanged;
window.DeleteEvent += HandleDeleteEvent;
collection.Changed += HandleCollectionChanged;
UpdateStatusLabel ();
if (collection.Count > 0)
directory_view.Selection.Add (0);
export.Submenu = (Mono.Addins.AddinManager.GetExtensionNode ("/FSpot/Menus/Exports") as FSpot.Extensions.SubmenuNode).GetMenuItem ().Submenu;
export.Submenu.ShowAll ();
export.Activated += HandleExportActivated ;
}
示例4: MainWindow
//
// Constructor
//
public MainWindow (Db db)
{
this.db = db;
if (Toplevel == null)
Toplevel = this;
Glade.XML gui = new Glade.XML (null, "f-spot.glade", "main_window", null);
gui.Autoconnect (this);
LoadPreference (Preferences.MAIN_WINDOW_WIDTH);
LoadPreference (Preferences.MAIN_WINDOW_X);
LoadPreference (Preferences.MAIN_WINDOW_MAXIMIZED);
main_window.ShowAll ();
LoadPreference (Preferences.SIDEBAR_POSITION);
LoadPreference (Preferences.METADATA_EMBED_IN_IMAGE);
slide_delay = new FSpot.Delay (new GLib.IdleHandler (SlideShow));
toolbar = new Gtk.Toolbar ();
toolbar_vbox.PackStart (toolbar);
Widget import_button = GtkUtil.MakeToolbarButton (toolbar, "gtk-add", Catalog.GetString ("Import"), new System.EventHandler (HandleImportCommand));
SetTip (import_button, Catalog.GetString ("Import photos"));
toolbar.AppendSpace ();
rl_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-rotate-270", new System.EventHandler (HandleRotate270Command));
rr_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-rotate-90", new System.EventHandler (HandleRotate90Command));
toolbar.AppendSpace ();
// FIXME putting these two toggle buttons in a radio group would prevent
// the two toggle sounds from being emitted every time you switch modes
browse_button = GtkUtil.MakeToolbarToggleButton (toolbar, "f-spot-browse",
new System.EventHandler (HandleToggleViewBrowse)) as ToggleButton;
SetTip (browse_button, Catalog.GetString ("Browse many photos simultaneously"));
edit_button = GtkUtil.MakeToolbarToggleButton (toolbar, "f-spot-edit-image",
new System.EventHandler (HandleToggleViewPhoto)) as ToggleButton;
SetTip (edit_button, Catalog.GetString ("View and edit a photo"));
toolbar.AppendSpace ();
Widget fs_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-fullscreen", new System.EventHandler (HandleViewFullscreen));
SetTip (fs_button, Catalog.GetString ("View photos fullscreen"));
Widget ss_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-slideshow", new System.EventHandler (HandleViewSlideShow));
SetTip (ss_button, Catalog.GetString ("View photos in a slideshow"));
tag_selection_widget = new TagSelectionWidget (db.Tags);
tag_selection_scrolled.Add (tag_selection_widget);
tag_selection_widget.Selection.Changed += HandleTagSelectionChanged;
tag_selection_widget.DragDataGet += HandleTagSelectionDragDataGet;
tag_selection_widget.DragDrop += HandleTagSelectionDragDrop;
tag_selection_widget.DragBegin += HandleTagSelectionDragBegin;
tag_selection_widget.KeyPressEvent += HandleTagSelectionKeyPress;
Gtk.Drag.SourceSet (tag_selection_widget, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask,
tag_target_table, DragAction.Copy | DragAction.Move);
tag_selection_widget.DragDataReceived += HandleTagSelectionDragDataReceived;
tag_selection_widget.DragMotion += HandleTagSelectionDragMotion;
Gtk.Drag.DestSet (tag_selection_widget, DestDefaults.All, tag_dest_target_table,
DragAction.Copy | DragAction.Move );
tag_selection_widget.ButtonPressEvent += HandleTagSelectionButtonPressEvent;
tag_selection_widget.PopupMenu += HandleTagSelectionPopupMenu;
tag_selection_widget.RowActivated += HandleTagSelectionRowActivated;
LoadPreference (Preferences.TAG_ICON_SIZE);
info_box = new InfoBox ();
info_box.VersionIdChanged += HandleInfoBoxVersionIdChange;
left_vbox.PackStart (info_box, false, true, 0);
try {
query = new FSpot.PhotoQuery (db.Photos);
} catch (System.Exception e) {
//FIXME assume any exception here is due to a corrupt db and handle that.
RestoreDb (e);
query = new FSpot.PhotoQuery (db.Photos);
}
UpdateStatusLabel ();
query.Changed += HandleQueryChanged;
db.Photos.ItemsChanged += HandleDbItemsChanged;
db.Tags.ItemsChanged += HandleTagsChanged;
db.Tags.ItemsAdded += HandleTagsChanged;
db.Tags.ItemsRemoved += HandleTagsChanged;
#if SHOW_CALENDAR
FSpot.SimpleCalendar cal = new FSpot.SimpleCalendar (query);
cal.DaySelected += HandleCalendarDaySelected;
left_vbox.PackStart (cal, false, true, 0);
#endif
group_selector = new FSpot.GroupSelector ();
group_selector.Adaptor = new FSpot.TimeAdaptor (query);
//.........这里部分代码省略.........