// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
+// Copyright: (c) Julian Smart
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
m_imageListSmall = new wxImageList(16, 16, TRUE);
#ifdef __WXMSW__
- m_imageListNormal->Add( wxIcon("icon1", wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon("icon2", wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon("icon3", wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon("icon4", wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon("icon5", wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon("icon6", wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon("icon7", wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon("icon8", wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon("icon9", wxBITMAP_TYPE_ICO_RESOURCE) );
-
- m_imageListSmall->Add( wxIcon("iconsmall", wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(_T("icon1"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(_T("icon2"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(_T("icon3"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(_T("icon4"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(_T("icon5"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(_T("icon6"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(_T("icon7"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(_T("icon8"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(_T("icon9"), wxBITMAP_TYPE_ICO_RESOURCE) );
+
+ m_imageListSmall->Add( wxIcon(_T("iconsmall"), wxBITMAP_TYPE_ICO_RESOURCE) );
#else
m_imageListNormal->Add( wxIcon( toolbrai_xpm ) );
{
m_listCtrl->SetImageList(m_imageListSmall, wxIMAGE_LIST_SMALL);
- // under MSW for SetColumnWidth() to work we need to create the items with
- // images initially
-#if 1
+ // note that under MSW for SetColumnWidth() to work we need to create the
+ // items with images initially even if we specify dummy image id
wxListItem itemCol;
- itemCol.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE;
- itemCol.m_text = _T("Column 1");
- itemCol.m_image = -1;
+ itemCol.SetText(_T("Column 1"));
+ itemCol.SetImage(-1);
m_listCtrl->InsertColumn(0, itemCol);
- itemCol.m_text = _T("Column 2");
+
+ itemCol.SetText(_T("Column 2"));
+ itemCol.SetAlign(wxLIST_FORMAT_CENTRE);
m_listCtrl->InsertColumn(1, itemCol);
- itemCol.m_text = _T("Column 3");
+
+ itemCol.SetText(_T("Column 3"));
+ itemCol.SetAlign(wxLIST_FORMAT_RIGHT);
m_listCtrl->InsertColumn(2, itemCol);
-#else
- m_listCtrl->InsertColumn(0, _T("Column 1")); // , wxLIST_FORMAT_LEFT, 140);
- m_listCtrl->InsertColumn(1, _T("Column 2")); // , wxLIST_FORMAT_LEFT, 140);
- m_listCtrl->InsertColumn(2, _T("One More Column (2)")); // , wxLIST_FORMAT_LEFT, 140);
-#endif
// to speed up inserting we hide the control temporarily
m_listCtrl->Hide();
void MyListCtrl::OnColBeginDrag(wxListEvent& event)
{
LogColEvent( event, wxT("OnColBeginDrag") );
+
+ if ( event.GetColumn() == 0 )
+ {
+ wxLogMessage(_T("Resizing this column shouldn't work."));
+
+ event.Veto();
+ }
}
void MyListCtrl::OnColDragging(wxListEvent& event)