Merge branch 'rbrugo-develop' into develop
This commit is contained in:
commit
36cec8743d
@ -17,6 +17,8 @@
|
|||||||
#include "skeletons/textbase_export_interface.hpp"
|
#include "skeletons/textbase_export_interface.hpp"
|
||||||
#include "skeletons/text_editor_part.hpp"
|
#include "skeletons/text_editor_part.hpp"
|
||||||
|
|
||||||
|
#include <nana/optional.hpp>
|
||||||
|
|
||||||
namespace nana
|
namespace nana
|
||||||
{
|
{
|
||||||
class textbox;
|
class textbox;
|
||||||
@ -173,6 +175,13 @@ namespace nana
|
|||||||
/// Read the text from a specified line with a set offset. It returns true for success.
|
/// Read the text from a specified line with a set offset. It returns true for success.
|
||||||
bool getline(std::size_t line_index,std::size_t offset,std::string& text) const;
|
bool getline(std::size_t line_index,std::size_t offset,std::string& text) const;
|
||||||
|
|
||||||
|
/// Read the text from a specified line; returns an empty optional on failure
|
||||||
|
std::optional<std::string> getline(std::size_t pos) const;
|
||||||
|
|
||||||
|
///Read the text from a specified line with a set offset. Returns an empty optional for
|
||||||
|
/// failure.
|
||||||
|
std::optional<std::string> getline(std::size_t line_index, std::size_t offset) const;
|
||||||
|
|
||||||
/// Gets the caret position
|
/// Gets the caret position
|
||||||
/// Returns true if the caret is in the area of display, false otherwise.
|
/// Returns true if the caret is in the area of display, false otherwise.
|
||||||
bool caret_pos(point& pos, bool text_coordinate) const;
|
bool caret_pos(point& pos, bool text_coordinate) const;
|
||||||
|
@ -377,6 +377,27 @@ namespace drawerbase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<std::string> textbox::getline(std::size_t pos) const
|
||||||
|
{
|
||||||
|
auto result = std::string{};
|
||||||
|
if ( getline(pos, result) )
|
||||||
|
{
|
||||||
|
return { std::move(result) };
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<std::string> textbox::getline(std::size_t line_index, std::size_t offset) const
|
||||||
|
{
|
||||||
|
auto result = std::string{};
|
||||||
|
if ( getline(line_index, offset, result) )
|
||||||
|
{
|
||||||
|
return { std::move(result) };
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Gets the caret position
|
/// Gets the caret position
|
||||||
bool textbox::caret_pos(point& pos, bool text_coordinate) const
|
bool textbox::caret_pos(point& pos, bool text_coordinate) const
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user