Ejemplo n.º 1
0
void GridComponent::set_boundary_size(const clan::Size &size)
{
	boundary.width = size.width;
	boundary.height = size.height;
	on_resized();
	request_repaint();
}
Ejemplo n.º 2
0
WelcomeView::WelcomeView(clan::GUIComponent *parent, MainWindow *mainwindow)
: View(parent, mainwindow, "Welcome")
{
	func_resized().set(this, &WelcomeView::on_resized);

	on_resized();
}
Ejemplo n.º 3
0
IcoCreatorView::IcoCreatorView(CL_GUIComponent *parent, MainWindow *mainwindow)
: View(parent, mainwindow, "ICO Creator")
{
	func_resized().set(this, &IcoCreatorView::on_resized);

	for(int i = 0; i < 11; ++i)
	{
		label_selected_file[i] = new CL_Label(this);
		label_selected_file[i]->set_text("Input image file:");

		lineedit_selected_file[i] = new CL_LineEdit(this);

		button_browse_file[i] = new CL_PushButton(this);
		button_browse_file[i]->set_text("...");
		button_browse_file[i]->func_clicked().set(this, &IcoCreatorView::on_button_browse, i);
	}

	button_save = new CL_PushButton(this);
	button_save->set_text("Create ICO file");
	button_save->func_clicked().set(this, &IcoCreatorView::on_button_save);

	label_result = new CL_Label(this);

	on_resized();
}
Ejemplo n.º 4
0
DlgAddNewProject::DlgAddNewProject(GUIComponent *owner, SolutionModel &model)
: GUIComponent(owner, get_toplevel_description()), model(model)
{
	label_name = new Label(this);
	lineedit_name = new LineEdit(this);
	label_location = new Label(this);
	lineedit_location = new LineEdit(this);
	button_browse_location = new PushButton(this);
	label_solution_name = new Label(this);
	lineedit_solution_name = new LineEdit(this);
	check_create_solution_directory = new CheckBox(this);
	button_ok = new PushButton(this);
	button_cancel = new PushButton(this);

	label_name->set_text("Name:");
	label_location->set_text("Location:");
	button_browse_location->set_text("Browse...");
	label_solution_name->set_text("Solution name:");
	check_create_solution_directory->set_text("Create directory for solution");
	button_ok->set_text("OK");
	button_ok->set_default(true);
	button_cancel->set_text("Cancel");
	button_cancel->set_cancel(true);

	func_resized() = bind_member(this, &DlgAddNewProject::on_resized);
	func_close() = bind_member(this, &DlgAddNewProject::on_close);
	button_ok->func_clicked() = bind_member(this, &DlgAddNewProject::on_button_ok_clicked);
	button_cancel->func_clicked() = bind_member(this, &DlgAddNewProject::on_button_cancel_clicked);
	button_browse_location->func_clicked() = bind_member(this, &DlgAddNewProject::on_button_browse_location_clicked);
	check_create_solution_directory->func_state_changed() = bind_member(this, &DlgAddNewProject::on_check_create_solution_directory_state_changed);

	on_check_create_solution_directory_state_changed();
	on_resized();
	lineedit_name->set_focus();
}
Ejemplo n.º 5
0
CSSBrowser::CSSBrowser(CL_GUIManager *gui)
: CL_Window(gui, get_window_description()), label(0), edit(0), view(0)
{
	view = new CSSView(this);
	func_close().set(this, &CSSBrowser::on_close);
	func_resized().set(this, &CSSBrowser::on_resized);
	label = new CL_Label(this);
	edit = new CL_LineEdit(this);
	label->set_text("Address:");
	on_resized();
}
Ejemplo n.º 6
0
DockedFrame::DockedFrame(GUIComponent *parent, DockableComponent *dockable)
    : GUIComponent(parent, "docked-frame"), dockable(dockable)
{
    func_resized().set(this, &DockedFrame::on_resized);
    func_render().set(this, &DockedFrame::on_render);
    dockable->set_parent_component(this);
    dockable->set_visible(true, false);
    set_visible(false, false);
    on_resized();
    request_repaint();
}
Ejemplo n.º 7
0
ViewWorkspace::ViewWorkspace(clan::GUIComponent *parent)
: clan::GUIComponent(parent, "workspace"), hot(false), current_page_index(0)
{
	func_render().set(this, &ViewWorkspace::on_render);
	func_resized().set(this, &ViewWorkspace::on_resized);
	func_process_message().set(this, &ViewWorkspace::on_process_message);

	clan::Canvas canvas = get_canvas();
	
	part_tab = clan::GUIThemePart(this, "workspacetab");
	font_tab = clan::Font(canvas, "Tahoma", -11);//part_background.get_font();
	image_cross = clan::Image(canvas, "Resources/cross-small.png");
	image_cross_hot = clan::Image(canvas, "Resources/cross-small-hot.png");
	image_cross_empty = clan::Image(canvas, "Resources/cross-small-empty.png");
	on_resized();
}
Ejemplo n.º 8
0
ResourceViewerView::ResourceViewerView(clan::GUIComponent *parent, MainWindow *mainwindow)
: View(parent, mainwindow, "Resource viewer"), sprite_component(NULL), resource_list(NULL)
{
	func_resized().set(this, &ResourceViewerView::on_resized);

	label_selected_resource_file = new clan::Label(this);
	label_selected_resource_file->set_text("Resource file:");

	lineedit_selected_resource_file = new clan::LineEdit(this);

	button_browse_resource_file = new clan::PushButton(this);
	button_browse_resource_file->set_text("...");
	button_browse_resource_file->func_clicked().set(this, &ResourceViewerView::on_button_browse_resource_file);

	button_edit_resource = new clan::PushButton(this);
	button_edit_resource->set_text("Edit resource");
	button_edit_resource->func_clicked().set(this, &ResourceViewerView::on_button_edit_resource);
	button_edit_resource->set_enabled(false);

	button_create_collision_data = new clan::PushButton(this);
	button_create_collision_data->set_text("Create collision data");
	button_create_collision_data->func_clicked().set(this, &ResourceViewerView::on_button_create_collision_data);
	button_create_collision_data->set_enabled(false);

	resource_list = new clan::ListView(this);
	clan::ListViewColumnHeader col_resource = resource_list->get_header()->append(resource_list->get_header()->create_column("Resource", "Resource"));
	col_resource.set_width(350);
	clan::ListViewColumnHeader col_message = resource_list->get_header()->append(resource_list->get_header()->create_column("Message", "Message"));

	clan::ListViewIconList icon_list = resource_list->get_icon_list();
	clan::ListViewIcon icon_disabled;
	icon_disabled.set_sprite(clan::Sprite(get_canvas(), "Resources/sweetie-16-em-cross.png"), clan::listview_mode_details);
	clan::ListViewIcon icon_enabled;
	icon_enabled.set_sprite(clan::Sprite(get_canvas(), "Resources/sweetie-16-em-check.png"), clan::listview_mode_details);
	icon_list.set_icon(1, icon_disabled);
	icon_list.set_icon(2, icon_enabled);

	resource_list->func_selection_changed().set(this, &ResourceViewerView::on_selection_changed);

	sprite_component = new SpriteComponent(this);

	on_resized();
}
Ejemplo n.º 9
0
MainWindow::MainWindow(GUIManager *gui, ResourceManager *resources)
: GUIComponent(gui, get_window_description(), "mainwindow"), resources(resources), workspace(0)
{
	func_close().set(this, &MainWindow::on_close);
	func_resized().set(this, &MainWindow::on_resized);

	workspace = new ViewWorkspace(this);
	workspace->cb_view_close.set(this, &MainWindow::on_view_close);

	create_components();

	create_welcome_view();
	create_texture_packer_view();
	create_css_packer_view();
	create_ico_creator_view();
	create_resource_viewer_view();

	on_resized();
}
Ejemplo n.º 10
0
DlgAddNewItem::DlgAddNewItem(GUIComponent *owner, FileItemTypeFactory &factory, const std::string &default_location)
: GUIComponent(owner, get_toplevel_description())
{
	label_name = new Label(this);
	lineedit_name = new LineEdit(this);
	label_location = new Label(this);
	lineedit_location = new LineEdit(this);
	button_browse_location = new PushButton(this);
	button_ok = new PushButton(this);
	button_cancel = new PushButton(this);
	list_items = new ListView(this);
	label_description_header = new Label(this);
	label_description = new Label(this);

	label_name->set_text("Name:");
	label_location->set_text("Location:");
	button_browse_location->set_text("Browse...");
	button_ok->set_text("OK");
	button_ok->set_default(true);
	button_cancel->set_text("Cancel");
	button_cancel->set_cancel(true);
	lineedit_name->set_focus();

	lineedit_name->set_text("New item");
	lineedit_location->set_text(default_location);

	list_items->get_header()->append(list_items->get_header()->create_column("name", "Name")).set_width(110);
	list_items->show_detail_opener(false);
	//	list_items->get_header()->set_visible(false);
	list_items->get_header()->set_class("hidden", true);

	func_resized().set(this, &DlgAddNewItem::on_resized);
	func_close().set(this, &DlgAddNewItem::on_close);
	button_ok->func_clicked().set(this, &DlgAddNewItem::on_button_ok_clicked);
	button_cancel->func_clicked().set(this, &DlgAddNewItem::on_button_cancel_clicked);
	button_browse_location->func_clicked().set(this, &DlgAddNewItem::on_button_browse_location_clicked);

	list_items->func_selection_changed().set(this, &DlgAddNewItem::on_list_items_selection_changed);

	on_resized();

	populate(factory);
}
Ejemplo n.º 11
0
CssPackerView::CssPackerView(clan::GUIComponent *parent, MainWindow *mainwindow)
    : View(parent, mainwindow, "CSS Packer")
{
    func_resized().set(this, &CssPackerView::on_resized);

    label_selected_file = new clan::Label(this);
    label_selected_file->set_text("Input CSS file:");

    lineedit_selected_file = new clan::LineEdit(this);

    button_browse_file = new clan::PushButton(this);
    button_browse_file->set_text("...");
    button_browse_file->func_clicked().set(this, &CssPackerView::on_button_browse);

    button_save = new clan::PushButton(this);
    button_save->set_text("Save CSS file");
    button_save->func_clicked().set(this, &CssPackerView::on_button_save);

    label_result = new clan::Label(this);

    on_resized();
}
Ejemplo n.º 12
0
TexturePackerView::TexturePackerView(clan::GUIComponent *parent, MainWindow *mainwindow)
: View(parent, mainwindow, "Texture Packer")
{
	func_resized().set(this, &TexturePackerView::on_resized);

	label_selected_resource_file = new clan::Label(this);
	label_selected_resource_file->set_text("Resource file:");

	lineedit_selected_resource_file = new clan::LineEdit(this);

	button_browse_resource_file = new clan::PushButton(this);
	button_browse_resource_file->set_text("...");
	button_browse_resource_file->func_clicked().set(this, &TexturePackerView::on_button_browse_resource_file);

	radio_texture32 = new clan::RadioButton(this);
	radio_texture32->set_text("32x32");
	radio_texture32->set_group_name("TextureSize");

	radio_texture64 = new clan::RadioButton(this);
	radio_texture64->set_text("64x64");
	radio_texture64->set_group_name("TextureSize");

	radio_texture128 = new clan::RadioButton(this);
	radio_texture128->set_text("128x128");
	radio_texture128->set_group_name("TextureSize");

	radio_texture256 = new clan::RadioButton(this);
	radio_texture256->set_text("256x256");
	radio_texture256->set_group_name("TextureSize");

	radio_texture512 = new clan::RadioButton(this);
	radio_texture512->set_text("512x512");
	radio_texture512->set_group_name("TextureSize");

	radio_texture1024 = new clan::RadioButton(this);
	radio_texture1024->set_text("1024x1024");
	radio_texture1024->set_group_name("TextureSize");

	radio_texture2048 = new clan::RadioButton(this);
	radio_texture2048->set_text("2048x2048");
	radio_texture2048->set_group_name("TextureSize");
	radio_texture2048->set_selected(true);

	radio_texture1024x256 = new clan::RadioButton(this);
	radio_texture1024x256->set_text("1024x256");
	radio_texture1024x256->set_group_name("TextureSize");
	radio_texture1024x256->set_selected(true);

	spin_border = new clan::Spin(this);
	spin_border->set_value(1);
	spin_border->set_step_size(1);
	spin_border->set_ranges(0, 8);
	spin_border->set_floating_point_mode(false);

	label_border = new clan::Label(this);
	label_border->set_text("Pixel Border");

	check_sort = new clan::CheckBox(this);
	check_sort->set_text("Sort images by width");

	button_pack = new clan::PushButton(this);
	button_pack->set_text("Generate textures");
	button_pack->func_clicked().set(this, &TexturePackerView::on_button_generate_textures);

	button_save = new clan::PushButton(this);
	button_save->set_text("Save resourcefile");
	button_save->func_clicked().set(this, &TexturePackerView::on_button_save_resources);

	generation_result = new clan::Label(this);

	texturegroup_component = new TextureGroupComponent(this);

	on_resized();
}
Ejemplo n.º 13
0
void ViewDock::update_layout()
{
	on_resized();
}