本文整理汇总了C#中Xwt.ButtonEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ButtonEventArgs类的具体用法?C# ButtonEventArgs怎么用?C# ButtonEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ButtonEventArgs类属于Xwt命名空间,在下文中一共展示了ButtonEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleButtonPressed
private void HandleButtonPressed(object sender, ButtonEventArgs e)
{
if(!e.Handled)
{
handler.ButtonPressed(e.Button);
e.Handled = true;
}
}
示例2: OnButtonPressed
protected override void OnButtonPressed(ButtonEventArgs args)
{
base.OnButtonPressed(args);
if (args.Button == PointerButton.Left)
mDown = true;
QueueDraw();
}
示例3: OnButtonReleased
protected override void OnButtonReleased(ButtonEventArgs args)
{
if (args.X > 16)
base.OnButtonReleased(args);
if (args.Button == PointerButton.Left)
{
mDown = false;
QueueDraw();
}
}
示例4: OnButtonPressed
protected override void OnButtonPressed(ButtonEventArgs args)
{
GradientButton B = Buttons.FirstOrDefault(X => CheckIfIn(args.Position, X));
try
{
B.ButtonPressed();
}
catch (Exception e)
{
Xwt.MessageDialog.ShowError(String.Format("Не удается выполнить {0}: {1}", B.Text, e.Message));
}
}
示例5: OnButtonReleased
protected override void OnButtonReleased(ButtonEventArgs args)
{
base.OnButtonReleased(args);
if (args.Button == PointerButton.Left)
{
if (Click != null)
Click(this, EventArgs.Empty);
mDown = false;
QueueDraw();
}
}
示例6: OnButtonPressed
protected override void OnButtonPressed(ButtonEventArgs args)
{
base.OnButtonPressed(args);
if (PluginType == FPlug.PluginType.Hud)
{
new Task(() =>
{
System.Threading.Thread.Sleep(50);
Application.Invoke(() =>
{
var d = new HudsTFDisplay();
d.Show();
d.Present();
});
}).Start();
}
}
示例7: OnButtonPressed
/// <summary>
/// OnButtonPressed method for AxisDrag interaction
/// </summary>
public override bool OnButtonPressed(ButtonEventArgs args, PlotCanvas pc)
{
// if the mouse is inside the plot area (the tick marks may be here,
// and are counted as part of the axis), then *don't* invoke scaling
if (pc.PlotAreaBoundingBoxCache.Contains(args.X, args.Y)) {
return false;
}
if (args.Button == PointerButton.Left) {
// see if hit with axis. NB Only one axis object will be returned
ArrayList objects = pc.HitTest (new Point(args.X, args.Y));
foreach (object o in objects) {
if (o is Axis) {
dragging = true;
Axis axis = (Axis)o;
if (pc.PhysicalXAxis1Cache.Axis == axis) {
physicalAxis = pc.PhysicalXAxis1Cache;
translateX = true;
}
else if (pc.PhysicalXAxis2Cache.Axis == axis) {
physicalAxis = pc.PhysicalXAxis2Cache;
translateX = true;
}
else if (pc.PhysicalYAxis1Cache.Axis == axis) {
physicalAxis = pc.PhysicalYAxis1Cache;
translateY = true;
}
else if (pc.PhysicalYAxis2Cache.Axis == axis) {
physicalAxis = pc.PhysicalYAxis2Cache;
translateY = true;
}
lastPoint = new Point (args.X, args.Y);
return false;
}
}
}
return false;
}
示例8: HandleButtonPressed
void HandleButtonPressed (object sender, ButtonEventArgs e)
{
if (e.Button != PointerButton.Right)
return;
var rows = view.SelectedRows;
if (rows.Length > 1) {
// this is a multiple selection
// waiting in this case means the selection disappears
ShowBatchFixContextMenu (e.X, e.Y, rows);
// Don't let the selection be reset
e.Handled = true;
handledByPress = true;
} else {
handledByPress = false;
}
}
示例9: HandleButtonReleased
// Event handling of right click on the TreeView is split in two parts
// This is because no single handler can support intuitive behavior regarding
// what happens to the selection when the right mouse button is pressed:
// if only a single row is selected: change the selection and then show menu
// if multiple rows are selected: show the menu directly
void HandleButtonReleased (object sender, ButtonEventArgs e)
{
if (e.Button != PointerButton.Right || handledByPress)
return;
var rows = view.SelectedRows;
if (rows.Length <= 1) {
// Single row or no row
ShowBatchFixContextMenu (e.X, e.Y, view.SelectedRows);
}
}
示例10: HandleButtonReleaseEvent
void HandleButtonReleaseEvent(object o, Gtk.ButtonReleaseEventArgs args)
{
var a = new ButtonEventArgs ();
a.X = args.Event.X;
a.Y = args.Event.Y;
a.Button = (PointerButton) args.Event.Button;
ApplicationContext.InvokeUserCode (delegate {
EventSink.OnButtonReleased (a);
});
if (a.Handled)
args.RetVal = true;
}
示例11: HandleButtonPressEvent
void HandleButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
{
var a = new ButtonEventArgs ();
a.X = args.Event.X;
a.Y = args.Event.Y;
a.Button = (PointerButton) args.Event.Button;
if (args.Event.Type == Gdk.EventType.TwoButtonPress)
a.MultiplePress = 2;
else if (args.Event.Type == Gdk.EventType.ThreeButtonPress)
a.MultiplePress = 3;
else
a.MultiplePress = 1;
ApplicationContext.InvokeUserCode (delegate {
EventSink.OnButtonPressed (a);
});
if (a.Handled)
args.RetVal = true;
}
示例12: HandleButtonReleaseEvent
void HandleButtonReleaseEvent(object o, Gtk.ButtonReleaseEventArgs args)
{
var sc = ConvertToScreenCoordinates (new Point (0, 0));
var a = new ButtonEventArgs ();
a.X = args.Event.XRoot - sc.X;
a.Y = args.Event.YRoot - sc.Y;
a.Button = (PointerButton) args.Event.Button;
ApplicationContext.InvokeUserCode (delegate {
EventSink.OnButtonReleased (a);
});
if (a.Handled)
args.RetVal = true;
}
示例13: HandleButtonPressed
void HandleButtonPressed (object sender, ButtonEventArgs e)
{
if (e.Button == PointerButton.Right)
menu.Popup ();
}
示例14: HandleButtonReleaseEvent
void HandleButtonReleaseEvent(object o, Gtk.ButtonReleaseEventArgs args)
{
var a = new ButtonEventArgs ();
a.X = args.Event.X;
a.Y = args.Event.Y;
a.Button = (PointerButton) args.Event.Button;
Toolkit.Invoke (delegate {
EventSink.OnButtonReleased (a);
});
}
示例15: OnButtonReleased
public void OnButtonReleased(ButtonEventArgs args)
{
Parent.OnButtonReleased (args);
}