4 * Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 This class handles the combo box of the address band.
29 Add auto completion support
30 Subclass windows in Init method
31 Connect to browser connection point
32 Handle navigation complete messages to set edit box text
33 Handle listbox dropdown message and fill contents
34 Add drag and drop of icon in edit box
35 Handle enter in edit box to browse to typed path
36 Handle change notifies to update appropriately
37 Add handling of enter in edit box
38 Fix so selection in combo listbox navigates
39 Fix so editing text and typing enter navigates
42 CAddressEditBox::CAddressEditBox() :
43 fEditWindow(NULL
, this, 1),
44 fComboBoxExWindow(NULL
, this, 2)
48 CAddressEditBox::~CAddressEditBox()
52 HRESULT STDMETHODCALLTYPE
CAddressEditBox::SetOwner(IUnknown
*)
54 // connect to browser connection point
58 HRESULT STDMETHODCALLTYPE
CAddressEditBox::FileSysChange(long param8
, long paramC
)
63 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Refresh(long param8
)
68 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Init(HWND comboboxEx
, HWND editControl
, long param14
, IUnknown
*param18
)
70 fComboBoxExWindow
.SubclassWindow(comboboxEx
);
71 fEditWindow
.SubclassWindow(editControl
);
75 HRESULT STDMETHODCALLTYPE
CAddressEditBox::SetCurrentDir(long paramC
)
80 HRESULT STDMETHODCALLTYPE
CAddressEditBox::ParseNow(long paramC
)
85 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Execute(long paramC
)
90 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Save(long paramC
)
95 HRESULT STDMETHODCALLTYPE
CAddressEditBox::OnWinEvent(
96 HWND hWnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
, LRESULT
*theResult
)
98 // handle fill of listbox here
102 HRESULT STDMETHODCALLTYPE
CAddressEditBox::IsWindowOwner(HWND hWnd
)
107 HRESULT STDMETHODCALLTYPE
CAddressEditBox::QueryStatus(
108 const GUID
*pguidCmdGroup
, ULONG cCmds
, OLECMD prgCmds
[ ], OLECMDTEXT
*pCmdText
)
113 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Exec(const GUID
*pguidCmdGroup
, DWORD nCmdID
,
114 DWORD nCmdexecopt
, VARIANT
*pvaIn
, VARIANT
*pvaOut
)
119 HRESULT STDMETHODCALLTYPE
CAddressEditBox::GetTypeInfoCount(UINT
*pctinfo
)
124 HRESULT STDMETHODCALLTYPE
CAddressEditBox::GetTypeInfo(UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
129 HRESULT STDMETHODCALLTYPE
CAddressEditBox::GetIDsOfNames(
130 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
135 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Invoke(DISPID dispIdMember
, REFIID riid
, LCID lcid
,
136 WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
138 // on navigate complete, change edit section of combobox
142 HRESULT STDMETHODCALLTYPE
CAddressEditBox::GetClassID(CLSID
*pClassID
)
144 if (pClassID
== NULL
)
146 *pClassID
= CLSID_AddressEditBox
;
150 HRESULT STDMETHODCALLTYPE
CAddressEditBox::IsDirty()
155 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Load(IStream
*pStm
)
160 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Save(IStream
*pStm
, BOOL fClearDirty
)
165 HRESULT STDMETHODCALLTYPE
CAddressEditBox::GetSizeMax(ULARGE_INTEGER
*pcbSize
)
170 HRESULT
CreateAddressEditBox(REFIID riid
, void **ppv
)
172 CComObject
<CAddressEditBox
> *theMenuBar
;
178 ATLTRY (theMenuBar
= new CComObject
<CAddressEditBox
>);
179 if (theMenuBar
== NULL
)
180 return E_OUTOFMEMORY
;
181 hResult
= theMenuBar
->QueryInterface(riid
, reinterpret_cast<void **>(ppv
));