mirror of
https://github.com/reactos/reactos.git
synced 2025-07-28 16:01:42 +00:00
charn <charn89@hotmail.com>:
A function for desktopbar.cpp that controls how the taskbar can be resized. svn path=/trunk/; revision=14620
This commit is contained in:
parent
3d7368e673
commit
adcb1f9fef
2 changed files with 38 additions and 4 deletions
|
@ -222,6 +222,10 @@ LRESULT DesktopBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
|||
Resize(LOWORD(lparam), HIWORD(lparam));
|
||||
break;
|
||||
|
||||
case WM_SIZING:
|
||||
ControlResize(wparam, lparam);
|
||||
break;
|
||||
|
||||
case PM_RESIZE_CHILDREN: {
|
||||
ClientRect size(_hwnd);
|
||||
Resize(size.right, size.bottom);
|
||||
|
@ -391,6 +395,35 @@ LRESULT DesktopBar::ProcessCopyData(COPYDATASTRUCT* pcd)
|
|||
}
|
||||
|
||||
|
||||
void DesktopBar::ControlResize(WPARAM wparam, LPARAM lparam)
|
||||
{
|
||||
PRECT dragRect = (PRECT) lparam;
|
||||
//int screenWidth = GetSystemMetrics(SM_CXSCREEN);
|
||||
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
///@todo write code for taskbar being at sides or top.
|
||||
|
||||
switch(wparam) {
|
||||
case WMSZ_BOTTOM: //@todo Taskbar is at the top of the screen
|
||||
break;
|
||||
|
||||
case WMSZ_TOP: // Taskbar is at the bottom of the screen
|
||||
dragRect->top = screenHeight - (((screenHeight - dragRect->top) + DESKTOPBARBAR_HEIGHT/2) / DESKTOPBARBAR_HEIGHT) * DESKTOPBARBAR_HEIGHT;
|
||||
if (dragRect->top < screenHeight / 2)
|
||||
dragRect->top = screenHeight - (screenHeight/2 / DESKTOPBARBAR_HEIGHT * DESKTOPBARBAR_HEIGHT);
|
||||
else if (dragRect->top > screenHeight - 5)
|
||||
dragRect->top = screenHeight - 5;
|
||||
break;
|
||||
|
||||
case WMSZ_RIGHT: //@todo Taskbar is at the left of the screen
|
||||
break;
|
||||
|
||||
case WMSZ_LEFT: //@todo Taskbar is at the right of the screen
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef _ROS_
|
||||
|
||||
void DesktopBar::AddTrayIcons()
|
||||
|
|
|
@ -92,6 +92,7 @@ protected:
|
|||
int Command(int id, int code);
|
||||
|
||||
void Resize(int cx, int cy);
|
||||
void ControlResize(WPARAM wparam, LPARAM lparam);
|
||||
void RegisterHotkeys();
|
||||
void ProcessHotKey(int id_hotkey);
|
||||
void ShowStartMenu();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue