mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
resize taskbar buttons on WM_SIZE
svn path=/trunk/; revision=8729
This commit is contained in:
parent
38b3d10879
commit
254292d714
5 changed files with 14 additions and 6 deletions
|
@ -41,7 +41,7 @@ exe explorer :
|
||||||
dialogs/searchprogram.cpp
|
dialogs/searchprogram.cpp
|
||||||
dialogs/settings.cpp
|
dialogs/settings.cpp
|
||||||
i386-stub-win32.c
|
i386-stub-win32.c
|
||||||
: <define>WIN32 <define>_WIN32_IE=0x0501 <define>_WIN32_WINNT=0x0501
|
: <define>WIN32 <define>_WIN32_IE=0x0600 <define>_WIN32_WINNT=0x0501
|
||||||
<cxxflags>-I$(INCLUDE)
|
<cxxflags>-I$(INCLUDE)
|
||||||
#nur für GCC: <cxxflags>-fexceptions <cxxflags>-Wall
|
#nur für GCC: <cxxflags>-fexceptions <cxxflags>-Wall
|
||||||
<find-shared-library>gdi32
|
<find-shared-library>gdi32
|
||||||
|
|
|
@ -43,7 +43,7 @@ ifndef UNICODE
|
||||||
UNICODE = 1
|
UNICODE = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS = -DWIN32 -D_ROS_ -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -fexceptions -Wall -I$(W32API_PATH)/include
|
CFLAGS = -DWIN32 -D_ROS_ -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -fexceptions -Wall -I$(W32API_PATH)/include
|
||||||
RCFLAGS = -DWIN32 -D_ROS_ -D__WINDRES__ --include-dir $(W32API_PATH)/include
|
RCFLAGS = -DWIN32 -D_ROS_ -D__WINDRES__ --include-dir $(W32API_PATH)/include
|
||||||
LFLAGS = -Wl,--subsystem,windows
|
LFLAGS = -Wl,--subsystem,windows
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ TaskBarMap::~TaskBarMap()
|
||||||
TaskBar::TaskBar(HWND hwnd)
|
TaskBar::TaskBar(HWND hwnd)
|
||||||
: super(hwnd)
|
: super(hwnd)
|
||||||
{
|
{
|
||||||
|
_last_btn_width = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskBar::~TaskBar()
|
TaskBar::~TaskBar()
|
||||||
|
@ -86,13 +87,14 @@ LRESULT TaskBar::Init(LPCREATESTRUCT pcs)
|
||||||
|
|
||||||
_htoolbar = CreateToolbarEx(_hwnd,
|
_htoolbar = CreateToolbarEx(_hwnd,
|
||||||
WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
|
WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
|
||||||
CCS_TOP|CCS_NODIVIDER | TBSTYLE_LIST|TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE,
|
CCS_TOP|CCS_NODIVIDER | TBSTYLE_LIST|TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE,//|TBSTYLE_AUTOSIZE
|
||||||
IDW_TASKTOOLBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
|
IDW_TASKTOOLBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
|
||||||
|
|
||||||
SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(TASKBUTTONWIDTH_MAX,TASKBUTTONWIDTH_MAX));
|
SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(TASKBUTTONWIDTH_MAX,TASKBUTTONWIDTH_MAX));
|
||||||
//SendMessage(_htoolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
|
//SendMessage(_htoolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
|
||||||
//SendMessage(_htoolbar, TB_SETDRAWTEXTFLAGS, DT_CENTER|DT_VCENTER, DT_CENTER|DT_VCENTER);
|
//SendMessage(_htoolbar, TB_SETDRAWTEXTFLAGS, DT_CENTER|DT_VCENTER, DT_CENTER|DT_VCENTER);
|
||||||
//SetWindowFont(_htoolbar, GetStockFont(ANSI_VAR_FONT), FALSE);
|
//SetWindowFont(_htoolbar, GetStockFont(ANSI_VAR_FONT), FALSE);
|
||||||
|
//SendMessage(_htoolbar, TB_SETPADDING, 0, MAKELPARAM(8,8));
|
||||||
|
|
||||||
_next_id = IDC_FIRST_APP;
|
_next_id = IDC_FIRST_APP;
|
||||||
|
|
||||||
|
@ -110,6 +112,7 @@ LRESULT TaskBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
||||||
switch(nmsg) {
|
switch(nmsg) {
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
SendMessage(_htoolbar, WM_SIZE, 0, 0);
|
SendMessage(_htoolbar, WM_SIZE, 0, 0);
|
||||||
|
ResizeButtons();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_TIMER:
|
case WM_TIMER:
|
||||||
|
@ -463,7 +466,11 @@ void TaskBar::ResizeButtons()
|
||||||
else if (btn_width > TASKBUTTONWIDTH_MAX)
|
else if (btn_width > TASKBUTTONWIDTH_MAX)
|
||||||
btn_width = TASKBUTTONWIDTH_MAX;
|
btn_width = TASKBUTTONWIDTH_MAX;
|
||||||
|
|
||||||
SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(btn_width,btn_width));
|
if (btn_width != _last_btn_width) {
|
||||||
SendMessage(_htoolbar, TB_AUTOSIZE, 0, 0);
|
_last_btn_width = btn_width;
|
||||||
|
|
||||||
|
SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(btn_width,btn_width));
|
||||||
|
SendMessage(_htoolbar, TB_AUTOSIZE, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,7 @@ protected:
|
||||||
TaskBarMap _map;
|
TaskBarMap _map;
|
||||||
int _next_id;
|
int _next_id;
|
||||||
WindowHandle _last_foreground_wnd;
|
WindowHandle _last_foreground_wnd;
|
||||||
|
int _last_btn_width;
|
||||||
|
|
||||||
LRESULT Init(LPCREATESTRUCT pcs);
|
LRESULT Init(LPCREATESTRUCT pcs);
|
||||||
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
|
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
|
||||||
|
|
|
@ -108,7 +108,7 @@ NotifyArea::NotifyArea(HWND hwnd)
|
||||||
_clock_width = 0;
|
_clock_width = 0;
|
||||||
_show_hidden = false;
|
_show_hidden = false;
|
||||||
|
|
||||||
_tooltip.add(_hwnd, _hwnd);
|
_tooltip.add(_hwnd, _hwnd); ///@todo use one area for each icon
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT NotifyArea::Init(LPCREATESTRUCT pcs)
|
LRESULT NotifyArea::Init(LPCREATESTRUCT pcs)
|
||||||
|
|
Loading…
Reference in a new issue