本文整理汇总了C#中Gtk.Alignment.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Alignment.Show方法的具体用法?C# Alignment.Show怎么用?C# Alignment.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Alignment
的用法示例。
在下文中一共展示了Alignment.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnableStartupNotesPreference
public EnableStartupNotesPreference ()
{
IPropertyEditorBool enableStartupNotes_peditor;
Gtk.CheckButton enableStartupNotesCheckbox;
Gtk.Label enableStartupNotesLabel;
// Enable Startup Notes option
enableStartupNotesLabel = new Gtk.Label (Catalog.GetString ("Enable startup notes"));
enableStartupNotesLabel.UseMarkup = true;
enableStartupNotesLabel.Justify = Gtk.Justification.Left;
enableStartupNotesLabel.SetAlignment (0.0f, 0.5f);
enableStartupNotesLabel.Show ();
enableStartupNotesCheckbox = new Gtk.CheckButton ();
enableStartupNotesCheckbox.Add (enableStartupNotesLabel);
enableStartupNotesCheckbox.Show ();
enableStartupNotes_peditor =
Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_STARTUP_NOTES, enableStartupNotesCheckbox);
Preferences.Get (enableStartupNotes_peditor.Key);
enableStartupNotes_peditor.Setup ();
align = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 1.0f);
align.Show ();
align.Add (enableStartupNotesCheckbox);
}
示例2: MonoMacPackagingSettingsDialog
public MonoMacPackagingSettingsDialog ()
{
this.Title = GettextCatalog.GetString ("Create Mac Installer");
this.DestroyWithParent = true;
this.Modal = true;
settingsWidget.Show ();
var al = new Alignment (0.5f, 0.5f, 1.0f, 1.0f) {
TopPadding = 12,
BottomPadding = 12,
RightPadding = 12,
LeftPadding = 12,
Child = settingsWidget,
};
al.Show ();
this.VBox.PackStart (al, true, true, 0);
var okButton = new Button () {
Label = GettextCatalog.GetString ("Create Package")
};
var cancelButton = new Button (Stock.Cancel);
this.AddActionWidget (cancelButton, ResponseType.Cancel);
this.AddActionWidget (okButton, ResponseType.Ok);
this.ActionArea.ShowAll ();
}
示例3: PopoverWindow
public PopoverWindow (Gtk.WindowType type) : base(type)
{
SkipTaskbarHint = true;
SkipPagerHint = true;
AppPaintable = true;
TypeHint = WindowTypeHint.Tooltip;
CheckScreenColormap ();
alignment = new Alignment (0, 0, 1f, 1f);
alignment.Show ();
Add (alignment);
disableSizeCheck = false;
SizeRequested += (object o, SizeRequestedArgs args) => {
if (this.AnimationIsRunning("Resize") && !disableSizeCheck) {
Gtk.Requisition result = new Gtk.Requisition ();
result.Width = Math.Max (args.Requisition.Width, Math.Max (Allocation.Width, targetSize.Width));
result.Height = Math.Max (args.Requisition.Height, Math.Max (Allocation.Height, targetSize.Height));
args.Requisition = result;
}
};
UpdatePadding ();
}
示例4: GetPreferenceTabWidget
public override bool GetPreferenceTabWidget ( PreferencesDialog parent,
out string tabLabel,
out Gtk.Widget preferenceWidget)
{
Gtk.Label label;
Gtk.SpinButton menuNoteCountSpinner;
Gtk.Alignment align;
int menuNoteCount;
// Addin's tab caption
tabLabel = Catalog.GetString ("Advanced");
Gtk.VBox opts_list = new Gtk.VBox (false, 12);
opts_list.BorderWidth = 12;
opts_list.Show ();
align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 1.0f);
align.Show ();
opts_list.PackStart (align, false, false, 0);
Gtk.Table table = new Gtk.Table (1, 2, false);
table.ColumnSpacing = 6;
table.RowSpacing = 6;
table.Show ();
align.Add (table);
// Menu Note Count option
label = new Gtk.Label (Catalog.GetString ("Minimum number of notes to show in Recent list (maximum 18)"));
label.UseMarkup = true;
label.Justify = Gtk.Justification.Left;
label.SetAlignment (0.0f, 0.5f);
label.Show ();
table.Attach (label, 0, 1, 0, 1);
menuNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT);
// we have a hard limit of 18 set, thus not allowing anything bigger than 18
menuNoteCountSpinner = new Gtk.SpinButton (1, 18, 1);
menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;
menuNoteCountSpinner.Show ();
table.Attach (menuNoteCountSpinner, 1, 2, 0, 1);
menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;
if (opts_list != null) {
preferenceWidget = opts_list;
return true;
} else {
preferenceWidget = null;
return false;
}
}
示例5: HoverImageButton
public HoverImageButton()
{
Gtk.Alignment al = new Alignment (0.5f, 0.5f, 0f, 0f);
al.Show ();
CanFocus = true;
VisibleWindow = false;
image = new ImageView();
image.Show();
al.Add (image);
Add(al);
}
示例6: MenuMinMaxNoteCountPreference
public MenuMinMaxNoteCountPreference ()
{
table = new Gtk.Table (2, 2, false);
table.ColumnSpacing = 6;
table.RowSpacing = 6;
table.Show ();
// Menu Min Note Count option
menuMinNoteCountLabel = new Gtk.Label (Catalog.GetString ("Minimum number of notes to show in Recent list"));
menuMinNoteCountLabel.UseMarkup = true;
menuMinNoteCountLabel.Justify = Gtk.Justification.Left;
menuMinNoteCountLabel.SetAlignment (0.0f, 0.5f);
menuMinNoteCountLabel.Show ();
table.Attach (menuMinNoteCountLabel, 0, 1, 0, 1);
menuMinNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT);
menuMaxNoteCount = (int) Preferences.Get (Preferences.MENU_MAX_NOTE_COUNT);
// This is to avoid having Max bigger than absolute maximum if someone changed the setting
// outside of the Tomboy using e.g. gconf
menuMaxNoteCount = (menuMaxNoteCount <= int.MaxValue ? menuMaxNoteCount : int.MaxValue);
// This is to avoid having Min bigger than Max if someone changed the setting
// outside of the Tomboy using e.g. gconf
menuMinNoteCount = (menuMinNoteCount <= menuMaxNoteCount ? menuMinNoteCount : menuMaxNoteCount);
menuMinNoteCountSpinner = new Gtk.SpinButton (1, menuMaxNoteCount, 1);
menuMinNoteCountSpinner.Value = menuMinNoteCount;
menuMinNoteCountSpinner.Show ();
table.Attach (menuMinNoteCountSpinner, 1, 2, 0, 1);
menuMinNoteCountSpinner.ValueChanged += UpdateMenuMinNoteCountPreference;
// Menu Max Note Count option
menuMaxNoteCountLabel = new Gtk.Label (Catalog.GetString ("Maximum number of notes to show in Recent list"));
menuMaxNoteCountLabel.UseMarkup = true;
menuMaxNoteCountLabel.Justify = Gtk.Justification.Left;
menuMaxNoteCountLabel.SetAlignment (0.0f, 0.5f);
menuMaxNoteCountLabel.Show ();
table.Attach (menuMaxNoteCountLabel, 0, 1, 1, 2);
menuMaxNoteCountSpinner = new Gtk.SpinButton (menuMinNoteCount, int.MaxValue, 1);
menuMaxNoteCountSpinner.Value = menuMaxNoteCount;
menuMaxNoteCountSpinner.Show ();
table.Attach (menuMaxNoteCountSpinner, 1, 2, 1, 2);
menuMaxNoteCountSpinner.ValueChanged += UpdateMenuMaxNoteCountPreference;
align = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 1.0f);
align.Show ();
align.Add (table);
}
示例7: DefaultApplicationHelperDialog
private DefaultApplicationHelperDialog()
: base(null, DialogFlags.DestroyWithParent, MessageType.Question, ButtonsType.None,
Catalog.GetString ("Make Banshee the default media player?"),
Catalog.GetString ("Currently another program is configured as the default media player. Would you prefer Banshee to be the default?"))
{
remember = new CheckButton (Catalog.GetString ("Do not ask me this again"));
remember.UseUnderline = true;
remember.Active = DefaultApplicationHelper.EverAskedSchema.Get ()
? DefaultApplicationHelper.RememberChoiceSchema.Get () : false;
remember.Show ();
Alignment align = new Alignment (0f, 0f, 1f, 1f);
align.TopPadding = 6;
align.Child = remember;
align.Show ();
LabelVBox.PackEnd (align, false, false, 0);
AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.No, false);
AddCustomButton (Catalog.GetString ("Make Banshee the Default"), Gtk.ResponseType.Yes, true).HasFocus = true;
}
示例8: PopoverWidget
public PopoverWidget ()
{
AppPaintable = true;
VisibleWindow = false;
alignment = new Alignment (0, 0, 1f, 1f);
alignment.Show ();
Add (alignment);
disableSizeCheck = false;
SizeRequested += (object o, SizeRequestedArgs args) => {
if (this.AnimationIsRunning("Resize") && !disableSizeCheck) {
Gtk.Requisition result = new Gtk.Requisition ();
result.Width = Math.Max (args.Requisition.Width, Math.Max (Allocation.Width, targetSize.Width));
result.Height = Math.Max (args.Requisition.Height, Math.Max (Allocation.Height, targetSize.Height));
args.Requisition = result;
}
};
UpdatePadding ();
}
示例9: SetButtonIcon
static void SetButtonIcon (Button button, string stockIcon)
{
Alignment alignment = new Alignment (0.5f, 0.5f, 0f, 0f);
Label label = new Label (button.Label);
HBox hbox = new HBox (false, 2);
Image image = new Image ();
image.Pixbuf = Stetic.IconLoader.LoadIcon (button, stockIcon, IconSize.Button);
image.Show ();
hbox.Add (image);
label.Show ();
hbox.Add (label);
hbox.Show ();
alignment.Add (hbox);
button.Child.Destroy ();
alignment.Show ();
button.Add (alignment);
}
示例10: CreateExceptionInfoHeader
Widget CreateExceptionInfoHeader ()
{
ExceptionMessageLabel = new Label () { UseMarkup = true, Selectable = true, Wrap = true, WidthRequest = 500, Xalign = 0.0f, Yalign = 0.0f };
ExceptionTypeLabel = new Label () { UseMarkup = true, Xalign = 0.0f };
ExceptionMessageLabel.Show ();
ExceptionTypeLabel.Show ();
var alignment = new Alignment (0.0f, 0.0f, 0.0f, 0.0f);
alignment.Child = ExceptionMessageLabel;
alignment.BorderWidth = 6;
alignment.Show ();
var frame = new InfoFrame (alignment);
frame.Show ();
var vbox = new VBox (false, 12);
vbox.PackStart (ExceptionTypeLabel, false, true, 0);
vbox.PackStart (frame, true, true, 0);
vbox.Show ();
return vbox;
}
示例11: CreatePageWidget
void CreatePageWidget (SectionPage page)
{
List<PanelInstance> boxPanels = new List<PanelInstance> ();
List<PanelInstance> tabPanels = new List<PanelInstance> ();
foreach (PanelInstance pi in page.Panels) {
if (pi.Widget == null) {
pi.Widget = pi.Panel.CreatePanelWidget ();
//HACK: work around bug 469427 - broken themes match on widget names
if (pi.Widget.Name.IndexOf ("Panel") > 0)
pi.Widget.Name = pi.Widget.Name.Replace ("Panel", "_");
}
else if (pi.Widget.Parent != null)
((Gtk.Container) pi.Widget.Parent).Remove (pi.Widget);
if (pi.Node.Grouping == PanelGrouping.Tab)
tabPanels.Add (pi);
else
boxPanels.Add (pi);
}
// Try to fit panels with grouping=box or auto in the main page.
// If they don't fit. Move auto panels to its own tab page.
int mainPageSize;
bool fits;
do {
PanelInstance lastAuto = null;
mainPageSize = 0;
foreach (PanelInstance pi in boxPanels) {
if (pi.Node.Grouping == PanelGrouping.Auto)
lastAuto = pi;
// HACK: This we are parenting/unparenting the widget here as a workaround
// for a layout issue. To properly calculate the size of the widget, the widget
// needs to have the style that it will have when added to the window.
pi.Widget.Parent = this;
mainPageSize += pi.Widget.SizeRequest ().Height + 6;
pi.Widget.Unparent ();
}
fits = mainPageSize <= pageFrame.Allocation.Height;
if (!fits) {
if (lastAuto != null && boxPanels.Count > 1) {
boxPanels.Remove (lastAuto);
tabPanels.Insert (0, lastAuto);
} else {
fits = true;
}
}
} while (!fits);
Gtk.VBox box = new VBox (false, 12);
box.Show ();
for (int n=0; n<boxPanels.Count; n++) {
if (n != 0) {
HSeparator sep = new HSeparator ();
sep.Show ();
box.PackStart (sep, false, false, 0);
}
PanelInstance pi = boxPanels [n];
box.PackStart (pi.Widget, pi.Node.Fill, pi.Node.Fill, 0);
pi.Widget.Show ();
}
box.BorderWidth = 12;
if (tabPanels.Count > 0) {
/* SquaredNotebook nb = new SquaredNotebook ();
nb.Show ();
nb.AddTab (box, GettextCatalog.GetString ("General"));
foreach (PanelInstance pi in tabPanels) {
Gtk.Alignment a = new Alignment (0, 0, 1, 1);
a.BorderWidth = 9;
a.Show ();
a.Add (pi.Widget);
nb.AddTab (a, GettextCatalog.GetString (pi.Node.Label));
pi.Widget.Show ();
}*/
Gtk.Notebook nb = new Notebook ();
nb.Show ();
Gtk.Label blab = new Gtk.Label (GettextCatalog.GetString ("General"));
blab.Show ();
box.BorderWidth = 9;
nb.InsertPage (box, blab, -1);
foreach (PanelInstance pi in tabPanels) {
Gtk.Label lab = new Gtk.Label (GettextCatalog.GetString (pi.Node.Label));
lab.Show ();
Gtk.Alignment a = new Alignment (0, 0, 1, 1);
a.BorderWidth = 9;
a.Show ();
a.Add (pi.Widget);
nb.InsertPage (a, lab, -1);
pi.Widget.Show ();
}
page.Widget = nb;
nb.BorderWidth = 12;
} else {
page.Widget = box;
}
}
示例12: ShowCalendar
public void ShowCalendar()
{
popup = new Window(WindowType.Popup);
popup.Screen = parent.Screen;
Frame frame = new Frame();
frame.Shadow = ShadowType.Out;
frame.Show();
popup.Add(frame);
VBox box = new VBox(false, 0);
box.Show();
frame.Add(box);
cal = new Calendar();
cal.DisplayOptions = CalendarDisplayOptions.ShowHeading
| CalendarDisplayOptions.ShowDayNames
| CalendarDisplayOptions.ShowWeekNumbers;
cal.KeyPressEvent += OnCalendarKeyPressed;
popup.ButtonPressEvent += OnButtonPressed;
cal.Show();
Alignment calAlignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
calAlignment.Show();
calAlignment.SetPadding(4, 4, 4, 4);
calAlignment.Add(cal);
box.PackStart(calAlignment, false, false, 0);
//Requisition req = SizeRequest();
parent.GdkWindow.GetOrigin(out xPos, out yPos);
// popup.Move(x + Allocation.X, y + Allocation.Y + req.Height + 3);
popup.Move(xPos, yPos);
popup.Show();
popup.GrabFocus();
Grab.Add(popup);
Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.GdkWindow, true,
Gdk.EventMask.ButtonPressMask
| Gdk.EventMask.ButtonReleaseMask
| Gdk.EventMask.PointerMotionMask, null, null, CURRENT_TIME);
if (grabbed == Gdk.GrabStatus.Success) {
grabbed = Gdk.Keyboard.Grab(popup.GdkWindow,
true, CURRENT_TIME);
if (grabbed != Gdk.GrabStatus.Success) {
Grab.Remove(popup);
popup.Destroy();
popup = null;
}
} else {
Grab.Remove(popup);
popup.Destroy();
popup = null;
}
cal.DaySelected += OnCalendarDaySelected;
cal.MonthChanged += OnCalendarMonthChanged;
cal.Date = date;
}
示例13: CreatePanelWidget
public override Widget CreatePanelWidget ()
{
HBox hbox = new HBox (false, 6);
Label label = new Label ();
label.MarkupWithMnemonic = GettextCatalog.GetString ("_Policy:");
hbox.PackStart (label, false, false, 0);
store = new ListStore (typeof (string), typeof (PolicySet));
policyCombo = new ComboBox (store);
CellRenderer renderer = new CellRendererText ();
policyCombo.PackStart (renderer, true);
policyCombo.AddAttribute (renderer, "text", 0);
label.MnemonicWidget = policyCombo;
policyCombo.RowSeparatorFunc = (TreeModel model, TreeIter iter) =>
((string) model.GetValue (iter, 0)) == "--";
hbox.PackStart (policyCombo, false, false, 0);
VBox vbox = new VBox (false, 6);
vbox.PackStart (hbox, false, false, 0);
vbox.ShowAll ();
notebook = new Notebook ();
// Get the panels for all mime types
List<string> types = new List<string> ();
types.AddRange (DesktopService.GetMimeTypeInheritanceChain (mimeType));
panelData.SectionLoaded = true;
panels = panelData.Panels;
foreach (IMimeTypePolicyOptionsPanel panel in panelData.Panels) {
panel.SetParentSection (this);
Widget child = panel.CreateMimePanelWidget ();
Label tlabel = new Label (panel.Label);
label.Show ();
child.Show ();
Alignment align = new Alignment (0.5f, 0.5f, 1f, 1f);
align.BorderWidth = 6;
align.Add (child);
align.Show ();
notebook.AppendPage (align, tlabel);
panel.LoadCurrentPolicy ();
}
notebook.Show ();
vbox.PackEnd (notebook, true, true, 0);
FillPolicies ();
policyCombo.Active = 0;
loading = false;
if (!isRoot && panelData.UseParentPolicy) {
//in this case "parent" is always first in the list
policyCombo.Active = 0;
notebook.Sensitive = false;
} else {
UpdateSelectedNamedPolicy ();
}
policyCombo.Changed += HandlePolicyComboChanged;
return vbox;
}
示例14: Build
void Build ()
{
Title = GettextCatalog.GetString ("Exception Caught");
DefaultWidth = 500;
DefaultHeight = 500;
HeightRequest = 350;
WidthRequest = 350;
VBox.Foreach (VBox.Remove);
VBox.PackStart (CreateExceptionHeader (), false, true, 0);
paned = new VPanedThin ();
paned.GrabAreaSize = 10;
paned.Pack1 (CreateStackTraceTreeView (), true, false);
paned.Pack2 (CreateExceptionValueTreeView (), true, false);
paned.Show ();
var vbox = new VBox (false, 0);
var whiteBackground = new EventBox ();
whiteBackground.Show ();
whiteBackground.ModifyBg (StateType.Normal, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor ());
whiteBackground.Add (vbox);
hadInnerException = HasInnerException ();
if (hadInnerException) {
vbox.PackStart (new VBox (), false, false, 6);
vbox.PackStart (CreateInnerExceptionMessage (), false, true, 0);
vbox.ShowAll ();
}
vbox.PackStart (paned, true, true, 0);
vbox.Show ();
if (hadInnerException) {
var box = new HBox ();
box.PackStart (CreateInnerExceptionsTree (), false, false, 0);
box.PackStart (whiteBackground, true, true, 0);
box.Show ();
VBox.PackStart (box, true, true, 0);
DefaultWidth = 900;
DefaultHeight = 700;
WidthRequest = 550;
HeightRequest = 450;
} else {
VBox.PackStart (whiteBackground, true, true, 0);
}
var actionArea = new HBox (false, 0) { BorderWidth = 14 };
OnlyShowMyCodeCheckbox = new CheckButton (GettextCatalog.GetString ("_Only show my code."));
OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
OnlyShowMyCodeCheckbox.Show ();
OnlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions ().ProjectAssembliesOnly;
var alignment = new Alignment (0.0f, 0.5f, 0.0f, 0.0f) { Child = OnlyShowMyCodeCheckbox };
alignment.Show ();
actionArea.PackStart (alignment, true, true, 0);
actionArea.PackStart (CreateButtonBox (), false, true, 0);
actionArea.PackStart (new VBox (), false, true, 3); // dummy just to take extra 6px at end to make it 20pixels
actionArea.ShowAll ();
VBox.PackStart (actionArea, false, true, 0);
}
示例15: DockMenu
public DockMenu (Gtk.Window parent) : base(Gtk.WindowType.Popup)
{
SetLight ();
AcceptFocus = false;
Decorated = false;
KeepAbove = true;
AppPaintable = true;
SkipPagerHint = true;
SkipTaskbarHint = true;
Resizable = false;
Modal = true;
TypeHint = WindowTypeHint.Dock;
AddEvents ((int) Gdk.EventMask.AllEventsMask);
this.SetCompositeColormap ();
Container = new Gtk.Alignment (0.5f, 0.5f, 0, 0);
Container.Show ();
Add (Container);
SetPadding ();
DockServices.Theme.ThemeChanged += DockyControllerThemeChanged;
Gdk.Screen.Default.CompositedChanged += HandleCompositedChanged;
}