mirror of
https://github.com/reactos/reactos.git
synced 2024-09-09 20:30:04 +00:00
rebar control for desktop bar
svn path=/trunk/; revision=8387
This commit is contained in:
parent
1816da4b7a
commit
427c8aeb8f
|
@ -65,3 +65,4 @@ If you search for more information, look into the CVS repository.
|
|||
16.02.2004 m. fuchs lean explorer version without additional bells and whistles -> see CVS branch "lean-explorer"
|
||||
23.02.2004 m. fuchs start menu navigation using first characters of entry names
|
||||
fixes for leaking GDI handles
|
||||
25.02.2004 m. fuchs rebar control for desktop bar
|
||||
|
|
|
@ -103,6 +103,44 @@ LRESULT DesktopBar::Init(LPCREATESTRUCT pcs)
|
|||
|
||||
_hwndQuickLaunch = QuickLaunchBar::Create(_hwnd);
|
||||
|
||||
// create rebar window to manage task and quick launch bar
|
||||
#ifndef _NO_REBAR
|
||||
_hwndrebar = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, NULL,
|
||||
WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
|
||||
RBS_VARHEIGHT|RBS_AUTOSIZE|RBS_DBLCLKTOGGLE| //|RBS_REGISTERDROP
|
||||
CCS_NODIVIDER|CCS_NOPARENTALIGN,
|
||||
0, 0, 0, 0, _hwnd, 0, g_Globals._hInstance, 0);
|
||||
|
||||
REBARBANDINFO rbBand;
|
||||
|
||||
rbBand.cbSize = sizeof(REBARBANDINFO);
|
||||
rbBand.fMask = RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE;
|
||||
#ifndef RBBS_HIDETITLE // missing in MinGW headers as of 25.02.2004
|
||||
#define RBBS_HIDETITLE 0x400
|
||||
#endif
|
||||
rbBand.fStyle = RBBS_CHILDEDGE|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE;
|
||||
|
||||
rbBand.cxMinChild = 0;
|
||||
rbBand.cyMinChild = 0;
|
||||
rbBand.cyChild = 0;
|
||||
rbBand.cyMaxChild = 0;
|
||||
rbBand.cyIntegral = DESKTOPBARBAR_HEIGHT;
|
||||
|
||||
rbBand.lpText = TEXT("Quicklaunchbar");
|
||||
rbBand.hwndChild = _hwndQuickLaunch;
|
||||
rbBand.cxMinChild = 0;
|
||||
rbBand.cyMinChild = HIWORD(SendMessage(_hwndQuickLaunch, TB_GETBUTTONSIZE, 0, 0)) + 2;
|
||||
rbBand.cx = 250;
|
||||
SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
|
||||
|
||||
rbBand.lpText = TEXT("Taskbar");
|
||||
rbBand.hwndChild = _hwndTaskBar;
|
||||
rbBand.cxMinChild = 0;
|
||||
rbBand.cyMinChild = ClientRect(_hwndTaskBar).bottom + 2;
|
||||
rbBand.cx = 200; //pcs->cx-TASKBAR_LEFT-quicklaunch_width-(notifyarea_width+1);
|
||||
SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
|
||||
#endif
|
||||
|
||||
RegisterHotkeys();
|
||||
|
||||
// notify all top level windows about the successfully created desktop bar
|
||||
|
@ -204,15 +242,19 @@ void DesktopBar::Resize(int cx, int cy)
|
|||
|
||||
HDWP hdwp = BeginDeferWindowPos(3);
|
||||
|
||||
if (_hwndTaskBar)
|
||||
DeferWindowPos(hdwp, _hwndTaskBar, 0, TASKBAR_LEFT+quicklaunch_width, 0, cx-TASKBAR_LEFT-quicklaunch_width-(notifyarea_width+1), cy, SWP_NOZORDER|SWP_NOACTIVATE);
|
||||
if (_hwndrebar)
|
||||
DeferWindowPos(hdwp, _hwndrebar, 0, TASKBAR_LEFT, 0, cx-TASKBAR_LEFT-(notifyarea_width+1), cy, SWP_NOZORDER|SWP_NOACTIVATE);
|
||||
else {
|
||||
if (_hwndQuickLaunch)
|
||||
DeferWindowPos(hdwp, _hwndQuickLaunch, 0, TASKBAR_LEFT, 1, quicklaunch_width, cy-2, SWP_NOZORDER|SWP_NOACTIVATE);
|
||||
|
||||
if (_hwndTaskBar)
|
||||
DeferWindowPos(hdwp, _hwndTaskBar, 0, TASKBAR_LEFT+quicklaunch_width, 0, cx-TASKBAR_LEFT-quicklaunch_width-(notifyarea_width+1), cy, SWP_NOZORDER|SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
if (_hwndNotify)
|
||||
DeferWindowPos(hdwp, _hwndNotify, 0, cx-(notifyarea_width+1), 1, notifyarea_width, cy-2, SWP_NOZORDER|SWP_NOACTIVATE);
|
||||
|
||||
if (_hwndQuickLaunch)
|
||||
DeferWindowPos(hdwp, _hwndQuickLaunch, 0, TASKBAR_LEFT, 1, quicklaunch_width, cy-2, SWP_NOZORDER|SWP_NOACTIVATE);
|
||||
|
||||
EndDeferWindowPos(hdwp);
|
||||
|
||||
WindowRect rect(_hwnd);
|
||||
|
|
|
@ -92,6 +92,7 @@ protected:
|
|||
WindowHandle _hwndTaskBar;
|
||||
WindowHandle _hwndNotify;
|
||||
WindowHandle _hwndQuickLaunch;
|
||||
WindowHandle _hwndrebar;
|
||||
|
||||
struct StartMenuRoot* _startMenuRoot;
|
||||
};
|
||||
|
|
|
@ -65,7 +65,6 @@ QuickLaunchBar::QuickLaunchBar(HWND hwnd)
|
|||
|
||||
SetWindowStyle(hwndToolTip, GetWindowStyle(hwndToolTip)|TTS_ALWAYSTIP);
|
||||
|
||||
// delay refresh to some time later
|
||||
PostMessage(hwnd, PM_REFRESH, 0, 0);
|
||||
}
|
||||
|
||||
|
@ -81,7 +80,8 @@ HWND QuickLaunchBar::Create(HWND hwndParent)
|
|||
ClientRect clnt(hwndParent);
|
||||
|
||||
HWND hwnd = CreateToolbarEx(hwndParent,
|
||||
WS_CHILD|WS_VISIBLE|CCS_NODIVIDER|CCS_NORESIZE|
|
||||
WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
|
||||
CCS_TOP|CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_NORESIZE|
|
||||
TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE|TBSTYLE_FLAT,
|
||||
IDW_QUICKLAUNCHBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
|
||||
|
||||
|
|
|
@ -72,7 +72,8 @@ HWND TaskBar::Create(HWND hwndParent)
|
|||
ClientRect clnt(hwndParent);
|
||||
|
||||
return Window::Create(WINDOW_CREATOR(TaskBar), 0,
|
||||
BtnWindowClass(CLASSNAME_TASKBAR), TITLE_TASKBAR, WS_CHILD|WS_VISIBLE,
|
||||
BtnWindowClass(CLASSNAME_TASKBAR), TITLE_TASKBAR,
|
||||
WS_CHILD|WS_VISIBLE | CCS_TOP|CCS_NODIVIDER|CCS_NORESIZE,
|
||||
TASKBAR_LEFT, 0, clnt.right-TASKBAR_LEFT-(NOTIFYAREA_WIDTH_DEF+1), clnt.bottom, hwndParent);
|
||||
}
|
||||
|
||||
|
@ -82,8 +83,8 @@ LRESULT TaskBar::Init(LPCREATESTRUCT pcs)
|
|||
return 1;
|
||||
|
||||
_htoolbar = CreateToolbarEx(_hwnd,
|
||||
WS_CHILD|WS_VISIBLE|CCS_NODIVIDER|CCS_TOP|
|
||||
TBSTYLE_LIST|TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE,
|
||||
WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
|
||||
CCS_TOP|CCS_NODIVIDER | TBSTYLE_LIST|TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE,
|
||||
IDW_TASKTOOLBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
|
||||
|
||||
SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(80,160));
|
||||
|
|
Loading…
Reference in a new issue