00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "precomp.h"
00010 #include "../API/GUI/checkbox.h"
00011 #include "../API/GUI/component_options.h"
00012 #include "../API/GUI/stylemanager.h"
00013 #include "checkbox_generic.h"
00014
00016
00017
00018 CL_CheckBox::CL_CheckBox(
00019 const CL_ComponentOptions &options,
00020 CL_Component *parent,
00021 CL_StyleManager *style)
00022 :
00023 CL_Button(options, parent, style),
00024 impl(NULL)
00025 {
00026 impl = new CL_CheckBox_Generic(this, options, get_style_manager());
00027 get_style_manager()->connect_styles("checkbox", options, this);
00028 }
00029
00030 CL_CheckBox::CL_CheckBox(
00031 const CL_Point &pos,
00032 const std::string &text,
00033 CL_Component *parent,
00034 CL_StyleManager *style)
00035 :
00036 CL_Button(
00037 CL_CheckBox_Generic::create_options(pos, text),
00038 parent,
00039 style),
00040 impl(NULL)
00041 {
00042 CL_ComponentOptions options = CL_CheckBox_Generic::create_options(pos, text);
00043 impl = new CL_CheckBox_Generic(this, options, get_style_manager());
00044 get_style_manager()->connect_styles("checkbox", options, this);
00045 }
00046
00047 CL_CheckBox::~CL_CheckBox()
00048 {
00049 delete impl;
00050 }
00051
00053
00054 bool CL_CheckBox::is_checked() const
00055 {
00056 return is_down();
00057 }
00058
00060
00061 void CL_CheckBox::set_checked(bool check)
00062 {
00063 set_down(check);
00064 }