]> git.saurik.com Git - wxWidgets.git/commitdiff
Prepare wxToolBarSimple for event type change.
authorRobert Roebling <robert@roebling.de>
Thu, 25 Jan 2001 18:27:01 +0000 (18:27 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 25 Jan 2001 18:27:01 +0000 (18:27 +0000)
  Make wxGrid use new event types.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp
src/generic/tbarsmpl.cpp

index 7b2b3b3f43da3ead66d8d949de141ff94c39b776..d6de399fb8f7cdada529daab50943a4e21513917 100644 (file)
@@ -96,6 +96,26 @@ WX_DECLARE_EXPORTED_OBJARRAY(wxGridCellWithAttr, wxGridCellWithAttrArray);
 WX_DEFINE_OBJARRAY(wxGridCellCoordsArray)
 WX_DEFINE_OBJARRAY(wxGridCellWithAttrArray)
 
+// ----------------------------------------------------------------------------
+// events
+// ----------------------------------------------------------------------------
+
+const int wxEVT_GRID_CELL_LEFT_CLICK = wxNewEventType();
+const int wxEVT_GRID_CELL_RIGHT_CLICK = wxNewEventType();
+const int wxEVT_GRID_CELL_LEFT_DCLICK = wxNewEventType();
+const int wxEVT_GRID_CELL_RIGHT_DCLICK = wxNewEventType();
+const int wxEVT_GRID_LABEL_LEFT_CLICK = wxNewEventType();
+const int wxEVT_GRID_LABEL_RIGHT_CLICK = wxNewEventType();
+const int wxEVT_GRID_LABEL_LEFT_DCLICK = wxNewEventType();
+const int wxEVT_GRID_LABEL_RIGHT_DCLICK = wxNewEventType();
+const int wxEVT_GRID_ROW_SIZE = wxNewEventType();
+const int wxEVT_GRID_COL_SIZE = wxNewEventType();
+const int wxEVT_GRID_RANGE_SELECT = wxNewEventType();
+const int wxEVT_GRID_CELL_CHANGE = wxNewEventType();
+const int wxEVT_GRID_SELECT_CELL = wxNewEventType();
+const int wxEVT_GRID_EDITOR_SHOWN = wxNewEventType();
+const int wxEVT_GRID_EDITOR_HIDDEN = wxNewEventType();
+
 // ----------------------------------------------------------------------------
 // private classes
 // ----------------------------------------------------------------------------
index 53f382c4021c609cb56c3f8f2af02588b5a9396b..33d0dfeb9f42a34193399180107e77b5e0084f19 100644 (file)
@@ -789,63 +789,51 @@ int wxToolBarSimple::CalcScrollInc(wxScrollEvent& event)
     int orient = event.GetOrientation();
 
     int nScrollInc = 0;
-    switch (event.GetEventType())
+    if (event.GetEventType() == wxEVT_SCROLL_TOP)
     {
-        case wxEVT_SCROLL_TOP:
-            {
-                if (orient == wxHORIZONTAL)
-                    nScrollInc = - m_xScrollPosition;
-                else
-                    nScrollInc = - m_yScrollPosition;
-                break;
-            }
-        case wxEVT_SCROLL_BOTTOM:
-            {
-                if (orient == wxHORIZONTAL)
-                    nScrollInc = m_xScrollLines - m_xScrollPosition;
-                else
-                    nScrollInc = m_yScrollLines - m_yScrollPosition;
-                break;
-            }
-        case wxEVT_SCROLL_LINEUP:
-            {
-                nScrollInc = -1;
-                break;
-            }
-        case wxEVT_SCROLL_LINEDOWN:
-            {
-                nScrollInc = 1;
-                break;
-            }
-        case wxEVT_SCROLL_PAGEUP:
-            {
-                if (orient == wxHORIZONTAL)
-                    nScrollInc = -GetScrollPageSize(wxHORIZONTAL);
-                else
-                    nScrollInc = -GetScrollPageSize(wxVERTICAL);
-                break;
-            }
-        case wxEVT_SCROLL_PAGEDOWN:
-            {
-                if (orient == wxHORIZONTAL)
-                    nScrollInc = GetScrollPageSize(wxHORIZONTAL);
-                else
-                    nScrollInc = GetScrollPageSize(wxVERTICAL);
-                break;
-            }
-        case wxEVT_SCROLL_THUMBTRACK:
-            {
-                if (orient == wxHORIZONTAL)
-                    nScrollInc = pos - m_xScrollPosition;
-                else
-                    nScrollInc = pos - m_yScrollPosition;
-                break;
-            }
-        default:
-            {
-                break;
-            }
+            if (orient == wxHORIZONTAL)
+                nScrollInc = - m_xScrollPosition;
+            else
+                nScrollInc = - m_yScrollPosition;
+    } else
+    if (event.GetEventType() == wxEVT_SCROLL_BOTTOM)
+    {
+            if (orient == wxHORIZONTAL)
+                nScrollInc = m_xScrollLines - m_xScrollPosition;
+            else
+                nScrollInc = m_yScrollLines - m_yScrollPosition;
+    } else
+    if (event.GetEventType() == wxEVT_SCROLL_LINEUP)
+    {
+            nScrollInc = -1;
+    } else
+    if (event.GetEventType() == wxEVT_SCROLL_LINEDOWN)
+    {
+            nScrollInc = 1;
+    } else
+    if (event.GetEventType() == wxEVT_SCROLL_PAGEUP)
+    {
+            if (orient == wxHORIZONTAL)
+                nScrollInc = -GetScrollPageSize(wxHORIZONTAL);
+            else
+                nScrollInc = -GetScrollPageSize(wxVERTICAL);
+    } else
+    if (event.GetEventType() == wxEVT_SCROLL_PAGEDOWN)
+    {
+            if (orient == wxHORIZONTAL)
+                nScrollInc = GetScrollPageSize(wxHORIZONTAL);
+            else
+                nScrollInc = GetScrollPageSize(wxVERTICAL);
+    } else
+    if ((event.GetEventType() == wxEVT_SCROLL_THUMBTRACK) ||
+        (event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE))
+    {
+            if (orient == wxHORIZONTAL)
+                nScrollInc = pos - m_xScrollPosition;
+            else
+                nScrollInc = pos - m_yScrollPosition;
     }
+    
     if (orient == wxHORIZONTAL)
     {
         int w, h;