Remove checks GetComCtl32Version() aimed prior WinXP.
Windows XP always has ComCtl32Version 582 available. If the executable includes a manifest version 600 is available.
This commit is contained in:
@@ -54,13 +54,6 @@ bool wxMSWDateControls::CheckInitialization()
|
||||
// it's enough to give the error only once
|
||||
s_initResult = false;
|
||||
|
||||
if ( wxApp::GetComCtl32Version() < 470 )
|
||||
{
|
||||
wxLogError(_("This system doesn't support date controls, please upgrade your version of comctl32.dll"));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
INITCOMMONCONTROLSEX icex;
|
||||
icex.dwSize = sizeof(icex);
|
||||
|
@@ -70,9 +70,7 @@ WXDWORD wxDatePickerCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
WXDWORD styleMSW = wxDatePickerCtrlBase::MSWGetStyle(style, exstyle);
|
||||
|
||||
// although MSDN doesn't mention it, DTS_UPDOWN doesn't work with
|
||||
// comctl32.dll 4.72
|
||||
if ( wxApp::GetComCtl32Version() > 472 && (style & wxDP_SPIN) )
|
||||
if ( style & wxDP_SPIN )
|
||||
styleMSW |= DTS_UPDOWN;
|
||||
//else: drop down by default
|
||||
|
||||
|
@@ -267,19 +267,14 @@ int wxDirDialog::ShowSHBrowseForFolder(WXHWND owner)
|
||||
|
||||
static const int verComCtl32 = wxApp::GetComCtl32Version();
|
||||
|
||||
// we always add the edit box (it doesn't hurt anybody, does it?) if it is
|
||||
// supported by the system
|
||||
if ( verComCtl32 >= 471 )
|
||||
{
|
||||
// we always add the edit box (it doesn't hurt anybody, does it?)
|
||||
bi.ulFlags |= BIF_EDITBOX;
|
||||
}
|
||||
|
||||
// to have the "New Folder" button we must use the "new" dialog style which
|
||||
// is also the only way to have a resizable dialog
|
||||
//
|
||||
// "new" style is only available in the version 5.0+ of comctl32.dll
|
||||
const bool needNewDir = !HasFlag(wxDD_DIR_MUST_EXIST);
|
||||
if ( (needNewDir || HasFlag(wxRESIZE_BORDER)) && (verComCtl32 >= 500) )
|
||||
if ( needNewDir || HasFlag(wxRESIZE_BORDER) )
|
||||
{
|
||||
if (needNewDir)
|
||||
{
|
||||
|
@@ -277,10 +277,8 @@ bool wxListCtrl::Create(wxWindow *parent,
|
||||
|
||||
void wxListCtrl::MSWSetExListStyles()
|
||||
{
|
||||
// for comctl32.dll v 4.70+ we want to have some non default extended
|
||||
// we want to have some non default extended
|
||||
// styles because it's prettier (and also because wxGTK does it like this)
|
||||
if ( wxApp::GetComCtl32Version() >= 470 )
|
||||
{
|
||||
::SendMessage
|
||||
(
|
||||
GetHwnd(), LVM_SETEXTENDEDLISTVIEWSTYLE, 0,
|
||||
@@ -297,7 +295,6 @@ void wxListCtrl::MSWSetExListStyles()
|
||||
LVS_EX_HEADERDRAGDROP
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
@@ -359,13 +356,6 @@ WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
#if !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 0 ) )
|
||||
if ( style & wxLC_VIRTUAL )
|
||||
{
|
||||
int ver = wxApp::GetComCtl32Version();
|
||||
if ( ver < 470 )
|
||||
{
|
||||
wxLogWarning(_("Please install a newer version of comctl32.dll\n(at least version 4.70 is required but you have %d.%02d)\nor this program won't operate correctly."),
|
||||
ver / 100, ver % 100);
|
||||
}
|
||||
|
||||
wstyle |= LVS_OWNERDATA;
|
||||
}
|
||||
#endif // ancient cygwin
|
||||
@@ -1622,7 +1612,7 @@ wxListCtrl::HitTest(const wxPoint& point, int& flags, long *ptrSubItem) const
|
||||
|
||||
long item;
|
||||
#ifdef LVM_SUBITEMHITTEST
|
||||
if ( ptrSubItem && wxApp::GetComCtl32Version() >= 470 )
|
||||
if ( ptrSubItem )
|
||||
{
|
||||
item = ListView_SubItemHitTest(GetHwnd(), &hitTestInfo);
|
||||
*ptrSubItem = hitTestInfo.iSubItem;
|
||||
@@ -3279,8 +3269,6 @@ static void wxConvertToMSWListCol(HWND hwndList,
|
||||
// see comment at the end of wxListCtrl::GetColumn()
|
||||
#ifdef NM_CUSTOMDRAW // _WIN32_IE >= 0x0300
|
||||
if ( item.m_mask & wxLIST_MASK_IMAGE )
|
||||
{
|
||||
if ( wxApp::GetComCtl32Version() >= 470 )
|
||||
{
|
||||
lvCol.mask |= LVCF_IMAGE;
|
||||
|
||||
@@ -3313,8 +3301,6 @@ static void wxConvertToMSWListCol(HWND hwndList,
|
||||
|
||||
lvCol.iImage = item.m_image;
|
||||
}
|
||||
//else: it doesn't support item images anyhow
|
||||
}
|
||||
#endif // _WIN32_IE >= 0x0300
|
||||
}
|
||||
|
||||
|
@@ -168,17 +168,12 @@ int wxSpinButton::GetValue() const
|
||||
{
|
||||
int n;
|
||||
#ifdef UDM_GETPOS32
|
||||
if ( wxApp::GetComCtl32Version() >= 580 )
|
||||
{
|
||||
// use the full 32 bit range if available
|
||||
n = ::SendMessage(GetHwnd(), UDM_GETPOS32, 0, 0);
|
||||
}
|
||||
else
|
||||
#endif // UDM_GETPOS32
|
||||
{
|
||||
#else
|
||||
// we're limited to 16 bit
|
||||
n = (short)LOWORD(::SendMessage(GetHwnd(), UDM_GETPOS, 0, 0));
|
||||
}
|
||||
#endif // UDM_GETPOS32
|
||||
|
||||
if (n < m_min) n = m_min;
|
||||
if (n > m_max) n = m_max;
|
||||
@@ -191,16 +186,11 @@ void wxSpinButton::SetValue(int val)
|
||||
// wxSpinButtonBase::SetValue(val); -- no, it is pure virtual
|
||||
|
||||
#ifdef UDM_SETPOS32
|
||||
if ( wxApp::GetComCtl32Version() >= 580 )
|
||||
{
|
||||
// use the full 32 bit range if available
|
||||
::SendMessage(GetHwnd(), UDM_SETPOS32, 0, val);
|
||||
}
|
||||
else // we're limited to 16 bit
|
||||
#endif // UDM_SETPOS32
|
||||
{
|
||||
#else
|
||||
::SendMessage(GetHwnd(), UDM_SETPOS, 0, MAKELONG((short) val, 0));
|
||||
}
|
||||
#endif // UDM_SETPOS32
|
||||
}
|
||||
|
||||
void wxSpinButton::NormalizeValue()
|
||||
@@ -215,17 +205,13 @@ void wxSpinButton::SetRange(int minVal, int maxVal)
|
||||
wxSpinButtonBase::SetRange(minVal, maxVal);
|
||||
|
||||
#ifdef UDM_SETRANGE32
|
||||
if ( wxApp::GetComCtl32Version() >= 471 )
|
||||
{
|
||||
// use the full 32 bit range if available
|
||||
::SendMessage(GetHwnd(), UDM_SETRANGE32, minVal, maxVal);
|
||||
}
|
||||
else // we're limited to 16 bit
|
||||
#endif // UDM_SETRANGE32
|
||||
{
|
||||
#else
|
||||
// we're limited to 16 bit
|
||||
::SendMessage(GetHwnd(), UDM_SETRANGE, 0,
|
||||
(LPARAM) MAKELONG((short)maxVal, (short)minVal));
|
||||
}
|
||||
#endif // UDM_SETRANGE32
|
||||
|
||||
// the current value might be out of the new range, force it to be in it
|
||||
NormalizeValue();
|
||||
|
@@ -386,7 +386,6 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size)
|
||||
::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
|
||||
|
||||
#ifdef TB_SETEXTENDEDSTYLE
|
||||
if ( wxApp::GetComCtl32Version() >= 471 )
|
||||
::SendMessage(GetHwnd(), TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_DRAWDDARROWS);
|
||||
#endif
|
||||
|
||||
@@ -523,10 +522,10 @@ WXDWORD wxToolBar::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
if ( !(style & wxTB_NO_TOOLTIPS) )
|
||||
msStyle |= TBSTYLE_TOOLTIPS;
|
||||
|
||||
if ( style & wxTB_FLAT && wxApp::GetComCtl32Version() > 400 )
|
||||
if ( style & wxTB_FLAT )
|
||||
msStyle |= TBSTYLE_FLAT;
|
||||
|
||||
if ( style & wxTB_HORZ_LAYOUT && wxApp::GetComCtl32Version() >= 470 )
|
||||
if ( style & wxTB_HORZ_LAYOUT )
|
||||
msStyle |= TBSTYLE_LIST;
|
||||
|
||||
if ( style & wxTB_NODIVIDER )
|
||||
@@ -607,10 +606,6 @@ void wxToolBar::CreateDisabledImageList()
|
||||
{
|
||||
wxDELETE(m_disabledImgList);
|
||||
|
||||
// as we can't use disabled image list with older versions of comctl32.dll,
|
||||
// don't even bother creating it
|
||||
if ( wxApp::GetComCtl32Version() >= 470 )
|
||||
{
|
||||
// search for the first disabled button img in the toolbar, if any
|
||||
for ( wxToolBarToolsList::compatibility_iterator
|
||||
node = m_tools.GetFirst(); node; node = node->GetNext() )
|
||||
@@ -633,9 +628,6 @@ void wxToolBar::CreateDisabledImageList()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// we don't have any disabled bitmaps
|
||||
}
|
||||
}
|
||||
|
||||
bool wxToolBar::Realize()
|
||||
@@ -824,8 +816,6 @@ bool wxToolBar::Realize()
|
||||
if ( oldToolBarBitmap )
|
||||
{
|
||||
#ifdef TB_REPLACEBITMAP
|
||||
if ( wxApp::GetComCtl32Version() >= 400 )
|
||||
{
|
||||
TBREPLACEBITMAP replaceBitmap;
|
||||
replaceBitmap.hInstOld = NULL;
|
||||
replaceBitmap.hInstNew = NULL;
|
||||
@@ -842,17 +832,14 @@ bool wxToolBar::Realize()
|
||||
|
||||
// already done
|
||||
addBitmap = false;
|
||||
}
|
||||
else
|
||||
#endif // TB_REPLACEBITMAP
|
||||
{
|
||||
#else
|
||||
// we can't replace the old bitmap, so we will add another one
|
||||
// (awfully inefficient, but what else to do?) and shift the bitmap
|
||||
// indices accordingly
|
||||
addBitmap = true;
|
||||
|
||||
bitmapId = m_nButtons;
|
||||
}
|
||||
#endif // TB_REPLACEBITMAP
|
||||
}
|
||||
|
||||
if ( addBitmap ) // no old bitmap or we can't replace it
|
||||
@@ -867,9 +854,6 @@ bool wxToolBar::Realize()
|
||||
}
|
||||
}
|
||||
|
||||
// disable image lists are only supported in comctl32.dll 4.70+
|
||||
if ( wxApp::GetComCtl32Version() >= 470 )
|
||||
{
|
||||
HIMAGELIST hil = m_disabledImgList
|
||||
? GetHimagelistOf(m_disabledImgList)
|
||||
: 0;
|
||||
@@ -883,7 +867,6 @@ bool wxToolBar::Realize()
|
||||
if ( oldImageList )
|
||||
::DeleteObject(oldImageList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Next add the buttons and separators
|
||||
@@ -900,14 +883,6 @@ bool wxToolBar::Realize()
|
||||
{
|
||||
wxToolBarTool *tool = static_cast<wxToolBarTool *>(node->GetData());
|
||||
|
||||
// don't add separators to the vertical toolbar with old comctl32.dll
|
||||
// versions as they didn't handle this properly
|
||||
if ( IsVertical() && tool->IsSeparator() &&
|
||||
wxApp::GetComCtl32Version() <= 472 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
TBBUTTON& button = buttons[i];
|
||||
|
||||
wxZeroMemory(button);
|
||||
@@ -1491,23 +1466,11 @@ void wxToolBar::SetRows(int nRows)
|
||||
|
||||
// The button size is bigger than the bitmap size
|
||||
wxSize wxToolBar::GetToolSize() const
|
||||
{
|
||||
// TB_GETBUTTONSIZE is supported from version 4.70
|
||||
#if defined(_WIN32_IE) && (_WIN32_IE >= 0x300 ) \
|
||||
&& !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 0 ) )
|
||||
if ( wxApp::GetComCtl32Version() >= 470 )
|
||||
{
|
||||
DWORD dw = ::SendMessage(GetHwnd(), TB_GETBUTTONSIZE, 0, 0);
|
||||
|
||||
return wxSize(LOWORD(dw), HIWORD(dw));
|
||||
}
|
||||
else
|
||||
#endif // comctl32.dll 4.70+
|
||||
{
|
||||
// defaults
|
||||
return wxSize(m_defaultWidth + 8, m_defaultHeight + 7);
|
||||
}
|
||||
}
|
||||
|
||||
wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const
|
||||
{
|
||||
|
@@ -130,11 +130,8 @@ public:
|
||||
// then as the control gets "focus lost" events and dismisses the
|
||||
// tooltip which then reappears because mouse remains hovering over the
|
||||
// control, see SF patch 1821229
|
||||
if ( wxApp::GetComCtl32Version() >= 470 )
|
||||
{
|
||||
uFlags |= TTF_TRANSPARENT;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef __VISUALC__
|
||||
@@ -538,8 +535,6 @@ void wxToolTip::DoSetTip(WXHWND hWnd)
|
||||
}
|
||||
|
||||
bool wxToolTip::AdjustMaxWidth()
|
||||
{
|
||||
if ( wxApp::GetComCtl32Version() >= 470 )
|
||||
{
|
||||
// use TTM_SETMAXTIPWIDTH to make tooltip multiline using the
|
||||
// extent of its first line as max value
|
||||
@@ -613,9 +608,6 @@ bool wxToolTip::AdjustMaxWidth()
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxToolTip::DoForAllWindows(void (wxToolTip::*func)(WXHWND))
|
||||
{
|
||||
if ( m_window )
|
||||
|
@@ -763,7 +763,6 @@ bool wxTreeCtrl::Create(wxWindow *parent,
|
||||
|
||||
if ( m_windowStyle & wxTR_FULL_ROW_HIGHLIGHT )
|
||||
{
|
||||
if ( wxApp::GetComCtl32Version() >= 471 )
|
||||
wstyle |= TVS_FULLROWSELECT;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user