Merge branch 'hotfix-1.2' into prepare-utf8

This commit is contained in:
Jinhao
2015-12-08 01:57:44 +08:00
20 changed files with 234 additions and 209 deletions

View File

@@ -11,6 +11,7 @@
*/
#include <nana/detail/platform_spec_selector.hpp>
#if defined(NANA_POSIX) && defined(NANA_X11)
#include <nana/gui/detail/bedrock_pi_data.hpp>
#include <nana/gui/detail/event_code.hpp>
#include <nana/system/platform.hpp>
@@ -468,8 +469,8 @@ namespace detail
arg.right_button = ((Button2Mask & mask_state) != 0) || (::nana::mouse::right_button == arg.button);
arg.mid_button = ((Button3Mask & mask_state) != 0) || (::nana::mouse::middle_button == arg.button);
arg.alt = ((Mod1Mask & mask_state) != 0);
arg.shift = £¨(ShiftMask & mask_state) != 0);
arg.ctrl = £¨(ControlMask & mask_state) != 0);
arg.shift = ((ShiftMask & mask_state) != 0);
arg.ctrl = ((ControlMask & mask_state) != 0);
}
@@ -833,7 +834,7 @@ namespace detail
msgwnd->flags.action = mouse_action::over;
click_arg.window_handle = reinterpret_cast<window>(msgwnd);
emit_drawer(&drawer::click, msgwnd, arg, &context);
emit_drawer(&drawer::click, msgwnd, click_arg, &context);
}
}
@@ -1399,3 +1400,4 @@ namespace detail
}
}//end namespace detail
}//end namespace nana
#endif //NANA_POSIX && NANA_X11

View File

@@ -1,23 +0,0 @@
/*
* Bedrock Selector
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Nana Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://nanapro.sourceforge.net/LICENSE_1_0.txt)
*
* @file: nana/gui/detail/bedrock_selector.cpp
*
* This file is used to support the Nana project of some cross-platform IDE,
*
*/
#include <nana/config.hpp>
#if defined(NANA_WINDOWS)
#include "win32/bedrock.cpp"
#elif defined(NANA_LINUX) || defined(NANA_MACOS)
#include "linux_X11/bedrock.cpp"
#endif

View File

@@ -12,6 +12,7 @@
*/
#include <nana/detail/platform_spec_selector.hpp>
#if defined(NANA_WINDOWS)
#include <nana/gui/detail/bedrock.hpp>
#include <nana/gui/detail/bedrock_pi_data.hpp>
#include <nana/gui/detail/event_code.hpp>
@@ -1895,3 +1896,4 @@ namespace detail
}
}//end namespace detail
}//end namespace nana
#endif //NANA_WINDOWS

View File

@@ -15,6 +15,7 @@
#include <cmath>
#include <map>
#include <deque>
#include <nana/deploy.hpp>
#include <nana/gui/place.hpp>
#include <nana/gui/programming_interface.hpp>
#include <nana/gui/widgets/label.hpp>
@@ -95,13 +96,7 @@ namespace nana
std::string pos_str() const
{
#ifdef UNDEFINED_to_string
std::stringstream ss;
ss<<pos();
return ss.str();
#else
return std::to_string(pos());
#endif // UNDEFINED_to_string
}
token read()

View File

@@ -605,60 +605,60 @@ namespace nana
void attach(std::size_t pos, window wd)
{
if(pos < list_.size())
{
iterator_at(pos)->relative = wd;
API::show_window(wd, basis_.active == pos);
}
if (pos >= list_.size())
throw std::out_of_range("tabbar: invalid position");
API::show_window(wd, basis_.active == pos);
}
bool tab_color(std::size_t pos, bool is_bgcolor, const ::nana::color& clr)
{
if(pos < list_.size())
if (pos >= list_.size())
throw std::out_of_range("tabbar: invalid position");
auto & m = *iterator_at(pos);
auto & m_clr = (is_bgcolor ? m.bgcolor : m.fgcolor);
if (m_clr != clr)
{
auto & m = *iterator_at(pos);
auto & m_clr = (is_bgcolor ? m.bgcolor : m.fgcolor);
if (m_clr != clr)
{
m_clr = clr;
return true;
}
m_clr = clr;
return true;
}
return false;
}
bool tab_image(std::size_t pos, const nana::paint::image& img)
void tab_image(std::size_t pos, const nana::paint::image& img)
{
if(pos > list_.size()) return false;
if (pos >= list_.size())
throw std::out_of_range("tabbar: invalid position");
auto & m = *iterator_at(pos);
if(img)
m.img = img;
else
m.img.close();
return true;
}
bool text(std::size_t pos, const nana::string& str)
{
if(pos < list_.size())
if (pos >= list_.size())
throw std::out_of_range("tabbar: invalid position");
auto & m = *iterator_at(pos);
if(m.text != str)
{
auto & m = *iterator_at(pos);
if(m.text != str)
{
m.text = str;
return true;
}
m.text = str;
return true;
}
return false;
}
nana::string text(std::size_t pos) const
{
if(pos < list_.size())
return iterator_at(pos)->text;
if (pos >= list_.size())
throw std::out_of_range("tabbar: invalid position");
return nana::string();
return iterator_at(pos)->text;
}
bool toolbox_answer(const arg_mouse& arg)
@@ -1195,8 +1195,8 @@ namespace nana
void trigger::tab_image(std::size_t i, const nana::paint::image& img)
{
if(layouter_->tab_image(i, img))
API::refresh_window(layouter_->widget_handle());
layouter_->tab_image(i, img);
API::refresh_window(layouter_->widget_handle());
}
void trigger::text(std::size_t i, const nana::string& str)