move lazy_refresh() from namespace API to API::dev

This commit is contained in:
Jinhao 2016-04-17 17:46:19 +08:00
parent afa253f924
commit 42990b8670
19 changed files with 121 additions and 120 deletions

View File

@ -88,10 +88,20 @@ namespace API
void set_menubar(window wd, bool attach); void set_menubar(window wd, bool attach);
void enable_space_click(window, bool enable); void enable_space_click(window, bool enable);
/// Refreshs a widget surface
/*
* This function will copy the drawer surface into system window after the event process finished.
*/
void lazy_refresh();
}//end namespace dev }//end namespace dev
/// Returns the widget pointer of the specified window.
widget* get_widget(window); /*
* @param window_handle A handle to a window owning the widget.
* @return A widget pointer.
*/
widget* get_widget(window window_handle);
namespace detail namespace detail
{ {
@ -258,17 +268,6 @@ namespace API
void window_enabled(window, bool); void window_enabled(window, bool);
bool window_enabled(window); bool window_enabled(window);
/** @brief A widget drawer draws the widget surface in answering an event.
*
* This function will tell the drawer to copy the graphics into window after event answering.
* Tells Nana.GUI to copy the buffer of event window to screen after the event is processed.
* This function only works for a drawer_trigger, when a drawer_trigger receives an event,
* after drawing, a drawer_trigger should call lazy_refresh to tell the Nana.GUI to refresh
* the window to the screen after the event process finished.
*/
void lazy_refresh();
/// Refresh the window and display it immediately calling the refresh function of its drawer_trigger. /// Refresh the window and display it immediately calling the refresh function of its drawer_trigger.
/* /*
* The drawer::refresh() will be called. If the currently state is lazy_refrsh, the window is delayed to update the graphics until an event is finished. * The drawer::refresh() will be called. If the currently state is lazy_refrsh, the window is delayed to update the graphics until an event is finished.
@ -296,6 +295,7 @@ namespace API
/// Sets the keyboard focus for a specified window. /// Sets the keyboard focus for a specified window.
void focus_window(window); void focus_window(window);
/// Returns a window which has grabbed the mouse input.
window capture_window(); window capture_window();
/// Enables a window to grab the mouse input. /// Enables a window to grab the mouse input.
@ -311,7 +311,10 @@ namespace API
*/ */
void release_capture(window window_handle); void release_capture(window window_handle);
void modal_window(window); ///< Blocks the routine til the specified window is closed. /// Blocks the execution and other windows' messages until the specified window is closed.
void modal_window(window);
/// Blocks the execution until the specified window is closesd.
void wait_for(window); void wait_for(window);
color fgcolor(window); color fgcolor(window);

View File

@ -205,14 +205,14 @@ namespace nana
void resized(graph_reference graph, const ::nana::arg_resized&) override void resized(graph_reference graph, const ::nana::arg_resized&) override
{ {
drawer_.draw(graph, metrics_.what); drawer_.draw(graph, metrics_.what);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void mouse_enter(graph_reference graph, const ::nana::arg_mouse& arg) override void mouse_enter(graph_reference graph, const ::nana::arg_mouse& arg) override
{ {
metrics_.what = drawer_.what(graph, arg.pos); metrics_.what = drawer_.what(graph, arg.pos);
drawer_.draw(graph, metrics_.what); drawer_.draw(graph, metrics_.what);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void mouse_move(graph_reference graph, const ::nana::arg_mouse& arg) override void mouse_move(graph_reference graph, const ::nana::arg_mouse& arg) override
@ -238,7 +238,7 @@ namespace nana
if (redraw) if (redraw)
{ {
drawer_.draw(graph, metrics_.what); drawer_.draw(graph, metrics_.what);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -278,7 +278,7 @@ namespace nana
break; break;
} }
drawer_.draw(graph, metrics_.what); drawer_.draw(graph, metrics_.what);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -291,7 +291,7 @@ namespace nana
metrics_.pressed = false; metrics_.pressed = false;
metrics_.what = drawer_.what(graph, arg.pos); metrics_.what = drawer_.what(graph, arg.pos);
drawer_.draw(graph, metrics_.what); drawer_.draw(graph, metrics_.what);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void mouse_leave(graph_reference graph, const arg_mouse&) override void mouse_leave(graph_reference graph, const arg_mouse&) override
@ -300,7 +300,7 @@ namespace nana
metrics_.what = buttons::none; metrics_.what = buttons::none;
drawer_.draw(graph, buttons::none); drawer_.draw(graph, buttons::none);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void mouse_wheel(graph_reference graph, const arg_wheel& arg) override void mouse_wheel(graph_reference graph, const arg_wheel& arg) override
@ -308,7 +308,7 @@ namespace nana
if (make_step(arg.upwards == false, 3)) if (make_step(arg.upwards == false, 3))
{ {
drawer_.draw(graph, metrics_.what); drawer_.draw(graph, metrics_.what);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
private: private:

View File

@ -109,14 +109,14 @@ namespace nana
x_pointed_ = _m_button_area().is_hit(arg.pos); x_pointed_ = _m_button_area().is_hit(arg.pos);
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void mouse_leave(graph_reference graph, const arg_mouse&) override void mouse_leave(graph_reference graph, const arg_mouse&) override
{ {
x_pointed_ = false; x_pointed_ = false;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void mouse_down(graph_reference graph, const arg_mouse&) override void mouse_down(graph_reference graph, const arg_mouse&) override
@ -127,7 +127,7 @@ namespace nana
x_state_ = ::nana::mouse_action::pressed; x_state_ = ::nana::mouse_action::pressed;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void mouse_up(graph_reference graph, const arg_mouse&) override void mouse_up(graph_reference graph, const arg_mouse&) override
@ -137,7 +137,7 @@ namespace nana
x_state_ = ::nana::mouse_action::over; x_state_ = ::nana::mouse_action::over;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
close_fn_(); close_fn_();
} }

View File

@ -314,6 +314,11 @@ namespace API
if (restrict::wd_manager().available(iwd)) if (restrict::wd_manager().available(iwd))
iwd->flags.space_click_enabled = enable; iwd->flags.space_click_enabled = enable;
} }
void lazy_refresh()
{
restrict::bedrock.thread_context_lazy_refresh();
}
}//end namespace dev }//end namespace dev
@ -824,13 +829,6 @@ namespace API
return (restrict::wd_manager().available(iwd) ? iwd->flags.enabled : false); return (restrict::wd_manager().available(iwd) ? iwd->flags.enabled : false);
} }
//lazy_refresh:
//@brief: A widget drawer draws the widget surface in answering an event. This function will tell the drawer to copy the graphics into window after event answering.
void lazy_refresh()
{
restrict::bedrock.thread_context_lazy_refresh();
}
//refresh_window //refresh_window
//@brief: Refresh the window and display it immediately. //@brief: Refresh the window and display it immediately.
void refresh_window(window wd) void refresh_window(window wd)

View File

@ -134,7 +134,7 @@ namespace nana{ namespace drawerbase
{ {
attr_.e_state = (attr_.pushed || attr_.keep_pressed ? element_state::pressed : element_state::hovered); attr_.e_state = (attr_.pushed || attr_.keep_pressed ? element_state::pressed : element_state::hovered);
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void trigger::mouse_leave(graph_reference graph, const arg_mouse&) void trigger::mouse_leave(graph_reference graph, const arg_mouse&)
@ -144,7 +144,7 @@ namespace nana{ namespace drawerbase
attr_.e_state = element_state::normal; attr_.e_state = element_state::normal;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void trigger::mouse_down(graph_reference graph, const arg_mouse& arg) void trigger::mouse_down(graph_reference graph, const arg_mouse& arg)
@ -185,7 +185,7 @@ namespace nana{ namespace drawerbase
{ {
attr_.focused = arg.getting; attr_.focused = arg.getting;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void trigger::_m_draw_title(graph_reference graph, bool enabled) void trigger::_m_draw_title(graph_reference graph, bool enabled)
@ -343,7 +343,7 @@ namespace nana{ namespace drawerbase
} }
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void trigger::emit_click() void trigger::emit_click()

View File

@ -881,7 +881,7 @@ namespace nana
{ {
scheme_->mouse_pressed(); scheme_->mouse_pressed();
scheme_->draw(graph); scheme_->draw(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
} }
@ -894,7 +894,7 @@ namespace nana
{ {
scheme_->mouse_release(); scheme_->mouse_release();
scheme_->draw(graph); scheme_->draw(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
} }
@ -904,7 +904,7 @@ namespace nana
if(scheme_->locate(arg.pos.x, arg.pos.y) && API::window_enabled(scheme_->window_handle())) if(scheme_->locate(arg.pos.x, arg.pos.y) && API::window_enabled(scheme_->window_handle()))
{ {
scheme_->draw(graph); scheme_->draw(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -913,7 +913,7 @@ namespace nana
if(API::window_enabled(scheme_->window_handle()) && (scheme_->is_list_shown() == false) && scheme_->erase_locate()) if(API::window_enabled(scheme_->window_handle()) && (scheme_->is_list_shown() == false) && scheme_->erase_locate())
{ {
scheme_->draw(graph); scheme_->draw(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
//end class trigger //end class trigger

View File

@ -85,7 +85,7 @@ namespace nana{ namespace drawerbase
void drawer::mouse_down(graph_reference graph, const arg_mouse&) void drawer::mouse_down(graph_reference graph, const arg_mouse&)
{ {
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_up(graph_reference graph, const arg_mouse&) void drawer::mouse_up(graph_reference graph, const arg_mouse&)
@ -97,19 +97,19 @@ namespace nana{ namespace drawerbase
API::events<nana::checkbox>(impl_->widget_ptr->handle()).checked.emit(arg, impl_->widget_ptr->handle()); API::events<nana::checkbox>(impl_->widget_ptr->handle()).checked.emit(arg, impl_->widget_ptr->handle());
} }
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_enter(graph_reference graph, const arg_mouse&) void drawer::mouse_enter(graph_reference graph, const arg_mouse&)
{ {
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_leave(graph_reference graph, const arg_mouse&) void drawer::mouse_leave(graph_reference graph, const arg_mouse&)
{ {
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
drawer::implement * drawer::impl() const drawer::implement * drawer::impl() const

View File

@ -586,7 +586,7 @@ namespace nana
{ {
drawer_->draw(); drawer_->draw();
drawer_->editor()->reset_caret(); drawer_->editor()->reset_caret();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -596,7 +596,7 @@ namespace nana
if(drawer_->widget_ptr()->enabled()) if(drawer_->widget_ptr()->enabled())
{ {
drawer_->draw(); drawer_->draw();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -607,7 +607,7 @@ namespace nana
if(drawer_->widget_ptr()->enabled()) if(drawer_->widget_ptr()->enabled())
{ {
drawer_->draw(); drawer_->draw();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -625,7 +625,7 @@ namespace nana
if(editor->attr().editable) if(editor->attr().editable)
editor->reset_caret(); editor->reset_caret();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -636,7 +636,7 @@ namespace nana
drawer_->editor()->mouse_pressed(arg); drawer_->editor()->mouse_pressed(arg);
drawer_->set_button_state(element_state::hovered, false); drawer_->set_button_state(element_state::hovered, false);
drawer_->draw(); drawer_->draw();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -651,7 +651,7 @@ namespace nana
{ {
drawer_->draw(); drawer_->draw();
drawer_->editor()->reset_caret(); drawer_->editor()->reset_caret();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
} }
@ -711,13 +711,13 @@ namespace nana
if (call_other_keys) if (call_other_keys)
drawer_->editor()->respond_key(arg); drawer_->editor()->respond_key(arg);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void trigger::key_char(graph_reference graph, const arg_keyboard& arg) void trigger::key_char(graph_reference graph, const arg_keyboard& arg)
{ {
if (drawer_->editor()->respond_char(arg)) if (drawer_->editor()->respond_char(arg))
API::lazy_refresh(); API::dev::lazy_refresh();
} }
//end class trigger //end class trigger

View File

@ -797,7 +797,7 @@ namespace nana
if (model_->set_where(pos) || (model::where::textarea == pos)) if (model_->set_where(pos) || (model::where::textarea == pos))
{ {
model_->render(graph); model_->render(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -806,7 +806,7 @@ namespace nana
if (model_->set_where(model::where::none)) if (model_->set_where(model::where::none))
{ {
model_->render(graph); model_->render(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -882,7 +882,7 @@ namespace nana
if (!transformed) if (!transformed)
model_->render(graph); model_->render(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -894,7 +894,7 @@ namespace nana
if (!redrawn) if (!redrawn)
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
//end class trigger //end class trigger

View File

@ -443,7 +443,7 @@ namespace nana
if(drawer_->set_mouse(graph, arg.pos.x, arg.pos.y)) if(drawer_->set_mouse(graph, arg.pos.x, arg.pos.y))
{ {
drawer_->draw(); drawer_->draw();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }

View File

@ -3392,7 +3392,7 @@ namespace nana
if (2 == update) if (2 == update)
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -3409,7 +3409,7 @@ namespace nana
} }
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -3504,7 +3504,7 @@ namespace nana
if(update) if(update)
{ {
_m_draw_border(); _m_draw_border();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -3525,7 +3525,7 @@ namespace nana
{ {
essence_->trace_item_dpl({0,0}); essence_->trace_item_dpl({0,0});
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
} }
@ -3535,7 +3535,7 @@ namespace nana
essence_->widget_to_header(pos); essence_->widget_to_header(pos);
drawer_header_->grab(pos, false); drawer_header_->grab(pos, false);
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
essence_->lister.wd_ptr()->release_capture(); essence_->lister.wd_ptr()->release_capture();
} }
} }
@ -3546,7 +3546,7 @@ namespace nana
{ {
refresh(graph); refresh(graph);
essence_->adjust_scroll_value(); essence_->adjust_scroll_value();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -3588,7 +3588,7 @@ namespace nana
} }
essence_->adjust_scroll_life(); essence_->adjust_scroll_life();
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
} }
@ -3597,7 +3597,7 @@ namespace nana
{ {
essence_->adjust_scroll_life(); essence_->adjust_scroll_life();
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void trigger::key_press(graph_reference graph, const arg_keyboard& arg) void trigger::key_press(graph_reference graph, const arg_keyboard& arg)
@ -3670,7 +3670,7 @@ namespace nana
return; return;
} }
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void trigger::key_char(graph_reference graph, const arg_keyboard& arg) void trigger::key_char(graph_reference graph, const arg_keyboard& arg)
@ -3688,7 +3688,7 @@ namespace nana
case keyboard::select_all : case keyboard::select_all :
essence_->lister.select_for_all(true); essence_->lister.select_for_all(true);
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
break; break;
default: default:

View File

@ -350,7 +350,7 @@ namespace nana
if(track_mouse(arg.pos)) if(track_mouse(arg.pos))
{ {
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }

View File

@ -253,7 +253,7 @@ namespace nana
{ {
_m_popup_menu(); _m_popup_menu();
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
state_.mouse_pos = arg.pos; state_.mouse_pos = arg.pos;
@ -281,7 +281,7 @@ namespace nana
_m_total_close(); _m_total_close();
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void trigger::mouse_up(graph_reference graph, const arg_mouse&) void trigger::mouse_up(graph_reference graph, const arg_mouse&)
@ -298,7 +298,7 @@ namespace nana
state_.behavior = state_.behavior_none; state_.behavior = state_.behavior_none;
_m_total_close(); _m_total_close();
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -312,7 +312,7 @@ namespace nana
_m_close_menu(); _m_close_menu();
state_.active = npos; state_.active = npos;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -407,7 +407,7 @@ namespace nana
} }
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void trigger::key_release(graph_reference graph, const arg_keyboard& arg) void trigger::key_release(graph_reference graph, const arg_keyboard& arg)
@ -429,7 +429,7 @@ namespace nana
state_.menu_active = false; state_.menu_active = false;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -449,7 +449,7 @@ namespace nana
state_.menu->goto_next(true); state_.menu->goto_next(true);
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
state_.behavior = state_.behavior_menu; state_.behavior = state_.behavior_menu;
} }
} }
@ -477,7 +477,7 @@ namespace nana
{ {
state_.active = index; state_.active = index;
refresh(*graph_); refresh(*graph_);
API::lazy_refresh(); API::dev::lazy_refresh();
if(_m_popup_menu()) if(_m_popup_menu())
state_.menu->goto_next(true); state_.menu->goto_next(true);

View File

@ -626,7 +626,7 @@ namespace nana
if(mkdir) if(mkdir)
{ {
impl_->draw(); impl_->draw();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
} }
@ -637,7 +637,7 @@ namespace nana
if(mkdraw) if(mkdraw)
{ {
impl_->draw(); impl_->draw();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -660,7 +660,7 @@ namespace nana
if(mkdraw) if(mkdraw)
{ {
impl_->draw(); impl_->draw();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -669,7 +669,7 @@ namespace nana
if(impl_->reset_adorn()) if(impl_->reset_adorn())
{ {
impl_->draw(); impl_->draw();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -677,7 +677,7 @@ namespace nana
{ {
impl_->resize(); impl_->resize();
impl_->draw(); impl_->draw();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
//end class trigger //end class trigger
}//end namespace slider }//end namespace slider

View File

@ -524,38 +524,38 @@ namespace nana
impl_->reset_text(); impl_->reset_text();
impl_->render(); impl_->render();
impl_->editor()->reset_caret(); impl_->editor()->reset_caret();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_wheel(graph_reference, const arg_wheel& arg) void drawer::mouse_wheel(graph_reference, const arg_wheel& arg)
{ {
impl_->mouse_wheel(arg.upwards); impl_->mouse_wheel(arg.upwards);
impl_->editor()->reset_caret(); impl_->editor()->reset_caret();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_down(graph_reference, const arg_mouse& arg) void drawer::mouse_down(graph_reference, const arg_mouse& arg)
{ {
if (impl_->mouse_button(arg, true)) if (impl_->mouse_button(arg, true))
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_up(graph_reference, const arg_mouse& arg) void drawer::mouse_up(graph_reference, const arg_mouse& arg)
{ {
if (impl_->mouse_button(arg, false)) if (impl_->mouse_button(arg, false))
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_move(graph_reference, const arg_mouse& arg) void drawer::mouse_move(graph_reference, const arg_mouse& arg)
{ {
if (impl_->mouse_move(arg.left_button, arg.pos)) if (impl_->mouse_move(arg.left_button, arg.pos))
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_leave(graph_reference, const arg_mouse&) void drawer::mouse_leave(graph_reference, const arg_mouse&)
{ {
impl_->render(); impl_->render();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::key_press(graph_reference, const arg_keyboard& arg) void drawer::key_press(graph_reference, const arg_keyboard& arg)
@ -564,7 +564,7 @@ namespace nana
{ {
impl_->editor()->reset_caret(); impl_->editor()->reset_caret();
impl_->draw_spins(); impl_->draw_spins();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -575,7 +575,7 @@ namespace nana
if (!impl_->value(to_utf8(impl_->editor()->text()))) if (!impl_->value(to_utf8(impl_->editor()->text())))
impl_->draw_spins(); impl_->draw_spins();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -584,7 +584,7 @@ namespace nana
impl_->reset_text_area(); impl_->reset_text_area();
impl_->render(); impl_->render();
impl_->editor()->reset_caret(); impl_->editor()->reset_caret();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
}//end namespace drawerbase }//end namespace drawerbase

View File

@ -1255,7 +1255,7 @@ namespace nana
if(false == layouter_->active_by_trace()) if(false == layouter_->active_by_trace())
layouter_->toolbox_answer(arg); layouter_->toolbox_answer(arg);
layouter_->render(); layouter_->render();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -1266,7 +1266,7 @@ namespace nana
if(rd) if(rd)
{ {
layouter_->render(); layouter_->render();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -1275,7 +1275,7 @@ namespace nana
if(layouter_->trace(arg.pos.x, arg.pos.y)) if(layouter_->trace(arg.pos.x, arg.pos.y))
{ {
layouter_->render(); layouter_->render();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -1284,7 +1284,7 @@ namespace nana
if(layouter_->leave()) if(layouter_->leave())
{ {
layouter_->render(); layouter_->render();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
//end class trigger //end class trigger
@ -1535,7 +1535,7 @@ namespace nana
return; return;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void driver::mouse_leave(graph_reference graph, const arg_mouse&) void driver::mouse_leave(graph_reference graph, const arg_mouse&)
@ -1544,7 +1544,7 @@ namespace nana
return; return;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void driver::mouse_down(graph_reference graph, const arg_mouse&) void driver::mouse_down(graph_reference graph, const arg_mouse&)
@ -1559,7 +1559,7 @@ namespace nana
model_->show_attached_window(); model_->show_attached_window();
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
event_arg arg; event_arg arg;
model_->widget_ptr()->events().selected.emit(arg, model_->widget_ptr()->handle()); model_->widget_ptr()->events().selected.emit(arg, model_->widget_ptr()->handle());

View File

@ -97,7 +97,7 @@ namespace drawerbase {
if (!editor_->focus_changed(arg)) if (!editor_->focus_changed(arg))
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_down(graph_reference, const arg_mouse& arg) void drawer::mouse_down(graph_reference, const arg_mouse& arg)
@ -105,20 +105,20 @@ namespace drawerbase {
if (editor_->mouse_pressed(arg)) if (editor_->mouse_pressed(arg))
{ {
editor_->render(true); editor_->render(true);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
void drawer::mouse_move(graph_reference, const arg_mouse& arg) void drawer::mouse_move(graph_reference, const arg_mouse& arg)
{ {
if(editor_->mouse_move(arg.left_button, arg.pos)) if(editor_->mouse_move(arg.left_button, arg.pos))
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_up(graph_reference graph, const arg_mouse& arg) void drawer::mouse_up(graph_reference graph, const arg_mouse& arg)
{ {
if(editor_->mouse_pressed(arg)) if(editor_->mouse_pressed(arg))
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_wheel(graph_reference, const arg_wheel& arg) void drawer::mouse_wheel(graph_reference, const arg_wheel& arg)
@ -126,20 +126,20 @@ namespace drawerbase {
if(editor_->scroll(arg.upwards, true)) if(editor_->scroll(arg.upwards, true))
{ {
editor_->reset_caret(); editor_->reset_caret();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
void drawer::mouse_enter(graph_reference, const arg_mouse&) void drawer::mouse_enter(graph_reference, const arg_mouse&)
{ {
if(editor_->mouse_enter(true)) if(editor_->mouse_enter(true))
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::mouse_leave(graph_reference, const arg_mouse&) void drawer::mouse_leave(graph_reference, const arg_mouse&)
{ {
if(editor_->mouse_enter(false)) if(editor_->mouse_enter(false))
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::key_press(graph_reference, const arg_keyboard& arg) void drawer::key_press(graph_reference, const arg_keyboard& arg)
@ -147,14 +147,14 @@ namespace drawerbase {
if(editor_->respond_key(arg)) if(editor_->respond_key(arg))
{ {
editor_->reset_caret(); editor_->reset_caret();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
void drawer::key_char(graph_reference, const arg_keyboard& arg) void drawer::key_char(graph_reference, const arg_keyboard& arg)
{ {
if (editor_->respond_char(arg)) if (editor_->respond_char(arg))
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::resized(graph_reference graph, const arg_resized& arg) void drawer::resized(graph_reference graph, const arg_resized& arg)
@ -162,7 +162,7 @@ namespace drawerbase {
_m_text_area(arg.width, arg.height); _m_text_area(arg.width, arg.height);
refresh(graph); refresh(graph);
editor_->reset_caret(); editor_->reset_caret();
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void drawer::typeface_changed(graph_reference graph) void drawer::typeface_changed(graph_reference graph)

View File

@ -317,7 +317,7 @@ namespace nana
impl_->state = item_renderer::state_t::highlighted; impl_->state = item_renderer::state_t::highlighted;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
if (impl_->state == item_renderer::state_t::highlighted) if (impl_->state == item_renderer::state_t::highlighted)
{ {
@ -341,7 +341,7 @@ namespace nana
impl_->which = npos; impl_->which = npos;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
if (which != npos && impl_->items.at(which)->enable) if (which != npos && impl_->items.at(which)->enable)
{ {
@ -359,7 +359,7 @@ namespace nana
{ {
impl_->state = item_renderer::state_t::selected; impl_->state = item_renderer::state_t::selected;
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -382,7 +382,7 @@ namespace nana
} }
refresh(graph); refresh(graph);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }

View File

@ -1879,7 +1879,7 @@ namespace nana
impl_->node_state.event_node = nl.node(); impl_->node_state.event_node = nl.node();
impl_->set_expanded(impl_->node_state.event_node, !impl_->node_state.event_node->value.second.expanded); impl_->set_expanded(impl_->node_state.event_node, !impl_->node_state.event_node->value.second.expanded);
impl_->draw(true); impl_->draw(true);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -1927,7 +1927,7 @@ namespace nana
if(has_redraw) if(has_redraw)
{ {
impl_->draw(true); impl_->draw(true);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -1960,7 +1960,7 @@ namespace nana
return; //Do not refresh return; //Do not refresh
impl_->draw(true); impl_->draw(true);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
void trigger::mouse_move(graph_reference, const arg_mouse& arg) void trigger::mouse_move(graph_reference, const arg_mouse& arg)
@ -1968,7 +1968,7 @@ namespace nana
if(impl_->track_mouse(arg.pos.x, arg.pos.y)) if(impl_->track_mouse(arg.pos.x, arg.pos.y))
{ {
impl_->draw(false); impl_->draw(false);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -1986,7 +1986,7 @@ namespace nana
impl_->track_mouse(arg.pos.x, arg.pos.y); impl_->track_mouse(arg.pos.x, arg.pos.y);
impl_->draw(false); impl_->draw(false);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -1998,14 +1998,14 @@ namespace nana
impl_->data.widget_ptr->events().hovered.emit(::nana::arg_treebox{ *impl_->data.widget_ptr, iprx, false }, impl_->data.widget_ptr->handle()); impl_->data.widget_ptr->events().hovered.emit(::nana::arg_treebox{ *impl_->data.widget_ptr, iprx, false }, impl_->data.widget_ptr->handle());
impl_->node_state.pointed = nullptr; impl_->node_state.pointed = nullptr;
impl_->draw(false); impl_->draw(false);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
void trigger::resized(graph_reference, const arg_resized&) void trigger::resized(graph_reference, const arg_resized&)
{ {
impl_->draw(false); impl_->draw(false);
API::lazy_refresh(); API::dev::lazy_refresh();
impl_->show_scroll(); impl_->show_scroll();
if(!impl_->shape.scroll.empty()) if(!impl_->shape.scroll.empty())
{ {
@ -2120,7 +2120,7 @@ namespace nana
if(redraw) if(redraw)
{ {
impl_->draw(scroll); impl_->draw(scroll);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
@ -2150,7 +2150,7 @@ namespace nana
if (do_refresh) if (do_refresh)
{ {
impl_->draw(do_refresh & 1); impl_->draw(do_refresh & 1);
API::lazy_refresh(); API::dev::lazy_refresh();
} }
} }
//end class trigger //end class trigger