fix typos

This commit is contained in:
beru 2019-04-14 14:49:01 +09:00
parent 18c11541a7
commit a596c7f64e
62 changed files with 183 additions and 183 deletions

View File

@ -61,7 +61,7 @@ namespace nana
return new holder(value); return new holder(value);
} }
public: public:
Value value; //representation accessable for friend of any Value value; //representation accessible for friend of any
}; };
public: public:
//constructors and destructor //constructors and destructor

View File

@ -74,7 +74,7 @@ namespace nana
namespace detail namespace detail
{ {
struct drawable_impl_type; //declearation, defined in platform_spec.hpp struct drawable_impl_type; //declaration, defined in platform_spec.hpp
} }
namespace paint namespace paint
@ -275,7 +275,7 @@ namespace nana
yellow = 0xFFFF00, yellow = 0xFFFF00,
yellow_green = 0x9acd32, yellow_green = 0x9acd32,
//temporary defintions, these will be replaced by color schema //temporary definitions, these will be replaced by color schema
button_face_shadow_start = 0xF5F4F2, button_face_shadow_start = 0xF5F4F2,
button_face_shadow_end = 0xD5D2CA, button_face_shadow_end = 0xD5D2CA,
button_face = 0xD4D0C8 , //,light_cyan button_face = 0xD4D0C8 , //,light_cyan
@ -425,7 +425,7 @@ namespace nana
size(value_type width, value_type height); size(value_type width, value_type height);
bool empty() const; ///< true if width * height == 0 bool empty() const; ///< true if width * height == 0
bool is_hit(const point&) const; ///< Assume it is a rectangle at (0,0), and check whether a specified position is in the rectange. bool is_hit(const point&) const; ///< Assume it is a rectangle at (0,0), and check whether a specified position is in the rectangle.
size& shift(); size& shift();
bool operator==(const size& rhs) const; bool operator==(const size& rhs) const;

View File

@ -164,7 +164,7 @@
#if defined(NANA_MINGW) #if defined(NANA_MINGW)
#ifndef __MINGW64_VERSION_MAJOR #ifndef __MINGW64_VERSION_MAJOR
//It's a knonwn issue under MinGW(except MinGW-W64) //It's a known issue under MinGW(except MinGW-W64)
#define STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED #define STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED
#endif #endif
#endif #endif

View File

@ -18,7 +18,7 @@ namespace nana
{ {
namespace utf namespace utf
{ {
/// Attempt to get a pointer to a character of UTF-8 string by a specifed character index. /// Attempt to get a pointer to a character of UTF-8 string by a specified character index.
/// @param text_utf8 A string encoded as UTF-8. /// @param text_utf8 A string encoded as UTF-8.
/// @param pos The unicode character index. /// @param pos The unicode character index.
/// @returns A pointer to the unicode character. It returns a null if pos is out of range. /// @returns A pointer to the unicode character. It returns a null if pos is out of range.

View File

@ -54,7 +54,7 @@
// //
//#define BOOST_FILESYSTEM_AVAILABLE // "Is Boost filesystem available?" //#define BOOST_FILESYSTEM_AVAILABLE // "Is Boost filesystem available?"
//#define BOOST_FILESYSTEM_FORCE // "Force use of Boost filesystem if available (over ISO and nana) //#define BOOST_FILESYSTEM_FORCE // "Force use of Boost filesystem if available (over ISO and nana)
//#define STD_FILESYSTEM_FORCE // "Use of STD filesystem?(a compilation error will ocurre if not available)" OFF) //#define STD_FILESYSTEM_FORCE // "Use of STD filesystem?(a compilation error will occur if not available)" OFF)
//#define NANA_FILESYSTEM_FORCE // "Force nana filesystem over ISO and boost?" OFF) //#define NANA_FILESYSTEM_FORCE // "Force nana filesystem over ISO and boost?" OFF)
// //
// Make sure you (cmake?) provide the following where correspond (please find the correct values): // Make sure you (cmake?) provide the following where correspond (please find the correct values):

View File

@ -9,7 +9,7 @@
* *
* @file: nana/deploy.hpp * @file: nana/deploy.hpp
* *
* What follow are dependented on what defined in nana/config.hpp * What follows is dependent on what defined in nana/config.hpp
*/ */
#ifndef NANA_DEPLOY_HPP #ifndef NANA_DEPLOY_HPP

View File

@ -34,7 +34,7 @@ namespace nana
public: public:
frameset(); frameset();
void push_back(paint::image); ///< Inserts frames at the end. void push_back(paint::image); ///< Inserts frames at the end.
void push_back(framebuilder fb, std::size_t length); ///< Insters a framebuilder and the number of frames that it generates. void push_back(framebuilder fb, std::size_t length); ///< Inserts a framebuilder and the number of frames that it generates.
private: private:
std::shared_ptr<impl> impl_; std::shared_ptr<impl> impl_;
}; };

View File

@ -183,7 +183,7 @@ namespace nana
A window has an appearance. This appearance can be specified when a window is being created. A window has an appearance. This appearance can be specified when a window is being created.
To determine the appearance of a window there is a structure named nana::appearance with To determine the appearance of a window there is a structure named nana::appearance with
a bool member for each feature with can be included or excluded in the "apereance" of the windows form. a bool member for each feature with can be included or excluded in the "appearance" of the windows form.
But in practical development is hard to describe the style of the appearance using the struct nana::appearance. But in practical development is hard to describe the style of the appearance using the struct nana::appearance.
If a form would to be defined without min/max button and sizable border, then If a form would to be defined without min/max button and sizable border, then
@ -282,7 +282,7 @@ that return a corresponding nana::appearance with predefined values.
set_type::template count<sizable>::value); set_type::template count<sizable>::value);
} }
}; };
};//end namespace apper };//end namespace appear
/// Interface for caret operations /// Interface for caret operations
class caret_interface class caret_interface

View File

@ -17,7 +17,7 @@
#include "../traits.hpp" #include "../traits.hpp"
namespace nana namespace nana
{ {
/// \brief Draw pictures on a widget by specifying a drawing method that will be employed everytime the widget refreshes. /// \brief Draw pictures on a widget by specifying a drawing method that will be employed every time the widget refreshes.
/// By the end of drawing, the picture may not be displayed immediately. /// By the end of drawing, the picture may not be displayed immediately.
/// If a picture need to be displayed immediately call nana::gui::API::refresh_window() . /// If a picture need to be displayed immediately call nana::gui::API::refresh_window() .
class drawing class drawing

View File

@ -46,7 +46,7 @@ namespace nana
/// Constructor 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&);
/// Constructor that creates a message box with an owner windoow, a specified title and buttons. /// Constructor that creates a message box with an owner window, 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.
@ -73,7 +73,7 @@ namespace nana
// Calls a manipulator to the stream. // Calls a manipulator to the stream.
msgbox & operator<<(std::ostream& (*)(std::ostream&)); msgbox & operator<<(std::ostream& (*)(std::ostream&));
/// Write a streamizable object to the buffer. /// Write a streamable object to the buffer.
template<typename T> template<typename T>
msgbox & operator<<(const T& t) msgbox & operator<<(const T& t)
{ {

View File

@ -73,7 +73,7 @@ namespace nana
std::function<void(Widget&)> init_; std::function<void(Widget&)> init_;
}; };
/// Layout managment - an object of class place is attached to a widget, and it automatically positions and resizes the children widgets. /// Layout management - an object of class place is attached to a widget, and it automatically positions and resizes the children widgets.
class place class place
: ::nana::noncopyable : ::nana::noncopyable
{ {

View File

@ -108,7 +108,7 @@ namespace API
bool copy_transparent_background(window, paint::graphics&); bool copy_transparent_background(window, paint::graphics&);
bool copy_transparent_background(window, const rectangle& src_r, paint::graphics&, const point& dst_pt); bool copy_transparent_background(window, const rectangle& src_r, paint::graphics&, const point& dst_pt);
/// Refreshs a widget surface /// Refreshes a widget surface
/* /*
* This function will copy the drawer surface into system window after the event process finished. * This function will copy the drawer surface into system window after the event process finished.
*/ */
@ -187,12 +187,12 @@ namespace API
void exit_all(); ///< close all windows void exit_all(); ///< close all windows
/// @brief Searches 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 '&' characters, 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
( std::string text, ///< the text is transformed ( std::string text, ///< the text is transformed
wchar_t &shortkey, ///< the character which indicates a short key. wchar_t &shortkey, ///< the character which indicates a short key.
std::string::size_type *skpos ///< retrives the shortkey position if it is not a null_ptr; std::string::size_type *skpos ///< retrieves the shortkey position if it is not a null_ptr;
); );
bool register_shortkey(window, unsigned long); bool register_shortkey(window, unsigned long);
void unregister_shortkey(window); void unregister_shortkey(window);
@ -432,7 +432,7 @@ namespace API
*/ */
window move_tabstop(window window_handle, bool forward); window move_tabstop(window window_handle, bool forward);
/// Sets the window active state. If a window active state is false, the window will not obtain the focus when a mouse clicks on it wich will be obteined by take_if_has_active_false. /// Sets the window active state. If a window active state is false, the window will not obtain the focus when a mouse clicks on it which will be obtained by take_if_has_active_false.
void take_active(window, bool has_active, window take_if_has_active_false); void take_active(window, bool has_active, window take_if_has_active_false);
/// Copies the graphics of a specified to a new graphics object. /// Copies the graphics of a specified to a new graphics object.

View File

@ -9,7 +9,7 @@
* @file: nana/gui/timer.hpp * @file: nana/gui/timer.hpp
* @description: * @description:
* A timer can repeatedly call a piece of code. The duration between * A timer can repeatedly call a piece of code. The duration between
* calls is specified in milliseconds. Timer is defferent from other graphics * calls is specified in milliseconds. Timer is different from other graphics
* controls, it has no graphics interface. * controls, it has no graphics interface.
*/ */

View File

@ -115,7 +115,7 @@ namespace nana
bool clear(); bool clear();
//splitstr //splitstr
//@brief: Sets the splitstr. If the parameter will be ingored if it is an empty string. //@brief: Sets the splitstr. If the parameter will be ignored if it is an empty string.
void splitstr(const ::std::string&); void splitstr(const ::std::string&);
const ::std::string& splitstr() const; const ::std::string& splitstr() const;

View File

@ -91,7 +91,7 @@ namespace nana
* @param window A handle to a window which is a owner of float_listbox * @param window A handle to a window which is a owner of float_listbox
* @param rectangle A position and a size of float_listbox * @param rectangle A position and a size of float_listbox
* @param is_ignore_first_mouse_up The flost_listbox will be closed when a mouse_up is emitted, this parameter is specified for ignoring the first mouse_up emitting. * @param is_ignore_first_mouse_up The flost_listbox will be closed when a mouse_up is emitted, this parameter is specified for ignoring the first mouse_up emitting.
* @remark The float_listbox can be popupped in a mouse_down event, the next mouse_up may be ignored, otherwise the float_listbox will be closed when user releases the button. * @remark The float_listbox can be pop-upped in a mouse_down event, the next mouse_up may be ignored, otherwise the float_listbox will be closed when user releases the button.
*/ */
float_listbox(window, const rectangle&, bool is_ignore_first_mouse_up); float_listbox(window, const rectangle&, bool is_ignore_first_mouse_up);

View File

@ -651,7 +651,7 @@ namespace nana
}; };
/// usefull for both absolute and display (sorted) positions /// useful for both absolute and display (sorted) positions
struct index_pair struct index_pair
{ {
constexpr static const size_type npos = ::nana::npos; constexpr static const size_type npos = ::nana::npos;
@ -712,7 +712,7 @@ namespace nana
// struct essence // struct essence
//@brief: this struct gives many data for listbox, //@brief: this struct gives many data for listbox,
// the state of the struct does not effect on member funcions, therefore all data members are public. // the state of the struct does not effect on member functions, therefore all data members are public.
struct essence; struct essence;
class oresolver class oresolver
@ -806,7 +806,7 @@ namespace nana
drawer_lister_impl *drawer_lister_; drawer_lister_impl *drawer_lister_;
};//end class trigger };//end class trigger
/// operate with absolute positions and contain only the position but montain pointers to parts of the real items /// operate with absolute positions and contain only the position but maintain pointers to parts of the real items
/// item_proxy self, it references and iterators are not invalidated by sort() /// item_proxy self, it references and iterators are not invalidated by sort()
class item_proxy class item_proxy
: public ::nana::widgets::detail::widget_iterator<std::input_iterator_tag, item_proxy> : public ::nana::widgets::detail::widget_iterator<std::input_iterator_tag, item_proxy>
@ -814,11 +814,11 @@ namespace nana
public: public:
item_proxy(essence*, const index_pair& = index_pair{npos, npos}); item_proxy(essence*, const index_pair& = index_pair{npos, npos});
/// the main porpose of this it to make obvious that item_proxy operate with absolute positions, and dont get moved during sort() /// the main purpose of this it to make obvious that item_proxy operate with absolute positions, and don't get moved during sort()
static item_proxy from_display(essence *, const index_pair &relative) ; static item_proxy from_display(essence *, const index_pair &relative) ;
item_proxy from_display(const index_pair &relative) const; item_proxy from_display(const index_pair &relative) const;
/// posible use: last_selected_display = last_selected.to_display().item; use with caution, it get invalidated after a sort() /// possible use: last_selected_display = last_selected.to_display().item; use with caution, it get invalidated after a sort()
index_pair to_display() const; index_pair to_display() const;
/// Determines whether the item is displayed on the screen /// Determines whether the item is displayed on the screen
@ -837,9 +837,9 @@ namespace nana
/// Determines whether the item is checked /// Determines whether the item is checked
bool checked() const; bool checked() const;
/// Selects/unselects the item /// Selects/deselects the item
/** /**
* @param sel Indicates whether to select or unselect the item * @param sel Indicates whether to select or deselect the item
* @param scroll_view Indicates whether to scroll the view to the item. It is ignored if the item is displayed. * @param scroll_view Indicates whether to scroll the view to the item. It is ignored if the item is displayed.
* @return the reference of *this. * @return the reference of *this.
*/ */
@ -1176,7 +1176,7 @@ namespace nana
{ {
drawerbase::listbox::cat_proxy category; drawerbase::listbox::cat_proxy category;
/// A flag that indicates whether or not to block expension/shrink of category when it is double clicking. /// A flag that indicates whether or not to block expansion/shrink of category when it is double clicked.
mutable bool block_operation{ false }; mutable bool block_operation{ false };
arg_listbox_category(const drawerbase::listbox::cat_proxy&) noexcept; arg_listbox_category(const drawerbase::listbox::cat_proxy&) noexcept;
@ -1189,7 +1189,7 @@ namespace nana
struct listbox_events struct listbox_events
: public general_events : public general_events
{ {
/// An envent occurs when the toggle of a listbox item is checked. /// An event occurs when the toggle of a listbox item is checked.
basic_event<arg_listbox> checked; basic_event<arg_listbox> checked;
/// An event occurs when a listbox item is clicked. /// An event occurs when a listbox item is clicked.
@ -1244,8 +1244,8 @@ By \a clicking on one header the list get \a reordered, first up, and then down
1. The resolver is used to resolute an object of the specified type into (or back from) a listbox item. 1. The resolver is used to resolute an object of the specified type into (or back from) a listbox item.
3. nana::listbox creates the category 0 by default. 3. nana::listbox creates the category 0 by default.
This is an special category, becouse it is invisible, while the associated items are visible. This is an special category, because it is invisible, while the associated items are visible.
The optional, user-created categories begin at index 1 and are visibles. The optional, user-created categories begin at index 1 and are visible.
The member functions without the categ parameter operate the items that belong to category 0. The member functions without the categ parameter operate the items that belong to category 0.
4. A sort compare is used for sorting the items. It is a strict weak ordering comparer that must meet the requirement: 4. A sort compare is used for sorting the items. It is a strict weak ordering comparer that must meet the requirement:
Irreflexivity (comp(x, x) returns false) Irreflexivity (comp(x, x) returns false)
@ -1276,15 +1276,15 @@ By \a clicking on one header the list get \a reordered, first up, and then down
cat.at(0).value(10); //10 is custom data. cat.at(0).value(10); //10 is custom data.
cat.at(1).value(20); //20 is custom data. cat.at(1).value(20); //20 is custom data.
5. listbox is a widget_object, with template parameters drawerbase::listbox::trigger and drawerbase::listbox::scheme 5. listbox is a widget_object, with template parameters drawerbase::listbox::trigger and drawerbase::listbox::scheme
amon others. among others.
That means that listbox have a member trigger_ constructed first and accecible with get_drawer_trigger() and That means that listbox have a member trigger_ constructed first and accessible with get_drawer_trigger() and
a member (unique pointer to) scheme_ accesible with scheme_type& scheme() created in the constructor a member (unique pointer to) scheme_ accessible with scheme_type& scheme() created in the constructor
with API::dev::make_scheme<Scheme>() which call API::detail::make_scheme(::nana::detail::scheme_factory<Scheme>()) with API::dev::make_scheme<Scheme>() which call API::detail::make_scheme(::nana::detail::scheme_factory<Scheme>())
which call restrict::bedrock.make_scheme(static_cast<::nana::detail::scheme_factory_base&&>(factory)); which call restrict::bedrock.make_scheme(static_cast<::nana::detail::scheme_factory_base&&>(factory));
which call pi_data_->scheme.create(std::move(factory)); which call pi_data_->scheme.create(std::move(factory));
which call factory.create(scheme_template(std::move(factory))); which call factory.create(scheme_template(std::move(factory)));
which call (new Scheme(static_cast<Scheme&>(other))); which call (new Scheme(static_cast<Scheme&>(other)));
and which in create is setted with: API::dev::set_scheme(handle_, scheme_.get()); which save the scheme pointer in and which in create is set with: API::dev::set_scheme(handle_, scheme_.get()); which save the scheme pointer in
the nana::detail::basic_window member pointer scheme the nana::detail::basic_window member pointer scheme
\todo doc: actualize this example listbox.at(0)... \todo doc: actualize this example listbox.at(0)...
\see nana::drawerbase::listbox::cat_proxy \see nana::drawerbase::listbox::cat_proxy
@ -1426,7 +1426,7 @@ the nana::detail::basic_window member pointer scheme
/// Scrolls the view to the first or last item of a specified category /// Scrolls the view to the first or last item of a specified category
void scroll(bool to_bottom, size_type cat_pos = ::nana::npos); void scroll(bool to_bottom, size_type cat_pos = ::nana::npos);
/// Scrolls the view to show an item sepcified by absolute position at top/bottom of the listbox. /// Scrolls the view to show an item specified by absolute position at top/bottom of the listbox.
void scroll(bool to_bottom, const index_pair& abs_pos); void scroll(bool to_bottom, const index_pair& abs_pos);
/// Appends a new column with a header text and the specified width at the end, and return it position /// Appends a new column with a header text and the specified width at the end, and return it position
@ -1532,11 +1532,11 @@ the nana::detail::basic_window member pointer scheme
std::function<bool(const std::string&, nana::any*, std::function<bool(const std::string&, nana::any*,
const std::string&, nana::any*, bool reverse)> strick_ordering); const std::string&, nana::any*, bool reverse)> strick_ordering);
/// sort() and ivalidate any existing reference from display position to absolute item, that is: after sort() display offset point to different items /// sort() and invalidates any existing reference from display position to absolute item, that is: after sort() display offset point to different items
void sort_col(size_type col, bool reverse = false); void sort_col(size_type col, bool reverse = false);
size_type sort_col() const; size_type sort_col() const;
/// potencially ivalidate any existing reference from display position to absolute item, that is: after sort() display offset point to different items /// potentially invalidates any existing reference from display position to absolute item, that is: after sort() display offset point to different items
void unsort(); void unsort();
bool freeze_sort(bool freeze); bool freeze_sort(bool freeze);

View File

@ -61,7 +61,7 @@ namespace nana
}//end namespace menubar }//end namespace menubar
}//end namespace drawerbase }//end namespace drawerbase
/// \brief A toolbar at the top of window for popuping menus. /// \brief A toolbar at the top of window for pop-upping menus.
/// ///
/// The widget sets as shortkey the character behind the first of & in the text, for the item. e.g. "File(&F)" or "&File". /// The widget sets as shortkey the character behind the first of & in the text, for the item. e.g. "File(&F)" or "&File".
class menubar class menubar

View File

@ -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, which in actual use makes no difference. /// For placing other widgets, where the bool template parameter determines 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,

View File

@ -47,8 +47,8 @@ namespace nana
}; };
} }
}//end namespace drawerbase }//end namespace drawerbase
/// \brief A progressbar widget with two styles: know, and unknow amount value (goal). /// \brief A progressbar widget with two styles: know, and unknown amount value (goal).
/// In unknow style the amount is ignored and the bar is scrolled when value change. /// In unknown style the amount is ignored and the bar is scrolled when value change.
class progress class progress
: public widget_object<category::widget_tag, drawerbase::progress::trigger, ::nana::general_events, drawerbase::progress::scheme> : public widget_object<category::widget_tag, drawerbase::progress::trigger, ::nana::general_events, drawerbase::progress::scheme>
{ {

View File

@ -53,7 +53,7 @@ namespace nana
size_type peak; ///< the whole total size_type peak; ///< the whole total
size_type range; ///< how many is shown 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 beginning
buttons what; buttons what;
bool pressed; bool pressed;
@ -354,7 +354,7 @@ namespace nana
/// Set the range of the widget. /// Set the range of the widget.
virtual void range(size_type r) = 0; virtual void range(size_type r) = 0;
/// \brief Get the value (current offset calculated from the very beginnig) /// \brief Get the value (current offset calculated from the very beginning)
/// @return the value. /// @return the value.
virtual size_type value() const = 0; virtual size_type value() const = 0;
@ -371,7 +371,7 @@ namespace nana
/// @param s a value for step. /// @param s a value for step.
virtual void step(size_type s) = 0; virtual void step(size_type s) = 0;
/// \brief Increase/decrease values by a step (alternativelly by some number of steps). /// \brief Increase/decrease values by a step (alternatively by some number of steps).
/// @param forward it determines whether increase or decrease. /// @param forward it determines whether increase or decrease.
/// @return true if the value is changed. /// @return true if the value is changed.
virtual bool make_step(bool forward, unsigned steps = 1) = 0; virtual bool make_step(bool forward, unsigned steps = 1) = 0;
@ -438,7 +438,7 @@ namespace nana
return this->get_drawer_trigger().range(r); return this->get_drawer_trigger().range(r);
} }
/// \brief Get the value (current offset calculated from the very beginnig) /// \brief Get the value (current offset calculated from the very beginning)
/// @return the value. /// @return the value.
size_type value() const override size_type value() const override
{ {
@ -466,7 +466,7 @@ namespace nana
return this->get_drawer_trigger().step(s); return this->get_drawer_trigger().step(s);
} }
/// \brief Increase/decrease values by a step (alternativelly by some number of steps). /// \brief Increase/decrease values by a step (alternatively by some number of steps).
/// @param forward it determines whether increase or decrease. /// @param forward it determines whether increase or decrease.
/// @return true if the value is changed. /// @return true if the value is changed.
bool make_step(bool forward, unsigned steps = 1) override bool make_step(bool forward, unsigned steps = 1) override
@ -486,7 +486,7 @@ namespace nana
/// \brief Increase/decrease values by steps as if it is scrolled through mouse wheel. /// \brief Increase/decrease values by steps as if it is scrolled through mouse wheel.
/// @param forward it determines whether increase or decrease. /// @param forward it determines whether increase or decrease.
/// @return true if the vlaue is changed. /// @return true if the value is changed.
bool make_scroll(bool forward) bool make_scroll(bool forward)
{ {
return this->make_step(forward, 3); // set this 3 in the metrics of the widget scheme ? return this->make_step(forward, 3); // set this 3 in the metrics of the widget scheme ?
@ -494,7 +494,7 @@ namespace nana
/// \brief Increase/decrease values by a page as if it is scrolled page up. /// \brief Increase/decrease values by a page as if it is scrolled page up.
/// @param forward it determines whether increase or decrease. /// @param forward it determines whether increase or decrease.
/// @return true if the vlaue is changed. /// @return true if the value is changed.
bool make_page_scroll(bool forward) bool make_page_scroll(bool forward)
{ {
auto const count = range() / step(); auto const count = range() / step();

View File

@ -134,7 +134,7 @@ namespace nana
}//end namespace drawerbase }//end namespace drawerbase
/// A slider widget wich the user can drag for tracking /// A slider widget which the user can drag for tracking
class slider class slider
: public widget_object<category::widget_tag, drawerbase::slider::trigger, drawerbase::slider::slider_events, drawerbase::slider::scheme_impl> : public widget_object<category::widget_tag, drawerbase::slider::trigger, drawerbase::slider::slider_events, drawerbase::slider::scheme_impl>
{ {

View File

@ -103,10 +103,10 @@ namespace nana
std::pair<int, int> range_int() const; std::pair<int, int> range_int() const;
std::pair<double, double> range_double() const; std::pair<double, double> range_double() const;
/// Selects/unselects the text /// Selects/Deselects the text
void select(bool); void select(bool);
/// Gets the spinned value /// Gets the spun 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;

View File

@ -328,7 +328,7 @@ namespace nana
tabbar& append(std::wstring text, window attach_wd, value_type value = {}) tabbar& append(std::wstring text, window attach_wd, value_type value = {})
{ {
if (attach_wd && API::empty_window(attach_wd)) if (attach_wd && API::empty_window(attach_wd))
throw std::invalid_argument("Appening a tab to a tabbar - error: tabbar.attach: invalid window handle"); throw std::invalid_argument("Appending a tab to a tabbar - error: tabbar.attach: invalid window handle");
this->get_drawer_trigger().insert(::nana::npos, to_nstring(std::move(text)), std::move(value)); this->get_drawer_trigger().insert(::nana::npos, to_nstring(std::move(text)), std::move(value));
if (attach_wd) if (attach_wd)
@ -409,7 +409,7 @@ namespace nana
this->get_drawer_trigger().text(pos, to_nstring(str)); this->get_drawer_trigger().text(pos, to_nstring(str));
} }
std::string text(std::size_t pos) const /// Returns a title of a specified item, If pos is invalid, the method trhows a std::out_of_range object. std::string text(std::size_t pos) const /// Returns a title of a specified item, If pos is invalid, the method throws a std::out_of_range object.
{ {
return to_utf8(this->get_drawer_trigger().text(pos)); return to_utf8(this->get_drawer_trigger().text(pos));
} }

View File

@ -223,7 +223,7 @@ namespace nana
bool selected() const; bool selected() const;
bool get_selected_points(nana::upoint &a, nana::upoint &b) const; bool get_selected_points(nana::upoint &a, nana::upoint &b) const;
/// Selects/unselects all text. /// Selects/Deselects all text.
void select(bool); void select(bool);
void select_points(nana::upoint arg_a, nana::upoint arg_b); void select_points(nana::upoint arg_a, nana::upoint arg_b);

View File

@ -194,7 +194,7 @@ namespace nana
bool empty() const; bool empty() const;
/// \brief Return the distance between the ROOT node and this node. /// \brief Return the distance between the ROOT node and this node.
/// @return only available when emtpy() is false. /// @return only available when empty() is false.
std::size_t level() const; std::size_t level() const;
/// Return the check state /// Return the check state
@ -309,7 +309,7 @@ namespace nana
return *this; return *this;
} }
// Undocumentated methods for internal use // Undocumented methods for internal use
trigger::node_type * _m_node() const; trigger::node_type * _m_node() const;
private: private:
nana::any& _m_value(); nana::any& _m_value();
@ -397,7 +397,7 @@ namespace nana
const nana::pat::cloneable<compset_placer_interface> & placer() const; const nana::pat::cloneable<compset_placer_interface> & placer() const;
/// \brief Eanble the widget to be draws automatically when it is operated. /// \brief Enable the widget to be draws automatically when it is operated.
/// ///
/// The treebox automatically redraws after certain operations, but, /// The treebox automatically redraws after certain operations, but,
/// under some circumstances, it is good to disable the automatic drawing mode, /// under some circumstances, it is good to disable the automatic drawing mode,
@ -441,7 +441,7 @@ namespace nana
/// If 'hovered' or 'expanded' are not set, it uses 'normal' state image for these 2 states. /// If 'hovered' or 'expanded' are not set, it uses 'normal' state image for these 2 states.
/// See also in [documentation](http://nanapro.org/en-us/help/widgets/treebox.htm) /// See also in [documentation](http://nanapro.org/en-us/help/widgets/treebox.htm)
/// @param id The name of an icon scheme. If the name is not existing, it creates a new scheme for the name. /// @param id The name of an icon scheme. If the name is not existing, it creates a new scheme for the name.
/// @return The reference of node image scheme correspending with the specified id. /// @return The reference of node image scheme corresponding with the specified id.
node_image_type& icon(const ::std::string& id); node_image_type& icon(const ::std::string& id);
void icon_erase(const ::std::string& id); void icon_erase(const ::std::string& id);

View File

@ -61,7 +61,7 @@ namespace nana
#ifdef NANA_AUTOMATIC_GUI_TESTING #ifdef NANA_AUTOMATIC_GUI_TESTING
/// @brief Take control of the GUI and optionaly automaticaly tests it. /// @brief Take control of the GUI and optionally automatically tests it.
/// ///
/// @detail It transfers to nana the program flow control, which begin pumping messages /// @detail It transfers to nana the program flow control, which begin pumping messages
/// from the underlying OS, interpreting and sending it with suitable arguments /// from the underlying OS, interpreting and sending it with suitable arguments
@ -71,10 +71,10 @@ namespace nana
void exec( void exec(
unsigned wait = 1, ///< for the GUI to be constructed, in seconds unsigned wait = 1, ///< for the GUI to be constructed, in seconds
unsigned wait_end = 1, ///< for the GUI to be destructed, in seconds unsigned wait_end = 1, ///< for the GUI to be destructed, in seconds
std::function<void()> = {} ///< emit events to mimics user actions and may asert results std::function<void()> = {} ///< emit events to mimics user actions and may assert results
); );
/// send a click message to this widget - useffull in GUI testing /// send a click message to this widget - useful in GUI testing
void click(widget& w); void click(widget& w);
/// in seconds /// in seconds

View File

@ -99,7 +99,7 @@ namespace nana
//add //add
//@brief: The add operation is successful if the name does not exist. //@brief: The add operation is successful if the name does not exist.
// it does not replace the existing object by new object, becuase this // it does not replace the existing object by new object, because this
// feature is thread safe and efficiency. // feature is thread safe and efficiency.
template<typename ImageProcessor, typename Tag> template<typename ImageProcessor, typename Tag>
void add(Tag & tag, const std::string& name) void add(Tag & tag, const std::string& name)

View File

@ -21,35 +21,35 @@
#if defined(STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED) #if defined(STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED)
namespace std namespace std
{ {
//Workaround for no implemenation of std::stoi in MinGW. //Workaround for no implementation of std::stoi in MinGW.
int stoi(const std::string&, std::size_t * pos = nullptr, int base = 10); int stoi(const std::string&, std::size_t * pos = nullptr, int base = 10);
int stoi(const std::wstring&, std::size_t* pos = nullptr, int base = 10); int stoi(const std::wstring&, std::size_t* pos = nullptr, int base = 10);
//Workaround for no implemenation of std::stof in MinGW. //Workaround for no implementation of std::stof in MinGW.
float stof(const std::string&, std::size_t * pos = nullptr); float stof(const std::string&, std::size_t * pos = nullptr);
float stof(const std::wstring&, std::size_t* pos = nullptr); float stof(const std::wstring&, std::size_t* pos = nullptr);
//Workaround for no implemenation of std::stod in MinGW. //Workaround for no implementation of std::stod in MinGW.
double stod(const std::string&, std::size_t * pos = nullptr); double stod(const std::string&, std::size_t * pos = nullptr);
double stod(const std::wstring&, std::size_t* pos = nullptr); double stod(const std::wstring&, std::size_t* pos = nullptr);
//Workaround for no implemenation of std::stold in MinGW. //Workaround for no implementation of std::stold in MinGW.
long double stold(const std::string&, std::size_t * pos = nullptr); long double stold(const std::string&, std::size_t * pos = nullptr);
long double stold(const std::wstring&, std::size_t* pos = nullptr); long double stold(const std::wstring&, std::size_t* pos = nullptr);
//Workaround for no implemenation of std::stol in MinGW. //Workaround for no implementation of std::stol in MinGW.
long stol(const std::string&, std::size_t* pos = nullptr, int base = 10); long stol(const std::string&, std::size_t* pos = nullptr, int base = 10);
long stol(const std::wstring&, std::size_t* pos = nullptr, int base = 10); long stol(const std::wstring&, std::size_t* pos = nullptr, int base = 10);
//Workaround for no implemenation of std::stoll in MinGW. //Workaround for no implementation of std::stoll in MinGW.
long long stoll(const std::string&, std::size_t* pos = nullptr, int base = 10); long long stoll(const std::string&, std::size_t* pos = nullptr, int base = 10);
long long stoll(const std::wstring&, std::size_t* pos = nullptr, int base = 10); long long stoll(const std::wstring&, std::size_t* pos = nullptr, int base = 10);
//Workaround for no implemenation of std::stoul in MinGW. //Workaround for no implementation of std::stoul in MinGW.
unsigned long stoul(const std::string&, std::size_t* pos = nullptr, int base = 10); unsigned long stoul(const std::string&, std::size_t* pos = nullptr, int base = 10);
unsigned long stoul(const std::wstring&, std::size_t* pos = nullptr, int base = 10); unsigned long stoul(const std::wstring&, std::size_t* pos = nullptr, int base = 10);
//Workaround for no implemenation of std::stoull in MinGW. //Workaround for no implementation of std::stoull in MinGW.
unsigned long long stoull(const std::string&, std::size_t* pos = nullptr, int base = 10); unsigned long long stoull(const std::string&, std::size_t* pos = nullptr, int base = 10);
unsigned long long stoull(const std::wstring&, std::size_t* pos = nullptr, int base = 10); unsigned long long stoull(const std::wstring&, std::size_t* pos = nullptr, int base = 10);
} }
@ -58,7 +58,7 @@ namespace std
#ifdef STD_TO_STRING_NOT_SUPPORTED #ifdef STD_TO_STRING_NOT_SUPPORTED
namespace std namespace std
{ {
//Workaround for no implemenation of std::to_string/std::to_wstring in MinGW. //Workaround for no implementation of std::to_string/std::to_wstring in MinGW.
std::string to_string(long double); std::string to_string(long double);
std::string to_string(double); std::string to_string(double);
std::string to_string(unsigned); std::string to_string(unsigned);
@ -131,7 +131,7 @@ namespace std {
#include <string> #include <string>
namespace std namespace std
{ {
//Workaround for no implemenation of std::put_time in gcc < 5. //Workaround for no implementation of std::put_time in gcc < 5.
/* std unspecified return type */ /* std unspecified return type */
//template< class CharT, class RTSTR >// let fail for CharT != char / wchar_t //template< class CharT, class RTSTR >// let fail for CharT != char / wchar_t
//RTSTR put_time(const std::tm* tmb, const CharT* fmt); //RTSTR put_time(const std::tm* tmb, const CharT* fmt);

View File

@ -100,7 +100,7 @@ namespace nana
//Initializes the color with a CSS-like string //Initializes the color with a CSS-like string
//contributor: BigDave(mortis2007 at hotmail co uk) //contributor: BigDave(mortis2007 at hotmail co uk)
//date: February 3, 2015 //date: February 3, 2015
//maintainor: Jinhao, extended the support of CSS-spec //maintainer: Jinhao, extended the support of CSS-spec
color::color(std::string css_color) color::color(std::string css_color)
: a_(1.0) : a_(1.0)

View File

@ -349,7 +349,7 @@ namespace nana
virtual std::wstring&& wstr_move() = 0; virtual std::wstring&& wstr_move() = 0;
}; };
/// playing with the idea - we need a mechanisme to set a user selected police - Testing an abtract interphase /// playing with the idea - we need a mechanism to set a user selected police - Testing an abstract interface
struct encoding_error_police struct encoding_error_police
{ {
virtual unsigned long next_code_point(const unsigned char*& current_code_unit, const unsigned char* end) = 0; virtual unsigned long next_code_point(const unsigned char*& current_code_unit, const unsigned char* end) = 0;
@ -689,14 +689,14 @@ namespace nana
} }
unsigned ch = *p; unsigned ch = *p;
unsigned long code; unsigned long code;
if(ch < 0xC0) // error? - move to end. Posible ANSI or ISO code-page if(ch < 0xC0) // error? - move to end. Possible ANSI or ISO code-page
{ {
//return *(p++); // temp: assume equal //return *(p++); // temp: assume equal
//p = end; //p = end;
//return 0; //return 0;
return def_encoding_error_police->next_code_point(p, end); return def_encoding_error_police->next_code_point(p, end);
} }
else if(ch < 0xE0 && (p + 1 <= end)) // two byte chararcter else if(ch < 0xE0 && (p + 1 <= end)) // two byte character
{ {
code = ((ch & 0x1F) << 6) | (p[1] & 0x3F); code = ((ch & 0x1F) << 6) | (p[1] & 0x3F);
p += 2; p += 2;

View File

@ -9,7 +9,7 @@
* *
* @file: nana/depoly.cpp * @file: nana/depoly.cpp
* *
* What follow are dependented on what defined in nana/config.hpp * What follows is dependent on what defined in nana/config.hpp
*/ */
#include <nana/deploy.hpp> #include <nana/deploy.hpp>

View File

@ -8,7 +8,7 @@
* *
* @file: nana/filesystem/filesystem.cpp * @file: nana/filesystem/filesystem.cpp
* @description: * @description:
* provide some interface for file managment * provide some interface for file management
*/ */
#include <nana/filesystem/filesystem_ext.hpp> #include <nana/filesystem/filesystem_ext.hpp>
@ -283,7 +283,7 @@ namespace nana { namespace experimental { namespace filesystem
path path::extension() const path path::extension() const
{ {
// todo: make more globlal // todo: make more global
#if defined(NANA_WINDOWS) #if defined(NANA_WINDOWS)
auto SLorP=L"\\/."; auto SLorP=L"\\/.";
auto P=L'.'; auto P=L'.';

View File

@ -180,7 +180,7 @@ namespace nana
//struct frameset::impl //struct frameset::impl
struct frameset::impl struct frameset::impl
{ {
//Only list whos iterator would not invalided after a insertion. //Only list whose iterator would not be invalidated after an insertion.
std::list<frame> frames; std::list<frame> frames;
std::list<frame>::iterator this_frame; std::list<frame>::iterator this_frame;
std::size_t pos_in_this_frame{ 0 }; std::size_t pos_in_this_frame{ 0 };

View File

@ -401,7 +401,7 @@ namespace nana
extra_width = extra_height = 0; extra_width = extra_height = 0;
//The window must keep its thread_id same as its parent if it is a child. //The window must keep its thread_id same as its parent if it is a child.
//Otherwise, its root buffer would be mapped repeatly if it is in its parent thread. //Otherwise, its root buffer would be mapped repeatedly if it is in its parent thread.
thread_id = nana::system::this_thread_id(); thread_id = nana::system::this_thread_id();
if(agrparent && (thread_id != agrparent->thread_id)) if(agrparent && (thread_id != agrparent->thread_id))
thread_id = agrparent->thread_id; thread_id = agrparent->thread_id;

View File

@ -214,7 +214,7 @@ namespace detail
if(wd_manager().number_of_core_window()) if(wd_manager().number_of_core_window())
{ {
std::string msg = "Nana.GUI detects a memory leaks in window_manager, " + std::to_string(wd_manager().number_of_core_window()) + " window(s) are not uninstalled."; std::string msg = "Nana.GUI detects a memory leaks in window_manager, " + std::to_string(wd_manager().number_of_core_window()) + " window(s) are not uninstalled.";
std::cerr << msg; /// \todo add list of cations of open windows and if aut testin GUI do auto Ok after 2 sec. std::cerr << msg; /// \todo add list of cations of opening windows and if auto testing GUI do auto OK after 2 seconds.
::MessageBoxA(0, msg.c_str(), ("Nana C++ Library"), MB_OK); ::MessageBoxA(0, msg.c_str(), ("Nana C++ Library"), MB_OK);
} }
@ -223,7 +223,7 @@ namespace detail
} }
/// @brief increament the number of windows in the thread id /// @brief increment the number of windows in the thread id
int bedrock::inc_window(thread_t tid) int bedrock::inc_window(thread_t tid)
{ {
//impl refers to the object of private_impl, the object is created when bedrock is creating. //impl refers to the object of private_impl, the object is created when bedrock is creating.
@ -592,7 +592,7 @@ namespace detail
delete [] reinterpret_cast<wchar_t*>(wParam); delete [] reinterpret_cast<wchar_t*>(wParam);
return true; return true;
case nana::detail::messages::remote_thread_destroy_window: case nana::detail::messages::remote_thread_destroy_window:
detail::native_interface::close_window(reinterpret_cast<native_window_type>(wd)); //The owner would be actived before the message has posted in current thread. detail::native_interface::close_window(reinterpret_cast<native_window_type>(wd)); //The owner would be activated before the message has posted in current thread.
{ {
internal_scope_guard sg; internal_scope_guard sg;
auto * thrd = bedrock.get_thread_context(); auto * thrd = bedrock.get_thread_context();
@ -896,8 +896,8 @@ namespace detail
//Don't take care about whether msgwnd is equal to the pressed_wd. //Don't take care about whether msgwnd is equal to the pressed_wd.
// //
//pressed_wd will remains when opens a no-actived window in an mouse_down event(like combox popups the drop-list). //pressed_wd will remain when opens a non-activated window in an mouse_down event(like combox popups the drop-list).
//After the no-actived window is closed, the window doesn't respond to the mouse click other than pressed_wd. //After the non-activated window is closed, the window doesn't respond to the mouse click other than pressed_wd.
pressed_wd = nullptr; pressed_wd = nullptr;
if (nullptr == msgwnd) if (nullptr == msgwnd)
break; break;
@ -1330,7 +1330,7 @@ namespace detail
msgwnd = msgwnd->root_widget->other.attribute.root->menubar; msgwnd = msgwnd->root_widget->other.attribute.root->menubar;
if(msgwnd) if(msgwnd)
{ {
//Don't call default window proc to avoid popuping system menu. //Don't call default window proc to avoid pop-upping system menu.
def_window_proc = false; def_window_proc = false;
bool set_focus = (brock.focus() != msgwnd) && (!msgwnd->root_widget->flags.ignore_menubar_focus); bool set_focus = (brock.focus() != msgwnd) && (!msgwnd->root_widget->flags.ignore_menubar_focus);
@ -1416,8 +1416,8 @@ namespace detail
if (msgwnd->root_widget->other.attribute.root->menubar == msgwnd) if (msgwnd->root_widget->other.attribute.root->menubar == msgwnd)
{ {
//In order to keep the focus on the menubar, cancel the delay_restore //In order to keep the focus on the menubar, cancel the delay_restore
//when pressing ESC to close the menu which is popuped by the menubar. //when pressing ESC to close the menu which is pop-upped by the menubar.
//If no menu popuped by the menubar, it should enable delay restore to //If no menu pop-upped by the menubar, it should enable delay restore to
//restore the focus for taken window. //restore the focus for taken window.
int cmd = (menu_wd && (keyboard::escape == static_cast<wchar_t>(wParam)) ? 1 : 0); int cmd = (menu_wd && (keyboard::escape == static_cast<wchar_t>(wParam)) ? 1 : 0);
@ -1522,7 +1522,7 @@ namespace detail
if (!arg.cancel) if (!arg.cancel)
{ {
def_window_proc = true; def_window_proc = true;
//Activate is owner, refer to the window_manager::close for the explaination //Activates its owner, refer to the window_manager::close for the explanation
if (msgwnd->flags.modal || (msgwnd->owner == 0) || msgwnd->owner->flags.take_active) if (msgwnd->flags.modal || (msgwnd->owner == 0) || msgwnd->owner->flags.take_active)
native_interface::activate_owner(msgwnd->root); native_interface::activate_owner(msgwnd->root);
} }
@ -1532,7 +1532,7 @@ namespace detail
if (msgwnd->root == brock.get_menu()) if (msgwnd->root == brock.get_menu())
{ {
brock.erase_menu(false); brock.erase_menu(false);
brock.delay_restore(3); //Restores if delay_restore not decleared brock.delay_restore(3); //Restores if delay_restore not declared
} }
wd_manager.destroy(msgwnd); wd_manager.destroy(msgwnd);
nana::detail::platform_spec::instance().release_window_icon(msgwnd->root); nana::detail::platform_spec::instance().release_window_icon(msgwnd->root);
@ -1578,7 +1578,7 @@ namespace detail
delete passoc; delete passoc;
} }
//Generates an identitifer for an accel key. //Generates an identifier for an accel key.
std::pair<int, WORD> id_accel_key(const accel_key& key) std::pair<int, WORD> id_accel_key(const accel_key& key)
{ {
std::pair<int, WORD> ret; std::pair<int, WORD> ret;

View File

@ -133,7 +133,7 @@ namespace nana{
//The XMoveWindow and XMoveResizeWindow don't take effect if the specified window is //The XMoveWindow and XMoveResizeWindow don't take effect if the specified window is
//unmapped, and the members x and y of XSetSizeHints is obsoluted. So the position that //unmapped, and the members x and y of XSetSizeHints is obsoleted. So the position that
//set to a unmapped windows should be kept and use the position when the window is mapped. //set to a unmapped windows should be kept and use the position when the window is mapped.
std::map<Window, ::nana::point> exposed_positions; //locked by platform_scope_guard std::map<Window, ::nana::point> exposed_positions; //locked by platform_scope_guard
@ -498,7 +498,7 @@ namespace nana{
{ {
if(nullptr == parent) return nullptr; if(nullptr == parent) return nullptr;
#if defined(NANA_WINDOWS) #if defined(NANA_WINDOWS)
HWND handle = ::CreateWindowEx(WS_EX_CONTROLPARENT, // Extended possibilites for variation HWND handle = ::CreateWindowEx(WS_EX_CONTROLPARENT, // Extended possibilities for variation
L"NanaWindowInternal", L"NanaWindowInternal",
L"Nana Child Window", // Title Text L"Nana Child Window", // Title Text
WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPSIBLINGS, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPSIBLINGS,
@ -703,7 +703,7 @@ namespace nana{
::PostMessage(reinterpret_cast<HWND>(wd), nana::detail::messages::remote_thread_destroy_window, 0, 0); ::PostMessage(reinterpret_cast<HWND>(wd), nana::detail::messages::remote_thread_destroy_window, 0, 0);
} }
#elif defined(NANA_X11) #elif defined(NANA_X11)
//Under X, XDestroyWindow destroys the specified window and generats a DestroyNotify //Under X, XDestroyWindow destroys the specified window and generates a DestroyNotify
//event, when the client receives the event, the specified window has been already //event, when the client receives the event, the specified window has been already
//destroyed. This is a feature which is different from Windows. So the following //destroyed. This is a feature which is different from Windows. So the following
//works should be handled before calling XDestroyWindow. //works should be handled before calling XDestroyWindow.
@ -711,7 +711,7 @@ namespace nana{
if(wd == brock.get_menu()) if(wd == brock.get_menu())
{ {
brock.erase_menu(false); brock.erase_menu(false);
brock.delay_restore(3); //Restores if delay_restore is not decleard brock.delay_restore(3); //Restores if delay_restore is not declared
} }
Display* disp = restrict::spec.open_display(); Display* disp = restrict::spec.open_display();

View File

@ -88,7 +88,7 @@ namespace nana
//read_visual_rectangle //read_visual_rectangle
///@brief Reads the visual rectangle of a window, the visual rectangle's reference frame is to root widget, ///@brief Reads the visual rectangle of a window, the visual rectangle's reference frame is to root widget,
/// the visual rectangle is a rectangular block that a window should be displayed on screen. /// the visual rectangle is a rectangular block that a window should be displayed on screen.
/// The result is a rectangle that is a visible area for its ancesters. /// The result is a rectangle that is a visible area for its ancestors.
bool window_layout::read_visual_rectangle(core_window_t* wd, nana::rectangle& visual) bool window_layout::read_visual_rectangle(core_window_t* wd, nana::rectangle& visual)
{ {
if (! wd->displayed()) return false; if (! wd->displayed()) return false;

View File

@ -511,7 +511,7 @@ namespace detail
if (impl_->wd_register.available(owner)) if (impl_->wd_register.available(owner))
{ {
if (owner->flags.destroying) if (owner->flags.destroying)
throw std::runtime_error("the specified owner is destoryed"); throw std::runtime_error("the specified owner is destroyed");
native = owner->root_widget->root; native = owner->root_widget->root;
r.x += owner->pos_root.x; r.x += owner->pos_root.x;
@ -592,7 +592,7 @@ namespace detail
brock.emit(event_code::unload, wd, arg, true, brock.get_thread_context()); brock.emit(event_code::unload, wd, arg, true, brock.get_thread_context());
if (false == arg.cancel) if (false == arg.cancel)
{ {
//Before close the window, its owner window should be actived, otherwise other window will be //Before close the window, its owner window should be activated, otherwise other window will be
//activated due to the owner window is not enabled. //activated due to the owner window is not enabled.
if(wd->flags.modal || (wd->owner == nullptr) || wd->owner->flags.take_active) if(wd->flags.modal || (wd->owner == nullptr) || wd->owner->flags.take_active)
native_interface::activate_owner(wd->root); native_interface::activate_owner(wd->root);
@ -601,7 +601,7 @@ namespace detail
{ {
//Close should detach the drawer and send destroy signal to widget object. //Close should detach the drawer and send destroy signal to widget object.
//Otherwise, when a widget object is been deleting in other thread by delete operator, the object will be destroyed //Otherwise, when a widget object is been deleting in other thread by delete operator, the object will be destroyed
//before the window_manager destroyes the window, and then, window_manager detaches the //before the window_manager destroys the window, and then, window_manager detaches the
//non-existing drawer_trigger which is destroyed by destruction of widget. Crash! //non-existing drawer_trigger which is destroyed by destruction of widget. Crash!
wd->drawer.detached(); wd->drawer.detached();
wd->widget_notifier->destroy(); wd->widget_notifier->destroy();
@ -894,7 +894,7 @@ namespace detail
} }
} }
//Before resiz the window, creates the new graphics //Before resizing the window, creates the new graphics
paint::graphics graph; paint::graphics graph;
paint::graphics root_graph; paint::graphics root_graph;
if (category::flags::lite_widget != wd->other.category) if (category::flags::lite_widget != wd->other.category)
@ -1191,7 +1191,7 @@ namespace detail
//A fix by Katsuhisa Yuasa //A fix by Katsuhisa Yuasa
//The menubar token window will be redirected to the prev focus window when the new //The menubar token window will be redirected to the prev focus window when the new
//focus window is a menubar. //focus window is a menubar.
//The focus window will be restored to the prev focus which losts the focus becuase of //The focus window will be restored to the prev focus which losts the focus because of
//memberbar. //memberbar.
if (prev_focus && (wd == wd->root_widget->other.attribute.root->menubar)) if (prev_focus && (wd == wd->root_widget->other.attribute.root->menubar))
wd = prev_focus; wd = prev_focus;
@ -1302,7 +1302,7 @@ namespace detail
//enable_tabstop //enable_tabstop
//@brief: when users press a TAB, the focus should move to the next widget. //@brief: when users press a TAB, the focus should move to the next widget.
// this method insert a window which catchs an user TAB into a TAB window container // this method insert a window which catches an user TAB into a TAB window container
// the TAB window container is held by a wd's root widget. Not every widget has a TAB window container, // the TAB window container is held by a wd's root widget. Not every widget has a TAB window container,
// the container is created while a first Tab Window is setting // the container is created while a first Tab Window is setting
void window_manager::enable_tabstop(core_window_t* wd) void window_manager::enable_tabstop(core_window_t* wd)
@ -1728,7 +1728,7 @@ namespace detail
void window_manager::_m_move_core(core_window_t* wd, const point& delta) void window_manager::_m_move_core(core_window_t* wd, const point& delta)
{ {
if(category::flags::root != wd->other.category) //A root widget always starts at (0, 0) and its childs are not to be changed if(category::flags::root != wd->other.category) //A root widget always starts at (0, 0) and its children are not to be changed
{ {
wd->pos_root += delta; wd->pos_root += delta;

View File

@ -1239,7 +1239,7 @@ namespace nana
if(!child.empty()) if(!child.empty())
{ {
child->icon("icon-folder"); child->icon("icon-folder");
//The try-catch can be eleminated by using //The try-catch can be eliminated by using
//directory_iterator( const std::filesystem::path& p, std::error_code& ec ) noexcept; //directory_iterator( const std::filesystem::path& p, std::error_code& ec ) noexcept;
//in C++17 //in C++17
try try

View File

@ -745,7 +745,7 @@ namespace nana
impl->label_text = std::move(label); impl->label_text = std::move(label);
} }
//Instance for impl_ because implmenet is incomplete type at the point of declaration //Instance for impl_ because implement is incomplete type at the point of declaration
inputbox::integer::~integer(){} inputbox::integer::~integer(){}
int inputbox::integer::value() const int inputbox::integer::value() const
@ -828,7 +828,7 @@ namespace nana
impl->label_text = std::move(label); impl->label_text = std::move(label);
} }
//Instance for impl_ because implmenet is incomplete type at the point of declaration //Instance for impl_ because implement is incomplete type at the point of declaration
inputbox::real::~real(){} inputbox::real::~real(){}
double inputbox::real::value() const double inputbox::real::value() const
@ -920,7 +920,7 @@ namespace nana
impl_->label_text.swap(label); impl_->label_text.swap(label);
} }
//Instance for impl_ because implmenet is incomplete type at the point of declaration //Instance for impl_ because implement is incomplete type at the point of declaration
inputbox::text::~text(){} inputbox::text::~text(){}
void inputbox::text::tip_string(std::wstring tip) void inputbox::text::tip_string(std::wstring tip)
@ -1041,7 +1041,7 @@ namespace nana
impl_->label_text.swap(label); impl_->label_text.swap(label);
} }
//Instance for impl_ because implmenet is incomplete type at the point of declaration //Instance for impl_ because implement is incomplete type at the point of declaration
inputbox::date::~date(){} inputbox::date::~date(){}
::std::string inputbox::date::value() const ::std::string inputbox::date::value() const
@ -1192,7 +1192,7 @@ namespace nana
{ {
} }
//Instance for impl_ because implmenet is incomplete type at the point of declaration //Instance for impl_ because implement is incomplete type at the point of declaration
inputbox::path::~path(){} inputbox::path::~path(){}
::std::string inputbox::path::value() const ::std::string inputbox::path::value() const

View File

@ -2666,7 +2666,7 @@ namespace nana
} }
} }
//Collocate doesn't sync the visiblity of fastened windows. //Collocate doesn't sync the visibility of fastened windows.
//This is a feature that allows tabbar panels to be fastened to a same field, the collocate() //This is a feature that allows tabbar panels to be fastened to a same field, the collocate()
//shouldn't break the visibility of panels that are maintained by tabbar. //shouldn't break the visibility of panels that are maintained by tabbar.
field.second->visible(is_show, false); field.second->visible(is_show, false);
@ -2903,14 +2903,14 @@ namespace nana
token unmatch = token::width; token unmatch = token::width;
switch (div_type) switch (div_type)
{ {
case token::eof: // "horitontal" div case token::eof: // "horizontal" div
case token::vert: // "vertical" div case token::vert: // "vertical" div
if(token::eof == div_type) if(token::eof == div_type)
unmatch = token::height; unmatch = token::height;
for (auto& ch : children) for (auto& ch : children)
if (ch->weigth_type == unmatch) if (ch->weigth_type == unmatch)
throw std::invalid_argument("nana.place: unmatch vertical-heigth/horizontal-width betwen division '" throw std::invalid_argument("nana.place: unmatch vertical-height/horizontal-width between division '"
+name+"' and children division '" + ch->name); +name+"' and children division '" + ch->name);
div.reset(new div_arrange(token::vert == div_type, std::move(name), std::move(arrange))); div.reset(new div_arrange(token::vert == div_type, std::move(name), std::move(arrange)));
@ -3033,7 +3033,7 @@ namespace nana
void place::implement::check_unique(const division* div) const void place::implement::check_unique(const division* div) const
{ {
//The second field_impl is useless. Reuse the map type in order to //The second field_impl is useless. Reuse the map type in order to
//reduce the size of the generated code, becuase std::set<std::string> //reduce the size of the generated code, because std::set<std::string>
//will create a new template class. //will create a new template class.
std::map<std::string, field_gather*> unique; std::map<std::string, field_gather*> unique;
field_gather tmp(nullptr); field_gather tmp(nullptr);
@ -3198,7 +3198,7 @@ namespace nana
try try
{ {
impl_->connect(div.get()); //throws if there is a redefined name of field. impl_->connect(div.get()); //throws if there is a redefined name of field.
impl_->root_division.reset(); //clear atachments div-fields impl_->root_division.reset(); //clear attachments div-fields
impl_->root_division.swap(div); impl_->root_division.swap(div);
impl_->div_text.swap(div_text); impl_->div_text.swap(div_text);
} }
@ -3322,7 +3322,7 @@ namespace nana
if (div) if (div)
{ {
if (div->field && (div->field != p)) if (div->field && (div->field != p))
throw std::runtime_error("nana.place: unexpected error, the division attachs a unexpected field."); throw std::runtime_error("nana.place: unexpected error, the division attaches an unexpected field.");
div->field = p; div->field = p;
p->attached = div; p->attached = div;

View File

@ -262,7 +262,7 @@ namespace API
iwd->drawer.graphics.make(iwd->dimension); iwd->drawer.graphics.make(iwd->dimension);
iwd->drawer.graphics.rectangle(true, iwd->annex.scheme->background.get_color()); iwd->drawer.graphics.rectangle(true, iwd->annex.scheme->background.get_color());
iwd->drawer.attached(wd, dr); iwd->drawer.attached(wd, dr);
iwd->drawer.refresh(); //Always redrawe no matter it is visible or invisible. This can make the graphics data correctly. iwd->drawer.refresh(); //Always redraw no matter it is visible or invisible. This can make the graphics data correctly.
} }
} }
@ -456,12 +456,12 @@ namespace API
} }
//transform_shortkey_text //transform_shortkey_text
//@brief: This function searchs whether the text contains a '&' and removes the character for transforming. //@brief: This function 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 '&' character, 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.
//@param, text: the text is transformed. //@param, text: the text is transformed.
//@param, shortkey: the character which indicates a short key. //@param, shortkey: the character which indicates a short key.
//@param, skpos: retrives the shortkey position if it is not a null_ptr; //@param, skpos: retrieves the shortkey position if it is not a null_ptr;
std::string transform_shortkey_text(std::string text, wchar_t &shortkey, std::string::size_type *skpos) std::string transform_shortkey_text(std::string text, wchar_t &shortkey, std::string::size_type *skpos)
{ {
shortkey = 0; shortkey = 0;
@ -1057,7 +1057,7 @@ namespace API
else else
return; return;
//modal has to guarantee that does not lock the mutex of window_manager before invokeing the pump_event, //modal has to guarantee that does not lock the mutex of window_manager before invoking the pump_event,
//otherwise, the modal will prevent the other thread access the window. //otherwise, the modal will prevent the other thread access the window.
restrict::bedrock.pump_event(wd, true); restrict::bedrock.pump_event(wd, true);
} }

View File

@ -10,7 +10,7 @@
* @file: nana/gui/timer.hpp * @file: nana/gui/timer.hpp
* @description: * @description:
* A timer can repeatedly call a piece of code. The duration between * A timer can repeatedly call a piece of code. The duration between
* calls is specified in milliseconds. Timer is defferent from other graphics * calls is specified in milliseconds. Timer is different from other graphics
* controls, it has no graphics interface. * controls, it has no graphics interface.
* @contributors: Benjamin Navarro(pr#81) * @contributors: Benjamin Navarro(pr#81)
*/ */

View File

@ -446,7 +446,7 @@ namespace nana
{ {
r.width = i->value.second.pixels; r.width = i->value.second.pixels;
//If the item is over the right border of widget, the item would be painted at //If the item is over the right border of widget, the item would be painted at
//the begining of the next line. //the beginning of the next line.
if(r.right() > xend) if(r.right() > xend)
{ {
r.x = xbase; r.x = xbase;
@ -573,7 +573,7 @@ namespace nana
style_.listbox->events().destroy.connect_unignorable([this](const arg_destroy&) style_.listbox->events().destroy.connect_unignorable([this](const arg_destroy&)
{ {
//Close list when listbox is destoryed //Close list when listbox is destroyed
style_.mode = mode::normal; style_.mode = mode::normal;
style_.state = mouse_action::normal; style_.state = mouse_action::normal;
@ -646,7 +646,7 @@ namespace nana
} }
else else
{ {
//Too many items, so some of items cann't be displayed //Too many items, so some of items can't be displayed
r.x += 16; r.x += 16;
r.width -= 16; r.width -= 16;
return r; return r;
@ -918,5 +918,5 @@ namespace nana
} }
//end class trigger //end class trigger
}//end namespace categorize }//end namespace categorize
}//end namespace draerbase }//end namespace drawerbase
}//end namespace nana }//end namespace nana

View File

@ -293,7 +293,7 @@ namespace nana
//The lister window closes by itself. I just take care about the destroy event. //The lister window closes by itself. I just take care about the destroy event.
//The event should be destroy rather than unload. Because the unload event is invoked while //The event should be destroy rather than unload. Because the unload event is invoked while
//the lister is not closed, if popuping a message box, the lister will cover the message box. //the lister is not closed, if pop-upping a message box, the lister will cover the message box.
state_.lister->events().destroy.connect_unignorable([this](const arg_destroy&) state_.lister->events().destroy.connect_unignorable([this](const arg_destroy&)
{ {
state_.lister = nullptr; //The lister closes by itself. state_.lister = nullptr; //The lister closes by itself.

View File

@ -532,7 +532,7 @@ namespace nana
perf_transform_helper(window_handle, transf, graph, dirtybuf, gbuf, refpos); perf_transform_helper(window_handle, transf, graph, dirtybuf, gbuf, refpos);
} }
private: private:
//renderring functions //rendering functions
void _m_calc_basis(graph_reference graph, const nana::point& refpos) void _m_calc_basis(graph_reference graph, const nana::point& refpos)
{ {

View File

@ -312,14 +312,14 @@ checkbox& group::add_option(std::string text)
drawing dw(*this); drawing dw(*this);
//When the group is resized, the drawing is called before moving the caption, but //When the group is resized, the drawing is called before moving the caption, but
//the drawing of group requires the lastest position of caption for gradual rectangle. //the drawing of group requires the latest position of caption for gradual rectangle.
//For the requirement, a move event handler is required for listning the change of caption's position. //For the requirement, a move event handler is required for listening the change of caption's position.
impl_->caption.events().move([this](const arg_move&){ impl_->caption.events().move([this](const arg_move&){
if (align::left != impl_->caption_align) if (align::left != impl_->caption_align)
API::refresh_window(*this); API::refresh_window(*this);
}); });
// This drawing function is owner by the onwer of dw (the outer panel of the group widget), not by dw !! // This drawing function is owner by the owner of dw (the outer panel of the group widget), not by dw !!
dw.draw([this](paint::graphics& graph) dw.draw([this](paint::graphics& graph)
{ {
auto gap_px = impl_->gap - 1; auto gap_px = impl_->gap - 1;

View File

@ -376,7 +376,7 @@ namespace nana
{ {
text_pos += static_cast<int>(extent_size.width); text_pos += static_cast<int>(extent_size.width);
//Adjust height of extent_size for special text alignement. //Adjust height of extent_size for special text alignment.
if (fblock::aligns::baseline == fblock->text_align) if (fblock::aligns::baseline == fblock->text_align)
{ {
ascent = static_cast<unsigned>(data->ascent()); ascent = static_cast<unsigned>(data->ascent());
@ -420,7 +420,7 @@ namespace nana
text_pos = 0; text_pos = 0;
max_content_height = max_ascent = max_descent = 0; max_content_height = max_ascent = max_descent = 0;
//Adjust height of extent_size for special text alignement. //Adjust height of extent_size for special text alignment.
if (fblock::aligns::baseline == fblock->text_align) if (fblock::aligns::baseline == fblock->text_align)
{ {
ascent = static_cast<unsigned>(data->ascent()); ascent = static_cast<unsigned>(data->ascent());

View File

@ -675,7 +675,7 @@ namespace nana
else else
item_str += exp_opt.sep; item_str += exp_opt.sep;
//Use the model cells instead if model cells is avaiable //Use the model cells instead if model cells is available
item_str += (model_cells ? model_cells : cells.get())->operator[](col).text; item_str += (model_cells ? model_cells : cells.get())->operator[](col).text;
} }
@ -842,7 +842,7 @@ namespace nana
return sort_attrs_; return sort_attrs_;
} }
/// each sort() ivalidate any existing reference from display position to absolute item, that is after sort() display offset point to different items /// each sort() invalidates any existing reference from display position to absolute item, that is after sort() display offset point to different items
void sort() void sort()
{ {
if((npos == sort_attrs_.column) || (!sort_attrs_.resort)) if((npos == sort_attrs_.column) || (!sort_attrs_.resort))
@ -1554,7 +1554,7 @@ namespace nana
return n; return n;
} }
/// Finds a good item or category if an item specified by pos is invaild /// Finds a good item or category if an item specified by pos is invalid
index_pair find_next_good(index_pair pos, bool ignore_category) const noexcept index_pair find_next_good(index_pair pos, bool ignore_category) const noexcept
{ {
//Return the pos if it is good //Return the pos if it is good
@ -1691,7 +1691,7 @@ namespace nana
/** /**
* @param for_selection Indicates whether the selected items or checked items to be returned. * @param for_selection Indicates whether the selected items or checked items to be returned.
* @param find_first Indicates whether or not to return the first item which * @param find_first Indicates whether or not to return the first item which
* @param items_status a pointer refers to a bool object to receive the status whethe the picked items are all selected or all checked, in contrast to for_selection * @param items_status a pointer refers to a bool object to receive the status whether the picked items are all selected or all checked, in contrast to for_selection
*/ */
index_pairs pick_items(bool for_selection, bool find_first = false, bool * items_status = nullptr) const index_pairs pick_items(bool for_selection, bool find_first = false, bool * items_status = nullptr) const
{ {
@ -1989,7 +1989,7 @@ namespace nana
msup_deselect msup_deselect
}; };
/// created and live by the trigger, holds data for listbox: the state of the struct does not effect on member funcions, therefore all data members are public. /// created and live by the trigger, holds data for listbox: the state of the struct does not effect on member functions, therefore all data members are public.
struct essence struct essence
{ {
enum class item_state{normal, highlighted, pressed, grabbed, floated}; enum class item_state{normal, highlighted, pressed, grabbed, floated};
@ -2006,7 +2006,7 @@ namespace nana
::nana::listbox::export_options def_exp_options; ::nana::listbox::export_options def_exp_options;
es_header header; es_header header;
es_lister lister; // we have at least one emty cat. the #0 es_lister lister; // we have at least one empty cat. the #0
item_state ptr_state{ item_state::normal }; item_state ptr_state{ item_state::normal };
std::pair<parts, std::size_t> pointer_where; //The 'first' stands for which object, such as header and lister, 'second' stands for item std::pair<parts, std::size_t> pointer_where; //The 'first' stands for which object, such as header and lister, 'second' stands for item
@ -3114,7 +3114,7 @@ namespace nana
{ {
auto next_selected_dpl = index_cast_noexcept(latest_selected_abs, false); //convert absolute position to display position auto next_selected_dpl = index_cast_noexcept(latest_selected_abs, false); //convert absolute position to display position
if (next_selected_dpl.empty()) // has no cat ? (cat == npos) => beging from first cat if (next_selected_dpl.empty()) // has no cat ? (cat == npos) => begins from first cat
{ {
bool good = false; bool good = false;
for (size_type i = 0, size = categories_.size(); i < size; ++i) // run all cat for (size_type i = 0, size = categories_.size(); i < size; ++i) // run all cat
@ -3377,7 +3377,7 @@ namespace nana
auto text_color = essence_->scheme_ptr->header_fgcolor.get_color(); auto text_color = essence_->scheme_ptr->header_fgcolor.get_color();
auto state = item_state::normal; auto state = item_state::normal;
//check whether grabing an item, if item_spliter_ != npos, that indicates the grab item is a spliter. //check whether grabbing an item, if item_spliter_ != npos, that indicates the grabbed item is a splitter.
if ((parts::header == essence_->pointer_where.first) && (npos == grabs_.splitter)) if ((parts::header == essence_->pointer_where.first) && (npos == grabs_.splitter))
state = essence_->ptr_state; state = essence_->ptr_state;
@ -3651,7 +3651,7 @@ namespace nana
// The first display is empty when the listbox is empty. // The first display is empty when the listbox is empty.
if (!first_disp.empty()) if (!first_disp.empty())
{ {
index_pair hoverred_pos(npos, npos); //the hoverred item. index_pair hoverred_pos(npos, npos); //the hovered item.
//if where == lister || where == checker, 'second' indicates the offset to the relative display-order pos of the scroll offset_y which stands for the first item to be displayed in lister. //if where == lister || where == checker, 'second' indicates the offset to the relative display-order pos of the scroll offset_y which stands for the first item to be displayed in lister.
if ((ptr_where.first == parts::list || ptr_where.first == parts::checker) && ptr_where.second != npos) if ((ptr_where.first == parts::list || ptr_where.first == parts::checker) && ptr_where.second != npos)
@ -3879,7 +3879,7 @@ namespace nana
for (size_type display_order{ 0 }; display_order < seqs.size(); ++display_order) // get the cell (column) index in the order headers are displayed for (size_type display_order{ 0 }; display_order < seqs.size(); ++display_order) // get the cell (column) index in the order headers are displayed
{ {
const auto column_pos = seqs[display_order]; const auto column_pos = seqs[display_order];
const auto & col = essence_->header.at(column_pos); // deduce the corresponding header which is in a kind of dislay order const auto & col = essence_->header.at(column_pos); // deduce the corresponding header which is in a kind of display order
if (col.width_px > essence_->scheme_ptr->text_margin) if (col.width_px > essence_->scheme_ptr->text_margin)
{ {
@ -4724,7 +4724,7 @@ namespace nana
cat_ = &(*ess->lister.get(pos.cat)); cat_ = &(*ess->lister.get(pos.cat));
} }
/// the main porpose of this it to make obvious that item_proxy operate with absolute positions, and dont get moved during sort() /// the main purpose of this it to make obvious that item_proxy operate with absolute positions, and don't get moved during sort()
item_proxy item_proxy::from_display(essence *ess, const index_pair &relative) item_proxy item_proxy::from_display(essence *ess, const index_pair &relative)
{ {
return item_proxy{ ess, ess->lister.index_cast(relative, true) }; return item_proxy{ ess, ess->lister.index_cast(relative, true) };
@ -4735,7 +4735,7 @@ namespace nana
return item_proxy{ess_, ess_->lister.index_cast(relative, true)}; return item_proxy{ess_, ess_->lister.index_cast(relative, true)};
} }
/// posible use: last_selected_display = last_selected.to_display().item; use with caution, it get invalidated after a sort() /// possible use: last_selected_display = last_selected.to_display().item; use with caution, it get invalidated after a sort()
index_pair item_proxy::to_display() const index_pair item_proxy::to_display() const
{ {
return ess_->lister.index_cast(pos_, false); //convert absolute position to display position return ess_->lister.index_cast(pos_, false); //convert absolute position to display position
@ -5811,7 +5811,7 @@ namespace nana
auto & ess = _m_ess(); auto & ess = _m_ess();
ess.lister.clear(); ess.lister.clear();
unsort(); // apperar to be espected unsort(); // appear to be expected
ess.calc_content_size(false); ess.calc_content_size(false);
ess.content_view->change_position(0, false, false); ess.content_view->change_position(0, false, false);
@ -5946,7 +5946,7 @@ namespace nana
_m_ess().header.at(col).weak_ordering = std::move(strick_ordering); _m_ess().header.at(col).weak_ordering = std::move(strick_ordering);
} }
/// sort() and ivalidate any existing reference from display position to absolute item, that is: after sort() display offset point to different items /// sort() and invalidates any existing reference from display position to absolute item, that is: after sort() display offset point to different items
void listbox::sort_col(size_type col, bool reverse) void listbox::sort_col(size_type col, bool reverse)
{ {
internal_scope_guard lock; internal_scope_guard lock;
@ -5959,7 +5959,7 @@ namespace nana
return _m_ess().lister.sort_attrs().column; return _m_ess().lister.sort_attrs().column;
} }
/// potencially ivalidate any existing reference from display position to absolute item, that is: after sort() display offset point to different items /// potentially invalidates any existing reference from display position to absolute item, that is: after sort() display offset point to different items
void listbox::unsort() void listbox::unsort()
{ {
internal_scope_guard lock; internal_scope_guard lock;

View File

@ -84,7 +84,7 @@ namespace nana
crook_.check(facade<element::crook>::state::checked); crook_.check(facade<element::crook>::state::checked);
} }
private: private:
//Impelement renderer_interface //Implements renderer_interface
void background(graph_reference graph, window) void background(graph_reference graph, window)
{ {
nana::size sz = graph.size(); nana::size sz = graph.size();
@ -133,7 +133,7 @@ namespace nana
return; return;
} }
//Stretchs menu icon only when it doesn't fit, center it otherwise. //Stretches menu icon only when it doesn't fit, center it otherwise.
//Contributed by kmribti(pr#102) //Contributed by kmribti(pr#102)
img.paste(graph, { img.paste(graph, {
pos.x + static_cast<int>(image_px - img.size().width) / 2, pos.x + static_cast<int>(image_px - img.size().width) / 2,
@ -740,7 +740,7 @@ namespace nana
struct widget_detail struct widget_detail
{ {
nana::point monitor_pos; //It is used for determinating the monitor. nana::point monitor_pos; //It is used for determining the monitor.
nana::upoint border; nana::upoint border;
}detail_; }detail_;
};//end class menu_drawer };//end class menu_drawer
@ -927,7 +927,7 @@ namespace nana
this->_m_close_all(); //means deleting this; this->_m_close_all(); //means deleting this;
//The deleting operation has moved here, because item.event_handler.operator()(ip) //The deleting operation has moved here, because item.event_handler.operator()(ip)
//may create a window, which make a killing focus for menu window, if so the close_all //may create a window, which make a killing focus for menu window, if so the close_all
//operation preformences after item.event_handler.operator()(ip), that would be deleting this object twice! //operation performs after item.event_handler.operator()(ip), that would be deleting this object twice!
if (item.event_handler) if (item.event_handler)
{ {

View File

@ -36,7 +36,7 @@ namespace nana
shortkey_pos(shortkey_pos) shortkey_pos(shortkey_pos)
{} {}
std::string text; ///< Transformed text, the shortkey charactor has been proccessed. std::string text; ///< Transformed text, the shortkey character has been processed.
wchar_t shortkey; wchar_t shortkey;
std::size_t shortkey_pos; std::size_t shortkey_pos;
::nana::menu menu_obj; ::nana::menu menu_obj;

View File

@ -277,7 +277,7 @@ namespace nana {
else else
{ {
cv_scroll->horz.close(); cv_scroll->horz.close();
//If horz is allowed, it indicates the horzontal origin is not moved //If horz is allowed, it indicates the horizontal origin is not moved
//Make sure the x origin is zero //Make sure the x origin is zero
if (horz_allowed) if (horz_allowed)
origin.x = 0; origin.x = 0;

View File

@ -1018,7 +1018,7 @@ namespace nana {
for (++i; i != entities.end(); ) for (++i; i != entities.end(); )
{ {
if (bound > i->begin) if (bound > i->begin)
i = entities.erase(i); // erase overlaping. Left only the first. i = entities.erase(i); // erase overlapping. Left only the first.
else else
++i; ++i;
} }
@ -2363,7 +2363,7 @@ namespace nana {
//The number of text lines //The number of text lines
auto const line_count = textbase().lines(); auto const line_count = textbase().lines();
//The number of charecters in the line of caret //The number of characters in the line of caret
auto const text_length = textbase().getline(points_.caret.y).size(); auto const text_length = textbase().getline(points_.caret.y).size();
switch (key) { switch (key) {
@ -2403,10 +2403,10 @@ namespace nana {
coord.y += static_cast<int>(line_px); coord.y += static_cast<int>(line_px);
break; break;
case keyboard::os_home: case keyboard::os_home:
//move the caret to the begining of the line //move the caret to the beginning of the line
pos.x = 0; pos.x = 0;
//move the caret to the begining of the text if Ctrl is pressed //move the caret to the beginning of the text if Ctrl is pressed
if (arg.ctrl) if (arg.ctrl)
pos.y = 0; pos.y = 0;
break; break;
@ -2415,7 +2415,7 @@ namespace nana {
//move the caret to the end of the text if Ctrl is pressed //move the caret to the end of the text if Ctrl is pressed
if (arg.ctrl) { if (arg.ctrl) {
coord.y = static_cast<unsigned>((line_count - 1) * line_px); coord.y = static_cast<unsigned>((line_count - 1) * line_px);
//The number of charecters of the bottom line //The number of characters of the bottom line
auto const text_length = textbase().getline(std::max<size_t>(0, line_count - 1)).size(); auto const text_length = textbase().getline(std::max<size_t>(0, line_count - 1)).size();
//move the caret to the end of the line //move the caret to the end of the line
pos.x = static_cast<decltype(pos.x)>(text_length); pos.x = static_cast<decltype(pos.x)>(text_length);
@ -3385,7 +3385,7 @@ namespace nana {
std::wstring_view ent_sv; std::wstring_view ent_sv;
if (rtl) if (rtl)
{ {
//draw the whole text if it is a RTL text, because Arbic language is transformable. //draw the whole text if it is a RTL text, because Arabic language is transformable.
ent_sv = { str, len }; ent_sv = { str, len };
} }
else else
@ -3397,7 +3397,7 @@ namespace nana {
#else #else
if (rtl) if (rtl)
{ {
//draw the whole text if it is a RTL text, because Arbic language is transformable. //draw the whole text if it is a RTL text, because Arabic language is transformable.
canvas.string({}, str, len); canvas.string({}, str, len);
} }
else else

View File

@ -748,7 +748,7 @@ namespace nana
} }
return false; return false;
} }
private: //Fundation private: //Foundation
bool _m_nextable() const bool _m_nextable() const
{ {
return (basis_.scroll_pixels + _m_itembar_right() < basis_.item_pixels * list_.size()); return (basis_.scroll_pixels + _m_itembar_right() < basis_.item_pixels * list_.size());

View File

@ -46,7 +46,7 @@ namespace drawerbase {
} }
//end class event_agent //end class event_agent
//class draweer //class drawer
drawer::drawer() drawer::drawer()
: widget_(nullptr), editor_(nullptr) : widget_(nullptr), editor_(nullptr)
{ {
@ -278,8 +278,8 @@ namespace drawerbase {
return{}; return{};
} }
/// Enables/disables the textbox to indent a line. Idents a new line when it is created by pressing enter. /// Enables/disables the textbox to indent a line. Indents a new line when it is created by pressing enter.
/// @param generator generates text for identing a line. If it is empty, textbox indents the line according to last line. /// @param generator generates text for indenting a line. If it is empty, textbox indents the line according to last line.
textbox& textbox::indention(bool enb, std::function<std::string()> generator) textbox& textbox::indention(bool enb, std::function<std::string()> generator)
{ {
internal_scope_guard lock; internal_scope_guard lock;
@ -474,7 +474,7 @@ namespace drawerbase {
} }
return *this; return *this;
} }
/// Determine wheter the text is auto-line changed. /// Determine whether the text is auto-line changed.
bool textbox::line_wrapped() const bool textbox::line_wrapped() const
{ {
internal_scope_guard lock; internal_scope_guard lock;

View File

@ -342,7 +342,7 @@ namespace nana
struct adjust_tag struct adjust_tag
{ {
int offset_x_adjust; //It is a new value of offset_x, and offset_x will be djusted to the new value int offset_x_adjust; //It is a new value of offset_x, and offset_x will be adjusted to the new value
tree_cont_type::node_type * node; tree_cont_type::node_type * node;
std::size_t scroll_timestamp; std::size_t scroll_timestamp;
nana::timer timer; nana::timer timer;
@ -1062,7 +1062,7 @@ namespace nana
item_proxy::item_proxy(trigger* trg, trigger::node_type* node) item_proxy::item_proxy(trigger* trg, trigger::node_type* node)
: trigger_(trg), node_(node) : trigger_(trg), node_(node)
{ {
//Make it an end itertor if one of them is a nullptr //Make it an end iterator if one of them is a nullptr
if(nullptr == trg || nullptr == node) if(nullptr == trg || nullptr == node)
{ {
trigger_ = nullptr; trigger_ = nullptr;
@ -1320,7 +1320,7 @@ namespace nana
return node_->value.second.value; return node_->value.second.value;
} }
//Undocumentated methods for internal use. //Undocumented methods for internal use.
trigger::node_type * item_proxy::_m_node() const trigger::node_type * item_proxy::_m_node() const
{ {
return node_; return node_;
@ -1927,7 +1927,7 @@ namespace nana
void trigger::detached() void trigger::detached()
{ {
//Reset the comp_placer, because after deteching, the scheme refered by comp_placer will be released //Reset the comp_placer, because after detaching, the scheme referred by comp_placer will be released
impl_->data.comp_placer.reset(); impl_->data.comp_placer.reset();
impl_->data.graph = nullptr; impl_->data.graph = nullptr;
} }

View File

@ -65,7 +65,7 @@ namespace nana
void exec( void exec(
unsigned wait, // = 1, ///< for the GUI to be constructed, in seconds unsigned wait, // = 1, ///< for the GUI to be constructed, in seconds
unsigned wait_end, // = 1, ///< for the GUI to be destructed, in seconds unsigned wait_end, // = 1, ///< for the GUI to be destructed, in seconds
std::function<void()>f // = {} ///< emit events to mimics user actions and may asert results std::function<void()>f // = {} ///< emit events to mimics user actions and may assert results
) )
{ {

View File

@ -520,7 +520,7 @@ namespace nana
args_.emplace_back(arg->clone()); args_.emplace_back(arg->clone());
} }
//Workaround for VC2013, becuase it can't specified a default explicit move-constructor //Workaround for VC2013, because it can't specify a default explicit move-constructor
i18n_eval::i18n_eval(i18n_eval&& other) i18n_eval::i18n_eval(i18n_eval&& other)
: msgid_(std::move(other.msgid_)), args_(std::move(other.args_)) : msgid_(std::move(other.msgid_)), args_(std::move(other.args_))
{ {

View File

@ -18,8 +18,8 @@ namespace paint
image_process_provider::image_process_provider() image_process_provider::image_process_provider()
{ {
add<paint::detail::algorithms::bilinear_interoplation>(stretch_, "bilinear interoplation"); add<paint::detail::algorithms::bilinear_interoplation>(stretch_, "bilinear interpolation");
add<paint::detail::algorithms::proximal_interoplation>(stretch_, "proximal interoplation"); add<paint::detail::algorithms::proximal_interoplation>(stretch_, "proximal interpolation");
add<paint::detail::algorithms::alpha_blend>(alpha_blend_, "alpha_blend"); add<paint::detail::algorithms::alpha_blend>(alpha_blend_, "alpha_blend");
add<paint::detail::algorithms::blend>(blend_, "blend"); add<paint::detail::algorithms::blend>(blend_, "blend");
add<paint::detail::algorithms::bresenham_line>(line_, "bresenham_line"); add<paint::detail::algorithms::bresenham_line>(line_, "bresenham_line");

View File

@ -856,7 +856,7 @@ namespace paint
{ {
if(impl_->handle) if(impl_->handle)
{ {
//Create the color table for perfermance //Create the color table for performance
float* tablebuf = new float[0x100 * 3]; float* tablebuf = new float[0x100 * 3];
float* table_red = tablebuf; float* table_red = tablebuf;
float* table_green = tablebuf + 0x100; float* table_green = tablebuf + 0x100;

View File

@ -305,7 +305,7 @@ namespace nana{ namespace paint
} }
#if defined(NANA_X11) #if defined(NANA_X11)
//The implementation of attach in X11 is same with non-attach's, because the image buffer of drawable can't be refered indirectly //The implementation of attach in X11 is same with non-attach's, because the image buffer of drawable can't be referred indirectly
//so the pixel_buffer::open() method may call the attached version of pixel_buffer_storage construction. //so the pixel_buffer::open() method may call the attached version of pixel_buffer_storage construction.
void detach() void detach()
{ {
@ -371,7 +371,7 @@ namespace nana{ namespace paint
::XPutImage(disp, dw, gc, ::XPutImage(disp, dw, gc,
img, src_x, src_y, x, y, width, height); img, src_x, src_y, x, y, width, height);
} }
img->data = nullptr; //Set null pointer to avoid XDestroyImage destroyes the buffer. img->data = nullptr; //Set null pointer to avoid XDestroyImage destroys the buffer.
XDestroyImage(img); XDestroyImage(img);
} }
#endif #endif
@ -787,7 +787,7 @@ namespace nana{ namespace paint
auto sp = storage_.get(); auto sp = storage_.get();
if(nullptr == sp) return; if(nullptr == sp) return;
//Test if the line intersects the rectangle, and retrive the two points that //Test if the line intersects the rectangle, and retrieve the two points that
//are always in the area of rectangle, good_pos_beg is left point, good_pos_end is right. //are always in the area of rectangle, good_pos_beg is left point, good_pos_end is right.
nana::point good_pos_beg, good_pos_end; nana::point good_pos_beg, good_pos_end;
if(intersection(nana::rectangle(sp->pixel_size), pos_beg, pos_end, good_pos_beg, good_pos_end)) if(intersection(nana::rectangle(sp->pixel_size), pos_beg, pos_end, good_pos_beg, good_pos_end))

View File

@ -661,7 +661,7 @@ namespace nana
//W1. Examine each nonspacing mark, and change the type of the NSM to the type of the previous //W1. Examine each nonspacing mark, and change the type of the NSM to the type of the previous
//character. //character.
//W2. Search backward from each instance of a European number until the first strong type(R, L, AL, or sor) is found //W2. Search backward from each instance of a European number until the first strong type(R, L, AL, or sor) is found
//If an AL is found, change the type of the European Number to arbic number. //If an AL is found, change the type of the European Number to Arabic number.
//W3. Change all ALs to R. //W3. Change all ALs to R.
//The three phases could be combined as one process. Because these phases are standalone. //The three phases could be combined as one process. Because these phases are standalone.
@ -702,7 +702,7 @@ namespace nana
} }
//W4. A single european separator between two european numbers changes to a european number. //W4. A single European separator between two European numbers changes to a European number.
//A single common separator between two numbers of the same type changes to that type. //A single common separator between two numbers of the same type changes to that type.
// //
//W5. A sequence of European terminators adjacent to European numbers changes to all European numbers. //W5. A sequence of European terminators adjacent to European numbers changes to all European numbers.