remove paint::gadget
This commit is contained in:
@@ -542,32 +542,6 @@ namespace nana{
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
bool native_interface::window_icon(native_window_type wd, const paint::image& big_icon, const paint::image& small_icon) //deprecated
|
||||
{
|
||||
#if defined(NANA_WINDOWS)
|
||||
HICON h_big_icon = paint::image_accessor::icon(big_icon);
|
||||
HICON h_small_icon = paint::image_accessor::icon(small_icon);
|
||||
if (h_big_icon || h_small_icon)
|
||||
{
|
||||
nana::detail::platform_spec::instance().keep_window_icon(wd, (!big_icon.empty() ? big_icon : small_icon));
|
||||
if (h_big_icon) {
|
||||
::SendMessage(reinterpret_cast<HWND>(wd), WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(h_big_icon));
|
||||
}
|
||||
if (h_small_icon) {
|
||||
::SendMessage(reinterpret_cast<HWND>(wd), WM_SETICON, ICON_SMALL, reinterpret_cast<WPARAM>(h_small_icon));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#elif defined(NANA_X11)
|
||||
return window_icon(wd, big_icon);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
void native_interface::activate_owner(native_window_type wd)
|
||||
{
|
||||
#if defined(NANA_WINDOWS)
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace nana
|
||||
bool draw(graph_reference graph, const ::nana::color& bgcolor, const ::nana::color& fgcolor, const ::nana::rectangle& r, element_state estate, unsigned weight)
|
||||
{
|
||||
graph.rectangle(r, false, static_cast<color_rgb>((element_state::focus_hovered == estate || element_state::focus_normal == estate) ? 0x0595E2 : 0x999A9E));
|
||||
graph.rectangle(::nana::rectangle{r}.pare_off(1), false, bgcolor);
|
||||
graph.rectangle(::nana::rectangle(r).pare_off(1), false, bgcolor);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -601,8 +601,7 @@ namespace nana
|
||||
: nana::noncopyable, nana::nonmovable
|
||||
{
|
||||
using element_type = ElementInterface;
|
||||
using factory_interface = pat::cloneable<element::provider::factory_interface<element_type>>; //deprecated
|
||||
//using factory_interface = pat::cloneable<element::detail::factory_abstract>;
|
||||
using factory_interface = pat::cloneable<element::detail::factory_abstract>;
|
||||
|
||||
public:
|
||||
~element_object()
|
||||
@@ -617,8 +616,7 @@ namespace nana
|
||||
auto keep_e = element_ptr_;
|
||||
|
||||
factory_ = rhs;
|
||||
element_ptr_ = factory_->create(); //deprecated
|
||||
//element_ptr_ = static_cast<element_type*>(static_cast<element::provider::factory_interface<element_type>&>(*factory_).create());
|
||||
element_ptr_ = static_cast<element_type*>(static_cast<element::provider::factory_interface<element_type>&>(*factory_).create());
|
||||
|
||||
if(nullptr == factory_ || nullptr == element_ptr_)
|
||||
{
|
||||
@@ -647,14 +645,6 @@ namespace nana
|
||||
class element_manager
|
||||
: nana::noncopyable, nana::nonmovable
|
||||
{
|
||||
/*
|
||||
template<typename ElementInterface> //deprecated
|
||||
struct item
|
||||
{
|
||||
element_object<ElementInterface> * employee;
|
||||
std::map<std::string, std::shared_ptr<element_object<ElementInterface>>> table;
|
||||
};
|
||||
*/
|
||||
template<typename ElementInterface>
|
||||
struct item
|
||||
{
|
||||
|
||||
@@ -959,7 +959,7 @@ namespace nana
|
||||
int inputbox::date::month() const
|
||||
{
|
||||
if (!impl_->wdg_month.empty())
|
||||
return impl_->wdg_month.option() + 1;
|
||||
return static_cast<int>(impl_->wdg_month.option()) + 1;
|
||||
return impl_->month;
|
||||
}
|
||||
|
||||
@@ -1028,7 +1028,7 @@ namespace nana
|
||||
impl->wdg_day.events().destroy.connect_unignorable([impl]
|
||||
{
|
||||
impl->day = impl->wdg_day.to_int();
|
||||
impl->month = impl->wdg_month.option() + 1;
|
||||
impl->month = static_cast<int>(impl->wdg_month.option()) + 1;
|
||||
});
|
||||
|
||||
impl->wdg_year.events().destroy.connect_unignorable([impl]
|
||||
@@ -1040,7 +1040,7 @@ namespace nana
|
||||
{
|
||||
auto month = impl->wdg_month.option() + 1;
|
||||
auto year = impl->wdg_year.to_int();
|
||||
int days = ::nana::date::month_days(year, month);
|
||||
int days = ::nana::date::month_days(year, static_cast<unsigned>(month));
|
||||
|
||||
auto day = impl->wdg_day.to_int();
|
||||
impl->wdg_day.range(1, days, 1); //It resets the current value of wdg_day
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#include <memory>
|
||||
#include <limits> //numeric_limits
|
||||
#include <cstdlib> //std::abs
|
||||
#include <cstring> //std::memset
|
||||
|
||||
#include "place_parts.hpp"
|
||||
|
||||
@@ -93,7 +95,13 @@ namespace nana
|
||||
|
||||
std::string pos_str() const
|
||||
{
|
||||
#ifdef NANA_MINGW
|
||||
std::stringstream ss;
|
||||
ss<<pos();
|
||||
return ss.str();
|
||||
#else
|
||||
return std::to_string(pos());
|
||||
#endif // NANA_MINGW
|
||||
}
|
||||
|
||||
token read()
|
||||
@@ -731,7 +739,7 @@ namespace nana
|
||||
return child.get();
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
|
||||
}
|
||||
public:
|
||||
void _m_visible_for_child(division * div, bool vsb)
|
||||
@@ -1397,7 +1405,6 @@ namespace nana
|
||||
else if (left_px < 0)
|
||||
left_px = 0;
|
||||
|
||||
auto leaf_left = _m_leaf_left();
|
||||
double imd_rate = 100.0 / area_px;
|
||||
left_px = static_cast<int>(limit_px(_m_leaf_left(), left_px, area_px));
|
||||
_m_leaf_left()->weight.assign_percent(imd_rate * left_px);
|
||||
@@ -1692,7 +1699,6 @@ namespace nana
|
||||
|
||||
});
|
||||
|
||||
//indicator_.dock_area->z_order(nullptr, ::nana::z_order_action::top); //deprecated
|
||||
API::bring_top(indicator_.dock_area->handle(), false);
|
||||
indicator_.dock_area->show();
|
||||
}
|
||||
@@ -2112,7 +2118,6 @@ namespace nana
|
||||
}
|
||||
|
||||
field_gather * attached_field = nullptr;
|
||||
field_dock* attached_dock = nullptr;
|
||||
if (name.size())
|
||||
{
|
||||
//find the field with specified name.
|
||||
@@ -2154,11 +2159,6 @@ namespace nana
|
||||
}
|
||||
break;
|
||||
case token::dock:
|
||||
//deprecated
|
||||
//
|
||||
//if (name.empty())
|
||||
// throw std::invalid_argument("nana.place: dock must have a name.");
|
||||
|
||||
div.reset(new div_dock(std::move(name), this));
|
||||
break;
|
||||
default:
|
||||
@@ -2258,7 +2258,7 @@ namespace nana
|
||||
check_fn(div);
|
||||
}
|
||||
|
||||
//connect the field/dock with div object,
|
||||
//connect the field/dock with div object,
|
||||
void place::implement::connect(division* start)
|
||||
{
|
||||
if (!start)
|
||||
@@ -2307,7 +2307,7 @@ namespace nana
|
||||
div->field->attached = div;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
for (auto & child : div->children)
|
||||
@@ -2392,33 +2392,6 @@ namespace nana
|
||||
//if name violate the naming convention.
|
||||
place_parts::check_field_name(name);
|
||||
|
||||
/* //deprecated
|
||||
implement::division * div_ptr = nullptr;
|
||||
implement::field_gather * field_ptr = nullptr;
|
||||
{
|
||||
auto i = impl_->fields.find(name);
|
||||
if (i != impl_->fields.end())
|
||||
field_ptr = i->second;
|
||||
}
|
||||
|
||||
if (field_ptr)
|
||||
{
|
||||
//remove the existing div object
|
||||
div_ptr = field_ptr->attached;
|
||||
}
|
||||
else
|
||||
div_ptr = impl_->search_div_name(impl_->root_division.get(), name);
|
||||
|
||||
if (nullptr == div_ptr)
|
||||
{
|
||||
std::string what = "nana::place: field '";
|
||||
what += name;
|
||||
what += "' is not found.";
|
||||
|
||||
throw std::invalid_argument(what);
|
||||
}
|
||||
*/
|
||||
|
||||
auto div_ptr = impl_->search_div_name(impl_->root_division.get(), name);
|
||||
if (!div_ptr)
|
||||
{
|
||||
@@ -2434,7 +2407,6 @@ namespace nana
|
||||
|
||||
implement::division * div_owner = div_ptr->div_owner;
|
||||
implement::division * div_next = div_ptr->div_next;
|
||||
implement::division * div_bro = nullptr;
|
||||
if (div_owner)
|
||||
{
|
||||
for (auto i = div_owner->children.begin(); i != div_owner->children.end(); ++i)
|
||||
@@ -2444,7 +2416,6 @@ namespace nana
|
||||
replaced = &(*i);
|
||||
break;
|
||||
}
|
||||
div_bro = i->get();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2458,7 +2429,6 @@ namespace nana
|
||||
auto modified = impl_->scan_div(tknizer);
|
||||
auto modified_ptr = modified.get();
|
||||
modified_ptr->name = name;
|
||||
//modified_ptr->field = field_ptr;
|
||||
|
||||
replaced->swap(modified);
|
||||
|
||||
@@ -2468,33 +2438,6 @@ namespace nana
|
||||
|
||||
modified_ptr->div_owner = div_owner;
|
||||
modified_ptr->div_next = div_next;
|
||||
//if (field_ptr)
|
||||
// field_ptr->attached = modified_ptr;
|
||||
/*
|
||||
std::function<void(implement::division*)> attach;
|
||||
attach = [this, &attach](implement::division* div)
|
||||
{
|
||||
if (!div->name.empty())
|
||||
{
|
||||
auto i = impl_->fields.find(div->name);
|
||||
if (impl_->fields.end() != i)
|
||||
{
|
||||
if (i->second->attached != div)
|
||||
{
|
||||
i->second->attached = div;
|
||||
div->field = i->second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& child : div->children)
|
||||
{
|
||||
attach(child.get());
|
||||
}
|
||||
};
|
||||
|
||||
attach(impl_->root_division.get());
|
||||
*/
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
@@ -2538,7 +2481,7 @@ namespace nana
|
||||
void place::field_visible(const char* name, bool vsb)
|
||||
{
|
||||
if (!name) name = "";
|
||||
|
||||
|
||||
//May throw std::invalid_argument
|
||||
place_parts::check_field_name(name);
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <nana/gui/widgets/categorize.hpp>
|
||||
#include <nana/gui/widgets/float_listbox.hpp>
|
||||
#include <nana/gui/element.hpp>
|
||||
//#include <nana/paint/gadget.hpp> //deprecated
|
||||
#include <nana/gui/widgets/detail/tree_cont.hpp>
|
||||
#include <stdexcept>
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
|
||||
#include <nana/gui/widgets/checkbox.hpp>
|
||||
//#include <nana/paint/gadget.hpp> //deprecated
|
||||
#include <nana/paint/text_renderer.hpp>
|
||||
#include <nana/gui/element.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <nana/gui/widgets/date_chooser.hpp>
|
||||
#include <nana/gui/element.hpp>
|
||||
//#include <nana/paint/gadget.hpp> //deprecated
|
||||
#include <nana/system/platform.hpp>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <nana/gui/widgets/menu.hpp>
|
||||
#include <nana/system/platform.hpp>
|
||||
#include <nana/paint/gadget.hpp>
|
||||
#include <nana/gui/element.hpp>
|
||||
#include <nana/gui/wvl.hpp>
|
||||
#include <nana/paint/text_renderer.hpp>
|
||||
|
||||
@@ -2250,7 +2250,7 @@ namespace nana{ namespace widgets
|
||||
break;
|
||||
case keyboard::os_end:
|
||||
if (caret.y != nlines - 1) {
|
||||
caret.y = nlines - 1;
|
||||
caret.y = static_cast<decltype(caret.y)>(nlines - 1);
|
||||
changed = true;
|
||||
}
|
||||
break;
|
||||
@@ -2265,7 +2265,7 @@ namespace nana{ namespace widgets
|
||||
}else {
|
||||
if (caret.y != 0) {
|
||||
--caret.y;
|
||||
caret.x = textbase_.getline(caret.y).size();
|
||||
caret.x = static_cast<decltype(caret.x)>(textbase_.getline(caret.y).size());
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
@@ -2309,7 +2309,7 @@ namespace nana{ namespace widgets
|
||||
break;
|
||||
case keyboard::os_end:
|
||||
if (caret.x < lnsz) {
|
||||
caret.x = lnsz;
|
||||
caret.x = static_cast<decltype(caret.x)>(lnsz);
|
||||
changed = true;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace nana
|
||||
{
|
||||
int x = r.x + (static_cast<int>(r.width) - 14) / 2;
|
||||
int y = r.y + (static_cast<int>(r.height) - 14) / 2;
|
||||
|
||||
|
||||
::nana::color clr;
|
||||
|
||||
switch(sta)
|
||||
@@ -114,12 +114,10 @@ namespace nana
|
||||
graph.rectangle(r, true, bgcolor_);
|
||||
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); //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)
|
||||
@@ -144,8 +142,6 @@ 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); //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);
|
||||
|
||||
@@ -153,19 +149,16 @@ namespace nana
|
||||
|
||||
virtual void back(graph_reference graph, const nana::rectangle& r, state_t sta)
|
||||
{
|
||||
//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; //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; //deprecated
|
||||
_m_draw_arrow(graph, r, sta, direction::south);
|
||||
}
|
||||
private:
|
||||
@@ -1448,7 +1441,6 @@ namespace nana
|
||||
private:
|
||||
void _m_calc_metrics(graph_reference graph, std::forward_list<item>& items)
|
||||
{
|
||||
const auto height_px = graph.height();
|
||||
std::vector<unsigned> pxs;
|
||||
|
||||
unsigned pixels = 0;
|
||||
|
||||
Reference in New Issue
Block a user