xtd 0.2.0
cursors.cpp

demonstrates the use of xtd::forms::cursor component.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/cursors>
#include <xtd/forms/form>
#include <xtd/forms/list_box>
#include <xtd/forms/panel>
#include <xtd/drawing/system_colors>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Cursor example");
start_position(form_start_position::manual);
location({200, 200});
client_size({360, 240});
list_box_loading_indicators.parent(*this);
list_box_loading_indicators.bounds({20, 20, 150, 200});
list_box_loading_indicators.anchor(anchor_styles::top | anchor_styles::left | anchor_styles::bottom);
list_box_loading_indicators.items().push_back_range({{"Default", cursors::default_cursor()}, {"Application Starting", cursors::app_starting()}, {"Arrow", cursors::arrow()}, {"Closed hand", cursors::closed_hand()}, {"Contextual menu", cursors::contextual_menu()}, {"Cell", cursors::cell()}, {"Cross", cursors::cross()}, {"Disappearing item", cursors::disappearing_item()}, {"Drag copy", cursors::drag_copy()}, {"Drag link", cursors::drag_link()}, {"Hand", cursors::hand()}, {"Help", cursors::help()}, {"Horizontal split", cursors::hsplit()}, {"I beam", cursors::ibeam()}, {"No", cursors::no()}, {"No drag", cursors::no_drag()}, {"No move 2d", cursors::no_move_2d()}, {"No move horizontal", cursors::no_move_horiz()}, {"No move vertical", cursors::no_move_vert()}, {"Open hand", cursors::open_hand()}, {"Pan east", cursors::pan_east()}, {"Pan north east", cursors::pan_ne()}, {"Pan north", cursors::pan_north()}, {"Pan north west", cursors::pan_nw()}, {"Pan south east", cursors::pan_se()}, {"Pan south", cursors::pan_south()}, {"Pan south west", cursors::pan_sw()}, {"Pan West", cursors::pan_west()}, {"Size all", cursors::size_all()}, {"Size north-east south-west", cursors::size_nesw()}, {"Size north south", cursors::size_ns()}, {"Size north-west south-east", cursors::size_nwse()}, {"Size west east", cursors::size_we()}, {"Up arrow", cursors::up_arrow()}, {"Vertical I beam", cursors::vibeam()}, {"Vertical split", cursors::vsplit()}, {"Wait", cursors::wait_cursor()}, {"Zoom in", cursors::zoom_in()}, {"Zoom out", cursors::zoom_out()}});
list_box_loading_indicators.selected_index_changed += [&] {
loading_indicator_panel.cursor(any_cast<forms::cursor>(list_box_loading_indicators.selected_item().tag()));
};
list_box_loading_indicators.selected_item("Default");
loading_indicator_panel.parent(*this);
loading_indicator_panel.border_style(border_style::fixed_3d);
loading_indicator_panel.back_color(drawing::system_colors::window());
loading_indicator_panel.bounds({190, 20, 150, 200});
}
private:
list_box list_box_loading_indicators;
panel loading_indicator_panel;
};
auto main() -> int {
application::run(form1 {});
}
static xtd::drawing::color window()
Gets a xtd::drawing::color structure that is the color of the background in the client area of a wind...
static void run()
Begins running a standard application message loop on the current thread, without a form.
static cursor size_all()
Gets the four-headed sizing cursor, which consists of four joined arrows that point north,...
static cursor size_nesw()
Gets the two-headed diagonal (northeast/southwest) sizing cursor.
static cursor wait_cursor()
Gets the wait cursor, typically an hourglass shape.
static cursor ibeam()
Gets the I-beam cursor, which is used to show where the text cursor appears when the mouse is clicked...
static cursor no()
Gets the cursor that indicates that a particular region is invalid for the current operation.
static cursor size_ns()
Gets the two-headed vertical (north/south) sizing cursor.
static cursor pan_sw()
Gets the cursor that appears during wheel operations when the mouse is moving and the window is scrol...
static cursor pan_west()
Gets the cursor that appears during wheel operations when the mouse is moving and the window is scrol...
static cursor hsplit()
Gets the cursor that appears when the mouse is positioned over a horizontal splitter bar.
static cursor no_drag()
Gets the cursor that indicates that a particular region is invalid for the current drag & drop operat...
static cursor contextual_menu()
Gets the contextual menu cursor.
static cursor disappearing_item()
Gets the disappearing item cursor.
static cursor size_we()
Gets the two-headed diagonal (northwest/southeast) sizing cursor.
static cursor cell()
Gets the cell cursor.
static cursor app_starting()
Gets the cursor that appears when an application starts.
static cursor pan_north()
Gets the cursor that appears during wheel operations when the mouse is moving and the window is scrol...
static cursor arrow()
Gets the arrow cursor.
static cursor cross()
Gets the crosshair cursor.
static cursor pan_nw()
Gets the cursor that appears during wheel operations when the mouse is moving and the window is scrol...
static cursor size_nwse()
Gets the two-headed diagonal (northwest/southeast) sizing cursor.
static cursor no_move_vert()
Gets the cursor that appears during wheel operations when the mouse is not moving,...
static cursor up_arrow()
Gets the up arrow cursor, typically used to identify an insertion point.
static cursor drag_copy()
Gets the drag copy cursor.
static cursor open_hand()
Gets the open hand cursor.
static cursor zoom_out()
Gets the zoom out cursor, typically to zoom out an object.
static cursor pan_se()
Gets the cursor that appears during wheel operations when the mouse is moving and the window is scrol...
static cursor default_cursor()
Gets the default cursor, which is usually an arrow cursor.
static cursor no_move_horiz()
Gets the cursor that appears during wheel operations when the mouse is not moving,...
static cursor vibeam()
Gets the vertical I-beam cursor, which is used to show where the text cursor appears when the mouse i...
static cursor drag_link()
Gets the drag link cursor.
static cursor help()
Gets the Help cursor, which is a combination of an arrow and a question mark.
static cursor hand()
Gets the hand cursor, typically used when hovering over a Web link.
static cursor pan_south()
Gets the cursor that appears during wheel operations when the mouse is moving and the window is scrol...
static cursor closed_hand()
Gets the closed hand cursor.
static cursor vsplit()
Gets the cursor that appears when the mouse is positioned over a vertical splitter bar.
static cursor pan_east()
Gets the cursor that appears during wheel operations when the mouse is moving and the window is scrol...
static cursor no_move_2d()
Gets the cursor that appears during wheel operations when the mouse is not moving,...
static cursor zoom_in()
Gets the zoom_in cursor, typically to zoom in an object.
static cursor pan_ne()
Gets the cursor that appears during wheel operations when the mouse is moving and the window is scrol...
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Used to group collections of controls.
Definition panel.hpp:32
@ location
Specifies that both the x and y coordinates of the control are defined.
Definition bounds_specified.hpp:30
@ fixed_3d
A three-dimensional border. Same as xtd::forms::border_style::inset.
Definition border_style.hpp:58
@ bottom
Bind control edges to the bottom of its container.
Definition anchor_styles.hpp:25
@ right
Bind control edges to the right of its container.
Definition anchor_styles.hpp:29
@ left
Bind control edges to the left of its container.
Definition anchor_styles.hpp:27
@ top
Bind control edges to the top of its container.
Definition anchor_styles.hpp:23
@ manual
The position of the form is determined by the Location property.
Definition form_start_position.hpp:24
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:217
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8