Beispiel #1
0
void App::update_images()
{

	CL_PixelConverter converter;
	switch (current_format)
	{
		case cl_srgb8:
		case cl_srgb8_alpha8:
			converter.set_gamma(1.0f / 2.2f);
	}

	CL_PixelBuffer pb_tux_convert = tux.to_format(current_format, converter);

	switch (current_format)
	{
		case cl_srgb8:
		case cl_srgb8_alpha8:
			converter.set_gamma(2.2f);
	}
	CL_PixelBuffer pb_tux_unconvert = pb_tux_convert.to_format(cl_rgba8, converter);

	tux_convert = CL_Image(*display_gc, pb_tux_convert, pb_tux_convert.get_size());
	tux_unconvert = CL_Image(*display_gc, pb_tux_unconvert, pb_tux_unconvert.get_size());

	gl_supported = CL_OpenGL::get_textureformat(current_format).valid;

}
CL_Image CL_GUIComponent_Impl::on_css_layout_get_image(CL_GraphicContext &gc, const CL_String &url)
{
	try
	{
        CL_ResourceManager resources = gui_manager.lock()->theme.get_resources();
		return CL_Image(gc, url, &resources);
	}
	catch (CL_Exception e)
	{
		// Hmm what to do about that?
		return CL_Image();
	}
}
Beispiel #3
0
void CL_StatusBar::set_part_text(int id, const CL_StringRef &text)
{
	unsigned int index = impl->find_part(id);
	impl->statusbar_parts[index].icon = CL_Image();
	impl->statusbar_parts[index].text = text;
	request_repaint();
}
Beispiel #4
0
PushButton::PushButton(GUI *gui) : 
	CL_Window(&gui->get_gui_manager(), CL_GUITopLevelDescription("PushButton", CL_Rect(256 + 16, 256 + 16, CL_Size(256, 180)), false)),
	gui(gui)
{
	CL_GraphicContext gc = gui->get_window()->get_gc();
	test_image = CL_Image(gc, "tux", &gui->get_resources_internal());

	set_draggable(true);

	CL_Rect client_area = get_client_area();

	pushbutton1 = new CL_PushButton(this);
	pushbutton1->set_geometry(CL_Rect(client_area.left + 11, client_area.top + 10, CL_Size(128, 40)));
	pushbutton1->set_text("Push Button");
	pushbutton1->set_flat(false);
	pushbutton1->func_clicked().set(this, &PushButton::on_clicked, pushbutton1);

	int label_xpos = client_area.left + 31;
	int yoffset = client_area.top + 80;
	CL_Size label_size(50, 15);
	const int gap = 16;

	checkbox_flat = new CL_CheckBox(this);
	checkbox_flat->set_geometry(CL_Rect(client_area.left + 11, yoffset, CL_Size(100, 15)));
	checkbox_flat->func_checked().set(this, &PushButton::on_checked_flat, checkbox_flat);
	checkbox_flat->func_unchecked().set(this, &PushButton::on_unchecked_flat, checkbox_flat);
	checkbox_flat->set_text("Flat");

	yoffset+=gap;
	checkbox_icon = new CL_CheckBox(this);
	checkbox_icon->set_geometry(CL_Rect(client_area.left + 11, yoffset, CL_Size(100, 15)));
	checkbox_icon->func_checked().set(this, &PushButton::on_checked_icon, checkbox_icon);
	checkbox_icon->func_unchecked().set(this, &PushButton::on_unchecked_icon, checkbox_icon);
	checkbox_icon->set_text("Icon");

	yoffset+=gap;
	checkbox_toggle = new CL_CheckBox(this);
	checkbox_toggle->set_geometry(CL_Rect(client_area.left + 11, yoffset, CL_Size(100, 15)));
	checkbox_toggle->func_checked().set(this, &PushButton::on_checked_toggle, checkbox_toggle);
	checkbox_toggle->func_unchecked().set(this, &PushButton::on_unchecked_toggle, checkbox_toggle);
	checkbox_toggle->set_text("Enable Toggle");

	yoffset+=gap;
	checkbox_disable = new CL_CheckBox(this);
	checkbox_disable->set_geometry(CL_Rect(client_area.left + 11, yoffset, CL_Size(100, 15)));
	checkbox_disable->func_checked().set(this, &PushButton::on_checked_disable, checkbox_disable);
	checkbox_disable->func_unchecked().set(this, &PushButton::on_unchecked_disable, checkbox_disable);
	checkbox_disable->set_text("Disable");

	int xoffset = client_area.left + 36;
	yoffset = client_area.top + 60;

	info_clicked = new Info(gui, this);
	info_clicked->set(xoffset, yoffset, "Clicked");
}
Beispiel #5
0
Skin::Skin(std::string filename, CL_GraphicContext& gc)
{
	_filename = filename;
	_element = 3;

	// We load the logo sprite in the gfx ressources file
	CL_VirtualFileSystem vfs(filename, true);
	CL_VirtualDirectory vd(vfs, "./");
	CL_ResourceManager gfx("general.xml", vd);
	_logo = CL_Image(gc, "logo", &gfx);
}
CL_Image &CL_CSSResourceCache::get_image(CL_GraphicContext &gc, const CL_String &url)
{
	std::map<CL_String, CL_Image>::iterator it = image_cache.find(url);
	if (it == image_cache.end())
	{
		CL_Image image;
		try
		{
			image = CL_Image(gc, url);
		}
		catch (CL_Exception &)
		{
		}
		image_cache[url] = image;
		return image_cache[url];
	}
	else
	{
		return it->second;
	}
}
Beispiel #7
0
CL_Image App::get_stencil(CL_GraphicContext &gc, CL_Rect rect)
{

	// For an unknown reason, stencil reads should be a multiple of 32
	rect.left =  32 * ((rect.left + 31) / 32);
	rect.top =  32 * ((rect.top + 31) / 32);
	rect.right =  32 * ((rect.right + 31) / 32);
	rect.bottom =  32 * ((rect.bottom + 31) / 32);

	int rect_width = rect.get_width();
	int rect_height  = rect.get_height();

	std::vector<unsigned char> buffer;
	buffer.resize(rect_width * rect_height);

	clReadPixels(rect.left, gc.get_height()- rect.bottom, rect_width, rect_height, CL_STENCIL_INDEX, CL_UNSIGNED_BYTE, &buffer[0]);
	CL_PixelBuffer pbuf(rect_width, rect_height, cl_abgr8);
	unsigned int *pdata = (unsigned int *) pbuf.get_data();
	unsigned char *rdata = &buffer[0];
	for (int ycnt=0; ycnt < rect_height; ycnt++)
	{
		for (int xcnt=0; xcnt < rect_width; xcnt++)
		{
			int value = *(rdata++);
			if (value == 0)
			{
				*(pdata++) = 0xFF005500;
			}
			else
			{
				value = value * 16;
				value = 0xFF000000 | value | (value << 8) | (value << 16);
				*(pdata++) = value;
			}
		}
	}
	pbuf.flip_vertical();
	return CL_Image(gc, pbuf, pbuf.get_size());
}
Beispiel #8
0
// The start of the Application
int App::start(const std::vector<CL_String> &args)
{
	quit = false;

	CL_OpenGLWindowDescription desc;
	desc.set_title("ClanLib Light Surface Example");
	desc.set_size(CL_Size(900, 700), true);
	desc.set_multisampling(4);
	desc.set_allow_resize(true);
	desc.set_depth_size(16);

	CL_DisplayWindow window(desc);

	// Connect the Window close event
	CL_Slot slot_quit = window.sig_window_close().connect(this, &App::on_window_close);

	// Connect a keyboard handler to on_key_up()
	CL_Slot slot_input_up = (window.get_ic().get_keyboard()).sig_key_up().connect(this, &App::on_input_up);

	// Set up GUI
	CL_String theme;
	if (CL_FileHelp::file_exists("../../../Resources/GUIThemeAero/theme.css"))
		theme = "../../../Resources/GUIThemeAero";
	else if (CL_FileHelp::file_exists("../../../Resources/GUIThemeBasic/theme.css"))
		theme = "../../../Resources/GUIThemeBasic";
	else
		throw CL_Exception("No themes found");

	CL_GUIWindowManagerTexture wm(window);
	CL_GUIManager gui(wm, theme);

	// Get the graphic context
	CL_GraphicContext gc = window.get_gc();

	// Deleted automatically by the GUI
	Options *options = new Options(gui, CL_Rect(8, 8, CL_Size(340, 600)));
	options->request_repaint();

	// Setup graphic store
	GraphicStore graphic_store(gc);
	scene.gs = &graphic_store;

	// Prepare the display
	gc.set_map_mode(cl_user_projection);

	CL_PolygonRasterizer polygon_rasterizer;
	polygon_rasterizer.set_culled(true);
	polygon_rasterizer.set_face_cull_mode(cl_cull_back);
	polygon_rasterizer.set_front_face(cl_face_side_clockwise);
	gc.set_polygon_rasterizer(polygon_rasterizer);

	create_scene(gc);

	CL_Font font(gc, "tahoma", 24);

	graphic_store.image_grid = CL_Image(gc, "../../Display_Render/Blend/Resources/grid.png");

	FramerateCounter framerate_counter;

	unsigned int time_last = CL_System::get_time();
	// Run until someone presses escape
	while (!quit)
	{
		framerate_counter.frame_shown();

		unsigned int time_now = CL_System::get_time();
		time_delta = time_now - time_last;
		time_last = time_now;

		// Copy direction options
		light_distant->rotation_y = options->light_direction_heading;
		light_distant->rotation_x = options->light_direction_pitch;

		// Set material options

		float shininess = options->material_shininess;

		// Convert shininess from a percentage, using Lightwave 3d's method
		shininess = shininess / 100.0f;
		shininess = pow(2, (10.0f * shininess) + 2);

		teapot->model.SetMaterial(
			shininess,		// material_shininess
			CL_Vec4f(options->material_emission_color.r, options->material_emission_color.g, options->material_emission_color.b, options->material_emission_color.a),	// material_emission
			CL_Vec4f(options->material_ambient_color.r, options->material_ambient_color.g, options->material_ambient_color.b, options->material_ambient_color.a),	// material_ambient
			CL_Vec4f(options->material_specular_color.r, options->material_specular_color.g, options->material_specular_color.b, options->material_specular_color.a)	//material_specular
			);

		rotate_teapot();

		calculate_matricies(gc);

		update_light(gc, options);

		polygon_rasterizer.set_culled(true);
		gc.set_polygon_rasterizer(polygon_rasterizer);
		render(gc);

		gc.set_modelview(CL_Mat4f::identity());
		gc.set_map_mode(cl_map_2d_upper_left);
		polygon_rasterizer.set_culled(false);
		gc.set_polygon_rasterizer(polygon_rasterizer);

		CL_String fps(cl_format("%1 fps", framerate_counter.get_framerate()));
		font.draw_text(gc, 16-2, gc.get_height()-16-2, fps, CL_Colorf(0.0f, 0.0f, 0.0f, 1.0f));
		font.draw_text(gc, 16, gc.get_height()-16-2, fps, CL_Colorf(1.0f, 1.0f, 1.0f, 1.0f));

		wm.process();
		wm.draw_windows(gc);

		// Use flip(1) to lock the fps
		window.flip(0);

		// This call processes user input and other events
		CL_KeepAlive::process();
	}

	return 0;
}
Beispiel #9
0
void PushButton::on_unchecked_icon(CL_CheckBox *checkbox)
{
	pushbutton1->set_icon(CL_Image());
}
Beispiel #10
0
// The start of the Application
int App::start(const std::vector<CL_String> &args)
{
	quit = false;

	// Set the window
	CL_DisplayWindowDescription desc;
	desc.set_title("ClanLib App Example");
	desc.set_size(CL_Size(1200, 500), true);
	desc.set_allow_resize(true);

	CL_DisplayWindow window(desc);

	// Connect the Window close event
	CL_Slot slot_quit = window.sig_window_close().connect(this, &App::on_window_close);

	// Connect a keyboard handler to on_key_up()
	CL_Slot slot_input_up = (window.get_ic().get_keyboard()).sig_key_up().connect(this, &App::on_input_up);

	// Get the graphic context
	CL_GraphicContext gc = window.get_gc();

	// Load a sprite from a png-file
	tux = CL_PixelBuffer("Resources/tux.png");

	tux_original = CL_Image(gc, tux, tux.get_size());
	current_format = cl_rgba8;

	//current_format = cl_rgba8;
	//current_format = cl_rgb8;
	//current_format = cl_bgra8;
	//current_format = cl_bgr8;
	//current_format = cl_r8;
	//current_format = cl_r8_snorm;
	//current_format = cl_r16;
	//current_format = cl_r16_snorm;
	//current_format = cl_rg8;
	//current_format = cl_rg8_snorm;
	//current_format = cl_rg16;
	//current_format = cl_rg16_snorm;
	//current_format = cl_r3_g3_b2;
	//current_format = cl_rgb4;
	//current_format = cl_rgb5;
	//current_format = cl_rgb8_snorm;
	//current_format = cl_rgb10;
	//current_format = cl_rgb12;		// XX
	//current_format = cl_rgb16;
	//current_format = cl_rgb16_snorm;
	//current_format = cl_rgba2;		// XX
	//current_format = cl_rgba4;
	//current_format = cl_rgb5_a1;
	//current_format = cl_rgba8_snorm;
	//current_format = cl_rgb10_a2;
	//current_format = cl_rgba12;		// X
	//current_format = cl_rgba16;
	//current_format = cl_rgba16_snorm;
	//current_format = cl_srgb8;
	//current_format = cl_srgb8_alpha8;
	//current_format = cl_r16f;
	//current_format = cl_rg16f;
	//current_format = cl_rgb16f;
	//current_format = cl_rgba16f;
	//current_format = cl_r32f;
	current_format = cl_rg32f;
	//current_format = cl_rgb32f;
	//current_format = cl_rgba32f;
	//current_format = cl_r11f_g11f_b10f;	// X
	//current_format = cl_rgb9_e5;	// X
	//current_format = cl_r8i;
	//current_format = cl_r8ui;
	//current_format = cl_r16i;
	//current_format = cl_r16ui;
	//current_format = cl_r32i;
	//current_format = cl_r32ui;
	//current_format = cl_rg8i;
	//current_format = cl_rg8ui;
	//current_format = cl_rg16i;
	//current_format = cl_rg16ui;
	//current_format = cl_rg32i;
	//current_format = cl_rg32ui;
	//current_format = cl_rgb8i;
	//current_format = cl_rgb8ui;
	//current_format = cl_rgb16i;
	//current_format = cl_rgb16ui;
	//current_format = cl_rgb32i;
	//current_format = cl_rgb32ui;
	//current_format = cl_rgba8i;
	//current_format = cl_rgba8ui;
	//current_format = cl_rgba16i;
	//current_format = cl_rgba16ui;
	//current_format = cl_rgba32i;
	//current_format = cl_rgba32ui;
	//current_format = cl_depth_component16;
	//current_format = cl_depth_component24;
	//current_format = cl_depth_component32;
	//current_format = cl_depth_component32f;
	//current_format = cl_depth24_stencil8;
	//current_format = cl_depth32f_stencil8;
	//current_format = cl_compressed_red;
	//current_format = cl_compressed_rg;
	//current_format = cl_compressed_rgb;
	//current_format = cl_compressed_rgba;
	//current_format = cl_compressed_srgb;
	//current_format = cl_compressed_srgb_alpha;
	//current_format = cl_compressed_red_rgtc1;
	//current_format = cl_compressed_signed_red_rgtc1;
	//current_format = cl_compressed_rg_rgtc2;
	//current_format = cl_compressed_signed_rg_rgtc2;
	//current_format = cl_compressed_rgb_s3tc_dxt1;
	//current_format = cl_compressed_rgba_s3tc_dxt1;
	//current_format = cl_compressed_rgba_s3tc_dxt3;
	//current_format = cl_compressed_rgba_s3tc_dxt5;
	//current_format = cl_compressed_srgb_s3tc_dxt1;
	//current_format = cl_compressed_srgb_alpha_s3tc_dxt1;
	//current_format = cl_compressed_srgb_alpha_s3tc_dxt3;
	//current_format = cl_compressed_srgb_alpha_s3tc_dxt5;


	display_gc = &gc;
	update_images();

	CL_Font font(gc, "tahoma", 24);

	// Run until someone presses escape
	while (!quit)
	{

		gc.clear(CL_Colorf(0.0f,0.0f,0.2f));

		tux_original.draw(gc, 0, 0);
		tux_convert.draw(gc, 400, 0);
		tux_unconvert.draw(gc, 800, 0);

		font.draw_text(gc, 10, 400, "cl_rgba8");

		if (gl_supported)
		{
			font.draw_text(gc, 410, 400, "converted");
		}
		else
		{
			font.draw_text(gc, 410, 400, "NOT SUPPORTED BY clanGL");
		}

		font.draw_text(gc, 810, 400, "converted back to cl_rgba8");

		window.flip(1);

		// This call processes user input and other events
		CL_KeepAlive::process(0);
	}

	return 0;
}
Beispiel #11
0
CL_Image HTMLPage::load_image(CL_GraphicContext &gc, const CL_String &image_url)
{
	HTMLUrl url(image_url, pageurl);
	CL_Console::write_line("Downloading image: %1", url.to_string());
	CL_String8 request;
	request = cl_format("GET %1 HTTP/1.1\r\n", url.path+url.query);
	request += cl_format("Host: %1\r\nConnection: close\r\nReferer: %2\r\nAccept: image/png, image/jpeg\r\nUser-Agent: CSSTokenize/0.1\r\n\r\n", url.host, pageurl.to_string());

	CL_TCPConnection connection(CL_SocketName(url.host, url.port));
	connection.set_nodelay(true);
	connection.send(request.data(), request.length(), true);

	CL_String response;
	while (connection.get_read_event().wait(15000))
	{
		char buffer[16*1024];
		int received = connection.read(buffer, 16*1024, false);
		if (received == 0)
			break;
		response.append(buffer, received);
	}
	connection.disconnect_graceful();

	CL_String response_header = response.substr(0, response.find("\r\n\r\n"));
	CL_String content = response.substr(response_header.length() + 4);

	if (response_header.find("Transfer-Encoding: chunked") != CL_String::npos)
	{
		CL_String::size_type start = 0;
		while (true)
		{
			CL_String::size_type end = content.find("\r\n", start);
			if (end == CL_String::npos)
				end = content.length();

			CL_String str_length = content.substr(start, end-start);
			int length = CL_StringHelp::text_to_int(str_length, 16);
			content = content.substr(0, start) + content.substr(end+2);
			start += length;


			end = content.find("\r\n", start);
			if (end == CL_String::npos)
				end = content.length();
			content = content.substr(0, start) + content.substr(end+2);

			if (length == 0)
				break;
		}
	}

	CL_DataBuffer buffer(content.data(), content.length());
	CL_IODevice_Memory device(buffer);
	if (response_header.find("image/png") != CL_String::npos)
	{
		CL_PixelBuffer pb = CL_PNGProvider::load(device);
		return CL_Image(gc, pb, pb.get_size());
	}
	else if (response_header.find("image/jpeg") != CL_String::npos)
	{
		CL_PixelBuffer pb = CL_JPEGProvider::load(device);
		return CL_Image(gc, pb, pb.get_size());
	}
	else if (response_header.find("image/gif") != CL_String::npos)
	{
		CL_PixelBuffer pb = GIFProvider::load(device);
		return CL_Image(gc, pb, pb.get_size());
	}
	else
	{
		CL_Console::write_line("Unknown image type: %1", CL_String8(buffer.get_data(), buffer.get_size()));
		return CL_Image();
	}
}
Beispiel #12
0
MenuBar::MenuBar(CL_GUIManager &manager, CL_ResourceManager &application_resources) :
	CL_Window(&manager, CL_GUITopLevelDescription("Menu Bar & Status Bar", CL_Rect(512 + 24, 256 + 16, CL_Size(256, 180)), false))
{
	tux_image = CL_ImageProviderFactory::load("../CommonCode/Resources/tux.png");

	CL_GraphicContext gc = get_gc();
	tux_head = CL_Image(gc, "tux_head", &application_resources);

	set_draggable(true);

	CL_Rect client_area = get_client_area();

	menubar1 = new CL_MenuBar(this);
	menubar1->set_geometry(CL_Rect(client_area.left, client_area.top, client_area.right, client_area.top + 25));

	menu_file.insert_item("New").func_clicked().set(this, &MenuBar::on_item_selected);
	menu_file.insert_item("Open").func_clicked().set(this, &MenuBar::on_item_selected);
	menu_file.insert_item("Save").func_clicked().set(this, &MenuBar::on_item_selected);
	CL_PopupMenuItem tux_item = menu_file.insert_item("Tux");
	tux_item.func_clicked().set(this, &MenuBar::on_item_selected);
	tux_item.set_icon(tux_image);

	menu_file.insert_item("Exit").func_clicked().set(this, &MenuBar::on_item_selected);
	menubar1->add_menu("File", menu_file);

	menu_edit.insert_item("Undo").func_clicked().set(this, &MenuBar::on_item_selected);
	CL_PopupMenuItem redo_item = menu_edit.insert_item("Redo");
	redo_item.func_clicked().set(this, &MenuBar::on_item_selected);
	redo_item.set_enabled(false);
	menu_edit.insert_separator();
	menu_edit.insert_item("Cut").func_clicked().set(this, &MenuBar::on_item_selected);
	menu_edit.insert_item("Copy").func_clicked().set(this, &MenuBar::on_item_selected);
	menu_edit.insert_separator();
	item_submenu = menu_edit.insert_item("Submenu");
	item_submenu.func_clicked().set(this, &MenuBar::on_item_selected);
	menu_edit.insert_separator();
	menu_edit.insert_item("Paste").func_clicked().set(this, &MenuBar::on_item_selected);
	menu_edit.insert_item("Delete").func_clicked().set(this, &MenuBar::on_item_selected);
	menu_edit.insert_separator();
	menu_edit.insert_item("Select All").func_clicked().set(this, &MenuBar::on_item_selected);

	menu_submenu.insert_item("foo").func_clicked().set(this, &MenuBar::on_item_selected);
	menu_submenu.insert_item("bar").func_clicked().set(this, &MenuBar::on_item_selected);
	menu_submenu.insert_item("foobar").func_clicked().set(this, &MenuBar::on_item_selected);
	CL_PopupMenuItem check_item1 = menu_submenu.insert_item("Checkable 1");
	check_item1.func_clicked().set(this, &MenuBar::on_item_selected);
	check_item1.set_checkable(true);
	check_item1.set_checked(true);
	CL_PopupMenuItem check_item2 = menu_submenu.insert_item("Checkable 2");
	check_item2.func_clicked().set(this, &MenuBar::on_item_selected);
	check_item2.set_checkable(true);
	check_item2.set_checked(false);
	CL_PopupMenuItem check_item3 = menu_submenu.insert_item("Disabled Checkable 1");
	check_item3.func_clicked().set(this, &MenuBar::on_item_selected);
	check_item3.set_checkable(true);
	check_item3.set_checked(true);
	check_item3.set_enabled(false);
	CL_PopupMenuItem check_item4 = menu_submenu.insert_item("Disabled Checkable 2");
	check_item4.func_clicked().set(this, &MenuBar::on_item_selected);
	check_item4.set_checkable(true);
	check_item4.set_checked(false);
	check_item4.set_enabled(false);
	item_submenu.set_submenu(menu_submenu);

	menubar1->add_menu("Edit", menu_edit);

	int xoffset = client_area.left + 80;
	int yoffset = client_area.top + 30;
	const int gap = 16;
	CL_Size label_size(50, 15);

	info_item_selected = new Info(this);
	info_item_selected->set(xoffset, yoffset, "Item Selected");
	yoffset += gap;

	statusbar1 = new CL_StatusBar(this);
	int statusbar_height = statusbar1->get_preferred_height();
	CL_Rect statusbar_rect(0, client_area.get_height() - statusbar_height, CL_Size(client_area.get_width(), statusbar_height));
	statusbar_rect.translate(client_area.left, client_area.top);
	statusbar1->set_geometry(statusbar_rect);
	statusbar1->set_status_text("Status bar");
	statusbar1->show_size_grip(true);

	pushbutton1 = new CL_PushButton(statusbar1);
	pushbutton1->set_icon(tux_head);
	pushbutton1->func_clicked().set(this, &MenuBar::on_clicked, pushbutton1);
	statusbar1->add_part(0, 48, pushbutton1);
	statusbar1->func_part_double_clicked(0).set(this, &MenuBar::on_part_double_clicked_0, statusbar1);

	component1 = new CL_GUIComponent(statusbar1);
	statusbar1->add_part(1, 48, component1);
	statusbar1->set_part_text(1, "ClanTest");
	statusbar1->func_part_double_clicked(1).set(this, &MenuBar::on_part_double_clicked_1, statusbar1);

	CL_GUIComponent *component2 = (new CL_GUIComponent(statusbar1));
	statusbar1->add_part(2, 48, component2);
	statusbar1->set_part_text(2, tux_head, "");
	statusbar1->func_part_double_clicked(2).set(this, &MenuBar::on_part_double_clicked_2, statusbar1);

	xoffset = client_area.left + 5;
	yoffset = client_area.top + 40;

	label_status = new CL_Label(this);
	label_status->set_geometry(CL_Rect(xoffset, yoffset, label_size));
	label_status->set_text("Status Bar:");
	yoffset += gap;

	checkbox_status_size_grip = new CL_CheckBox(this);
	checkbox_status_size_grip->set_geometry(CL_Rect(xoffset, yoffset, CL_Size(150, 15)));
	checkbox_status_size_grip->func_checked().set(this, &MenuBar::on_checked_status_size_grip, checkbox_status_size_grip);
	checkbox_status_size_grip->func_unchecked().set(this, &MenuBar::on_unchecked_status_size_grip, checkbox_status_size_grip);
	checkbox_status_size_grip->set_text("Show Size Grip");
	checkbox_status_size_grip->set_checked(true);
	yoffset += gap;

	checkbox_status_text = new CL_CheckBox(this);
	checkbox_status_text->set_geometry(CL_Rect(xoffset, yoffset, CL_Size(150, 15)));
	checkbox_status_text->func_checked().set(this, &MenuBar::on_checked_status_text, checkbox_status_text);
	checkbox_status_text->func_unchecked().set(this, &MenuBar::on_unchecked_status_text, checkbox_status_text);
	checkbox_status_text->set_text("Change Status Text");
	checkbox_status_text->set_checked(true);
	yoffset += gap;

	checkbox_status_show_clantest = new CL_CheckBox(this);
	checkbox_status_show_clantest->set_geometry(CL_Rect(xoffset, yoffset, CL_Size(150, 15)));
	checkbox_status_show_clantest->func_checked().set(this, &MenuBar::on_checked_show_clantest, checkbox_status_show_clantest);
	checkbox_status_show_clantest->func_unchecked().set(this, &MenuBar::on_unchecked_show_clantest, checkbox_status_show_clantest);
	checkbox_status_show_clantest->set_text("Show ClanTest");
	checkbox_status_show_clantest->set_checked(true);
	yoffset += gap;

	checkbox_status_remove_clantest = new CL_CheckBox(this);
	checkbox_status_remove_clantest->set_geometry(CL_Rect(xoffset, yoffset, CL_Size(150, 15)));
	checkbox_status_remove_clantest->func_checked().set(this, &MenuBar::on_checked_remove_clantest, checkbox_status_remove_clantest);
	checkbox_status_remove_clantest->func_unchecked().set(this, &MenuBar::on_unchecked_remove_clantest, checkbox_status_remove_clantest);
	checkbox_status_remove_clantest->set_text("Remove ClanTest");
	checkbox_status_remove_clantest->set_checked(false);
	yoffset += gap;

	xoffset = client_area.left + 110;
	yoffset -= (gap*2);

	info_clicked = new Info(this);
	info_clicked->set(xoffset, yoffset, "Push Button Clicked");

	yoffset += gap;

	info_part_clicked = new Info(this);
	info_part_clicked->set(xoffset, yoffset, "Part Dbl Clicked");

}