Exemplo n.º 1
0
void dialog_view_callback(twidget& caller)
{
	D* dialog = dynamic_cast<D*>(caller.dialog());
	assert(dialog);
	twindow* window = dynamic_cast<twindow*>(caller.get_window());
	assert(window);
	(*(dialog->get_view()).*fptr)(*window);
}
Exemplo n.º 2
0
void tlistbox::resize_content(const twidget& row)
{
	if(row.get_visible() == tvisible::invisible) {
		return;
	}

	DBG_GUI_L << LOG_HEADER << " current size " << content_grid()->get_size()
			  << " row size " << row.get_best_size() << ".\n";

	const tpoint content = content_grid()->get_size();
	tpoint size = row.get_best_size();
	if(size.x < content.x) {
		size.x = 0;
	} else {
		size.x -= content.x;
	}

	resize_content(size.x, size.y);
}
Exemplo n.º 3
0
	explicit tbottom_up(twidget& root) : root_(root.create_walker()), stack_()
	{
		TST_GUI_I << "Constructor: ";
		while(!tvisit_child::at_end(*root_)) {
			stack_.push_back(root_);
			root_ = tvisit_child::get(*root_)->create_walker();
			TST_GUI_I << " Down widget '" << operator*().id() << "'.";
		}

		if(!at_end()) {
			TST_GUI_I << " Finished at '" << operator*().id() << "'.\n";
		} else {
			TST_GUI_I << " Finished at the end.\n";
		}
	}
Exemplo n.º 4
0
bool tdispatcher::fire(const tevent event
		, twidget& target
		, void*)
{

	/**
	 * @todo The firing needs some polishing.
	 *
	 * Make sure the events can't be added to pre and post chain since they are
	 * not used.
	 */

	// Fire it here directly since we need special handling.
	bool handled = false;
	bool halt = false;

	if(target.has_event(event, child)) {

		tsignal<tsignal_notification_function>& signal =
				target.signal_notification_queue_.queue[event];

		for(std::vector<tsignal_notification_function>::iterator
					itor = signal.child.begin();
				itor != signal.child.end();
				++itor) {

			(*itor)(*this, event, handled, halt, NULL);

			if(halt) {
				assert(handled);
				break;
			}
		}
	}
	return handled;
}
Exemplo n.º 5
0
	explicit ttop_down(twidget& root) : root_(root.create_walker()), stack_()
	{
	}
Exemplo n.º 6
0
void dialog_view_callback(twidget& caller)
{
	D* dialog = dynamic_cast<D*>(caller.dialog());
	assert(dialog);
	(*(dialog->get_view()).*fptr)();
}