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();
}
Exemple #2
0
 virtual bool close(  ) {
     ::osiris::PythonState __pystate(getPythonThreadState());
     if( ::osiris::PythonOverride func_close = this->get_override( "close" ) )
         return func_close(  );
     else{
         __pystate.leave();
         return this->::osiris::File::close(  );
     }
 }
Exemple #3
0
Theme::Theme(clan::GUIManager &manager, gui_theme default_theme) : current_theme(default_theme),
	clan::Window(&manager, clan::GUITopLevelDescription("Window Theme", clan::Rect(256*3 + 32, 256 + 180 + 24, clan::Size(256, 180)), false))
{

	func_close() = bind_member(this, &Theme::on_close);

	clan::Rect client_area = get_client_area();

	groupbox = new clan::GroupBox(this);
	groupbox->set_geometry(clan::Rect(client_area.left + 5, client_area.top + 5, client_area.right - 5, client_area.bottom - 5));

	int xoffset = client_area.left + 100;
	int yoffset = client_area.top + 4;
	int ygap = 20;

	radiobutton_aero = new clan::RadioButton(this);
	radiobutton_aero->set_geometry(clan::Rect(xoffset, yoffset , clan::Size(96, 24)));
	radiobutton_aero->set_text("Aero");
	radiobutton_aero->set_selected(default_theme == theme_aero);
	radiobutton_aero->set_group_name("Theme");
	radiobutton_aero->func_selected() = [=](){on_theme_selected(radiobutton_aero);};
	yoffset += ygap;

	radiobutton_aero_packed = new clan::RadioButton(this);
	radiobutton_aero_packed->set_geometry(clan::Rect(xoffset, yoffset , clan::Size(96, 24)));
	radiobutton_aero_packed->set_text("Aero Packed");
	radiobutton_aero_packed->set_selected(default_theme == theme_aero_packed);
	radiobutton_aero_packed->set_group_name("Theme");
	radiobutton_aero_packed->func_selected() = [=](){on_theme_selected(radiobutton_aero_packed); };
	yoffset += ygap;

	radiobutton_basic = new clan::RadioButton(this);
	radiobutton_basic->set_geometry(clan::Rect(xoffset, yoffset , clan::Size(96, 24)));
	radiobutton_basic->set_text("Basic");
	radiobutton_basic->set_selected(default_theme == theme_basic);
	radiobutton_basic->set_group_name("Theme");
	radiobutton_basic->func_selected() = [=](){on_theme_selected(radiobutton_basic); };
	yoffset += ygap;

	radiobutton_basic_packed = new clan::RadioButton(this);
	radiobutton_basic_packed->set_geometry(clan::Rect(xoffset, yoffset , clan::Size(96, 24)));
	radiobutton_basic_packed->set_text("Basic Packed");
	radiobutton_basic_packed->set_selected(default_theme == theme_basic_packed);
	radiobutton_basic_packed->set_group_name("Theme");
	radiobutton_basic_packed->func_selected() = [=](){on_theme_selected(radiobutton_basic_packed); };
	yoffset += ygap;

	if (!clan::FileHelp::file_exists("../../../Resources/GUIThemeAero/theme.css"))
	{
		radiobutton_aero->set_enabled(false);
		radiobutton_aero_packed->set_enabled(false);
		radiobutton_basic->set_selected(true);

	}


}
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();
}
PopupMenuWindow::PopupMenuWindow(const PopupMenu &menu, const Point &screen_position, GUIComponent *owner)
: GUIComponent(owner, create_toplevel_description(), CssStr::PopupMenuWindow::type_name),
  menu(menu), selected(-1)
{
	set_class(menu.get_class(), true);

	create_parts();

	Rect rect_pos(screen_position, calc_desired_size());
	set_window_geometry(rect_pos);
	set_visible(true, false);

	func_close().set(this, &PopupMenuWindow::on_close);
}
	int
main(int argc, char *argv[])
{
	int confd;
	struct sockaddr_in saddr;
	char sbuf[1024] = "12345", cbuf[1024];
	pid_t pid;
	int i;

	for (i = 0; i < 200; i++)
	{
		pid = fork ();
		if (pid == 0)
		{
			confd = func_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

			saddr.sin_family = AF_INET;
			saddr.sin_port = htons(8000);
			inet_pton(AF_INET, "127.0.0.1", &saddr.sin_addr);
			func_connect(confd, (struct sockaddr *)&saddr, sizeof(saddr));
#if 0

			bzero(sbuf, sizeof(sbuf));
			//	func_gets(sbuf);
			//while(func_gets(sbuf))
			while(scanf("%s", sbuf))
			{
				fprintf(stdout, "sbuf:%s\n", sbuf);
				func_send(confd, sbuf, sizeof(sbuf) > strlen(sbuf) ? strlen(sbuf) : sizeof(sbuf), 0);

				bzero(cbuf, sizeof(cbuf));
				func_recv(confd, cbuf, sizeof(cbuf), 0);
				fprintf(stdout, "cbuf:%s\n", cbuf);
			}
#endif
			func_close(confd);
			break;
		}
		else if (pid < 0)
		{
			fprintf(stdout, "fork error:%s\n", strerror(errno));
			fprintf(stdout, "pid:%d\n", pid);
		}
	}

	exit(0);


	return 0;
}
Exemple #7
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();
}
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);
}
Exemple #9
0
Spin::Spin(clan::GUIManager &manager) :
	clan::Window(&manager, clan::GUITopLevelDescription("Spin", clan::Rect(256*3 + 32, 256 + 16, clan::Size(256, 180)), false))
{

	func_close() = bind_member(this, &Spin::on_close);

	clan::Rect client_area = get_client_area();

	spin1 = new clan::Spin(this);
	spin1->set_geometry(clan::Rect(client_area.left + 11, client_area.top + 10, clan::Size(128, 21)));
	spin1->set_number_of_decimal_places(2);
	spin1->set_value(500);
	spin1->set_step_size(50);
	spin1->set_ranges(200, 2000);
	spin1->set_floating_point_mode(false);
	spin1->func_value_changed() = bind_member(this, &Spin::on_value_changed);

	int xoffset = client_area.left + 16;
	int yoffset = client_area.top + 40;
	const int gap = 16;
	clan::Size label_size(50, 15);

	info_value_changed = new Info(this);
	info_value_changed->set(xoffset, yoffset, "Value Changed");
	yoffset += gap;

	clan::Size lineedit_size(48, 20);
	int lineedit_xpos = client_area.left + 6;
	int label_xpos = client_area.left + 56;
	int lineedit_ypos = client_area.top + 60;
	const int lineedit_gap = 25;

	lineedit_value = new clan::LineEdit(this);
	lineedit_value->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, lineedit_size));
	lineedit_value->set_text("500");
	lineedit_value->set_numeric_mode(true);
	lineedit_value->func_enter_pressed() = bind_member(this, &Spin::on_value_enter_pressed);

	lineedit_label_value = new clan::Label(this);
	lineedit_label_value->set_geometry(clan::Rect(label_xpos, lineedit_ypos, label_size));
	lineedit_label_value->set_text("Value");
	lineedit_ypos += lineedit_gap;

	lineedit_decimal_places = new clan::LineEdit(this);
	lineedit_decimal_places->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, lineedit_size));
	lineedit_decimal_places->set_text("2");
	lineedit_decimal_places->set_numeric_mode(true, true);
	lineedit_decimal_places->func_enter_pressed() = bind_member(this, &Spin::on_decimal_places_enter_pressed);

	lineedit_label_decimal_places = new clan::Label(this);
	lineedit_label_decimal_places->set_geometry(clan::Rect(label_xpos, lineedit_ypos, label_size));
	lineedit_label_decimal_places->set_text("Decimal Places");
	lineedit_ypos += lineedit_gap;
	lineedit_decimal_places->set_enabled(false);

	lineedit_xpos = client_area.left + 146;
	label_xpos = client_area.left + 196;
	lineedit_ypos = client_area.top + 10;

	lineedit_min = new clan::LineEdit(this);
	lineedit_min->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, lineedit_size));
	lineedit_min->set_text("200");
	lineedit_min->set_numeric_mode(true, true);
	lineedit_min->func_enter_pressed() = bind_member(this, &Spin::on_min_enter_pressed);

	lineedit_label_min = new clan::Label(this);
	lineedit_label_min->set_geometry(clan::Rect(label_xpos, lineedit_ypos, label_size));
	lineedit_label_min->set_text("Min");
	lineedit_ypos += lineedit_gap;

	lineedit_max = new clan::LineEdit(this);
	lineedit_max->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, lineedit_size));
	lineedit_max->set_text("2000");
	lineedit_max->set_numeric_mode(true, true);
	lineedit_max->func_enter_pressed() = bind_member(this, &Spin::on_max_enter_pressed);

	lineedit_label_max = new clan::Label(this);
	lineedit_label_max->set_geometry(clan::Rect(label_xpos, lineedit_ypos, label_size));
	lineedit_label_max->set_text("Max");
	lineedit_ypos += lineedit_gap;

	lineedit_step = new clan::LineEdit(this);
	lineedit_step->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, lineedit_size));
	lineedit_step->set_text("50");
	lineedit_step->set_numeric_mode(true, true);
	lineedit_step->func_enter_pressed() = bind_member(this, &Spin::on_step_enter_pressed);

	lineedit_label_step = new clan::Label(this);
	lineedit_label_step->set_geometry(clan::Rect(label_xpos, lineedit_ypos, label_size));
	lineedit_label_step->set_text("Step");
	lineedit_ypos += lineedit_gap;

	pushbutton_apply = new clan::PushButton(this);
	pushbutton_apply->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, clan::Size(48, 20)));
	pushbutton_apply->set_text("Apply");
	pushbutton_apply->func_clicked() = bind_member(this, &Spin::on_apply_clicked);

	xoffset = client_area.left + 1;
	yoffset = client_area.top + 126 - gap;

	checkbox_fp_mode = new clan::CheckBox(this);
	checkbox_fp_mode->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_fp_mode->func_checked() = bind_member(this, &Spin::on_checked_fp_mode);
	checkbox_fp_mode->func_unchecked() = bind_member(this, &Spin::on_unchecked_fp_mode);
	checkbox_fp_mode->set_text("Floating Point Mode");

	yoffset += gap;

	checkbox_disable = new clan::CheckBox(this);
	checkbox_disable->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_disable->func_checked() = bind_member(this, &Spin::on_checked_disable);
	checkbox_disable->func_unchecked() = bind_member(this, &Spin::on_unchecked_disable);
	checkbox_disable->set_text("Disable");
}
Exemple #10
0
Slider::Slider(clan::GUIManager &manager) : 
	clan::Window(&manager, clan::GUITopLevelDescription("Slider", clan::Rect(256 + 16, 8, clan::Size(256, 256)), false))
{

	func_close().set(this, &Slider::on_close);

	clan::Rect client_area = get_client_area();

	slider_vertical = new clan::Slider(this);
	slider_vertical->set_geometry(clan::Rect(client_area.left + 1, client_area.top + 10, clan::Size(17, 200)));
	slider_vertical->set_vertical(true);
	slider_vertical->set_horizontal(false);
	slider_vertical->set_min(0);
	slider_vertical->set_max(100);
	slider_vertical->set_tick_count(10);
	slider_vertical->set_page_step(40);
	slider_vertical->set_position(50);
	slider_vertical->set_lock_to_ticks(false);
	slider_vertical->func_value_changed().set(this, &Slider::on_value_changed, slider_vertical);
	slider_vertical->func_value_decremented().set(this, &Slider::on_value_decremented, slider_vertical);
	slider_vertical->func_value_incremented().set(this, &Slider::on_value_incremented, slider_vertical);
	slider_vertical->func_slider_moved().set(this, &Slider::on_slider_moved, slider_vertical);

	slider_horizontal = new clan::Slider(this);
	slider_horizontal->set_geometry(clan::Rect(client_area.left + 36, client_area.top + 10, clan::Size(200, 17)));
	slider_horizontal->set_vertical(false);
	slider_horizontal->set_horizontal(true);
	slider_horizontal->set_min(0);
	slider_horizontal->set_max(100);
	slider_horizontal->set_tick_count(10);
	slider_horizontal->set_page_step(40);
	slider_horizontal->set_position(50);
	slider_horizontal->set_lock_to_ticks(false);
	slider_horizontal->func_value_changed().set(this, &Slider::on_value_changed, slider_horizontal);
	slider_horizontal->func_value_decremented().set(this, &Slider::on_value_decremented, slider_horizontal);
	slider_horizontal->func_value_incremented().set(this, &Slider::on_value_incremented, slider_horizontal);
	slider_horizontal->func_slider_moved().set(this, &Slider::on_slider_moved, slider_horizontal);

	clan::Size lineedit_size(42, 20);
	clan::Size label_size(50, 15);
	int lineedit_xpos = client_area.left + 146;
	int label_xpos = client_area.left + 190;

	int lineedit_ypos = client_area.top + 40;
	const int lineedit_gap = 25;

	lineedit_min = new clan::LineEdit(this);
	lineedit_min->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, lineedit_size));
	lineedit_min->set_text("0");
	lineedit_min->set_numeric_mode(true);
	lineedit_min->func_enter_pressed().set(this, &Slider::on_min_enter_pressed, lineedit_min);

	lineedit_label_min = new clan::Label(this);
	lineedit_label_min->set_geometry(clan::Rect(label_xpos, lineedit_ypos, label_size));
	lineedit_label_min->set_text("Min");
	lineedit_ypos += lineedit_gap;

	lineedit_max = new clan::LineEdit(this);
	lineedit_max->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, lineedit_size));
	lineedit_max->set_text("100");
	lineedit_max->set_numeric_mode(true);
	lineedit_max->func_enter_pressed().set(this, &Slider::on_max_enter_pressed, lineedit_max);

	lineedit_label_max = new clan::Label(this);
	lineedit_label_max->set_geometry(clan::Rect(label_xpos, lineedit_ypos, label_size));
	lineedit_label_max->set_text("Max");
	lineedit_ypos += lineedit_gap;

	lineedit_tick_count = new clan::LineEdit(this);
	lineedit_tick_count->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, lineedit_size));
	lineedit_tick_count->set_text("10");
	lineedit_tick_count->func_enter_pressed().set(this, &Slider::on_tick_count_enter_pressed, lineedit_tick_count);

	lineedit_label_tick_count = new clan::Label(this);
	lineedit_label_tick_count->set_geometry(clan::Rect(label_xpos, lineedit_ypos, label_size));
	lineedit_label_tick_count->set_text("Tick Count");
	lineedit_ypos += lineedit_gap;

	lineedit_page_step = new clan::LineEdit(this);
	lineedit_page_step->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, lineedit_size));
	lineedit_page_step->set_text("40");
	lineedit_page_step->func_enter_pressed().set(this, &Slider::on_page_step_enter_pressed, lineedit_page_step);

	lineedit_label_page_step = new clan::Label(this);
	lineedit_label_page_step->set_geometry(clan::Rect(label_xpos, lineedit_ypos, label_size));
	lineedit_label_page_step->set_text("Page Step");
	lineedit_ypos += lineedit_gap;

	lineedit_position_vert = new clan::LineEdit(this);
	lineedit_position_vert->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, lineedit_size));
	lineedit_position_vert->set_text("50");
	lineedit_position_vert->func_enter_pressed().set(this, &Slider::on_position_enter_pressed_vert, lineedit_position_vert);

	lineedit_label_position_vert = new clan::Label(this);
	lineedit_label_position_vert->set_geometry(clan::Rect(label_xpos, lineedit_ypos, label_size));
	lineedit_label_position_vert->set_text("Vertical");
	lineedit_ypos += lineedit_gap;

	lineedit_position_horiz = new clan::LineEdit(this);
	lineedit_position_horiz->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, lineedit_size));
	lineedit_position_horiz->set_text("50");
	lineedit_position_horiz->func_enter_pressed().set(this, &Slider::on_position_enter_pressed_horiz, lineedit_position_horiz);

	lineedit_label_position_horiz = new clan::Label(this);
	lineedit_label_position_horiz->set_geometry(clan::Rect(label_xpos, lineedit_ypos, label_size));
	lineedit_label_position_horiz->set_text("Horizonal");
	lineedit_ypos += lineedit_gap;

	pushbutton_apply = new clan::PushButton(this);
	pushbutton_apply->set_geometry(clan::Rect(lineedit_xpos, lineedit_ypos, clan::Size(48, 20)));
	pushbutton_apply->set_text("Apply");
	pushbutton_apply->func_clicked().set(this, &Slider::on_apply_clicked, pushbutton_apply);

	int xoffset = client_area.left + 21;
	int yoffset = client_area.top + 35;
	const int gap = 16;

	info_value_changed = new Info(this);
	info_value_changed->set(xoffset, yoffset, "Value Changed");
	yoffset += gap;

	info_value_decremented = new Info(this);
	info_value_decremented->set(xoffset, yoffset, "Value Decr.");
	yoffset += gap;

	info_value_incremented = new Info(this);
	info_value_incremented->set(xoffset, yoffset, "Value Incr.");
	yoffset += gap;

	info_slider_moved = new Info(this);
	info_slider_moved->set(xoffset, yoffset, "Slider Moved");
	yoffset += gap;

	xoffset = client_area.left + 36;
	yoffset = client_area.top + 195 - gap;

	checkbox_lock_to_ticks = new clan::CheckBox(this);
	checkbox_lock_to_ticks->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_lock_to_ticks->func_checked().set(this, &Slider::on_checked_lock_to_ticks, checkbox_lock_to_ticks);
	checkbox_lock_to_ticks->func_unchecked().set(this, &Slider::on_unchecked_lock_to_ticks, checkbox_lock_to_ticks);
	checkbox_lock_to_ticks->set_text("Lock to Ticks");

	yoffset += gap;

	checkbox_disable = new clan::CheckBox(this);
	checkbox_disable->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_disable->func_checked().set(this, &Slider::on_checked_disable, checkbox_disable);
	checkbox_disable->func_unchecked().set(this, &Slider::on_unchecked_disable, checkbox_disable);
	checkbox_disable->set_text("Disable");
}
Exemple #11
0
LineEdit::LineEdit(clan::GUIManager &manager) :
	clan::Window(&manager, clan::GUITopLevelDescription("Line Edit", clan::Rect(512 + 24, 8, clan::Size(256, 256)), false))
{
	func_close().set(this, &LineEdit::on_close);


	clan::Rect client_area = get_client_area();

	lineedit1 = new clan::LineEdit(this);
	lineedit1->set_geometry(clan::Rect(client_area.left + 11, client_area.top + 10, clan::Size(128, 21)));
	lineedit1->set_text("Line Edit");

	lineedit1->func_before_edit_changed().set(this, &LineEdit::on_before_edit_changed, lineedit1);
	lineedit1->func_after_edit_changed().set(this, &LineEdit::on_after_edit_changed, lineedit1);
	lineedit1->func_selection_changed().set(this, &LineEdit::on_selection_changed, lineedit1);
	lineedit1->func_focus_gained().set(this, &LineEdit::on_focus_gained, lineedit1);
	lineedit1->func_focus_lost().set(this, &LineEdit::on_focus_lost, lineedit1);
	lineedit1->func_enter_pressed().set(this, &LineEdit::on_enter_pressed, lineedit1);

	int xoffset = client_area.left + 96;
	int yoffset = client_area.top + 40;
	const int gap = 16;

	info_before_edit_changed = new Info(this);
	info_before_edit_changed->set(xoffset, yoffset, "Before Edit Changed");
	yoffset += gap;
	info_after_edit_changed = new Info(this);
	info_after_edit_changed->set(xoffset, yoffset, "After Edit Changed");
	yoffset += gap;
	info_selection_changed = new Info(this);
	info_selection_changed->set(xoffset, yoffset, "Selection Changed");
	yoffset += gap;
	info_focus_gained = new Info(this);
	info_focus_gained->set(xoffset, yoffset, "Focus Gained");
	yoffset += gap;
	info_focus_lost = new Info(this);
	info_focus_lost->set(xoffset, yoffset, "Focus Lost");
	yoffset += gap;
	info_enter_pressed = new Info(this);
	info_enter_pressed->set(xoffset, yoffset, "Enter Pressed");
	yoffset += gap;

	xoffset = client_area.left + 1;
	yoffset = client_area.top + 195 - gap*8;
	clan::Size label_size(50, 15);

	checkbox_mask_hex = new clan::CheckBox(this);
	checkbox_mask_hex->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_mask_hex->func_checked().set(this, &LineEdit::on_checked_mask_hex, checkbox_mask_hex);
	checkbox_mask_hex->func_unchecked().set(this, &LineEdit::on_unchecked_mask_hex, checkbox_mask_hex);
	checkbox_mask_hex->set_text("Hex Mask");

	yoffset+=gap;
	checkbox_read_only = new clan::CheckBox(this);
	checkbox_read_only->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_read_only->func_checked().set(this, &LineEdit::on_checked_read_only, checkbox_read_only);
	checkbox_read_only->func_unchecked().set(this, &LineEdit::on_unchecked_read_only, checkbox_read_only);
	checkbox_read_only->set_text("Read Only");

	yoffset+=gap;
	checkbox_lowercase = new clan::CheckBox(this);
	checkbox_lowercase->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_lowercase->func_checked().set(this, &LineEdit::on_checked_lowercase, checkbox_lowercase);
	checkbox_lowercase->func_unchecked().set(this, &LineEdit::on_unchecked_lowercase, checkbox_lowercase);
	checkbox_lowercase->set_text("Lowercase");

	yoffset+=gap;
	checkbox_uppercase = new clan::CheckBox(this);
	checkbox_uppercase->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_uppercase->func_checked().set(this, &LineEdit::on_checked_uppercase, checkbox_uppercase);
	checkbox_uppercase->func_unchecked().set(this, &LineEdit::on_unchecked_uppercase, checkbox_uppercase);
	checkbox_uppercase->set_text("Uppercase");

	yoffset+=gap;
	checkbox_password_mode = new clan::CheckBox(this);
	checkbox_password_mode->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_password_mode->func_checked().set(this, &LineEdit::on_checked_password_mode, checkbox_password_mode);
	checkbox_password_mode->func_unchecked().set(this, &LineEdit::on_unchecked_password_mode, checkbox_password_mode);
	checkbox_password_mode->set_text("Password Mode");

	yoffset+=gap;
	checkbox_numeric_mode = new clan::CheckBox(this);
	checkbox_numeric_mode->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_numeric_mode->func_checked().set(this, &LineEdit::on_checked_numeric_mode, checkbox_numeric_mode);
	checkbox_numeric_mode->func_unchecked().set(this, &LineEdit::on_unchecked_numeric_mode, checkbox_numeric_mode);
	checkbox_numeric_mode->set_text("Numeric Mode");

	yoffset+=gap;
	checkbox_numeric_mode_decimals = new clan::CheckBox(this);
	checkbox_numeric_mode_decimals->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_numeric_mode_decimals->func_checked().set(this, &LineEdit::on_checked_numeric_mode_decimals, checkbox_numeric_mode_decimals);
	checkbox_numeric_mode_decimals->func_unchecked().set(this, &LineEdit::on_unchecked_numeric_mode_decimals, checkbox_numeric_mode_decimals);
	checkbox_numeric_mode_decimals->set_text("Numeric Mode Decimals");
	checkbox_numeric_mode_decimals->set_enabled(false);

	yoffset+=gap;
	pushbutton_resize = new clan::PushButton(this);
	pushbutton_resize->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(64, 20)));
	pushbutton_resize->set_text("Resize");
	pushbutton_resize->func_clicked().set(this, &LineEdit::on_resize_clicked, pushbutton_resize);

	yoffset+=gap+4;
	checkbox_disable = new clan::CheckBox(this);
	checkbox_disable->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(100, 15)));
	checkbox_disable->func_checked().set(this, &LineEdit::on_checked_disable, checkbox_disable);
	checkbox_disable->func_unchecked().set(this, &LineEdit::on_unchecked_disable, checkbox_disable);
	checkbox_disable->set_text("Disable");

	xoffset = client_area.left + 101;
	yoffset = client_area.top + 190;
	menu_settext.insert_item("(Settings)");
	menu_settext.insert_item("Set Align: Left");
	menu_settext.insert_item("Set Align: Centre");
	menu_settext.insert_item("Set Align: Right");
	menu_settext.insert_item("Set Text: Hello World");
	menu_settext.insert_item("Set Integer: 1234");
	menu_settext.insert_item("Set Float: 123.456");
	menu_settext.insert_item("Select: All");
	menu_settext.insert_item("Select: 2nd to 5th char");
	menu_settext.insert_item("Select: None");

	combo_settext = new clan::ComboBox(this);
	combo_settext->set_geometry(clan::Rect(xoffset, yoffset, clan::Size(130, 20)));
	combo_settext->set_editable(false);
	combo_settext->set_dropdown_height(128);
	combo_settext->set_dropdown_minimum_width(64);
	combo_settext->set_popup_menu(menu_settext);
	combo_settext->set_selected_item(0);
	combo_settext->func_item_selected().set(this, &LineEdit::on_settext_selected, combo_settext);
}
Exemple #12
0
int main(int argc, char *argv[])
{
   void (*OldSig)(int);
   OldSig=signal(SIGINT,SIG_IGN);
   printf("nn************************************************************rn");
   printf("*                           zFTP                           *rn");
   printf("************************************************************rn");
   printf("                                 Copyright (c) 2005rn");
   printf("                                 All rights reserved.rn");
   printf("                                 By Ji Surn");
   if(argc > 0)
   {
     printf("nPlease use 'connect <system name> <user>'  command to connect to a FTPserverrn");
     printf("For anonymous user, please leave <user> blank.rn");
   }	 
   
   //Main loop starts; 
   //Checks on keyboard i/o for interaction and socket communication.
 
   int exit=0;
char command[1024];
printf("nzftp>");
while(!exit) {
 if( ReadCommand ) {
     printf("nzftp>");
     fflush(stdout);
 }
 
 if( !CheckFds(command) )
      continue;
 
 switch(check_cmd(command) ) {
 case READ:
      func_read(command);
      break;
 case WRITE:
      func_write(command);
      break;
case BINARY:
      func_binary_mode();
      break;
case ASCII:
      func_ascii_mode();
      break;
case CLOSE:
 func_close();
 break;
case CONNECT:
 func_connect(command);
 break;
case CD:
func_cdir(command);
  	break;
case DELETE:
func_delete(command);
  	break;
case PWD:
func_pwd(command);
break;
case LS:
func_list(command);
break;
case HELP:
func_help(command);
  	break;
case SHELL:
func_Shell_cmd(command);
break;
 case EXIT:
 exit = 1;
 if( flag_connected )
     func_close();
 break;
 default:
if(command[0] == 0 ) ;
else
    printf("Invalid command: %sn",command);
break;
  }
 }
   
   (void)signal(SIGINT,OldSig);
   return 0;
}
Exemple #13
0
INPUT_HANDLE func_open( LPSTR file )
{
    lsmash_handler_t *hp = (lsmash_handler_t *)lw_malloc_zero( sizeof(lsmash_handler_t) );
    if( !hp )
        return NULL;
    hp->video_reader = READER_NONE;
    hp->audio_reader = READER_NONE;
    get_settings();
    if( reader_opt.threads <= 0 )
        reader_opt.threads = get_auto_threads();
    extern lsmash_reader_t libavsmash_reader;
    extern lsmash_reader_t avs_reader;
    extern lsmash_reader_t vpy_reader;
    extern lsmash_reader_t libav_reader;
    extern lsmash_reader_t dummy_reader;
    static lsmash_reader_t *lsmash_reader_table[] =
    {
        &libavsmash_reader,
        &avs_reader,
        &vpy_reader,
        &libav_reader,
        &dummy_reader,
        NULL
    };
    for( int i = 0; lsmash_reader_table[i]; i++ )
    {
        if( reader_disabled[lsmash_reader_table[i]->type - 1] )
            continue;
        int video_none = 1;
        int audio_none = 1;
        lsmash_reader_t reader = *lsmash_reader_table[i];
        void *private_stuff = reader.open_file( file, &reader_opt );
        if( private_stuff )
        {
            if( !hp->video_private )
            {
                hp->video_private = private_stuff;
                if( reader.get_video_track
                 && reader.get_video_track( hp ) == 0 )
                {
                    hp->video_reader     = reader.type;
                    hp->read_video       = reader.read_video;
                    hp->is_keyframe      = reader.is_keyframe;
                    hp->video_cleanup    = reader.video_cleanup;
                    hp->close_video_file = reader.close_file;
                    video_none = 0;
                }
                else
                    hp->video_private = NULL;
            }
            if( !hp->audio_private )
            {
                hp->audio_private = private_stuff;
                if( reader.get_audio_track
                 && reader.get_audio_track( hp ) == 0 )
                {
                    hp->audio_reader     = reader.type;
                    hp->read_audio       = reader.read_audio;
                    hp->delay_audio      = reader.delay_audio;
                    hp->audio_cleanup    = reader.audio_cleanup;
                    hp->close_audio_file = reader.close_file;
                    audio_none = 0;
                }
                else
                    hp->audio_private = NULL;
            }
        }
        if( video_none && audio_none )
        {
            if( reader.close_file )
                reader.close_file( private_stuff );
        }
        else
        {
            if( reader.destroy_disposable )
                reader.destroy_disposable( private_stuff );
            if( !video_none
             && reader.prepare_video_decoding
             && reader.prepare_video_decoding( hp, video_opt ) )
            {
                if( hp->video_cleanup )
                {
                    hp->video_cleanup( hp );
                    hp->video_cleanup = NULL;
                }
                hp->video_private = NULL;
                hp->video_reader  = READER_NONE;
                video_none = 1;
            }
            if( !audio_none
             && reader.prepare_audio_decoding
             && reader.prepare_audio_decoding( hp, audio_opt ) )
            {
                if( hp->audio_cleanup )
                {
                    hp->audio_cleanup( hp );
                    hp->audio_cleanup = NULL;
                }
                hp->audio_private = NULL;
                hp->audio_reader  = READER_NONE;
                audio_none = 1;
            }
            if( video_none && audio_none && reader.close_file )
                reader.close_file( private_stuff );
        }
        /* Found both video and audio reader. */
        if( hp->video_reader != READER_NONE && hp->audio_reader != READER_NONE )
            break;
    }
    if( hp->video_reader == hp->audio_reader )
    {
        hp->global_private = hp->video_private;
        hp->close_file     = hp->close_video_file;
        hp->close_video_file = NULL;
        hp->close_audio_file = NULL;
    }
    if( hp->video_reader == READER_NONE && hp->audio_reader == READER_NONE )
    {
        DEBUG_MESSAGE_BOX_DESKTOP( MB_OK, "No readable video and/or audio stream" );
        func_close( hp );
        return NULL;
    }
    return hp;
}
Exemple #14
0
 virtual void close(  ){
     ::osiris::PythonState __pystate(getPythonThreadState());
     ::osiris::PythonOverride func_close = this->get_override( "close" );
     func_close(  );
 }
Exemple #15
0
ListView::ListView(clan::GUIManager &manager) :
	clan::Window(&manager, clan::GUITopLevelDescription("List View & Toolbar", clan::Rect(8, 256*1 + 180*1 + 24, clan::Size(256*2, 180*2)), false))
{

	func_close() = bind_member(this, &ListView::on_close);

	clan::Rect client_area = get_client_area();

	clan::Canvas canvas = get_canvas();
	if (clan::FileHelp::file_exists("../../../Resources/GUIThemeLuna/Images/icon_mycomputer.png"))
	{
		sprite_mycomputer = clan::Sprite(canvas, "../../../Resources/GUIThemeLuna/Images/icon_mycomputer.png");
		sprite_folder = clan::Sprite(canvas, "../../../Resources/GUIThemeLuna/Images/icon_folder_32x32.png");
		sprite_overlay = clan::Sprite(canvas, "../../../Resources/GUIThemeLuna/Images/overlay_96x96.png");
	}
	else
	{
		sprite_mycomputer = clan::Sprite(canvas, "../CommonCode/Resources/tux.png");
		sprite_folder = clan::Sprite(canvas, "../CommonCode/Resources/tux.png");
		sprite_overlay = clan::Sprite(canvas, "../CommonCode/Resources/tux.png");
	}

	toolbar = new clan::ToolBar(this);
	toolbar->set_geometry(clan::Rect(client_area.left, client_area.top, clan::Size(32, 180)));
	toolbar->add_item(clan::Sprite(canvas, "../CommonCode/Resources/tux.png"), 0, "Tux1", 0);
	toolbar->add_item(clan::Sprite(canvas, "../CommonCode/Resources/tux.png"), 0, "Tux2", 0);

	listview1 = new clan::ListView(this);
	listview1->set_geometry(clan::Rect(client_area.left + 100, client_area.top + 10, clan::Size(360, 180)));
	listview1->set_display_mode(clan::listview_mode_details);

	listview1->func_selection_changed() = bind_member(this, &ListView::on_selection_changed);
	listview1->func_item_edited() = bind_member(this, &ListView::on_item_edited);
	listview1->func_key_pressed() = bind_member(this, &ListView::on_key_pressed);
	listview1->func_key_released() = bind_member(this, &ListView::on_key_released);
	listview1->func_mouse_right_up() = bind_member(this, &ListView::on_mouse_right_up);
	clan::ListViewItem doc_item = listview1->get_document_item(); 

	clan::ListViewHeader *lv_header = listview1->get_header();  
	lv_header->append(lv_header->create_column("col1_id", "col1")).set_width(130);
	lv_header->append(lv_header->create_column("col2_id", "col2")).set_width(80);
	lv_header->append(lv_header->create_column("col3_id", "col3")).set_width(80);

	clan::ListViewIcon icon;
	icon.set_sprite(sprite_mycomputer, clan::listview_mode_details);
	icon.set_sprite(sprite_folder, clan::listview_mode_icons);
	icon.set_sprite(sprite_folder, clan::listview_mode_thumbnails);

	clan::ListViewIcon olay;
	olay.set_sprite(sprite_overlay, clan::listview_mode_thumbnails);
	olay.set_offset(clan::Point(0, 96-sprite_overlay.get_height()), clan::listview_mode_thumbnails);
	olay.set_scalable(false);

	clan::ListViewIconList ico_list = listview1->get_icon_list();
	ico_list.set_icon(1, icon);
	ico_list.set_icon(1001, olay);

	clan::ListViewItem i1 = listview1->create_item();
	{
		i1.set_column_text("col1_id", "i1");
		i1.set_column_text("col2_id", "col2 text!");
		i1.set_editable(true);
		i1.set_icon(1);
		i1.add_overlay_icon(1001);
		i1.set_open(false);
		doc_item.append_child(i1);

		clan::ListViewItem i1c1 = listview1->create_item();  
		{ 
			i1c1.set_column_text("col1_id", "i1c1");
			i1c1.set_column_text("col2_id", "BOOYAA!");
			i1c1.set_icon(1);
			i1.append_child(i1c1);
		}
	}

	clan::ListViewItem i2 = listview1->create_item();
	{
		i2.set_column_text("col1_id", "i2");
		i2.set_column_text("col2_id", "bar2");
		i2.set_column_text("col3_id", "foobar!");
		i2.set_icon(1);
		i2.set_open(true);

		clan::ListViewItem i2c1 = listview1->create_item();  
		{
			i2c1.set_column_text("col1_id", "i2c1"); 
			i2c1.set_column_text("col2_id", "BOOYAA!");
			i2c1.set_icon(1);
		}
		i2.append_child(i2c1); 

		clan::ListViewItem i2c2 = listview1->create_item();
		{
			i2c2.set_column_text("col1_id", "i2c2");
			i2c2.set_column_text("col2_id", "BOOYAA!");
			i2c2.set_icon(1);
			i2c2.set_open(true); 

			clan::ListViewItem i2c2c1 = listview1->create_item();
			{
				i2c2c1.set_column_text("col1_id", "i2c2c1"); 
				i2c2c1.set_column_text("col2_id", "BOOYAA!");
				i2c2c1.set_icon(1);
			}
			i2c2.append_child(i2c2c1); 
		}
		i2.append_child(i2c2);
	}
	doc_item.append_child(i2);


	for (int j = 0;j < 15; j++)
	{  
		clan::ListViewItem i = listview1->create_item();
		i.set_editable(true);
		i.set_column_text("col1_id", clan::string_format("item %1", j)); 
		i.set_icon(1);       
		if ((j%4) == 0)
		{ 
			i.set_column_text("col3_id", clan::string_format("item %1, col3", j));
		}
		if (( j%2)==0)
		{
			i.set_column_text("col2_id", clan::string_format("item %1, col2", j));
		} 
		doc_item.append_child(i);
	}

	int xoffset = client_area.left + 100;
	int yoffset = client_area.top + 200;
	const int gap = 16;

	info_selection_changed = new Info(this);
	info_selection_changed->set(xoffset, yoffset, "Selection Changed");
	yoffset += gap;

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

	info_key_pressed = new Info(this);
	info_key_pressed->set(xoffset, yoffset, "Key Pressed");
	yoffset += gap;

	info_key_released = new Info(this);
	info_key_released->set(xoffset, yoffset, "Key Released");
	yoffset += gap;

	info_mouse_right_up = new Info(this);
	info_mouse_right_up->set(xoffset, yoffset, "Mouse Right Up");
}