本文整理汇总了C#中Gtk.Alignment.ShowAll方法的典型用法代码示例。如果您正苦于以下问题:C# Alignment.ShowAll方法的具体用法?C# Alignment.ShowAll怎么用?C# Alignment.ShowAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Alignment
的用法示例。
在下文中一共展示了Alignment.ShowAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoginDialog
public LoginDialog(Window parent, string errorMsg)
: base("Login", parent)
{
XML gxml = new XML(null, "MultiMC.GTKGUI.LoginDialog.glade",
"loginTable", null);
gxml.Autoconnect(this);
labelErrorMsg.Text = errorMsg;
Alignment loginAlign = new Alignment(0.5f, 0.5f, 1, 1);
loginAlign.Add(loginTable);
loginAlign.SetPadding(4, 4, 4, 4);
this.VBox.Add(loginAlign);
loginAlign.ShowAll();
okButton = this.AddButton("_OK", ResponseType.Ok) as Button;
cancelButton = this.AddButton("_Cancel", ResponseType.Cancel) as Button;
this.Default = okButton;
this.WidthRequest = 420;
labelErrorMsg.Visible = !string.IsNullOrEmpty(labelErrorMsg.Text);
entryPassword.Visibility = false;
}
示例2: Construct
protected void Construct (Widget buttonWidget, Menu menu, bool showArrow)
{
WidgetFlags |= WidgetFlags.NoWindow;
button_widget = buttonWidget;
Menu = menu;
toggle_button.Parent = this;
toggle_button.FocusOnClick = false;
toggle_button.Relief = ReliefStyle.None;
toggle_button.Pressed += delegate { ShowMenu (); toggle_button.Active = true; };
toggle_button.Activated += delegate { ShowMenu (); };
box.Parent = this;
if (showArrow) {
box.PackStart (button_widget, true, true, 0);
alignment = new Alignment (0f, 0.5f, 0f, 0f);
arrow = new Arrow (ArrowType.Down, ShadowType.None);
alignment.Add (arrow);
box.PackStart (alignment, false, false, 5);
size_widget = box;
FocusChain = new Widget[] {toggle_button, box};
alignment.ShowAll ();
alignment.NoShowAll = true;
} else {
toggle_button.Add (button_widget);
size_widget = toggle_button;
}
ShowAll ();
}
示例3: DocumentOutlinePad
public DocumentOutlinePad ()
{
box = new Gtk.Alignment (0, 0, 1, 1);
box.BorderWidth = 0;
SetWidget (null);
box.ShowAll ();
}
示例4: MeeGoHeaderBox
public MeeGoHeaderBox ()
{
BorderWidth = 5;
Spacing = 5;
RedrawOnAllocate = true;
AppPaintable = true;
header = new Alignment (0.0f, 0.5f, 1.0f, 1.0f) {
LeftPadding = 10,
RightPadding = 10,
TopPadding = 5,
BottomPadding = 5
};
header_label = new Label () { Xalign = 0.0f };
header.Add (header_label);
header.ShowAll ();
PackStart (header, false, false, 0);
}
示例5: TileTemplate
public TileTemplate (Beagle.Hit hit, Beagle.Query query) : base (hit, query)
{
Alignment alignment = new Alignment (0.0f, 0.5f, 1.0f, 0.0f);
HBox.PackStart (alignment, true, true, 0);
VBox vbox = new VBox (false, 0);
alignment.Add (vbox);
title_label = WidgetFu.NewLabel ();
title_label.LineWrap = true;
WidgetFu.EllipsizeLabel (title_label, 30);
vbox.PackStart (title_label, false, false, 0);
desc_label = WidgetFu.NewGrayLabel ();
desc_label.NoShowAll = true;
WidgetFu.EllipsizeLabel (desc_label, 30);
vbox.PackStart (desc_label, false, false, 0);
alignment.ShowAll ();
}
示例6: StatusArea
public StatusArea()
{
theme = new StatusAreaTheme ();
renderArg = new RenderArg ();
mainContext = new MainStatusBarContextImpl (this);
activeContext = mainContext;
contexts.Add (mainContext);
VisibleWindow = false;
NoShowAll = true;
WidgetFlags |= Gtk.WidgetFlags.AppPaintable;
statusIconBox.BorderWidth = 0;
statusIconBox.Spacing = 3;
Action<bool> animateProgressBar =
showing => this.Animate ("ProgressBarFade",
val => renderArg.ProgressBarAlpha = val,
renderArg.ProgressBarAlpha,
showing ? 1.0f : 0.0f,
easing: Easing.CubicInOut);
ProgressBegin += delegate {
renderArg.ShowProgressBar = true;
// StartBuildAnimation ();
renderArg.ProgressBarFraction = 0;
QueueDraw ();
animateProgressBar (true);
};
ProgressEnd += delegate {
renderArg.ShowProgressBar = false;
// StopBuildAnimation ();
QueueDraw ();
animateProgressBar (false);
};
ProgressFraction += delegate(object sender, FractionEventArgs e) {
renderArg.ProgressBarFraction = (float)e.Work;
QueueDraw ();
};
contentBox.PackStart (messageBox, true, true, 0);
contentBox.PackEnd (statusIconBox, false, false, 0);
contentBox.PackEnd (statusIconSeparator = new StatusAreaSeparator (), false, false, 0);
contentBox.PackEnd (buildResultWidget = CreateBuildResultsWidget (Orientation.Horizontal), false, false, 0);
HasTooltip = true;
QueryTooltip += messageBoxToolTip;
mainAlign = new Alignment (0, 0.5f, 1, 0);
mainAlign.LeftPadding = 12;
mainAlign.RightPadding = 8;
mainAlign.Add (contentBox);
Add (mainAlign);
mainAlign.ShowAll ();
statusIconBox.Hide ();
statusIconSeparator.Hide ();
buildResultWidget.Hide ();
Show ();
this.ButtonPressEvent += delegate {
if (sourcePad != null)
sourcePad.BringToFront (true);
};
statusIconBox.Shown += delegate {
UpdateSeparators ();
};
statusIconBox.Hidden += delegate {
UpdateSeparators ();
};
messageQueue = new Queue<Message> ();
tracker = new MouseTracker(this);
tracker.MouseMoved += (sender, e) => QueueDraw ();
tracker.HoveredChanged += (sender, e) => {
this.Animate ("Hovered",
x => renderArg.HoverProgress = x,
renderArg.HoverProgress,
tracker.Hovered ? 1.0f : 0.0f,
easing: Easing.SinInOut);
};
IdeApp.FocusIn += delegate {
// If there was an error while the application didn't have the focus,
// trigger the error animation again when it gains the focus
if (errorAnimPending) {
errorAnimPending = false;
TriggerErrorAnimation ();
}
};
}
示例7: UpdateTab
public void UpdateTab()
{
if (Child != null) {
Widget w = Child;
Remove (w);
w.Destroy ();
}
mainBox = new Alignment (0,0,1,1);
if (bar.Orientation == Gtk.Orientation.Horizontal) {
box = new HBox ();
mainBox.LeftPadding = mainBox.RightPadding = 2;
}
else {
box = new VBox ();
mainBox.TopPadding = mainBox.BottomPadding = 2;
}
Gtk.Widget customLabel = null;
if (it.DockLabelProvider != null)
customLabel = it.DockLabelProvider.CreateLabel (bar.Orientation);
if (customLabel != null) {
customLabel.ShowAll ();
box.PackStart (customLabel, true, true, 0);
}
else {
if (it.Icon != null)
box.PackStart (new Gtk.Image (it.Icon), false, false, 0);
if (!string.IsNullOrEmpty (it.Label)) {
label = new Gtk.Label (it.Label);
label.UseMarkup = true;
if (bar.Orientation == Gtk.Orientation.Vertical)
label.Angle = 270;
box.PackStart (label, true, true, 0);
} else
label = null;
}
box.BorderWidth = 2;
box.Spacing = 2;
mainBox.Add (box);
mainBox.ShowAll ();
Add (mainBox);
SetNormalColor ();
}
示例8: ShowConnectingDialog
void ShowConnectingDialog(RemoteDebuggerStartInfo dsi)
{
string message = GetConnectingMessage (dsi);
Gtk.Application.Invoke (delegate {
if (VirtualMachine != null || Exited)
return;
dialog = new Gtk.Dialog () {
Title = "Waiting for debugger"
};
var label = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f) {
Child = new Gtk.Label (message),
BorderWidth = 12
};
dialog.VBox.PackStart (label);
label.ShowAll ();
dialog.AddButton ("Cancel", Gtk.ResponseType.Cancel);
int response = MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog);
dialog = null;
if (response != (int) Gtk.ResponseType.Ok) {
EndSession ();
}
});
}
示例9: BuildLayout
void BuildLayout ()
{
var primary_vbox = new VBox () {
Spacing = 6
};
// Source selector
var combo_align = new Alignment (0, .5f, 0, 0);
var combo_hbox = new HBox (false, 6);
combo_hbox.Add (new Label (Catalog.GetString ("Import from:")));
sources_combo = new ComboBox (sources_model);
var render = new CellRendererText ();
sources_combo.PackStart (render, true);
sources_combo.SetAttributes (render, "text", 1);
combo_hbox.Add (sources_combo);
combo_align.Add (combo_hbox);
combo_align.ShowAll ();
primary_vbox.Add (combo_align);
// Button row near the top
var align = new Alignment (1, .5f, 0, 0);
var button_box = new HButtonBox () {
Spacing = 6
};
button_box.Add (cancel_button = new Button (Stock.Cancel));
button_box.Add (import_button = new Button (Stock.Add));
align.Add (button_box);
align.ShowAll ();
primary_vbox.Add (align);
primary_vbox.Show ();
Add (primary_vbox);
}
示例10: BuildWidget
private void BuildWidget ()
{
alignment = new Alignment (0.5f, 0.5f, 1f, 0f);
alignment.SetPadding (1, 1, 3, 3);
VisibleWindow = false;
box = new HBox ();
entry = new FramelessEntry (this);
filter_button = new HoverImageButton (IconSize.Menu, "md-searchbox-search");
clear_button = new HoverImageButton (IconSize.Menu, "md-searchbox-clear");
entryAlignment = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f);
alignment.SetPadding (0, 0, 3, 3);
entryAlignment.Add (entry);
box.PackStart (filter_button, false, false, 0);
box.PackStart (entryAlignment, true, true, 0);
box.PackStart (clear_button, false, false, 0);
alignment.Add (box);
Add (alignment);
alignment.ShowAll ();
entry.StyleSet += OnInnerEntryStyleSet;
entry.StateChanged += OnInnerEntryStateChanged;
entry.FocusInEvent += OnInnerEntryFocusEvent;
entry.FocusOutEvent += OnInnerEntryFocusEvent;
entry.Changed += OnInnerEntryChanged;
entry.Activated += delegate {
NotifyActivated ();
};
filter_button.Image.Xpad = 0;
clear_button.Image.Xpad = 0;
filter_button.CanFocus = false;
clear_button.CanFocus = false;
filter_button.ButtonReleaseEvent += OnButtonReleaseEvent;
clear_button.ButtonReleaseEvent += OnButtonReleaseEvent;
clear_button.Clicked += OnClearButtonClicked;
ShowHideButtons ();
}
示例11: ConfirmUnmap
private static bool ConfirmUnmap (IUnmapableSource source)
{
string key = "no_confirm_unmap_" + source.GetType ().Name.ToLower ();
bool do_not_ask = ConfigurationClient.Get<bool> ("sources", key, false);
if (do_not_ask) {
return true;
}
Hyena.Widgets.HigMessageDialog dialog = new Hyena.Widgets.HigMessageDialog (
ServiceManager.Get<GtkElementsService> ().PrimaryWindow,
Gtk.DialogFlags.Modal,
Gtk.MessageType.Question,
Gtk.ButtonsType.Cancel,
String.Format (Catalog.GetString ("Are you sure you want to delete this {0}?"),
source.GenericName.ToLower ()),
source.Name);
dialog.AddButton (Gtk.Stock.Delete, Gtk.ResponseType.Ok, false);
Gtk.Alignment alignment = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 0.0f);
alignment.TopPadding = 10;
Gtk.CheckButton confirm_button = new Gtk.CheckButton (String.Format (Catalog.GetString (
"Do not ask me this again"), source.GenericName.ToLower ()));
confirm_button.Toggled += delegate {
do_not_ask = confirm_button.Active;
};
alignment.Add (confirm_button);
alignment.ShowAll ();
dialog.LabelVBox.PackStart (alignment, false, false, 0);
try {
if (dialog.Run () == (int)Gtk.ResponseType.Ok) {
ConfigurationClient.Set<bool> ("sources", key, do_not_ask);
return true;
}
return false;
} finally {
dialog.Destroy ();
}
}
示例12: UpdateTab
public void UpdateTab ()
{
if (Child != null) {
Widget w = Child;
Remove (w);
w.Destroy ();
}
mainBox = new Alignment (0,0,1,1);
if (bar.Orientation == Gtk.Orientation.Horizontal) {
box = new HBox ();
if (bar.AlignToEnd)
mainBox.SetPadding (3, 3, 11, 9);
else
mainBox.SetPadding (3, 3, 9, 11);
}
else {
box = new VBox ();
if (bar.AlignToEnd)
mainBox.SetPadding (11, 9, 3, 3);
else
mainBox.SetPadding (9, 11, 3, 3);
}
Gtk.Widget customLabel = null;
if (it.DockLabelProvider != null)
customLabel = it.DockLabelProvider.CreateLabel (bar.Orientation);
if (customLabel != null) {
customLabel.ShowAll ();
box.PackStart (customLabel, true, true, 0);
}
else {
if (it.Icon != null) {
var desat = it.Icon.WithAlpha (0.5);
crossfade = new CrossfadeIcon (desat, it.Icon);
box.PackStart (crossfade, false, false, 0);
desat.Dispose ();
}
if (!string.IsNullOrEmpty (it.Label)) {
label = new Gtk.Label (it.Label);
label.UseMarkup = true;
if (bar.Orientation == Gtk.Orientation.Vertical)
label.Angle = 270;
box.PackStart (label, true, true, 0);
} else
label = null;
}
box.Spacing = 2;
mainBox.Add (box);
mainBox.ShowAll ();
Add (mainBox);
QueueDraw ();
}
示例13: create_element
private Gtk.HBox create_element(Item item, string search_text, string snippet_text, VoidFunction update)
{
Gtk.HBox element = new Gtk.HBox();
Gtk.VBox lines = new Gtk.VBox();
Gtk.HBox title_date = new Gtk.HBox();
Gtk.EventBox title_wrapper = new Gtk.EventBox();
Gtk.Label title = new Gtk.Label();
string str_title = item.name(40);
string capitalized = search_text.Substring(0, 1).ToUpper() + search_text.Substring(1);
if (str_title.Contains(search_text)) {
int index = str_title.IndexOf(search_text);
str_title = str_title.Substring(0, index) + "<b>" + search_text + "</b>" + str_title.Substring(index+search_text.Length);
} else if (str_title.Contains(capitalized)) {
int index = str_title.IndexOf(capitalized);
str_title = str_title.Substring(0, index) + "<b>" + capitalized + "</b>" + str_title.Substring(index+capitalized.Length);
}
title.Markup = "<big>" + str_title + "</big>";
title.UseUnderline = false;
title.SetAlignment(0, 0); // left aligned
title_wrapper.ButtonPressEvent += delegate(object sender, Gtk.ButtonPressEventArgs args) {
if (args.Event.Button == 1)
item.open();
};
title_wrapper.Add(title);
GtkCommon.set_background_color(title_wrapper, "white");
GtkCommon.show_hand_and_tooltip(title_wrapper, String.Format(Mono.Unix.Catalog.GetString("Open: {0}"), item.long_name));
GtkCommon.create_preview(item, lines, title_wrapper);
title_date.PackStart(title_wrapper, true, true, 0);
Gtk.Alignment date_alignment = new Gtk.Alignment(1, 0, 0, 0);
Gtk.Label date = new Gtk.Label();
date.Markup = "<big>" + String.Format("{0:dd/MM/yy}", item.last_modify) + "</big>";
date_alignment.Add(date);
date_alignment.LeftPadding = 10;
title_date.PackStart(date_alignment, true, true, 0);
lines.PackStart(title_date, true, true, 0);
try {
DocumentItem doc_item = item as DocumentItem;
if (doc_item != null) {
doc_item.on_snippet_callback = delegate (string snippet) {
if (!String.IsNullOrEmpty(snippet)) {
System.Console.WriteLine("got snippet: {0}", snippet);
Gtk.Label snippet_label = new Gtk.Label();
snippet_label.SetAlignment(0, 0); // left aligned
snippet_label.Markup = snippet;
lines.PackStart(snippet_label, true, true, 2);
lines.ReorderChild(snippet_label, 1);
update();
}
};
if (!String.IsNullOrEmpty(doc_item.snippet))
doc_item.on_snippet_callback(doc_item.snippet);
}
} catch (Exception) { // not document item
}
Gtk.HBox label_links = new Gtk.HBox();
Gtk.HBox bubbles = new Gtk.HBox();
foreach (UserLabel label in item.labels)
bubbles.Add(label.dot());
label_links.PackStart(bubbles, false, false, 0);
item.on_labels_callback = delegate() {
foreach (Widget w in bubbles)
w.Destroy();
foreach (UserLabel label in item.labels)
bubbles.Add(label.dot());
element.ShowAll();
};
Gtk.Alignment links_alignment = new Gtk.Alignment(1,1,0,0);
Gtk.HBox links = new Gtk.HBox();
add_link(Mono.Unix.Catalog.GetString("Go to week"), CalendarDriver.View.Week, item.last_modify, links);
add_link(Mono.Unix.Catalog.GetString("Go to month"), CalendarDriver.View.Month, item.last_modify, links);
add_link(Mono.Unix.Catalog.GetString("Go to year"), CalendarDriver.View.Year, item.last_modify, links);
links_alignment.Add(links);
label_links.PackStart(links_alignment, true, true, 0);
//.........这里部分代码省略.........
示例14: Clicked
public override void Clicked()
{
Window w = new Window("Maple Appearance Locations");
var minimapContainer = new Alignment(1.0f,1.0f,1.0f,1.0f);
ComboBox comboBox = new ComboBox(
new string[] {
"Present (Ricky)",
"Present (Dimitri)",
"Present (Moosh)",
"Past"
});
comboBox.Changed += (a,b) => {
int i = comboBox.Active;
Data data;
Map map;
if (i == 3) {
data = Project.GetData("maplePastLocations");
map = Project.GetIndexedDataType<WorldMap>(1);
}
else {
data = Project.GetData(Project.GetData("maplePresentLocationsTable", i*2).GetValue(0));
map = Project.GetIndexedDataType<WorldMap>(0);
}
var minimap = new MyMinimap(data);
minimap.Width = map.MapWidth;
minimap.Height = map.MapHeight;
minimap.SetMap(map);
minimap.Selectable = false;
minimapContainer.Remove(minimapContainer.Child);
minimapContainer.Add(minimap);
minimapContainer.ShowAll();
};
if (manager.GetActiveMap().Group == 1)
comboBox.Active = 3;
else
comboBox.Active = 0;
VBox vbox = new VBox();
vbox.Add(comboBox);
vbox.Add(minimapContainer);
w.Add(vbox);
w.ShowAll();
}
示例15: BuildViews
private void BuildViews()
{
VBox source_box = new VBox ();
source_box.PackStart (new UserJobTileHost (), false, false, 0);
view_container = new ViewContainer ();
composite_view = new LtrTrackSourceContents ();
composite_view.TrackView.HeaderVisible = false;
view_container.Content = composite_view;
view_container.Show ();
view_box = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
view_box.Add (view_container);
view_box.ShowAll ();
primary_vbox.PackStart (view_box, true, true, 0);
}