fix typos
This commit is contained in:
@@ -446,7 +446,7 @@ namespace nana
|
||||
{
|
||||
r.width = i->value.second.pixels;
|
||||
//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)
|
||||
{
|
||||
r.x = xbase;
|
||||
@@ -573,7 +573,7 @@ namespace nana
|
||||
|
||||
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_.state = mouse_action::normal;
|
||||
|
||||
@@ -646,7 +646,7 @@ namespace nana
|
||||
}
|
||||
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.width -= 16;
|
||||
return r;
|
||||
@@ -918,5 +918,5 @@ namespace nana
|
||||
}
|
||||
//end class trigger
|
||||
}//end namespace categorize
|
||||
}//end namespace draerbase
|
||||
}//end namespace drawerbase
|
||||
}//end namespace nana
|
||||
|
||||
@@ -293,7 +293,7 @@ namespace nana
|
||||
|
||||
//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 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 = nullptr; //The lister closes by itself.
|
||||
|
||||
@@ -532,7 +532,7 @@ namespace nana
|
||||
perf_transform_helper(window_handle, transf, graph, dirtybuf, gbuf, refpos);
|
||||
}
|
||||
private:
|
||||
//renderring functions
|
||||
//rendering functions
|
||||
|
||||
void _m_calc_basis(graph_reference graph, const nana::point& refpos)
|
||||
{
|
||||
|
||||
@@ -312,14 +312,14 @@ checkbox& group::add_option(std::string text)
|
||||
drawing dw(*this);
|
||||
|
||||
//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.
|
||||
//For the requirement, a move event handler is required for listning the change of caption's position.
|
||||
//the drawing of group requires the latest position of caption for gradual rectangle.
|
||||
//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&){
|
||||
if (align::left != impl_->caption_align)
|
||||
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)
|
||||
{
|
||||
auto gap_px = impl_->gap - 1;
|
||||
|
||||
@@ -376,7 +376,7 @@ namespace nana
|
||||
{
|
||||
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)
|
||||
{
|
||||
ascent = static_cast<unsigned>(data->ascent());
|
||||
@@ -420,7 +420,7 @@ namespace nana
|
||||
|
||||
text_pos = 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)
|
||||
{
|
||||
ascent = static_cast<unsigned>(data->ascent());
|
||||
|
||||
@@ -675,7 +675,7 @@ namespace nana
|
||||
else
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -842,7 +842,7 @@ namespace nana
|
||||
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()
|
||||
{
|
||||
if((npos == sort_attrs_.column) || (!sort_attrs_.resort))
|
||||
@@ -1554,7 +1554,7 @@ namespace nana
|
||||
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
|
||||
{
|
||||
//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 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
|
||||
{
|
||||
@@ -1989,7 +1989,7 @@ namespace nana
|
||||
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
|
||||
{
|
||||
enum class item_state{normal, highlighted, pressed, grabbed, floated};
|
||||
@@ -2006,7 +2006,7 @@ namespace nana
|
||||
::nana::listbox::export_options def_exp_options;
|
||||
|
||||
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 };
|
||||
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
|
||||
|
||||
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;
|
||||
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 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))
|
||||
state = essence_->ptr_state;
|
||||
|
||||
@@ -3651,7 +3651,7 @@ namespace nana
|
||||
// The first display is empty when the listbox is 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 ((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
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -4724,7 +4724,7 @@ namespace nana
|
||||
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)
|
||||
{
|
||||
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)};
|
||||
}
|
||||
|
||||
/// 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
|
||||
{
|
||||
return ess_->lister.index_cast(pos_, false); //convert absolute position to display position
|
||||
@@ -5811,7 +5811,7 @@ namespace nana
|
||||
auto & ess = _m_ess();
|
||||
|
||||
ess.lister.clear();
|
||||
unsort(); // apperar to be espected
|
||||
unsort(); // appear to be expected
|
||||
|
||||
ess.calc_content_size(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);
|
||||
}
|
||||
|
||||
/// 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)
|
||||
{
|
||||
internal_scope_guard lock;
|
||||
@@ -5959,7 +5959,7 @@ namespace nana
|
||||
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()
|
||||
{
|
||||
internal_scope_guard lock;
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace nana
|
||||
crook_.check(facade<element::crook>::state::checked);
|
||||
}
|
||||
private:
|
||||
//Impelement renderer_interface
|
||||
//Implements renderer_interface
|
||||
void background(graph_reference graph, window)
|
||||
{
|
||||
nana::size sz = graph.size();
|
||||
@@ -133,7 +133,7 @@ namespace nana
|
||||
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)
|
||||
img.paste(graph, {
|
||||
pos.x + static_cast<int>(image_px - img.size().width) / 2,
|
||||
@@ -740,7 +740,7 @@ namespace nana
|
||||
|
||||
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;
|
||||
}detail_;
|
||||
};//end class menu_drawer
|
||||
@@ -927,7 +927,7 @@ namespace nana
|
||||
this->_m_close_all(); //means deleting this;
|
||||
//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
|
||||
//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)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace nana
|
||||
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;
|
||||
std::size_t shortkey_pos;
|
||||
::nana::menu menu_obj;
|
||||
|
||||
@@ -277,7 +277,7 @@ namespace nana {
|
||||
else
|
||||
{
|
||||
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
|
||||
if (horz_allowed)
|
||||
origin.x = 0;
|
||||
|
||||
@@ -1018,7 +1018,7 @@ namespace nana {
|
||||
for (++i; i != entities.end(); )
|
||||
{
|
||||
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
|
||||
++i;
|
||||
}
|
||||
@@ -2363,7 +2363,7 @@ namespace nana {
|
||||
//The number of text 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();
|
||||
|
||||
switch (key) {
|
||||
@@ -2403,10 +2403,10 @@ namespace nana {
|
||||
coord.y += static_cast<int>(line_px);
|
||||
break;
|
||||
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;
|
||||
|
||||
//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)
|
||||
pos.y = 0;
|
||||
break;
|
||||
@@ -2415,7 +2415,7 @@ namespace nana {
|
||||
//move the caret to the end of the text if Ctrl is pressed
|
||||
if (arg.ctrl) {
|
||||
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();
|
||||
//move the caret to the end of the line
|
||||
pos.x = static_cast<decltype(pos.x)>(text_length);
|
||||
@@ -3385,7 +3385,7 @@ namespace nana {
|
||||
std::wstring_view ent_sv;
|
||||
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 };
|
||||
}
|
||||
else
|
||||
@@ -3397,7 +3397,7 @@ namespace nana {
|
||||
#else
|
||||
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);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -748,7 +748,7 @@ namespace nana
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private: //Fundation
|
||||
private: //Foundation
|
||||
bool _m_nextable() const
|
||||
{
|
||||
return (basis_.scroll_pixels + _m_itembar_right() < basis_.item_pixels * list_.size());
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace drawerbase {
|
||||
}
|
||||
//end class event_agent
|
||||
|
||||
//class draweer
|
||||
//class drawer
|
||||
drawer::drawer()
|
||||
: widget_(nullptr), editor_(nullptr)
|
||||
{
|
||||
@@ -278,8 +278,8 @@ namespace drawerbase {
|
||||
return{};
|
||||
}
|
||||
|
||||
/// Enables/disables the textbox to indent a line. Idents 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.
|
||||
/// Enables/disables the textbox to indent a line. Indents a new line when it is created by pressing enter.
|
||||
/// @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)
|
||||
{
|
||||
internal_scope_guard lock;
|
||||
@@ -474,7 +474,7 @@ namespace drawerbase {
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
/// Determine wheter the text is auto-line changed.
|
||||
/// Determine whether the text is auto-line changed.
|
||||
bool textbox::line_wrapped() const
|
||||
{
|
||||
internal_scope_guard lock;
|
||||
|
||||
@@ -342,7 +342,7 @@ namespace nana
|
||||
|
||||
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;
|
||||
std::size_t scroll_timestamp;
|
||||
nana::timer timer;
|
||||
@@ -1062,7 +1062,7 @@ namespace nana
|
||||
item_proxy::item_proxy(trigger* trg, trigger::node_type* 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)
|
||||
{
|
||||
trigger_ = nullptr;
|
||||
@@ -1320,7 +1320,7 @@ namespace nana
|
||||
return node_->value.second.value;
|
||||
}
|
||||
|
||||
//Undocumentated methods for internal use.
|
||||
//Undocumented methods for internal use.
|
||||
trigger::node_type * item_proxy::_m_node() const
|
||||
{
|
||||
return node_;
|
||||
@@ -1927,7 +1927,7 @@ namespace nana
|
||||
|
||||
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.graph = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user