void UIPopupPane::prepare()
{
    /* Prepare this: */
    installEventFilter(this);
    /* Prepare background: */
    prepareBackground();
    /* Prepare content: */
    prepareContent();
    /* Prepare animation: */
    prepareAnimation();

    /* Update size-hint: */
    sltUpdateSizeHint();
}
Example #2
0
void __cdecl
WinMainCRTStartup()
{
	HWND hWnd;
	HBITMAP bgbm = prepareBackground();
	HBRUSH bgbrush = CreatePatternBrush(bgbm);
	inst = GetModuleHandle(0);

	{
		WNDCLASS wc = {
			0, //style
			winProc, //lpfnWndProc
			0, //cbClsExtra
			0, //cbWndExtra
			inst, //hInstance
			0, //hIcon
			LoadCursor(NULL,IDC_ARROW), //hCursor
			bgbrush,
			0, //lpszMenuName
			TITLE //lpszClassName
		};
		RegisterClass(&wc);
	}

	hWnd = CreateWindow(TITLE, TITLE, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_VISIBLE, 0, 0, WIN_WIDTH, WIN_HEIGHT, 0, 0, inst, 0);

	{
		MSG msg;

		while (GetMessage(&msg, 0, 0, 0)) {
			if (!hDlgCurrent || !IsDialogMessage(hDlgCurrent, &msg)) {
				TranslateMessage(&msg);
				DispatchMessage(&msg);
			}
		}
	}

	DestroyWindow(hWnd);
	DeleteObject(bgbrush);
	DeleteObject(bgbm);
	ExitProcess(0);
}
Example #3
0
bool EventHandler::handleAppEvent(SDL_Event &event) {
	switch (event.type) {
	case SDL_APP_TERMINATING:
		prepareShutdown();
		break;
	case SDL_APP_LOWMEMORY:
		lowMemory();
		break;
	case SDL_APP_WILLENTERBACKGROUND:
		prepareBackground();
		return true;
	case SDL_APP_DIDENTERBACKGROUND:
		background();
		return true;
	case SDL_APP_WILLENTERFOREGROUND:
		prepareForeground();
		return true;
	case SDL_APP_DIDENTERFOREGROUND:
		foreground();
		return true;
	}
	return false;
}