Merge branch 'hotfix-1.3' into develop

This commit is contained in:
Jinhao
2016-07-19 23:50:11 +08:00
7 changed files with 144 additions and 90 deletions

View File

@@ -175,7 +175,8 @@ namespace detail
Atom xdnd_finished;
};
struct caret_tag;
//A forward declaration of caret data
struct caret_rep;
class timer_runner;
@@ -243,9 +244,7 @@ namespace detail
void caret_close(native_window_type);
void caret_pos(native_window_type, const ::nana::point&);
void caret_visible(native_window_type, bool);
void caret_flash(caret_tag&);
bool caret_update(native_window_type, nana::paint::graphics& root_graph, bool is_erase_caret_from_root_graph);
static bool caret_reinstate(caret_tag&);
void set_error_handler();
int rev_error_handler();
@@ -287,7 +286,7 @@ namespace detail
{
volatile bool exit_thread;
std::unique_ptr<std::thread> thr;
std::map<native_window_type, caret_tag*> carets;
std::map<native_window_type, caret_rep*> carets;
}caret_holder_;
std::map<native_window_type, window_context_t> wincontext_;

View File

@@ -61,6 +61,12 @@ namespace nana
/// Writes a string to the buffer.
msgbox & operator<<(const wchar_t*);
/// Writes a UTF-8 string to the buffer.
msgbox & operator<<(const std::string&);
/// Writes a UTF-8 string to the buffer.
msgbox & operator<<(const char*);
/// Writes a string to the buffer.
msgbox & operator<<(const nana::charset&);

View File

@@ -168,7 +168,7 @@ namespace nana
void insert(std::size_t, native_string_type&&, nana::any&&);
std::size_t length() const;
bool close_fly(bool);
void attach(std::size_t, window);
window attach(std::size_t, window, bool drop_other);
void erase(std::size_t);
void tab_color(std::size_t, bool is_bgcolor, const ::nana::color&);
void tab_image(size_t, const nana::paint::image&);
@@ -306,12 +306,19 @@ namespace nana
API::update_window(*this);
}
void attach(std::size_t pos, window attach_wd)
/// Attach a window to a specified tab. When the tab is activated, tabbar shows the attached window.
/**
* @param pos The position of tab to set the attached window.
* @param attach_wd A handle to the window to be set.
* @param drop_other Drop the attached windows of other tabs whose attach windows are equal to the parameter attach_wd. If drop_other is true, the other tabs attached windows equal to attach_wd will be dropped.
* @return A handle to the last attached window of specified tab.
*/
window attach(std::size_t pos, window attach_wd, bool drop_other = true)
{
if (attach_wd && API::empty_window(attach_wd))
throw std::invalid_argument("tabbar.attach: invalid window handle");
this->get_drawer_trigger().attach(pos, attach_wd);
return this->get_drawer_trigger().attach(pos, attach_wd, drop_other);
}
void erase(std::size_t pos)