merged 2.4 branch into the trunk
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /machine:I386 ..\..\lib\wxmsw233.lib
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /machine:I386 ..\..\lib\wxmsw234.lib
|
||||
|
||||
!ELSEIF "$(CFG)" == "listctrl - Win32 Debug DLL"
|
||||
|
||||
@@ -80,7 +80,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept ..\..\lib\wxmsw233d.lib
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept ..\..\lib\wxmsw234d.lib
|
||||
|
||||
!ELSEIF "$(CFG)" == "listctrl - Win32 Release"
|
||||
|
||||
|
@@ -117,7 +117,9 @@ static const int NUM_ICONS = 9;
|
||||
int wxCALLBACK MyCompareFunction(long item1, long item2, long sortData)
|
||||
{
|
||||
// inverse the order
|
||||
return item1 < item2;
|
||||
if (item1 < item2) return -1;
|
||||
if (item1 > item2) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// `Main program' equivalent, creating windows and returning main app frame
|
||||
@@ -223,7 +225,8 @@ MyFrame::MyFrame(const wxChar *title, int x, int y, int w, int h)
|
||||
menubar->Append(menuCol, _T("&Colour"));
|
||||
SetMenuBar(menubar);
|
||||
|
||||
m_logWindow = new wxTextCtrl(this, -1, wxEmptyString,
|
||||
m_panel = new wxPanel(this, -1);
|
||||
m_logWindow = new wxTextCtrl(m_panel, -1, wxEmptyString,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_MULTILINE | wxSUNKEN_BORDER);
|
||||
|
||||
@@ -328,7 +331,7 @@ void MyFrame::RecreateList(long flags, bool withText)
|
||||
{
|
||||
delete m_listCtrl;
|
||||
|
||||
m_listCtrl = new MyListCtrl(this, LIST_CTRL,
|
||||
m_listCtrl = new MyListCtrl(m_panel, LIST_CTRL,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
flags |
|
||||
wxSUNKEN_BORDER | wxLC_EDIT_LABELS);
|
||||
@@ -658,19 +661,30 @@ void MyListCtrl::OnColRightClick(wxListEvent& event)
|
||||
wxLogMessage( wxT("OnColumnRightClick at %d."), event.GetColumn() );
|
||||
}
|
||||
|
||||
void MyListCtrl::LogColEvent(const wxListEvent& event, const wxChar *name)
|
||||
{
|
||||
const int col = event.GetColumn();
|
||||
|
||||
wxLogMessage(wxT("%s: column %d (width = %d or %d)."),
|
||||
name,
|
||||
col,
|
||||
event.GetItem().GetWidth(),
|
||||
GetColumnWidth(col));
|
||||
}
|
||||
|
||||
void MyListCtrl::OnColBeginDrag(wxListEvent& event)
|
||||
{
|
||||
wxLogMessage( wxT("OnColBeginDrag: column %d."), event.GetColumn() );
|
||||
LogColEvent( event, wxT("OnColBeginDrag") );
|
||||
}
|
||||
|
||||
void MyListCtrl::OnColDragging(wxListEvent& event)
|
||||
{
|
||||
wxLogMessage( wxT("OnColDragging: column %d."), event.GetColumn() );
|
||||
LogColEvent( event, wxT("OnColDragging") );
|
||||
}
|
||||
|
||||
void MyListCtrl::OnColEndDrag(wxListEvent& event)
|
||||
{
|
||||
wxLogMessage( wxT("OnColEndDrag: column %d."), event.GetColumn() );
|
||||
LogColEvent( event, wxT("OnColEndDrag") );
|
||||
}
|
||||
|
||||
void MyListCtrl::OnBeginDrag(wxListEvent& event)
|
||||
|
@@ -58,6 +58,7 @@ private:
|
||||
void SetColumnImage(int col, int image);
|
||||
|
||||
void LogEvent(const wxListEvent& event, const wxChar *eventName);
|
||||
void LogColEvent(const wxListEvent& event, const wxChar *eventName);
|
||||
|
||||
virtual wxString OnGetItemText(long item, long column) const;
|
||||
virtual int OnGetItemImage(long item) const;
|
||||
@@ -72,13 +73,10 @@ private:
|
||||
class MyFrame: public wxFrame
|
||||
{
|
||||
public:
|
||||
MyListCtrl *m_listCtrl;
|
||||
wxTextCtrl *m_logWindow;
|
||||
|
||||
MyFrame(const wxChar *title, int x, int y, int w, int h);
|
||||
~MyFrame();
|
||||
|
||||
public:
|
||||
protected:
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
@@ -113,6 +111,10 @@ public:
|
||||
wxImageList *m_imageListNormal;
|
||||
wxImageList *m_imageListSmall;
|
||||
|
||||
wxPanel *m_panel;
|
||||
MyListCtrl *m_listCtrl;
|
||||
wxTextCtrl *m_logWindow;
|
||||
|
||||
private:
|
||||
// recreate the list control with the new flags
|
||||
void RecreateList(long flags, bool withText = TRUE);
|
||||
|
Reference in New Issue
Block a user