remove deprecated components
This commit is contained in:
@@ -83,6 +83,9 @@ namespace API
|
|||||||
paint::graphics* window_graphics(window);
|
paint::graphics* window_graphics(window);
|
||||||
|
|
||||||
void delay_restore(bool);
|
void delay_restore(bool);
|
||||||
|
|
||||||
|
void register_menu_window(window, bool has_keyboard);
|
||||||
|
void set_menubar(window wd, bool attach);
|
||||||
}//end namespace dev
|
}//end namespace dev
|
||||||
|
|
||||||
|
|
||||||
@@ -310,8 +313,8 @@ namespace API
|
|||||||
void eat_tabstop(window, bool);
|
void eat_tabstop(window, bool);
|
||||||
window move_tabstop(window, bool next); ///< Sets the focus to the window which tabstop is near to the specified window.
|
window move_tabstop(window, bool next); ///< Sets the focus to the window which tabstop is near to the specified window.
|
||||||
|
|
||||||
bool glass_window(window); /// \deprecated
|
//bool glass_window(window); //deprecated
|
||||||
bool glass_window(window, bool); /// \deprecated
|
//bool glass_window(window, bool); //deprecated
|
||||||
|
|
||||||
/// Sets the window active state. If a window active state is false, the window will not obtain the focus when a mouse clicks on it wich will be obteined by take_if_has_active_false.
|
/// Sets the window active state. If a window active state is false, the window will not obtain the focus when a mouse clicks on it wich will be obteined by take_if_has_active_false.
|
||||||
void take_active(window, bool has_active, window take_if_has_active_false);
|
void take_active(window, bool has_active, window take_if_has_active_false);
|
||||||
@@ -328,10 +331,6 @@ namespace API
|
|||||||
|
|
||||||
window find_window(const nana::point& mspos);
|
window find_window(const nana::point& mspos);
|
||||||
|
|
||||||
void register_menu_window(window, bool has_keyboard);
|
|
||||||
bool attach_menubar(window menubar);
|
|
||||||
void detach_menubar(window menubar);
|
|
||||||
|
|
||||||
bool is_window_zoomed(window, bool ask_for_max); ///<Tests a window whether it is maximized or minimized.
|
bool is_window_zoomed(window, bool ask_for_max); ///<Tests a window whether it is maximized or minimized.
|
||||||
|
|
||||||
void widget_borderless(window, bool); ///<Enables or disables a borderless widget.
|
void widget_borderless(window, bool); ///<Enables or disables a borderless widget.
|
||||||
|
|||||||
@@ -148,10 +148,10 @@ namespace nana
|
|||||||
|
|
||||||
enum class kits
|
enum class kits
|
||||||
{
|
{
|
||||||
add,
|
add, ///< The type identifies the add button of the tabbar's toolbox.
|
||||||
scroll,
|
scroll, ///< The type identifies the scroll button of the tabbar's toolbox
|
||||||
list,
|
list, ///< The type identifies the list button of the tabbar's toolbox
|
||||||
close
|
close ///< The type identifies the close button of the tabbar's toolbox
|
||||||
};
|
};
|
||||||
|
|
||||||
trigger();
|
trigger();
|
||||||
@@ -193,30 +193,9 @@ namespace nana
|
|||||||
{
|
{
|
||||||
typedef drawerbase::tabbar::trigger drawer_trigger_t;
|
typedef drawerbase::tabbar::trigger drawer_trigger_t;
|
||||||
public:
|
public:
|
||||||
typedef Type value_type; ///< The type of element data which is stored in the tabbar.
|
using value_type = Type; ///< The type of element data which is stored in the tabbar.
|
||||||
typedef drawerbase::tabbar::item_renderer item_renderer; ///< A user-defined item renderer should be derived from this interface.
|
using item_renderer = drawerbase::tabbar::item_renderer; ///< A user-defined item renderer should be derived from this interface.
|
||||||
|
using kits = drawer_trigger_t::kits;
|
||||||
//These member types is deprecated, they will be removed in Nana 1.3
|
|
||||||
struct button_add{}; ///< The type identifies the add button of the tabbar's toolbox.
|
|
||||||
struct button_scroll{}; ///< The type identifies the scroll button of the tabbar's toolbox.
|
|
||||||
struct button_list{}; ///< The type identifies the list button of the tabbar's toolbox.
|
|
||||||
struct button_close{}; ///< The type identifies the close button of the tabbar's toolbox.
|
|
||||||
|
|
||||||
//This template class is deprecated, it will be removed in 1.3
|
|
||||||
/// A template class identifies the buttons of the tabbar's toolbox. Refer to notes for more details.
|
|
||||||
template<typename ButtonAdd = nana::null_type, typename ButtonScroll = nana::null_type, typename ButtonList = nana::null_type, typename ButtonClose = nana::null_type>
|
|
||||||
struct button_container
|
|
||||||
{
|
|
||||||
typedef meta::fixed_type_set<ButtonAdd, ButtonScroll, ButtonList, ButtonClose> type_set;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class kits
|
|
||||||
{
|
|
||||||
add, ///< The type identifies the add button of the tabbar's toolbox.
|
|
||||||
scroll, ///< The type identifies the scroll button of the tabbar's toolbox
|
|
||||||
list, ///< The type identifies the list button of the tabbar's toolbox
|
|
||||||
close ///< The type identifies the close button of the tabbar's toolbox
|
|
||||||
};
|
|
||||||
|
|
||||||
tabbar()
|
tabbar()
|
||||||
{
|
{
|
||||||
@@ -324,12 +303,6 @@ namespace nana
|
|||||||
API::update_window(*this);
|
API::update_window(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
//deprecated from 1.2.1, removed from 1.3
|
|
||||||
void relate(std::size_t pos, window wd) /// Binds a window to an item specified by pos, if the item is selected, shows the window, otherwise, hides it.
|
|
||||||
{
|
|
||||||
this->get_drawer_trigger().attach(pos, wd);
|
|
||||||
}
|
|
||||||
|
|
||||||
void attach(std::size_t pos, window attach_wd)
|
void attach(std::size_t pos, window attach_wd)
|
||||||
{
|
{
|
||||||
if (attach_wd && API::empty_window(attach_wd))
|
if (attach_wd && API::empty_window(attach_wd))
|
||||||
@@ -357,32 +330,8 @@ namespace nana
|
|||||||
{
|
{
|
||||||
this->get_drawer_trigger().tab_image(pos, img);
|
this->get_drawer_trigger().tab_image(pos, img);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets buttons of the tabbar's toolbox, refer to notes for more details.
|
/// Sets buttons of the tabbar's toolbox, refer to notes for more details.
|
||||||
template<typename Add, typename Scroll, typename List, typename Close>
|
|
||||||
void toolbox(const button_container<Add, Scroll, List, Close>&, bool enable)
|
|
||||||
{
|
|
||||||
typedef typename button_container<Add, Scroll, List, Close>::type_set type_set;
|
|
||||||
auto & tg = this->get_drawer_trigger();
|
|
||||||
bool redraw = false;
|
|
||||||
|
|
||||||
using inner_kits = drawerbase::tabbar::trigger::kits;
|
|
||||||
|
|
||||||
if(type_set::template count<button_add>::value)
|
|
||||||
redraw |= tg.toolbox(inner_kits::add, enable);
|
|
||||||
|
|
||||||
if(type_set::template count<button_scroll>::value)
|
|
||||||
redraw |= tg.toolbox(inner_kits::scroll, enable);
|
|
||||||
|
|
||||||
if(type_set::template count<button_list>::value)
|
|
||||||
redraw |= tg.toolbox(inner_kits::add, enable);
|
|
||||||
|
|
||||||
if(type_set::template count<button_close>::value)
|
|
||||||
redraw |= tg.toolbox(inner_kits::close, enable);
|
|
||||||
|
|
||||||
if(redraw)
|
|
||||||
API::refresh_window(this->handle());
|
|
||||||
}
|
|
||||||
|
|
||||||
void toolbox(kits kit, bool enable)
|
void toolbox(kits kit, bool enable)
|
||||||
{
|
{
|
||||||
if (this->get_drawer_trigger().toolbox(kit, enable))
|
if (this->get_drawer_trigger().toolbox(kit, enable))
|
||||||
|
|||||||
@@ -138,9 +138,6 @@ namespace nana
|
|||||||
/// @param file_utf8 A UTF-8 string to a filename
|
/// @param file_utf8 A UTF-8 string to a filename
|
||||||
void save_as_file(const char* file_utf8) const throw();
|
void save_as_file(const char* file_utf8) const throw();
|
||||||
|
|
||||||
void set_color(const ::nana::color&); //deprecated, graphics::palette() instead
|
|
||||||
void set_text_color(const ::nana::color&); //deprecated, graphics::palette() instead
|
|
||||||
|
|
||||||
::nana::color palette(bool for_text) const;
|
::nana::color palette(bool for_text) const;
|
||||||
graphics& palette(bool for_text, const ::nana::color&);
|
graphics& palette(bool for_text, const ::nana::color&);
|
||||||
|
|
||||||
|
|||||||
@@ -173,11 +173,8 @@ namespace nana
|
|||||||
const int x = r.x + 1;
|
const int x = r.x + 1;
|
||||||
const int y = r.y + 1;
|
const int y = r.y + 1;
|
||||||
|
|
||||||
graph.set_color(bld_bgcolor);
|
graph.rectangle(rectangle{ x + 1, y + 1, 11, 11 }, true, bld_bgcolor);
|
||||||
graph.rectangle(rectangle{ x + 1, y + 1, 11, 11 }, true);
|
graph.rectangle(rectangle{ x, y, 13, 13 }, false, bld_fgcolor);
|
||||||
|
|
||||||
graph.set_color(bld_fgcolor);
|
|
||||||
graph.rectangle(rectangle{ x, y, 13, 13 }, false);
|
|
||||||
|
|
||||||
switch(crook_data.check_state)
|
switch(crook_data.check_state)
|
||||||
{
|
{
|
||||||
@@ -252,11 +249,11 @@ namespace nana
|
|||||||
int x = r.x + (static_cast<int>(r.width) - 16) / 2;
|
int x = r.x + (static_cast<int>(r.width) - 16) / 2;
|
||||||
int y = r.y + (static_cast<int>(r.height) - 16) / 2;
|
int y = r.y + (static_cast<int>(r.height) - 16) / 2;
|
||||||
|
|
||||||
graph.set_color(fgcolor);
|
graph.palette(false, fgcolor);
|
||||||
graph.line(point{ x + 3, y + 7 }, point{ x + 6, y + 10 });
|
graph.line(point{ x + 3, y + 7 }, point{ x + 6, y + 10 });
|
||||||
graph.line(point{ x + 7, y + 9 }, point{ x + 12, y + 4 });
|
graph.line(point{ x + 7, y + 9 }, point{ x + 12, y + 4 });
|
||||||
|
|
||||||
graph.set_color(fgcolor.blend(colors::white, 0.5));
|
graph.palette(false, fgcolor.blend(colors::white, 0.5));
|
||||||
graph.line(point{ x + 3, y + 8 }, point{ x + 6, y + 11 });
|
graph.line(point{ x + 3, y + 8 }, point{ x + 6, y + 11 });
|
||||||
graph.line(point{ x + 7, y + 10 }, point{ x + 12, y + 5 });
|
graph.line(point{ x + 7, y + 10 }, point{ x + 12, y + 5 });
|
||||||
graph.line(point{ x + 4, y + 7 }, point{ x + 6, y + 9 });
|
graph.line(point{ x + 4, y + 7 }, point{ x + 6, y + 9 });
|
||||||
@@ -515,16 +512,16 @@ namespace nana
|
|||||||
::nana::point left_mid{ r.x + 1, r.y + 1 + static_cast<int>(part_px) }, right_mid{ right_top.x, left_mid.y };
|
::nana::point left_mid{ r.x + 1, r.y + 1 + static_cast<int>(part_px) }, right_mid{ right_top.x, left_mid.y };
|
||||||
::nana::point left_bottom{ r.x + 1, r.bottom() - 2 }, right_bottom{ r.right() - 2, r.bottom() - 2 };
|
::nana::point left_bottom{ r.x + 1, r.bottom() - 2 }, right_bottom{ r.right() - 2, r.bottom() - 2 };
|
||||||
|
|
||||||
graph.set_color(bgcolor.blend(colors::white, 0.9));
|
graph.palette(false, bgcolor.blend(colors::white, 0.9));
|
||||||
graph.line(left_top, left_mid);
|
graph.line(left_top, left_mid);
|
||||||
graph.line(right_top, right_mid);
|
graph.line(right_top, right_mid);
|
||||||
|
|
||||||
graph.set_color(bgcolor.blend(colors::white, 0.5));
|
graph.palette(false, bgcolor.blend(colors::white, 0.5));
|
||||||
graph.line(left_top, right_top);
|
graph.line(left_top, right_top);
|
||||||
|
|
||||||
left_mid.y++;
|
left_mid.y++;
|
||||||
right_mid.y++;
|
right_mid.y++;
|
||||||
graph.set_color(bgcolor.blend(colors::black, 0.8));
|
graph.palette(false, bgcolor.blend(colors::black, 0.8));
|
||||||
graph.line(left_mid, left_bottom);
|
graph.line(left_mid, left_bottom);
|
||||||
graph.line(right_mid, right_bottom);
|
graph.line(right_mid, right_bottom);
|
||||||
|
|
||||||
@@ -557,7 +554,7 @@ namespace nana
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
graph.set_color(clr);
|
graph.palette(false, clr);
|
||||||
|
|
||||||
const int x = r.x + 4;
|
const int x = r.x + 4;
|
||||||
const int y = r.y + 4;
|
const int y = r.y + 4;
|
||||||
@@ -959,13 +956,13 @@ namespace nana
|
|||||||
ps[11].x = r.x + gap;
|
ps[11].x = r.x + gap;
|
||||||
ps[11].y = r.y + gap;
|
ps[11].y = r.y + gap;
|
||||||
|
|
||||||
graph.set_color(fgcolor.blend(colors::black, true));
|
graph.palette(false, fgcolor.blend(colors::black, true));
|
||||||
|
|
||||||
for (int i = 0; i < 11; ++i)
|
for (int i = 0; i < 11; ++i)
|
||||||
graph.line(ps[i], ps[i + 1]);
|
graph.line(ps[i], ps[i + 1]);
|
||||||
graph.line(ps[11], ps[0]);
|
graph.line(ps[11], ps[0]);
|
||||||
|
|
||||||
graph.set_color(fgcolor);
|
graph.palette(false, fgcolor);
|
||||||
|
|
||||||
unsigned thk_minus_2 = thickness_ - 2;
|
unsigned thk_minus_2 = thickness_ - 2;
|
||||||
graph.rectangle(rectangle{ ps[10].x + 1, ps[10].y + 1, (gap << 1) + thk_minus_2, thk_minus_2 }, true);
|
graph.rectangle(rectangle{ ps[10].x + 1, ps[10].y + 1, (gap << 1) + thk_minus_2, thk_minus_2 }, true);
|
||||||
@@ -1010,7 +1007,7 @@ namespace nana
|
|||||||
//Implement element_interface
|
//Implement element_interface
|
||||||
bool facade<element::arrow>::draw(graph_reference graph, const nana::color& bgcolor, const nana::color& fgcolor, const nana::rectangle& r, element_state estate)
|
bool facade<element::arrow>::draw(graph_reference graph, const nana::color& bgcolor, const nana::color& fgcolor, const nana::rectangle& r, element_state estate)
|
||||||
{
|
{
|
||||||
graph.set_color(fgcolor);
|
graph.palette(false, fgcolor);
|
||||||
return (*cite_)->draw(graph, bgcolor, fgcolor, r, estate, dir_);
|
return (*cite_)->draw(graph, bgcolor, fgcolor, r, estate, dir_);
|
||||||
}
|
}
|
||||||
//end class facade<element::arrow>
|
//end class facade<element::arrow>
|
||||||
|
|||||||
@@ -79,9 +79,8 @@ namespace nana
|
|||||||
|
|
||||||
void refresh(graph_reference& graph) override
|
void refresh(graph_reference& graph) override
|
||||||
{
|
{
|
||||||
graph.set_color(static_cast<color_rgb>(0x83EB));
|
graph.palette(true, colors::white);
|
||||||
graph.set_text_color(colors::white);
|
graph.rectangle(true, static_cast<color_rgb>(0x83EB));
|
||||||
graph.rectangle(true);
|
|
||||||
|
|
||||||
//draw caption
|
//draw caption
|
||||||
auto text = utf8_cast(API::window_caption(window_handle_));
|
auto text = utf8_cast(API::window_caption(window_handle_));
|
||||||
|
|||||||
@@ -280,6 +280,33 @@ namespace API
|
|||||||
{
|
{
|
||||||
restrict::bedrock.delay_restore(enable ? 0 : 1);
|
restrict::bedrock.delay_restore(enable ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void register_menu_window(window wd, bool has_keyboard)
|
||||||
|
{
|
||||||
|
internal_scope_guard lock;
|
||||||
|
if (restrict::wd_manager().available(reinterpret_cast<basic_window*>(wd)))
|
||||||
|
restrict::bedrock.set_menu(reinterpret_cast<basic_window*>(wd)->root, has_keyboard);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_menubar(window wd, bool attach)
|
||||||
|
{
|
||||||
|
auto iwd = reinterpret_cast<basic_window*>(wd);
|
||||||
|
internal_scope_guard lock;
|
||||||
|
if (restrict::wd_manager().available(iwd))
|
||||||
|
{
|
||||||
|
auto root_attr = iwd->root_widget->other.attribute.root;
|
||||||
|
if (attach)
|
||||||
|
{
|
||||||
|
if (!root_attr->menubar)
|
||||||
|
root_attr->menubar = iwd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (iwd == root_attr->menubar)
|
||||||
|
root_attr->menubar = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}//end namespace dev
|
}//end namespace dev
|
||||||
|
|
||||||
|
|
||||||
@@ -1141,6 +1168,7 @@ namespace API
|
|||||||
return reinterpret_cast<window>(ts_wd);
|
return reinterpret_cast<window>(ts_wd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
//glass_window deprecated
|
//glass_window deprecated
|
||||||
//@brief: Test a window whether it is a glass attribute.
|
//@brief: Test a window whether it is a glass attribute.
|
||||||
bool glass_window(window wd)
|
bool glass_window(window wd)
|
||||||
@@ -1156,6 +1184,7 @@ namespace API
|
|||||||
effects_bground_remove(wd);
|
effects_bground_remove(wd);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
void take_active(window wd, bool active, window take_if_active_false)
|
void take_active(window wd, bool active, window take_if_active_false)
|
||||||
{
|
{
|
||||||
@@ -1247,36 +1276,6 @@ namespace API
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void register_menu_window(window wd, bool has_keyboard)
|
|
||||||
{
|
|
||||||
internal_scope_guard lock;
|
|
||||||
if(restrict::wd_manager().available(reinterpret_cast<basic_window*>(wd)))
|
|
||||||
restrict::bedrock.set_menu(reinterpret_cast<basic_window*>(wd)->root, has_keyboard);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool attach_menubar(window menubar)
|
|
||||||
{
|
|
||||||
auto iwd = reinterpret_cast<basic_window*>(menubar);
|
|
||||||
internal_scope_guard lock;
|
|
||||||
if(restrict::wd_manager().available(iwd) && (nullptr == iwd->root_widget->other.attribute.root->menubar))
|
|
||||||
{
|
|
||||||
iwd->root_widget->other.attribute.root->menubar = iwd;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void detach_menubar(window menubar)
|
|
||||||
{
|
|
||||||
auto iwd = reinterpret_cast<basic_window*>(menubar);
|
|
||||||
internal_scope_guard lock;
|
|
||||||
if (restrict::wd_manager().available(iwd))
|
|
||||||
{
|
|
||||||
if (iwd->root_widget->other.attribute.root->menubar == iwd)
|
|
||||||
iwd->root_widget->other.attribute.root->menubar = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_window_zoomed(window wd, bool ask_for_max)
|
bool is_window_zoomed(window wd, bool ask_for_max)
|
||||||
{
|
{
|
||||||
auto const iwd = reinterpret_cast<basic_window*>(wd);
|
auto const iwd = reinterpret_cast<basic_window*>(wd);
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ namespace nana{ namespace drawerbase
|
|||||||
++pos.y;
|
++pos.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
graph.set_text_color(attr_.focus_color && attr_.focused ? ::nana::color(colors::blue) : attr_.fgcolor);
|
graph.palette(true, attr_.focus_color && attr_.focused ? ::nana::color(colors::blue) : attr_.fgcolor);
|
||||||
|
|
||||||
if (attr_.omitted)
|
if (attr_.omitted)
|
||||||
tr.render(pos, txtptr, txtlen, omitted_pixels, true);
|
tr.render(pos, txtptr, txtlen, omitted_pixels, true);
|
||||||
@@ -268,23 +268,22 @@ namespace nana{ namespace drawerbase
|
|||||||
pos.x += off_w;
|
pos.x += off_w;
|
||||||
pos.y += static_cast<int>(ascent + 2);
|
pos.y += static_cast<int>(ascent + 2);
|
||||||
|
|
||||||
graph.set_color(colors::black);
|
graph.line(pos, point{ pos.x + static_cast<int>(shortkey_size.width) - 1, pos.y }, colors::black);
|
||||||
graph.line(pos, point{ pos.x + static_cast<int>(shortkey_size.width) - 1, pos.y });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
graph.set_text_color(::nana::color(colors::white));
|
graph.palette(true, ::nana::color(colors::white));
|
||||||
if(attr_.omitted)
|
if(attr_.omitted)
|
||||||
{
|
{
|
||||||
tr.render(point{ pos.x + 1, pos.y + 1 }, txtptr, txtlen, omitted_pixels, true);
|
tr.render(point{ pos.x + 1, pos.y + 1 }, txtptr, txtlen, omitted_pixels, true);
|
||||||
graph.set_text_color(::nana::color(colors::gray));
|
graph.palette(true, ::nana::color(colors::gray));
|
||||||
tr.render(pos, txtptr, txtlen, omitted_pixels, true);
|
tr.render(pos, txtptr, txtlen, omitted_pixels, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
graph.bidi_string(point{ pos.x + 1, pos.y + 1 }, txtptr, txtlen);
|
graph.bidi_string(point{ pos.x + 1, pos.y + 1 }, txtptr, txtlen);
|
||||||
graph.set_text_color(::nana::color(colors::gray));
|
graph.palette(true, ::nana::color(colors::gray));
|
||||||
graph.bidi_string(pos, txtptr, txtlen);
|
graph.bidi_string(pos, txtptr, txtlen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -325,10 +324,10 @@ namespace nana{ namespace drawerbase
|
|||||||
::nana::color lt(static_cast<color_rgb>(0x7f7f7f)), rb(static_cast<color_rgb>(0x707070));
|
::nana::color lt(static_cast<color_rgb>(0x7f7f7f)), rb(static_cast<color_rgb>(0x707070));
|
||||||
graph.frame_rectangle(r, lt, lt, rb, rb);
|
graph.frame_rectangle(r, lt, lt, rb, rb);
|
||||||
|
|
||||||
graph.set_color(colors::button_face);
|
graph.palette(false, colors::button_face);
|
||||||
draw_corner_point(graph, r);
|
draw_corner_point(graph, r);
|
||||||
|
|
||||||
graph.set_color(static_cast<color_rgb>(0x919191));
|
graph.palette(false, static_cast<color_rgb>(0x919191));
|
||||||
draw_corner_point(graph, r.pare_off(1));
|
draw_corner_point(graph, r.pare_off(1));
|
||||||
|
|
||||||
if (element_state::pressed == attr_.e_state)
|
if (element_state::pressed == attr_.e_state)
|
||||||
|
|||||||
@@ -191,12 +191,12 @@ namespace nana
|
|||||||
int bottom = y + height - 1;
|
int bottom = y + height - 1;
|
||||||
int right = x + width - 1;
|
int right = x + width - 1;
|
||||||
|
|
||||||
graph.set_color(static_cast<color_rgb>(0x6E8D9F));
|
graph.palette(false, static_cast<color_rgb>(0x6E8D9F));
|
||||||
graph.line(point{ x, y }, point{right, y});
|
graph.line(point{ x, y }, point{right, y});
|
||||||
graph.line(point{ x, y + 1 }, point{ x, bottom });
|
graph.line(point{ x, y + 1 }, point{ x, bottom });
|
||||||
++x;
|
++x;
|
||||||
++y;
|
++y;
|
||||||
graph.set_color(color(0xa6, 0xc7, 0xd9));
|
graph.palette(false, color(0xa6, 0xc7, 0xd9));
|
||||||
graph.line(point{ x, y }, point{ right, y });
|
graph.line(point{ x, y }, point{ right, y });
|
||||||
graph.line(point{ x, y + 1 }, point{ x, bottom });
|
graph.line(point{ x, y + 1 }, point{ x, bottom });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,12 +105,12 @@ namespace checkbox
|
|||||||
nana::paint::text_renderer tr(graph);
|
nana::paint::text_renderer tr(graph);
|
||||||
if (API::window_enabled(widget_->handle()) == false)
|
if (API::window_enabled(widget_->handle()) == false)
|
||||||
{
|
{
|
||||||
graph.set_text_color(colors::white);
|
graph.palette(true, colors::white);
|
||||||
tr.render({ 17 + interval, 2 }, title.c_str(), title.length(), pixels);
|
tr.render({ 17 + interval, 2 }, title.c_str(), title.length(), pixels);
|
||||||
graph.set_text_color({ 0x80, 0x80, 0x80 });
|
graph.palette(true, { 0x80, 0x80, 0x80 });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
graph.set_text_color(widget_->fgcolor());
|
graph.palette(true, widget_->fgcolor());
|
||||||
|
|
||||||
tr.render({ 16 + interval, 1 }, title.c_str(), title.length(), pixels);
|
tr.render({ 16 + interval, 1 }, title.c_str(), title.length(), pixels);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,8 +111,7 @@ namespace nana
|
|||||||
int xpos = static_cast<int>(graph.width() - txt_s.width) / 2;
|
int xpos = static_cast<int>(graph.width() - txt_s.width) / 2;
|
||||||
if(xpos < border_size + 16) xpos = 16 + border_size + 1;
|
if(xpos < border_size + 16) xpos = 16 + border_size + 1;
|
||||||
|
|
||||||
graph.set_text_color(pos_ == where::topbar ? color_.highlight : color_.normal);
|
graph.string({ xpos, top }, str, (pos_ == where::topbar ? color_.highlight : color_.normal));
|
||||||
graph.string({ xpos, top }, str);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,9 +166,8 @@ namespace nana
|
|||||||
if(false == primary)
|
if(false == primary)
|
||||||
color = { 0xB0, 0xB0, 0xB0 };
|
color = { 0xB0, 0xB0, 0xB0 };
|
||||||
|
|
||||||
nana::size txt_s = graph.text_extent_size(str_utf8);
|
auto txt_s = graph.text_extent_size(str_utf8);
|
||||||
graph.set_text_color(color);
|
graph.string({ r.x + static_cast<int>(r.width - txt_s.width) / 2, r.y + static_cast<int>(r.height - txt_s.height) / 2 }, str_utf8, color);
|
||||||
graph.string({ r.x + static_cast<int>(r.width - txt_s.width) / 2, r.y + static_cast<int>(r.height - txt_s.height) / 2 }, str_utf8);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void trigger::_m_draw_pos(drawing_basis & dbasis, graph_reference graph, int x, int y, int number, bool primary, bool sel)
|
void trigger::_m_draw_pos(drawing_basis & dbasis, graph_reference graph, int x, int y, int number, bool primary, bool sel)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace nana
|
|||||||
|
|
||||||
auto right = r.right() - 1;
|
auto right = r.right() - 1;
|
||||||
auto bottom = r.bottom() - 1;
|
auto bottom = r.bottom() - 1;
|
||||||
graph.set_color(colors::white);
|
graph.palette(false, colors::white);
|
||||||
graph.set_pixel(r.x, r.y);
|
graph.set_pixel(r.x, r.y);
|
||||||
graph.set_pixel(right, r.y);
|
graph.set_pixel(right, r.y);
|
||||||
graph.set_pixel(r.x, bottom);
|
graph.set_pixel(r.x, bottom);
|
||||||
@@ -47,7 +47,7 @@ namespace nana
|
|||||||
|
|
||||||
--right;
|
--right;
|
||||||
--bottom;
|
--bottom;
|
||||||
graph.set_color(clr);
|
graph.palette(false, clr);
|
||||||
graph.set_pixel(r.x + 1, r.y + 1);
|
graph.set_pixel(r.x + 1, r.y + 1);
|
||||||
graph.set_pixel(right, r.y + 1);
|
graph.set_pixel(right, r.y + 1);
|
||||||
graph.set_pixel(r.x + 1, bottom);
|
graph.set_pixel(r.x + 1, bottom);
|
||||||
@@ -103,8 +103,8 @@ namespace nana
|
|||||||
}
|
}
|
||||||
x += (image_pixels_ + 2);
|
x += (image_pixels_ + 2);
|
||||||
}
|
}
|
||||||
graph.set_text_color(colors::black);
|
|
||||||
graph.string({ x, r.y + 2 }, item->text());
|
graph.string({ x, r.y + 2 }, item->text(), colors::black);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned item_pixels(graph_reference graph) const
|
unsigned item_pixels(graph_reference graph) const
|
||||||
|
|||||||
@@ -2855,7 +2855,7 @@ namespace nana
|
|||||||
auto fgcolor = wdptr->fgcolor();
|
auto fgcolor = wdptr->fgcolor();
|
||||||
|
|
||||||
unsigned header_w = essence_->header.pixels();
|
unsigned header_w = essence_->header.pixels();
|
||||||
essence_->graph->set_color(bgcolor);
|
essence_->graph->palette(false, bgcolor);
|
||||||
if(header_w - essence_->scroll.offset_x < rect.width)
|
if(header_w - essence_->scroll.offset_x < rect.width)
|
||||||
essence_->graph->rectangle(rectangle{ point(rect.x + static_cast<int>(header_w)-essence_->scroll.offset_x, rect.y),
|
essence_->graph->rectangle(rectangle{ point(rect.x + static_cast<int>(header_w)-essence_->scroll.offset_x, rect.y),
|
||||||
size(static_cast<int>(rect.width) + essence_->scroll.offset_x - static_cast<int>(header_w), rect.height) },
|
size(static_cast<int>(rect.width) + essence_->scroll.offset_x - static_cast<int>(header_w), rect.height) },
|
||||||
@@ -3154,31 +3154,28 @@ namespace nana
|
|||||||
if (item_state::highlighted == state)
|
if (item_state::highlighted == state)
|
||||||
it_bgcolor = it_bgcolor.blend(static_cast<color_rgb>(0x99defd), 0.8);
|
it_bgcolor = it_bgcolor.blend(static_cast<color_rgb>(0x99defd), 0.8);
|
||||||
|
|
||||||
graph->set_color(it_bgcolor);
|
graph->rectangle(rectangle{ item_xpos, y, header.pixels, essence_->item_size }, true, it_bgcolor);
|
||||||
|
|
||||||
graph->rectangle(rectangle{ item_xpos, y, header.pixels, essence_->item_size }, true);
|
|
||||||
|
|
||||||
cell_txtcolor = m_cell.custom_format->fgcolor;
|
cell_txtcolor = m_cell.custom_format->fgcolor;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (draw_column)
|
if (draw_column)
|
||||||
{
|
{
|
||||||
graph->set_text_color(cell_txtcolor);
|
graph->string(point{ item_xpos + content_pos, y + txtoff }, m_cell.text, cell_txtcolor); // draw full text of the cell index (column)
|
||||||
graph->string(point{ item_xpos + content_pos, y + txtoff }, m_cell.text); // draw full text of the cell index (column)
|
|
||||||
|
|
||||||
if (static_cast<int>(ts.width) > static_cast<int>(header.pixels) - (content_pos + item_xpos)) // it was an excess
|
if (static_cast<int>(ts.width) > static_cast<int>(header.pixels) - (content_pos + item_xpos)) // it was an excess
|
||||||
{
|
{
|
||||||
//The text is painted over the next subitem // here beging the ...
|
//The text is painted over the next subitem // here beging the ...
|
||||||
int xpos = item_xpos + static_cast<int>(header.pixels) - static_cast<int>(essence_->suspension_width);
|
int xpos = item_xpos + static_cast<int>(header.pixels) - static_cast<int>(essence_->suspension_width);
|
||||||
|
|
||||||
graph->set_color(it_bgcolor); // litter rect with the item bg end ...
|
// litter rect with the item bg end ...
|
||||||
graph->rectangle(rectangle{ xpos, y + 2, essence_->suspension_width, essence_->item_size - 4 }, true);
|
graph->rectangle(rectangle{ xpos, y + 2, essence_->suspension_width, essence_->item_size - 4 }, true, it_bgcolor);
|
||||||
graph->string(point{ xpos, y + 2 }, L"...");
|
graph->string(point{ xpos, y + 2 }, L"...");
|
||||||
|
|
||||||
//Erase the part that over the next subitem only if the right of column is less than right of listbox
|
//Erase the part that over the next subitem only if the right of column is less than right of listbox
|
||||||
if (item_xpos + content_pos < content_r.right() - static_cast<int>(header.pixels))
|
if (item_xpos + content_pos < content_r.right() - static_cast<int>(header.pixels))
|
||||||
{
|
{
|
||||||
graph->set_color(bgcolor); // we need to erase the excess, because some cell may not draw text over
|
graph->palette(false, bgcolor); // we need to erase the excess, because some cell may not draw text over
|
||||||
graph->rectangle(rectangle{ item_xpos + static_cast<int>(header.pixels), y + 2,
|
graph->rectangle(rectangle{ item_xpos + static_cast<int>(header.pixels), y + 2,
|
||||||
ts.width + static_cast<unsigned>(content_pos)-header.pixels, essence_->item_size - 4 }, true);
|
ts.width + static_cast<unsigned>(content_pos)-header.pixels, essence_->item_size - 4 }, true);
|
||||||
}
|
}
|
||||||
@@ -3193,10 +3190,9 @@ namespace nana
|
|||||||
|
|
||||||
item_xpos += static_cast<int>(header.pixels);
|
item_xpos += static_cast<int>(header.pixels);
|
||||||
if (display_order + 1 >= seqs.size() && static_cast<int>(extreme_text) > item_xpos)
|
if (display_order + 1 >= seqs.size() && static_cast<int>(extreme_text) > item_xpos)
|
||||||
{
|
{
|
||||||
graph->set_color(item.bgcolor);
|
graph->rectangle(rectangle{item_xpos , y + 2, extreme_text - item_xpos, essence_->item_size - 4}, true, item.bgcolor);
|
||||||
graph->rectangle(rectangle{item_xpos , y + 2, extreme_text - item_xpos, essence_->item_size - 4}, true);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Draw selecting inner rectangle
|
//Draw selecting inner rectangle
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ namespace nana
|
|||||||
nana::point(r.x + r.width - 1, r.y + r.height - 1)
|
nana::point(r.x + r.width - 1, r.y + r.height - 1)
|
||||||
};
|
};
|
||||||
|
|
||||||
graph.set_color(static_cast<color_rgb>(0xc0ddfc));
|
graph.palette(false, static_cast<color_rgb>(0xc0ddfc));
|
||||||
for(int i = 0; i < 4; ++i)
|
for(int i = 0; i < 4; ++i)
|
||||||
graph.set_pixel(points[i].x, points[i].y);
|
graph.set_pixel(points[i].x, points[i].y);
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ namespace nana
|
|||||||
|
|
||||||
void item_text(graph_reference graph, const nana::point& pos, const std::string& text, unsigned text_pixels, const attr& at)
|
void item_text(graph_reference graph, const nana::point& pos, const std::string& text, unsigned text_pixels, const attr& at)
|
||||||
{
|
{
|
||||||
graph.set_text_color(at.enabled ? colors::black : colors::gray_border);
|
graph.palette(true, at.enabled ? colors::black : colors::gray_border);
|
||||||
nana::paint::text_renderer tr(graph);
|
nana::paint::text_renderer tr(graph);
|
||||||
|
|
||||||
auto wstr = to_wstring(text);
|
auto wstr = to_wstring(text);
|
||||||
@@ -372,8 +372,7 @@ namespace nana
|
|||||||
{
|
{
|
||||||
if (m.flags.splitter)
|
if (m.flags.splitter)
|
||||||
{
|
{
|
||||||
graph_->set_color(colors::gray_border);
|
graph_->line({ item_r.x + 40, item_r.y }, { static_cast<int>(graph.width()) - 1, item_r.y }, colors::gray_border);
|
||||||
graph_->line({ item_r.x + 40, item_r.y }, { static_cast<int>(graph.width()) - 1, item_r.y });
|
|
||||||
item_r.y += 2;
|
item_r.y += 2;
|
||||||
++pos;
|
++pos;
|
||||||
continue;
|
continue;
|
||||||
@@ -403,8 +402,7 @@ namespace nana
|
|||||||
int x = item_r.x + 40 + off_w;
|
int x = item_r.x + 40 + off_w;
|
||||||
int y = item_r.y + text_top_off + hotkey_size.height;
|
int y = item_r.y + text_top_off + hotkey_size.height;
|
||||||
|
|
||||||
graph_->set_color(colors::black);
|
graph_->line({ x, y }, { x + static_cast<int>(hotkey_size.width) - 1, y }, colors::black);
|
||||||
graph_->line({ x, y }, { x + static_cast<int>(hotkey_size.width) - 1, y });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -751,7 +749,7 @@ namespace nana
|
|||||||
if(submenu_.parent == nullptr)
|
if(submenu_.parent == nullptr)
|
||||||
{
|
{
|
||||||
state_.owner_menubar = owner_menubar;
|
state_.owner_menubar = owner_menubar;
|
||||||
API::register_menu_window(this->handle(), !owner_menubar);
|
API::dev::register_menu_window(this->handle(), !owner_menubar);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto & events = this->events();
|
auto & events = this->events();
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ namespace nana
|
|||||||
|
|
||||||
int right = pos.x + static_cast<int>(size.width) - 1;
|
int right = pos.x + static_cast<int>(size.width) - 1;
|
||||||
int bottom = pos.y + static_cast<int>(size.height) - 1;
|
int bottom = pos.y + static_cast<int>(size.height) - 1;
|
||||||
graph_.set_color(corner);
|
graph_.palette(false, corner);
|
||||||
graph_.set_pixel(pos.x, pos.y);
|
graph_.set_pixel(pos.x, pos.y);
|
||||||
graph_.set_pixel(right, pos.y);
|
graph_.set_pixel(right, pos.y);
|
||||||
graph_.set_pixel(pos.x, bottom);
|
graph_.set_pixel(pos.x, bottom);
|
||||||
@@ -608,7 +608,8 @@ namespace nana
|
|||||||
{
|
{
|
||||||
widget_object<category::widget_tag, drawerbase::menubar::trigger>
|
widget_object<category::widget_tag, drawerbase::menubar::trigger>
|
||||||
::create(wd, rectangle(nana::size(API::window_size(wd).width, 28)));
|
::create(wd, rectangle(nana::size(API::window_size(wd).width, 28)));
|
||||||
API::attach_menubar(handle());
|
|
||||||
|
API::dev::set_menubar(handle(), true);
|
||||||
evt_resized_ = API::events(wd).resized([this](const ::nana::arg_resized& arg)
|
evt_resized_ = API::events(wd).resized([this](const ::nana::arg_resized& arg)
|
||||||
{
|
{
|
||||||
auto sz = this->size();
|
auto sz = this->size();
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ namespace nana
|
|||||||
graph.rectangle(r, false, clr);
|
graph.rectangle(r, false, clr);
|
||||||
|
|
||||||
clr = clr.blend(colors::white, 0.5);
|
clr = clr.blend(colors::white, 0.5);
|
||||||
graph.set_color(clr);
|
graph.palette(false, clr);
|
||||||
|
|
||||||
r.pare_off(2);
|
r.pare_off(2);
|
||||||
if(vertical_)
|
if(vertical_)
|
||||||
|
|||||||
@@ -2971,7 +2971,7 @@ namespace nana{ namespace widgets
|
|||||||
|
|
||||||
void text_editor::_m_draw_parse_string(const keyword_parser& parser, bool rtl, ::nana::point pos, const ::nana::color& fgcolor, const wchar_t* str, std::size_t len) const
|
void text_editor::_m_draw_parse_string(const keyword_parser& parser, bool rtl, ::nana::point pos, const ::nana::color& fgcolor, const wchar_t* str, std::size_t len) const
|
||||||
{
|
{
|
||||||
graph_.set_text_color(fgcolor);
|
graph_.palette(true, fgcolor);
|
||||||
graph_.string(pos, str, len);
|
graph_.string(pos, str, len);
|
||||||
if (parser.entities().empty())
|
if (parser.entities().empty())
|
||||||
return;
|
return;
|
||||||
@@ -3010,8 +3010,8 @@ namespace nana{ namespace widgets
|
|||||||
auto ent_end = (ent.end < str_end ? ent.end : str_end);
|
auto ent_end = (ent.end < str_end ? ent.end : str_end);
|
||||||
auto ent_pixels = std::accumulate(glyphs + (ent_begin - str), glyphs + (ent_end - str), unsigned{});
|
auto ent_pixels = std::accumulate(glyphs + (ent_begin - str), glyphs + (ent_end - str), unsigned{});
|
||||||
|
|
||||||
canvas.set_color(ent.scheme->bgcolor.invisible() ? _m_bgcolor() : ent.scheme->bgcolor);
|
canvas.palette(false, ent.scheme->bgcolor.invisible() ? _m_bgcolor() : ent.scheme->bgcolor);
|
||||||
canvas.set_text_color(ent.scheme->fgcolor.invisible() ? fgcolor : ent.scheme->fgcolor);
|
canvas.palette(true, ent.scheme->fgcolor.invisible() ? fgcolor : ent.scheme->fgcolor);
|
||||||
|
|
||||||
canvas.rectangle(true);
|
canvas.rectangle(true);
|
||||||
|
|
||||||
@@ -3058,9 +3058,8 @@ namespace nana{ namespace widgets
|
|||||||
|
|
||||||
//The line of text is in the range of selection
|
//The line of text is in the range of selection
|
||||||
nana::upoint a, b;
|
nana::upoint a, b;
|
||||||
graph_.set_text_color(clr);
|
graph_.palette(true, clr);
|
||||||
|
graph_.palette(false, scheme_->selection.get_color());
|
||||||
graph_.set_color(scheme_->selection.get_color());
|
|
||||||
|
|
||||||
//The text is not selected or the whole line text is selected
|
//The text is not selected or the whole line text is selected
|
||||||
if (!focused || (!_m_get_sort_select_points(a, b)) || (select_.a.y != str_pos.y && select_.b.y != str_pos.y))
|
if (!focused || (!_m_get_sort_select_points(a, b)) || (select_.a.y != str_pos.y && select_.b.y != str_pos.y))
|
||||||
@@ -3075,7 +3074,7 @@ namespace nana{ namespace widgets
|
|||||||
{
|
{
|
||||||
if (selected && focused)
|
if (selected && focused)
|
||||||
{
|
{
|
||||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
graph_.palette(true, scheme_->selection_text.get_color());
|
||||||
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true);
|
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true);
|
||||||
graph_.string(text_pos, ent.begin, len);
|
graph_.string(text_pos, ent.begin, len);
|
||||||
}
|
}
|
||||||
@@ -3099,7 +3098,7 @@ namespace nana{ namespace widgets
|
|||||||
|
|
||||||
int sel_xpos = static_cast<int>(str_px - (glyph_front + glyph_selected));
|
int sel_xpos = static_cast<int>(str_px - (glyph_front + glyph_selected));
|
||||||
|
|
||||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
graph.palette(true, scheme_->selection_text.get_color());
|
||||||
graph.string({-sel_xpos, 0}, str, len);
|
graph.string({-sel_xpos, 0}, str, len);
|
||||||
graph_.bitblt(nana::rectangle(strpos.x + sel_xpos, strpos.y, glyph_selected, line_h_pixels), graph);
|
graph_.bitblt(nana::rectangle(strpos.x + sel_xpos, strpos.y, glyph_selected, line_h_pixels), graph);
|
||||||
};
|
};
|
||||||
@@ -3123,7 +3122,7 @@ namespace nana{ namespace widgets
|
|||||||
if (a.x <= pos && str_end <= b.x)
|
if (a.x <= pos && str_end <= b.x)
|
||||||
{
|
{
|
||||||
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true);
|
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true);
|
||||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
graph_.palette(true, scheme_->selection_text.get_color());
|
||||||
graph_.string(text_pos, ent.begin, len);
|
graph_.string(text_pos, ent.begin, len);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -3139,7 +3138,7 @@ namespace nana{ namespace widgets
|
|||||||
auto head_w = std::accumulate(pxbuf, pxbuf + (a.x - pos), unsigned());
|
auto head_w = std::accumulate(pxbuf, pxbuf + (a.x - pos), unsigned());
|
||||||
auto sel_w = std::accumulate(pxbuf + (a.x - pos), pxbuf + (endpos - pos), unsigned());
|
auto sel_w = std::accumulate(pxbuf + (a.x - pos), pxbuf + (endpos - pos), unsigned());
|
||||||
|
|
||||||
graph_.set_text_color(clr);
|
graph_.palette(true, clr);
|
||||||
if (is_right_text(ent))
|
if (is_right_text(ent))
|
||||||
{ //RTL
|
{ //RTL
|
||||||
rtl_string(text_pos, ent.begin, len, str_w, head_w, sel_w);
|
rtl_string(text_pos, ent.begin, len, str_w, head_w, sel_w);
|
||||||
@@ -3153,7 +3152,7 @@ namespace nana{ namespace widgets
|
|||||||
|
|
||||||
//Draw selected part
|
//Draw selected part
|
||||||
graph_.rectangle(::nana::rectangle{ part_pos, { sel_w, line_h_pixels } }, true);
|
graph_.rectangle(::nana::rectangle{ part_pos, { sel_w, line_h_pixels } }, true);
|
||||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
graph_.palette(true, scheme_->selection_text.get_color());
|
||||||
graph_.string(part_pos, ent.begin + (a.x - pos), endpos - a.x);
|
graph_.string(part_pos, ent.begin + (a.x - pos), endpos - a.x);
|
||||||
|
|
||||||
if (static_cast<size_t>(endpos) < str_end)
|
if (static_cast<size_t>(endpos) < str_end)
|
||||||
@@ -3171,14 +3170,14 @@ namespace nana{ namespace widgets
|
|||||||
|
|
||||||
if (is_right_text(ent))
|
if (is_right_text(ent))
|
||||||
{ //RTL
|
{ //RTL
|
||||||
graph_.set_text_color(clr);
|
graph_.palette(true, clr);
|
||||||
rtl_string(text_pos, ent.begin, len, str_w, 0, sel_w);
|
rtl_string(text_pos, ent.begin, len, str_w, 0, sel_w);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //LTR
|
{ //LTR
|
||||||
//Draw selected part
|
//Draw selected part
|
||||||
graph_.rectangle(::nana::rectangle{ text_pos, { sel_w, line_h_pixels } }, true);
|
graph_.rectangle(::nana::rectangle{ text_pos, { sel_w, line_h_pixels } }, true);
|
||||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
graph_.palette(true, scheme_->selection_text.get_color());
|
||||||
graph_.string(text_pos, ent.begin, endpos - pos);
|
graph_.string(text_pos, ent.begin, endpos - pos);
|
||||||
|
|
||||||
_m_draw_parse_string(parser, false, text_pos + ::nana::point(static_cast<int>(sel_w), 0), clr, ent.begin + (endpos - pos), str_end - endpos);
|
_m_draw_parse_string(parser, false, text_pos + ::nana::point(static_cast<int>(sel_w), 0), clr, ent.begin + (endpos - pos), str_end - endpos);
|
||||||
@@ -3196,7 +3195,7 @@ namespace nana{ namespace widgets
|
|||||||
unsigned str_w = graph_.text_extent_size(ent.begin, len).width;
|
unsigned str_w = graph_.text_extent_size(ent.begin, len).width;
|
||||||
if ((text_pos.x + static_cast<int>(str_w) > text_area_.area.x) && (text_pos.x < text_right))
|
if ((text_pos.x + static_cast<int>(str_w) > text_area_.area.x) && (text_pos.x < text_right))
|
||||||
{
|
{
|
||||||
graph_.set_text_color(clr);
|
graph_.palette(true, clr);
|
||||||
std::size_t pos = ent.begin - strbeg + str_pos.x;
|
std::size_t pos = ent.begin - strbeg + str_pos.x;
|
||||||
if ((pos + len <= a.x) || (a.x < pos)) //Not selected or selected all
|
if ((pos + len <= a.x) || (a.x < pos)) //Not selected or selected all
|
||||||
{
|
{
|
||||||
@@ -3204,7 +3203,7 @@ namespace nana{ namespace widgets
|
|||||||
{
|
{
|
||||||
//Draw selected all
|
//Draw selected all
|
||||||
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true, static_cast<color_rgb>(0x3399FF));
|
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true, static_cast<color_rgb>(0x3399FF));
|
||||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
graph_.palette(true, scheme_->selection_text.get_color());
|
||||||
graph_.string(text_pos, ent.begin, len);
|
graph_.string(text_pos, ent.begin, len);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -3225,7 +3224,7 @@ namespace nana{ namespace widgets
|
|||||||
|
|
||||||
//Draw selected part
|
//Draw selected part
|
||||||
graph_.rectangle(::nana::rectangle{ part_pos, {str_w - head_w, line_h_pixels } }, true);
|
graph_.rectangle(::nana::rectangle{ part_pos, {str_w - head_w, line_h_pixels } }, true);
|
||||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
graph_.palette(true, scheme_->selection_text.get_color());
|
||||||
graph_.string(part_pos, ent.begin + a.x - pos, len - (a.x - pos));
|
graph_.string(part_pos, ent.begin + a.x - pos, len - (a.x - pos));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3249,12 +3248,12 @@ namespace nana{ namespace widgets
|
|||||||
if ((text_pos.x + static_cast<int>(str_w) > text_area_.area.x) && (text_pos.x < text_right))
|
if ((text_pos.x + static_cast<int>(str_w) > text_area_.area.x) && (text_pos.x < text_right))
|
||||||
{
|
{
|
||||||
std::size_t pos = ent.begin - strbeg + str_pos.x;
|
std::size_t pos = ent.begin - strbeg + str_pos.x;
|
||||||
graph_.set_text_color(clr);
|
graph_.palette(true, clr);
|
||||||
if (pos + len <= b.x)
|
if (pos + len <= b.x)
|
||||||
{
|
{
|
||||||
//Draw selected part
|
//Draw selected part
|
||||||
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true);
|
graph_.rectangle(::nana::rectangle{ text_pos, { str_w, line_h_pixels } }, true);
|
||||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
graph_.palette(true, scheme_->selection_text.get_color());
|
||||||
graph_.string(text_pos, ent.begin, len);
|
graph_.string(text_pos, ent.begin, len);
|
||||||
}
|
}
|
||||||
else if (pos <= b.x && b.x < pos + len)
|
else if (pos <= b.x && b.x < pos + len)
|
||||||
@@ -3268,7 +3267,7 @@ namespace nana{ namespace widgets
|
|||||||
{
|
{
|
||||||
//draw selected part
|
//draw selected part
|
||||||
graph_.rectangle(::nana::rectangle{ text_pos, { sel_w, line_h_pixels } }, true);
|
graph_.rectangle(::nana::rectangle{ text_pos, { sel_w, line_h_pixels } }, true);
|
||||||
graph_.set_text_color(scheme_->selection_text.get_color());
|
graph_.palette(true, scheme_->selection_text.get_color());
|
||||||
graph_.string(text_pos, ent.begin, b.x - pos);
|
graph_.string(text_pos, ent.begin, b.x - pos);
|
||||||
|
|
||||||
_m_draw_parse_string(parser, false, text_pos + ::nana::point(static_cast<int>(sel_w), 0), clr, ent.begin + b.x - pos, len - (b.x - pos));
|
_m_draw_parse_string(parser, false, text_pos + ::nana::point(static_cast<int>(sel_w), 0), clr, ent.begin + b.x - pos, len - (b.x - pos));
|
||||||
|
|||||||
@@ -50,8 +50,7 @@ namespace nana
|
|||||||
virtual void adorn_textbox(window, graph_reference graph, const std::string& str, const nana::rectangle & r)
|
virtual void adorn_textbox(window, graph_reference graph, const std::string& str, const nana::rectangle & r)
|
||||||
{
|
{
|
||||||
graph.rectangle(r, false, colors::white);
|
graph.rectangle(r, false, colors::white);
|
||||||
graph.set_text_color(colors::white);
|
graph.string({ r.x + 2, r.y + 1 }, str, colors::white);
|
||||||
graph.string({ r.x + 2, r.y + 1 }, str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void slider(window, graph_reference graph, const slider_t& s)
|
virtual void slider(window, graph_reference graph, const slider_t& s)
|
||||||
|
|||||||
@@ -1004,7 +1004,7 @@ namespace nana
|
|||||||
if(item.text.size())
|
if(item.text.size())
|
||||||
{
|
{
|
||||||
nana::size ts = basis_.graph->text_extent_size(item.text);
|
nana::size ts = basis_.graph->text_extent_size(item.text);
|
||||||
basis_.graph->set_text_color(m.fgcolor.invisible() ? fgcolor : m.fgcolor);
|
basis_.graph->palette(true, m.fgcolor.invisible() ? fgcolor : m.fgcolor);
|
||||||
nana::paint::text_renderer tr(*basis_.graph);
|
nana::paint::text_renderer tr(*basis_.graph);
|
||||||
|
|
||||||
std::wstring wtext = to_wstring(item.text);
|
std::wstring wtext = to_wstring(item.text);
|
||||||
@@ -1030,7 +1030,7 @@ namespace nana
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
basis_.graph->set_color(static_cast<color_rgb>(0x808080));
|
basis_.graph->palette(false, static_cast<color_rgb>(0x808080));
|
||||||
|
|
||||||
int right = static_cast<int>(basis_.graph->width());
|
int right = static_cast<int>(basis_.graph->width());
|
||||||
int end = active_m.r.x + static_cast<int>(active_m.r.width);
|
int end = active_m.r.x + static_cast<int>(active_m.r.width);
|
||||||
@@ -1453,8 +1453,8 @@ namespace nana
|
|||||||
rectangle r{ m.pos_ends.first, 0, static_cast<unsigned>(m.pos_ends.second - m.pos_ends.first), graph.height() };
|
rectangle r{ m.pos_ends.first, 0, static_cast<unsigned>(m.pos_ends.second - m.pos_ends.first), graph.height() };
|
||||||
if (indexes.active_pos == pos)
|
if (indexes.active_pos == pos)
|
||||||
{
|
{
|
||||||
graph.set_color(colors::white);
|
graph.palette(false, colors::white);
|
||||||
graph.set_text_color(colors::black);
|
graph.palette(true, colors::black);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1463,8 +1463,8 @@ namespace nana
|
|||||||
if (pos == indexes.hovered_pos)
|
if (pos == indexes.hovered_pos)
|
||||||
bgcolor = bgcolor.blend(colors::white, 0.5);
|
bgcolor = bgcolor.blend(colors::white, 0.5);
|
||||||
|
|
||||||
graph.set_color(bgcolor);
|
graph.palette(false, bgcolor);
|
||||||
graph.set_text_color(colors::white);
|
graph.palette(true, colors::white);
|
||||||
}
|
}
|
||||||
|
|
||||||
graph.rectangle(r, true);
|
graph.rectangle(r, true);
|
||||||
|
|||||||
@@ -138,9 +138,9 @@ namespace nana
|
|||||||
if (imgsize.width > scale) imgsize.width = scale;
|
if (imgsize.width > scale) imgsize.width = scale;
|
||||||
if (imgsize.height > scale) imgsize.height = scale;
|
if (imgsize.height > scale) imgsize.height = scale;
|
||||||
|
|
||||||
nana::point pos(x, y);
|
nana::point pos(
|
||||||
pos.x += static_cast<int>(scale + extra_size - imgsize.width) / 2;
|
x + static_cast<int>(scale + extra_size - imgsize.width) / 2,
|
||||||
pos.y += static_cast<int>(height - imgsize.height) / 2;
|
y + static_cast<int>(height - imgsize.height) / 2);
|
||||||
|
|
||||||
item.image.paste(::nana::rectangle{ imgsize }, graph, pos);
|
item.image.paste(::nana::rectangle{ imgsize }, graph, pos);
|
||||||
if(item.enable == false)
|
if(item.enable == false)
|
||||||
@@ -213,7 +213,7 @@ namespace nana
|
|||||||
int x = 2, y = 2;
|
int x = 2, y = 2;
|
||||||
|
|
||||||
auto bgcolor = API::bgcolor(widget_->handle());
|
auto bgcolor = API::bgcolor(widget_->handle());
|
||||||
graph.set_text_color(bgcolor);
|
graph.palette(true, bgcolor);
|
||||||
graph.gradual_rectangle(rectangle{ graph.size() }, bgcolor.blend(colors::white, 0.9), bgcolor.blend(colors::black, 0.95), true);
|
graph.gradual_rectangle(rectangle{ graph.size() }, bgcolor.blend(colors::white, 0.9), bgcolor.blend(colors::black, 0.95), true);
|
||||||
|
|
||||||
item_renderer ir(graph, impl_->textout, impl_->scale, bgcolor);
|
item_renderer ir(graph, impl_->textout, impl_->scale, bgcolor);
|
||||||
|
|||||||
@@ -873,18 +873,6 @@ namespace paint
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void graphics::set_color(const ::nana::color& col)
|
|
||||||
{
|
|
||||||
if (handle_)
|
|
||||||
handle_->set_color(col);
|
|
||||||
}
|
|
||||||
|
|
||||||
void graphics::set_text_color(const ::nana::color& col)
|
|
||||||
{
|
|
||||||
if (handle_)
|
|
||||||
handle_->set_text_color(col);
|
|
||||||
}
|
|
||||||
|
|
||||||
::nana::color graphics::palette(bool for_text) const
|
::nana::color graphics::palette(bool for_text) const
|
||||||
{
|
{
|
||||||
if (handle_)
|
if (handle_)
|
||||||
@@ -967,7 +955,7 @@ namespace paint
|
|||||||
|
|
||||||
void graphics::string(const point& pos, const std::string& text_utf8, const color& clr)
|
void graphics::string(const point& pos, const std::string& text_utf8, const color& clr)
|
||||||
{
|
{
|
||||||
set_text_color(clr);
|
palette(true, clr);
|
||||||
string(pos, text_utf8);
|
string(pos, text_utf8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1025,7 +1013,7 @@ namespace paint
|
|||||||
|
|
||||||
void graphics::string(const point& pos, const ::std::wstring& text, const color& clr)
|
void graphics::string(const point& pos, const ::std::wstring& text, const color& clr)
|
||||||
{
|
{
|
||||||
set_text_color(clr);
|
palette(true, clr);
|
||||||
string(pos, text.data(), text.size());
|
string(pos, text.data(), text.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1050,7 +1038,7 @@ namespace paint
|
|||||||
|
|
||||||
void graphics::line(const point& pos_a, const point& pos_b, const color& clr)
|
void graphics::line(const point& pos_a, const point& pos_b, const color& clr)
|
||||||
{
|
{
|
||||||
set_color(clr);
|
palette(false, clr);
|
||||||
line(pos_a, pos_b);
|
line(pos_a, pos_b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1085,7 +1073,7 @@ namespace paint
|
|||||||
|
|
||||||
void graphics::rectangle(bool solid, const ::nana::color& clr)
|
void graphics::rectangle(bool solid, const ::nana::color& clr)
|
||||||
{
|
{
|
||||||
set_color(clr);
|
palette(false, clr);
|
||||||
rectangle(::nana::rectangle{ size() }, solid);
|
rectangle(::nana::rectangle{ size() }, solid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1111,7 +1099,7 @@ namespace paint
|
|||||||
|
|
||||||
void graphics::rectangle(const ::nana::rectangle& r, bool solid, const color& clr)
|
void graphics::rectangle(const ::nana::rectangle& r, bool solid, const color& clr)
|
||||||
{
|
{
|
||||||
set_color(clr);
|
palette(false, clr);
|
||||||
rectangle(r, solid);
|
rectangle(r, solid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ namespace nana
|
|||||||
|
|
||||||
dum_graph.bitblt(r, graph, pos);
|
dum_graph.bitblt(r, graph, pos);
|
||||||
|
|
||||||
dum_graph.set_text_color(graph.palette(true));
|
dum_graph.palette(true, graph.palette(true));
|
||||||
dum_graph.string({}, i.begin, len);
|
dum_graph.string({}, i.begin, len);
|
||||||
|
|
||||||
r.x = pos.x;
|
r.x = pos.x;
|
||||||
|
|||||||
Reference in New Issue
Block a user