diff --git a/include/nana/gui/widgets/scroll.hpp b/include/nana/gui/widgets/scroll.hpp index f06ef8e0..81bc0a60 100644 --- a/include/nana/gui/widgets/scroll.hpp +++ b/include/nana/gui/widgets/scroll.hpp @@ -502,7 +502,7 @@ namespace nana bool make_page_scroll(bool forward) { auto const count = range() / step(); - return this->make_step(forward, (count > 2 ? count - 1 : 1)); + return this->make_step(forward, static_cast(count > 2 ? count - 1 : 1)); } };//end class scroll }//end namespace nana diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 1101fbb8..9d57de66 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -1934,10 +1934,10 @@ namespace nana nana::listbox * widget_{nullptr}; sort_attributes sort_attrs_; //Attributes of sort + container categories_; bool ordered_categories_{false}; ///< A switch indicates whether the categories are ordered. /// The ordered categories always creates a new category at a proper position(before the first one which is larger than it). - container categories_; bool single_selection_{ false }; bool single_selection_category_limited_{ false }; @@ -2049,7 +2049,7 @@ namespace nana index_pair first_display() const noexcept { auto offset_display = content_view->origin().y / item_height(); - return lister.advance(lister.first(), offset_display); + return lister.advance(lister.first(), static_cast(content_view->origin().y / item_height())); } unsigned item_height() const noexcept @@ -4569,7 +4569,7 @@ namespace nana if (target_idx.empty()) target_idx = list.first(); - origin.y = list.distance(list.first(), target_idx) * item_px; + origin.y = static_cast(list.distance(list.first(), target_idx) * item_px); } else { @@ -4577,7 +4577,7 @@ namespace nana if (target_idx.empty()) target_idx = list.last(); - origin.y = list.distance(list.first(), target_idx) * item_px + item_px; + origin.y = static_cast((list.distance(list.first(), target_idx) + 1) * item_px); if (origin.y >= static_cast(screen_bottom - screen_top)) origin.y -= static_cast(screen_bottom - screen_top); else