本文整理汇总了C#中Gtk.Dialog.SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Dialog.SetPosition方法的具体用法?C# Dialog.SetPosition怎么用?C# Dialog.SetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Dialog
的用法示例。
在下文中一共展示了Dialog.SetPosition方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
void Initialize(Window parent)
{
Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LadderLogic.Presentation.OpenFileDialog.glade");
Glade.XML glade = new Glade.XML(stream, "OpenFileDialog", null);
stream.Close();
glade.Autoconnect(this);
thisDialog = ((Gtk.Dialog)(glade.GetWidget("OpenFileDialog")));
thisDialog.Modal = true;
thisDialog.TransientFor = parent;
thisDialog.SetPosition (WindowPosition.Center);
}
示例2: Initialize
private void Initialize(Window parent)
{
var stream = Assembly
.GetExecutingAssembly()
.GetManifestResourceStream("LadderLogic.Presentation.UpdateDialog.glade");
var glade = new Glade.XML(stream, "dialog1", null);
if (stream != null)
{
stream.Close();
}
//Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
//stream.Close();
glade.Autoconnect(this);
_thisDialog = ((Dialog)(glade.GetWidget("dialog1")));
_thisDialog.SetPosition(WindowPosition.Center);
}
示例3: Initialize
void Initialize(Window parent)
{
var gladeRes = AppController.Instance.Config.AboutDialog;
var stream = Assembly
.GetExecutingAssembly()
.GetManifestResourceStream(gladeRes);
var glade = new Glade.XML(stream, AppController.Instance.Config.AboutDialogName, null);
if (stream != null)
{
stream.Close();
}
glade.Autoconnect(this);
_thisDialog = ((Dialog)(glade.GetWidget(AppController.Instance.Config.AboutDialogName)));
_thisDialog.Modal = true;
_thisDialog.TransientFor = parent;
_thisDialog.SetPosition (WindowPosition.Center);
}
示例4: Initialize
void Initialize(Window parent)
{
var stream = Assembly
.GetExecutingAssembly()
.GetManifestResourceStream("LadderLogic.Presentation.EnvironmentVariablesDialog.glade");
var glade = new Glade.XML(stream, "UnhandledExceptionDialog", null);
if (stream != null)
{
stream.Close();
}
//Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
//stream.Close();
glade.Autoconnect(this);
_thisDialog = ((Dialog)(glade.GetWidget("UnhandledExceptionDialog")));
//_thisDialog = ((Dialog)(glade.GetWidget(AppController.Instance.Config.UnhandledExceptionDialogName)));
//_thisDialog.Modal = true;
//_thisDialog.TransientFor = parent;
_thisDialog.SetPosition (WindowPosition.Center);
var env = CController.Instance.GetEnvironmentVariables ();
if (env != null) {
etBoard.Text = env.ArduinoBoard;
etPort.Text = env.ArduinoPort;
etPath.Text = env.ArduinoPath;
}
}
示例5: Initialize
void Initialize(Window parent, Exception ex)
{
var stream = Assembly
.GetExecutingAssembly()
.GetManifestResourceStream(AppController.Instance.Config.UnhandledExceptionDialog);
var glade = new Glade.XML(stream, AppController.Instance.Config.UnhandledExceptionDialogName, null);
if (stream != null)
{
stream.Close();
}
//Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
//stream.Close();
glade.Autoconnect(this);
_thisDialog = ((Dialog)(glade.GetWidget(AppController.Instance.Config.UnhandledExceptionDialogName)));
//_thisDialog = ((Dialog)(glade.GetWidget(AppController.Instance.Config.UnhandledExceptionDialogName)));
_thisDialog.Modal = true;
_thisDialog.TransientFor = parent;
_thisDialog.SetPosition (WindowPosition.Center);
textview1.Buffer.Text = ex.ToString ();
}
示例6: Initialize
void Initialize(Window parent, String text)
{
var stream = Assembly
.GetExecutingAssembly()
.GetManifestResourceStream(AppController.Instance.Config.SourceDialog);
var glade = new Glade.XML(stream, "UnhandledExceptionDialog", null);
if (stream != null)
{
stream.Close();
}
//Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
//stream.Close();
glade.Autoconnect(this);
_thisDialog = ((Dialog)(glade.GetWidget("UnhandledExceptionDialog")));
_thisDialog.Modal = true;
_thisDialog.TransientFor = parent;
_thisDialog.SetPosition (WindowPosition.Center);
textview1.Buffer.Text = text;
btnContinue.Clicked += (sender, e) => _thisDialog.HideAll();
btnUpload.Clicked += OnUpload;
miSave.Activated += OnSave;
miSaveAs.Activated += OnSaveAs;
miQuit.Activated += (object sender, EventArgs e) => _thisDialog.HideAll();
miAbout.Activated += (object sender, EventArgs e) => new AboutDialog (_thisDialog).ShowDialog();
}
示例7: OnCellBeginEdit
/// <summary>
/// User is about to edit a cell.
/// </summary>
/// <param name="sender">The sender of the event</param>
/// <param name="e">The event arguments</param>
private void OnCellBeginEdit(object sender, EditingStartedArgs e)
{
this.userEditingCell = true;
IGridCell where = GetCurrentCell;
if (where.RowIndex >= DataSource.Rows.Count)
{
for (int i = DataSource.Rows.Count; i <= where.RowIndex; i++)
{
DataRow row = DataSource.NewRow();
DataSource.Rows.Add(row);
}
}
this.valueBeforeEdit = this.DataSource.Rows[where.RowIndex][where.ColumnIndex];
Type dataType = this.valueBeforeEdit.GetType();
if (dataType == typeof(DateTime))
{
Dialog dialog = new Dialog("Select date", gridview.Toplevel as Window, DialogFlags.DestroyWithParent);
dialog.SetPosition(WindowPosition.None);
VBox topArea = dialog.VBox;
topArea.PackStart(new HBox());
Calendar calendar = new Calendar();
calendar.DisplayOptions = CalendarDisplayOptions.ShowHeading |
CalendarDisplayOptions.ShowDayNames |
CalendarDisplayOptions.ShowWeekNumbers;
calendar.Date = (DateTime)this.valueBeforeEdit;
topArea.PackStart(calendar, true, true, 0);
dialog.ShowAll();
dialog.Run();
// What SHOULD we do here? For now, assume that if the user modified the date in the calendar dialog,
// the resulting date is what they want. Otherwise, keep the text-editing (Entry) widget active, and
// let the user enter a value manually.
if (calendar.Date != (DateTime)this.valueBeforeEdit)
{
DateTime date = calendar.GetDate();
this.DataSource.Rows[where.RowIndex][where.ColumnIndex] = date;
CellRendererText render = sender as CellRendererText;
if (render != null)
{
render.Text = String.Format("{0:d}", date);
if (e.Editable is Entry)
{
(e.Editable as Entry).Text = render.Text;
(e.Editable as Entry).Destroy();
this.userEditingCell = false;
if (this.CellsChanged != null)
{
GridCellsChangedArgs args = new GridCellsChangedArgs();
args.ChangedCells = new List<IGridCell>();
args.ChangedCells.Add(this.GetCell(where.ColumnIndex, where.RowIndex));
this.CellsChanged(this, args);
}
}
}
}
dialog.Destroy();
}
}