本文整理汇总了C#中Gtk.Alignment类的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Alignment类的具体用法?C# Gtk.Alignment怎么用?C# Gtk.Alignment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Gtk.Alignment类属于命名空间,在下文中一共展示了Gtk.Alignment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DocumentOutlinePad
public DocumentOutlinePad ()
{
box = new Gtk.Alignment (0, 0, 1, 1);
box.BorderWidth = 0;
SetEmptyWidget ();
box.ShowAll ();
}
示例2: Build
protected virtual void Build()
{
Stetic.Gui.Initialize(this);
// Widget ocmgtk.OCMSplash
this.WidthRequest = 744;
this.HeightRequest = 600;
this.Name = "ocmgtk.OCMSplash";
this.Title = Mono.Unix.Catalog.GetString("OCMSplash");
this.TypeHint = ((Gdk.WindowTypeHint)(4));
this.WindowPosition = ((Gtk.WindowPosition)(3));
this.Resizable = false;
this.AllowGrow = false;
this.Decorated = false;
// Container child ocmgtk.OCMSplash.Gtk.Container+ContainerChild
this.splashVBox = new Gtk.VBox();
this.splashVBox.Name = "splashVBox";
this.splashVBox.Spacing = 6;
// Container child splashVBox.Gtk.Box+BoxChild
this.labelAlignment = new Gtk.Alignment(0F, 0F, 1F, 1F);
this.labelAlignment.Name = "labelAlignment";
this.labelAlignment.LeftPadding = ((uint)(120));
this.labelAlignment.TopPadding = ((uint)(430));
// Container child labelAlignment.Gtk.Container+ContainerChild
this.versionLabel = new Gtk.Label();
this.versionLabel.Name = "versionLabel";
this.versionLabel.Xalign = 0F;
this.versionLabel.Yalign = 0F;
this.versionLabel.LabelProp = "<b><big>Version XXX</big></b>\n<small>Copyright (c) Kyle Campbell 2010-2011</small>";
this.versionLabel.UseMarkup = true;
this.labelAlignment.Add(this.versionLabel);
this.splashVBox.Add(this.labelAlignment);
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.splashVBox[this.labelAlignment]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
// Container child splashVBox.Gtk.Box+BoxChild
this.progressAlign = new Gtk.Alignment(0F, 0F, 1F, 1F);
this.progressAlign.Name = "progressAlign";
this.progressAlign.LeftPadding = ((uint)(120));
this.progressAlign.RightPadding = ((uint)(400));
// Container child progressAlign.Gtk.Container+ContainerChild
this.loadProgress = new Gtk.ProgressBar();
this.loadProgress.WidthRequest = 100;
this.loadProgress.HeightRequest = 10;
this.loadProgress.Name = "loadProgress";
this.progressAlign.Add(this.loadProgress);
this.splashVBox.Add(this.progressAlign);
Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.splashVBox[this.progressAlign]));
w4.Position = 1;
w4.Expand = false;
w4.Fill = false;
this.Add(this.splashVBox);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.DefaultWidth = 786;
this.DefaultHeight = 627;
this.Show();
}
示例3: CreateMainLayout
protected virtual Gtk.Widget CreateMainLayout ()
{
mainBox = new Gtk.VBox ();
mainBox.Show ();
alignment = new RootWindowAlignment (this);
mainBox.PackStart (alignment, true, true, 0);
alignment.Show ();
return mainBox;
}
示例4: WindowBackend
public WindowBackend()
{
Window = new Gtk.Window ("");
mainBox = new Gtk.VBox ();
Window.Add (mainBox);
mainBox.Show ();
alignment = new Gtk.Alignment (0, 0, 1, 1);
mainBox.PackStart (alignment, true, true, 0);
alignment.Show ();
}
示例5: AddLabel
void AddLabel ()
{
if (label == null) {
Gtk.Alignment al = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f);
al.SetPadding (6, 6, 6, 6);
label = new Gtk.Label ();
al.Add (label);
ContentBox.Add (al);
al.ShowAll ();
}
}
示例6: MultipleObjectViewer
protected MultipleObjectViewer(IBroadcaster hub, string caption)
: base(false, 0)
{
_hub = hub;
// --- first line: caption and buttons
Gtk.HBox hbxFirstLine = new Gtk.HBox(false, 2);
// Caption label
Gtk.Alignment labelAlign = new Gtk.Alignment(0F, 0F, 1F, 1F);
labelAlign.Add(new Gtk.Label(caption));
hbxFirstLine.PackStart(labelAlign, false, false, 0);
hbxFirstLine.PackStart(new Gtk.Label(String.Empty), true, true, 0);
// "Add" button
Gtk.Image image = new Gtk.Image();
image.Stock = Gtk.Stock.Add;
_btnAdd = new Gtk.Button();
_btnAdd.Add(image);
_btnAdd.Relief = Gtk.ReliefStyle.None;
_btnAdd.Clicked += new EventHandler(OnAddButtonClicked);
_btnAdd.Sensitive = false;
hbxFirstLine.PackStart(_btnAdd, false, false, 0);
// "Edit" button
image = new Gtk.Image();
image.Stock = Gtk.Stock.JumpTo;
_btnEdit = new Gtk.Button();
_btnEdit.Add(image);
_btnEdit.Relief = Gtk.ReliefStyle.None;
_btnEdit.Clicked += new EventHandler(OnEditButtonClicked);
_btnEdit.Sensitive = false;
hbxFirstLine.PackStart(_btnEdit, false, false, 0);
// "Delete" button
image = new Gtk.Image();
image.Stock = Gtk.Stock.Remove;
_btnDelete = new Gtk.Button();
_btnDelete.Add(image);
_btnDelete.Relief = Gtk.ReliefStyle.None;
_btnDelete.Clicked += new EventHandler(OnDeleteButtonClicked);
_btnDelete.Sensitive = false;
hbxFirstLine.PackStart(_btnDelete, false, false, 0);
base.PackStart(hbxFirstLine, false, false, 0);
// --- second line: element list
_store = new Gtk.TreeStore(typeof(string));
_tvList = new Gtk.TreeView();
_tvList.HeadersVisible = false;
_tvList.AppendColumn("", new Gtk.CellRendererText(), "text", 0);
_tvList.Model = _store;
_tvList.FocusInEvent += new Gtk.FocusInEventHandler(EnableButtons);
_tvList.ButtonPressEvent += new Gtk.ButtonPressEventHandler(ListClickedHandler);
Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
sw.ShadowType = Gtk.ShadowType.In;
sw.Add(_tvList);
base.PackStart(sw, true, true, 0);
sw.Show();
}
示例7: CreateWidget
protected override Gtk.Widget CreateWidget(WindowContext context)
{
if(Child == null)
throw new Exception("Align musí obsahovat widget");
Gtk.Alignment a = new Gtk.Alignment(
GetAtr("x", 0.5f),
GetAtr("y", 0.5f),
GetAtr("xs", 1.0f),
GetAtr("ys", 1.0f));
a.Child = Child.Build(context);
return a;
}
示例8: MakeImageButton
public static Gtk.Button MakeImageButton (Gtk.Image image, string label)
{
Gtk.HBox box = new Gtk.HBox (false, 2);
box.PackStart (image, false, false, 0);
box.PackEnd (new Gtk.Label (label), false, false, 0);
box.ShowAll ();
Gtk.Button button = new Gtk.Button ();
Gtk.Alignment align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 0.0f);
align.Add (box);
align.Show ();
button.Add (align);
return button;
}
示例9: ToolbarComboBox
public ToolbarComboBox ()
{
align = new Gtk.Alignment (0.5f, 0.5f, 1.0f, 0f);
Add (align);
align.LeftPadding = 3;
align.RightPadding = 3;
combo = new Gtk.ComboBox ();
combo.Model = new Gtk.ListStore (typeof(string));
ctx = new Gtk.CellRendererText ();
combo.PackStart (ctx, true);
combo.AddAttribute (ctx, "text", 0);
align.Add (combo);
ShowAll ();
}
示例10: WelcomePageTipOfTheDaySection
public WelcomePageTipOfTheDaySection (): base (GettextCatalog.GetString ("Did you know?"))
{
XmlDocument xmlDocument = new XmlDocument ();
xmlDocument.Load (System.IO.Path.Combine (System.IO.Path.Combine (PropertyService.DataPath, "options"), "TipsOfTheDay.xml"));
foreach (XmlNode xmlNode in xmlDocument.DocumentElement.ChildNodes) {
tips.Add (StringParserService.Parse (xmlNode.InnerText));
}
if (tips.Count != 0)
currentTip = new Random ().Next () % tips.Count;
else
currentTip = -1;
Gtk.VBox box = new Gtk.VBox (false, 12);
label = new Gtk.Label ();
label.Xalign = 0;
label.Wrap = true;
label.WidthRequest = 200;
label.ModifyFont (FontService.SansFont.CopyModified (Gui.Styles.FontScale11));
label.SetPadding (0, 10);
label.Text = currentTip != -1 ? tips[currentTip] : "";
box.PackStart (label, true, true, 0);
var next = new Gtk.Button (GettextCatalog.GetString ("Next Tip"));
next.Relief = Gtk.ReliefStyle.Normal;
next.Clicked += delegate {
if (tips.Count == 0)
return;
currentTip = currentTip + 1;
if (currentTip >= tips.Count)
currentTip = 0;
label.Text = tips[currentTip];
};
var al = new Gtk.Alignment (0, 0, 0, 0);
al.Add (next);
box.PackStart (al, false, false, 0);
SetContent (box);
}
示例11: Wrap
public override void Wrap (object obj, bool initialized)
{
base.Wrap (obj, initialized);
if (!initialized) {
frame.Label = "<b>" + frame.Name + "</b>";
((Gtk.Label)frame.LabelWidget).UseMarkup = true;
frame.Shadow = Gtk.ShadowType.None;
if (AllowPlaceholders) {
Gtk.Alignment align = new Gtk.Alignment (0, 0, 1, 1);
align.LeftPadding = 12;
Container align_wrapper = (Container)ObjectWrapper.Create (proj, align, this);
align_wrapper.AddPlaceholder ();
ReplaceChild (frame.Child, (Gtk.Widget)align_wrapper.Wrapped, true);
}
}
if (frame.LabelWidget != null)
ObjectWrapper.Create (proj, frame.LabelWidget, this);
frame.AddNotification ("label-widget", LabelWidgetChanged);
}
示例12: Build
protected virtual void Build() {
Stetic.Gui.Initialize(this);
// Widget Mono.Upnp.GtkClient.LazyDeviceInfo
Stetic.BinContainer.Attach(this);
this.Name = "Mono.Upnp.GtkClient.LazyDeviceInfo";
// Container child Mono.Upnp.GtkClient.LazyDeviceInfo.Gtk.Container+ContainerChild
this.alignment = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment.Name = "alignment";
// Container child alignment.Gtk.Container+ContainerChild
this.loading = new Gtk.Label();
this.loading.Name = "loading";
this.loading.LabelProp = Mono.Unix.Catalog.GetString("Loading");
this.alignment.Add(this.loading);
this.Add(this.alignment);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.Hide();
this.Mapped += new System.EventHandler(this.OnMapped);
}
示例13: Header
public Header(string text)
: base()
{
base.SetSizeRequest (-1, 30);
Gtk.Alignment alignment = new Gtk.Alignment (0, 0, 1, 1);
alignment.TopPadding = 1;
alignment.LeftPadding = 5;
alignment.RightPadding = 0;
alignment.BottomPadding = 1;
base.Add (alignment);
//Select ();
Gtk.HBox box = new Gtk.HBox ();
alignment.Add (box);
label = new Gtk.Label ();
label.Ypad = 3;
// label.Xpad = 3;
//base.Add (label);
box.PackStart (label, true, true, 0);
label.SetAlignment (0f, 0.5f);
label.Justify = Gtk.Justification.Left;
label.Markup = "<b>" + text + "</b>";
closeButton = new Gtk.Button ();
closeButton.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Menu));
closeButton.Relief = Gtk.ReliefStyle.None;
box.PackEnd (closeButton, false, false, 0);
closeButton.ShowAll ();
label.Show ();
box.Show ();
alignment.Show ();
closeButton.Clicked += closeButton_Clicked;
}
示例14: Build
protected virtual void Build()
{
Stetic.Gui.Initialize(this);
// Widget ocmgtk.LogViewerWidget
Stetic.BinContainer.Attach(this);
this.Name = "ocmgtk.LogViewerWidget";
// Container child ocmgtk.LogViewerWidget.Gtk.Container+ContainerChild
this.logBox = new Gtk.VBox();
this.logBox.Name = "logBox";
this.logBox.Spacing = 6;
this.logBox.BorderWidth = ((uint)(6));
// Container child logBox.Gtk.Box+BoxChild
this.logAlign = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.logAlign.Name = "logAlign";
this.logBox.Add(this.logAlign);
Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.logBox[this.logAlign]));
w1.Position = 0;
this.Add(this.logBox);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.Hide();
}
示例15: Build
protected virtual void Build()
{
Stetic.Gui.Initialize(this);
// Widget Pinta.CurvesDialog
this.Name = "Pinta.CurvesDialog";
this.Title = Mono.Unix.Catalog.GetString("Curves");
this.WindowPosition = ((Gtk.WindowPosition)(4));
this.Resizable = false;
this.AllowGrow = false;
this.SkipTaskbarHint = true;
// Internal child Pinta.CurvesDialog.VBox
Gtk.VBox w1 = this.VBox;
w1.Name = "dialog1_VBox";
w1.BorderWidth = ((uint)(2));
// Container child dialog1_VBox.Gtk.Box+BoxChild
this.hbox1 = new Gtk.HBox();
this.hbox1.Name = "hbox1";
this.hbox1.Spacing = 6;
// Container child hbox1.Gtk.Box+BoxChild
this.labelMap = new Gtk.Label();
this.labelMap.Name = "labelMap";
this.labelMap.LabelProp = Mono.Unix.Catalog.GetString("Transfer Map");
this.hbox1.Add(this.labelMap);
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.labelMap]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.hseparatorMap = new Gtk.HSeparator();
this.hseparatorMap.Name = "hseparatorMap";
this.hbox1.Add(this.hseparatorMap);
Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.hbox1[this.hseparatorMap]));
w3.Position = 1;
w1.Add(this.hbox1);
Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(w1[this.hbox1]));
w4.Position = 0;
w4.Expand = false;
w4.Fill = false;
// Container child dialog1_VBox.Gtk.Box+BoxChild
this.hbox2 = new Gtk.HBox();
this.hbox2.Name = "hbox2";
this.hbox2.Spacing = 6;
// Container child hbox2.Gtk.Box+BoxChild
this.comboMap = Gtk.ComboBox.NewText();
this.comboMap.AppendText(Mono.Unix.Catalog.GetString("RGB"));
this.comboMap.AppendText(Mono.Unix.Catalog.GetString("Luminosity"));
this.comboMap.Name = "comboMap";
this.comboMap.Active = 1;
this.hbox2.Add(this.comboMap);
Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(this.hbox2[this.comboMap]));
w5.Position = 0;
w5.Expand = false;
w5.Fill = false;
// Container child hbox2.Gtk.Box+BoxChild
this.alignment3 = new Gtk.Alignment(1F, 0.5F, 0F, 0F);
this.alignment3.Name = "alignment3";
// Container child alignment3.Gtk.Container+ContainerChild
this.labelPoint = new Gtk.Label();
this.labelPoint.Name = "labelPoint";
this.labelPoint.LabelProp = Mono.Unix.Catalog.GetString("(256, 256)");
this.alignment3.Add(this.labelPoint);
this.hbox2.Add(this.alignment3);
Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.hbox2[this.alignment3]));
w7.PackType = ((Gtk.PackType)(1));
w7.Position = 2;
w7.Expand = false;
w7.Fill = false;
w1.Add(this.hbox2);
Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(w1[this.hbox2]));
w8.Position = 1;
w8.Expand = false;
w8.Fill = false;
// Container child dialog1_VBox.Gtk.Box+BoxChild
this.drawing = new Gtk.DrawingArea();
this.drawing.WidthRequest = 256;
this.drawing.HeightRequest = 256;
this.drawing.CanFocus = true;
this.drawing.Events = ((Gdk.EventMask)(795646));
this.drawing.Name = "drawing";
w1.Add(this.drawing);
Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(w1[this.drawing]));
w9.Position = 2;
w9.Padding = ((uint)(8));
// Container child dialog1_VBox.Gtk.Box+BoxChild
this.hbox3 = new Gtk.HBox();
this.hbox3.Name = "hbox3";
// Container child hbox3.Gtk.Box+BoxChild
this.checkRed = new Gtk.CheckButton();
this.checkRed.CanFocus = true;
this.checkRed.Name = "checkRed";
this.checkRed.Label = Mono.Unix.Catalog.GetString("Red ");
this.checkRed.Active = true;
this.checkRed.DrawIndicator = true;
this.checkRed.UseUnderline = true;
this.hbox3.Add(this.checkRed);
Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.hbox3[this.checkRed]));
w10.Position = 0;
// Container child hbox3.Gtk.Box+BoxChild
this.checkGreen = new Gtk.CheckButton();
this.checkGreen.CanFocus = true;
//.........这里部分代码省略.........