add throw() for some functions
This commit is contained in:
@@ -1305,26 +1305,22 @@ namespace detail
|
||||
brock.event_move(msgwnd, (int)(short) LOWORD(lParam), (int)(short) HIWORD(lParam));
|
||||
break;
|
||||
case WM_PAINT:
|
||||
if (msgwnd->is_draw_through())
|
||||
{
|
||||
msgwnd->other.attribute.root->draw_through();
|
||||
|
||||
::PAINTSTRUCT ps;
|
||||
::BeginPaint(root_window, &ps);
|
||||
if (msgwnd->is_draw_through())
|
||||
{
|
||||
msgwnd->other.attribute.root->draw_through();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Don't copy root_graph to the window directly, otherwise the edge nimbus effect will be missed.
|
||||
::nana::rectangle update_area(ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top);
|
||||
if (!update_area.empty())
|
||||
msgwnd->drawer.map(reinterpret_cast<window>(msgwnd), true, &update_area);
|
||||
}
|
||||
::EndPaint(root_window, &ps);
|
||||
}
|
||||
else
|
||||
{
|
||||
::PAINTSTRUCT ps;
|
||||
::HDC dc = ::BeginPaint(root_window, &ps);
|
||||
|
||||
//Don't copy root_graph to the window directly, otherwise the edge nimbus effect will be missed.
|
||||
::nana::rectangle update_area(ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top);
|
||||
if (!update_area.empty())
|
||||
msgwnd->drawer.map(reinterpret_cast<window>(msgwnd), true, &update_area);
|
||||
|
||||
::EndPaint(root_window, &ps);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_SYSCHAR:
|
||||
def_window_proc = true;
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace API
|
||||
iwd->effect.bground = new_effect_ptr;
|
||||
iwd->effect.bground_fade_rate = fade_rate;
|
||||
restrict::window_manager.enable_effects_bground(iwd, true);
|
||||
|
||||
|
||||
if (fade_rate < 0.01)
|
||||
iwd->flags.make_bground_declared = true;
|
||||
|
||||
@@ -184,7 +184,7 @@ namespace API
|
||||
}
|
||||
}
|
||||
|
||||
nana::string window_caption(window wd)
|
||||
nana::string window_caption(window wd) throw()
|
||||
{
|
||||
auto const iwd = reinterpret_cast<restrict::core_window_t*>(wd);
|
||||
internal_scope_guard isg;
|
||||
@@ -559,7 +559,7 @@ namespace API
|
||||
{
|
||||
if (category::flags::root != iwd->other.category)
|
||||
iwd = iwd->seek_non_lite_widget_ancestor();
|
||||
|
||||
|
||||
restrict::window_manager.update(iwd, false, false);
|
||||
}
|
||||
}
|
||||
@@ -640,7 +640,7 @@ namespace API
|
||||
internal_scope_guard lock;
|
||||
if (!restrict::window_manager.available(iwd))
|
||||
return{};
|
||||
|
||||
|
||||
auto sz = window_size(wd);
|
||||
sz.width += iwd->extra_width;
|
||||
sz.height += iwd->extra_height;
|
||||
@@ -774,7 +774,7 @@ namespace API
|
||||
if (restrict::window_manager.available(iwd))
|
||||
iwd->widget_notifier->caption(title);
|
||||
}
|
||||
|
||||
|
||||
nana::string window_caption(window wd)
|
||||
{
|
||||
auto const iwd = reinterpret_cast<restrict::core_window_t*>(wd);
|
||||
@@ -931,7 +931,7 @@ namespace API
|
||||
if (prev != clr)
|
||||
{
|
||||
iwd->scheme->background = clr;
|
||||
|
||||
|
||||
//If the bground mode of this window is basic, it should remake the background
|
||||
if (iwd->effect.bground && iwd->effect.bground_fade_rate < 0.01) // fade rate < 0.01 means it is basic mode
|
||||
iwd->flags.make_bground_declared = true;
|
||||
|
||||
@@ -201,7 +201,7 @@ namespace nana
|
||||
|
||||
if (new_where == state_.pointer_where)
|
||||
return false;
|
||||
|
||||
|
||||
state_.pointer_where = new_where;
|
||||
return true;
|
||||
}
|
||||
@@ -261,7 +261,7 @@ namespace nana
|
||||
state_.lister->move_items(upwards, circle);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
auto pos = module_.index;
|
||||
if (upwards)
|
||||
{
|
||||
@@ -412,7 +412,7 @@ namespace nana
|
||||
{
|
||||
if (image_pixels_ == px)
|
||||
return false;
|
||||
|
||||
|
||||
image_pixels_ = px;
|
||||
return true;
|
||||
}
|
||||
@@ -988,7 +988,7 @@ namespace nana
|
||||
API::refresh_window(*this);
|
||||
}
|
||||
|
||||
nana::string combox::_m_caption() const
|
||||
nana::string combox::_m_caption() const throw()
|
||||
{
|
||||
internal_scope_guard lock;
|
||||
auto editor = _m_impl().editor();
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace nana{
|
||||
_m_init();
|
||||
}
|
||||
|
||||
::nana::string group::_m_caption() const
|
||||
::nana::string group::_m_caption() const throw()
|
||||
{
|
||||
return impl_->caption.caption();
|
||||
}
|
||||
|
||||
@@ -779,13 +779,6 @@ namespace nana
|
||||
caption(text);
|
||||
}
|
||||
|
||||
label::label(window wd, const nana::char_t* text, bool visible)
|
||||
{
|
||||
create(wd, rectangle(), visible);
|
||||
bgcolor(API::bgcolor(wd));
|
||||
caption(text);
|
||||
}
|
||||
|
||||
label::label(window wd, const rectangle& r, bool visible)
|
||||
{
|
||||
create(wd, r, visible);
|
||||
@@ -801,7 +794,7 @@ namespace nana
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool label::transparent() const
|
||||
bool label::transparent() const throw()
|
||||
{
|
||||
return (bground_mode::basic == API::effects_bground_mode(*this));
|
||||
}
|
||||
@@ -825,9 +818,10 @@ namespace nana
|
||||
return *this;
|
||||
}
|
||||
|
||||
void label::click_for(window associated_window)
|
||||
label& label::click_for(window associated_window) throw()
|
||||
{
|
||||
get_drawer_trigger().impl()->for_associated_wd = associated_window;
|
||||
return *this;
|
||||
}
|
||||
|
||||
nana::size label::measure(unsigned limited) const
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace nana
|
||||
ss >> v;
|
||||
if (v < begin_ || last_ < v)
|
||||
return false;
|
||||
|
||||
|
||||
diff = (value_ != v);
|
||||
value_ = v;
|
||||
return true;
|
||||
@@ -297,7 +297,7 @@ namespace nana
|
||||
bool diff;
|
||||
if (!range_->value(value_str, diff))
|
||||
return false;
|
||||
|
||||
|
||||
if (diff)
|
||||
reset_text();
|
||||
return true;
|
||||
@@ -403,7 +403,7 @@ namespace nana
|
||||
_m_draw_spins(buttons::none);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ namespace nana
|
||||
auto size = API::window_size(editor_->window_handle());
|
||||
if (size.width > 18)
|
||||
return{ static_cast<int>(size.width - 16), 0, 16, size.height };
|
||||
|
||||
|
||||
return{ 0, 0, size.width, size.height };
|
||||
}
|
||||
|
||||
@@ -513,7 +513,7 @@ namespace nana
|
||||
{
|
||||
impl_->attach(wdg, graph);
|
||||
}
|
||||
|
||||
|
||||
void drawer::refresh(graph_reference)
|
||||
{
|
||||
impl_->render();
|
||||
@@ -526,7 +526,7 @@ namespace nana
|
||||
impl_->editor()->reset_caret();
|
||||
API::lazy_refresh();
|
||||
}
|
||||
|
||||
|
||||
void drawer::mouse_wheel(graph_reference, const arg_wheel& arg)
|
||||
{
|
||||
impl_->mouse_wheel(arg.upwards);
|
||||
@@ -557,7 +557,7 @@ namespace nana
|
||||
impl_->render();
|
||||
API::lazy_refresh();
|
||||
}
|
||||
|
||||
|
||||
void drawer::key_press(graph_reference, const arg_keyboard& arg)
|
||||
{
|
||||
if (impl_->editor()->respond_key(arg))
|
||||
@@ -682,7 +682,7 @@ namespace nana
|
||||
modifier(static_cast<std::wstring>(::nana::charset(prefix_utf8, ::nana::unicode::utf8)), static_cast<std::wstring>(::nana::charset(suffix_utf8, ::nana::unicode::utf8)));
|
||||
}
|
||||
|
||||
::nana::string spinbox::_m_caption() const
|
||||
::nana::string spinbox::_m_caption() const throw()
|
||||
{
|
||||
internal_scope_guard lock;
|
||||
auto editor = get_drawer_trigger().impl()->editor();
|
||||
|
||||
@@ -515,7 +515,7 @@ namespace drawerbase {
|
||||
}
|
||||
|
||||
//Override _m_caption for caption()
|
||||
nana::string textbox::_m_caption() const
|
||||
nana::string textbox::_m_caption() const throw()
|
||||
{
|
||||
internal_scope_guard lock;
|
||||
auto editor = get_drawer_trigger().editor();
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* The fundamental widget class implementation
|
||||
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* @file: nana/gui/widgets/widget.cpp
|
||||
@@ -54,7 +54,7 @@ namespace nana
|
||||
widget& wdg_;
|
||||
};
|
||||
|
||||
nana::string widget::caption() const
|
||||
nana::string widget::caption() const throw()
|
||||
{
|
||||
return this->_m_caption();
|
||||
}
|
||||
@@ -64,7 +64,7 @@ namespace nana
|
||||
_m_caption(std::wstring(::nana::charset(utf8, ::nana::unicode::utf8)));
|
||||
}
|
||||
|
||||
void widget::caption(nana::string str)
|
||||
void widget::caption(std::wstring str)
|
||||
{
|
||||
_m_caption(std::move(str));
|
||||
}
|
||||
@@ -125,7 +125,7 @@ namespace nana
|
||||
|
||||
bool widget::empty() const
|
||||
{
|
||||
return (nullptr == handle());
|
||||
return (nullptr == handle());
|
||||
}
|
||||
|
||||
void widget::focus()
|
||||
@@ -252,7 +252,7 @@ namespace nana
|
||||
void widget::_m_complete_creation()
|
||||
{}
|
||||
|
||||
nana::string widget::_m_caption() const
|
||||
nana::string widget::_m_caption() const throw()
|
||||
{
|
||||
return API::dev::window_caption(handle());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user