Merge branch 'beru-develop' into develop
This commit is contained in:
commit
43eb4eebd4
@ -98,10 +98,10 @@ namespace nana
|
|||||||
void clear_filter();
|
void clear_filter();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _m_reset_overrided();
|
void _m_reset_overridden();
|
||||||
bool _m_overrided(event_code) const;
|
bool _m_overridden(event_code) const;
|
||||||
private:
|
private:
|
||||||
unsigned overrided_{ 0xFFFFFFFF };
|
unsigned overridden_{ 0xFFFFFFFF };
|
||||||
unsigned evt_disabled_{ 0 }; // bit set if event is filtered
|
unsigned evt_disabled_{ 0 }; // bit set if event is filtered
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -117,8 +117,8 @@ namespace nana
|
|||||||
enum class method_state
|
enum class method_state
|
||||||
{
|
{
|
||||||
pending,
|
pending,
|
||||||
overrided,
|
overridden,
|
||||||
not_overrided
|
not_overridden
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
drawer();
|
drawer();
|
||||||
@ -165,7 +165,7 @@ namespace nana
|
|||||||
auto realizer = this->realizer();
|
auto realizer = this->realizer();
|
||||||
auto & mth_state = _m_mth_state(pos);
|
auto & mth_state = _m_mth_state(pos);
|
||||||
|
|
||||||
if (realizer && (method_state::not_overrided != mth_state))
|
if (realizer && (method_state::not_overridden != mth_state))
|
||||||
{
|
{
|
||||||
const bool bFiltered = !bForce__EmitInternal && realizer->filter_event(evt_code);
|
const bool bFiltered = !bForce__EmitInternal && realizer->filter_event(evt_code);
|
||||||
if (method_state::pending == mth_state)
|
if (method_state::pending == mth_state)
|
||||||
@ -176,7 +176,7 @@ namespace nana
|
|||||||
//Check realizer, when the window is closed in that event handler, the drawer will be
|
//Check realizer, when the window is closed in that event handler, the drawer will be
|
||||||
//detached and realizer will be a nullptr
|
//detached and realizer will be a nullptr
|
||||||
if (realizer)
|
if (realizer)
|
||||||
mth_state = (realizer->_m_overrided(evt_code) ? method_state::overrided : method_state::not_overrided);
|
mth_state = (realizer->_m_overridden(evt_code) ? method_state::overridden : method_state::not_overridden);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,7 +28,7 @@ namespace nana
|
|||||||
mouse_wheel, ///< A mouse scrolls the wheel on a widget.
|
mouse_wheel, ///< A mouse scrolls the wheel on a widget.
|
||||||
mouse_drop, ///< A mouse release over a window that is registered as recipient of drag and drop.
|
mouse_drop, ///< A mouse release over a window that is registered as recipient of drag and drop.
|
||||||
expose, ///<
|
expose, ///<
|
||||||
resizing, ///< A widget's size is sizing. In this event, A widget's size can be overrided with a new size.
|
resizing, ///< A widget's size is sizing. In this event, A widget's size can be overridden with a new size.
|
||||||
resized, ///< A widget's size is changing.
|
resized, ///< A widget's size is changing.
|
||||||
move, ///<
|
move, ///<
|
||||||
unload, ///< A form is closed by clicking the X button, only works for root widget.
|
unload, ///< A form is closed by clicking the X button, only works for root widget.
|
||||||
|
|||||||
@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
namespace nana
|
namespace nana
|
||||||
{
|
{
|
||||||
//overlap test if overlaped between r1 and r2
|
//overlap test if overlapped between r1 and r2
|
||||||
bool overlapped(const rectangle& r1, const rectangle& r2);
|
bool overlapped(const rectangle& r1, const rectangle& r2);
|
||||||
|
|
||||||
// overlap, compute the overlap area between r1 and r2. the r is for root
|
// overlap, compute the overlapping area between r1 and r2. the r is for root
|
||||||
bool overlap(const rectangle& r1, const rectangle& r2, rectangle& r);
|
bool overlap(const rectangle& r1, const rectangle& r2, rectangle& r);
|
||||||
|
|
||||||
bool overlap(const rectangle& ir, const size& valid_input_area, const rectangle & dr, const size& valid_dst_area, rectangle& output_src_r, rectangle& output_dst_r);
|
bool overlap(const rectangle& ir, const size& valid_input_area, const rectangle & dr, const size& valid_dst_area, rectangle& output_src_r, rectangle& output_dst_r);
|
||||||
@ -37,7 +37,7 @@ namespace nana
|
|||||||
|
|
||||||
//covered
|
//covered
|
||||||
//@brief: Tests a rectangle whether it is wholly covered by another.
|
//@brief: Tests a rectangle whether it is wholly covered by another.
|
||||||
bool covered(const rectangle& underlying, //Rectangle 1 is must under rectangle 2
|
bool covered(const rectangle& underlying, // 1st rectangle must be placed under 2nd rectangle
|
||||||
const rectangle& cover);
|
const rectangle& cover);
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -21,7 +21,7 @@ namespace nana
|
|||||||
//Forward declaration of filebox for msgbox
|
//Forward declaration of filebox for msgbox
|
||||||
class filebox;
|
class filebox;
|
||||||
|
|
||||||
/// Prefabricated modal dialog box (with text, icon and actions buttons) that inform and instruct the user.
|
/// Prefabricated modal dialog box (with text, icon and actions buttons) that informs and instructs the user.
|
||||||
class msgbox
|
class msgbox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -34,19 +34,19 @@ namespace nana
|
|||||||
/// Identifiers of buttons that a user clicked.
|
/// Identifiers of buttons that a user clicked.
|
||||||
enum pick_t{pick_ok, pick_yes, pick_no, pick_cancel};
|
enum pick_t{pick_ok, pick_yes, pick_no, pick_cancel};
|
||||||
|
|
||||||
/// Default construct that creates a message box with default title and default button, the default button is OK.
|
/// Default constructor that creates a message box with default title and default button, the default button is OK.
|
||||||
msgbox();
|
msgbox();
|
||||||
|
|
||||||
/// Copy construct from an existing msgbox object.
|
/// Copy constructor from an existing msgbox object.
|
||||||
msgbox(const msgbox&);
|
msgbox(const msgbox&);
|
||||||
|
|
||||||
/// Assign from an existing msgbox object.
|
/// Assign from an existing msgbox object.
|
||||||
msgbox& operator=(const msgbox&);
|
msgbox& operator=(const msgbox&);
|
||||||
|
|
||||||
/// Construct that creates a message box with a specified title and default button.
|
/// Constructor that creates a message box with a specified title and default button.
|
||||||
msgbox(const ::std::string&);
|
msgbox(const ::std::string&);
|
||||||
|
|
||||||
/// Construct that creates a message box with an owner windoow, a specified title and buttons.
|
/// Constructor that creates a message box with an owner windoow, a specified title and buttons.
|
||||||
msgbox(window, const ::std::string&, button_t = ok);
|
msgbox(window, const ::std::string&, button_t = ok);
|
||||||
|
|
||||||
/// Sets an icon for informing user.
|
/// Sets an icon for informing user.
|
||||||
|
|||||||
@ -186,7 +186,7 @@ namespace API
|
|||||||
void exit(); ///< close all windows in current thread
|
void exit(); ///< close all windows in current thread
|
||||||
void exit_all(); ///< close all windows
|
void exit_all(); ///< close all windows
|
||||||
|
|
||||||
/// @brief Searchs whether the text contains a '&' and removes the character for transforming.
|
/// @brief Searches whether the text contains a '&' and removes the character for transforming.
|
||||||
/// If the text contains more than one '&' charachers, the others are ignored. e.g
|
/// If the text contains more than one '&' charachers, the others are ignored. e.g
|
||||||
/// text = "&&a&bcd&ef", the result should be "&abcdef", shortkey = 'b', and pos = 2.
|
/// text = "&&a&bcd&ef", the result should be "&abcdef", shortkey = 'b', and pos = 2.
|
||||||
std::string transform_shortkey_text
|
std::string transform_shortkey_text
|
||||||
@ -344,11 +344,11 @@ namespace API
|
|||||||
|
|
||||||
/// Refresh the window and display it immediately calling the refresh function of its drawer_trigger.
|
/// Refresh the window and display it immediately calling the refresh function of its drawer_trigger.
|
||||||
/*
|
/*
|
||||||
* The drawer::refresh() will be called. If the currently state is lazy_refrsh, the window is delayed to update the graphics until an event is finished.
|
* The drawer::refresh() will be called. If the current state is lazy_refrsh, the window is delayed to update the graphics until an event is finished.
|
||||||
* @param window_handle A handle to the window to be refreshed.
|
* @param window_handle A handle to the window to be refreshed.
|
||||||
*/
|
*/
|
||||||
void refresh_window(window window_handle);
|
void refresh_window(window window_handle);
|
||||||
void refresh_window_tree(window); ///< Refreshes the specified window and all its children windows, then display it immediately
|
void refresh_window_tree(window); ///< Refreshes the specified window and all its children windows, then displays it immediately
|
||||||
void update_window(window); ///< Copies the off-screen buffer to the screen for immediate display.
|
void update_window(window); ///< Copies the off-screen buffer to the screen for immediate display.
|
||||||
|
|
||||||
void window_caption(window, const std::string& title_utf8);
|
void window_caption(window, const std::string& title_utf8);
|
||||||
@ -418,8 +418,8 @@ namespace API
|
|||||||
/// Enables or disables a window to receive a key_char event for pressing TAB key.
|
/// Enables or disables a window to receive a key_char event for pressing TAB key.
|
||||||
/*
|
/*
|
||||||
* @param window_handle A handle to the window to catch TAB key through key_char event.
|
* @param window_handle A handle to the window to catch TAB key through key_char event.
|
||||||
* @param enable Indicates whether to enable or disable catch of TAB key. If this parameter is *true*, the window is
|
* @param enable Indicates whether to enable or disable catch of TAB key. If this parameter is *true*, the window
|
||||||
* received a key_char when pressing TAB key, and the input focus is not changed. If this parameter is *false*, the
|
* receives a key_char event when pressing TAB key, and the input focus is not changed. If this parameter is *false*, the
|
||||||
* input focus is changed to the next tabstop window.
|
* input focus is changed to the next tabstop window.
|
||||||
*/
|
*/
|
||||||
void eat_tabstop(window window_handle, bool enable);
|
void eat_tabstop(window window_handle, bool enable);
|
||||||
|
|||||||
@ -76,7 +76,7 @@ namespace nana
|
|||||||
|
|
||||||
bool chose() const;
|
bool chose() const;
|
||||||
nana::date read() const;
|
nana::date read() const;
|
||||||
void weekstr(unsigned index, ::std::string);///<Set the week strings which will be displayed for day, index is in range of [0, 6]
|
void weekstr(unsigned index, ::std::string);///<Set the week strings which will be displayed for day, index is in the range of [0, 6]
|
||||||
};
|
};
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
#include <nana/pop_ignore_diagnostic>
|
#include <nana/pop_ignore_diagnostic>
|
||||||
|
|||||||
@ -51,7 +51,7 @@ namespace nana
|
|||||||
}//end namespace form
|
}//end namespace form
|
||||||
}//end namespace drawerbase
|
}//end namespace drawerbase
|
||||||
|
|
||||||
/// \brief Pop-up window. Is different from other window widgets: its default constructor create the window.
|
/// \brief Pop-up window. Is different from other window widgets: its default constructor creates the window.
|
||||||
/// \see nana::appearance
|
/// \see nana::appearance
|
||||||
class form
|
class form
|
||||||
: public drawerbase::form::form_base
|
: public drawerbase::form::form_base
|
||||||
|
|||||||
@ -55,12 +55,12 @@ namespace nana{
|
|||||||
/// The construction that creates the widget
|
/// The construction that creates the widget
|
||||||
group(window parent, const rectangle& = {}, bool visible = true);
|
group(window parent, const rectangle& = {}, bool visible = true);
|
||||||
|
|
||||||
/// The construction that creates the widget and set the titel or caption
|
/// The construction that creates the widget and set the title or caption
|
||||||
|
|
||||||
group(window parent, ///< a handle to the parent
|
group(window parent, ///< a handle to the parent
|
||||||
::std::string titel, ///< caption of the group
|
::std::string title, ///< caption of the group
|
||||||
bool formatted = false, ///< Enable/disable the formatted text for the title
|
bool formatted = false, ///< Enable/disable the formatted text for the title
|
||||||
unsigned gap = 2, ///< betwen the content and the external limit
|
unsigned gap = 2, ///< between the content and the external limit
|
||||||
const rectangle& r = {} ,
|
const rectangle& r = {} ,
|
||||||
bool visible = true
|
bool visible = true
|
||||||
);
|
);
|
||||||
|
|||||||
@ -79,7 +79,7 @@ namespace nana
|
|||||||
|
|
||||||
/// Deselects the menu
|
/// Deselects the menu
|
||||||
/**
|
/**
|
||||||
* If a menu is popped up, the menu deselects the item and close the popuped menu.
|
* If a menu is popped up, the menu deselects the item and close the pop-upped menu.
|
||||||
* @return true if an item is deselected, false otherwise.
|
* @return true if an item is deselected, false otherwise.
|
||||||
*/
|
*/
|
||||||
bool cancel();
|
bool cancel();
|
||||||
|
|||||||
@ -34,7 +34,7 @@ namespace nana
|
|||||||
};
|
};
|
||||||
}// end namespace panel
|
}// end namespace panel
|
||||||
}//end namespace drawerbase
|
}//end namespace drawerbase
|
||||||
/// For placing other widgets, where the bool template parameter determinte if it is widget or lite_widget, wich in actual use make no difference.
|
/// For placing other widgets, where the bool template parameter determinte if it is widget or lite_widget, which in actual use makes no difference.
|
||||||
template<bool HasBackground>
|
template<bool HasBackground>
|
||||||
class panel
|
class panel
|
||||||
: public widget_object<typename std::conditional<HasBackground, category::widget_tag, category::lite_widget_tag>::type,
|
: public widget_object<typename std::conditional<HasBackground, category::widget_tag, category::lite_widget_tag>::type,
|
||||||
|
|||||||
@ -59,10 +59,10 @@ namespace nana
|
|||||||
/// Enables the image to be stretched to the widget size.
|
/// Enables the image to be stretched to the widget size.
|
||||||
void stretchable(unsigned left, unsigned top, unsigned right, unsigned bottom);
|
void stretchable(unsigned left, unsigned top, unsigned right, unsigned bottom);
|
||||||
|
|
||||||
/// Enables/disable the image to be stretched without changing aspect ratio.
|
/// Enables/disables the image to be stretched without changing aspect ratio.
|
||||||
void stretchable(bool);
|
void stretchable(bool);
|
||||||
|
|
||||||
/// Fills a gradual-change color in background. If One of colors is invisible or clr_from is equal to clr_to, it draws background in bgcolor.
|
/// Fills a gradual-change color in background. If one of colors is invisible or clr_from is equal to clr_to, it draws background in bgcolor.
|
||||||
void set_gradual_background(const color& clr_from, const color& clr_to, bool horizontal);
|
void set_gradual_background(const color& clr_from, const color& clr_to, bool horizontal);
|
||||||
void transparent(bool);
|
void transparent(bool);
|
||||||
bool transparent() const;
|
bool transparent() const;
|
||||||
|
|||||||
@ -51,14 +51,14 @@ namespace nana
|
|||||||
using size_type = std::size_t;
|
using size_type = std::size_t;
|
||||||
|
|
||||||
size_type peak; ///< the whole total
|
size_type peak; ///< the whole total
|
||||||
size_type range; ///< how many is shonw on a page, that is, How many to scroll after click on first or second
|
size_type range; ///< how many is shown on a page, that is, How many to scroll after click on first or second
|
||||||
size_type step; ///< how many to scroll by click in forward or backward
|
size_type step; ///< how many to scroll by click in forward or backward
|
||||||
size_type value; ///< current offset calculated from the very beginnig
|
size_type value; ///< current offset calculated from the very beginnig
|
||||||
|
|
||||||
buttons what;
|
buttons what;
|
||||||
bool pressed;
|
bool pressed;
|
||||||
size_type scroll_length; ///< the lenght in pixels of the central button show how many of the total (peak) is shonw (range)
|
size_type scroll_length; ///< the length in pixels of the central button show how many of the total (peak) is shown (range)
|
||||||
int scroll_pos; ///< in pixels, and correspond to the offsset from the very beginning (value)
|
int scroll_pos; ///< in pixels, and correspond to the offset from the very beginning (value)
|
||||||
int scroll_mouse_offset;
|
int scroll_mouse_offset;
|
||||||
|
|
||||||
metrics_type();
|
metrics_type();
|
||||||
@ -348,7 +348,7 @@ namespace nana
|
|||||||
|
|
||||||
virtual void amount(size_type peak) = 0;
|
virtual void amount(size_type peak) = 0;
|
||||||
|
|
||||||
/// Get the range of the widget (how many is shonw on a page, that is, How many to scroll after click on first or second)
|
/// Get the range of the widget (how many is shown on a page, that is, How many to scroll after click on first or second)
|
||||||
virtual size_type range() const = 0;
|
virtual size_type range() const = 0;
|
||||||
|
|
||||||
/// Set the range of the widget.
|
/// Set the range of the widget.
|
||||||
@ -426,7 +426,7 @@ namespace nana
|
|||||||
return this->get_drawer_trigger().peak(peak);
|
return this->get_drawer_trigger().peak(peak);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the range of the widget (how many is shonw on a page, that is, How many to scroll after click on first or second)
|
/// Get the range of the widget (how many is shown on a page, that is, How many to scroll after click on first or second)
|
||||||
size_type range() const override
|
size_type range() const override
|
||||||
{
|
{
|
||||||
return this->get_drawer_trigger().metrics().range;
|
return this->get_drawer_trigger().metrics().range;
|
||||||
|
|||||||
@ -86,7 +86,7 @@ namespace nana
|
|||||||
spinbox(window, const nana::rectangle& = {}, bool visible = true);
|
spinbox(window, const nana::rectangle& = {}, bool visible = true);
|
||||||
|
|
||||||
/// Sets the widget whether it accepts user keyboard input.
|
/// Sets the widget whether it accepts user keyboard input.
|
||||||
/// @param accept Set to indicate whether it accepts uesr keyboard input.
|
/// @param accept Set to indicate whether it accepts user keyboard input.
|
||||||
void editable(bool accept);
|
void editable(bool accept);
|
||||||
|
|
||||||
/// Determines whether the widget accepts user keyboard input.
|
/// Determines whether the widget accepts user keyboard input.
|
||||||
@ -106,7 +106,7 @@ namespace nana
|
|||||||
/// Selects/unselects the text
|
/// Selects/unselects the text
|
||||||
void select(bool);
|
void select(bool);
|
||||||
|
|
||||||
/// Gets the spined value
|
/// Gets the spinned value
|
||||||
::std::string value() const;
|
::std::string value() const;
|
||||||
void value(const ::std::string&);
|
void value(const ::std::string&);
|
||||||
int to_int() const;
|
int to_int() const;
|
||||||
|
|||||||
@ -33,99 +33,99 @@ namespace nana
|
|||||||
|
|
||||||
void drawer_trigger::resizing(graph_reference, const arg_resizing&)
|
void drawer_trigger::resizing(graph_reference, const arg_resizing&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::resizing));
|
overridden_ &= ~(1 << static_cast<int>(event_code::resizing));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::resized(graph_reference graph, const arg_resized&)
|
void drawer_trigger::resized(graph_reference graph, const arg_resized&)
|
||||||
{
|
{
|
||||||
overrided_ |= (1 << static_cast<int>(event_code::resized));
|
overridden_ |= (1 << static_cast<int>(event_code::resized));
|
||||||
this->refresh(graph);
|
this->refresh(graph);
|
||||||
detail::bedrock::instance().thread_context_lazy_refresh();
|
detail::bedrock::instance().thread_context_lazy_refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::move(graph_reference, const arg_move&)
|
void drawer_trigger::move(graph_reference, const arg_move&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::move));
|
overridden_ &= ~(1 << static_cast<int>(event_code::move));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::click(graph_reference, const arg_click&)
|
void drawer_trigger::click(graph_reference, const arg_click&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::click));
|
overridden_ &= ~(1 << static_cast<int>(event_code::click));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::dbl_click(graph_reference, const arg_mouse&)
|
void drawer_trigger::dbl_click(graph_reference, const arg_mouse&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::dbl_click));
|
overridden_ &= ~(1 << static_cast<int>(event_code::dbl_click));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::mouse_enter(graph_reference, const arg_mouse&)
|
void drawer_trigger::mouse_enter(graph_reference, const arg_mouse&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::mouse_enter));
|
overridden_ &= ~(1 << static_cast<int>(event_code::mouse_enter));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::mouse_move(graph_reference, const arg_mouse&)
|
void drawer_trigger::mouse_move(graph_reference, const arg_mouse&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::mouse_move));
|
overridden_ &= ~(1 << static_cast<int>(event_code::mouse_move));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::mouse_leave(graph_reference, const arg_mouse&)
|
void drawer_trigger::mouse_leave(graph_reference, const arg_mouse&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::mouse_leave));
|
overridden_ &= ~(1 << static_cast<int>(event_code::mouse_leave));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::mouse_down(graph_reference, const arg_mouse&)
|
void drawer_trigger::mouse_down(graph_reference, const arg_mouse&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::mouse_down));
|
overridden_ &= ~(1 << static_cast<int>(event_code::mouse_down));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::mouse_up(graph_reference, const arg_mouse&)
|
void drawer_trigger::mouse_up(graph_reference, const arg_mouse&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::mouse_up));
|
overridden_ &= ~(1 << static_cast<int>(event_code::mouse_up));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::mouse_wheel(graph_reference, const arg_wheel&)
|
void drawer_trigger::mouse_wheel(graph_reference, const arg_wheel&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::mouse_wheel));
|
overridden_ &= ~(1 << static_cast<int>(event_code::mouse_wheel));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::mouse_dropfiles(graph_reference, const arg_dropfiles&)
|
void drawer_trigger::mouse_dropfiles(graph_reference, const arg_dropfiles&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::mouse_drop));
|
overridden_ &= ~(1 << static_cast<int>(event_code::mouse_drop));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::focus(graph_reference, const arg_focus&)
|
void drawer_trigger::focus(graph_reference, const arg_focus&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::focus));
|
overridden_ &= ~(1 << static_cast<int>(event_code::focus));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::key_press(graph_reference, const arg_keyboard&)
|
void drawer_trigger::key_press(graph_reference, const arg_keyboard&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::key_press));
|
overridden_ &= ~(1 << static_cast<int>(event_code::key_press));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::key_char(graph_reference, const arg_keyboard&)
|
void drawer_trigger::key_char(graph_reference, const arg_keyboard&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::key_char));
|
overridden_ &= ~(1 << static_cast<int>(event_code::key_char));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::key_release(graph_reference, const arg_keyboard&)
|
void drawer_trigger::key_release(graph_reference, const arg_keyboard&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::key_release));
|
overridden_ &= ~(1 << static_cast<int>(event_code::key_release));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::shortkey(graph_reference, const arg_keyboard&)
|
void drawer_trigger::shortkey(graph_reference, const arg_keyboard&)
|
||||||
{
|
{
|
||||||
overrided_ &= ~(1 << static_cast<int>(event_code::shortkey));
|
overridden_ &= ~(1 << static_cast<int>(event_code::shortkey));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::_m_reset_overrided()
|
void drawer_trigger::_m_reset_overridden()
|
||||||
{
|
{
|
||||||
overrided_ = 0xFFFFFFFF;
|
overridden_ = 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool drawer_trigger::_m_overrided(event_code evt_code) const
|
bool drawer_trigger::_m_overridden(event_code evt_code) const
|
||||||
{
|
{
|
||||||
return 0 != (overrided_ & (1 << static_cast<int>(evt_code)));
|
return 0 != (overridden_ & (1 << static_cast<int>(evt_code)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawer_trigger::filter_event(const event_code evt_code, const bool bDisabled)
|
void drawer_trigger::filter_event(const event_code evt_code, const bool bDisabled)
|
||||||
@ -396,7 +396,7 @@ namespace nana
|
|||||||
*i = method_state::pending;
|
*i = method_state::pending;
|
||||||
|
|
||||||
data_impl_->realizer = &realizer;
|
data_impl_->realizer = &realizer;
|
||||||
realizer._m_reset_overrided();
|
realizer._m_reset_overridden();
|
||||||
realizer.attached(wd, graphics);
|
realizer.attached(wd, graphics);
|
||||||
realizer.typeface_changed(graphics);
|
realizer.typeface_changed(graphics);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace nana
|
namespace nana
|
||||||
{
|
{
|
||||||
//overlap test if overlaped between r1 and r2
|
//overlap test if overlapped between r1 and r2
|
||||||
bool overlapped(const rectangle& r1, const rectangle& r2)
|
bool overlapped(const rectangle& r1, const rectangle& r2)
|
||||||
{
|
{
|
||||||
if (r1.y + (long long)(r1.height) <= r2.y) return false;
|
if (r1.y + (long long)(r1.height) <= r2.y) return false;
|
||||||
|
|||||||
@ -49,8 +49,8 @@ static const char* field_options = "__nana_group_options__";
|
|||||||
|
|
||||||
implement() = default;
|
implement() = default;
|
||||||
|
|
||||||
implement(window grp_panel, ::std::string titel, bool vsb, unsigned gap=2)
|
implement(window grp_panel, ::std::string title, bool vsb, unsigned gap=2)
|
||||||
: caption (grp_panel, std::move(titel), vsb),
|
: caption (grp_panel, std::move(title), vsb),
|
||||||
place_content{grp_panel},
|
place_content{grp_panel},
|
||||||
gap{gap}
|
gap{gap}
|
||||||
{
|
{
|
||||||
@ -118,12 +118,12 @@ group::group(window parent, const rectangle& r, bool vsb)
|
|||||||
|
|
||||||
using groupbase_type = widget_object<category::widget_tag, drawerbase::panel::drawer, general_events, drawerbase::group::scheme>;
|
using groupbase_type = widget_object<category::widget_tag, drawerbase::panel::drawer, general_events, drawerbase::group::scheme>;
|
||||||
|
|
||||||
group::group(window parent, ::std::string titel, bool formatted, unsigned gap, const rectangle& r, bool vsb)
|
group::group(window parent, ::std::string title, bool formatted, unsigned gap, const rectangle& r, bool vsb)
|
||||||
: group(parent, r, vsb)
|
: group(parent, r, vsb)
|
||||||
{
|
{
|
||||||
this->bgcolor(API::bgcolor(parent));
|
this->bgcolor(API::bgcolor(parent));
|
||||||
|
|
||||||
impl_.reset(new implement(*this, std::move(titel), vsb, gap));
|
impl_.reset(new implement(*this, std::move(title), vsb, gap));
|
||||||
|
|
||||||
impl_->caption.format(formatted);
|
impl_->caption.format(formatted);
|
||||||
_m_init();
|
_m_init();
|
||||||
|
|||||||
@ -285,7 +285,7 @@ namespace paint
|
|||||||
const void* graphics::pixmap() const
|
const void* graphics::pixmap() const
|
||||||
{
|
{
|
||||||
//The reinterpret_cast is used for same platform. Under Windows, the type
|
//The reinterpret_cast is used for same platform. Under Windows, the type
|
||||||
//of pixmap can be conversed into void* directly, but under X11, the type is not a pointer.
|
//of pixmap can be converted into void* directly, but under X11, the type is not a pointer.
|
||||||
return (impl_->handle ? reinterpret_cast<void*>(impl_->handle->pixmap) : nullptr);
|
return (impl_->handle ? reinterpret_cast<void*>(impl_->handle->pixmap) : nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +310,7 @@ namespace paint
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//The object will be delete while dwptr_ is performing a release.
|
//The object will be deleted while dwptr_ is performing a release.
|
||||||
std::shared_ptr<nana::detail::drawable_impl_type> dw{ new nana::detail::drawable_impl_type, detail::drawable_deleter{} };
|
std::shared_ptr<nana::detail::drawable_impl_type> dw{ new nana::detail::drawable_impl_type, detail::drawable_deleter{} };
|
||||||
|
|
||||||
//Reuse the old font
|
//Reuse the old font
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user