Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

checkbox.cpp

Go to the documentation of this file.
00001 /*
00002         ClanGUI, copyrights by various people. Have a look in the CREDITS file.
00003         
00004         This sourcecode is distributed using the Library GNU Public Licence,
00005         version 2 or (at your option) any later version. Please read LICENSE
00006         for details.
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 // Construction:
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 // Attributes:
00054 bool CL_CheckBox::is_checked() const
00055 {
00056         return is_down();
00057 }
00058 
00060 // Operations:
00061 void CL_CheckBox::set_checked(bool check)
00062 {
00063         set_down(check);
00064 }

Generated at Wed Apr 4 19:53:59 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001