本文整理汇总了C#中Gtk.Alignment.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Alignment.Add方法的具体用法?C# Alignment.Add怎么用?C# Alignment.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Alignment
的用法示例。
在下文中一共展示了Alignment.Add方法的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: InfoBar
public InfoBar()
: base()
{
// top panel bar
Image close = new Image (Stock.Close, IconSize.Menu);
close_box.Realized += close_box_realized;
close_box.ButtonReleaseEvent += close_box_released;
close_box.Add (close);
Label title = new Label ();
title.Markup = "<small>Information Bar</small>";
title.Angle = 90;
VBox left_box = new VBox (false, 0);
left_box.PackStart (button_box, false, false, 0);
left_box.PackStart (title, true, true, 0);
Alignment align = new Alignment (1, 0.5f, 0, 0);
align.Add (close_box);
HBox panel_header = new HBox (false, 0);
panel_header.PackStart (custom_align, true, true, 0);
panel_header.PackStart (align, false, false, 0);
panel_box.PackStart (panel_header, false, false, 0);
panel_frame.Add (panel_box);
main_box.PackStart (left_box, false, false, 0);
this.PackStart (main_box, true, true, 0);
addInfoPanel (new Lyrics (this), "Lyrics");
addInfoPanel (new ArtistInfo (this), "Artist Info");
addInfoPanel (new Profile (this), "Profile");
}
示例3: AddMessage
public void AddMessage (string msg, string icon)
{
if (lastImage != null) {
HSeparator sep = new HSeparator ();
sep.Show ();
msgBox.PackStart (sep);
lastImage.IconSize = (int) Gtk.IconSize.Button;
}
HBox box = new HBox ();
box.Spacing = 12;
Alignment imgBox = new Alignment (0, 0, 0, 0);
Image img = new Image (icon, lastImage != null ? Gtk.IconSize.Button : IconSize.Dialog);
imgBox.Add (img);
lastImage = img;
box.PackStart (imgBox, false, false, 0);
Label lab = new Label (msg);
lab.Xalign = 0;
lab.Yalign = 0;
lab.Wrap = true;
lab.WidthRequest = 500;
box.PackStart (lab, true, true, 0);
msgBox.PackStart (box, false, false, 0);
box.ShowAll ();
}
示例4: ThemeTestModule
public ThemeTestModule()
: base("Theme")
{
var align = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
var theme_widget = new ThemeTestWidget ();
align.Add (theme_widget);
Add (align);
ShowAll ();
int state = 0;
uint[,] borders = {
{0, 0, 0, 0},
{10, 0, 0, 0},
{0, 10, 0, 0},
{0, 0, 10, 0},
{0, 0, 0, 10},
{10, 10, 0, 0},
{10, 10, 10, 0},
{10, 10, 10, 10},
{10, 0, 0, 10},
{0, 10, 10, 0}
};
GLib.Timeout.Add (2000, delegate {
Console.WriteLine (state);
align.TopPadding = borders[state, 0];
align.RightPadding = borders[state, 1];
align.BottomPadding = borders[state, 2];
align.LeftPadding = borders[state, 3];
if (++state % borders.GetLength (0) == 0) {
state = 0;
}
return true;
});
}
示例5: 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;
}
示例6: BuildWidget
private void BuildWidget ()
{
HBox box = new HBox ();
disk_bar_align = new Alignment (0.5f, 0.5f, 1.0f, 1.0f);
disk_bar = new SegmentedBar ();
disk_bar.ValueFormatter = DapValueFormatter;
disk_bar.AddSegmentRgb (Catalog.GetString ("Audio"), 0, 0x3465a4);
disk_bar.AddSegmentRgb (Catalog.GetString ("Video"), 0, 0x73d216);
disk_bar.AddSegmentRgb (Catalog.GetString ("Other"), 0, 0xf57900);
disk_bar.AddSegment (Catalog.GetString ("Free Space"), 0, disk_bar.RemainderColor, false);
UpdateUsage ();
disk_bar_align.Add (disk_bar);
box.PackStart (disk_bar_align, true, true, 0);
disk_bar_align.TopPadding = 6;
Add (box);
box.ShowAll ();
SizeAllocated += delegate (object o, Gtk.SizeAllocatedArgs args) {
SetBackground ();
disk_bar.HorizontalPadding = (int)(args.Allocation.Width * 0.25);
};
}
示例7: BuildContent
protected override void BuildContent (Container parent)
{
LogoImage = Xwt.Drawing.Image.FromResource ("WelcomePage_Logo.png");
TopBorderImage = Xwt.Drawing.Image.FromResource ("WelcomePage_TopBorderRepeat.png");
var mainAlignment = new Gtk.Alignment (0.5f, 0.5f, 0f, 1f);
var mainCol = new WelcomePageColumn ();
mainAlignment.Add (mainCol);
var row1 = new WelcomePageRow ();
row1.PackStart (new WelcomePageButtonBar (
new WelcomePageBarButton ("Haxe.org", "http://www.haxe.org", "link-cloud.png"),
new WelcomePageBarButton (GettextCatalog.GetString ("Documentation"), "http://www.http://haxe.org/doc", "link-info.png"),
new WelcomePageBarButton (GettextCatalog.GetString ("Support"), "https://groups.google.com/forum/#!forum/haxelang", "link-heart.png"),
new WelcomePageBarButton (GettextCatalog.GetString ("Q&A"), "https://groups.google.com/forum/#!forum/haxelang", "link-chat.png")
)
);
mainCol.PackStart (row1, false, false, 0);
var row2 = new WelcomePageRow (
new WelcomePageColumn (
new WelcomePageRecentProjectsList (GettextCatalog.GetString ("Solutions"))
),
new WelcomePageColumn (
new WelcomePageNewsFeed (GettextCatalog.GetString ("Haxe News"), "http://software.xamarin.com/Service/News", "NewsLinks")
),
new WelcomePageColumn (
new WelcomePageTipOfTheDaySection ()
)
);
mainCol.PackStart (row2, false, false, 0);
parent.Add (mainAlignment);
}
示例8: DemoColorSelection
public DemoColorSelection () : base ("Color Selection")
{
BorderWidth = 8;
VBox vbox = new VBox (false,8);
vbox.BorderWidth = 8;
Add (vbox);
// Create the color swatch area
Frame frame = new Frame ();
frame.ShadowType = ShadowType.In;
vbox.PackStart (frame, true, true, 0);
drawingArea = new DrawingArea ();
// set a minimum size
drawingArea.SetSizeRequest (200,200);
// set the color
color.Red = 0;
color.Green = 0;
color.Blue = 1;
color.Alpha = 1;
drawingArea.OverrideBackgroundColor (StateFlags.Normal, color);
frame.Add (drawingArea);
Alignment alignment = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
Button button = new Button ("_Change the above color");
button.Clicked += new EventHandler (ChangeColorCallback);
alignment.Add (button);
vbox.PackStart (alignment, false, false, 0);
ShowAll ();
}
示例9: MainWindow_2
public MainWindow_2()
: base("Allignment")
{
SetDefaultSize(260, 150);
SetPosition(WindowPosition.Center);
DeleteEvent += delegate { Application.Quit(); };
VBox vbox = new VBox(false, 5);
HBox hbox = new HBox(true, 3);
Alignment valign = new Alignment(0, 0.5f, 0, 0);
vbox.PackStart(valign);
Button ok = new Button("OK");
ok.SetSizeRequest(70, 30);
Button close = new Button("Close");
hbox.Add(ok);
hbox.Add(close);
Alignment halign = new Alignment(0.5f, 0, 0, 0);
halign.Add(hbox);
vbox.PackStart(halign, false, false, 3);
Add(vbox);
ShowAll();
}
示例10: ArtistInfoHelp
public ArtistInfoHelp()
: base(false, 0)
{
Label title = new Label ();
Label details1 = new Label ();
Label details2 = new Label ();
Label details3 = new Label ();
title.Markup = "<b><big><big>Artist Info</big></big></b>";
details1.Markup = "This panel displays information about the currently playing artist such as:";
details2.Markup = "<i>Similar Artists\nSimilar Tracks\nTop Albums\nTop Tracks\nAlbum Details</i>";
details3.Markup = "You can also search for an artist below";
details1.Wrap = true;
details2.Wrap = true;
details3.Wrap = true;
VBox details_box = new VBox (false, 0);
details_box.PackStart (details1, false, false, 0);
details_box.PackStart (details2, false, false, 2);
details_box.PackStart (details3, false, false, 40);
Alignment align = new Alignment (0.5f, 0.5f, 0, 0);
align.Add (details_box);
this.PackStart (title, false, false, 0);
this.PackStart (new HSeparator (), false, false, 5);
this.PackStart (align, true, true, 0);
this.PackStart (new Image (null, "audioscrobbler-logo.png"), false, false, 0);
}
示例11: 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 ();
}
示例12: GetDisplayWidget
public override Gtk.Widget GetDisplayWidget()
{
DrawingArea colorPreview = new DrawingArea ();
colorPreview.ModifyBg(StateType.Normal, GetColor ());
colorPreview.WidthRequest = 15;
Alignment colorPreviewAlign = new Alignment (0, 0, 0, 1);
colorPreviewAlign.SetPadding (2, 2, 2, 2);
colorPreviewAlign.Add (colorPreview);
string labelText;
System.Drawing.Color color = (System.Drawing.Color) parentRow.PropertyValue;
//TODO: dropdown known color selector so this does something
if (color.IsKnownColor)
labelText = color.Name;
else if (color.IsEmpty)
labelText = "[empty]";
else
labelText = String.Format("#{0:x2}{1:x2}{2:x2}", color.R, color.G, color.B);
//we use StringValue as it auto-bolds the text for non-default values
Label theLabel = (Label) base.StringValue (labelText);
theLabel.Xalign = 0;
theLabel.Xpad = 3;
HBox hbox = new HBox ();
hbox.PackStart (colorPreviewAlign, false, false, 0);
hbox.PackStart (theLabel, true, true, 0);
return hbox;
}
示例13: AddMessage
public void AddMessage (string msg, IconId icon)
{
if (lastImage != null) {
HSeparator sep = new HSeparator ();
sep.Show ();
msgBox.PackStart (sep, false, false, 0);
lastImage.IconSize = Gtk.IconSize.Menu;
}
HBox box = new HBox ();
box.Spacing = 12;
Alignment imgBox = new Alignment (0, 0, 0, 0);
var img = new ImageView (icon, lastImage != null ? Gtk.IconSize.Menu : IconSize.Dialog);
imgBox.Add (img);
lastImage = img;
box.PackStart (imgBox, false, false, 0);
Label lab = new Label (msg);
lab.UseUnderline = false;
lab.Xalign = 0;
lab.Yalign = 0;
lab.Wrap = true;
lab.WidthRequest = 500;
box.PackStart (lab, true, true, 0);
msgBox.PackStart (box, false, false, 0);
box.ShowAll ();
}
示例14: NotificationMessage
public NotificationMessage (string t, string m) : base (false, 5)
{
this.Style = style;
BorderWidth = 5;
icon = new Image (Stock.DialogInfo, IconSize.Dialog);
this.PackStart (icon, false, true, 5);
VBox vbox = new VBox (false, 5);
this.PackStart (vbox, true, true, 0);
title = new Label ();
title.SetAlignment (0.0f, 0.5f);
this.Title = t;
vbox.PackStart (title, false, true, 0);
message = new Label ();
message.LineWrap = true;
message.SetSizeRequest (500, -1); // ugh, no way to sanely reflow a gtk label
message.SetAlignment (0.0f, 0.0f);
this.Message = m;
vbox.PackStart (message, true, true, 0);
action_box = new HBox (false, 3);
Button hide_button = new Button (Catalog.GetString ("Hide"));
hide_button.Clicked += OnHideClicked;
action_box.PackEnd (hide_button, false, true, 0);
Alignment action_align = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
action_align.Add (action_box);
vbox.PackStart (action_align, false, true, 0);
}
示例15: BuildInterface
private void BuildInterface ()
{
NoShowAll = true;
Alignment matchesAlignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
matchesAlignment.SetPadding (5, 5, 5, 5);
matchesAlignment.Add (terms_box);
matchesFrame = new Frame (null);
matchesFrame.Add (matchesAlignment);
matchesFrame.LabelWidget = BuildMatchHeader ();
matchesFrame.ShowAll ();
terms_entry_box = new HBox ();
terms_entry_box.Spacing = 8;
terms_entry_box.PackStart (new Label (Catalog.GetString ("Condition:")), false, false, 0);
terms_entry = new Entry ();
terms_entry_box.PackStart (terms_entry, true, true, 0);
limit_box.ShowAll ();
PackStart(matchesFrame, true, true, 0);
PackStart(terms_entry_box, false, false, 0);
PackStart(limit_box, false, false, 0);
//ShowAll ();
}