#if defined(__DOS__) || defined(__WINDOWS__)
// c:\.. is a drive don't stat it
- if ((fileName == wxT("..")) && (filePath.length() <= 5))
+ if ((m_fileName == wxT("..")) && (m_filePath.length() <= 5))
{
m_type = is_drive;
m_size = 0;
buff.st_mode & wxS_IWOTH ? _T('w') : _T('-'),
buff.st_mode & wxS_IXOTH ? _T('x') : _T('-'));
#elif defined(__WIN32__)
- DWORD attribs = GetFileAttributes(filePath);
+ DWORD attribs = GetFileAttributes(m_filePath);
if (attribs != (DWORD)-1)
{
m_permissions.Printf(_T("%c%c%c%c"),
case WM_PAINT:
{
- wxPaintDCEx *pdc = 0;
- if (wParam) {
- pdc = new wxPaintDCEx(this, (WXHDC) wParam);
+ if ( wParam )
+ {
+ // cast to wxWindow is needed for wxUniv
+ wxPaintDCEx dc((wxWindow *)this, (WXHDC)wParam);
+ processed = HandlePaint();
}
- processed = HandlePaint();
- if (pdc) {
- delete pdc;
+ else
+ {
+ processed = HandlePaint();
}
break;
}
#endif // USE_OWNER_DRAWN
-#if wxUSE_CONTROLS
+#if wxUSE_CONTROLS && !defined(__WXUNIVERSAL__)
+ wxControl *item = wxDynamicCast
+ (
+ FindItem(id),
#if wxUSE_OWNER_DRAWN
- wxWindow *item = FindItem(id);
- if ( item && item->IsKindOf(CLASSINFO(wxControl)) )
- return ((wxControl *)item)->MSWOnDraw(itemStruct);
-#elif !defined(__WXUNIVERSAL__)
- // we may still have owner-drawn buttons internally because we have to make
- // them owner-drawn to support colour change
- wxWindow *item = FindItem(id);
- if ( item && item->IsKindOf(CLASSINFO(wxButton)) )
- return ((wxButton *)item)->MSWOnDraw(itemStruct);
+ wxControl
+#else // !wxUSE_OWNER_DRAWN
+ // we may still have owner-drawn buttons internally
+ // because we have to make them owner-drawn to support
+ // colour change
+ wxButton
#endif // USE_OWNER_DRAWN
+ );
+
+ if ( item )
+ {
+ return item->MSWOnDraw(itemStruct);
+ }
#endif // wxUSE_CONTROLS
bool wxWindowMSW::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
{
-#if wxUSE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
// is it a menu item?
MEASUREITEMSTRUCT *pMeasureStruct = (MEASUREITEMSTRUCT *)itemStruct;
if ( id == 0 && pMeasureStruct->CtlType == ODT_MENU )
&pMeasureStruct->itemHeight);
}
- wxWindow *item = FindItem(id);
- if ( item && item->IsKindOf(CLASSINFO(wxControl)) )
+ wxControl *item = wxDynamicCast(FindItem(id), wxControl);
+ if ( item )
{
- return ((wxControl *)item)->MSWOnMeasure(itemStruct);
+ return item->MSWOnMeasure(itemStruct);
}
-#endif // owner-drawn menus
+#endif // wxUSE_OWNER_DRAWN
+
return FALSE;
}