More changes for compilation issues on OSX

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-06-04 00:07:57 +00:00
parent ba0d19c23f
commit adf64959aa
2 changed files with 26 additions and 22 deletions

View File

@@ -140,16 +140,14 @@ public:
void RemoveColumn(size_t column); void RemoveColumn(size_t column);
void SetColumn(size_t column, const wxTreeListColumnInfo& info); void SetColumn(size_t column, const wxTreeListColumnInfo& info);
const wxTreeListColumnInfo& GetColumn(size_t column) const const wxTreeListColumnInfo GetColumn(size_t column) const
{ {
static wxTreeListColumnInfo tmp; wxCHECK_MSG(column < GetColumnCount(), wxTreeListColumnInfo(), wxT("Invalid column"));
wxCHECK_MSG(column < GetColumnCount(), tmp, wxT("Invalid column"));
return m_columns[column]; return m_columns[column];
} }
wxTreeListColumnInfo& GetColumn(size_t column) wxTreeListColumnInfo GetColumn(size_t column)
{ {
static wxTreeListColumnInfo tmp; wxCHECK_MSG(column < GetColumnCount(), wxTreeListColumnInfo(), wxT("Invalid column"));
wxCHECK_MSG(column < GetColumnCount(), tmp, wxT("Invalid column"));
return m_columns[column]; return m_columns[column];
} }
@@ -688,18 +686,15 @@ public:
// trivial accessors // trivial accessors
wxArrayTreeListItems& GetChildren() { return m_children; } wxArrayTreeListItems& GetChildren() { return m_children; }
const wxString& GetText() const const wxString GetText() const
{ {
//return m_text;
static wxString empty = wxEmptyString;
if(m_text.GetCount() > 0) return m_text[0]; if(m_text.GetCount() > 0) return m_text[0];
return empty; return wxEmptyString;
} }
const wxString& GetText(size_t col) const const wxString GetText(size_t col) const
{ {
static wxString empty = wxEmptyString;
if(m_text.GetCount() > col) return m_text[col]; if(m_text.GetCount() > col) return m_text[col];
return empty; return wxEmptyString;
} }
int GetImage(wxTreeItemIcon which = wxTreeItemIcon_Normal) const int GetImage(wxTreeItemIcon which = wxTreeItemIcon_Normal) const
{ return m_images[which]; } { return m_images[which]; }
@@ -1156,7 +1151,7 @@ void wxTreeListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
int numColumns = GetColumnCount(); int numColumns = GetColumnCount();
for ( int i = 0; i < numColumns && x < w; i++ ) for ( int i = 0; i < numColumns && x < w; i++ )
{ {
wxTreeListColumnInfo& column = GetColumn(i); wxTreeListColumnInfo column = GetColumn(i);
int wCol = column.GetWidth(); int wCol = column.GetWidth();
// the width of the rect to draw: make it smaller to fit entirely // the width of the rect to draw: make it smaller to fit entirely
@@ -1817,11 +1812,11 @@ bool wxTreeListMainWindow::Create(wxTreeListCtrl *parent,
SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_LISTBOX ) ); SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_LISTBOX ) );
#ifdef __WXMSW__ // #ifdef __WXMSW__
m_dottedPen = wxPen( "black", 0, wxDOT ); // too slow under XFree86 // m_dottedPen = wxPen( "black", 0, wxDOT ); // too slow under XFree86
#else // #else
m_dottedPen = wxPen( wxT("grey"), 0, 0 ); m_dottedPen = wxPen( wxT("grey"), 0, 0 );
#endif // #endif
// ALB // ALB
m_owner = parent; m_owner = parent;
@@ -4626,10 +4621,10 @@ void wxTreeListCtrl::RemoveColumn(size_t column)
void wxTreeListCtrl::SetColumn(size_t column, const wxTreeListColumnInfo& col) void wxTreeListCtrl::SetColumn(size_t column, const wxTreeListColumnInfo& col)
{ m_header_win->SetColumn(column, col); } { m_header_win->SetColumn(column, col); }
const wxTreeListColumnInfo& wxTreeListCtrl::GetColumn(size_t column) const const wxTreeListColumnInfo wxTreeListCtrl::GetColumn(size_t column) const
{ return m_header_win->GetColumn(column); } { return m_header_win->GetColumn(column); }
wxTreeListColumnInfo& wxTreeListCtrl::GetColumn(size_t column) wxTreeListColumnInfo wxTreeListCtrl::GetColumn(size_t column)
{ return m_header_win->GetColumn(column); } { return m_header_win->GetColumn(column); }
void wxTreeListCtrl::Refresh(bool erase, const wxRect* rect) void wxTreeListCtrl::Refresh(bool erase, const wxRect* rect)

View File

@@ -60,6 +60,15 @@ public:
m_alignment = alignment; m_alignment = alignment;
} }
wxTreeListColumnInfo(const wxTreeListColumnInfo& other)
{
m_image = other.m_image;
m_selected_image = other.m_selected_image;
m_text = other.m_text;
m_width = other.m_width;
m_alignment = other.m_alignment;
}
~wxTreeListColumnInfo() {} ~wxTreeListColumnInfo() {}
// getters // getters
@@ -201,8 +210,8 @@ public:
wxString GetColumnText(size_t column) const; wxString GetColumnText(size_t column) const;
void SetColumn(size_t column, const wxTreeListColumnInfo& info); void SetColumn(size_t column, const wxTreeListColumnInfo& info);
wxTreeListColumnInfo& GetColumn(size_t column); wxTreeListColumnInfo GetColumn(size_t column);
const wxTreeListColumnInfo& GetColumn(size_t column) const; const wxTreeListColumnInfo GetColumn(size_t column) const;
// Functions to work with tree list ctrl items. // Functions to work with tree list ctrl items.