exposing generic system option define, adding missing event.Skip() to OnChar, and tweaking handling of scrollbars.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44067 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -15,6 +15,8 @@
|
|||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/generic/listctrl.h"
|
#include "wx/generic/listctrl.h"
|
||||||
|
|
||||||
|
#define wxMAC_ALWAYS_USE_GENERIC_LISTCTRL wxT("mac.listctrl.always_use_generic")
|
||||||
|
|
||||||
class wxMacDataBrowserListCtrlControl;
|
class wxMacDataBrowserListCtrlControl;
|
||||||
class wxMacListControl;
|
class wxMacListControl;
|
||||||
class wxListCtrlTextCtrlWrapper;
|
class wxListCtrlTextCtrlWrapper;
|
||||||
|
@@ -40,8 +40,6 @@
|
|||||||
|
|
||||||
#include "wx/hashmap.h"
|
#include "wx/hashmap.h"
|
||||||
|
|
||||||
#define wxMAC_ALWAYS_USE_GENERIC_LISTCTRL wxT("mac.listctrl.always_use_generic")
|
|
||||||
|
|
||||||
#if wxUSE_EXTENDED_RTTI
|
#if wxUSE_EXTENDED_RTTI
|
||||||
WX_DEFINE_FLAGS( wxListCtrlStyle )
|
WX_DEFINE_FLAGS( wxListCtrlStyle )
|
||||||
|
|
||||||
@@ -221,7 +219,8 @@ public:
|
|||||||
virtual void MacSetColumnInfo( unsigned int row, unsigned int column, wxListItem* item );
|
virtual void MacSetColumnInfo( unsigned int row, unsigned int column, wxListItem* item );
|
||||||
virtual void MacGetColumnInfo( unsigned int row, unsigned int column, wxListItem& item );
|
virtual void MacGetColumnInfo( unsigned int row, unsigned int column, wxListItem& item );
|
||||||
virtual void UpdateState(wxMacDataItem* dataItem, wxListItem* item);
|
virtual void UpdateState(wxMacDataItem* dataItem, wxListItem* item);
|
||||||
|
int GetFlags() { return m_flags; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// we need to override to provide specialized handling for virtual wxListCtrls
|
// we need to override to provide specialized handling for virtual wxListCtrls
|
||||||
virtual OSStatus GetSetItemData(DataBrowserItemID itemID,
|
virtual OSStatus GetSetItemData(DataBrowserItemID itemID,
|
||||||
@@ -276,6 +275,7 @@ protected:
|
|||||||
|
|
||||||
wxClientDataType m_clientDataItemsType;
|
wxClientDataType m_clientDataItemsType;
|
||||||
bool m_isVirtual;
|
bool m_isVirtual;
|
||||||
|
int m_flags;
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacDataBrowserListCtrlControl)
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacDataBrowserListCtrlControl)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -671,6 +671,7 @@ void wxListCtrl::OnChar(wxKeyEvent& event)
|
|||||||
}
|
}
|
||||||
GetEventHandler()->ProcessEvent(le);
|
GetEventHandler()->ProcessEvent(le);
|
||||||
}
|
}
|
||||||
|
event.Skip();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -802,12 +803,15 @@ void wxListCtrl::DoSetSize( int x, int y, int width, int height, int sizeFlags )
|
|||||||
totalWidth += m_dbImpl->GetColumnWidth( column );
|
totalWidth += m_dbImpl->GetColumnWidth( column );
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean vertScrollBar;
|
if ( !(m_dbImpl->GetFlags() & wxHSCROLL) )
|
||||||
GetDataBrowserHasScrollBars( m_dbImpl->GetControlRef(), NULL, &vertScrollBar );
|
{
|
||||||
if (totalWidth > width)
|
Boolean vertScrollBar;
|
||||||
SetDataBrowserHasScrollBars( m_dbImpl->GetControlRef(), true, vertScrollBar );
|
GetDataBrowserHasScrollBars( m_dbImpl->GetControlRef(), NULL, &vertScrollBar );
|
||||||
else
|
if (totalWidth > width)
|
||||||
SetDataBrowserHasScrollBars( m_dbImpl->GetControlRef(), false, vertScrollBar );
|
SetDataBrowserHasScrollBars( m_dbImpl->GetControlRef(), true, vertScrollBar );
|
||||||
|
else
|
||||||
|
SetDataBrowserHasScrollBars( m_dbImpl->GetControlRef(), false, vertScrollBar );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1021,7 +1025,7 @@ bool wxListCtrl::SetColumnWidth(int col, int width)
|
|||||||
{
|
{
|
||||||
wxListItem colInfo;
|
wxListItem colInfo;
|
||||||
GetColumn(col, colInfo);
|
GetColumn(col, colInfo);
|
||||||
|
|
||||||
colInfo.SetWidth(width);
|
colInfo.SetWidth(width);
|
||||||
SetColumn(col, colInfo);
|
SetColumn(col, colInfo);
|
||||||
m_dbImpl->SetColumnWidth(col, mywidth);
|
m_dbImpl->SetColumnWidth(col, mywidth);
|
||||||
@@ -2367,6 +2371,7 @@ wxMacDataBrowserListCtrlControl::wxMacDataBrowserListCtrlControl( wxWindow *peer
|
|||||||
OSStatus err = noErr;
|
OSStatus err = noErr;
|
||||||
m_clientDataItemsType = wxClientData_None;
|
m_clientDataItemsType = wxClientData_None;
|
||||||
m_isVirtual = false;
|
m_isVirtual = false;
|
||||||
|
m_flags = 0;
|
||||||
|
|
||||||
if ( style & wxLC_VIRTUAL )
|
if ( style & wxLC_VIRTUAL )
|
||||||
m_isVirtual = true;
|
m_isVirtual = true;
|
||||||
@@ -2431,7 +2436,7 @@ wxMacDataBrowserListCtrlControl::wxMacDataBrowserListCtrlControl( wxWindow *peer
|
|||||||
}
|
}
|
||||||
|
|
||||||
verify_noerr( SetHiliteStyle(kDataBrowserTableViewFillHilite ) );
|
verify_noerr( SetHiliteStyle(kDataBrowserTableViewFillHilite ) );
|
||||||
err = SetHasScrollBars( (style & wxHSCROLL) != 0 , (style & wxVSCROLL) != 0 );
|
verify_noerr( SetHasScrollBars( (style & wxHSCROLL) != 0 , true ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
pascal Boolean wxMacDataBrowserListCtrlControl::DataBrowserEditTextProc(
|
pascal Boolean wxMacDataBrowserListCtrlControl::DataBrowserEditTextProc(
|
||||||
@@ -2842,7 +2847,7 @@ void wxMacDataBrowserListCtrlControl::ItemNotification(DataBrowserItemID itemID,
|
|||||||
// avoid asserts by getting out now
|
// avoid asserts by getting out now
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxListCtrl *list = wxDynamicCast( GetPeer() , wxListCtrl );
|
wxListCtrl *list = wxDynamicCast( GetPeer() , wxListCtrl );
|
||||||
if ( list )
|
if ( list )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user