00001
00002
00003
00004
00005
00006
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
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 }