EtoFormsMenuExtensionMethods
Provides extension methods for Eto.Forms.Menu and Eto.Forms.ContextMenu.
Methods
Add a control with a leading label to a stack layout collection.
public static StackLayoutItem AddWithLabel()
items,
Collection to append to.
text,
Label text.
string[]
labels,
If not null, collection of all labels for horizontal sizing.
Control
control,
Control to host to the right of the label.
expand = false
Expansion state.
Returns: Layout item which was inserted.
Try to figure out the background colour of a specific cell.
public static Color CellBackColor()
this CellPaintEventArgs
args,
TreeGridView
grid
Compute the line height of a font in logical pixels. This method is better than the Font.LineHeight property on Font as that one behaves differently on Windows and MacOS.
Invoke a specific method delegate on the UI thread using a default delay of 20 milliseconds.
Invoke a specific method delegate on the UI thread.
Invoke a specific method delegate on the UI thread using a default delay of 20 milliseconds.
public static void DelayedInvoke<T>()
Invoke a specific method delegate on the UI thread.
Invalidate a control using thread-safe methods.
public static void InvalidateSafe()
this Control
control
Control to invalidate.
Ensure a font is italic. This method will not create a new font if not needed.
public static Font Italicize()
this Font
font
Limit a form to be entirely within the bounds of whichever screen it is associated with.
If the form is already visible, it will be moved.
If the form is still being constructed, it will be moved as soon as possible, hopefully before it is drawn wrongly once.
public static void LimitFormToScreen()
this Form
form
Form to limit.
Transform a mouse event from control coordinates into content coordinates.
public static MouseEventArgs Map()
this MouseEventArgs
args,
Arguments to transform.
control,
Relevant control.
CoordinateSystem
system
Coordinate system.
Returns: Transformed arguments.
Transform a mouse event from control coordinates into content coordinates.
public static MouseEventArgs MapToContent()
Returns: Transformed arguments.
Resize a font.
Returns: Adjusted font or the same font if no resizing was needed.
Show an Open File dialog in an OS-appropriate way. I.e. on OSX no parent window is assigned, allowing the dialog to be dragged, on Windows either the provided parent, or the Grasshopper Editor, or the Rhino window is assigned.
public static DialogResult Show()
this OpenFileDialog
dialog,
Window
parent = null
Show a Save File dialog in an OS-appropriate way. I.e. on OSX no parent window is assigned, allowing the dialog to be dragged, on Windows either the provided parent, or the Grasshopper Editor, or the Rhino window is assigned.
public static DialogResult Show()
this SaveFileDialog
dialog,
Window
parent = null