rename API::is_focus_window to API::is_focus_ready
This commit is contained in:
parent
a64354900c
commit
4154c8e132
@ -239,7 +239,7 @@ namespace API
|
||||
cursor window_cursor(window);
|
||||
|
||||
void activate_window(window);
|
||||
bool is_focus_window(window);
|
||||
bool is_focus_ready(window);
|
||||
window focus_window();
|
||||
void focus_window(window);
|
||||
|
||||
|
@ -796,7 +796,7 @@ namespace API
|
||||
return cursor::arrow;
|
||||
}
|
||||
|
||||
bool is_focus_window(window wd)
|
||||
bool is_focus_ready(window wd)
|
||||
{
|
||||
auto iwd = reinterpret_cast<restrict::core_window_t*>(wd);
|
||||
internal_scope_guard lock;
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <numeric>
|
||||
#include <cwctype>
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
|
||||
namespace nana{ namespace widgets
|
||||
{
|
||||
@ -688,7 +689,7 @@ namespace nana{ namespace widgets
|
||||
}
|
||||
}
|
||||
else
|
||||
editor_.render(API::is_focus_window(editor_.window_));
|
||||
editor_.render(API::is_focus_ready(editor_.window_));
|
||||
}
|
||||
|
||||
void render(const ::nana::color& fgcolor) override
|
||||
@ -1447,7 +1448,7 @@ namespace nana{ namespace widgets
|
||||
move_caret(upoint{});
|
||||
|
||||
_m_scrollbar();
|
||||
render(API::is_focus_window(window_));
|
||||
render(API::is_focus_ready(window_));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -1465,7 +1466,7 @@ namespace nana{ namespace widgets
|
||||
|
||||
_m_reset();
|
||||
behavior_->pre_calc_lines(width_pixels());
|
||||
render(API::is_focus_window(window_));
|
||||
render(API::is_focus_ready(window_));
|
||||
_m_scrollbar();
|
||||
return true;
|
||||
}
|
||||
@ -1716,7 +1717,7 @@ namespace nana{ namespace widgets
|
||||
//Set caret position through text coordinate
|
||||
void text_editor::move_caret(const upoint& crtpos)
|
||||
{
|
||||
if (!API::is_focus_window(window_))
|
||||
if (!API::is_focus_ready(window_))
|
||||
return;
|
||||
|
||||
const unsigned line_pixels = line_height();
|
||||
@ -1758,7 +1759,7 @@ namespace nana{ namespace widgets
|
||||
|
||||
void text_editor::show_caret(bool isshow)
|
||||
{
|
||||
if(isshow == false || API::is_focus_window(window_))
|
||||
if(isshow == false || API::is_focus_ready(window_))
|
||||
API::caret_visible(window_, isshow);
|
||||
}
|
||||
|
||||
@ -1923,7 +1924,7 @@ namespace nana{ namespace widgets
|
||||
{
|
||||
behavior_->adjust_caret_into_screen();
|
||||
reset_caret();
|
||||
render(API::is_focus_window(window_));
|
||||
render(API::is_focus_ready(window_));
|
||||
_m_scrollbar();
|
||||
|
||||
points_.xpos = points_.caret.x;
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <nana/gui/widgets/skeletons/text_editor.hpp>
|
||||
#include <nana/gui/element.hpp>
|
||||
#include <nana/gui/timer.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
namespace nana
|
||||
{
|
||||
@ -328,7 +329,7 @@ namespace nana
|
||||
|
||||
void render()
|
||||
{
|
||||
editor_->render(API::is_focus_window(editor_->window_handle()));
|
||||
editor_->render(API::is_focus_ready(editor_->window_handle()));
|
||||
_m_draw_spins(spin_stated_);
|
||||
}
|
||||
|
||||
@ -420,7 +421,7 @@ namespace nana
|
||||
if (!editor_)
|
||||
return;
|
||||
|
||||
if (API::is_focus_window(editor_->window_handle()))
|
||||
if (API::is_focus_ready(editor_->window_handle()))
|
||||
editor_->text(range_->value());
|
||||
else
|
||||
editor_->text(modifier_.prefix + range_->value() + modifier_.suffix);
|
||||
|
@ -83,7 +83,7 @@ namespace drawerbase {
|
||||
|
||||
void drawer::refresh(graph_reference graph)
|
||||
{
|
||||
editor_->render(API::is_focus_window(*widget_));
|
||||
editor_->render(API::is_focus_ready(*widget_));
|
||||
}
|
||||
|
||||
void drawer::focus(graph_reference graph, const arg_focus& arg)
|
||||
|
@ -101,7 +101,7 @@ namespace nana
|
||||
|
||||
bool widget::focused() const
|
||||
{
|
||||
return API::is_focus_window(handle());
|
||||
return (API::focus_window() == handle());
|
||||
}
|
||||
|
||||
void widget::show()
|
||||
|
Loading…
x
Reference in New Issue
Block a user