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

label_generic.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 "label_generic.h"
00011 #include "API/GUI/component_options.h"
00012 
00013 CL_ComponentOptions CL_Label_Generic::create_options(
00014         const CL_Rect &pos,
00015         const std::string &text)
00016 {
00017         CL_ComponentOptions options;
00018 
00019         options.add_option_as_int("x", pos.x1);
00020         options.add_option_as_int("y", pos.y1);
00021 
00022         // TODO: This should be automatically calculated
00023         if(pos.x2 == 0)
00024                 options.add_option_as_int("width", 500);
00025         else
00026                 options.add_option_as_int("width", pos.get_width());
00027         if(pos.y2 == 0)
00028                 options.add_option_as_int("height", 50);
00029         else
00030                 options.add_option_as_int("height", pos.get_height());
00031 
00032         options.add_option("text", text);
00033 
00034         return options;
00035 }
00036 
00037 CL_Label_Generic::CL_Label_Generic(CL_Label *self, const CL_ComponentOptions &options, CL_StyleManager *style)
00038 :
00039         label(self),
00040         alignment(0)
00041 {
00042         if(options.exists("text"))
00043                 text = options.get_value("text");
00044 }

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