Applied patch [ 583922 ] Make generic/wxListCtrl avail. in WIN32

Generic wxListCtrl renamed to wxGenericListCtrl, wxImageList
renamed to wxGenericImageList, so they can be used on wxMSW
(Rene Rivera).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16250 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-07-22 08:51:49 +00:00
parent 70a2c6562f
commit 3cd94a0d11
11 changed files with 164 additions and 147 deletions

View File

@@ -216,6 +216,9 @@ All (GUI):
- updated libpng from 1.0.3 to 1.2.4
- Added wxView::OnClosingDocument so the application can do
cleanup.
- generic wxListCtrl renamed to wxGenericListCtrl, wxImageList
renamed to wxGenericImageList, so they can be used on wxMSW
(Rene Rivera).
wxMSW:

View File

@@ -34,6 +34,8 @@
* used.
*/
#if !defined(wxIMAGELIST_DRAW_NORMAL)
// Flags for Draw
#define wxIMAGELIST_DRAW_NORMAL 0x0001
#define wxIMAGELIST_DRAW_TRANSPARENT 0x0002
@@ -47,17 +49,19 @@ enum {
wxIMAGE_LIST_STATE // State icons: unimplemented (see WIN32 documentation)
};
class WXDLLEXPORT wxImageList: public wxObject
#endif
class WXDLLEXPORT wxGenericImageList: public wxObject
{
public:
wxImageList() { }
wxImageList( int width, int height, bool mask = TRUE, int initialCount = 1 );
~wxImageList();
wxGenericImageList() { }
wxGenericImageList( int width, int height, bool mask = TRUE, int initialCount = 1 );
~wxGenericImageList();
bool Create( int width, int height, bool mask = TRUE, int initialCount = 1 );
bool Create();
int GetImageCount() const;
bool GetSize( int index, int &width, int &height ) const;
virtual int GetImageCount() const;
virtual bool GetSize( int index, int &width, int &height ) const;
int Add( const wxBitmap& bitmap );
int Add( const wxBitmap& bitmap, const wxBitmap& mask );
@@ -67,7 +71,7 @@ public:
bool Remove( int index );
bool RemoveAll();
bool Draw(int index, wxDC& dc, int x, int y,
virtual bool Draw(int index, wxDC& dc, int x, int y,
int flags = wxIMAGELIST_DRAW_NORMAL,
bool solidBackground = FALSE);
@@ -77,7 +81,7 @@ private:
int m_width;
int m_height;
DECLARE_DYNAMIC_CLASS(wxImageList)
DECLARE_DYNAMIC_CLASS(wxGenericImageList)
};
#endif // __IMAGELISTH_G__

View File

@@ -54,11 +54,11 @@ class WXDLLEXPORT wxListTextCtrl;
// wxListCtrl
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxListCtrl: public wxControl
class WXDLLEXPORT wxGenericListCtrl: public wxControl
{
public:
wxListCtrl();
wxListCtrl( wxWindow *parent,
wxGenericListCtrl();
wxGenericListCtrl( wxWindow *parent,
wxWindowID id = -1,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
@@ -68,7 +68,7 @@ public:
{
Create(parent, id, pos, size, style, validator, name);
}
~wxListCtrl();
~wxGenericListCtrl();
bool Create( wxWindow *parent,
wxWindowID id = -1,
@@ -114,9 +114,9 @@ public:
void SetWindowStyleFlag( long style );
void RecreateWindow() {}
long GetNextItem( long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE ) const;
wxImageList *GetImageList( int which ) const;
void SetImageList( wxImageList *imageList, int which );
void AssignImageList( wxImageList *imageList, int which );
wxGenericImageList *GetImageList( int which ) const;
void SetImageList( wxGenericImageList *imageList, int which );
void AssignImageList( wxGenericImageList *imageList, int which );
bool Arrange( int flag = wxLIST_ALIGN_DEFAULT ); // always wxLIST_ALIGN_LEFT in wxGLC
void ClearAll();
@@ -183,9 +183,9 @@ public:
// implementation
// --------------
wxImageList *m_imageListNormal;
wxImageList *m_imageListSmall;
wxImageList *m_imageListState; // what's that ?
wxGenericImageList *m_imageListNormal;
wxGenericImageList *m_imageListSmall;
wxGenericImageList *m_imageListState; // what's that ?
bool m_ownsImageListNormal,
m_ownsImageListSmall,
m_ownsImageListState;
@@ -217,7 +217,7 @@ private:
void ResizeReportView(bool showHeader);
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxListCtrl);
DECLARE_DYNAMIC_CLASS(wxGenericListCtrl);
};

View File

@@ -20,12 +20,12 @@
#include "wx/scrolwin.h"
#include "wx/pen.h"
#include "wx/imaglist.h"
// -----------------------------------------------------------------------------
// forward declaration
// -----------------------------------------------------------------------------
class WXDLLEXPORT wxImageList;
class WXDLLEXPORT wxGenericTreeItem;
class WXDLLEXPORT wxTreeItemData;

View File

@@ -3,8 +3,11 @@
#if defined(__WIN32__)
#include "wx/msw/imaglist.h"
#else
#include "wx/generic/imaglist.h"
#endif
#include "wx/generic/imaglist.h"
#if !defined(__WIN32__)
#define wxImageList wxGenericImageList
#define sm_classwxImageList sm_classwxGenericImageList
#endif
#endif

View File

@@ -315,8 +315,11 @@ private:
#if defined(__WIN32__) && !defined(__WXUNIVERSAL__)
#include "wx/msw/listctrl.h"
#else
#include "wx/generic/listctrl.h"
#endif
#include "wx/generic/listctrl.h"
#if !defined(__WIN32__) || defined(__WXUNIVERSAL__)
#define wxListCtrl wxGenericListCtrl
#define sm_classwxListCtrl sm_classwxGenericListCtrl
#endif
// ----------------------------------------------------------------------------

View File

@@ -26,8 +26,7 @@
#include "wx/control.h"
#include "wx/dynarray.h"
class WXDLLEXPORT wxImageList;
#include "wx/imaglist.h"
// ----------------------------------------------------------------------------
// types

View File

@@ -26,23 +26,23 @@
// wxImageList
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxImageList, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxGenericImageList, wxObject)
wxImageList::wxImageList( int width, int height, bool mask, int initialCount )
wxGenericImageList::wxGenericImageList( int width, int height, bool mask, int initialCount )
{
(void)Create(width, height, mask, initialCount);
}
wxImageList::~wxImageList()
wxGenericImageList::~wxGenericImageList()
{
}
int wxImageList::GetImageCount() const
int wxGenericImageList::GetImageCount() const
{
return m_images.Number();
}
bool wxImageList::Create( int width, int height, bool WXUNUSED(mask), int WXUNUSED(initialCount) )
bool wxGenericImageList::Create( int width, int height, bool WXUNUSED(mask), int WXUNUSED(initialCount) )
{
m_width = width;
m_height = height;
@@ -50,13 +50,13 @@ bool wxImageList::Create( int width, int height, bool WXUNUSED(mask), int WXUNUS
return Create();
}
bool wxImageList::Create()
bool wxGenericImageList::Create()
{
m_images.DeleteContents( TRUE );
return TRUE;
}
int wxImageList::Add( const wxBitmap &bitmap )
int wxGenericImageList::Add( const wxBitmap &bitmap )
{
if (bitmap.IsKindOf(CLASSINFO(wxIcon)))
m_images.Append( new wxIcon( (const wxIcon&) bitmap ) );
@@ -65,7 +65,7 @@ int wxImageList::Add( const wxBitmap &bitmap )
return m_images.Number()-1;
}
int wxImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask )
int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask )
{
wxBitmap bmp(bitmap);
if (mask.Ok())
@@ -73,14 +73,14 @@ int wxImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask )
return Add(bmp);
}
int wxImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour )
int wxGenericImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour )
{
wxImage img = bitmap.ConvertToImage();
img.SetMaskColour(maskColour.Red(), maskColour.Green(), maskColour.Blue());
return Add(wxBitmap(img));
}
const wxBitmap *wxImageList::GetBitmap( int index ) const
const wxBitmap *wxGenericImageList::GetBitmap( int index ) const
{
wxNode *node = m_images.Nth( index );
@@ -89,7 +89,7 @@ const wxBitmap *wxImageList::GetBitmap( int index ) const
return (wxBitmap*)node->Data();
}
bool wxImageList::Replace( int index, const wxBitmap &bitmap )
bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
{
wxNode *node = m_images.Nth( index );
@@ -122,7 +122,7 @@ bool wxImageList::Replace( int index, const wxBitmap &bitmap )
return TRUE;
}
bool wxImageList::Remove( int index )
bool wxGenericImageList::Remove( int index )
{
wxNode *node = m_images.Nth( index );
@@ -133,14 +133,14 @@ bool wxImageList::Remove( int index )
return TRUE;
}
bool wxImageList::RemoveAll()
bool wxGenericImageList::RemoveAll()
{
m_images.Clear();
return TRUE;
}
bool wxImageList::GetSize( int index, int &width, int &height ) const
bool wxGenericImageList::GetSize( int index, int &width, int &height ) const
{
width = 0;
height = 0;
@@ -156,7 +156,7 @@ bool wxImageList::GetSize( int index, int &width, int &height ) const
return TRUE;
}
bool wxImageList::Draw( int index, wxDC &dc, int x, int y,
bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y,
int flags, bool WXUNUSED(solidBackground) )
{
wxNode *node = m_images.Nth( index );

File diff suppressed because it is too large Load Diff