From d13677f703988023df7e7d16d2723106a394febb Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 12 Apr 2015 23:45:02 +0200 Subject: [PATCH 1/3] add empty group files --- build/vc2013/nana.vcxproj | 123 +++++++++ build/vc2013/nana.vcxproj.filters | 410 +++++++++++++++++++++++++++++ include/nana/gui/widgets/group.hpp | 37 +++ source/gui/widgets/group.cpp | 25 ++ 4 files changed, 595 insertions(+) create mode 100644 include/nana/gui/widgets/group.hpp create mode 100644 source/gui/widgets/group.cpp diff --git a/build/vc2013/nana.vcxproj b/build/vc2013/nana.vcxproj index 7e216758..62b7f037 100644 --- a/build/vc2013/nana.vcxproj +++ b/build/vc2013/nana.vcxproj @@ -213,6 +213,7 @@ + @@ -247,6 +248,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/vc2013/nana.vcxproj.filters b/build/vc2013/nana.vcxproj.filters index f0f82981..d04ac84d 100644 --- a/build/vc2013/nana.vcxproj.filters +++ b/build/vc2013/nana.vcxproj.filters @@ -58,6 +58,51 @@ {e95b4a72-643f-4416-af95-b0bbaf7f0c57} + + {d421a05b-b868-4c3d-bdac-ff57d09f8d07} + + + {64c22f90-dce2-40dc-be98-edc9fe8951e8} + + + {91301ff5-79ac-40cc-a6db-bca2097ea763} + + + {81c62a28-ef5f-43f7-a6ce-e6c186cb411a} + + + {4a1db6f0-a4ee-4514-8e89-54ef9d52e3b8} + + + {c92e890a-ffd5-4efd-8b37-78ed9bbea1e1} + + + {63401f37-26a3-423e-87e6-6840344c3056} + + + {61385c08-f06b-4cf3-8e05-9b47d546164b} + + + {e9eadc97-4a14-4a4e-bb52-52d3a20e2693} + + + {5667eac1-0887-4936-9502-eac4dd8c1c1d} + + + {e6c4a4d9-b4b5-4c56-bb2a-486f3f777ecb} + + + {ac132633-f80c-4983-8e47-fa7fc17f666e} + + + {ee3e9e63-7221-409e-9659-25864e576e16} + + + {ef87057b-dff2-40aa-a05e-9dcd0b335c30} + + + {8ea232cf-bd7c-47e3-a694-6a8898b677d7} + @@ -300,5 +345,370 @@ Source Files\nana\gui\widgets + + Source Files\nana\gui\widgets + + + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\widgets + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui\detail + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui\widgets\detail + + + Header Files\gui\widgets\detail + + + Header Files\gui\widgets\skeletons + + + Header Files\gui\widgets\skeletons + + + Header Files\gui\widgets\skeletons + + + Header Files\gui\widgets\skeletons + + + Header Files\gui\widgets\skeletons + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files\detail\linux_X11 + + + Header Files\detail\linux_X11 + + + Header Files\detail\linux_X11 + + + Header Files\detail\win32 + + + Header Files\extrlib + + + Header Files\extrlib + + + Header Files\extrlib + + + Header Files\extrlib + + + Header Files\filesystem + + + Header Files\filesystem + + + Header Files\paint + + + Header Files\paint + + + Header Files\paint + + + Header Files\paint + + + Header Files\paint + + + Header Files\paint + + + Header Files\paint + + + Header Files\paint\detail + + + Header Files\paint\detail + + + Header Files\paint\detail + + + Header Files\paint\detail + + + Header Files\paint\detail + + + Header Files\paint\detail + + + Header Files\paint\detail + + + Header Files\pat + + + Header Files\system + + + Header Files\system + + + Header Files\system + + + Header Files\system + + + Header Files\threads + + + Header Files\gui\widgets + \ No newline at end of file diff --git a/include/nana/gui/widgets/group.hpp b/include/nana/gui/widgets/group.hpp new file mode 100644 index 00000000..d876becb --- /dev/null +++ b/include/nana/gui/widgets/group.hpp @@ -0,0 +1,37 @@ +/** + * A group widget implementation + * Nana C++ Library(http://www.nanaro.org) + * Copyright(C) 2015 Jinhao(cnjinhao@hotmail.com) + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * @file: nana/gui/widgets/group.hpp + * + * @contributors: Stefan Pfeifer (st-321), Jinhao, Ariel Vina-Rodriguez (qPCR4vir) + * + * @brief group is a widget used to visually group and layout other widgets. + */ + +#ifndef NANA_GUI_WIDGETS_GROUP_HPP +#define NANA_GUI_WIDGETS_GROUP_HPP + +#include +#include +#include +#include +#include + +namespace nana{ + class group + : public panel + { + + + }; + + + +}//end namespace nana +#endif diff --git a/source/gui/widgets/group.cpp b/source/gui/widgets/group.cpp new file mode 100644 index 00000000..e0958124 --- /dev/null +++ b/source/gui/widgets/group.cpp @@ -0,0 +1,25 @@ +/** + * A group widget implementation + * Nana C++ Library(http://www.nanaro.org) + * Copyright(C) 2015 Jinhao(cnjinhao@hotmail.com) + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * @file: nana/gui/widgets/group.cpp + * + * @contributors: Stefan Pfeifer (st-321), Jinhao, Ariel Vina-Rodriguez (qPCR4vir) + * + * @brief group is a widget used to visually group and layout other widgets. + */ + + +#include + +namespace nana{ + + + +}//end namespace nana + From ae2a2aeec4a8fa271236f2e3e0fe7c89b68e3b47 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Mon, 13 Apr 2015 01:59:30 +0200 Subject: [PATCH 2/3] group with internal panel and place Non tested --- include/nana/gui/widgets/group.hpp | 18 +++++++++++---- source/gui/widgets/group.cpp | 35 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/include/nana/gui/widgets/group.hpp b/include/nana/gui/widgets/group.hpp index d876becb..6cd15af1 100644 --- a/include/nana/gui/widgets/group.hpp +++ b/include/nana/gui/widgets/group.hpp @@ -27,11 +27,21 @@ namespace nana{ class group : public panel { - - + place plc_outer{*this}; + panel content {*this}; + label titel/* {*this}*/; + place plc_inner{content}; + unsigned int gap; + public: + group( widget &owner, ///< + string titel_ ={}, ///< + bool format =false, ///< Use a formated label? + unsigned gap =2, ///< betwen the content and the external limit + rectangle r ={} ///< + ); + place& plc (){ return plc_inner; } + window inner(){ return content; } }; - - }//end namespace nana #endif diff --git a/source/gui/widgets/group.cpp b/source/gui/widgets/group.cpp index e0958124..d613b63d 100644 --- a/source/gui/widgets/group.cpp +++ b/source/gui/widgets/group.cpp @@ -18,8 +18,43 @@ #include namespace nana{ + group::group( widget &owner, ///< + string titel_ /*={}*/, ///< + bool format /*=false*/, ///< + unsigned gap /*=2*/, ///< + rectangle r /*={} */ ///< + ) + : panel (owner, r), + titel (*this, titel_) + { + titel.format(format); + ::nana::size sz = titel.measure(1000); + std::stringstream ft; + ft << "vertical margin=[0," << gap << "," << gap << "," << gap << "]" + << " >" + << " "; + plc_outer.div(ft.str().c_str()); + plc_outer["titel" ] << titel; + plc_outer["content"] << content; + plc_outer.collocate(); + + color obg = owner.bgcolor(); + titel.bgcolor(obg.blend(colors::black, 0.975) ); + color bg=obg.blend(colors::black, 0.950 ); + bgcolor(bg); + + drawing dw(*this); + dw.draw([gap,sz,bg,obg](paint::graphics& graph) + { + graph.rectangle(true, obg); + graph.round_rectangle(rectangle( point ( gap-1 , sz.height/2 ), + nana::size (graph.width()-2*(gap-1), graph.height()-sz.height/2-(gap-1)) + ), + 3,3, colors::gray_border, true, bg); + }); + } }//end namespace nana From 73e5d3fd8f233700028c4e387012673f26b61cfb Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Mon, 13 Apr 2015 10:53:20 +0200 Subject: [PATCH 3/3] refine group --- include/nana/gui/widgets/group.hpp | 5 +++-- source/gui/widgets/group.cpp | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/include/nana/gui/widgets/group.hpp b/include/nana/gui/widgets/group.hpp index 6cd15af1..19cb6dce 100644 --- a/include/nana/gui/widgets/group.hpp +++ b/include/nana/gui/widgets/group.hpp @@ -33,14 +33,15 @@ namespace nana{ place plc_inner{content}; unsigned int gap; public: - group( widget &owner, ///< - string titel_ ={}, ///< + group( window parent, ///< + string titel_ ={STR("")}, ///< bool format =false, ///< Use a formated label? unsigned gap =2, ///< betwen the content and the external limit rectangle r ={} ///< ); place& plc (){ return plc_inner; } window inner(){ return content; } + label& lbl (){ return titel; } }; }//end namespace nana diff --git a/source/gui/widgets/group.cpp b/source/gui/widgets/group.cpp index d613b63d..b4905afe 100644 --- a/source/gui/widgets/group.cpp +++ b/source/gui/widgets/group.cpp @@ -18,13 +18,13 @@ #include namespace nana{ - group::group( widget &owner, ///< + group::group( window parent, ///< string titel_ /*={}*/, ///< bool format /*=false*/, ///< unsigned gap /*=2*/, ///< rectangle r /*={} */ ///< ) - : panel (owner, r), + : panel (parent, r), titel (*this, titel_) { titel.format(format); @@ -40,15 +40,18 @@ namespace nana{ plc_outer["content"] << content; plc_outer.collocate(); - color obg = owner.bgcolor(); - titel.bgcolor(obg.blend(colors::black, 0.975) ); - color bg=obg.blend(colors::black, 0.950 ); - bgcolor(bg); + color pbg = API::bgcolor( parent); + titel.bgcolor(pbg.blend(colors::black, 0.975) ); + color bg=pbg.blend(colors::black, 0.950 ); + bgcolor(pbg); + content.bgcolor(bg); drawing dw(*this); - dw.draw([gap,sz,bg,obg](paint::graphics& graph) + + // This drawing function is owner by the onwer of dw (the outer panel of the group widget), not by dw !! + dw.draw([gap,sz,bg,pbg](paint::graphics& graph) { - graph.rectangle(true, obg); + graph.rectangle(true, pbg); graph.round_rectangle(rectangle( point ( gap-1 , sz.height/2 ), nana::size (graph.width()-2*(gap-1), graph.height()-sz.height/2-(gap-1)) ),