From b72c549dbcdc4c260d78111c363368716123c0d2 Mon Sep 17 00:00:00 2001 From: cnjinhao Date: Sat, 13 Dec 2014 01:38:48 +0800 Subject: [PATCH 1/8] Adding .gitignore file This file was created by qPCR4vir. --- .gitignore | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..f6f1e54d --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +#This .gitignore created by qPCR4vir +#ignore thumbnails created by windows +Thumbs.db +#Ignore files build by Visual Studio +*.obj +*.exe +*.pdb +*.user +*.aps +*.pch +*.vspscc +*_i.c +*_p.c +*.ncb +*.tlb +*.tlh +*.bak +*.cache +*.ilk +*.log +[Bb]in +[Dd]ebug*/ +*.lib +*.sbr +obj/ +[Rr]elease*/ +_ReSharper*/ +[Tt]est[Rr]esult* +*.suo +*.sdf \ No newline at end of file From 9a061f23990ab2f1207d2a58c8cc41e1946a30ac Mon Sep 17 00:00:00 2001 From: cnjinhao Date: Sat, 13 Dec 2014 01:48:06 +0800 Subject: [PATCH 2/8] remove the nana.v12.suo --- build/vc2013/nana.v12.suo | Bin 23552 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 build/vc2013/nana.v12.suo diff --git a/build/vc2013/nana.v12.suo b/build/vc2013/nana.v12.suo deleted file mode 100644 index d9bff60ccf7241d203d7257050dec8deaab4cf16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23552 zcmeHPYm8LY9Y3>_7K#Y+(xTGEU0&j>v$M-QKm_(B(8Z-J53Q4s*?BC3%j{+!JgTeJ z5JjW}`=ON&EgCdw4ccmy&{qn4G14>;6WfN;Sksy|scnrW)en{J?|1G!J9qBPea!5z z%fg(=nRD(rXU_kBUjNtqpSf`UroX)S`rHqMDcmb2h|5Eh#g`4`9z$MC7vd{;X4&PT zp&?c=k8C-NqZ!yFy7B23m7-ask@kvxTuRqrj+i*S=C?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o2AHhwSW#BG;a2%fqz>M38WS^C{GYhSW*q7QFk@sw&g?+eIij>+I#T^IBi}Vf?ip%==Hc zu-~KWY={2>k1u^MHeeuKQYzQHmU(+^0B=y$yENXqq<@AGE98B$V)&HRKCOXPxkvYw zR&cdj8%C&nL!Tcvb>nd*EVv8Ns+72`5UU(}M1v89{92{;Y;7{h58EWS=gF>t48hwt zym`0-Io<&>&LMBkmU4D#EGUc<9<&&(0gjp$_{u2h&wM+ax&K0fQn(iSLhP+i&ph?S z`j*qb|L~r{|DNQ+8_XLr%d$ek_eVJXY`M32$;2Q1^T3kUgO5La{8D0G12M73FoE~= zN!WF`Qzl7DoS$#3u#igWheH~oQE(DwhSX{}h&6cIH!t_$^GG}x3e@^zL2o!5@O$e! zLUrEovUu3*4}^U6fp|3TuZs?5n%C7Qf`LS+)|*JwN4>SRai2Gu@F%=JU(^>1`;y6I ztj^Hfmkfo1VZYBC^LGT;-0uz71(%_D$QKLN2jk(W&(J&&st*N2p^(?_(|WJ-hJuL> zG>`e}lfiJXHo9z(Y>_4h8M4n&_Wor9ck>sKo)Np`?U*!pb_D;K({ru+Gz|$Y z*Bg<(Hw;{_V&<>^%Gyu!t3(&NX74|7^QmVho?7|d>b-BC;Q(^TjJx$eJVN?MN^W-# zu|RQ1%y_n??YXMc(*qN~H~W)!2I-cNGc@CF^q{^AvDC{Tg-gl9wf*hK38=*miVz_L z&Bv2xVtmX0^t;gIe<6N}2TmwsF&9(q&0N+~n$a&vN_dfv zNlHa~7)v_wFDF+-`*5W{jJ5vZ&Q4{uPsfM;VXX&Xr;aGtTlcJHtp@*DlWj*FuX;dP z{vR3V7^(cP^f32&K( Date: Mon, 15 Dec 2014 16:09:58 +0800 Subject: [PATCH 3/8] Create README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..8b7a7fb1 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Nana C++ Library + +Nana is a C++ library designed to allow developers to easily create cross-platform GUI applications with modern C++11 style, currently it can work on Linux(X11) and Windows. The nana repository contains the entire source of library, you can browse the source code and submit your pull request for contributing. + +## License + +Nana is licensed under the [Boost Software License]. + +[Boost Software License]: http://www.boost.org/LICENSE_1_0.txt + +## Support + +The best way to get help with Nana library is by visiting htt://nanapro.org/help/index.htm From c9305784fe82a48d4882fca19085050b83550395 Mon Sep 17 00:00:00 2001 From: cnjinhao Date: Mon, 15 Dec 2014 16:48:44 +0800 Subject: [PATCH 4/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b7a7fb1..843feff2 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ Nana is licensed under the [Boost Software License]. ## Support -The best way to get help with Nana library is by visiting htt://nanapro.org/help/index.htm +The best way to get help with Nana library is by visiting http://nanapro.org/help/index.htm From ccd74ede895df52fd663e4cee16a2a7ee47cd78e Mon Sep 17 00:00:00 2001 From: cnjinhao Date: Mon, 15 Dec 2014 16:50:47 +0800 Subject: [PATCH 5/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 843feff2..2106bb6b 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ Nana is licensed under the [Boost Software License]. ## Support -The best way to get help with Nana library is by visiting http://nanapro.org/help/index.htm +The best way to get help with Nana library is by visiting http://nanapro.org/help.htm From dd8a0a017361b7cc5efdf32ca7a796c3435a3de8 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Sun, 21 Dec 2014 08:47:09 +0800 Subject: [PATCH 6/8] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 2106bb6b..3546c151 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,13 @@ Nana is licensed under the [Boost Software License]. ## Support The best way to get help with Nana library is by visiting http://nanapro.org/help.htm + +## Introduction to the Repository + +There are two main branches with an infinite lifetime: +* **master** is the main branch and it is marked as every version release. +* **develop** is also another main branch where the source code reflects a state with the lastest delivered developement changes for the next release. + +Other branches: +* **features** are used to develop new features for the upcoming or a distant future release. Feature branches are named as 'feature-FEATURENAME'. +* **hotfix** is meant to prepare for a new release, and fixes some bugs from the corresponding tag on the master branch. From 0a5c85d21be419aa618861629da3ee3f98f10e82 Mon Sep 17 00:00:00 2001 From: cnjinhao Date: Sat, 3 Jan 2015 22:04:06 +0800 Subject: [PATCH 7/8] Fixed some syntax errors and clang compiling warnings GCC/VS2013/Clang is tested --- include/nana/gui/widgets/checkbox.hpp | 1 - include/nana/gui/widgets/date_chooser.hpp | 2 +- include/nana/gui/widgets/progress.hpp | 1 - include/nana/gui/widgets/scroll.hpp | 16 +- .../widgets/skeletons/text_token_stream.hpp | 21 +- include/nana/gui/widgets/widget.hpp | 8 +- include/nana/internationalization.hpp | 4 +- source/gui/widgets/date_chooser.cpp | 4 +- source/gui/widgets/listbox.cpp | 2 +- source/gui/widgets/progress.cpp | 2 +- source/gui/widgets/skeletons/text_editor.cpp | 4 +- source/gui/widgets/treebox.cpp | 238 +++++++++--------- source/paint/image.cpp | 5 +- source/unicode_bidi.cpp | 3 +- 14 files changed, 150 insertions(+), 161 deletions(-) diff --git a/include/nana/gui/widgets/checkbox.hpp b/include/nana/gui/widgets/checkbox.hpp index 5f9da66a..0795fa1a 100644 --- a/include/nana/gui/widgets/checkbox.hpp +++ b/include/nana/gui/widgets/checkbox.hpp @@ -44,7 +44,6 @@ namespace drawerbase private: static const int interval = 4; widget* widget_; - unsigned state_; std::unique_ptr imptr_; implement * impl_; }; diff --git a/include/nana/gui/widgets/date_chooser.hpp b/include/nana/gui/widgets/date_chooser.hpp index 03b47c5d..1cda0d12 100644 --- a/include/nana/gui/widgets/date_chooser.hpp +++ b/include/nana/gui/widgets/date_chooser.hpp @@ -58,7 +58,7 @@ namespace nana bool _m_get_trace(point, int & res); void _m_perf_transform(transform_action tfid, graph_reference, graph_reference dirtybuf, graph_reference newbuf, const nana::point& refpos); private: - void refresh(graph_reference); + void refresh(graph_reference) override; void attached(widget_reference, graph_reference) override; void mouse_move(graph_reference, const arg_mouse&) override; void mouse_leave(graph_reference, const arg_mouse&) override; diff --git a/include/nana/gui/widgets/progress.hpp b/include/nana/gui/widgets/progress.hpp index 6b12fee5..f0605988 100644 --- a/include/nana/gui/widgets/progress.hpp +++ b/include/nana/gui/widgets/progress.hpp @@ -44,7 +44,6 @@ namespace nana widget * widget_; nana::paint::graphics* graph_; unsigned draw_width_; - bool has_value_; bool unknown_; unsigned max_; unsigned value_; diff --git a/include/nana/gui/widgets/scroll.hpp b/include/nana/gui/widgets/scroll.hpp index 26421b48..bf81d52d 100644 --- a/include/nana/gui/widgets/scroll.hpp +++ b/include/nana/gui/widgets/scroll.hpp @@ -180,7 +180,7 @@ namespace nana return false; } private: - void attached(widget_reference widget, graph_reference graph) + void attached(widget_reference widget, graph_reference graph) override { graph_ = &graph; widget_ = static_cast< ::nana::scroll*>(&widget); @@ -190,12 +190,12 @@ namespace nana timer_.elapse(std::bind(&trigger::_m_tick, this)); } - void detached() + void detached() override { graph_ = nullptr; } - void refresh(graph_reference graph) + void refresh(graph_reference graph) override { drawer_.draw(graph, metrics_.what); } @@ -213,7 +213,7 @@ namespace nana API::lazy_refresh(); } - void mouse_move(graph_reference graph, const ::nana::arg_mouse& arg) + void mouse_move(graph_reference graph, const ::nana::arg_mouse& arg) override { bool redraw = false; if(metrics_.pressed && (metrics_.what == buttons::scroll)) @@ -240,7 +240,7 @@ namespace nana } } - void mouse_down(graph_reference graph, const arg_mouse& arg) + void mouse_down(graph_reference graph, const arg_mouse& arg) override { if(arg.left_button) { @@ -275,7 +275,7 @@ namespace nana } } - void mouse_up(graph_reference graph, const arg_mouse& arg) + void mouse_up(graph_reference graph, const arg_mouse& arg) override { timer_.stop(); @@ -287,7 +287,7 @@ namespace nana API::lazy_refresh(); } - void mouse_leave(graph_reference graph, const arg_mouse&) + void mouse_leave(graph_reference graph, const arg_mouse&) override { if(metrics_.pressed) return; @@ -296,7 +296,7 @@ namespace nana API::lazy_refresh(); } - void mouse_wheel(graph_reference graph, const arg_wheel& arg) + void mouse_wheel(graph_reference graph, const arg_wheel& arg) override { if(make_step(arg.upwards == false, 3)) { diff --git a/include/nana/gui/widgets/skeletons/text_token_stream.hpp b/include/nana/gui/widgets/skeletons/text_token_stream.hpp index a753f3f4..873760eb 100644 --- a/include/nana/gui/widgets/skeletons/text_token_stream.hpp +++ b/include/nana/gui/widgets/skeletons/text_token_stream.hpp @@ -45,9 +45,7 @@ namespace nana{ namespace widgets{ namespace skeletons tokenizer(const nana::string& s, bool format_enabled) : iptr_(s.data()), endptr_(s.data() + s.size()), - format_enabled_(format_enabled), - format_state_(false), - revert_token_(token::eof) + format_enabled_(format_enabled) { } @@ -414,17 +412,14 @@ namespace nana{ namespace widgets{ namespace skeletons } } private: - const nana::char_t * iptr_; - const nana::char_t * endptr_; + const ::nana::char_t * iptr_; + const ::nana::char_t * endptr_; const bool format_enabled_; - bool format_state_; + bool format_state_{false}; - nana::string idstr_; + ::nana::string idstr_; std::pair binary_; - - std::size_t whspace_size_; - - token revert_token_; + token revert_token_{token::eof}; }; //The fblock states a format, and a format from which it is inherted @@ -528,7 +523,7 @@ namespace nana{ namespace widgets{ namespace skeletons { public: data_image(const nana::string& imgpath, const nana::size & sz, std::size_t limited) - : image_(imgpath), limited_(limited) + : image_(imgpath)//, limited_(limited) { size_ = image_.size(); @@ -597,7 +592,6 @@ namespace nana{ namespace widgets{ namespace skeletons nana::string str_; nana::paint::image image_; nana::size size_; - std::size_t limited_; }; class dstream @@ -928,7 +922,6 @@ namespace nana{ namespace widgets{ namespace skeletons } private: - bool format_enabled_; std::vector fblocks_; std::list > lines_; diff --git a/include/nana/gui/widgets/widget.hpp b/include/nana/gui/widgets/widget.hpp index ce11aeec..de6e5dce 100644 --- a/include/nana/gui/widgets/widget.hpp +++ b/include/nana/gui/widgets/widget.hpp @@ -200,7 +200,7 @@ namespace nana } } - general_events& _m_get_general_events() const + general_events& _m_get_general_events() const override { return *events_; } @@ -275,7 +275,7 @@ namespace nana } } - general_events& _m_get_general_events() const + general_events& _m_get_general_events() const override { return *events_; } @@ -404,7 +404,7 @@ namespace nana API::dev::attach_drawer(*this, trigger_); } - general_events& _m_get_general_events() const + general_events& _m_get_general_events() const override { return *events_; } @@ -487,7 +487,7 @@ namespace nana } } - general_events& _m_get_general_events() const + general_events& _m_get_general_events() const override { return *events_; } diff --git a/include/nana/internationalization.hpp b/include/nana/internationalization.hpp index 4c9942af..341c8e97 100644 --- a/include/nana/internationalization.hpp +++ b/include/nana/internationalization.hpp @@ -127,7 +127,7 @@ namespace nana class arg_eval; template - class arg_function + class arg_function: public eval_arg { public: arg_function(std::function fn) @@ -208,4 +208,4 @@ namespace nana };//end class i18n_eval; } -#endif//NANA_I18N_HPP \ No newline at end of file +#endif//NANA_I18N_HPP diff --git a/source/gui/widgets/date_chooser.cpp b/source/gui/widgets/date_chooser.cpp index 52ec5708..33734fbb 100644 --- a/source/gui/widgets/date_chooser.cpp +++ b/source/gui/widgets/date_chooser.cpp @@ -49,13 +49,13 @@ namespace nana void trigger::week_name(unsigned index, const nana::string& str) { - if(0 <= index && index < 7) + if(index < 7) this->weekstr_[index] = str; } void trigger::month_name(unsigned index, const nana::string& str) { - if(0 <= index && index < 12) + if(index < 12) this->monthstr_[index] = str; } diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index fb37ecb8..fba11ba3 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -3023,7 +3023,7 @@ namespace nana item_proxy & item_proxy::bgcolor(nana::color_t col) { - cat_->items.at(pos_.item).flags.selected; + cat_->items.at(pos_.item).bgcolor = col; ess_->update(); return *this; } diff --git a/source/gui/widgets/progress.cpp b/source/gui/widgets/progress.cpp index 2c89cbf5..a689ae64 100644 --- a/source/gui/widgets/progress.cpp +++ b/source/gui/widgets/progress.cpp @@ -19,7 +19,7 @@ namespace nana { //class trigger trigger::trigger() - : graph_(nullptr), draw_width_(static_cast(-1)), has_value_(true), + : graph_(nullptr), draw_width_(static_cast(-1)), unknown_(false), max_(100), value_(0) {} diff --git a/source/gui/widgets/skeletons/text_editor.cpp b/source/gui/widgets/skeletons/text_editor.cpp index be087de0..469b22f4 100644 --- a/source/gui/widgets/skeletons/text_editor.cpp +++ b/source/gui/widgets/skeletons/text_editor.cpp @@ -664,7 +664,7 @@ namespace nana{ namespace widgets pre_calc_line(i, pixels); } - std::size_t take_lines() const + std::size_t take_lines() const override { std::size_t lines = 0; for (auto & mtr : linemtr_) @@ -673,7 +673,7 @@ namespace nana{ namespace widgets return lines; } - std::size_t take_lines(std::size_t pos) const + std::size_t take_lines(std::size_t pos) const override { return (pos < linemtr_.size() ? linemtr_[pos].take_lines : 0); } diff --git a/source/gui/widgets/treebox.cpp b/source/gui/widgets/treebox.cpp index 9135e364..babbf1a4 100644 --- a/source/gui/widgets/treebox.cpp +++ b/source/gui/widgets/treebox.cpp @@ -25,53 +25,138 @@ namespace nana { typedef trigger::node_type node_type; - bool no_sensitive_compare(const nana::string& text, const nana::char_t *pattern, std::size_t len) + bool no_sensitive_compare(const nana::string& text, const nana::char_t *pattern, std::size_t len) + { + if(len <= text.length()) { - if(len <= text.length()) + const nana::char_t * s = text.c_str(); + for(std::size_t i = 0; i < len; ++i) { - const nana::char_t * s = text.c_str(); - for(std::size_t i = 0; i < len; ++i) + if('a' <= s[i] && s[i] <= 'z') { - if('a' <= s[i] && s[i] <= 'z') - { - if(pattern[i] != s[i] - ('a' - 'A')) - return false; - } - else - if(pattern[i] != s[i]) return false; + if(pattern[i] != s[i] - ('a' - 'A')) + return false; } - return true; + else + if(pattern[i] != s[i]) return false; + } + return true; + } + return false; + } + + const node_type* find_track_child_node(const node_type* node, const node_type * end, const nana::char_t* pattern, std::size_t len, bool &finish) + { + if(node->value.second.expanded) + { + node = node->child; + while(node) + { + if(no_sensitive_compare(node->value.second.text, pattern, len)) return node; + + if(node == end) break; + + if(node->value.second.expanded) + { + auto t = find_track_child_node(node, end, pattern, len, finish); + if(t || finish) + return t; + } + node = node->next; } - return false; } - const node_type* find_track_child_node(const node_type* node, const node_type * end, const nana::char_t* pattern, std::size_t len, bool &finish) + finish = (node && (node == end)); + return nullptr; + } + + class tlwnd_drawer + : public drawer_trigger, public compset_interface + { + public: + typedef drawer_trigger::graph_reference graph_reference; + + void assign(const item_attribute_t & item_attr, const pat::cloneable* renderer, const pat::cloneable * compset_placer) { - if(node->value.second.expanded) + if(renderer && compset_placer) { - node = node->child; + renderer_ = *renderer; + placer_ = *compset_placer; - while(node) - { - if(no_sensitive_compare(node->value.second.text, pattern, len)) return node; + item_attr_ = item_attr; - if(node == end) break; - - if(node->value.second.expanded) - { - auto t = find_track_child_node(node, end, pattern, len, finish); - if(t || finish) - return t; - } - node = node->next; - } + _m_draw(); } + } + private: + void _m_draw() + { + item_r_.x = item_r_.y = 0; + item_r_.width = placer_->item_width(*this->graph_, item_attr_); + item_r_.height = placer_->item_height(*this->graph_); - finish = (node && (node == end)); - return nullptr; + comp_attribute_t attr; + if(comp_attribute(component::text, attr)) + { + nana::paint::graphics item_graph(item_r_.width, item_r_.height); + item_graph.typeface(graph_->typeface()); + + auto bgcolor = widget_->background(); + auto fgcolor = widget_->foreground(); + renderer_->bground(item_graph, bgcolor, fgcolor, this); + renderer_->expander(item_graph, bgcolor, fgcolor, this); + renderer_->crook(item_graph, bgcolor, fgcolor, this); + renderer_->icon(item_graph, bgcolor, fgcolor, this); + renderer_->text(item_graph, bgcolor, fgcolor, this); + + item_graph.paste(attr.area, *graph_, 1, 1); + graph_->rectangle(0x0, false); + } + } + private: + // Implementation of drawer_trigger + void attached(widget_reference wd, graph_reference graph) override + { + widget_ = &wd; + graph_ = &graph; + graph.typeface(widget_->typeface()); + } + private: + // Implementation of compset_interface + virtual const item_attribute_t& item_attribute() const override + { + return item_attr_; } - class tooltip_window; + virtual bool comp_attribute(component_t comp, comp_attribute_t& comp_attr) const override + { + comp_attr.area = item_r_; + return placer_->locate(comp, item_attr_, &comp_attr.area); + } + private: + ::nana::paint::graphics * graph_; + ::nana::pat::cloneable renderer_; + ::nana::pat::cloneable placer_; + widget *widget_; + item_attribute_t item_attr_; + nana::rectangle item_r_; + };//end class tlwnd_drawer + + class tooltip_window + : public widget_object + { + public: + tooltip_window(window wd, const rectangle& r) + : widget_object(wd, false, rectangle(r).pare_off(-1), appear::bald()) + { + API::take_active(handle(), false, nullptr); + } + + drawer_trigger_t & impl() + { + return get_drawer_trigger(); + } + };//end class tooltip_window //item_locator should be defined before the definition of basic_implement class trigger::item_locator @@ -1355,95 +1440,6 @@ namespace nana //Treebox Implementation namespace treebox { - class tlwnd_drawer - : public drawer_trigger, public compset_interface - { - public: - typedef drawer_trigger::graph_reference graph_reference; - - void assign(const item_attribute_t & item_attr, const pat::cloneable* renderer, const pat::cloneable * compset_placer) - { - if(renderer && compset_placer) - { - renderer_ = *renderer; - placer_ = *compset_placer; - - item_attr_ = item_attr; - - _m_draw(); - } - } - private: - void _m_draw() - { - item_r_.x = item_r_.y = 0; - item_r_.width = placer_->item_width(*this->graph_, item_attr_); - item_r_.height = placer_->item_height(*this->graph_); - - comp_attribute_t attr; - if(comp_attribute(component::text, attr)) - { - nana::paint::graphics item_graph(item_r_.width, item_r_.height); - item_graph.typeface(graph_->typeface()); - - auto bgcolor = widget_->background(); - auto fgcolor = widget_->foreground(); - renderer_->bground(item_graph, bgcolor, fgcolor, this); - renderer_->expander(item_graph, bgcolor, fgcolor, this); - renderer_->crook(item_graph, bgcolor, fgcolor, this); - renderer_->icon(item_graph, bgcolor, fgcolor, this); - renderer_->text(item_graph, bgcolor, fgcolor, this); - - item_graph.paste(attr.area, *graph_, 1, 1); - graph_->rectangle(0x0, false); - } - } - private: - // Implementation of drawer_trigger - void attached(widget_reference wd, graph_reference graph) override - { - widget_ = &wd; - graph_ = &graph; - graph.typeface(widget_->typeface()); - } - private: - // Implementation of compset_interface - virtual const item_attribute_t& item_attribute() const override - { - return item_attr_; - } - - virtual bool comp_attribute(component_t comp, comp_attribute_t& comp_attr) const override - { - comp_attr.area = item_r_; - return placer_->locate(comp, item_attr_, &comp_attr.area); - } - private: - ::nana::paint::graphics * graph_; - ::nana::pat::cloneable renderer_; - ::nana::pat::cloneable placer_; - widget *widget_; - item_attribute_t item_attr_; - nana::rectangle item_r_; - };//end class tlwnd_drawer - - class tooltip_window - : public widget_object - { - public: - tooltip_window(window wd, const rectangle& r) - : widget_object(wd, false, rectangle(r).pare_off(-1), appear::bald()) - { - API::take_active(handle(), false, nullptr); - } - - drawer_trigger_t & impl() - { - return get_drawer_trigger(); - } - };//end class tooltip_window - - //class trigger //struct treebox_node_type trigger::treebox_node_type::treebox_node_type() diff --git a/source/paint/image.cpp b/source/paint/image.cpp index 8385fd10..ec471d6a 100644 --- a/source/paint/image.cpp +++ b/source/paint/image.cpp @@ -1,6 +1,7 @@ /* * Paint Image Implementation - * Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com) + * Nana C++ Library(http://www.nanapro.org) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -62,6 +63,8 @@ namespace paint ::DeleteObject(info.hbmMask); return true; } +#else + if(is_ico_){} //kill the unused compiler warning in Linux. #endif return false; } diff --git a/source/unicode_bidi.cpp b/source/unicode_bidi.cpp index 889e7c4c..ab90f538 100644 --- a/source/unicode_bidi.cpp +++ b/source/unicode_bidi.cpp @@ -958,8 +958,7 @@ namespace nana unsigned level_of_run = begin_character->level; bool head_of_run = true; - std::vector::iterator last = end - 1; - std::vector::iterator begin_neutral = end; + auto begin_neutral = end; //N1. A sequence of neutrals takes the direction of the surrounding strong text if the text on both sides has the same direction. //European and Arabic numbers act as if they were R in terms of their influence on neutrals. From a3db9cb5d675e764c9382d1b25954aa3aa7c8a4a Mon Sep 17 00:00:00 2001 From: cnjinhao Date: Tue, 6 Jan 2015 20:40:01 +0800 Subject: [PATCH 8/8] Removed the declaration of deprecated treebox::icon --- include/nana/gui/widgets/treebox.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/nana/gui/widgets/treebox.hpp b/include/nana/gui/widgets/treebox.hpp index a5235880..9d8f9828 100644 --- a/include/nana/gui/widgets/treebox.hpp +++ b/include/nana/gui/widgets/treebox.hpp @@ -411,8 +411,6 @@ namespace nana /// Determinte whether the checkbox is enabled. bool checkable() const; - treebox& icon(const nana::string& id, const node_image_type& node_img); - node_image_type& icon(const nana::string& id) const; void icon_erase(const nana::string& id);