No changes, just refactor wxMSW wxComboBox code calling GetComboBoxInfo().
Move the code dynamically loading this function to the base wxChoice class to make it possible to use it from there in the upcoming commit. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72953 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -12,6 +12,8 @@
|
|||||||
#ifndef _WX_CHOICE_H_
|
#ifndef _WX_CHOICE_H_
|
||||||
#define _WX_CHOICE_H_
|
#define _WX_CHOICE_H_
|
||||||
|
|
||||||
|
struct tagCOMBOBOXINFO;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Choice item
|
// Choice item
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -136,6 +138,10 @@ protected:
|
|||||||
// set the height of the visible part of the control to m_heightOwn
|
// set the height of the visible part of the control to m_heightOwn
|
||||||
void MSWUpdateVisibleHeight();
|
void MSWUpdateVisibleHeight();
|
||||||
|
|
||||||
|
// Call GetComboBoxInfo() and return false if it's not supported by this
|
||||||
|
// system. Notice that the caller must initialize info.cbSize.
|
||||||
|
bool MSWGetComboBoxInfo(tagCOMBOBOXINFO* info) const;
|
||||||
|
|
||||||
// create and initialize the control
|
// create and initialize the control
|
||||||
bool CreateAndInit(wxWindow *parent, wxWindowID id,
|
bool CreateAndInit(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
|
@@ -36,6 +36,8 @@
|
|||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/dynlib.h"
|
||||||
|
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -198,6 +200,28 @@ wxChoice::~wxChoice()
|
|||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxChoice::MSWGetComboBoxInfo(COMBOBOXINFO* info) const
|
||||||
|
{
|
||||||
|
// TODO-Win9x: Get rid of this once we officially drop support for Win9x
|
||||||
|
// and just call the function directly.
|
||||||
|
#if wxUSE_DYNLIB_CLASS
|
||||||
|
typedef BOOL (WINAPI *GetComboBoxInfo_t)(HWND, COMBOBOXINFO*);
|
||||||
|
static GetComboBoxInfo_t s_pfnGetComboBoxInfo = NULL;
|
||||||
|
static bool s_triedToLoad = false;
|
||||||
|
if ( !s_triedToLoad )
|
||||||
|
{
|
||||||
|
s_triedToLoad = true;
|
||||||
|
wxLoadedDLL dllUser32("user32.dll");
|
||||||
|
wxDL_INIT_FUNC(s_pfn, GetComboBoxInfo, dllUser32);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( s_pfnGetComboBoxInfo )
|
||||||
|
return (*s_pfnGetComboBoxInfo)(GetHwnd(), info) != 0;
|
||||||
|
#endif // wxUSE_DYNLIB_CLASS
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// adding/deleting items to/from the list
|
// adding/deleting items to/from the list
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -39,7 +39,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/clipbrd.h"
|
#include "wx/clipbrd.h"
|
||||||
#include "wx/dynlib.h"
|
|
||||||
#include "wx/wupdlock.h"
|
#include "wx/wupdlock.h"
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
|
|
||||||
@@ -378,26 +377,9 @@ bool wxComboBox::MSWShouldPreProcessMessage(WXMSG *pMsg)
|
|||||||
|
|
||||||
WXHWND wxComboBox::GetEditHWNDIfAvailable() const
|
WXHWND wxComboBox::GetEditHWNDIfAvailable() const
|
||||||
{
|
{
|
||||||
#if wxUSE_DYNLIB_CLASS
|
|
||||||
#if defined(WINVER) && WINVER >= 0x0500
|
|
||||||
typedef BOOL (WINAPI *GetComboBoxInfo_t)(HWND, COMBOBOXINFO*);
|
|
||||||
static GetComboBoxInfo_t s_pfnGetComboBoxInfo = NULL;
|
|
||||||
static bool s_triedToLoad = false;
|
|
||||||
if ( !s_triedToLoad )
|
|
||||||
{
|
|
||||||
s_triedToLoad = true;
|
|
||||||
wxLoadedDLL dllUser32("user32.dll");
|
|
||||||
wxDL_INIT_FUNC(s_pfn, GetComboBoxInfo, dllUser32);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( s_pfnGetComboBoxInfo )
|
|
||||||
{
|
|
||||||
WinStruct<COMBOBOXINFO> info;
|
WinStruct<COMBOBOXINFO> info;
|
||||||
(*s_pfnGetComboBoxInfo)(GetHwnd(), &info);
|
if ( MSWGetComboBoxInfo(&info) )
|
||||||
return info.hwndItem;
|
return info.hwndItem;
|
||||||
}
|
|
||||||
#endif // WINVER >= 0x0500
|
|
||||||
#endif // wxUSE_DYNLIB_CLASS
|
|
||||||
|
|
||||||
if (HasFlag(wxCB_SIMPLE))
|
if (HasFlag(wxCB_SIMPLE))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user