00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "precomp.h"
00010 #include "window_generic.h"
00011 #include "API/GUI/component_options.h"
00012
00013 CL_ComponentOptions CL_Window_Generic::create_options(
00014 const CL_Rect &pos,
00015 const std::string &title)
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 options.add_option_as_int("width", pos.get_width());
00022 options.add_option_as_int("height", pos.get_height());
00023 options.add_option("title", title);
00024
00025 return options;
00026 }
00027
00028 CL_Window_Generic::CL_Window_Generic(
00029 CL_Window *self,
00030 const CL_ComponentOptions &options,
00031 CL_StyleManager *style)
00032 :
00033 window(self),
00034 client_area(NULL)
00035 {
00036 if(options.exists("title"))
00037 title = options.get_value("title");
00038
00039 CL_Rect rect(3, 24, window->get_width() - 3, window->get_height() - 3);
00040 client_area = new CL_Component(rect, window, style);
00041
00042
00043 }
00044
00045 CL_Window_Generic::~CL_Window_Generic()
00046 {
00047 delete client_area;
00048 }