]> git.saurik.com Git - wxWidgets.git/blobdiff - src/palmos/toplevel.cpp
Added validator to generic date picker control
[wxWidgets.git] / src / palmos / toplevel.cpp
index 2ff38362b723ee55f16176ebc8a138f170aedaef..52116b2db919d8e4dcc17472567ff50b5428e252 100644 (file)
@@ -243,12 +243,13 @@ bool wxTopLevelWindowPalm::SetShape(const wxRegion& region)
 #endif // !__WXWINCE__
 
 // ----------------------------------------------------------------------------
-// wxTopLevelWindow event handling
+// wxTopLevelWindow native event handling
 // ----------------------------------------------------------------------------
 
 bool wxTopLevelWindowPalm::HandleControlSelect(EventType* event)
 {
     int id = event->data.ctlSelect.controlID;
+
     wxWindow* win = FindWindowById(id,this);
     if(win==NULL)
         return false;
@@ -276,6 +277,30 @@ bool wxTopLevelWindowPalm::HandleControlSelect(EventType* event)
     return false;
 }
 
+bool wxTopLevelWindowPalm::HandleControlRepeat(EventType* event)
+{
+    int id = event->data.ctlRepeat.controlID;
+
+    wxWindow* win = FindWindowById(id,this);
+    if(win==NULL)
+        return false;
+
+    wxSlider* slider = wxDynamicCast(win,wxSlider);
+    if(slider)
+        return slider->SendScrollEvent(event);
+
+    return false;
+}
+
+bool wxTopLevelWindowPalm::HandleSize(EventType* event)
+{
+    wxSize newSize(event->data.winResized.newBounds.extent.x,
+                   event->data.winResized.newBounds.extent.y);
+    wxSizeEvent eventWx(newSize,GetId());
+    eventWx.SetEventObject(this);
+    return GetEventHandler()->ProcessEvent(eventWx);
+}
+
 void wxTopLevelWindowPalm::OnActivate(wxActivateEvent& event)
 {
 }
@@ -296,12 +321,21 @@ void wxTopLevelWindowPalm::OnActivate(wxActivateEvent& event)
  */
 static Boolean FrameFormHandleEvent(EventType* event)
 {
-    wxFrame*    frame = wxDynamicCast(ActiveParentFrame,wxFrame);
+    // frame and tlw point to the same object but they are for convenience
+    // of calling proper structure withiout later dynamic typcasting
+    wxFrame* frame = wxDynamicCast(ActiveParentFrame,wxFrame);
+    wxTopLevelWindowPalm* tlw = ActiveParentFrame;
     Boolean     handled = false;
 
     switch (event->eType) {
         case ctlSelectEvent:
-            handled = frame->HandleControlSelect(event);
+            handled = tlw->HandleControlSelect(event);
+            break;
+        case ctlRepeatEvent:
+            handled = tlw->HandleControlRepeat(event);
+            break;
+        case winResizedEvent:
+            handled = tlw->HandleSize(event);
             break;
 #if wxUSE_MENUS_NATIVE
         case menuOpenEvent: