add a method to show caret for the uneditable textbox
When an uneditable textbox has a caret, user can select the text and copy it.
This commit is contained in:
@@ -118,7 +118,13 @@ namespace nana{ namespace widgets
|
||||
|
||||
const attributes & attr() const;
|
||||
bool multi_lines(bool);
|
||||
void editable(bool);
|
||||
|
||||
/// Enables/disables the editability of text_editor
|
||||
/**
|
||||
* @param enable Indicates whether to enable or disable the editability
|
||||
* @param enable_cart Indicates whether to show or hide the caret when the text_editor is not editable. It is ignored if enable is false.
|
||||
*/
|
||||
void editable(bool enable, bool enable_caret);
|
||||
void enable_background(bool);
|
||||
void enable_background_counterpart(bool);
|
||||
|
||||
@@ -255,6 +261,7 @@ namespace nana{ namespace widgets
|
||||
bool line_wrapped{false};
|
||||
bool multi_lines{true};
|
||||
bool editable{true};
|
||||
bool enable_caret{ true }; ///< Indicates whether to show or hide caret when text_editor is not editable
|
||||
bool enable_background{true};
|
||||
}attributes_;
|
||||
|
||||
|
||||
@@ -184,6 +184,9 @@ namespace nana
|
||||
bool editable() const;
|
||||
textbox& editable(bool);
|
||||
|
||||
/// Enables the caret if the textbox current is not editable
|
||||
textbox& enable_caret();
|
||||
|
||||
void set_accept(std::function<bool(wchar_t)>);
|
||||
|
||||
textbox& tip_string(::std::string);
|
||||
|
||||
Reference in New Issue
Block a user