Added listbox color scheme

This commit is contained in:
cnjinhao
2014-12-30 06:28:23 +08:00
parent 052d34a746
commit aa12254844
22 changed files with 142 additions and 107 deletions

View File

@@ -21,7 +21,7 @@ namespace nana
{
if(active)
{
native_interface::caret_create(wd_->root, size_.width, size_.height);
native_interface::caret_create(wd_->root, size_);
real_visible_state_ = false;
visible_ = false;
this->position(point_.x, point_.y);
@@ -173,7 +173,7 @@ namespace nana
if(paint_size_ != size)
{
native_interface::caret_destroy(wd_->root);
native_interface::caret_create(wd_->root, size.width, size.height);
native_interface::caret_create(wd_->root, size);
real_visible_state_ = false;
if(visible_)
_m_visible(true);
@@ -181,7 +181,7 @@ namespace nana
paint_size_ = size;
}
native_interface::caret_pos(wd_->root, wd_->pos_root.x + pos.x, wd_->pos_root.y + pos.y);
native_interface::caret_pos(wd_->root, wd_->pos_root + pos);
}
}
//end class caret_descriptor

View File

@@ -29,6 +29,18 @@ namespace nana
return *this;
}
color_proxy& color_proxy::operator = (color_rgb clr)
{
color_ = std::make_shared<::nana::color>(clr);
return *this;
}
color_proxy& color_proxy::operator = (colors clr)
{
color_ = std::make_shared<::nana::color>(clr);
return *this;
}
color color_proxy::get_color() const
{
return *color_;

View File

@@ -1193,13 +1193,13 @@ namespace nana{
#endif
}
void native_interface::caret_create(native_window_type wd, unsigned width, unsigned height)
void native_interface::caret_create(native_window_type wd, const ::nana::size& caret_sz)
{
#if defined(NANA_WINDOWS)
::CreateCaret(reinterpret_cast<HWND>(wd), 0, int(width), int(height));
::CreateCaret(reinterpret_cast<HWND>(wd), 0, int(caret_sz.width), int(caret_sz.height));
#elif defined(NANA_X11)
nana::detail::platform_scope_guard psg;
restrict::spec.caret_open(wd, width, height);
restrict::spec.caret_open(wd, caret_sz);
#endif
}
@@ -1216,21 +1216,21 @@ namespace nana{
#endif
}
void native_interface::caret_pos(native_window_type wd, int x, int y)
void native_interface::caret_pos(native_window_type wd, const point& pos)
{
#if defined(NANA_WINDOWS)
if(::GetCurrentThreadId() != ::GetWindowThreadProcessId(reinterpret_cast<HWND>(wd), 0))
{
auto cp = new nana::detail::messages::caret;
cp->x = x;
cp->y = y;
cp->x = pos.x;
cp->y = pos.y;
::PostMessage(reinterpret_cast<HWND>(wd), nana::detail::messages::operate_caret, 2, reinterpret_cast<LPARAM>(cp));
}
else
::SetCaretPos(x, y);
::SetCaretPos(pos.x, pos.y);
#elif defined(NANA_X11)
nana::detail::platform_scope_guard psg;
restrict::spec.caret_pos(wd, x, y);
restrict::spec.caret_pos(wd, pos);
#endif
}