Exemple #1
0
void WindowManager::HandleDrag()
{
	if (Controller::LastInput == PSP_CTRL_CROSS && ListStart && Controller::AnalogX > ListStart->X + ListStart->Width - (wnd_btn_close->imageWidth + 3) && Controller::AnalogY > ListStart->Y && Controller::AnalogX < (ListStart->X + ListStart->Width) && Controller::AnalogY < (ListStart->Y + ListStart->Topbar->imageHeight))
	{
				DestroyWindow(ListStart);
				Controller::Handled = 1;
	}
	if (Controller::LastInput == PSP_CTRL_CROSS && ListStart)
	{
		if (Interface::IsWithinImage(Controller::AnalogX, Controller::AnalogY, ListStart->X, ListStart->Y, ListStart->Topbar))
		{
			WindowPosition(ListStart, ListStart->X + (Controller::AnalogX - Controller::PreviousAnalogX), ListStart->Y + (Controller::AnalogY - Controller::PreviousAnalogY));
			IsBeingDragged = 1;
			Controller::Handled = 1;
			IsActive = 1;
		}
		else if (Controller::IsLastInputPressed && Controller::LastInput == PSP_CTRL_CROSS && ListStart && IsBeingDragged)
		{
			WindowPosition(ListStart, ListStart->X + (Controller::AnalogX - Controller::PreviousAnalogX), ListStart->Y + (Controller::AnalogY - Controller::PreviousAnalogY));
			Controller::Handled = 1;
			IsActive = 1;
		}
	}
	else if (IsBeingDragged)
		IsBeingDragged = 0;
}
Exemple #2
0
gboolean WindowPositionTracker::configure(ui::Widget widget, GdkEventConfigure *event, WindowPositionTracker *self)
{
	self->m_position = WindowPosition( event->x, event->y, event->width, event->height );
	return FALSE;
}
Exemple #3
0
void WindowPosition_String::Import(WindowPosition &position, const char *value)
{
	if ( sscanf( value, "%d %d %d %d", &position.x, &position.y, &position.w, &position.h ) != 4 ) {
		position = WindowPosition( c_default_window_pos ); // ensure sane default value for window position
	}
}