corrections for event handling changes in wxWindows

renamed Cell and CellBox to LifeCell and LifeCellBox to avoid conflict
with Classic Mac OS Toolbox type


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Gilles Depeyrot
2001-02-04 20:11:49 +00:00
parent 50dacf0581
commit 764835a5d5
4 changed files with 112 additions and 99 deletions

View File

@@ -41,7 +41,7 @@
// resources
// --------------------------------------------------------------------------
#if defined(__WXGTK__) || defined(__WXMOTIF__)
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__)
// application icon
#include "mondrian.xpm"
@@ -503,7 +503,7 @@ void LifeFrame::OnZoom(wxCommandEvent& event)
void LifeFrame::OnNavigate(wxCommandEvent& event)
{
Cell c;
LifeCell c;
switch (event.GetId())
{
@@ -772,7 +772,7 @@ void LifeCanvas::DrawChanged()
wxClientDC dc(this);
size_t ncells;
Cell *cells;
LifeCell *cells;
bool done = FALSE;
m_life->BeginFind(m_viewportX,
@@ -824,7 +824,7 @@ void LifeCanvas::OnPaint(wxPaintEvent& event)
j1 = YToCell(y + h - 1);
size_t ncells;
Cell *cells;
LifeCell *cells;
bool done = FALSE;
m_life->BeginFind(i0, j0, i1, j1, FALSE);
@@ -1021,48 +1021,61 @@ void LifeCanvas::OnScroll(wxScrollWinEvent& event)
// calculate scroll increment
int scrollinc = 0;
switch (type)
if (type == wxEVT_SCROLLWIN_TOP)
{
case wxEVT_SCROLLWIN_TOP:
if (orient == wxHORIZONTAL)
scrollinc = -m_viewportW;
else
scrollinc = -m_viewportH;
}
else
if (type == wxEVT_SCROLLWIN_BOTTOM)
{
if (orient == wxHORIZONTAL)
scrollinc = m_viewportW;
else
scrollinc = m_viewportH;
}
else
if (type == wxEVT_SCROLLWIN_LINEUP)
{
scrollinc = -1;
}
else
if (type == wxEVT_SCROLLWIN_LINEDOWN)
{
scrollinc = +1;
}
else
if (type == wxEVT_SCROLLWIN_PAGEUP)
{
scrollinc = -10;
}
else
if (type == wxEVT_SCROLLWIN_PAGEDOWN)
{
scrollinc = -10;
}
else
if (type == wxEVT_SCROLLWIN_THUMBTRACK)
{
if (orient == wxHORIZONTAL)
{
if (orient == wxHORIZONTAL)
scrollinc = -m_viewportW;
else
scrollinc = -m_viewportH;
break;
scrollinc = pos - m_thumbX;
m_thumbX = pos;
}
case wxEVT_SCROLLWIN_BOTTOM:
else
{
if (orient == wxHORIZONTAL)
scrollinc = m_viewportW;
else
scrollinc = m_viewportH;
break;
}
case wxEVT_SCROLLWIN_LINEUP: scrollinc = -1; break;
case wxEVT_SCROLLWIN_LINEDOWN: scrollinc = +1; break;
case wxEVT_SCROLLWIN_PAGEUP: scrollinc = -10; break;
case wxEVT_SCROLLWIN_PAGEDOWN: scrollinc = +10; break;
case wxEVT_SCROLLWIN_THUMBTRACK:
{
if (orient == wxHORIZONTAL)
{
scrollinc = pos - m_thumbX;
m_thumbX = pos;
}
else
{
scrollinc = pos - m_thumbY;
m_thumbY = pos;
}
break;
}
case wxEVT_SCROLLWIN_THUMBRELEASE:
{
m_thumbX = m_viewportW;
m_thumbY = m_viewportH;
scrollinc = pos - m_thumbY;
m_thumbY = pos;
}
}
else
if (type == wxEVT_SCROLLWIN_THUMBRELEASE)
{
m_thumbX = m_viewportW;
m_thumbY = m_viewportH;
}
#if defined(__WXGTK__) || defined(__WXMOTIF__)
// wxGTK and wxMotif update the thumb automatically (wxMSW doesn't);