X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5fcf715b5e37494222b89b6c46b65b65a99c1245..b0803032d3dad9ac066df82b242e94d49408de8c:/include/wx/mac/listbox.h diff --git a/include/wx/mac/listbox.h b/include/wx/mac/listbox.h index ff4be45527..0df5bd0366 100644 --- a/include/wx/mac/listbox.h +++ b/include/wx/mac/listbox.h @@ -1,25 +1,27 @@ ///////////////////////////////////////////////////////////////////////////// // Name: listbox.h // Purpose: wxListBox class -// Author: AUTHOR +// Author: Stefan Csomor // Modified by: -// Created: ??/??/98 +// Created: 1998-01-01 // RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence +// Copyright: (c) Stefan Csomor +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_LISTBOX_H_ #define _WX_LISTBOX_H_ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "listbox.h" #endif // ---------------------------------------------------------------------------- // simple types // ---------------------------------------------------------------------------- +#include "wx/dynarray.h" +#include "wx/arrstr.h" #if wxUSE_OWNER_DRAWN class WXDLLEXPORT wxOwnerDrawn; @@ -56,6 +58,16 @@ public: { Create(parent, id, pos, size, n, choices, style, validator, name); } + wxListBox(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxListBoxNameStr) + { + Create(parent, id, pos, size, choices, style, validator, name); + } bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, @@ -64,6 +76,13 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); + bool Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxListBoxNameStr); virtual ~wxListBox(); virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL); @@ -92,7 +111,7 @@ public: virtual void* DoGetItemClientData(int n) const; virtual void DoSetItemClientObject(int n, wxClientData* clientData); virtual wxClientData* DoGetItemClientObject(int n) const; - virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ; + virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ; // wxCheckListBox support #if wxUSE_OWNER_DRAWN @@ -109,8 +128,8 @@ public: // Windows callbacks virtual void SetupColours(); - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ; - virtual bool MacCanFocus() const { return true ; } + virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; + virtual bool MacCanFocus() const { return true ; } void OnChar(wxKeyEvent& event); void* m_macList ; @@ -121,9 +140,9 @@ public: protected: void MacDestroy() ; void MacDelete( int n ) ; - void MacInsert( int n , const char * text) ; - void MacAppend( const char * text) ; - void MacSet( int n , const char *text ) ; + void MacInsert( int n , const wxString& item) ; + void MacAppend( const wxString& item) ; + void MacSet( int n , const wxString& item ) ; void MacClear() ; void MacSetSelection( int n , bool select ) ; int MacGetSelection() const ; @@ -138,12 +157,13 @@ protected: bool HasMultipleSelection() const; // free memory (common part of Clear() and dtor) - void Free(); + // prevent collision with some BSD definitions of macro Free() + void FreeData(); int m_noItems; int m_selected; - wxString m_typeIn ; - long m_lastTypeIn ; + wxString m_typeIn ; + long m_lastTypeIn ; virtual wxSize DoGetBestSize() const;