本文整理汇总了C#中Gtk.Table.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Table.Show方法的具体用法?C# Table.Show怎么用?C# Table.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Table
的用法示例。
在下文中一共展示了Table.Show方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
示例2: TileView
public TileView(int initialColumnCount) : base(null, null)
{
current_column_count = initialColumnCount;
Table table = new Table(1, 1, true);
table.Show();
cached_tables.Add(table);
Add(table);
Show ();
}
示例3: 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);
}
示例4: CreateGui
public void CreateGui()
{
dialog = new Dialog ();
dialog.AllowGrow = true;
dialog.Title = "About";
dialog.BorderWidth = 3;
dialog.VBox.BorderWidth = 5;
dialog.HasSeparator = false;
Table table = new Table (4, 1, false);
table.ColumnSpacing = 4;
table.RowSpacing = 4;
Label label = null;
label = new Label ("About Mono SQL# For GTK#");
table.Attach (label, 0, 1, 0, 1);
label = new Label ("sqlsharpgtk");
table.Attach (label, 0, 1, 1, 2);
label = new Label (VERSION);
table.Attach (label, 0, 1, 2, 3);
label = new Label ("(C) Copyright 2002-2006 Daniel Morgan");
table.Attach (label, 0, 1, 3, 4);
table.Show();
dialog.VBox.PackStart (table, false, false, 10);
Button button = null;
button = new Button (Stock.Ok);
button.Clicked += new EventHandler (Ok_Action);
button.CanDefault = true;
dialog.ActionArea.PackStart (button, true, true, 0);
button.GrabDefault ();
dialog.Modal = true;
dialog.ShowAll ();
}
示例5: BuildHeader
private void BuildHeader ()
{
header_table = new Table (2, 2, false);
header_table.Show ();
primary_vbox.PackStart (header_table, false, false, 0);
main_menu = new MainMenu ();
if (!PlatformDetection.IsMac && !PlatformDetection.IsMeeGo) {
main_menu.Show ();
header_table.Attach (main_menu, 0, 1, 0, 1,
AttachOptions.Expand | AttachOptions.Fill,
AttachOptions.Shrink, 0, 0);
}
Alignment toolbar_alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
toolbar_alignment.TopPadding = PlatformDetection.IsMeeGo ? 0u : 3u;
toolbar_alignment.BottomPadding = PlatformDetection.IsMeeGo ? 0u : 3u;
header_toolbar = (Toolbar)ActionService.UIManager.GetWidget ("/HeaderToolbar");
header_toolbar.ShowArrow = false;
header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
header_toolbar.Show ();
if (PlatformDetection.IsMeeGo) {
header_toolbar.IconSize = IconSize.LargeToolbar;
header_toolbar.Name = "meego-toolbar";
}
toolbar_alignment.Add (header_toolbar);
toolbar_alignment.Show ();
header_table.Attach (toolbar_alignment, 0, 2, 1, 2,
AttachOptions.Expand | AttachOptions.Fill,
AttachOptions.Shrink, 0, 0);
var next_button = new NextButton (ActionService, PlatformDetection.IsMeeGo);
next_button.Show ();
ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/NextArrowButton", next_button);
seek_slider = new ConnectedSeekSlider () { Resizable = ShowSeekSliderResizer.Get () };
seek_slider.SeekSlider.WidthRequest = SeekSliderWidth.Get ();
seek_slider.SeekSlider.SizeAllocated += (o, a) => {
SeekSliderWidth.Set (seek_slider.SeekSlider.Allocation.Width);
};
seek_slider.ShowAll ();
ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider);
var track_info_display = new ClassicTrackInfoDisplay ();
track_info_display.Show ();
track_info_container = TrackInfoDisplay.GetEditable (track_info_display);
track_info_container.Show ();
ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_container, true);
if (PlatformDetection.IsMeeGo) {
track_info_display.ArtworkSpacing = 5;
seek_slider.LeftPadding = 20;
seek_slider.RightPadding = 20;
var menu = (Menu)(ActionService.UIManager.GetWidget ("/ToolbarMenu"));
var menu_button = new Hyena.Widgets.MenuButton (new Image (Stock.Preferences, IconSize.LargeToolbar), menu, true);
menu_button.Show ();
ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ToolbarMenuPlaceholder", menu_button);
var close_button = new Button (Image.NewFromIconName ("window-close", IconSize.LargeToolbar)) {
TooltipText = Catalog.GetString ("Close")
};
close_button.Clicked += (o, e) => Hide ();
close_button.ShowAll ();
ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ClosePlaceholder", close_button);
} else {
var volume_button = new ConnectedVolumeButton ();
volume_button.Show ();
ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/VolumeButton", volume_button);
}
}
示例6: Init
private void Init()
{
Logger.Debug("Called Init");
this.Icon = Utilities.GetIcon ("giver-48", 48);
// Update the window title
this.Title = string.Format ("Giver Preferences");
//this.DefaultSize = new Gdk.Size (300, 500);
this.VBox.Spacing = 0;
this.VBox.BorderWidth = 0;
this.SetDefaultSize (450, 100);
this.AddButton(Stock.Close, Gtk.ResponseType.Ok);
this.DefaultResponse = ResponseType.Ok;
// Start with an event box to paint the background white
EventBox eb = new EventBox();
eb.Show();
eb.BorderWidth = 0;
eb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
eb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));
VBox mainVBox = new VBox();
mainVBox.BorderWidth = 10;
mainVBox.Spacing = 5;
mainVBox.Show ();
eb.Add(mainVBox);
this.VBox.PackStart(eb);
Label label = new Label();
label.Show();
label.Justify = Gtk.Justification.Left;
label.SetAlignment (0.0f, 0.5f);
label.LineWrap = false;
label.UseMarkup = true;
label.UseUnderline = false;
label.Markup = "<span weight=\"bold\" size=\"large\">Your Name</span>";
mainVBox.PackStart(label, true, true, 0);
// Name Box at the top of the Widget
HBox nameBox = new HBox();
nameBox.Show();
nameEntry = new Entry();
nameEntry.Show();
nameBox.PackStart(nameEntry, true, true, 0);
nameBox.Spacing = 10;
mainVBox.PackStart(nameBox, false, false, 0);
label = new Label();
label.Show();
label.Justify = Gtk.Justification.Left;
label.SetAlignment (0.0f, 0.5f);
label.LineWrap = false;
label.UseMarkup = true;
label.UseUnderline = false;
label.Markup = "<span weight=\"bold\" size=\"large\">Your Picture</span>";
mainVBox.PackStart(label, true, true, 0);
Gtk.Table table = new Table(4, 3, false);
table.Show();
// None Entry
noneButton = new RadioButton((Gtk.RadioButton)null);
noneButton.Show();
table.Attach(noneButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
VBox vbox = new VBox();
vbox.Show();
Gtk.Image image = new Image(Utilities.GetIcon("computer", 48));
image.Show();
vbox.PackStart(image, false, false, 0);
label = new Label("None");
label.Show();
vbox.PackStart(label, false, false, 0);
table.Attach(vbox, 1, 2, 0 ,1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
vbox = new VBox();
vbox.Show();
table.Attach(vbox, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);
// Local Entry
localButton = new RadioButton(noneButton);
localButton.Show();
table.Attach(localButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
vbox = new VBox();
vbox.Show();
localImage = new Image(Utilities.GetIcon("stock_person", 48));
localImage.Show();
vbox.PackStart(localImage, false, false, 0);
label = new Label("File");
label.Show();
vbox.PackStart(label, false, false, 0);
table.Attach(vbox, 1, 2, 1 ,2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
photoButton = new Button("Change Photo");
photoButton.Show();
table.Attach(photoButton, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
// Web Entry
webButton = new RadioButton(noneButton);
webButton.Show();
table.Attach(webButton, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
//.........这里部分代码省略.........
示例7: InitializeComponents
void InitializeComponents()
{
var stream = Assembly
.GetExecutingAssembly()
.GetManifestResourceStream(AppController.Instance.Config.AppWindow);
var glade = new Glade.XML(stream, AppController.Instance.Config.AppWindowName, null);
if (stream != null)
{
stream.Close();
}
glade.Autoconnect(this);
mNew.Activated += OnNew;
mOpen.Activated += OnOpen;
mSave.Activated += OnSave;
mSaveAs.Activated += OnSaveAs;
mQuit.Activated += OnQuit;
mEnvironment.Activated += OnEnvironment;
mAbout.Activated += OnAbout;
mExportToPng.Activated += OnExportToPng;
rbDefault.Clicked += OnVariableRadiobuttonCliecked;
rbExisting.Clicked += OnVariableRadiobuttonCliecked;
rbNew.Clicked += OnVariableRadiobuttonCliecked;
rbDefault1.Clicked += OnVariableRadiobuttonCliecked1;
rbExisting1.Clicked += OnVariableRadiobuttonCliecked1;
rbNew1.Clicked += OnVariableRadiobuttonCliecked1;
rbDefault2.Clicked += OnVariableRadiobuttonCliecked2;
rbExisting2.Clicked += OnVariableRadiobuttonCliecked2;
rbNew2.Clicked += OnVariableRadiobuttonCliecked2;
rbDefault3.Clicked += OnVariableRadiobuttonCliecked3;
rbExisting3.Clicked += OnVariableRadiobuttonCliecked3;
rbNew3.Clicked += OnVariableRadiobuttonCliecked3;
DisableProperties ();
cbDefaultVar.Changed += OnVariableComboboxChanged;
cbExistVar.Changed += OnVariableComboboxChanged;
etNewVar.Changed += OnVariableComboboxChanged;
cbDefaultVar1.Changed += OnVariableComboboxChanged;
cbExistVar1.Changed += OnVariableComboboxChanged;
etNewVar1.Changed += OnVariableComboboxChanged;
cbDefaultVar2.Changed += OnVariableComboboxChanged;
cbExistVar2.Changed += OnVariableComboboxChanged;
etNewVar2.Changed += OnVariableComboboxChanged;
cbDefaultVar3.Changed += OnVariableComboboxChanged;
cbExistVar3.Changed += OnVariableComboboxChanged;
etNewVar3.Changed += OnVariableComboboxChanged;
cbFunction.Changed += OnFunctionChanged;
chbOverride.Toggled += OnOverrideToggled;
IconList = new[]{ new Gdk.Pixbuf (Assembly.GetExecutingAssembly (), AppController.Instance.Config.Icon) };
Icon = IconList[0];
var surfaces = AppController.Instance.GetPalette ();
var count = (uint)surfaces.Sum (s => s.Segments.Count);
table1 = new Table (2, count / 2, true);
var index = 0;
for (uint i = 0; i < count / 2; i++) {
for (uint j = 0; j < 2; j++) {
if (surfaces.Count() <= index) continue;
var surf = surfaces [index++];
var el = new ElementDrawing(surf, 2, 2 );
table1.Attach (el, i, i+1, j, j+(uint)surf.Segments.Count());
el.Show ();
}
}
vboxPalette.Add (table1);
table1.SetSizeRequest (300, 100);
table1.Show ();
_grid = new ElementDrawing(AppController.Instance.Surface, 24, 24);
scrolledwindow1.AddWithViewport (_grid);
_grid.Show ();
var arduino = AppController.Instance.GetArduino ();
var code = new ElementDrawing(arduino[0], 2, 2 );
tblArdulino.Attach (code, 0, 1, 0, 1);
code.CreateCode += CController.Instance.CreateCode;
code.Show ();
var t = new System.Threading.Thread(() =>
{
System.Threading.Thread.Sleep(2000);
UpdateHelper.CompareVersions(this);
});
//.........这里部分代码省略.........
示例8: MakeHotkeysPane
// Page 2
// List of Hotkey options
public Gtk.Widget MakeHotkeysPane ()
{
Gtk.Label label;
Gtk.CheckButton check;
Gtk.Alignment align;
Gtk.Entry entry;
IPropertyEditorBool keybind_peditor;
IPropertyEditor peditor;
Gtk.VBox hotkeys_list = new Gtk.VBox (false, 12);
hotkeys_list.BorderWidth = 12;
hotkeys_list.Show ();
// Hotkeys...
check = MakeCheckButton (Catalog.GetString ("Listen for _Hotkeys"));
hotkeys_list.PackStart (check, false, false, 0);
keybind_peditor =
Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_KEYBINDINGS,
check);
SetupPropertyEditor (keybind_peditor);
label = MakeTipLabel (
Catalog.GetString ("Hotkeys allow you to quickly access " +
"your notes from anywhere with a keypress. " +
"Example Hotkeys: " +
"<b><ALT>F11</b>, " +
"<b><ALT>N</b>"));
hotkeys_list.PackStart (label, false, false, 0);
align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 1.0f);
align.Show ();
hotkeys_list.PackStart (align, false, false, 0);
Gtk.Table table = new Gtk.Table (4, 2, false);
table.ColumnSpacing = 6;
table.RowSpacing = 6;
table.Show ();
align.Add (table);
// Show notes menu keybinding...
label = MakeLabel (Catalog.GetString ("Show notes _menu"));
table.Attach (label, 0, 1, 0, 1);
entry = new Gtk.Entry ();
label.MnemonicWidget = entry;
entry.Show ();
table.Attach (entry, 1, 2, 0, 1);
peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_SHOW_NOTE_MENU,
entry);
SetupPropertyEditor (peditor);
keybind_peditor.AddGuard (entry);
// Open Start Here keybinding...
label = MakeLabel (Catalog.GetString ("Open \"_Start Here\""));
table.Attach (label, 0, 1, 1, 2);
entry = new Gtk.Entry ();
label.MnemonicWidget = entry;
entry.Show ();
table.Attach (entry, 1, 2, 1, 2);
peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_OPEN_START_HERE,
entry);
SetupPropertyEditor (peditor);
keybind_peditor.AddGuard (entry);
// Create new note keybinding...
label = MakeLabel (Catalog.GetString ("Create _new note"));
table.Attach (label, 0, 1, 2, 3);
entry = new Gtk.Entry ();
label.MnemonicWidget = entry;
entry.Show ();
table.Attach (entry, 1, 2, 2, 3);
peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_CREATE_NEW_NOTE,
entry);
SetupPropertyEditor (peditor);
keybind_peditor.AddGuard (entry);
// Open Search All Notes window keybinding...
label = MakeLabel (Catalog.GetString ("Open \"Search _All Notes\""));
table.Attach (label, 0, 1, 3, 4);
//.........这里部分代码省略.........
示例9: BuildHeader
private void BuildHeader()
{
header_table = new Table (2, 2, false);
header_table.Show ();
header_table.Vexpand = false;
primary_vbox.PackStart (header_table, false, false, 0);
main_menu = new MainMenu ();
if (!PlatformDetection.IsMac) {
main_menu.Show ();
header_table.Attach (main_menu, 0, 1, 0, 1,
AttachOptions.Expand | AttachOptions.Fill,
AttachOptions.Shrink, 0, 0);
}
Alignment toolbar_alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
toolbar_alignment.TopPadding = 3u;
toolbar_alignment.BottomPadding = 3u;
header_toolbar = (Toolbar)ActionService.UIManager.GetWidget ("/HeaderToolbar");
header_toolbar.ShowArrow = false;
header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
header_toolbar.Show ();
toolbar_alignment.Add (header_toolbar);
toolbar_alignment.Show ();
header_table.Attach (toolbar_alignment, 0, 2, 1, 2,
AttachOptions.Expand | AttachOptions.Fill,
AttachOptions.Shrink, 0, 0);
var next_button = new NextButton (ActionService);
next_button.Show ();
ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/NextArrowButton", next_button);
seek_slider = new ConnectedSeekSlider () { Resizable = ShowSeekSliderResizer.Get () };
seek_slider.SeekSlider.WidthRequest = SeekSliderWidth.Get ();
seek_slider.SeekSlider.SizeAllocated += (o, a) => {
SeekSliderWidth.Set (seek_slider.SeekSlider.Allocation.Width);
};
seek_slider.ShowAll ();
ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider);
var track_info_display = new ClassicTrackInfoDisplay ();
track_info_display.Show ();
track_info_container = TrackInfoDisplay.GetEditable (track_info_display);
track_info_container.Show ();
ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_container, true);
var volume_button = new ConnectedVolumeButton ();
volume_button.Show ();
ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/VolumeButton", volume_button);
}
示例10: BuildInterface
private void BuildInterface() {
string category = null;
uint count = 0;
foreach (EffectMember i in this.mMembers) {
if (i.Category != category) {
category = i.Category;
count++;
}
count++;
}
category = null;
Table table = new Table(count, 2, false);
uint row = 0;
foreach (EffectMember i in this.mMembers) {
Label l;
if (i.Category != category) {
category = i.Category;
l = new Label();
l.Markup = "<b>" + category + "</b>";
l.Show();
table.Attach(l, 0, 2, row, ++row,
AttachOptions.Expand | AttachOptions.Fill,
AttachOptions.Shrink, 5, 5);
}
l = new Label(i.DisplayName);
l.Show();
table.Attach(l, 0, 1, row, row + 1, AttachOptions.Fill,
AttachOptions.Shrink, 5, 5);
MemberEditor editor = MemberEditor.Create(this.mEffect, i.Item);
editor.Show();
editor.MadeClean += this.OnEditorMadeClean;
editor.MadeDirty += this.OnEditorMadeDirty;
editor.Applied += this.OnEditorApplied;
this.mEditors.Add(editor);
if (!string.IsNullOrEmpty(i.Description))
editor.TooltipText = i.Description;
table.Attach(editor, 1, 2, row, ++row,
editor.XAttachment, editor.YAttachment, 5, 5);
}
this.SheetPane.AddWithViewport(table);
table.Show();
}
示例11: CreateGui
public void CreateGui()
{
dialog = new Dialog ();
dialog.AllowGrow = true;
dialog.Title = "Login";
dialog.BorderWidth = 2;
dialog.VBox.BorderWidth = 2;
dialog.HasSeparator = false;
Frame frame = new Frame ("Connection");
frame.BorderWidth = 2;
Table table = new Table (7, 2, false);
table.ColumnSpacing = 2;
table.RowSpacing = 2;
Label label = null;
label = new Label ("_Provider");
label.Xalign = 1.0f;
label.Ypad = 8;
table.Attach (label, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
LoadProviderCombo();
if (providerCombo.Model.IterNChildren() > 0)
providerCombo.Active = 0;
providerSelected = providerCombo.Active;
table.Attach (providerCombo, 1, 8, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 10, 1);
label = new Label ("_Connection String");
label.Xpad = 2;
label.Ypad = 8;
label.Xalign = 1.0f;
table.Attach (label, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
connection_entry = new Entry ();
connection_entry.Changed += new EventHandler (OnConnectionEntryChanged);
table.Attach (connection_entry, 1, 8, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 10, 1);
label = new Label ("_Server");
label.Xalign = 1.0f;
label.Ypad = 8;
table.Attach (label, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
server_entry = new Entry ();
server_entry.Changed += new EventHandler (OnParameterChanged);
table.Attach (server_entry, 1, 8, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 10, 1);
label = new Label ("_Database");
label.Xalign = 1.0f;
label.Ypad = 8;
table.Attach (label, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
database_entry = new Entry ();
database_entry.Changed += new EventHandler (OnParameterChanged);
table.Attach (database_entry, 1, 8, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 10, 1);
label = new Label ("_User ID");
label.Xalign = 1.0f;
label.Ypad = 8;
table.Attach (label, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
userid_entry = new Entry ();
userid_entry.Changed += new EventHandler (OnParameterChanged);
table.Attach (userid_entry, 1, 8, 4, 5, AttachOptions.Fill, AttachOptions.Fill, 10, 1);
label = new Label ("_Password");
label.Xalign = 1.0f;
label.Ypad = 8;
table.Attach (label, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
password_entry = new Entry ();
password_entry.Visibility = false;
password_entry.Changed += new EventHandler (OnParameterChanged);
table.Attach (password_entry, 1, 8, 5, 6, AttachOptions.Fill, AttachOptions.Fill, 10, 1);
label = new Label ("_Other");
label.Xalign = 1.0f;
label.Ypad = 8;
table.Attach (label, 0, 1, 6, 7, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
other_entry = new Entry ();
other_entry.Changed += new EventHandler (OnParameterChanged);
table.Attach (other_entry, 1, 8, 6, 7, AttachOptions.Fill, AttachOptions.Fill, 10, 1);
table.Show();
frame.Add (table);
dialog.VBox.PackStart (frame, false, false, 5);
Frame appSettingFrame = new Frame ("App Settings");
appSettingFrame.Add (grid);
dialog.VBox.PackStart (appSettingFrame, true, true, 10);
Button button = null;
button = new Button (Stock.Ok);
button.Clicked += new EventHandler (Connect_Action);
button.CanDefault = true;
dialog.ActionArea.PackStart (button, true, true, 0);
button.GrabDefault ();
button = new Button (Stock.Cancel);
button.Clicked += new EventHandler (Dialog_Cancel);
dialog.ActionArea.PackStart (button, true, true, 0);
dialog.Modal = true;
dialog.SetDefaultSize (500, 500);
//.........这里部分代码省略.........
示例12: Update
private void Update()
{
showRemoteStatus.Sensitive = !remoteStatus;
if (statuses.Length == 0) {
if (!remoteStatus)
this.status.Text = "No files have local modifications.";
else
this.status.Text = "No files have local or remote modifications.";
return;
}
buttonsShowLog = new Hashtable();
buttonsShowDiff = new Hashtable();
box.Remove(this.status);
this.status = null;
if (vc.CanCommit(filepath))
buttonCommit.Sensitive = true;
checkCommit = new Hashtable();
table = new Table((uint)statuses.Length+1, (uint)5 + (uint)(remoteStatus ? 2 : 0), false);
box.Add(table);
uint row = 0;
table.Attach(new HeaderLabel("Status"), 0, 3, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
table.Attach(new HeaderLabel("Path"), 3, 4, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
if (remoteStatus)
table.Attach(new HeaderLabel("Remote Status"), 4, 6, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
for (int i = 0; i < statuses.Length; i++) {
Node n = statuses[i];
RevItem item = new RevItem();
item.Path = n.LocalPath;
item.BaseRev = n.BaseRevision;
uint col = 0;
row++;
CheckButton check = new CheckButton();
checkCommit[check] = item;
table.Attach(check, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
check.Visible = false;
Gdk.Pixbuf statusicon = VersionControlService.LoadIconForStatus(n.Status);
if (n.Status == NodeStatus.Modified) {
Button b = new Button();
if (statusicon != null) {
Image img = new Image(statusicon);
img.Show();
b.Add(img);
} else {
b.Label = "Diff";
}
b.Relief = ReliefStyle.Half;
buttonsShowDiff[b] = item;
table.Attach(b, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
b.Clicked += new EventHandler(OnShowDiffClicked);
b.Show();
} else if (statusicon != null) {
Image img = new Image(statusicon);
img.Show();
table.Attach(img, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Fill, 2, 2);
} else {
++col;
}
Label status = new Label(n.Status.ToString());
status.Show();
table.Attach(status, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
Label name = new Label(); // I can't get this to left align!
name.Justify = Justification.Left;
name.Layout.Alignment = Pango.Alignment.Left;
name.Xalign = 0;
string localpath = n.LocalPath.Substring(filepath.Length);
if (localpath.Length > 0 && localpath[0] == Path.DirectorySeparatorChar) localpath = localpath.Substring(1);
if (localpath == "") { localpath = "."; } // not sure if this happens
name.Text = localpath;
name.Show();
table.Attach(name, col, ++col, row, row+1, AttachOptions.Expand, AttachOptions.Shrink, 2, 2);
if (remoteStatus) {
Label rstatus = new Label(n.RemoteStatus.ToString());
rstatus.Show();
table.Attach(rstatus, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
if (n.RemoteStatus == NodeStatus.Modified) {
Button b = new Button("View");
b.Relief = ReliefStyle.Half;
buttonsShowLog[b] = item;
table.Attach(b, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
b.Clicked += new EventHandler(OnShowLogClicked);
//.........这里部分代码省略.........