improve all widgets for bground effects
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* A Drawer Implementation
|
||||
* Nana C++ Library(http://www.nanapro.org)
|
||||
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
|
||||
* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -126,8 +126,7 @@ namespace nana
|
||||
void* draw(std::function<void(paint::graphics&)> &&, bool diehard);
|
||||
void erase(void* diehard);
|
||||
private:
|
||||
void _m_effect_bground(bool before);
|
||||
bool _m_lazy_decleared() const;
|
||||
void _m_effect_bground_subsequent();
|
||||
method_state& _m_mth_state(int pos);
|
||||
|
||||
template<typename Arg, typename Mfptr>
|
||||
@@ -140,8 +139,6 @@ namespace nana
|
||||
|
||||
if (realizer && (method_state::not_overrided != mth_state))
|
||||
{
|
||||
_m_effect_bground(true);
|
||||
|
||||
if (method_state::pending == mth_state)
|
||||
{
|
||||
(realizer->*mfptr)(graphics, arg);
|
||||
@@ -154,8 +151,7 @@ namespace nana
|
||||
else
|
||||
(realizer->*mfptr)(graphics, arg);
|
||||
|
||||
if (_m_lazy_decleared())
|
||||
_m_effect_bground(false);
|
||||
_m_effect_bground_subsequent();
|
||||
}
|
||||
}
|
||||
public:
|
||||
|
||||
@@ -54,6 +54,8 @@ namespace API
|
||||
effects::edge_nimbus effects_edge_nimbus(window);
|
||||
|
||||
void effects_bground(window, const effects::bground_factory_interface&, double fade_rate);
|
||||
void effects_bground(std::initializer_list<window> wdgs, const effects::bground_factory_interface&, double fade_rate);
|
||||
|
||||
bground_mode effects_bground_mode(window);
|
||||
void effects_bground_remove(window);
|
||||
|
||||
@@ -96,6 +98,9 @@ namespace API
|
||||
|
||||
void enable_space_click(window, bool enable);
|
||||
|
||||
bool copy_transparent_background(window, paint::graphics&);
|
||||
bool copy_transparent_background(window, const rectangle& src_r, paint::graphics&, const point& dst_pt);
|
||||
|
||||
/// Refreshs a widget surface
|
||||
/*
|
||||
* This function will copy the drawer surface into system window after the event process finished.
|
||||
@@ -195,6 +200,8 @@ namespace API
|
||||
bool is_destroying(window); ///< Determines whether a window is destroying
|
||||
void enable_dropfiles(window, bool);
|
||||
|
||||
bool is_transparent_background(window);
|
||||
|
||||
/// \brief Retrieves the native window of a Nana.GUI window.
|
||||
///
|
||||
/// The native window type is platform-dependent. Under Microsoft Windows, a conversion can be employed between
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* A Panel Implementation
|
||||
* Nana C++ Library(http://www.nanaro.org)
|
||||
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
|
||||
* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -57,7 +57,7 @@ namespace nana
|
||||
|
||||
bool transparent() const
|
||||
{
|
||||
return (bground_mode::basic == API::effects_bground_mode(*this));
|
||||
return API::is_transparent_background(*this);
|
||||
}
|
||||
|
||||
void transparent(bool tr)
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace nana{ namespace widgets
|
||||
void clear_undo(); ///< same with undo_max_steps(0)
|
||||
|
||||
unsigned line_height() const;
|
||||
unsigned screen_lines() const;
|
||||
unsigned screen_lines(bool completed_line = false) const;
|
||||
|
||||
bool getline(std::size_t pos, ::std::wstring&) const;
|
||||
void text(std::wstring, bool end_caret);
|
||||
@@ -153,7 +153,7 @@ namespace nana{ namespace widgets
|
||||
bool move_caret(const upoint& pos, bool reset = false);
|
||||
void move_caret_end(bool update);
|
||||
void reset_caret_pixels() const;
|
||||
void reset_caret();
|
||||
void reset_caret(bool stay_in_view = false);
|
||||
void show_caret(bool isshow);
|
||||
|
||||
bool selected() const;
|
||||
@@ -204,10 +204,12 @@ namespace nana{ namespace widgets
|
||||
bool focus_changed(const arg_focus&);
|
||||
bool mouse_enter(bool entering);
|
||||
bool mouse_move(bool left_button, const point& screen_pos);
|
||||
bool mouse_pressed(const arg_mouse& arg);
|
||||
void mouse_pressed(const arg_mouse& arg);
|
||||
|
||||
skeletons::textbase<char_type>& textbase();
|
||||
const skeletons::textbase<char_type>& textbase() const;
|
||||
|
||||
bool try_refresh();
|
||||
private:
|
||||
std::vector<upoint> _m_render_text(const ::nana::color& text_color);
|
||||
void _m_pre_calc_lines(std::size_t line_off, std::size_t lines);
|
||||
@@ -223,7 +225,7 @@ namespace nana{ namespace widgets
|
||||
bool _m_accepts(char_type) const;
|
||||
::nana::color _m_bgcolor() const;
|
||||
|
||||
void _m_reset_content_size();
|
||||
void _m_reset_content_size(bool calc_lines = false);
|
||||
void _m_reset();
|
||||
::nana::upoint _m_put(::std::wstring);
|
||||
::nana::upoint _m_erase_select();
|
||||
@@ -258,6 +260,7 @@ namespace nana{ namespace widgets
|
||||
unsigned _m_pixels_by_char(const ::std::wstring&, ::std::size_t pos) const;
|
||||
void _m_handle_move_key(const arg_keyboard& arg);
|
||||
|
||||
unsigned _m_width_px(bool exclude_vs) const;
|
||||
void _m_draw_border();
|
||||
private:
|
||||
struct implementation;
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace nana
|
||||
typedef compset_interface::comp_attribute_t comp_attribute_t;
|
||||
|
||||
virtual ~renderer_interface() = default;
|
||||
virtual void set_color(const nana::color& bgcolor, const nana::color& fgcolor) = 0;
|
||||
|
||||
virtual void begin_paint(::nana::widget&) = 0;
|
||||
virtual void bground(graph_reference, const compset_interface *) const = 0;
|
||||
virtual void expander(graph_reference, const compset_interface *) const = 0;
|
||||
virtual void crook(graph_reference, const compset_interface *) const = 0;
|
||||
|
||||
@@ -30,7 +30,8 @@ namespace detail
|
||||
nana::pixel_color_t fade_color_intermedia(pixel_color_t fgcolor, const unsigned char* fade_table);
|
||||
nana::pixel_color_t fade_color_by_intermedia(pixel_color_t bgcolor, nana::pixel_color_t fgcolor_intermedia, const unsigned char* const fade_table);
|
||||
|
||||
void blend(drawable_type dw, const nana::rectangle& r, pixel_color_t, double fade_rate);
|
||||
//dw color = dw color * fade_rate + bdcolor * (1 - fade_rate)
|
||||
void blend(drawable_type dw, const nana::rectangle& r, pixel_color_t bdcolor, double fade_rate);
|
||||
|
||||
nana::size raw_text_extent_size(drawable_type, const wchar_t*, std::size_t len);
|
||||
nana::size text_extent_size(drawable_type, const wchar_t*, std::size_t len);
|
||||
|
||||
Reference in New Issue
Block a user