change the implementation of pat::cloneable

This commit is contained in:
Jinhao
2015-08-17 01:37:56 +08:00
parent c1e9ea3daf
commit 4323977908
10 changed files with 183 additions and 77 deletions

View File

@@ -14,7 +14,7 @@
#include <nana/gui/widgets/categorize.hpp>
#include <nana/gui/widgets/float_listbox.hpp>
#include <nana/gui/element.hpp>
#include <nana/paint/gadget.hpp>
//#include <nana/paint/gadget.hpp> //deprecated
#include <nana/gui/widgets/detail/tree_cont.hpp>
#include <stdexcept>

View File

@@ -11,7 +11,7 @@
*/
#include <nana/gui/widgets/checkbox.hpp>
#include <nana/paint/gadget.hpp>
//#include <nana/paint/gadget.hpp> //deprecated
#include <nana/paint/text_renderer.hpp>
#include <nana/gui/element.hpp>
#include <algorithm>

View File

@@ -12,7 +12,7 @@
#include <nana/gui/widgets/date_chooser.hpp>
#include <nana/gui/element.hpp>
#include <nana/paint/gadget.hpp>
//#include <nana/paint/gadget.hpp> //deprecated
#include <nana/system/platform.hpp>
#include <sstream>

View File

@@ -112,12 +112,16 @@ namespace nana
clr = { 0xF0, 0xF0, 0xF0 };
}
graph.rectangle(r, true, bgcolor_);
nana::paint::gadget::cross(graph, x, y, 14, 6, clr);
facade<element::cross> cross;
cross.draw(graph, {}, clr, { x, y, 14, 6 }, element_state::normal);
//nana::paint::gadget::cross(graph, x, y, 14, 6, clr); //deprecated
}
virtual void close(graph_reference graph, const nana::rectangle& r, state_t sta)
{
nana::paint::gadget::close_16_pixels(graph, r.x + (r.width - 16) / 2, r.y + (r.height - 16) / 2, 1, colors::black);
//nana::paint::gadget::close_16_pixels(graph, r.x + (r.width - 16) / 2, r.y + (r.height - 16) / 2, 1, colors::black); //deprecated
facade<element::x_icon> x_icon;
x_icon.draw(graph, {}, colors::black, { r.x + static_cast<int>(r.width - 16) / 2, r.y + static_cast<int>(r.height - 16) / 2, 16, 16 }, element_state::normal);
if(item_renderer::highlight == sta)
graph.rectangle(r, false, {0xa0, 0xa0, 0xa0});
}
@@ -140,24 +144,28 @@ namespace nana
else if (!active)
clr = ::nana::color{ 0x92, 0x99, 0xA4 };
gadget::close_16_pixels(graph, r.x - (16 - r.width) / 2, r.y - (16 - r.height) / 2, 1, clr);
//gadget::close_16_pixels(graph, r.x - (16 - r.width) / 2, r.y - (16 - r.height) / 2, 1, clr); //deprecated
facade<element::x_icon> x_icon;
x_icon.draw(graph, {}, colors::black, { r.x + static_cast<int>(r.width - 16) / 2, r.y + static_cast<int>(r.height - 16) / 2, 16, 16 }, element_state::normal);
}
virtual void back(graph_reference graph, const nana::rectangle& r, state_t sta)
{
using namespace nana::paint::gadget;
//using namespace nana::paint::gadget; //deprecated
_m_draw_arrow(graph, r, sta, direction::west);
}
virtual void next(graph_reference graph, const nana::rectangle& r, state_t sta)
{
using namespace nana::paint::gadget;
//using namespace nana::paint::gadget; //deprecated
_m_draw_arrow(graph, r, sta, direction::east);
}
virtual void list(graph_reference graph, const nana::rectangle& r, state_t sta)
{
using namespace nana::paint::gadget;
//using namespace nana::paint::gadget; //deprecated
_m_draw_arrow(graph, r, sta, direction::south);
}
private: