#include <text_field_view.h>

+ Inheritance diagram for clan::TextFieldView:

Public Member Functions

 TextFieldView ()
 
 ~TextFieldView ()
 
void clear_selection ()
 
int cursor_pos () const
 
void delete_selected_text ()
 
bool is_lowercase () const
 
bool is_password_mode () const
 
bool is_read_only () const
 
bool is_uppercase () const
 
int max_length () const
 
std::string placeholder () const
 
int preferred_size () const
 
void select_all ()
 
std::string selection () const
 
size_t selection_length () const
 
size_t selection_start () const
 
void set_cursor_drawing_enabled (bool value)
 
void set_cursor_pos (int pos)
 
void set_decimal_character (const std::string &decimal_char)
 
void set_input_mask (const std::string &mask)
 
void set_lowercase (bool value=true)
 
void set_max_length (int length)
 
void set_numeric_mode (bool enable=true, bool decimals=false)
 
void set_password_mode (bool value=true)
 
void set_placeholder (const std::string &value)
 
void set_preferred_size (int num_characters)
 
void set_read_only (bool value=true)
 
void set_select_all_on_focus_gain (bool value)
 
void set_selection (size_t pos, size_t length)
 
void set_text (const std::string &value)
 
void set_text (int number)
 
void set_text (float number, int num_decimal_places=6)
 
void set_text_alignment (TextAlignment value)
 
void set_uppercase (bool value=true)
 
Signal< void(KeyEvent &)> & sig_after_edit_changed ()
 
Signal< void(KeyEvent &)> & sig_before_edit_changed ()
 
Signal< void()> & sig_enter_pressed ()
 
Signal< void()> & sig_selection_changed ()
 
std::string text () const
 
TextAlignment text_alignment () const
 
float text_float () const
 
int text_int () const
 
- Public Member Functions inherited from clan::View
 View ()
 
virtual ~View ()
 
const std::vector
< std::shared_ptr< ViewAction > > & 
actions () const
 List of all action recognizers. More...
 
void add_action (const std::shared_ptr< ViewAction > &action)
 Add an action recognizer. More...
 
template<typename T , typename... Types>
std::shared_ptr< T > add_action (Types &&...args)
 
void add_child (const std::shared_ptr< View > &view)
 Add a child view. More...
 
template<typename T , typename... Types>
std::shared_ptr< T > add_child (Types &&...args)
 
std::shared_ptr< Viewadd_child ()
 
void animate (float from, float to, const std::function< void(float)> &setter, int duration_ms=400, const std::function< float(float)> &easing=Easing::linear, std::function< void()> animation_end=std::function< void()>())
 Continously call an animation function for the specified duration. More...
 
Canvas canvas () const
 
const std::vector
< std::shared_ptr< View > > & 
children () const
 List of all immediate child views. More...
 
void clear_exception_encountered ()
 
bool content_clipped () const
 Content clipping flag. More...
 
void draw_without_layout ()
 Render view and its children directly, without re-layout. More...
 
std::shared_ptr< Viewfind_view_at (const Pointf &pos) const
 Find descendant view at the specified content relative position. More...
 
float first_baseline_offset (Canvas &canvas, float width)
 Calculates the offset to the first baseline. More...
 
FocusPolicy focus_policy () const
 Focus policy active for this view. More...
 
Viewfocus_view () const
 The view receiving keyboard events or nullptr if no view has the focus. More...
 
Pointf from_root_pos (const Pointf &pos)
 Map from root content to local content coordinates. More...
 
Pointf from_screen_pos (const Pointf &pos)
 Map from screen to local content coordinates. More...
 
const ViewGeometrygeometry () const
 Actual view position and size after layout. More...
 
bool has_focus () const
 Test if this view is receiving keyboard input. More...
 
bool hidden () const
 Test if view is set to hidden. More...
 
bool is_static_position_and_visible () const
 Test if view should participate in static layout calculations (layout_children) More...
 
float last_baseline_offset (Canvas &canvas, float width)
 Calculates the offset to the last baseline. More...
 
virtual void layout_children (Canvas &canvas)
 Sets the view geometry for all children of this view. More...
 
bool needs_layout () const
 Test if view geometry needs to be recalculated. More...
 
void next_focus ()
 Give focus to the next view in the keyboard tab index order. More...
 
Viewparent () const
 Parent view node or nullptr if the view is the current root node. More...
 
float preferred_height (Canvas &canvas, float width)
 Calculates the preferred height of this view. More...
 
float preferred_width (Canvas &canvas)
 Calculates the preferred width of this view. More...
 
void prev_focus ()
 Give focus to the previous view in the keyboard tab index order. More...
 
void remove_focus ()
 Remove focus from this view. More...
 
void remove_from_parent ()
 Remove view from parent. More...
 
bool render_exception_encountered () const
 Test if this view generated an exception during rendering. More...
 
void set_content_clipped (bool clipped)
 Specifies if content should be clipped during rendering. More...
 
void set_cursor (const CursorDescription &cursor)
 Set the cursor icon used when cursor is above this view. More...
 
void set_cursor (StandardCursor type)
 
void set_focus ()
 Set this view as the focused view. More...
 
void set_focus_policy (FocusPolicy policy)
 Set if this view automatically can gain focus. More...
 
void set_geometry (const ViewGeometry &geometry)
 
void set_hidden (bool value=true)
 Hides a view from layout and rendering. More...
 
void set_inherit_cursor ()
 Specify that the cursor icon is inherited from the parent view. More...
 
void set_needs_layout ()
 Forces recalculation of view geometry before next rendering. More...
 
void set_needs_render ()
 Signals this view needs to be rendered again. More...
 
void set_state (const std::string &name, bool value)
 Set or clear style state. More...
 
void set_state_cascade (const std::string &name, bool value)
 Sets the state for this view and all children recursively, until a manually set state of the same name is found. More...
 
void set_tab_index (unsigned int index)
 Sets the tab index used for keyboard focus changes. More...
 
void set_view_transform (const Mat4f &transform)
 Specifies the view transform to be applied before its contents and children are rendered. More...
 
Signal< void(ActivationChangeEvent &)> & sig_activated (bool use_capture=false)
 Window activated event. More...
 
Signal< void(CloseEvent &)> & sig_close (bool use_capture=false)
 Window close button clicked event. More...
 
Signal< void(ActivationChangeEvent &)> & sig_deactivated (bool use_capture=false)
 Window deactivated event. More...
 
Signal< void(FocusChangeEvent &)> & sig_focus_gained (bool use_capture=false)
 View gained focus event. More...
 
Signal< void(FocusChangeEvent &)> & sig_focus_lost (bool use_capture=false)
 View lost focus event. More...
 
Signal< void(KeyEvent &)> & sig_key_press (bool use_capture=false)
 Key pressed event. More...
 
Signal< void(KeyEvent &)> & sig_key_release (bool use_capture=false)
 Key released event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_double_click (bool use_capture=false)
 Pointer button double clicked event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_enter (bool use_capture=false)
 Pointer entering view geometry event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_leave (bool use_capture=false)
 Pointer leaving view geometry event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_move (bool use_capture=false)
 Pointer moved above view event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_press (bool use_capture=false)
 Pointer button pressed event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_proximity_change (bool use_capture=false)
 Pointer proximity change event. More...
 
Signal< void(PointerEvent &)> & sig_pointer_release (bool use_capture=false)
 Pointer button released event. More...
 
Signal< void(ResizeEvent &)> & sig_resize (bool use_capture=false)
 Window resize event. More...
 
bool state (const std::string &name) const
 Test if a style state is currently set. More...
 
void stop_animations ()
 Stop all activate animation functions. More...
 
const std::shared_ptr< Style > & style (const std::string &state=std::string()) const
 Style properties for the specified state. More...
 
const StyleCascadestyle_cascade () const
 Style cascade currently active for this view. More...
 
unsigned int tab_index () const
 Tab index for keyboard focus changes. More...
 
Pointf to_root_pos (const Pointf &pos, bool relative_to_margin=false)
 Map from local content to root content or margin (plus content, padding, border and margin) coordinates. More...
 
Pointf to_screen_pos (const Pointf &pos)
 Map from local content to screen coordinates. More...
 
void update_cursor (DisplayWindow &window)
 Update window cursor to the cursor used by this view. More...
 
const Mat4fview_transform () const
 Current view transform. More...
 
const ViewTreeview_tree () const
 Tree in view hierachy. More...
 
ViewTreeview_tree ()
 

Protected Member Functions

float calculate_first_baseline_offset (Canvas &canvas, float width) override
 Calculates the offset to the first baseline. More...
 
float calculate_last_baseline_offset (Canvas &canvas, float width) override
 Calculates the offset to the last baseline. More...
 
float calculate_preferred_height (Canvas &canvas, float width) override
 Calculates the preferred height of this view. More...
 
float calculate_preferred_width (Canvas &canvas) override
 Calculates the preferred width of this view. More...
 
void render_content (Canvas &canvas) override
 Renders the content of a view. More...
 
- Protected Member Functions inherited from clan::View
virtual void child_added (const std::shared_ptr< View > &view)
 Child view was added to this view. More...
 
virtual void child_removed (const std::shared_ptr< View > &view)
 Child view was removed from this view. More...
 
virtual void render_background (Canvas &canvas)
 Renders the background of a view. More...
 
virtual void render_border (Canvas &canvas)
 Renders the border of a view. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from clan::View
static void dispatch_event (View *target, EventUI *e, bool no_propagation=false)
 Dispatch event to signals listening for events. More...
 
- Public Attributes inherited from clan::View
SlotContainer slots
 Slot container helping with automatic disconnection of connected slots when the view is destroyed. More...
 

Constructor & Destructor Documentation

clan::TextFieldView::TextFieldView ( )
clan::TextFieldView::~TextFieldView ( )

Member Function Documentation

float clan::TextFieldView::calculate_first_baseline_offset ( Canvas canvas,
float  width 
)
overrideprotectedvirtual

Calculates the offset to the first baseline.

Reimplemented from clan::View.

float clan::TextFieldView::calculate_last_baseline_offset ( Canvas canvas,
float  width 
)
overrideprotectedvirtual

Calculates the offset to the last baseline.

Reimplemented from clan::View.

float clan::TextFieldView::calculate_preferred_height ( Canvas canvas,
float  width 
)
overrideprotectedvirtual

Calculates the preferred height of this view.

Reimplemented from clan::View.

float clan::TextFieldView::calculate_preferred_width ( Canvas canvas)
overrideprotectedvirtual

Calculates the preferred width of this view.

Reimplemented from clan::View.

void clan::TextFieldView::clear_selection ( )
int clan::TextFieldView::cursor_pos ( ) const
void clan::TextFieldView::delete_selected_text ( )
bool clan::TextFieldView::is_lowercase ( ) const
bool clan::TextFieldView::is_password_mode ( ) const
bool clan::TextFieldView::is_read_only ( ) const
bool clan::TextFieldView::is_uppercase ( ) const
int clan::TextFieldView::max_length ( ) const
std::string clan::TextFieldView::placeholder ( ) const
int clan::TextFieldView::preferred_size ( ) const
void clan::TextFieldView::render_content ( Canvas canvas)
overrideprotectedvirtual

Renders the content of a view.

Reimplemented from clan::View.

void clan::TextFieldView::select_all ( )
std::string clan::TextFieldView::selection ( ) const
size_t clan::TextFieldView::selection_length ( ) const
size_t clan::TextFieldView::selection_start ( ) const
void clan::TextFieldView::set_cursor_drawing_enabled ( bool  value)
void clan::TextFieldView::set_cursor_pos ( int  pos)
void clan::TextFieldView::set_decimal_character ( const std::string decimal_char)
void clan::TextFieldView::set_input_mask ( const std::string mask)
void clan::TextFieldView::set_lowercase ( bool  value = true)
void clan::TextFieldView::set_max_length ( int  length)
void clan::TextFieldView::set_numeric_mode ( bool  enable = true,
bool  decimals = false 
)
void clan::TextFieldView::set_password_mode ( bool  value = true)
void clan::TextFieldView::set_placeholder ( const std::string value)
void clan::TextFieldView::set_preferred_size ( int  num_characters)
void clan::TextFieldView::set_read_only ( bool  value = true)
void clan::TextFieldView::set_select_all_on_focus_gain ( bool  value)
void clan::TextFieldView::set_selection ( size_t  pos,
size_t  length 
)
void clan::TextFieldView::set_text ( const std::string value)
void clan::TextFieldView::set_text ( int  number)
void clan::TextFieldView::set_text ( float  number,
int  num_decimal_places = 6 
)
void clan::TextFieldView::set_text_alignment ( TextAlignment  value)
void clan::TextFieldView::set_uppercase ( bool  value = true)
Signal<void(KeyEvent &)>& clan::TextFieldView::sig_after_edit_changed ( )
Signal<void(KeyEvent &)>& clan::TextFieldView::sig_before_edit_changed ( )
Signal<void()>& clan::TextFieldView::sig_enter_pressed ( )
Signal<void()>& clan::TextFieldView::sig_selection_changed ( )
std::string clan::TextFieldView::text ( ) const
TextAlignment clan::TextFieldView::text_alignment ( ) const
float clan::TextFieldView::text_float ( ) const
int clan::TextFieldView::text_int ( ) const

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