本文整理汇总了C#中Gtk.Label.SetAlignment方法的典型用法代码示例。如果您正苦于以下问题:C# Label.SetAlignment方法的具体用法?C# Label.SetAlignment怎么用?C# Label.SetAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Label
的用法示例。
在下文中一共展示了Label.SetAlignment方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IndexInfo
public IndexInfo ()
{
HeaderIcon = Beagle.Util.WidgetFu.LoadThemeIcon ("dialog-information", 48);
Header = Catalog.GetString ("Index Information");
Gtk.Label description = new Gtk.Label ();
description.Markup = Catalog.GetString ("Number of items currently indexed:");
description.LineWrap = true;
description.Justify = Justification.Left;
description.SetAlignment (0.0f, 0.5f);
Append (description, Gtk.AttachOptions.Fill, 0);
label = new Gtk.Label ();
label.LineWrap = true;
label.SetAlignment (0.0f, 0.5f);
label.Justify = Justification.Fill;
Append (label, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0);
note = new Gtk.Label ();
note.Markup = Catalog.GetString ("<i>NOTE: The search service is still indexing new data.</i>");
note.LineWrap = true;
note.Justify = Justification.Fill;
note.SetAlignment (0.0f, 0.5f);
note.NoShowAll = true;
Append (note, Gtk.AttachOptions.Fill, 0);
}
示例2: SdStatusBar
public SdStatusBar(IStatusBarService manager)
{
Spacing = 3;
BorderWidth = 1;
progress = new ProgressBar ();
this.PackStart (progress, false, false, 0);
this.PackStart (txtStatusBarPanel, true, true, 0);
statusBox = new HBox ();
statusLabel = new Label ();
statusLabel.SetAlignment (0, 0.5f);
statusLabel.Wrap = false;
statusBox.PackEnd (statusLabel, true, true, 0);
txtStatusBarPanel.Add (statusBox);
this.PackStart (cursorStatusBarPanel, false, false, 0);
cursorLabel = new Label (" ");
cursorStatusBarPanel.Add (cursorLabel);
this.PackStart (modeStatusBarPanel, false, false, 0);
modeLabel = new Label (" ");
modeStatusBarPanel.Add (modeLabel);
this.PackStart (iconsStatusBarPanel, false, false, 0);
txtStatusBarPanel.ShowAll ();
Progress.Hide ();
Progress.PulseStep = 0.3;
}
示例3: DialogError
public DialogError(string message, Exception e, Window parent) : base("Error", parent, DialogFlags.Modal, Stock.Ok, ResponseType.Ok)
{
HBox hbox = new HBox();
Image icon = new Image(Stock.DialogError,IconSize.Dialog);
Label label = new Label(message);
Expander exp = new Expander("Details");
ScrolledWindow sw = new ScrolledWindow();
TextView tview = new TextView();
hbox.BorderWidth = 6;
hbox.Spacing = 6;
label.SetAlignment(0f, 0.5f);
exp.BorderWidth = 6;
tview.Buffer.Text = e.Message;
tview.Buffer.Text += "\n";
tview.Buffer.Text += e.StackTrace;
sw.Add(tview);
exp.Add(sw);
hbox.PackStart(icon, false, false, 0);
hbox.PackStart(label, true, true, 0);
this.VBox.PackStart(hbox, false, false, 0);
this.VBox.PackStart(exp, true, true, 0);
this.ShowAll();
}
示例4: FormOrder
public FormOrder() : base(4,2, false)
{
labelid = new Label("Id :");
labelid.SetAlignment(0, (float)0.5);
labelcust = new Label("Customer :");
labelcust.SetAlignment(0, (float)0.5);
labelpay = new Label("Payment :");
labelpay.SetAlignment(0, (float)0.5);
labeltax = new Label("Tax :");
labeltax.SetAlignment(0, (float)0.5);
entryid = new Entry();
entryid.Sensitive = false;
combocust = new ComboBoxCustomers();
combopay = new ComboBoxPayments();
combopay.NoneRow = true;
combotax = new ComboBoxTaxes();
combotax.NoneRow = true;
this.ColumnSpacing = 6;
Attach(labelid, 0, 1, 0, 1);
Attach(labelcust, 0, 1, 1, 2);
Attach(labelpay, 0, 1, 2, 3);
Attach(labeltax, 0, 1, 3, 4);
Attach(entryid, 1, 2, 0, 1);
Attach(combocust, 1, 2, 1, 2);
Attach(combopay, 1, 2, 2, 3);
Attach(combotax, 1, 2, 3, 4);
this.ShowAll();
}
示例5: 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);
}
示例6: 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);
}
示例7: PreferencesDialog
public PreferencesDialog(Settings set, Window parent,
string argsOver)
{
settings = set;
argsOverride = argsOver;
dialog = new Dialog("Preferences", parent,
DialogFlags.Modal | DialogFlags.DestroyWithParent,
new object[]{Gtk.Stock.Close, -1});
var table = new Table(4, 3, false);
sUseBundledDebugger = new CheckButton("Use bundled MSPDebug");
sUseBundledDebugger.Clicked += OnBundledState;
table.Attach(sUseBundledDebugger, 0, 3, 0, 1,
AttachOptions.Expand | AttachOptions.Fill,
0, 4, 4);
Label lbl;
lbl = new Label("MSPDebug path:");
lbl.SetAlignment(0.0f, 0.5f);
table.Attach(lbl, 0, 1, 1, 2, AttachOptions.Fill, 0, 4, 4);
sMSPDebugPath = new Entry();
table.Attach(sMSPDebugPath, 1, 2, 1, 2,
AttachOptions.Expand | AttachOptions.Fill,
0, 4, 4);
chooseMSPDebug = new Button("Choose...");
chooseMSPDebug.Clicked += OnChoose;
table.Attach(chooseMSPDebug, 2, 3, 1, 2,
AttachOptions.Fill, 0, 4, 4);
lbl = new Label("MSPDebug arguments:");
lbl.SetAlignment(0.0f, 0.5f);
table.Attach(lbl, 0, 1, 2, 3, AttachOptions.Fill, 0, 4, 4);
sMSPDebugArgs = new Entry();
sMSPDebugArgs.Sensitive = (argsOverride == null);
table.Attach(sMSPDebugArgs, 1, 3, 2, 3,
AttachOptions.Expand | AttachOptions.Fill,
0, 4, 4);
lbl = new Label("Console font:");
lbl.SetAlignment(0.0f, 0.5f);
table.Attach(lbl, 0, 1, 3, 4, AttachOptions.Fill, 0, 4, 4);
sConsoleFont = new FontButton();
table.Attach(sConsoleFont, 1, 3, 3, 4,
AttachOptions.Expand | AttachOptions.Fill,
0, 4, 4);
table.ShowAll();
((Container)dialog.Child).Add(table);
chooseDialog = new FileChooserDialog("Choose MSPDebug binary",
dialog, FileChooserAction.Open,
new object[]{Stock.Cancel, ResponseType.Cancel,
Stock.Ok, ResponseType.Ok});
chooseDialog.DefaultResponse = ResponseType.Ok;
}
示例8: MainWindow
public MainWindow()
: base("Katahdin Debugger")
{
SetDefaultSize(500, 400);
try
{
PathResolver pathResolver = new PathResolver();
SetIconFromFile(pathResolver.Resolve("katahdin.svg"));
}
catch
{
}
Destroyed += delegate
{
if (runtimeThread != null)
runtimeThread.Shutdown();
};
VBox vertical = new VBox();
Add(vertical);
MenuBuilder menuBuilder = new MenuBuilder();
MenuBar menuBar = menuBuilder.StartMenuBar();
vertical.PackStart(menuBar, false, false, 0);
menuBuilder.StartMenu("Debug");
debugRun = menuBuilder.Add("Run", OnDebugRun);
menuBuilder.End();
menuBuilder.StartMenu("View");
viewGrammar = menuBuilder.AddCheck("Grammar", OnViewGrammarToggled);
viewParseTrace = menuBuilder.AddCheck("Parse Trace", OnViewParseTraceToggled);
viewParseTree = menuBuilder.AddCheck("Parse Tree", OnViewParseTreeToggled);
menuBuilder.Separate();
menuBuilder.Add("View runtime object", OnViewRuntimeModule);
menuBuilder.End();
menuBuilder.End();
console = new ConsoleWidget();
vertical.PackStart(console, true, true, 0);
vertical.PackStart(new HSeparator(), false, false, 0);
HBox statusBar = new HBox();
vertical.PackStart(statusBar, false, false, 1);
progress = new ProgressBar();
statusBar.PackStart(progress, false, false, 1);
statusLabel = new Label();
statusLabel.SetAlignment(0, (float) 0.5);
statusLabel.LineWrap = true;
statusBar.PackStart(statusLabel, true, true, 0);
}
示例9: AddSubcatHeading
public void AddSubcatHeading(ControlSubcategory Subcat)
{
Label Heading = new Label(string.Format("<b>{0}</b>", Subcat.Name));
Heading.UseMarkup = true;
Heading.SetAlignment(0, 0.5f);
Attach(Heading, 0, 2, CurrentRow, CurrentRow+1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
CurrentRow++;
HasHeading = true;
}
示例10: 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;
}
}
示例11: FormDatabasePreferences
public FormDatabasePreferences() : base(7, 3, false)
{
typeLabel = new Gtk.Label("Type :");
serverLabel = new Gtk.Label("Server :");
portLabel = new Gtk.Label("Port :");
userLabel = new Gtk.Label("Username :");
passLabel = new Gtk.Label("Password :");
dbLabel = new Gtk.Label("Database :");
mediaLabel = new Gtk.Label("Medias path :");
typeCombo = ComboBox.NewText();
serverEntry = new Entry();
portSpinButton = new SpinButton(0f,65536f,1f);
userEntry = new Entry();
passEntry = new Entry();
dbEntry = new Entry();
passCheck = new CheckButton("Save password");
dbButton= new Button(Stock.Open);
mediaButton= new FileChooserButton("Choose the media directory", FileChooserAction.SelectFolder);
typeLabel.SetAlignment(0, (float)0.5);
serverLabel.SetAlignment(0, (float)0.5);
portLabel.SetAlignment(0, (float)0.5);
userLabel.SetAlignment(0, (float)0.5);
passLabel.SetAlignment(0, (float)0.5);
dbLabel.SetAlignment(0, (float)0.5);
mediaLabel.SetAlignment(0, (float)0.5);
typeCombo.AppendText("SQLite");
typeCombo.AppendText("PostgreSQL");
typeCombo.Changed += OnTypeComboChanged;
passEntry.Visibility = false;
dbButton.Clicked += OnDbButton;
this.Attach(typeLabel, 0, 1, 0, 1);
this.Attach(serverLabel, 0, 1, 1, 2);
this.Attach(portLabel, 0, 1, 2, 3);
this.Attach(userLabel, 0, 1, 3, 4);
this.Attach(passLabel, 0, 1, 4, 5);
this.Attach(dbLabel, 0, 1, 5, 6);
this.Attach(mediaLabel, 0, 1, 6, 7);
this.Attach(typeCombo, 1, 3, 0, 1);
this.Attach(serverEntry, 1, 3, 1, 2);
this.Attach(portSpinButton, 1, 3, 2, 3);
this.Attach(userEntry, 1, 3, 3, 4);
this.Attach(passEntry, 1, 2, 4, 5);
this.Attach(dbEntry, 1, 2, 5, 6);
this.Attach(passCheck, 2, 3, 4, 5);
this.Attach(dbButton, 2, 3, 5, 6);
this.Attach(mediaButton, 1, 3, 6, 7);
}
示例12: 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);
}
示例13: GiverMenuItem
public GiverMenuItem(ServiceInfo serviceInfo) : base(false)
{
this.serviceInfo = serviceInfo;
HBox hbox = new HBox(false, 10);
Gtk.Image image;
if(serviceInfo.Photo != null)
image = new Gtk.Image(serviceInfo.Photo);
else
image = new Gtk.Image(Utilities.GetIcon("giver-48", 48));
hbox.PackStart(image, false, false, 0);
VBox vbox = new VBox();
hbox.PackStart(vbox, false, false, 0);
Label label = new Label();
label.Justify = Gtk.Justification.Left;
label.SetAlignment (0.0f, 0.5f);
label.LineWrap = false;
label.UseMarkup = true;
label.UseUnderline = false;
label.Markup = string.Format ("<span weight=\"bold\" size=\"large\">{0}</span>",
serviceInfo.UserName);
vbox.PackStart(label, true, true, 0);
label = new Label();
label.Justify = Gtk.Justification.Left;
label.SetAlignment (0.0f, 0.5f);
label.LineWrap = false;
label.UseMarkup = true;
label.UseUnderline = false;
label.Markup = string.Format ("<span size=\"small\">{0}</span>",
serviceInfo.MachineName);
vbox.PackStart(label, true, true, 0);
label = new Label();
label.Justify = Gtk.Justification.Left;
label.SetAlignment (0.0f, 0.5f);
label.LineWrap = false;
label.UseMarkup = true;
label.UseUnderline = false;
label.Markup = string.Format ("<span style=\"italic\" size=\"small\">{0}:{1}</span>",
serviceInfo.Address, serviceInfo.Port);
vbox.PackStart(label, true, true, 0);
hbox.ShowAll();
Add(hbox);
}
示例14: Append
public void Append (string tip)
{
uint row = table.NRows;
Gtk.Image image = new Gtk.Image (arrow);
image.Show ();
table.Attach (image, 0, 1, row, row + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);
Gtk.Label label = new Gtk.Label ();
label.Markup = tip;
label.LineWrap = true;
label.Justify = Justification.Fill;
label.SetAlignment (0.0f, 0.5f);
label.ModifyFg (Gtk.StateType.Normal, label.Style.Foreground (Gtk.StateType.Insensitive));
label.Show ();
table.Attach (label, 1, 2, row, row + 1, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0, 0);
}
示例15: Base
public Base ()
{
table = new Gtk.Table (1, 2, false);
table.RowSpacing = 12;
table.ColumnSpacing = 12;
header_icon = new Gtk.Image ();
table.Attach (header_icon, 0, 1, 0, 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 5);
header_label = new Gtk.Label ();
header_label.SetAlignment (0.0f, 0.5f);
table.Attach (header_label, 1, 2, 0, 1, Gtk.AttachOptions.Fill | Gtk.AttachOptions.Expand, 0, 0, 5);
table.ShowAll ();
Add (table);
}