本文整理汇总了C#中MonoDevelop.Components.Docking.DockFrame.HasLayout方法的典型用法代码示例。如果您正苦于以下问题:C# DockFrame.HasLayout方法的具体用法?C# DockFrame.HasLayout怎么用?C# DockFrame.HasLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoDevelop.Components.Docking.DockFrame
的用法示例。
在下文中一共展示了DockFrame.HasLayout方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDockAndPads
//.........这里部分代码省略.........
show_palette.Activated += delegate { palette_item.Visible = true; };
// Canvas pad
DockItem documentDockItem = dock.AddItem ("Canvas");
documentDockItem.Behavior = DockItemBehavior.Locked;
documentDockItem.Expand = true;
documentDockItem.DrawFrame = false;
documentDockItem.Label = Catalog.GetString ("Documents");
documentDockItem.Content = mainTable;
//rulers
hruler = new HRuler ();
hruler.Metric = MetricType.Pixels;
mainTable.Attach (hruler, 1, 2, 0, 1, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink | AttachOptions.Fill, 0, 0);
vruler = new VRuler ();
vruler.Metric = MetricType.Pixels;
mainTable.Attach (vruler, 0, 1, 1, 2, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink | AttachOptions.Fill, 0, 0);
sw.Hadjustment.ValueChanged += delegate {
UpdateRulerRange ();
};
sw.Vadjustment.ValueChanged += delegate {
UpdateRulerRange ();
};
PintaCore.Workspace.CanvasSizeChanged += delegate {
UpdateRulerRange ();
};
canvas.MotionNotifyEvent += delegate (object o, MotionNotifyEventArgs args) {
if (!PintaCore.Workspace.HasOpenDocuments)
return;
Cairo.PointD point = PintaCore.Workspace.WindowPointToCanvas (args.Event.X, args.Event.Y);
hruler.Position = point.X;
vruler.Position = point.Y;
};
mainTable.Attach (sw, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);
sw.Add (vp);
vp.Add (canvas);
mainTable.ShowAll ();
canvas.Show ();
vp.Show ();
HideRulers();
// Layer pad
layers = new LayersListWidget ();
DockItem layers_item = dock.AddItem ("Layers");
DockItemToolbar layers_tb = layers_item.GetToolbar (PositionType.Bottom);
layers_item.Label = Catalog.GetString ("Layers");
layers_item.Content = layers;
layers_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.MergeLayerDown.png");
layers_tb.Add (PintaCore.Actions.Layers.AddNewLayer.CreateDockToolBarItem ());
layers_tb.Add (PintaCore.Actions.Layers.DeleteLayer.CreateDockToolBarItem ());
layers_tb.Add (PintaCore.Actions.Layers.DuplicateLayer.CreateDockToolBarItem ());
layers_tb.Add (PintaCore.Actions.Layers.MergeLayerDown.CreateDockToolBarItem ());
layers_tb.Add (PintaCore.Actions.Layers.MoveLayerUp.CreateDockToolBarItem ());
layers_tb.Add (PintaCore.Actions.Layers.MoveLayerDown.CreateDockToolBarItem ());
Gtk.Action show_layers = show_pad.AppendAction ("Layers", Catalog.GetString ("Layers"), null, "Menu.Layers.MergeLayerDown.png");
show_layers.Activated += delegate { layers_item.Visible = true; };
// History pad
HistoryTreeView history = new HistoryTreeView ();
DockItem history_item = dock.AddItem ("History");
DockItemToolbar history_tb = history_item.GetToolbar (PositionType.Bottom);
history_item.Label = Catalog.GetString ("History");
history_item.DefaultLocation = "Layers/Bottom";
history_item.Content = history;
history_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.DuplicateLayer.png");
history_tb.Add (PintaCore.Actions.Edit.Undo.CreateDockToolBarItem ());
history_tb.Add (PintaCore.Actions.Edit.Redo.CreateDockToolBarItem ());
Gtk.Action show_history = show_pad.AppendAction ("History", Catalog.GetString ("History"), null, "Menu.Layers.DuplicateLayer.png");
show_history.Activated += delegate { history_item.Visible = true; };
container.PackStart (dock, true, true, 0);
string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml");
if (System.IO.File.Exists (layout_file))
dock.LoadLayouts (layout_file);
if (!dock.HasLayout ("Default"))
dock.CreateLayout ("Default", false);
dock.CurrentLayout = "Default";
}
示例2: CreateDockAndPads
private void CreateDockAndPads(HBox container)
{
Gtk.IconFactory fact = new Gtk.IconFactory ();
fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png")));
fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png")));
fact.AddDefault ();
// Dock widget
dock = new DockFrame ();
dock.CompactGuiLevel = 5;
// Toolbox pad
var toolboxpad = new ToolBoxPad ();
toolboxpad.Initialize (dock, show_pad);
// Palette pad
var palettepad = new ColorPalettePad ();
palettepad.Initialize (dock, show_pad);
// Canvas pad
var canvas_pad = new CanvasPad ();
canvas_pad.Initialize (dock, show_pad);
sw = canvas_pad.ScrolledWindow;
// Layer pad
var layers_pad = new LayersPad ();
layers_pad.Initialize (dock, show_pad);
// History pad
var history_pad = new HistoryPad ();
history_pad.Initialize (dock, show_pad);
container.PackStart (dock, true, true, 0);
string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml");
if (System.IO.File.Exists (layout_file))
dock.LoadLayouts (layout_file);
if (!dock.HasLayout ("Default"))
dock.CreateLayout ("Default", false);
dock.CurrentLayout = "Default";
}
示例3: CreateDockAndPads
private void CreateDockAndPads(HBox container)
{
Gtk.IconFactory fact = new Gtk.IconFactory ();
fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png")));
fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png")));
fact.AddDefault ();
// Dock widget
dock = new DockFrame ();
dock.CompactGuiLevel = 5;
// Toolbox pad
var toolboxpad = new ToolBoxPad ();
toolboxpad.Initialize (dock, show_pad);
// Palette pad
var palettepad = new ColorPalettePad ();
palettepad.Initialize (dock, show_pad);
// Canvas pad
var canvas_pad = new CanvasPad ();
canvas_pad.Initialize (dock, show_pad);
sw = canvas_pad.ScrolledWindow;
// Layer pad
var layers_pad = new LayersPad ();
layers_pad.Initialize (dock, show_pad);
// History pad
var history_pad = new HistoryPad ();
history_pad.Initialize (dock, show_pad);
// Open Images pad
var open_images_pad = new OpenImagesPad ();
open_images_pad.Initialize (dock, show_pad);
container.PackStart (dock, true, true, 0);
string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml");
if (System.IO.File.Exists(layout_file))
{
try
{
dock.LoadLayouts(layout_file);
}
// If parsing layouts.xml fails for some reason, proceed to create the default layout.
catch (Exception e)
{
System.Console.Error.WriteLine ("Error reading layouts.xml: " + e.ToString());
}
}
if (!dock.HasLayout ("Default"))
dock.CreateLayout ("Default", false);
dock.CurrentLayout = "Default";
}
示例4: CreateDockAndPads
//.........这里部分代码省略.........
};
// Dock widget
dock = new DockFrame ();
dock.CompactGuiLevel = 5;
Gtk.IconFactory fact = new Gtk.IconFactory ();
fact.Add ("Tools.Pencil.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Tools.Pencil.png")));
fact.Add ("Pinta.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Pinta.png")));
fact.AddDefault ();
// Toolbox pad
DockItem toolbox_item = dock.AddItem ("Toolbox");
toolbox = new ToolBoxWidget () { Name = "toolbox" };
toolbox_item.Label = Catalog.GetString ("Tools");
toolbox_item.Content = toolbox;
toolbox_item.Icon = PintaCore.Resources.GetIcon ("Tools.Pencil.png");
toolbox_item.Behavior |= DockItemBehavior.CantClose;
toolbox_item.DefaultWidth = 65;
Gtk.Action show_toolbox = show_pad.AppendAction ("Tools", Catalog.GetString ("Tools"), null, "Tools.Pencil.png");
show_toolbox.Activated += delegate { toolbox_item.Visible = true; };
// Palette pad
DockItem palette_item = dock.AddItem ("Palette");
color = new ColorPaletteWidget () { Name = "color" };
palette_item.Label = Catalog.GetString ("Palette");
palette_item.Content = color;
palette_item.Icon = PintaCore.Resources.GetIcon ("Pinta.png");
palette_item.DefaultLocation = "Toolbox/Bottom";
palette_item.Behavior |= DockItemBehavior.CantClose;
palette_item.DefaultWidth = 65;
Gtk.Action show_palette = show_pad.AppendAction ("Palette", Catalog.GetString ("Palette"), null, "Pinta.png");
show_palette.Activated += delegate { palette_item.Visible = true; };
// Canvas pad
DockItem documentDockItem = dock.AddItem ("Canvas");
documentDockItem.Behavior = DockItemBehavior.Locked;
documentDockItem.Expand = true;
documentDockItem.DrawFrame = false;
documentDockItem.Label = Catalog.GetString ("Documents");
documentDockItem.Content = sw;
sw.Add (vp);
vp.Add (canvas);
canvas.Show ();
vp.Show ();
// Layer pad
LayersListWidget layers = new LayersListWidget ();
DockItem layers_item = dock.AddItem ("Layers");
DockItemToolbar layers_tb = layers_item.GetToolbar (PositionType.Bottom);
layers_item.Label = Catalog.GetString ("Layers");
layers_item.Content = layers;
layers_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.MergeLayerDown.png");
layers_tb.Add (PintaCore.Actions.Layers.AddNewLayer.CreateDockToolBarItem ());
layers_tb.Add (PintaCore.Actions.Layers.DeleteLayer.CreateDockToolBarItem ());
layers_tb.Add (PintaCore.Actions.Layers.DuplicateLayer.CreateDockToolBarItem ());
layers_tb.Add (PintaCore.Actions.Layers.MergeLayerDown.CreateDockToolBarItem ());
layers_tb.Add (PintaCore.Actions.Layers.MoveLayerUp.CreateDockToolBarItem ());
layers_tb.Add (PintaCore.Actions.Layers.MoveLayerDown.CreateDockToolBarItem ());
Gtk.Action show_layers = show_pad.AppendAction ("Layers", Catalog.GetString ("Layers"), null, "Menu.Layers.MergeLayerDown.png");
show_layers.Activated += delegate { layers_item.Visible = true; };
// History pad
HistoryTreeView history = new HistoryTreeView ();
DockItem history_item = dock.AddItem ("History");
DockItemToolbar history_tb = history_item.GetToolbar (PositionType.Bottom);
history_item.Label = Catalog.GetString ("History");
history_item.DefaultLocation = "Layers/Bottom";
history_item.Content = history;
history_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.DuplicateLayer.png");
history_tb.Add (PintaCore.Actions.Edit.Undo.CreateDockToolBarItem ());
history_tb.Add (PintaCore.Actions.Edit.Redo.CreateDockToolBarItem ());
Gtk.Action show_history = show_pad.AppendAction ("History", Catalog.GetString ("History"), null, "Menu.Layers.DuplicateLayer.png");
show_history.Activated += delegate { history_item.Visible = true; };
container.PackStart (dock, true, true, 0);
string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml");
if (System.IO.File.Exists (layout_file))
dock.LoadLayouts (layout_file);
if (!dock.HasLayout ("Default"))
dock.CreateLayout ("Default", false);
dock.CurrentLayout = "Default";
}