xtd 0.2.0
Loading...
Searching...
No Matches
xtd::forms::draw_item_event_args Class Reference
Inheritance diagram for xtd::forms::draw_item_event_args:
xtd::event_args xtd::object xtd::forms::status_bar_draw_item_event_args

Definition

Provides data for the.

draw_item 

event.

Header
#include <xtd/forms/draw_item_event_args>
Namespace
xtd::forms
Library
xtd.forms
Remarks
The
draw_item 
event is raised by owner draw controls, such as the xtd::forms::list_box and xtd::forms::combo_box controls. It contains all the information that is needed for the user to paint the specified item, including the item index, the xtd::drawing::rectangle, and the xtd::drawing::graphics on which the drawing should be done.

Public Constructors

 draw_item_event_args (xtd::drawing::graphics &graphics, const xtd::drawing::font &font, const xtd::drawing::rectangle &rect, size_t index, xtd::forms::draw_item_state state)
 Initializes a new instance of the xtd::forms::draw_item_event_args class for the specified control with the specified font, state, surface to draw on, and the bounds to draw within.
 
 draw_item_event_args (xtd::drawing::graphics &graphics, const xtd::drawing::font &font, const xtd::drawing::rectangle &rect, size_t index, xtd::forms::draw_item_state state, const xtd::drawing::color &back_color, const xtd::drawing::color &fore_core)
 Initializes a new instance of the xtd::forms::draw_item_event_args class for the specified control with the specified font, state, foreground color, background color, surface to draw on, and the bounds to draw within.
 

Public Properties

const xtd::drawing::colorback_color () const noexcept
 Gets the background color of the item that is being drawn.
 
const xtd::drawing::rectanglebounds () const noexcept
 Gets the rectangle that represents the bounds of the item that is being drawn.
 
const xtd::drawing::fontfont () const noexcept
 Gets the font that is assigned to the item being drawn.
 
const xtd::drawing::colorfore_color () const noexcept
 Gets the foreground color of the of the item being drawn.
 
xtd::drawing::graphicsgraphics () noexcept
 Gets the graphics surface to draw the item on.
 
size_t index () const noexcept
 Gets the index value of the item that is being drawn.
 
xtd::forms::draw_item_state state () const noexcept
 Gets the state of the item being drawn.
 

Additional Inherited Members

- Static Public Attributes inherited from xtd::event_args
static const event_args empty
 Provides a value to use with events that do not have event data.
 
- Public Member Functions inherited from xtd::event_args
 event_args ()=default
 Initializes a new instance of the event_args class.
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const noexcept
 Returns a xtd::string that represents the current object.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<typename object_a_t , typename object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

Constructor & Destructor Documentation

◆ draw_item_event_args() [1/2]

xtd::forms::draw_item_event_args::draw_item_event_args ( xtd::drawing::graphics graphics,
const xtd::drawing::font font,
const xtd::drawing::rectangle rect,
size_t  index,
xtd::forms::draw_item_state  state 
)

Initializes a new instance of the xtd::forms::draw_item_event_args class for the specified control with the specified font, state, surface to draw on, and the bounds to draw within.

Parameters
graphicsThe xtd::drawing::graphics surface on which to draw.
fontThe xtd::drawing::font to use, usually the parent control's Font property.
rectThe xtd::drawing::rectangle bounds to draw within.
indexThe xtd::control::control_collection index value of the item that is being drawn.
stateThe control's xtd::forms::drawItem_state information.

◆ draw_item_event_args() [2/2]

xtd::forms::draw_item_event_args::draw_item_event_args ( xtd::drawing::graphics graphics,
const xtd::drawing::font font,
const xtd::drawing::rectangle rect,
size_t  index,
xtd::forms::draw_item_state  state,
const xtd::drawing::color back_color,
const xtd::drawing::color fore_core 
)

Initializes a new instance of the xtd::forms::draw_item_event_args class for the specified control with the specified font, state, foreground color, background color, surface to draw on, and the bounds to draw within.

Parameters
graphicsThe xtd::drawing::graphics surface on which to draw.
fontThe xtd::drawing::font to use, usually the parent control's Font property.
rectThe xtd::drawing::rectangle bounds to draw within.
indexThe xtd::control::control_collection index value of the item that is being drawn.
stateThe control's xtd::forms::drawItem_state information.

Member Function Documentation

◆ back_color()

const xtd::drawing::color & xtd::forms::draw_item_event_args::back_color ( ) const
noexcept

Gets the background color of the item that is being drawn.

Returns
The background xtd::drawing::color of the item that is being drawn.
Remarks
If the item's state is xtd::forms::draw_item_state::selected, the xtd::forms::drawing_item_event_args::back_color is set to xtd::drawing::system_colors::highlight. If the item's state is not xtd::forms::draw_item_state::selected, the xtd::forms::draw_item_event_Args::back_color property is set to xtd::drawing::system_colors::window.

◆ bounds()

const xtd::drawing::rectangle & xtd::forms::draw_item_event_args::bounds ( ) const
noexcept

Gets the rectangle that represents the bounds of the item that is being drawn.

Returns
The xtd::drawing::rectangle that represents the bounds of the item that is being drawn.

◆ font()

const xtd::drawing::font & xtd::forms::draw_item_event_args::font ( ) const
noexcept

Gets the font that is assigned to the item being drawn.

Returns
The xtd::drawing::font that is assigned to the item being drawn.
Remarks
A suggested xtd::drawing::font, usually the xtd::forms::control::font property of the parent control.

◆ fore_color()

const xtd::drawing::color & xtd::forms::draw_item_event_args::fore_color ( ) const
noexcept

Gets the foreground color of the of the item being drawn.

Returns
The foreground xtd::drawing::color of the item being drawn.
Remarks
If the item's state is xtd::forms::draw_item_state::selected, the xtd::forms::drawing_item_event_args::fore_color is set to xtd::drawing::system_colors::highlight_text. If the item's state is not xtd::forms::draw_item_state::selected, the xtd::forms::drawing_item_event_args::fore_color property is set to xtd::drawing::system_colors::window.

◆ graphics()

xtd::drawing::graphics & xtd::forms::draw_item_event_args::graphics ( )
noexcept

Gets the graphics surface to draw the item on.

Returns
The xtd::drawing::graphics surface to draw the item on.

◆ index()

size_t xtd::forms::draw_item_event_args::index ( ) const
noexcept

Gets the index value of the item that is being drawn.

Returns
The numeric value that represents the xtd::forms::control::control_collection::operator [] value of the item being drawn.
Remarks
This property returns the xtd::forms::control::control_collection::operator [] value of the item being drawn in the xtd::forms::control::control_collection. This property can return xtd::forms::control::control_collection::npos if items were removed from the list.

◆ state()

xtd::forms::draw_item_state xtd::forms::draw_item_event_args::state ( ) const
noexcept

Gets the state of the item being drawn.

Returns
The xtd::forms::draw_item_state that represents the state of the item being drawn.
Remarks
This property value can be a combination of the xtd::forms::draw_item_state enumeration members. The members can be combined by using bitwise operators.

The documentation for this class was generated from the following file: