fix typos
This commit is contained in:
@@ -180,7 +180,7 @@ namespace nana
|
||||
//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>::iterator this_frame;
|
||||
std::size_t pos_in_this_frame{ 0 };
|
||||
|
||||
@@ -401,7 +401,7 @@ namespace nana
|
||||
extra_width = extra_height = 0;
|
||||
|
||||
//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();
|
||||
if(agrparent && (thread_id != agrparent->thread_id))
|
||||
thread_id = agrparent->thread_id;
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace detail
|
||||
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::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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
//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);
|
||||
return true;
|
||||
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;
|
||||
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.
|
||||
//
|
||||
//pressed_wd will remains when opens a no-actived 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.
|
||||
//pressed_wd will remain when opens a non-activated window in an mouse_down event(like combox popups the drop-list).
|
||||
//After the non-activated window is closed, the window doesn't respond to the mouse click other than pressed_wd.
|
||||
pressed_wd = nullptr;
|
||||
if (nullptr == msgwnd)
|
||||
break;
|
||||
@@ -1330,7 +1330,7 @@ namespace detail
|
||||
msgwnd = msgwnd->root_widget->other.attribute.root->menubar;
|
||||
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;
|
||||
|
||||
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)
|
||||
{
|
||||
//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.
|
||||
//If no menu popuped by the menubar, it should enable delay restore to
|
||||
//when pressing ESC to close the menu which is pop-upped by the menubar.
|
||||
//If no menu pop-upped by the menubar, it should enable delay restore to
|
||||
//restore the focus for taken window.
|
||||
|
||||
int cmd = (menu_wd && (keyboard::escape == static_cast<wchar_t>(wParam)) ? 1 : 0);
|
||||
@@ -1522,7 +1522,7 @@ namespace detail
|
||||
if (!arg.cancel)
|
||||
{
|
||||
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)
|
||||
native_interface::activate_owner(msgwnd->root);
|
||||
}
|
||||
@@ -1532,7 +1532,7 @@ namespace detail
|
||||
if (msgwnd->root == brock.get_menu())
|
||||
{
|
||||
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);
|
||||
nana::detail::platform_spec::instance().release_window_icon(msgwnd->root);
|
||||
@@ -1578,7 +1578,7 @@ namespace detail
|
||||
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> ret;
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace nana{
|
||||
|
||||
|
||||
//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.
|
||||
std::map<Window, ::nana::point> exposed_positions; //locked by platform_scope_guard
|
||||
|
||||
@@ -498,7 +498,7 @@ namespace nana{
|
||||
{
|
||||
if(nullptr == parent) return nullptr;
|
||||
#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"Nana Child Window", // Title Text
|
||||
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);
|
||||
}
|
||||
#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
|
||||
//destroyed. This is a feature which is different from Windows. So the following
|
||||
//works should be handled before calling XDestroyWindow.
|
||||
@@ -711,7 +711,7 @@ namespace nana{
|
||||
if(wd == brock.get_menu())
|
||||
{
|
||||
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();
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace nana
|
||||
//read_visual_rectangle
|
||||
///@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 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)
|
||||
{
|
||||
if (! wd->displayed()) return false;
|
||||
|
||||
@@ -511,7 +511,7 @@ namespace detail
|
||||
if (impl_->wd_register.available(owner))
|
||||
{
|
||||
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;
|
||||
r.x += owner->pos_root.x;
|
||||
@@ -592,7 +592,7 @@ namespace detail
|
||||
brock.emit(event_code::unload, wd, arg, true, brock.get_thread_context());
|
||||
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.
|
||||
if(wd->flags.modal || (wd->owner == nullptr) || wd->owner->flags.take_active)
|
||||
native_interface::activate_owner(wd->root);
|
||||
@@ -601,7 +601,7 @@ namespace detail
|
||||
{
|
||||
//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
|
||||
//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!
|
||||
wd->drawer.detached();
|
||||
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 root_graph;
|
||||
if (category::flags::lite_widget != wd->other.category)
|
||||
@@ -1191,7 +1191,7 @@ namespace detail
|
||||
//A fix by Katsuhisa Yuasa
|
||||
//The menubar token window will be redirected to the prev focus window when the new
|
||||
//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.
|
||||
if (prev_focus && (wd == wd->root_widget->other.attribute.root->menubar))
|
||||
wd = prev_focus;
|
||||
@@ -1302,7 +1302,7 @@ namespace detail
|
||||
|
||||
//enable_tabstop
|
||||
//@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 container is created while a first Tab Window is setting
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
||||
|
||||
@@ -1239,7 +1239,7 @@ namespace nana
|
||||
if(!child.empty())
|
||||
{
|
||||
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;
|
||||
//in C++17
|
||||
try
|
||||
|
||||
@@ -745,7 +745,7 @@ namespace nana
|
||||
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(){}
|
||||
|
||||
int inputbox::integer::value() const
|
||||
@@ -828,7 +828,7 @@ namespace nana
|
||||
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(){}
|
||||
|
||||
double inputbox::real::value() const
|
||||
@@ -920,7 +920,7 @@ namespace nana
|
||||
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(){}
|
||||
|
||||
void inputbox::text::tip_string(std::wstring tip)
|
||||
@@ -1041,7 +1041,7 @@ namespace nana
|
||||
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(){}
|
||||
|
||||
::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(){}
|
||||
|
||||
::std::string inputbox::path::value() const
|
||||
|
||||
@@ -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()
|
||||
//shouldn't break the visibility of panels that are maintained by tabbar.
|
||||
field.second->visible(is_show, false);
|
||||
@@ -2903,14 +2903,14 @@ namespace nana
|
||||
token unmatch = token::width;
|
||||
switch (div_type)
|
||||
{
|
||||
case token::eof: // "horitontal" div
|
||||
case token::eof: // "horizontal" div
|
||||
case token::vert: // "vertical" div
|
||||
if(token::eof == div_type)
|
||||
unmatch = token::height;
|
||||
|
||||
for (auto& ch : children)
|
||||
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);
|
||||
|
||||
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
|
||||
{
|
||||
//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.
|
||||
std::map<std::string, field_gather*> unique;
|
||||
field_gather tmp(nullptr);
|
||||
@@ -3198,7 +3198,7 @@ namespace nana
|
||||
try
|
||||
{
|
||||
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_->div_text.swap(div_text);
|
||||
}
|
||||
@@ -3322,7 +3322,7 @@ namespace nana
|
||||
if (div)
|
||||
{
|
||||
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;
|
||||
p->attached = div;
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace API
|
||||
iwd->drawer.graphics.make(iwd->dimension);
|
||||
iwd->drawer.graphics.rectangle(true, iwd->annex.scheme->background.get_color());
|
||||
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
|
||||
//@brief: This function searchs 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
|
||||
//@brief: This function searches whether the text contains a '&' and removes the character for transforming.
|
||||
// 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.
|
||||
//@param, text: the text is transformed.
|
||||
//@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)
|
||||
{
|
||||
shortkey = 0;
|
||||
@@ -1057,7 +1057,7 @@ namespace API
|
||||
else
|
||||
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.
|
||||
restrict::bedrock.pump_event(wd, true);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* @file: nana/gui/timer.hpp
|
||||
* @description:
|
||||
* 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.
|
||||
* @contributors: Benjamin Navarro(pr#81)
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace nana
|
||||
void exec(
|
||||
unsigned wait, // = 1, ///< for the GUI to be constructed, 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
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user