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

@@ -309,10 +309,10 @@ namespace nana
color& from_rgb(unsigned red, unsigned green, unsigned blue); ///< immutable alpha channel
color& from_hsl(double hue, double saturation, double lightness); ///< immutable alpha channel
color& blend(const color& bgcolor, bool ignore_bgcolor_alpha);
color blend(const color& bgcolor, bool ignore_bgcolor_alpha) const;
///< Blends two colors with the specified alpha, and the alpha values that come with these two colors are both ignored.
color& blend(const color& bgcolor, double alpha);
color blend(const color& bgcolor, double alpha) const;
bool invisible() const;
pixel_color_t px_color() const;

View File

@@ -223,9 +223,9 @@ namespace detail
void read_keystate(XKeyEvent&);
XIC caret_input_context(native_window_type) const;
void caret_open(native_window_type, unsigned width, unsigned height);
void caret_open(native_window_type, const ::nana::size&);
void caret_close(native_window_type);
void caret_pos(native_window_type, int x, int y);
void caret_pos(native_window_type, const ::nana::point&);
void caret_visible(native_window_type, bool);
void caret_flash(caret_tag&);
bool caret_update(native_window_type, nana::paint::graphics& root_graph, bool is_erase_caret_from_root_graph);

View File

@@ -69,9 +69,9 @@ namespace detail
static nana::point cursor_position();
static native_window_type get_owner_window(native_window_type);
//For Caret
static void caret_create(native_window_type, unsigned width, unsigned height);
static void caret_create(native_window_type, const ::nana::size&);
static void caret_destroy(native_window_type);
static void caret_pos(native_window_type, int x, int y);
static void caret_pos(native_window_type, const ::nana::point&);
static void caret_visible(native_window_type, bool);
static void set_focus(native_window_type);

View File

@@ -25,6 +25,8 @@ namespace nana
color_proxy(colors);
color_proxy& operator=(const color_proxy&);
color_proxy& operator=(const ::nana::color&);
color_proxy& operator=(color_rgb);
color_proxy& operator=(colors);
color get_color() const;
operator color() const;
private:

View File

@@ -230,7 +230,7 @@ namespace API
void create_caret(window, unsigned width, unsigned height);
void destroy_caret(window);
void caret_effective_range(window, const rectangle&);
void caret_pos(window, int x, int y);
void caret_pos(window, const ::nana::point&);
nana::point caret_pos(window);
nana::size caret_size(window);
void caret_size(window, const size&);

View File

@@ -431,6 +431,15 @@ namespace nana
basic_event<arg_listbox> checked;
basic_event<arg_listbox> selected;
};
struct scheme
: public widget_colors
{
color_proxy header_bgcolor{static_cast<color_rgb>(0xf1f2f4)};
color_proxy header_grabbed{ static_cast<color_rgb>(0x8BD6F6)};
color_proxy header_floated{ static_cast<color_rgb>(0xBABBBC)};
color_proxy item_selected{ static_cast<color_rgb>(0xD5EFFC) };
};
}
}//end namespace drawerbase
@@ -442,7 +451,7 @@ The user can \a drag the header to \a reisize it or to \a reorganize it.
By \a clicking on a header the list get \a reordered, first up, and then down alternatively,
*/
class listbox
: public widget_object<category::widget_tag, drawerbase::listbox::trigger, drawerbase::listbox::listbox_events>,
: public widget_object<category::widget_tag, drawerbase::listbox::trigger, drawerbase::listbox::listbox_events, drawerbase::listbox::scheme>,
public concepts::any_objective<drawerbase::listbox::size_type, 2>
{
public: