本文整理汇总了C#中Gtk.Button类的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Button类的具体用法?C# Gtk.Button怎么用?C# Gtk.Button使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Gtk.Button类属于命名空间,在下文中一共展示了Gtk.Button类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Build
protected virtual void Build()
{
Stetic.Gui.Initialize(this);
// Widget MainWindow
this.Name = "MainWindow";
this.Title = Mono.Unix.Catalog.GetString("MainWindow");
this.WindowPosition = ((Gtk.WindowPosition)(4));
// Container child MainWindow.Gtk.Container+ContainerChild
this.fixed1 = new Gtk.Fixed();
this.fixed1.Name = "fixed1";
this.fixed1.HasWindow = false;
// Container child fixed1.Gtk.Fixed+FixedChild
this.button1 = new Gtk.Button();
this.button1.CanFocus = true;
this.button1.Name = "button1";
this.button1.UseUnderline = true;
this.button1.Label = Mono.Unix.Catalog.GetString("GtkButton");
this.fixed1.Add(this.button1);
Gtk.Fixed.FixedChild w1 = ((Gtk.Fixed.FixedChild)(this.fixed1[this.button1]));
w1.X = 160;
w1.Y = 113;
this.Add(this.fixed1);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.DefaultWidth = 400;
this.DefaultHeight = 300;
this.Show();
this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent);
}
示例2: MenuButtonEntry
public MenuButtonEntry (Gtk.Entry entry, Gtk.Button button)
{
if (entry == null) entry = new Gtk.Entry ();
if (button == null) button = new Gtk.Button (new Gtk.Arrow (Gtk.ArrowType.Right, Gtk.ShadowType.Out));
this.entry = entry;
this.button = button;
manager = new CommandManager ();
manager.RegisterGlobalHandler (this);
if (entry.Parent == null)
PackStart (entry, true, true, 0);
if (button.Parent == null)
PackStart (button, false, false, 2);
ActionCommand cmd = new ActionCommand ("InsertOption", "InsertOption", null);
cmd.CommandArray = true;
manager.RegisterCommand (cmd);
entrySet = new CommandEntrySet ();
entrySet.AddItem ("InsertOption");
button.Clicked += ShowQuickInsertMenu;
button.StateChanged += ButtonStateChanged;
}
示例3: Build
protected virtual void Build() {
Stetic.Gui.Initialize(this);
// Widget OpenVP.GtkGui.BrowsableEditor
Stetic.BinContainer.Attach(this);
this.Name = "OpenVP.GtkGui.BrowsableEditor";
// Container child OpenVP.GtkGui.BrowsableEditor.Gtk.Container+ContainerChild
this.vbox2 = new Gtk.VBox();
this.vbox2.Name = "vbox2";
this.vbox2.Spacing = 6;
// Container child vbox2.Gtk.Box+BoxChild
this.SheetPane = new Gtk.ScrolledWindow();
this.SheetPane.CanFocus = true;
this.SheetPane.Name = "SheetPane";
this.vbox2.Add(this.SheetPane);
Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox2[this.SheetPane]));
w1.Position = 0;
// Container child vbox2.Gtk.Box+BoxChild
this.hbuttonbox2 = new Gtk.HButtonBox();
this.hbuttonbox2.Name = "hbuttonbox2";
this.hbuttonbox2.Homogeneous = true;
this.hbuttonbox2.Spacing = 6;
this.hbuttonbox2.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
// Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
this.RevertButton = new Gtk.Button();
this.RevertButton.Sensitive = false;
this.RevertButton.CanFocus = true;
this.RevertButton.Name = "RevertButton";
this.RevertButton.UseStock = true;
this.RevertButton.UseUnderline = true;
this.RevertButton.Label = "gtk-revert-to-saved";
this.hbuttonbox2.Add(this.RevertButton);
Gtk.ButtonBox.ButtonBoxChild w2 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.RevertButton]));
w2.Expand = false;
w2.Fill = false;
// Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
this.ApplyButton = new Gtk.Button();
this.ApplyButton.Sensitive = false;
this.ApplyButton.CanFocus = true;
this.ApplyButton.Name = "ApplyButton";
this.ApplyButton.UseStock = true;
this.ApplyButton.UseUnderline = true;
this.ApplyButton.Label = "gtk-apply";
this.hbuttonbox2.Add(this.ApplyButton);
Gtk.ButtonBox.ButtonBoxChild w3 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.ApplyButton]));
w3.Position = 1;
w3.Expand = false;
w3.Fill = false;
this.vbox2.Add(this.hbuttonbox2);
Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.vbox2[this.hbuttonbox2]));
w4.Position = 1;
w4.Expand = false;
w4.Fill = false;
this.Add(this.vbox2);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.Show();
this.RevertButton.Clicked += new System.EventHandler(this.OnRevertButtonClicked);
this.ApplyButton.Clicked += new System.EventHandler(this.OnApplyButtonClicked);
}
示例4: WebSyncPreferencesWidget
public WebSyncPreferencesWidget (Api.OAuth oauth, string server, EventHandler requiredPrefChanged) : base (false, 5)
{
this.oauth = oauth;
Gtk.Table prefsTable = new Gtk.Table (1, 2, false);
prefsTable.RowSpacing = 5;
prefsTable.ColumnSpacing = 10;
serverEntry = new Gtk.Entry ();
serverEntry.Text = server;
AddRow (prefsTable, serverEntry, Catalog.GetString ("Se_rver:"), 0);
Add (prefsTable);
authButton = new Gtk.Button ();
// TODO: If Auth is valid, this text should change
if (!Auth.IsAccessToken)
authButton.Label = Catalog.GetString ("Connect to Server");
else {
authButton.Label = Catalog.GetString ("Connected");
authButton.Sensitive = false;
}
authButton.Clicked += OnAuthButtonClicked;
serverEntry.Changed += delegate {
Auth = null;
};
serverEntry.Changed += requiredPrefChanged;
Add (authButton);
// TODO: Add a section that shows the user something to verify they put
// in the right URL...something that constructs their user URL, maybe?
ShowAll ();
}
示例5: Initialize
public override void Initialize ()
{
NeedsEventBox = false;
Widget = new Gtk.Button ();
base.Widget.Show ();
}
示例6: ThreadProgressDialog
public ThreadProgressDialog (Thread thread, int total) {
/*
if (parent_window)
this.TransientFor = parent_window;
*/
this.Title = thread.Name;
this.thread = thread;
HasSeparator = false;
BorderWidth = 6;
SetDefaultSize (300, -1);
message_label = new Gtk.Label (String.Empty);
VBox.PackStart (message_label, true, true, 12);
progress_bar = new Gtk.ProgressBar ();
VBox.PackStart (progress_bar, true, true, 6);
retry_button = new Gtk.Button (Mono.Unix.Catalog.GetString ("Retry"));
retry_button.Clicked += new EventHandler (HandleRetryClicked);
skip_button = new Gtk.Button (Mono.Unix.Catalog.GetString ("Skip"));
skip_button.Clicked += new EventHandler (HandleSkipClicked);
ActionArea.Add (retry_button);
ActionArea.Add (skip_button);
button_label = Gtk.Stock.Cancel;
button = (Gtk.Button) AddButton (button_label, (int)Gtk.ResponseType.Cancel);
delay = new Delay (new GLib.IdleHandler (HandleUpdate));
Response += HandleResponse;
Destroyed += HandleDestroy;
}
示例7: ScreenshotViewerController
public ScreenshotViewerController(Glade.XML gxml, ScreenshotViewerModel ssViewerModel)
{
this.ssViewerModel = ssViewerModel;
nextNoteButton = (Gtk.Button)gxml.GetWidget ("nextNoteButton");
previousNoteButton = (Gtk.Button)gxml.GetWidget ("previousNoteButton");
forwardHourButton = (Gtk.Button)gxml.GetWidget ("forwardHourButton");
backHourButton = (Gtk.Button)gxml.GetWidget ("backHourButton");
forward10MinButton = (Gtk.Button)gxml.GetWidget ("foward10MinButton");
back10MinButton = (Gtk.Button)gxml.GetWidget ("back10MinButton");
noteViewBox = (Gtk.VBox)gxml.GetWidget ("noteViewBox");
screenshotImage = (Gtk.Image)gxml.GetWidget ("noteImage");
nextNoteButton.Clicked += this.NextNoteButtonPressed;
previousNoteButton.Clicked += this.PrevNoteButtonPressed;
forwardHourButton.Clicked += this.ForwardHourButtonPressed;
backHourButton.Clicked += this.BackHourButtonPressed;
forward10MinButton.Clicked += this.Forward10MinButtonPressed;
back10MinButton.Clicked += this.Back10MinButtonPressed;
noteViewBox.ScrollEvent += this.NoteViewScroll;
screenshotImage.ScrollEvent += this.NoteViewScroll;
doUpdateTimeCheckFilters ();
}
示例8: DiffWidget
public DiffWidget (VersionControlDocumentInfo info, bool viewOnly = false)
{
this.info = info;
this.Build ();
comparisonWidget = new ComparisonWidget (viewOnly);
buttonNext = new DocumentToolButton (Gtk.Stock.GoUp, GettextCatalog.GetString ("Previous Change"));
buttonPrev = new DocumentToolButton (Gtk.Stock.GoDown, GettextCatalog.GetString ("Next Change"));
labelOverview = new Gtk.Label () { Xalign = 0 };
buttonDiff = new Gtk.Button (GettextCatalog.GetString ("Unified Diff"));
this.buttonNext.Clicked += (sender, args) => ComparisonWidget.GotoNext ();
this.buttonPrev.Clicked += (sender, args) => ComparisonWidget.GotoPrev ();
notebook1.Page = 0;
vboxComparisonView.PackStart (comparisonWidget, true, true, 0);
comparisonWidget.Show ();
comparisonWidget.DiffChanged += delegate {
labelOverview.Markup = LabelText;
SetButtonSensitivity ();
};
comparisonWidget.SetVersionControlInfo (info);
this.buttonDiff.Clicked += HandleButtonDiffhandleClicked;
diffTextEditor = new global::Mono.TextEditor.MonoTextEditor (new Mono.TextEditor.TextDocument (), CommonTextEditorOptions.Instance);
diffTextEditor.Document.MimeType = "text/x-diff";
diffTextEditor.Options.ShowFoldMargin = false;
diffTextEditor.Options.ShowIconMargin = false;
diffTextEditor.Options.DrawIndentationMarkers = PropertyService.Get ("DrawIndentationMarkers", false);
diffTextEditor.Document.ReadOnly = true;
scrolledwindow1.Child = diffTextEditor;
diffTextEditor.Show ();
SetButtonSensitivity ();
}
示例9: QueryWidget
public QueryWidget (PhotoQuery query, Db db, TagSelectionWidget selector)
{
tips.Enable ();
this.query = query;
query.Changed += HandleChanged;
Gtk.HSeparator sep = new Gtk.HSeparator ();
sep.Show ();
this.PackStart (sep, false, false, 0);
Gtk.HBox hbox = new Gtk.HBox ();
hbox.Show ();
this.PackStart (hbox, false, false, 0);
label = new Gtk.Label (Catalog.GetString ("Find: "));
label.Show ();
label.Ypad = 9;
hbox.PackStart (label, false, false, 0);
untagged = new Gtk.Label (Catalog.GetString ("Untagged photos"));
untagged.Visible = false;
hbox.PackStart (untagged, false, false, 0);
comma_label = new Gtk.Label (", ");
comma_label.Visible = false;
hbox.PackStart (comma_label, false, false, 0);
rollfilter = new Gtk.Label (Catalog.GetString ("Import roll"));
rollfilter.Visible = false;
hbox.PackStart (rollfilter, false, false, 0);
logic_widget = new LogicWidget (query, db.Tags, selector);
logic_widget.Show ();
hbox.PackStart (logic_widget, true, true, 0);
warning_box = new Gtk.HBox ();
warning_box.PackStart (new Gtk.Label (System.String.Empty));
Gtk.Image warning_image = new Gtk.Image ("gtk-info", Gtk.IconSize.Button);
warning_image.Show ();
warning_box.PackStart (warning_image, false, false, 0);
clear_button = new Gtk.Button ();
clear_button.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Button));
clear_button.Clicked += HandleClearButtonClicked;
clear_button.Relief = Gtk.ReliefStyle.None;
hbox.PackEnd (clear_button, false, false, 0);
tips.SetTip (clear_button, Catalog.GetString("Clear search"), null);
Gtk.Label warning = new Gtk.Label (Catalog.GetString ("No matching photos found"));
warning_box.PackStart (warning, false, false, 0);
warning_box.ShowAll ();
warning_box.Spacing = 6;
warning_box.Visible = false;
hbox.PackEnd (warning_box, false, false, 0);
warning_box.Visible = false;
}
示例10: Initialize
public override void Initialize (IPadWindow window)
{
base.Initialize(window);
// Call ctors
inputEditor = new TextEditor() { Name = "input", Events = Gdk.EventMask.AllEventsMask, HeightRequest = 80 };
editor = new TextEditor() { Name = "output", Events = Gdk.EventMask.AllEventsMask };
vpaned = new Gtk.VPaned();
var scr1 = new Gtk.ScrolledWindow();
var scr2 = new Gtk.ScrolledWindow();
// Init layout
scr1.ShadowType = Gtk.ShadowType.In;
scr1.Child = inputEditor;
vpaned.Add1(scr1);
scr1.ShowAll();
inputEditor.ShowAll();
scr2.ShadowType = Gtk.ShadowType.In;
scr2.Child = editor;
vpaned.Add2(scr2);
scr2.ShowAll();
editor.ShowAll();
vpaned.ShowAll();
// Init editors
var o = editor.Options;
inputEditor.Options = o;
o.ShowLineNumberMargin = false;
o.ShowFoldMargin = false;
o.ShowIconMargin = false;
editor.Document.ReadOnly = true;
inputEditor.Text = PropertyService.Get(lastInputStringPropId, string.Empty);
editor.Text = string.Empty;
editor.Document.SyntaxMode = new Highlighting.DSyntaxMode();
inputEditor.Document.SyntaxMode = new Highlighting.DSyntaxMode();
editor.Document.MimeType = Formatting.DCodeFormatter.MimeType;
inputEditor.Document.MimeType = Formatting.DCodeFormatter.MimeType;
// Init toolbar
var tb = window.GetToolbar(Gtk.PositionType.Top);
executeButton = new Gtk.Button();
executeButton.Image = new Gtk.Image(Gtk.Stock.Execute, Gtk.IconSize.Menu);
executeButton.TooltipText = "Evaluates the expression typed in the upper input editor.";
executeButton.Clicked += Execute;
tb.Add(executeButton);
abortButton = new Gtk.Button();
abortButton.Sensitive = false;
abortButton.Image = new Gtk.Image(Gtk.Stock.Stop, Gtk.IconSize.Menu);
abortButton.TooltipText = "Stops the evaluation.";
abortButton.Clicked += (object sender, EventArgs e) => AbortExecution();
tb.Add(abortButton);
tb.ShowAll();
}
示例11: Build
protected virtual void Build()
{
Stetic.Gui.Initialize(this);
// Widget HollyLibrary.HColorPickerDialog
this.Name = "HollyLibrary.HColorPickerDialog";
this.Title = "Pick a color";
this.WindowPosition = ((Gtk.WindowPosition)(4));
this.Resizable = false;
this.AllowGrow = false;
this.HasSeparator = false;
// Internal child HollyLibrary.HColorPickerDialog.VBox
Gtk.VBox w1 = this.VBox;
w1.Name = "dialog1_VBox";
w1.BorderWidth = ((uint)(2));
// Container child dialog1_VBox.Gtk.Box+BoxChild
this.Picker = new HollyLibrary.HColorPickerWidget();
this.Picker.Events = ((Gdk.EventMask)(256));
this.Picker.Name = "Picker";
w1.Add(this.Picker);
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(w1[this.Picker]));
w2.Position = 0;
// Internal child HollyLibrary.HColorPickerDialog.ActionArea
Gtk.HButtonBox w3 = this.ActionArea;
w3.Name = "dialog1_ActionArea";
w3.Spacing = 6;
w3.BorderWidth = ((uint)(5));
w3.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonCancel = new Gtk.Button();
this.buttonCancel.CanDefault = true;
this.buttonCancel.CanFocus = true;
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.UseStock = true;
this.buttonCancel.UseUnderline = true;
this.buttonCancel.Label = "gtk-cancel";
this.AddActionWidget(this.buttonCancel, -6);
Gtk.ButtonBox.ButtonBoxChild w4 = ((Gtk.ButtonBox.ButtonBoxChild)(w3[this.buttonCancel]));
w4.Expand = false;
w4.Fill = false;
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new Gtk.Button();
this.buttonOk.CanDefault = true;
this.buttonOk.CanFocus = true;
this.buttonOk.Name = "buttonOk";
this.buttonOk.UseStock = true;
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-ok";
this.AddActionWidget(this.buttonOk, -5);
Gtk.ButtonBox.ButtonBoxChild w5 = ((Gtk.ButtonBox.ButtonBoxChild)(w3[this.buttonOk]));
w5.Position = 1;
w5.Expand = false;
w5.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.DefaultWidth = 591;
this.DefaultHeight = 394;
this.Show();
}
示例12: Build
protected virtual void Build()
{
Stetic.Gui.Initialize(this);
// Widget DirectoryHistory.UI.HistoryDialog
this.Name = "DirectoryHistory.UI.HistoryDialog";
this.WindowPosition = ((Gtk.WindowPosition)(4));
this.DefaultWidth = 640;
this.DefaultHeight = 480;
// Internal child DirectoryHistory.UI.HistoryDialog.VBox
Gtk.VBox w1 = this.VBox;
w1.Name = "dialog1_VBox";
w1.BorderWidth = ((uint)(2));
// Container child dialog1_VBox.Gtk.Box+BoxChild
this.entriesVbox = new Gtk.VBox();
this.entriesVbox.Name = "entriesVbox";
this.entriesVbox.Spacing = 6;
// Container child entriesVbox.Gtk.Box+BoxChild
this.label = new Gtk.Label();
this.label.Name = "label";
this.label.LabelProp = Mono.Unix.Catalog.GetString("label1");
this.entriesVbox.Add(this.label);
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.entriesVbox[this.label]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
// Container child entriesVbox.Gtk.Box+BoxChild
this.scrolledwindow1 = new Gtk.ScrolledWindow();
this.scrolledwindow1.CanFocus = true;
this.scrolledwindow1.Name = "scrolledwindow1";
this.scrolledwindow1.ShadowType = ((Gtk.ShadowType)(1));
this.entriesVbox.Add(this.scrolledwindow1);
Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.entriesVbox[this.scrolledwindow1]));
w3.Position = 1;
w1.Add(this.entriesVbox);
Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(w1[this.entriesVbox]));
w4.Position = 0;
// Internal child DirectoryHistory.UI.HistoryDialog.ActionArea
Gtk.HButtonBox w5 = this.ActionArea;
w5.Name = "dialog1_ActionArea";
w5.Spacing = 10;
w5.BorderWidth = ((uint)(5));
w5.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new Gtk.Button();
this.buttonOk.CanDefault = true;
this.buttonOk.CanFocus = true;
this.buttonOk.Name = "buttonOk";
this.buttonOk.UseStock = true;
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-ok";
this.AddActionWidget(this.buttonOk, -5);
Gtk.ButtonBox.ButtonBoxChild w6 = ((Gtk.ButtonBox.ButtonBoxChild)(w5[this.buttonOk]));
w6.Expand = false;
w6.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.Show();
}
示例13: Build
protected virtual void Build() {
Stetic.Gui.Initialize();
// Widget Monodoc.Editor.SaveDocDialog
this.Name = "Monodoc.Editor.SaveDocDialog";
this.Title = Mono.Unix.Catalog.GetString("Save as...");
this.WindowPosition = ((Gtk.WindowPosition)(4));
this.HasSeparator = false;
// Internal child Monodoc.Editor.SaveDocDialog.VBox
Gtk.VBox w1 = this.VBox;
w1.Name = "dialog1_VBox";
w1.BorderWidth = ((uint)(2));
// Container child dialog1_VBox.Gtk.Box+BoxChild
this.saveFileDialog = new Gtk.FileChooserWidget(((Gtk.FileChooserAction)(1)));
this.saveFileDialog.Name = "saveFileDialog";
w1.Add(this.saveFileDialog);
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(w1[this.saveFileDialog]));
w2.Position = 0;
// Internal child Monodoc.Editor.SaveDocDialog.ActionArea
Gtk.HButtonBox w3 = this.ActionArea;
w3.Name = "dialog1_ActionArea";
w3.Spacing = 6;
w3.BorderWidth = ((uint)(5));
w3.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonCancel = new Gtk.Button();
this.buttonCancel.CanDefault = true;
this.buttonCancel.CanFocus = true;
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.UseStock = true;
this.buttonCancel.UseUnderline = true;
this.buttonCancel.Label = "gtk-cancel";
this.AddActionWidget(this.buttonCancel, -6);
Gtk.ButtonBox.ButtonBoxChild w4 = ((Gtk.ButtonBox.ButtonBoxChild)(w3[this.buttonCancel]));
w4.Expand = false;
w4.Fill = false;
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new Gtk.Button();
this.buttonOk.CanDefault = true;
this.buttonOk.CanFocus = true;
this.buttonOk.Name = "buttonOk";
this.buttonOk.UseStock = true;
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-save";
w3.Add(this.buttonOk);
Gtk.ButtonBox.ButtonBoxChild w5 = ((Gtk.ButtonBox.ButtonBoxChild)(w3[this.buttonOk]));
w5.Position = 1;
w5.Expand = false;
w5.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.DefaultWidth = 703;
this.DefaultHeight = 178;
this.Show();
this.saveFileDialog.FileActivated += new System.EventHandler(this.OnSaveFileDialogFileActivated);
this.buttonCancel.Clicked += new System.EventHandler(this.OnButtonCancelClicked);
this.buttonOk.Clicked += new System.EventHandler(this.OnButtonOkClicked);
}
示例14: Build
protected virtual void Build() {
Stetic.Gui.Initialize();
// Widget CBinding.AddPathDialog
this.Name = "CBinding.AddPathDialog";
this.Title = Mono.Unix.Catalog.GetString("Add Path");
this.Modal = true;
// Internal child CBinding.AddPathDialog.VBox
Gtk.VBox w1 = this.VBox;
w1.Name = "dialog1_VBox";
w1.Spacing = 6;
w1.BorderWidth = ((uint)(2));
// Container child dialog1_VBox.Gtk.Box+BoxChild
this.file_chooser_widget = new Gtk.FileChooserWidget(((Gtk.FileChooserAction)(0)));
this.file_chooser_widget.Name = "file_chooser_widget";
this.file_chooser_widget.ShowHidden = true;
w1.Add(this.file_chooser_widget);
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(w1[this.file_chooser_widget]));
w2.Position = 0;
// Internal child CBinding.AddPathDialog.ActionArea
Gtk.HButtonBox w3 = this.ActionArea;
w3.Name = "dialog1_ActionArea";
w3.Spacing = 6;
w3.BorderWidth = ((uint)(5));
w3.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonCancel = new Gtk.Button();
this.buttonCancel.CanDefault = true;
this.buttonCancel.CanFocus = true;
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.UseStock = true;
this.buttonCancel.UseUnderline = true;
this.buttonCancel.Label = "gtk-cancel";
this.AddActionWidget(this.buttonCancel, -6);
Gtk.ButtonBox.ButtonBoxChild w4 = ((Gtk.ButtonBox.ButtonBoxChild)(w3[this.buttonCancel]));
w4.Expand = false;
w4.Fill = false;
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new Gtk.Button();
this.buttonOk.CanDefault = true;
this.buttonOk.CanFocus = true;
this.buttonOk.Name = "buttonOk";
this.buttonOk.UseStock = true;
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-ok";
this.AddActionWidget(this.buttonOk, -5);
Gtk.ButtonBox.ButtonBoxChild w5 = ((Gtk.ButtonBox.ButtonBoxChild)(w3[this.buttonOk]));
w5.Position = 1;
w5.Expand = false;
w5.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.DefaultWidth = 649;
this.DefaultHeight = 436;
this.Show();
this.buttonCancel.Clicked += new System.EventHandler(this.OnCancelButtonClick);
this.buttonOk.Clicked += new System.EventHandler(this.OnOkButtonClick);
}
示例15: NoteDialog
public NoteDialog(Gtk.Window parentWindow, ITask task)
: base()
{
this.ParentWindow = parentWindow.GdkWindow;
this.task = task;
this.Title = String.Format(Catalog.GetString("Notes for: {0:s}"), task.Text);
this.HasSeparator = false;
this.SetSizeRequest(500,320);
this.Icon = Utilities.GetIcon ("tasque", 16);
//this.Flags = Gtk.DialogFlags.DestroyWithParent;
sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
sw.HscrollbarPolicy = Gtk.PolicyType.Never;
sw.BorderWidth = 0;
sw.CanFocus = true;
sw.Show ();
Gtk.EventBox innerEb = new Gtk.EventBox();
innerEb.BorderWidth = 0;
targetVBox = new Gtk.VBox();
targetVBox.BorderWidth = 5;
targetVBox.Show ();
innerEb.Add(targetVBox);
innerEb.Show ();
if(task.Notes != null) {
foreach (var note in task.Notes) {
NoteWidget noteWidget = new NoteWidget (note);
noteWidget.TextChanged += OnNoteTextChanged;
noteWidget.DeleteButtonClicked += OnDeleteButtonClicked;
noteWidget.EditCanceled += OnEditCanceled;
noteWidget.Show ();
targetVBox.PackStart (noteWidget, false, false, 0);
}
}
sw.AddWithViewport(innerEb);
sw.Show ();
VBox.PackStart (sw, true, true, 0);
if(task.NoteSupport == NoteSupport.Multiple) {
addButton = new Gtk.Button(Gtk.Stock.Add);
addButton.Show();
this.ActionArea.PackStart(addButton);
addButton.Clicked += OnAddButtonClicked;
}
AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close);
Response += delegate (object sender, Gtk.ResponseArgs args) {
// Hide the window. The TaskWindow watches for when the
// dialog is hidden and will take care of the rest.
Hide ();
};
}