From ba5b8a68f7486cfb11e326c200e1c2df3e1a534d Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 9 Apr 2006 06:42:32 +0000 Subject: [PATCH] listbox cleanup git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/carbon/listbox.h | 22 ++++++++++---------- include/wx/mac/carbon/private.h | 37 +++++---------------------------- 2 files changed, 16 insertions(+), 43 deletions(-) diff --git a/include/wx/mac/carbon/listbox.h b/include/wx/mac/carbon/listbox.h index a0521f0e40..6826f1d997 100644 --- a/include/wx/mac/carbon/listbox.h +++ b/include/wx/mac/carbon/listbox.h @@ -21,6 +21,9 @@ // forward decl for GetSelections() class wxArrayInt; +// forward decl for GetPeer() +class wxMacListControl ; + // List box item WX_DEFINE_ARRAY( char * , wxListDataArray ) ; @@ -90,19 +93,15 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - // Windows callbacks -#ifndef __WXMAC_OSX__ - void OnChar(wxKeyEvent& event); -#endif - - void* m_macList ; wxArrayString m_stringArray ; wxListDataArray m_dataArray ; + + wxMacListControl* GetPeer() const { return (wxMacListControl*) m_peer ; } - // as we are getting the same events for human and API selection we have to suppress - // events in the latter case - bool MacIsSelectionSuppressed() const { return m_suppressSelection ; } protected: + // internal storage for line n has changed, issue a redraw + void MacUpdateLine( int n ) ; + virtual void DoSetSelection(int n, bool select); virtual int DoAppend(const wxString& item); virtual void DoInsertItems(const wxArrayString& items, unsigned int pos); @@ -135,11 +134,12 @@ protected: unsigned int m_noItems; int m_selected; bool m_suppressSelection ; - wxString m_typeIn ; - long m_lastTypeIn ; virtual wxSize DoGetBestSize() const; + // common creation for all databrowser list implementations + wxMacListControl* CreateMacListControl(const wxPoint& pos, const wxSize& size, long style) ; + private: DECLARE_DYNAMIC_CLASS(wxListBox) DECLARE_EVENT_TABLE() diff --git a/include/wx/mac/carbon/private.h b/include/wx/mac/carbon/private.h index 11298873af..703ad07254 100644 --- a/include/wx/mac/carbon/private.h +++ b/include/wx/mac/carbon/private.h @@ -618,40 +618,13 @@ public : virtual void GetFeatures( UInt32 *features ) ; virtual OSStatus GetRegion( ControlPartCode partCode , RgnHandle region ) ; virtual OSStatus SetZOrder( bool above , wxMacControl* other ) ; - // to be moved into a databrowser subclass - - virtual OSStatus SetSelectionFlags( DataBrowserSelectionFlags ) ; - virtual OSStatus AddListViewColumn( DataBrowserListViewColumnDesc *columnDesc, - DataBrowserTableViewColumnIndex position ) ; - virtual OSStatus AutoSizeListViewColumns() ; - virtual OSStatus SetHasScrollBars( bool horiz , bool vert ) ; - virtual OSStatus SetTableViewHiliteStyle( DataBrowserTableViewHiliteStyle hiliteStyle ) ; - virtual OSStatus SetListViewHeaderBtnHeight(UInt16 height) ; - virtual OSStatus SetCallbacks(const DataBrowserCallbacks * callbacks) ; - virtual OSStatus UpdateItems( DataBrowserItemID container, UInt32 numItems, - const DataBrowserItemID* items, - DataBrowserPropertyID preSortProperty, - DataBrowserPropertyID propertyID ) ; - virtual OSStatus AddItems( DataBrowserItemID container, UInt32 numItems, - const DataBrowserItemID* items, - DataBrowserPropertyID preSortProperty ) ; - virtual OSStatus RemoveItems( DataBrowserItemID container, UInt32 numItems, - const DataBrowserItemID* items, - DataBrowserPropertyID preSortProperty ) ; - virtual OSStatus RevealItem( DataBrowserItemID item, - DataBrowserPropertyID propertyID, - DataBrowserRevealOptions options ) ; - virtual OSStatus GetSelectionAnchor( DataBrowserItemID * first, DataBrowserItemID * last ) ; - virtual bool IsItemSelected( DataBrowserItemID item ) ; - virtual OSStatus SetSelectedItems(UInt32 numItems, - const DataBrowserItemID * items, - DataBrowserSetOption operation ) ; - - // to be moved into a tab control class - - virtual OSStatus SetTabEnabled( SInt16 tabNo , bool enable ) ; + bool IsCompositing() { return m_isCompositing ; } bool IsRootControl() { return m_isRootControl ; } + + // to be moved into a tab control class + + virtual OSStatus SetTabEnabled( SInt16 tabNo , bool enable ) ; protected : ControlRef m_controlRef ; wxFont m_font ; -- 2.45.2