本文整理汇总了C#中Gtk.Entry.SelectRegion方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.SelectRegion方法的具体用法?C# Entry.SelectRegion怎么用?C# Entry.SelectRegion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Entry
的用法示例。
在下文中一共展示了Entry.SelectRegion方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateActions
private Widget CreateActions()
{
VBox actionsVBox = new VBox(false, 0);
actionsVBox.WidthRequest = 250;
Label l = new Label("<span size=\"small\"></span>");
actionsVBox.PackStart(l, false, false, 0);
l.UseMarkup = true;
l = new Label(
string.Format(
"<span size=\"x-large\">{0}</span>",
Util.GS("Filter")));
actionsVBox.PackStart(l, false, false, 0);
l.UseMarkup = true;
l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected));
l.Xalign = 0.0F;
HBox searchHBox = new HBox(false, 4);
actionsVBox.PackStart(searchHBox, false, false, 0);
SearchEntry = new Entry();
searchHBox.PackStart(SearchEntry, true, true, 0);
SearchEntry.SelectRegion(0, -1);
SearchEntry.CanFocus = true;
SearchEntry.Changed +=
new EventHandler(OnSearchEntryChanged);
Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu);
stopImage.SetAlignment(0.5F, 0F);
CancelSearchButton = new Button(stopImage);
searchHBox.PackEnd(CancelSearchButton, false, false, 0);
CancelSearchButton.Relief = ReliefStyle.None;
CancelSearchButton.Sensitive = false;
CancelSearchButton.Clicked +=
new EventHandler(OnCancelSearchButton);
l = new Label("<span size=\"small\"></span>");
actionsVBox.PackStart(l, false, false, 0);
l.UseMarkup = true;
l = new Label(
string.Format(
"<span size=\"x-large\">{0}</span>",
Util.GS("General Actions")));
actionsVBox.PackStart(l, false, false, 0);
l.UseMarkup = true;
l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected));
l.Xalign = 0.0F;
HBox spacerHBox = new HBox(false, 0);
actionsVBox.PackStart(spacerHBox, false, false, 0);
spacerHBox.PackStart(new Label(""), false, false, 4);
VBox vbox = new VBox(false, 0);
spacerHBox.PackStart(vbox, true, true, 0);
HBox hbox = new HBox(false, 0);
AddiFolderButton = new Button(hbox);
vbox.PackStart(AddiFolderButton, false, false, 0);
AddiFolderButton.Relief = ReliefStyle.None;
Label buttonText = new Label(
string.Format("<span size=\"large\">{0}</span>",
Util.GS("Upload a folder...")));
hbox.PackStart(buttonText, false, false, 4);
buttonText.UseMarkup = true;
buttonText.UseUnderline = false;
buttonText.Xalign = 0;
AddiFolderButton.Clicked +=
new EventHandler(AddiFolderHandler);
hbox = new HBox(false, 0);
ShowHideAllFoldersButton = new Button(hbox);
vbox.PackStart(ShowHideAllFoldersButton, false, false, 0);
ShowHideAllFoldersButton.Relief = ReliefStyle.None;
ShowHideAllFoldersButtonText = new Label(
string.Format("<span size=\"large\">{0}</span>",
Util.GS("View available iFolders")));
hbox.PackStart(ShowHideAllFoldersButtonText, false, false, 4);
ShowHideAllFoldersButtonText.UseMarkup = true;
ShowHideAllFoldersButtonText.UseUnderline = false;
ShowHideAllFoldersButtonText.Xalign = 0;
ShowHideAllFoldersButton.Clicked +=
new EventHandler(ShowHideAllFoldersHandler);
l = new Label("<span size=\"small\"></span>");
actionsVBox.PackStart(l, false, false, 0);
l.UseMarkup = true;
SynchronizedFolderTasks = new VBox(false, 0);
actionsVBox.PackStart(SynchronizedFolderTasks, false, false, 0);
l = new Label(
string.Format(
"<span size=\"x-large\">{0}</span>",
Util.GS("iFolder Actions")));
SynchronizedFolderTasks.PackStart(l, false, false, 0);
l.UseMarkup = true;
l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected));
l.Xalign = 0.0F;
spacerHBox = new HBox(false, 0);
SynchronizedFolderTasks.PackStart(spacerHBox, false, false, 0);
spacerHBox.PackStart(new Label(""), false, false, 4);
vbox = new VBox(false, 0);
spacerHBox.PackStart(vbox, true, true, 0);
hbox = new HBox(false, 0);
OpenSynchronizedFolderButton = new Button(hbox);
vbox.PackStart(OpenSynchronizedFolderButton, false, false, 0);
OpenSynchronizedFolderButton.Relief = ReliefStyle.None;
buttonText = new Label(
string.Format("<span size=\"large\">{0}</span>",
Util.GS("Open...")));
hbox.PackStart(buttonText, false, false, 4);
buttonText.UseMarkup = true;
//.........这里部分代码省略.........
示例2: BuildWindow
private void BuildWindow()
{
DefaultWidth = 475;
BorderWidth = 6;
ContentArea.Spacing = 12;
ActionArea.Layout = Gtk.ButtonBoxStyle.End;
HBox box = new HBox();
box.BorderWidth = 6;
box.Spacing = 12;
Image image = new Image (IconThemeUtils.LoadIcon (48, "podcast"));
image.Yalign = 0.0f;
box.PackStart(image, false, true, 0);
VBox contentBox = new VBox();
contentBox.Spacing = 12;
Label header = new Label();
header.Markup = String.Format (
"<big><b>{0}</b></big>",
GLib.Markup.EscapeText (Catalog.GetString ("Subscribe to New Podcast"))
);
header.Justify = Justification.Left;
header.SetAlignment (0.0f, 0.0f);
var message = new WrapLabel () {
Markup = Catalog.GetString (
"Please enter the URL of the podcast to which you would like to subscribe."
),
Wrap = true
};
url_entry = new Entry ();
url_entry.ActivatesDefault = true;
// If the user has copied some text to the clipboard that starts with http, set
// our url entry to it and select it
Clipboard clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
if (clipboard != null) {
string pasted = clipboard.WaitForText ();
if (!String.IsNullOrEmpty (pasted)) {
if (pasted.StartsWith ("http")) {
url_entry.Text = pasted.Trim ();
url_entry.SelectRegion (0, url_entry.Text.Length);
}
}
}
contentBox.PackStart (header, true, true, 0);
contentBox.PackStart (message, true, true, 0);
var url_box = new HBox () { Spacing = 12 };
url_box.PackStart (new Label (Catalog.GetString ("URL:")), false, false, 0);
url_box.PackStart (url_entry, true, true, 0);
contentBox.PackStart (url_box, false, false, 0);
var options_label = new Label () {
Markup = String.Format ("<b>{0}</b>", GLib.Markup.EscapeText (Catalog.GetString ("Subscription Options"))),
Xalign = 0f
};
download_check = new CheckButton (Catalog.GetString ("Download new episodes"));
archive_check = new CheckButton (Catalog.GetString ("Archive all episodes except the newest one"));
var options_box = new VBox () { Spacing = 3 };
options_box.PackStart (options_label, false, false, 0);
options_box.PackStart (new Gtk.Alignment (0f, 0f, 0f, 0f) { LeftPadding = 12, Child = download_check }, false, false, 0);
options_box.PackStart (new Gtk.Alignment (0f, 0f, 0f, 0f) { LeftPadding = 12, Child = archive_check }, false, false, 0);
contentBox.PackStart (options_box, false, false, 0);
box.PackStart (contentBox, true, true, 0);
AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
AddButton (Catalog.GetString ("Subscribe"), ResponseType.Ok, true);
box.ShowAll ();
ContentArea.Add (box);
}
示例3: CreateiFolderActionButtonArea
//.........这里部分代码省略.........
new EventHandler(OnResolveConflicts);
buttontips.SetTip(ResolveConflictsButton, Util.GS("Resolve conflicts"),"");
SynchronizedFolderTasks = new VBox(false, 0);
ButtonControl.PackStart(SynchronizedFolderTasks, false, false, 0);
spacerHBox = new HBox(false, 0);
SynchronizedFolderTasks.PackStart(spacerHBox, false, false, 0);
hbox = new HBox(false, 0);
OpenSynchronizedFolderButton = new Button(hbox);
vbox.PackStart(OpenSynchronizedFolderButton, false, false, 0);
buttonText = new Label(
string.Format("<span>{0}</span>",
Util.GS("Open...")));
hbox.PackStart(buttonText, false, false, 4);
buttonText.UseMarkup = true;
buttonText.UseUnderline = false;
buttonText.Xalign = 0;
OpenSynchronizedFolderButton.Visible = false;
OpenSynchronizedFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")));
OpenSynchronizedFolderButton.Clicked +=
new EventHandler(OnOpenSynchronizedFolder);
buttontips.SetTip(OpenSynchronizedFolderButton, Util.GS("Open iFolder"),"");
hbox = new HBox(false, 0);
SynchronizeNowButton = new Button(hbox);
vbox.PackStart(SynchronizeNowButton, false, false, 0);
buttonText = new Label(
string.Format("<span>{0}</span>",
Util.GS("Synchronize Now")));
hbox.PackStart(buttonText, true, true, 4);
buttonText.UseMarkup = true;
buttonText.UseUnderline = false;
buttonText.Xalign = 0;
SynchronizeNowButton.Sensitive = false;
SynchronizeNowButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-sync48.png")));
SynchronizeNowButton.Clicked +=
new EventHandler(OnSynchronizeNow);
buttontips.SetTip(SynchronizeNowButton, Util.GS("Synchronize Now"),"");
hbox = new HBox(false, 0);
RemoveiFolderButton = new Button(hbox);
vbox.PackStart(RemoveiFolderButton, false, false, 0);
buttonText = new Label(
string.Format("<span>{0}</span>",
Util.GS("Revert to a Normal Folder")));
hbox.PackStart(buttonText, true, true, 4);
buttonText.UseMarkup = true;
buttonText.UseUnderline = false;
buttonText.Xalign = 0;
RemoveiFolderButton.Sensitive = false;
RemoveiFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("revert48.png")));
RemoveiFolderButton.Clicked +=
new EventHandler(RemoveiFolderHandler);
buttontips.SetTip(RemoveiFolderButton, Util.GS("Revert to a Normal Folder"),"");
hbox = new HBox(false, 0);
ViewFolderPropertiesButton = new Button(hbox);
vbox.PackStart(ViewFolderPropertiesButton, false, false, 0);
buttonText = new Label(
string.Format("<span>{0}</span>",
Util.GS("Properties...")));
hbox.PackStart(buttonText, true, true, 4);
buttonText.UseMarkup = true;
buttonText.UseUnderline = false;
buttonText.Xalign = 0;
ViewFolderPropertiesButton.Visible = false;
ViewFolderPropertiesButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")));
ViewFolderPropertiesButton.Clicked +=
new EventHandler(OnShowFolderProperties);
buttontips.SetTip(ViewFolderPropertiesButton, Util.GS("Properties"),"");
ButtonControl.PackStart(new Label(""), false, false, 4);
HBox searchHBox = new HBox(false, 4);
searchHBox.WidthRequest = 110;
ButtonControl.PackEnd(searchHBox, false, false, 0);
SearchEntry = new Entry();
searchHBox.PackStart(SearchEntry, true, true, 0);
SearchEntry.SelectRegion(0, -1);
SearchEntry.CanFocus = true;
SearchEntry.Changed +=
new EventHandler(OnSearchEntryChanged);
Label l = new Label("<span size=\"small\"></span>");
l = new Label(
string.Format(
"<span size=\"large\">{0}</span>",
Util.GS("Filter")));
ButtonControl.PackEnd(l, false, false, 0);
l.UseMarkup = true;
l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected));
l.Xalign = 0.0F;
VBox viewChanger = new VBox(false,0);
string[] list = {Util.GS("Open Panel"),Util.GS("Close Panel"),Util.GS("Thumbnail View"),Util.GS("List View") };
viewList = new ComboBoxEntry (list);
viewList.Active = 0;
viewList.WidthRequest = 110;
viewList.Changed += new EventHandler(OnviewListIndexChange);
VBox dummyVbox = new VBox(false,0);
Label labeldummy = new Label( string.Format( ""));
labeldummy.UseMarkup = true;
dummyVbox.PackStart(labeldummy,false,true,0);
viewChanger.PackStart(dummyVbox,false,true,0);
viewChanger.PackStart(viewList,false,true,0);
ButtonControl.PackEnd(viewChanger, false, true,0);
return buttonArea;
}
示例4: BuildWindow
private void BuildWindow ()
{
DefaultWidth = 475;
BorderWidth = 6;
VBox.Spacing = 12;
ActionArea.Layout = Gtk.ButtonBoxStyle.End;
HBox box = new HBox();
box.BorderWidth = 6;
box.Spacing = 12;
Image image = new Image (IconThemeUtils.LoadIcon (48, "podcast"));
image.Yalign = 0.0f;
box.PackStart(image, false, true, 0);
VBox contentBox = new VBox();
contentBox.Spacing = 12;
Label header = new Label();
header.Markup = String.Format (
"<big><b>{0}</b></big>",
GLib.Markup.EscapeText (Catalog.GetString ("Subscribe to New Podcast"))
);
header.Justify = Justification.Left;
header.SetAlignment (0.0f, 0.0f);
WrapLabel message = new WrapLabel ();
message.Markup = Catalog.GetString (
"Please enter the URL of the podcast to which you would like to subscribe."
);
message.Wrap = true;
VBox sync_vbox = new VBox ();
VBox expander_children = new VBox();
//expander_children.BorderWidth = 6;
expander_children.Spacing = 6;
Label sync_text = new Label (
Catalog.GetString ("When new episodes are available: ")
);
sync_text.SetAlignment (0.0f, 0.0f);
sync_text.Justify = Justification.Left;
syncCombo = new SyncPreferenceComboBox ();
expander_children.PackStart (sync_text, true, true, 0);
expander_children.PackStart (syncCombo, true, true, 0);
sync_vbox.Add (expander_children);
url_entry = new Entry ();
url_entry.ActivatesDefault = true;
// If the user has copied some text to the clipboard that starts with http, set
// our url entry to it and select it
Clipboard clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
if (clipboard != null) {
string pasted = clipboard.WaitForText ();
if (!String.IsNullOrEmpty (pasted)) {
if (pasted.StartsWith ("http")) {
url_entry.Text = pasted.Trim ();
url_entry.SelectRegion (0, url_entry.Text.Length);
}
}
}
Table table = new Table (1, 2, false);
table.RowSpacing = 6;
table.ColumnSpacing = 12;
table.Attach (
new Label (Catalog.GetString ("URL:")), 0, 1, 0, 1,
AttachOptions.Shrink, AttachOptions.Shrink, 0, 0
);
table.Attach (
url_entry, 1, 2, 0, 1,
AttachOptions.Expand | AttachOptions.Fill,
AttachOptions.Shrink, 0, 0
);
table.Attach (
sync_vbox, 0, 2, 1, 2,
AttachOptions.Expand | AttachOptions.Fill,
AttachOptions.Shrink, 0, 0
);
contentBox.PackStart (header, true, true, 0);
contentBox.PackStart (message, true, true, 0);
contentBox.PackStart (table, true, true, 0);
box.PackStart (contentBox, true, true, 0);
//.........这里部分代码省略.........
示例5: TextPrompt
public static void TextPrompt(string title, string labelText, string entryText, string buttonText,
int position, int selectStart, int selectEnd, TextPromptHandler onOk)
{
Dialog d = new Dialog();
d.Modal = false;
d.ActionArea.Layout = ButtonBoxStyle.Spread;
d.HasSeparator = false;
d.BorderWidth = 10;
d.Title = title;
Label label = new Label (labelText);
label.UseUnderline = false;
d.VBox.Add (label);
Entry e = new Entry (entryText);
e.WidthChars = Math.Min(100, e.Text.Length + 10);
e.Activated += new EventHandler (delegate { d.Respond(ResponseType.Ok); });
d.VBox.Add (e);
d.AddButton (buttonText, ResponseType.Ok);
d.Response += new ResponseHandler(delegate (object obj, ResponseArgs args) {
if (args.ResponseId == ResponseType.Ok) {
onOk(e.Text);
} else {
LogError (args.ResponseId);
}
d.Unrealize ();
d.Destroy ();
});
d.ShowAll ();
e.Position = position;
e.SelectRegion(selectStart, selectEnd);
}
示例6: ShowCustomizePage
//.........这里部分代码省略.........
localfolder_entry.Changed += delegate {
localrepopath_entry.Text = System.IO.Path.Combine(Controller.DefaultRepoPath, localfolder_entry.Text);
};
Label localfolder_error_label = new Label() {
Xalign = 0,
UseMarkup = true,
Markup = ""
};
Button cancel_button = new Button(cancelText);
Button add_button = new Button(
CmisSync.Properties_Resources.ResourceManager.GetString("Add", CultureInfo.CurrentCulture)
);
Button back_button = new Button(
CmisSync.Properties_Resources.ResourceManager.GetString("Back", CultureInfo.CurrentCulture)
);
Controller.UpdateAddProjectButtonEvent += delegate(bool button_enabled) {
Gtk.Application.Invoke(delegate {
add_button.Sensitive = button_enabled;
});
};
string error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text);
if (!String.IsNullOrEmpty(error)) {
localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" +
CmisSync.Properties_Resources.ResourceManager.GetString(error, CultureInfo.CurrentCulture) +
"</span>";
localfolder_error_label.Show();
} else {
localfolder_error_label.Hide();
}
localfolder_entry.Changed += delegate {
error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text);
if (!String.IsNullOrEmpty(error)) {
localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" +
CmisSync.Properties_Resources.ResourceManager.GetString(error, CultureInfo.CurrentCulture) +
"</span>";
localfolder_error_label.Show();
} else {
localfolder_error_label.Hide();
}
};
error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text);
if (!String.IsNullOrEmpty(error)) {
localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" +
CmisSync.Properties_Resources.ResourceManager.GetString(error, CultureInfo.CurrentCulture) +
"</span>";
localfolder_error_label.Show();
} else {
localfolder_error_label.Hide();
}
localrepopath_entry.Changed += delegate {
error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text);
if (!String.IsNullOrEmpty(error)) {
localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" +
CmisSync.Properties_Resources.ResourceManager.GetString(error, CultureInfo.CurrentCulture) +
"</span>";
localfolder_error_label.Show();
} else {
localfolder_error_label.Hide();
}
};
cancel_button.Clicked += delegate {
Controller.PageCancelled();
};
back_button.Clicked += delegate {
Controller.BackToPage2();
};
add_button.Clicked += delegate {
Controller.CustomizePageCompleted(localfolder_entry.Text, localrepopath_entry.Text);
};
VBox layout_vertical = new VBox (false, 12);
layout_vertical.PackStart (new Label(""), false, false, 0);
layout_vertical.PackStart (localfolder_label, true, true, 0);
layout_vertical.PackStart (localfolder_entry, true, true, 0);
layout_vertical.PackStart (localrepopath_label, true, true, 0);
layout_vertical.PackStart (localrepopath_entry, true, true, 0);
layout_vertical.PackStart (localfolder_error_label, true, true, 0);
Add(layout_vertical);
AddButton(back_button);
AddButton(add_button);
AddButton(cancel_button);
// add_button.GrabFocus();
localfolder_entry.GrabFocus();
localfolder_entry.SelectRegion(0, localfolder_entry.Text.Length);
}
示例7: InitializeWidgets
private void InitializeWidgets()
{
this.SetDefaultSize (500, 400);
this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));
VBox dialogBox = new VBox();
dialogBox.Spacing = 10;
dialogBox.BorderWidth = 10;
this.VBox.PackStart(dialogBox, true, true, 0);
Label l = new Label(
string.Format("<span size=\"large\" weight=\"bold\">{0}</span>",
Util.GS("Add users to this iFolder")));
l.Xalign = 0;
l.UseMarkup = true;
dialogBox.PackStart(l, false, false, 0);
HBox selBox = new HBox(false, 10);
dialogBox.PackStart(selBox, true, true, 0);
VBox vbox = new VBox(false, 0);
selBox.PackStart(vbox, false, false, 0);
HBox searchHBox = new HBox(false, 4);
vbox.PackStart(searchHBox, false, false, 0);
Label findLabel = new Label(Util.GS("_Find:"));
searchHBox.PackStart(findLabel, false, false, 0);
findLabel.Xalign = 0;
SearchEntry = new Entry();
searchHBox.PackStart(SearchEntry, true, true, 0);
findLabel.MnemonicWidget = SearchEntry;
SearchEntry.SelectRegion(0, -1);
SearchEntry.CanFocus = true;
SearchEntry.Changed +=
new EventHandler(OnSearchEntryChanged);
Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu);
stopImage.SetAlignment(0.5F, 0F);
CancelSearchButton = new Button(stopImage);
searchHBox.PackEnd(CancelSearchButton, false, false, 0);
CancelSearchButton.Relief = ReliefStyle.None;
CancelSearchButton.Sensitive = false;
CancelSearchButton.Clicked +=
new EventHandler(OnCancelSearchButton);
memberListModel = new MemberListModel(domainID, simws);
memberList = new BigList(memberListModel);
ScrolledWindow sw = new ScrolledWindow(memberList.HAdjustment, memberList.VAdjustment);
sw.ShadowType = Gtk.ShadowType.EtchedIn;
sw.Add(memberList);
vbox.PackStart(sw, true, true, 0);
memberList.ItemSelected += new ItemSelected(OnMemberIndexSelected);
memberList.ItemActivated += new ItemActivated(OnMemberIndexActivated);
VBox btnBox = new VBox();
btnBox.Spacing = 10;
selBox.PackStart(btnBox, false, false, 0);
Label spacer = new Label("");
btnBox.PackStart(spacer, true, true, 0);
HBox buttonHBox = new HBox(false, 4);
spacer = new Label("");
buttonHBox.PackStart(spacer, true, true, 0);
Label buttonLabel = new Label(Util.GS("_Add"));
buttonHBox.PackStart(buttonLabel, false, false, 0);
Image buttonImage = new Image(Stock.GoForward, IconSize.Button);
buttonHBox.PackStart(buttonImage, false, false, 0);
spacer = new Label("");
buttonHBox.PackStart(spacer, true, true, 0);
UserAddButton = new Button(buttonHBox);
btnBox.PackStart(UserAddButton, false, true, 0);
UserAddButton.Clicked += new EventHandler(OnAddButtonClicked);
buttonHBox = new HBox(false, 4);
spacer = new Label("");
buttonHBox.PackStart(spacer, true, true, 0);
buttonImage = new Image(Stock.GoBack, IconSize.Button);
buttonHBox.PackStart(buttonImage, false, false, 0);
buttonLabel = new Label(Util.GS("_Remove"));
buttonHBox.PackStart(buttonLabel, false, false, 0);
spacer = new Label("");
buttonHBox.PackStart(spacer, true, true, 0);
UserDelButton = new Button(buttonHBox);
btnBox.PackStart(UserDelButton, false, true, 0);
UserDelButton.Clicked += new EventHandler(OnRemoveButtonClicked);
spacer = new Label("");
btnBox.PackStart(spacer, true, true, 0);
vbox = new VBox(false, 0);
selBox.PackStart(vbox, true, true, 0);
l = new Label(Util.GS("_Users to add:"));
l.Xalign = 0;
vbox.PackStart(l, false, false, 0);
SelTreeView = new TreeView();
ScrolledWindow ssw = new ScrolledWindow();
ssw.ShadowType = Gtk.ShadowType.EtchedIn;
ssw.Add(SelTreeView);
vbox.PackStart(ssw, true, true, 0);
ssw.WidthRequest = 200;
l.MnemonicWidget = SelTreeView;
SelTreeStore = new ListStore(typeof(MemberInfo));
SelTreeStore.SetSortFunc(
0,
new TreeIterCompareFunc(SelTreeStoreSortFunction));
SelTreeStore.SetSortColumnId(0, SortType.Ascending);
SelTreeView.Model = SelTreeStore;
SelTreeView.HeadersVisible = false;
TreeViewColumn selmemberColumn = new TreeViewColumn();
CellRendererText smcrt = new CellRendererText();
selmemberColumn.PackStart(smcrt, false);
selmemberColumn.SetCellDataFunc(smcrt, new TreeCellDataFunc(
//.........这里部分代码省略.........
示例8: ShowCustomizePage
//.........这里部分代码省略.........
try{
localrepopath_entry.Text = System.IO.Path.Combine(Controller.DefaultRepoPath, localfolder_entry.Text);
}catch(Exception){}
};
Label localfolder_error_label = new Label() {
Xalign = 0,
UseMarkup = true,
Markup = ""
};
Button cancel_button = new Button(cancelText);
Button add_button = new Button(
CmisSync.Properties_Resources.Add
);
Button back_button = new Button(
CmisSync.Properties_Resources.Back
);
Controller.UpdateAddProjectButtonEvent += delegate(bool button_enabled) {
Gtk.Application.Invoke(delegate {
add_button.Sensitive = button_enabled;
});
};
string error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text);
if (!String.IsNullOrEmpty(error)) {
localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" +
error +
"</span>";
localfolder_error_label.Show();
} else {
localfolder_error_label.Hide();
}
localfolder_entry.Changed += delegate {
error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text);
if (!String.IsNullOrEmpty(error)) {
localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" +
error +
"</span>";
localfolder_error_label.Show();
} else {
localfolder_error_label.Hide();
}
};
error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text);
if (!String.IsNullOrEmpty(error)) {
localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" +
error +
"</span>";
localfolder_error_label.Show();
} else {
localfolder_error_label.Hide();
}
localrepopath_entry.Changed += delegate {
error = Controller.CheckRepoPathAndName(localrepopath_entry.Text, localfolder_entry.Text);
if (!String.IsNullOrEmpty(error)) {
localfolder_error_label.Markup = "<span foreground=\"#ff8080\">" +
error +
"</span>";
localfolder_error_label.Show();
} else {
localfolder_error_label.Hide();
}
};
cancel_button.Clicked += delegate {
Controller.PageCancelled();
};
back_button.Clicked += delegate {
Controller.BackToPage2();
};
add_button.Clicked += delegate {
Controller.CustomizePageCompleted(localfolder_entry.Text, localrepopath_entry.Text);
};
VBox layout_vertical = new VBox (false, 12);
layout_vertical.PackStart (new Label(""), false, false, 0);
layout_vertical.PackStart (localfolder_label, true, true, 0);
layout_vertical.PackStart (localfolder_entry, true, true, 0);
layout_vertical.PackStart (localrepopath_label, true, true, 0);
layout_vertical.PackStart (localrepopath_entry, true, true, 0);
layout_vertical.PackStart (localfolder_error_label, true, true, 0);
Add(layout_vertical);
AddButton(back_button);
AddButton(cancel_button);
AddButton(add_button);
// add_button.GrabFocus();
localfolder_entry.GrabFocus();
localfolder_entry.SelectRegion(0, localfolder_entry.Text.Length);
}
示例9: InitializeWidgets
private void InitializeWidgets()
{
this.SetDefaultSize (500, 400);
this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolderuser.png"));
VBox dialogBox = new VBox();
dialogBox.Spacing = 10;
dialogBox.BorderWidth = 10;
this.VBox.PackStart(dialogBox, true, true, 0);
Table findTable = new Table(2, 3, false);
dialogBox.PackStart(findTable, false, false, 0);
findTable.ColumnSpacing = 20;
findTable.RowSpacing = 5;
Label findLabel = new Label(Util.GS("Find:"));
findLabel.Xalign = 0;
findTable.Attach(findLabel, 0, 1, 0, 1,
AttachOptions.Shrink, 0, 0, 0);
SearchAttribComboBox = ComboBox.NewText();
SearchAttribComboBox.AppendText(Util.GS("First Name"));
SearchAttribComboBox.AppendText(Util.GS("Last Name"));
SearchAttribComboBox.AppendText(Util.GS("Full Name"));
SearchAttribComboBox.Active = 2;
SearchAttribComboBox.Changed += new EventHandler(OnSearchAttribComboBoxChanged);
findTable.Attach(SearchAttribComboBox, 1, 2, 0, 1,
AttachOptions.Shrink, 0, 0, 0);
SearchEntry = new Gtk.Entry(Util.GS("<Enter text to find a user>"));
SearchEntry.SelectRegion(0, -1);
SearchEntry.CanFocus = true;
SearchEntry.Changed += new EventHandler(OnSearchEntryChanged);
findTable.Attach(SearchEntry, 2, 3, 0, 1,
AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
Label findHelpTextLabel = new Label(Util.GS("(Full or partial name)"));
findHelpTextLabel.Xalign = 0;
findTable.Attach(findHelpTextLabel, 2,3,1,2,
AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
HBox selBox = new HBox();
selBox.Spacing = 10;
dialogBox.PackStart(selBox, true, true, 0);
memberListModel = new MemberListModel(domainID, simws);
memberList = new BigList(memberListModel);
ScrolledWindow sw = new ScrolledWindow(memberList.HAdjustment, memberList.VAdjustment);
sw.ShadowType = Gtk.ShadowType.EtchedIn;
sw.Add(memberList);
selBox.PackStart(sw, true, true, 0);
memberList.ItemSelected += new ItemSelected(OnMemberIndexSelected);
memberList.ItemActivated += new ItemActivated(OnMemberIndexActivated);
VBox btnBox = new VBox();
btnBox.Spacing = 10;
selBox.PackStart(btnBox, false, true, 0);
UserAddButton = new Button(Util.GS("_Add >>"));
btnBox.PackStart(UserAddButton, false, true, 0);
UserAddButton.Clicked += new EventHandler(OnAddButtonClicked);
UserDelButton = new Button(Util.GS("_Remove"));
btnBox.PackStart(UserDelButton, false, true, 0);
UserDelButton.Clicked += new EventHandler(OnRemoveButtonClicked);
SelTreeView = new TreeView();
ScrolledWindow ssw = new ScrolledWindow();
ssw.ShadowType = Gtk.ShadowType.EtchedIn;
ssw.Add(SelTreeView);
selBox.PackStart(ssw, true, true, 0);
SelTreeStore = new ListStore(typeof(MemberInfo));
SelTreeView.Model = SelTreeStore;
CellRendererPixbuf smcrp = new CellRendererPixbuf();
TreeViewColumn selmemberColumn = new TreeViewColumn();
selmemberColumn.PackStart(smcrp, false);
selmemberColumn.SetCellDataFunc(smcrp, new TreeCellDataFunc(
UserCellPixbufDataFunc));
CellRendererText smcrt = new CellRendererText();
selmemberColumn.PackStart(smcrt, false);
selmemberColumn.SetCellDataFunc(smcrt, new TreeCellDataFunc(
UserCellTextDataFunc));
selmemberColumn.Title = Util.GS("Selected Users");
selmemberColumn.Resizable = true;
SelTreeView.AppendColumn(selmemberColumn);
SelTreeView.Selection.Mode = SelectionMode.Multiple;
SelTreeView.Selection.Changed += new EventHandler(
OnSelUserSelectionChanged);
UserPixBuf =
new Gdk.Pixbuf(Util.ImagesPath("ifolderuser.png"));
this.AddButton(Stock.Cancel, ResponseType.Cancel);
this.AddButton(Stock.Ok, ResponseType.Ok);
this.AddButton(Stock.Help, ResponseType.Help);
SearchiFolderUsers();
}
示例10: CreateSidebarSearchEntry
/* private void OnStatusComboKeyPress (object sender, KeyPressEventArgs args)
{
if (args.Event.Key == Gdk.Key.Return) {
if (PersonManager.Me != null) {
Logger.Debug ("FIXME: Set \"my\" status to: {0}",
statusComboBoxEntry.ActiveText);
PersonManager.Me.Presence.Message =
statusComboBoxEntry.ActiveText;
}
}
}
*/
/* private void OnStatusComboChanged (object sender, EventArgs args)
{
Logger.Debug ("OnStatusComboChanged");
}
*/
private Widget CreateSidebarSearchEntry()
{
VBox vbox = new VBox (false, 0);
Label l = new Label (
string.Format ("<span size=\"large\">{0}</span>",
Catalog.GetString ("Filter")));
l.UseMarkup = true;
l.ModifyFg (StateType.Normal, this.Style.Base (StateType.Selected));
l.Xalign = 0;
l.Show ();
vbox.PackStart (l, false, false, 0);
searchEntry = new Entry ();
searchEntry.SelectRegion (0, -1);
searchEntry.CanFocus = true;
searchEntry.Changed += OnSearchEntryChanged;
searchEntry.Show ();
Image stopImage = new Image (Stock.Stop, Gtk.IconSize.Menu);
stopImage.SetAlignment (0.5F, 0.0F);
cancelSearchButton = new Button (stopImage);
cancelSearchButton.Relief = ReliefStyle.None;
cancelSearchButton.Sensitive = false;
cancelSearchButton.Clicked += OnCancelSearchButton;
cancelSearchButton.Show ();
HBox searchHBox = new HBox (false, 4);
searchHBox.PackStart (searchEntry, true, true, 0);
searchHBox.PackStart (cancelSearchButton, false, false, 0);
searchHBox.Show ();
vbox.PackStart (searchHBox, false, false, 0);
return vbox;
}