mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[BROWSEUI]
* Reenable the brand box on file browser windows. * Fix an invalid usage of a null HWND. * Implement size calculation of the standard toolbar. CORE-7330 svn path=/branches/shell-experiments/; revision=62961
This commit is contained in:
parent
2f3d0e3e01
commit
60334b103a
4 changed files with 37 additions and 24 deletions
|
@ -817,7 +817,7 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::GetSizeMax(ULARGE_INTEGER *pcbSize)
|
||||||
HRESULT STDMETHODCALLTYPE CInternetToolbar::InitNew()
|
HRESULT STDMETHODCALLTYPE CInternetToolbar::InitNew()
|
||||||
{
|
{
|
||||||
CComPtr<IShellMenu> menuBar;
|
CComPtr<IShellMenu> menuBar;
|
||||||
//CComPtr<IUnknown> logoBar;
|
CComPtr<IUnknown> logoBar;
|
||||||
CComPtr<IUnknown> toolsBar;
|
CComPtr<IUnknown> toolsBar;
|
||||||
CComPtr<IUnknown> navigationBar;
|
CComPtr<IUnknown> navigationBar;
|
||||||
CComPtr<IOleWindow> menuOleWindow;
|
CComPtr<IOleWindow> menuOleWindow;
|
||||||
|
@ -825,6 +825,7 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::InitNew()
|
||||||
CComPtr<IOleWindow> navigationOleWindow;
|
CComPtr<IOleWindow> navigationOleWindow;
|
||||||
HRESULT hResult;
|
HRESULT hResult;
|
||||||
|
|
||||||
|
/* Create and attach the menubar to the rebar */
|
||||||
hResult = CreateMenuBar(&menuBar);
|
hResult = CreateMenuBar(&menuBar);
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
return hResult;
|
return hResult;
|
||||||
|
@ -835,15 +836,15 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::InitNew()
|
||||||
hResult = menuOleWindow->GetWindow(&fMenuBandWindow);
|
hResult = menuOleWindow->GetWindow(&fMenuBandWindow);
|
||||||
fMenuBar.Attach(menuBar.Detach()); // transfer the ref count
|
fMenuBar.Attach(menuBar.Detach()); // transfer the ref count
|
||||||
|
|
||||||
/* FIXME
|
/* Create and attach the brand/logo to the rebar */
|
||||||
hResult = CreateBrandBand(&logoBar);
|
hResult = CreateBrandBand(&logoBar);
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
return hResult;
|
return hResult;
|
||||||
AddDockItem(logoBar, ITBBID_BRANDBAND,
|
AddDockItem(logoBar, ITBBID_BRANDBAND,
|
||||||
CDockSite::ITF_NOGRIPPER | CDockSite::ITF_NOTITLE | CDockSite::ITF_FIXEDSIZE);
|
CDockSite::ITF_NOGRIPPER | CDockSite::ITF_NOTITLE | CDockSite::ITF_FIXEDSIZE);
|
||||||
fLogoBar.Attach(logoBar.Detach()); // transfer the ref count
|
fLogoBar.Attach(logoBar.Detach()); // transfer the ref count
|
||||||
*/
|
|
||||||
|
|
||||||
|
/* Create and attach the standard toolbar to the rebar */
|
||||||
hResult = CreateToolsBar(&toolsBar);
|
hResult = CreateToolsBar(&toolsBar);
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
return hResult;
|
return hResult;
|
||||||
|
@ -856,6 +857,7 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::InitNew()
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
return hResult;
|
return hResult;
|
||||||
|
|
||||||
|
/* Create and attach the address/navigation toolbar to the rebar */
|
||||||
hResult = CreateAddressBand(&navigationBar);
|
hResult = CreateAddressBand(&navigationBar);
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
return hResult;
|
return hResult;
|
||||||
|
|
|
@ -87,7 +87,7 @@ public:
|
||||||
CComPtr<IShellMenu> fMenuBar; // the menu rebar
|
CComPtr<IShellMenu> fMenuBar; // the menu rebar
|
||||||
HWND fMenuBandWindow;
|
HWND fMenuBandWindow;
|
||||||
HWND fNavigationWindow;
|
HWND fNavigationWindow;
|
||||||
//CComPtr<IUnknown> fLogoBar; // the reactos logo
|
CComPtr<IUnknown> fLogoBar; // the reactos logo
|
||||||
CComPtr<IUnknown> fControlsBar; // navigation controls
|
CComPtr<IUnknown> fControlsBar; // navigation controls
|
||||||
CComPtr<IUnknown> fNavigationBar; // address bar
|
CComPtr<IUnknown> fNavigationBar; // address bar
|
||||||
CComObject<CMenuCallback> fMenuCallback;
|
CComObject<CMenuCallback> fMenuCallback;
|
||||||
|
|
|
@ -1305,11 +1305,10 @@ void CShellBrowser::RepositionBars()
|
||||||
RECT statusRect;
|
RECT statusRect;
|
||||||
RECT toolbarRect;
|
RECT toolbarRect;
|
||||||
int x;
|
int x;
|
||||||
HRESULT hResult;
|
|
||||||
|
|
||||||
GetClientRect(&clientRect);
|
GetClientRect(&clientRect);
|
||||||
|
|
||||||
if (fStatusBarVisible)
|
if (fStatusBarVisible && fStatusBar)
|
||||||
{
|
{
|
||||||
::GetWindowRect(fStatusBar, &statusRect);
|
::GetWindowRect(fStatusBar, &statusRect);
|
||||||
::SetWindowPos(fStatusBar, NULL, clientRect.left, clientRect.bottom - (statusRect.bottom - statusRect.top),
|
::SetWindowPos(fStatusBar, NULL, clientRect.left, clientRect.bottom - (statusRect.bottom - statusRect.top),
|
||||||
|
@ -1320,14 +1319,9 @@ void CShellBrowser::RepositionBars()
|
||||||
|
|
||||||
for (x = 0; x < 3; x++)
|
for (x = 0; x < 3; x++)
|
||||||
{
|
{
|
||||||
CComPtr<IOleWindow> oleWindow;
|
|
||||||
|
|
||||||
if (fClientBars[x].hwnd == NULL && fClientBars[x].clientBar != NULL)
|
if (fClientBars[x].hwnd == NULL && fClientBars[x].clientBar != NULL)
|
||||||
{
|
{
|
||||||
hResult = fClientBars[x].clientBar->QueryInterface(
|
IUnknown_GetWindow(fClientBars[x].clientBar, &fClientBars[x].hwnd);
|
||||||
IID_IOleWindow, reinterpret_cast<void **>(&oleWindow));
|
|
||||||
if (SUCCEEDED(hResult))
|
|
||||||
hResult = oleWindow->GetWindow(&fClientBars[x].hwnd);
|
|
||||||
}
|
}
|
||||||
if (fClientBars[x].hwnd != NULL)
|
if (fClientBars[x].hwnd != NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,10 +24,9 @@ Implements the toolbar band of a cabinet window
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
/*
|
/* FIXME, I can't include windowsx because it conflicts with some #defines */
|
||||||
TODO:
|
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
|
||||||
**Fix GetBandInfo to calculate size correctly
|
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
|
||||||
*/
|
|
||||||
|
|
||||||
class CToolsBand :
|
class CToolsBand :
|
||||||
public CWindowImpl<CToolsBand, CWindow, CControlWinTraits>,
|
public CWindowImpl<CToolsBand, CWindow, CControlWinTraits>,
|
||||||
|
@ -108,25 +107,43 @@ CToolsBand::~CToolsBand()
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CToolsBand::GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO* pdbi)
|
HRESULT STDMETHODCALLTYPE CToolsBand::GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO* pdbi)
|
||||||
{
|
{
|
||||||
|
RECT actualRect;
|
||||||
|
POINTL actualSize;
|
||||||
|
POINTL idealSize;
|
||||||
|
POINTL maxSize;
|
||||||
|
POINTL itemSize;
|
||||||
|
|
||||||
|
::GetWindowRect(m_hWnd, &actualRect);
|
||||||
|
actualSize.x = actualRect.right - actualRect.left;
|
||||||
|
actualSize.y = actualRect.bottom - actualRect.top;
|
||||||
|
|
||||||
|
/* Obtain the ideal size, to be used as min and max */
|
||||||
|
SendMessageW(m_hWnd, TB_AUTOSIZE, 0, 0);
|
||||||
|
SendMessageW(m_hWnd, TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(&maxSize));
|
||||||
|
|
||||||
|
idealSize = maxSize;
|
||||||
|
SendMessageW(m_hWnd, TB_GETIDEALSIZE, FALSE, reinterpret_cast<LPARAM>(&idealSize));
|
||||||
|
|
||||||
|
/* Obtain the button size, to be used as the integral size */
|
||||||
|
DWORD size = SendMessageW(m_hWnd, TB_GETBUTTONSIZE, 0, 0);
|
||||||
|
itemSize.x = GET_X_LPARAM(size);
|
||||||
|
itemSize.y = GET_Y_LPARAM(size);
|
||||||
|
|
||||||
if (pdbi->dwMask & DBIM_MINSIZE)
|
if (pdbi->dwMask & DBIM_MINSIZE)
|
||||||
{
|
{
|
||||||
pdbi->ptMinSize.x = 400;
|
pdbi->ptMinSize = idealSize;
|
||||||
pdbi->ptMinSize.y = 38;
|
|
||||||
}
|
}
|
||||||
if (pdbi->dwMask & DBIM_MAXSIZE)
|
if (pdbi->dwMask & DBIM_MAXSIZE)
|
||||||
{
|
{
|
||||||
pdbi->ptMaxSize.x = 0;
|
pdbi->ptMaxSize = maxSize;
|
||||||
pdbi->ptMaxSize.y = 0;
|
|
||||||
}
|
}
|
||||||
if (pdbi->dwMask & DBIM_INTEGRAL)
|
if (pdbi->dwMask & DBIM_INTEGRAL)
|
||||||
{
|
{
|
||||||
pdbi->ptIntegral.x = 0;
|
pdbi->ptIntegral = itemSize;
|
||||||
pdbi->ptIntegral.y = 0;
|
|
||||||
}
|
}
|
||||||
if (pdbi->dwMask & DBIM_ACTUAL)
|
if (pdbi->dwMask & DBIM_ACTUAL)
|
||||||
{
|
{
|
||||||
pdbi->ptActual.x = 400;
|
pdbi->ptActual = actualSize;
|
||||||
pdbi->ptActual.y = 38;
|
|
||||||
}
|
}
|
||||||
if (pdbi->dwMask & DBIM_TITLE)
|
if (pdbi->dwMask & DBIM_TITLE)
|
||||||
wcscpy(pdbi->wszTitle, L"");
|
wcscpy(pdbi->wszTitle, L"");
|
||||||
|
|
Loading…
Reference in a new issue