Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00032
00033 #pragma once
00034
00035 #include "../api_gui.h"
00036 #include "../gui_component.h"
00037
00038 class CL_TextEdit_Impl;
00039
00043 class CL_API_GUI CL_TextEdit : public CL_GUIComponent
00044 {
00047
00048 public:
00052 CL_TextEdit(CL_GUIComponent *parent);
00053
00054 virtual ~CL_TextEdit();
00055
00059
00060 public:
00061 using CL_GUIComponent::get_named_item;
00062
00066 static CL_TextEdit *get_named_item(CL_GUIComponent *reference_component, const CL_StringRef &id);
00067
00071 bool is_read_only() const;
00072
00076 bool is_lowercase() const;
00077
00081 bool is_uppercase() const;
00082
00086 int get_max_length() const;
00087
00091 CL_String get_text() const;
00092
00096 int get_line_count() const;
00097
00101 CL_String get_line_text(int line) const;
00102
00106 CL_String get_selection() const;
00107
00111 int get_selection_start() const;
00112
00116 int get_selection_length() const;
00117
00121 int get_cursor_pos() const;
00122
00126 int get_cursor_line_number() const;
00127
00131 virtual CL_Size get_preferred_size() const;
00132
00134 int get_total_height();
00135
00139
00140 public:
00141 void set_select_all_on_focus_gain(bool enable);
00142
00144 void select_all();
00145
00149 void set_read_only(bool enable = true);
00150
00154 void set_lowercase(bool enable = true);
00155
00159 void set_uppercase(bool enable = true);
00160
00164 void set_max_length(int length);
00165
00169 void set_text(const CL_StringRef &text);
00170
00174 void add_text(const CL_StringRef &text);
00175
00180 void set_selection(int pos, int length);
00181
00183 void clear_selection();
00184
00188 void set_cursor_pos(int pos);
00189
00191 void delete_selected_text();
00192
00194 void set_input_mask(const CL_StringRef &mask);
00195
00197 void set_cursor_drawing_enabled(bool enable);
00198
00202
00203 public:
00204 CL_Callback_v1<CL_InputEvent &> &func_before_edit_changed();
00205
00206 CL_Callback_v1<CL_InputEvent &> &func_after_edit_changed();
00207
00211 CL_Callback_v0 &func_selection_changed();
00212
00214 CL_Callback_v0 &func_focus_gained();
00215
00217 CL_Callback_v0 &func_focus_lost();
00218
00222 CL_Callback_v0 &func_enter_pressed();
00223
00227
00228 private:
00229 CL_SharedPtr<CL_TextEdit_Impl> impl;
00231 };
00232