namespace Terminal.Gui;
/// Args for events that relate to specific
public class ViewEventArgs : EventArgs
{
/// Creates a new instance of the class.
/// The view that the event is about.
public ViewEventArgs (View view) { View = view; }
/// The view that the event is about.
///
/// Can be different from the sender of the for example if event describes the adding a
/// child then sender may be the parent while is the child being added.
///
public View View { get; }
}
/// Event arguments for the event.
public class LayoutEventArgs : EventArgs
{
/// Creates a new instance of the class.
/// The view that the event is about.
public LayoutEventArgs (Size oldContentSize) { OldContentSize = oldContentSize; }
/// The viewport of the before it was laid out.
public Size OldContentSize { get; set; }
}
/// Event args for draw events
public class DrawEventArgs : EventArgs
{
/// Creates a new instance of the class.
///
/// The Content-relative rectangle describing the new visible viewport into the
/// .
///
///
/// The Content-relative rectangle describing the old visible viewport into the
/// .
///
public DrawEventArgs (Rectangle newViewport, Rectangle oldViewport)
{
NewViewport = newViewport;
OldViewport = oldViewport;
}
/// If set to true, the draw operation will be canceled, if applicable.
public bool Cancel { get; set; }
/// Gets the Content-relative rectangle describing the old visible viewport into the .
public Rectangle OldViewport { get; }
/// Gets the Content-relative rectangle describing the currently visible viewport into the .
public Rectangle NewViewport { get; }
}
/// Defines the event arguments for
public class FocusEventArgs : EventArgs
{
/// Constructs.
/// The view that gets or loses focus.
public FocusEventArgs (View view) { View = view; }
///
/// Indicates if the current focus event has already been processed and the driver should stop notifying any other
/// event subscriber. Its important to set this value to true specially when updating any View's layout from inside the
/// subscriber method.
///
public bool Handled { get; set; }
/// Indicates the current view that gets or loses focus.
public View View { get; set; }
}