mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-17 13:20:10 +02:00
Allow the launcher window to be moved
This commit is contained in:
parent
07983cd642
commit
a94eb4d44b
2 changed files with 49 additions and 9 deletions
|
@ -119,9 +119,16 @@ BOOL CLauncherDlg::OnInitDialog() {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
POINT CLauncherDlg::getMouseCoords(MSG* pMsg) {
|
||||||
|
POINT pos;
|
||||||
|
pos.x = (int)(short)LOWORD(pMsg->lParam);
|
||||||
|
pos.y = (int)(short)HIWORD(pMsg->lParam);
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL CLauncherDlg::PreTranslateMessage(MSG* pMsg) {
|
BOOL CLauncherDlg::PreTranslateMessage(MSG* pMsg) {
|
||||||
if ((pMsg->message == WM_KEYDOWN))
|
switch (pMsg->message) {
|
||||||
{
|
case WM_KEYDOWN:
|
||||||
if (pMsg->wParam == 'A' && GetKeyState(VK_CONTROL) < 0) {
|
if (pMsg->wParam == 'A' && GetKeyState(VK_CONTROL) < 0) {
|
||||||
CWnd* wnd = GetFocus();
|
CWnd* wnd = GetFocus();
|
||||||
CWnd* myWnd = this->GetDlgItem(IDC_ORGNAME);
|
CWnd* myWnd = this->GetDlgItem(IDC_ORGNAME);
|
||||||
|
@ -135,6 +142,33 @@ BOOL CLauncherDlg::PreTranslateMessage(MSG* pMsg) {
|
||||||
OnNextClicked();
|
OnNextClicked();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case WM_LBUTTONDOWN:
|
||||||
|
if (pMsg->hwnd == GetSafeHwnd()) {
|
||||||
|
_draggingWindow = true;
|
||||||
|
_dragOffset = getMouseCoords(pMsg);
|
||||||
|
SetCapture();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WM_LBUTTONUP:
|
||||||
|
if (_draggingWindow) {
|
||||||
|
ReleaseCapture();
|
||||||
|
_draggingWindow = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WM_MOUSEMOVE:
|
||||||
|
if (_draggingWindow) {
|
||||||
|
POINT pos = getMouseCoords(pMsg);
|
||||||
|
RECT windowRect;
|
||||||
|
GetWindowRect(&windowRect);
|
||||||
|
int width = windowRect.right - windowRect.left;
|
||||||
|
int height = windowRect.bottom - windowRect.top;
|
||||||
|
ClientToScreen(&pos);
|
||||||
|
MoveWindow(pos.x - _dragOffset.x, pos.y - _dragOffset.y, width, height, FALSE);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return CDialog::PreTranslateMessage(pMsg);
|
return CDialog::PreTranslateMessage(pMsg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,12 +60,18 @@ protected:
|
||||||
DrawStep _drawStep { DrawStep::DrawLogo };
|
DrawStep _drawStep { DrawStep::DrawLogo };
|
||||||
BOOL getTextFormat(int ResID, TextFormat& formatOut);
|
BOOL getTextFormat(int ResID, TextFormat& formatOut);
|
||||||
void showWindows(std::vector<CStatic*> windows, bool show);
|
void showWindows(std::vector<CStatic*> windows, bool show);
|
||||||
|
POINT getMouseCoords(MSG* pMsg);
|
||||||
|
|
||||||
bool _isConsoleRunning{ false };
|
|
||||||
bool _isInstalling{ false };
|
bool _isConsoleRunning { false };
|
||||||
bool _isFirstDraw{ false };
|
bool _isInstalling { false };
|
||||||
bool _showSplash{ true };
|
bool _isFirstDraw { false };
|
||||||
int _splashStep{ 0 };
|
bool _showSplash { true };
|
||||||
|
|
||||||
|
bool _draggingWindow { false };
|
||||||
|
POINT _dragOffset;
|
||||||
|
|
||||||
|
int _splashStep { 0 };
|
||||||
float _logoRotation { 0.0f };
|
float _logoRotation { 0.0f };
|
||||||
|
|
||||||
HICON m_hIcon;
|
HICON m_hIcon;
|
||||||
|
|
Loading…
Reference in a new issue