xtd - Reference Guide 0.2.0
xtd::forms::draw_item_event_args Class Reference

#include <draw_item_event_args.h>

Definition

Provides data for the.

draw_item 

event.

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.

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. More...
 
 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. More...
 

Properties

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

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. More...
 
- Public Member Functions inherited from xtd::event_args
 event_args ()=default
 Initializes a new instance of the event_args class. More...
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const
 Gets the type of the current instance. More...
 
virtual xtd::ustring to_string () const noexcept
 Returns a sxd::ustring that represents the current object. More...
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

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 
)
inline

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 
)
inline

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
inlinenoexcept

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
inlinenoexcept

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
inlinenoexcept

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
inlinenoexcept

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 ( )
inlinenoexcept

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
inlinenoexcept

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
inlinenoexcept

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: