Merge branch 'hotfix-1.4.1' into develop
This commit is contained in:
@@ -102,7 +102,7 @@
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#pragma warning(disable : 4996)
|
||||
|
||||
#if (_MSC_VER == 1900)
|
||||
#if (_MSC_VER >= 1900)
|
||||
// google: break any code that tries to use codecvt<char16_t> or codecvt<char32_t>.
|
||||
// google: It appears the C++ libs haven't been compiled with native char16_t/char32_t support.
|
||||
// google: Those definitions are for codecvt<wchar_t>::id, codecvt<unsigned short>::id and codecvt<char>::id respectively.
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace detail
|
||||
|
||||
enum class update_state
|
||||
{
|
||||
none, lazy, refresh
|
||||
none, lazy, refreshed, request_refresh
|
||||
};
|
||||
|
||||
struct edge_nimbus_action
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace nana{
|
||||
}
|
||||
|
||||
//Avoiding duplicated rendering. If the window is declared to lazy refresh, it should be rendered.
|
||||
if ((forced && (action.window == wd)) || (focused == action.window) || !action.rendered || (action.window->other.upd_state == core_window_t::update_state::refresh))
|
||||
if ((forced && (action.window == wd)) || (focused == action.window) || !action.rendered || (action.window->other.upd_state == core_window_t::update_state::refreshed))
|
||||
{
|
||||
rd_set.emplace_back(r, action.window);
|
||||
action.rendered = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Window Layout Implementation
|
||||
* Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com)
|
||||
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -42,10 +42,16 @@ namespace detail
|
||||
core_window_t * window;
|
||||
rectangle r;
|
||||
};
|
||||
public:
|
||||
static void paint(core_window_t*, bool is_redraw, bool is_child_refreshed);
|
||||
|
||||
static bool maproot(core_window_t*, bool have_refreshed, bool is_child_refreshed);
|
||||
enum class paint_operation {
|
||||
none,
|
||||
have_refreshed,
|
||||
try_refresh
|
||||
};
|
||||
public:
|
||||
static void paint(core_window_t*, paint_operation, bool request_refresh_children);
|
||||
|
||||
static bool maproot(core_window_t*, bool have_refreshed, bool request_refresh_children);
|
||||
|
||||
static void paste_children_to_graphics(core_window_t*, nana::paint::graphics& graph);
|
||||
|
||||
@@ -68,13 +74,12 @@ namespace detail
|
||||
|
||||
//_m_paste_children
|
||||
//@brief:paste children window to the root graphics directly. just paste the visual rectangle
|
||||
static void _m_paste_children(core_window_t*, bool is_child_refreshed, bool have_refreshed, const nana::rectangle& parent_rect, nana::paint::graphics& graph, const nana::point& graph_rpos);
|
||||
static void _m_paste_children(core_window_t*, bool have_refreshed, bool request_refresh_children, const nana::rectangle& parent_rect, nana::paint::graphics& graph, const nana::point& graph_rpos);
|
||||
|
||||
static void _m_paint_glass_window(core_window_t*, bool is_redraw, bool is_child_refreshed, bool called_by_notify, bool notify_other);
|
||||
|
||||
//_m_notify_glasses
|
||||
//@brief: Notify the glass windows that are overlapped with the specified vis_rect
|
||||
static void _m_notify_glasses(core_window_t* const sigwd, const nana::rectangle& r_visual);
|
||||
//Notify the windows which have brground to update their background buffer.
|
||||
static void _m_notify_glasses(core_window_t* const sigwd);
|
||||
private:
|
||||
struct data_section
|
||||
{
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace detail
|
||||
bool update(core_window_t*, bool redraw, bool force, const rectangle* update_area = nullptr);
|
||||
void refresh_tree(core_window_t*);
|
||||
|
||||
bool do_lazy_refresh(core_window_t*, bool force_copy_to_screen, bool refresh_tree = false);
|
||||
void do_lazy_refresh(core_window_t*, bool force_copy_to_screen, bool refresh_tree = false);
|
||||
|
||||
bool get_graphics(core_window_t*, nana::paint::graphics&);
|
||||
bool get_visual_rectangle(core_window_t*, nana::rectangle&);
|
||||
|
||||
@@ -14,10 +14,7 @@
|
||||
#ifndef NANA_GUI_WIDGETS_MENU_HPP
|
||||
#define NANA_GUI_WIDGETS_MENU_HPP
|
||||
#include "widget.hpp"
|
||||
#include <vector>
|
||||
#include <nana/gui/timer.hpp>
|
||||
#include <nana/pat/cloneable.hpp>
|
||||
|
||||
#include <nana/push_ignore_diagnostic>
|
||||
|
||||
namespace nana
|
||||
@@ -72,25 +69,12 @@ namespace nana
|
||||
|
||||
menu_type *sub_menu{nullptr};
|
||||
std::string text;
|
||||
event_fn_t functor;
|
||||
event_fn_t event_handler;
|
||||
checks style{checks::none};
|
||||
paint::image image;
|
||||
mutable wchar_t hotkey{0};
|
||||
};
|
||||
|
||||
struct menu_type
|
||||
{
|
||||
typedef std::vector<menu_item_type> item_container;
|
||||
typedef item_container::iterator iterator;
|
||||
typedef item_container::const_iterator const_iterator;
|
||||
|
||||
std::vector<menu_type*> owner;
|
||||
std::vector<menu_item_type> items;
|
||||
unsigned max_pixels;
|
||||
unsigned item_pixels;
|
||||
nana::point gaps;
|
||||
};
|
||||
|
||||
class renderer_interface
|
||||
{
|
||||
public:
|
||||
@@ -158,7 +142,7 @@ namespace nana
|
||||
void popup(window owner, int x, int y); ///< Popup the menu at the owner window.
|
||||
void popup_await(window owner, int x, int y);
|
||||
void answerer(std::size_t index, const event_fn_t&); ///< Modify answerer of the specified item.
|
||||
void destroy_answer(const std::function<void()>&); ///< Sets an answerer for the callback while the menu window is closing.
|
||||
void destroy_answer(std::function<void()>); ///< Sets an answerer for the callback while the menu window is closing.
|
||||
void gaps(const nana::point&); ///< Sets the gap between a menu and its sub menus.(\See Note4)
|
||||
void goto_next(bool forward); ///< Moves the focus to the next or previous item.
|
||||
bool goto_submen();///< Popup the submenu of the current item if it has a sub menu. Returns true if succeeds.
|
||||
@@ -177,7 +161,7 @@ namespace nana
|
||||
const pat::cloneable<renderer_interface>& renderer() const;
|
||||
|
||||
private:
|
||||
void _m_popup(window, int x, int y, bool called_by_menubar);
|
||||
void _m_popup(window, const point& position, bool called_by_menubar);
|
||||
private:
|
||||
implement * impl_;
|
||||
};
|
||||
|
||||
@@ -134,6 +134,7 @@ namespace nana{ namespace widgets
|
||||
std::size_t undo_max_steps() const;
|
||||
|
||||
renderers& customized_renderers();
|
||||
void clear_undo(); ///< same with undo_max_steps(0)
|
||||
|
||||
unsigned line_height() const;
|
||||
unsigned screen_lines() const;
|
||||
@@ -148,14 +149,15 @@ namespace nana{ namespace widgets
|
||||
* @param reset indicates whether to reset the text position by the pos. If this parameter is true, the text position is set by pos. If the parameter is false, it only moves the UI caret to the specified position.
|
||||
*/
|
||||
bool move_caret(const upoint& pos, bool reset = false);
|
||||
void move_caret_end();
|
||||
void move_caret_end(bool update);
|
||||
void reset_caret_pixels() const;
|
||||
void reset_caret();
|
||||
void show_caret(bool isshow);
|
||||
|
||||
bool selected() const;
|
||||
bool get_selected_points(nana::upoint&, nana::upoint&) const;
|
||||
|
||||
bool select(bool);
|
||||
bool get_select_points(nana::upoint&, nana::upoint&) const;
|
||||
|
||||
/// Sets the end position of a selected string.
|
||||
void set_end_caret();
|
||||
|
||||
@@ -162,6 +162,9 @@ namespace nana
|
||||
/// Read the text from a specified line. It returns true for success.
|
||||
bool getline(std::size_t pos, std::string&) const;
|
||||
|
||||
/// Read the text from a specified line with a set offset. It returns true for success.
|
||||
bool getline(std::size_t line_index,std::size_t offset,std::string& text) const;
|
||||
|
||||
/// Gets the caret position
|
||||
/// Returns true if the caret is in the area of display, false otherwise.
|
||||
bool caret_pos(point& pos, bool text_coordinate) const;
|
||||
@@ -196,6 +199,7 @@ namespace nana
|
||||
|
||||
/// Returns true if some text is selected.
|
||||
bool selected() const;
|
||||
bool get_selected_points(nana::upoint &a, nana::upoint &b) const;
|
||||
|
||||
/// Selects/unselects all text.
|
||||
void select(bool);
|
||||
@@ -215,6 +219,8 @@ namespace nana
|
||||
textbox& from(int);
|
||||
textbox& from(double);
|
||||
|
||||
void clear_undo();
|
||||
|
||||
void set_highlight(const std::string& name, const ::nana::color& fgcolor, const ::nana::color& bgcolor);
|
||||
void erase_highlight(const std::string& name);
|
||||
void set_keywords(const std::string& name, bool case_sensitive, bool whole_word_match, std::initializer_list<std::wstring> kw_list);
|
||||
|
||||
@@ -51,6 +51,8 @@ namespace nana
|
||||
bool italic() const;
|
||||
native_font_type handle() const;
|
||||
void release();
|
||||
bool strikeout() const;
|
||||
bool underline() const;
|
||||
|
||||
font& operator=(const font&);
|
||||
bool operator==(const font&) const;
|
||||
|
||||
@@ -54,11 +54,17 @@ namespace threads
|
||||
|
||||
struct task_signal;
|
||||
class impl;
|
||||
|
||||
pool(const pool&) = delete;
|
||||
pool& operator=(const pool&) = delete;
|
||||
public:
|
||||
pool(); ///< Creates a group of threads.
|
||||
pool(pool&&);
|
||||
pool(std::size_t thread_number); ///< Creates a number of threads specifed by thread_number.
|
||||
~pool(); ///< waits for the all running tasks till they are finished and skips all the queued tasks.
|
||||
|
||||
pool& operator=(pool&&);
|
||||
|
||||
template<typename Function>
|
||||
void push(const Function& f)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user