Example #1
0
void uart_rx_process(void)
{
    switch (g_uart_rx_buff[0]) {
    case 'r':
        get_stat();
        break;
    case 'u':
        get_transmitter_uptime();
        break;
    case 's':
        x_start();
        break;
    case 'q':
        if (g_uart_rx_buff[1] == 'd') {
            x_get_page();
        } else {
            x_get_status();
        }
        break;
    case '?':
        get_help();
        break;
    default:
        uart_printf("invalid command, send ? to get help" UART_EOL);
        uart_tx_flush();
    }
}
Example #2
0
void i4_browse_window_class::add_arranged_child(i4_window_class * child)
{
	title_area->add_child(0,0,child);
	((i4_horizontal_compact_window_class *)title_area)->compact();


	private_resize(0,0);
	arrange_right_down();
	if (child_object)
	{
		child_object->move(x_start(), 0);
	}
	resize_to_fit_children();
}
Example #3
0
void i4_browse_window_class::expand()
{
	if (child_object && !expanded)
	{
		expanded=i4_T;
		i4_parent_window_class::add_child(0,0,child_object);
		private_resize(0,0);
		arrange_right_down();
		if (child_object)
		{
			child_object->move(x_start(), 0);
		}
		resize_to_fit_children();
	}
}
Example #4
0
void i4_browse_window_class::replace_object(i4_window_class * object)
{
	if (child_object)
	{
		if (expanded)
		{
			remove_child(child_object);
		}

		delete child_object;
		child_object=0;

		/*
		   if (((i4_browse_toggle_class *)toggle_button)->state == i4_browse_toggle_class::EXPANDED)
		   ((i4_browse_toggle_class *)toggle_button)->state=i4_browse_toggle_class::COMPACTED;
		   else if (((i4_browse_toggle_class *)toggle_button)->state == i4_browse_toggle_class::COMPACTED)
		   ((i4_browse_toggle_class *)toggle_button)->state=i4_browse_toggle_class::EXPANDED;
		 */

		toggle_button->request_redraw();

		private_resize(0,0);
		resize_to_fit_children();
	}

	if (object)
	{
		child_object=object;
		if (expanded)
		{
			i4_parent_window_class::add_child(0,0,object);
		}

		private_resize(0,0);
		arrange_right_down();
		object->move(x_start(), 0);

		resize_to_fit_children();
	}
}
Example #5
0
void i4_browse_window_class::receive_event(i4_event * ev)
{
	if (ev->type()==i4_event::WINDOW_MESSAGE)
	{
		CAST_PTR(mess,i4_window_message_class,ev);

		if (mess->sub_type==i4_window_message_class::NOTIFY_RESIZE)
		{
			CAST_PTR(resize,i4_window_notify_resize_class,ev);

			note_undrawn(0,0, width()-1, height()-1);

			w16 ow=resize->from()->width(),
				oh=resize->from()->height();

			resize->from()->private_resize(resize->new_width,resize->new_height);

			private_resize(0,0);
			arrange_right_down();
			if (child_object)
			{
				child_object->move(x_start(), 0);
			}
			resize_to_fit_children();

			note_undrawn(0,0, width()-1, height()-1);

			resize->from()->private_resize(ow, oh);
		}
		else
		{
			i4_parent_window_class::receive_event(ev);
		}
	}
	else
	{
		i4_parent_window_class::receive_event(ev);
	}
}