From 5779b979f7e71b25969d18f31426189ce9355cfe Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sat, 26 Mar 2016 16:32:45 +0100 Subject: [PATCH] implement some geometrical parameters ?? --- include/nana/gui/widgets/listbox.hpp | 14 ++++++++++++-- source/gui/widgets/listbox.cpp | 11 ++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/include/nana/gui/widgets/listbox.hpp b/include/nana/gui/widgets/listbox.hpp index 82e9abb1..cfad6214 100644 --- a/include/nana/gui/widgets/listbox.hpp +++ b/include/nana/gui/widgets/listbox.hpp @@ -529,8 +529,18 @@ namespace nana color_proxy header_floated{ static_cast(0xBABBBC)}; color_proxy item_selected{ static_cast(0xD5EFFC) }; - unsigned max_header_width{3000}, /// \todo how to implement some geometrical parameters ?? - ext_w = 5; + /// \todo how to implement some geometrical parameters ?? + unsigned max_header_width{ 3000 }; ///< during auto width don't alow more than this + unsigned min_header_width{ 20 }; ///< non counting suspension_width + unsigned suspension_width{ 0 }; ///< the trigger will set this to the width if ("...") + unsigned ext_w { 5 }; ///< ?? + unsigned header_height { 20 }; ///< header height header_size + unsigned text_height { 0 }; ///< the trigger will set this to the height of the text font + unsigned item_height_ex { 6 }; ///< 6? item_height = text_height + item_height_ex + unsigned item_height { 0 }; ///< the trigger will set this TO item_height = text_height + item_height_ex + unsigned header_mouse_spliter_area_before{ 2 }; + unsigned header_mouse_spliter_area_after { 3 }; + }; } }//end namespace drawerbase diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 9604ac24..a0d30cdd 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -1858,7 +1858,7 @@ namespace nana struct scroll_part { - static const unsigned scale = 16; + static const unsigned scale = 16; // ? int offset_x; index_pair offset_y_abs, offset_y_dpl; //cat stands for category, item stands for item. "item == npos" means that is a category. // need to be abs??? to see the same item after sort() ?? @@ -1982,8 +1982,9 @@ namespace nana void trace_item_abs( index_pair abs_pos ) { - if(abs_pos.item == npos && abs_pos.cat == scroll.offset_y_abs.cat - && scroll.offset_y_abs.item == npos ) // if item==off y and is a cat + if( abs_pos.item == npos + && abs_pos.cat == scroll.offset_y_abs.cat + && scroll.offset_y_abs.item == npos ) // if item==off y and is a cat return; trace_item_dpl( lister.relative_pair(abs_pos)) ; // ??? scroll_y_dpl_refresh() ; @@ -2680,8 +2681,8 @@ namespace nana } //grab_move - //@brief: draw when an item is grabbing. - //@return: 0 = no graphics changed, 1 = just update, 2 = refresh + /// @brief draw when an item is grabbing. + /// @return 0 = no graphics changed, 1 = just update, 2 = refresh int grab_move(const nana::rectangle& rect, const nana::point& pos) { if(item_spliter_ == npos)