]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
value of wxTE_PASSWORD changed to be different from wxCANCEL
[wxWidgets.git] / src / msw / listctrl.cpp
index 97b639ead4babd078ba1f61e633bfb5909c21a84..34649103cc5eaf2cffed7d461b0ece5efdc2d536 100644 (file)
@@ -61,13 +61,48 @@ static void wxConvertFromMSWListItem(const wxListCtrl *ctrl, wxListItem& info, L
 // macros
 // ----------------------------------------------------------------------------
 
-    IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)
-    IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
+IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
 
 // ============================================================================
 // implementation
 // ============================================================================
 
+// ----------------------------------------------------------------------------
+// wxListEvent
+// ----------------------------------------------------------------------------
+
+void wxListEvent::CopyObject(wxObject& object_dest) const
+{
+    wxListEvent *obj = (wxListEvent *)&object_dest;
+
+    wxNotifyEvent::CopyObject(object_dest);
+
+    obj->m_code = m_code;
+    obj->m_itemIndex = m_itemIndex;
+    obj->m_oldItemIndex = m_oldItemIndex;
+    obj->m_col = m_col;
+    obj->m_cancelled = m_cancelled;
+    obj->m_pointDrag = m_pointDrag;
+    obj->m_item.m_mask = m_item.m_mask;
+    obj->m_item.m_itemId = m_item.m_itemId;
+    obj->m_item.m_col = m_item.m_col;
+    obj->m_item.m_state = m_item.m_state;
+    obj->m_item.m_stateMask = m_item.m_stateMask;
+    obj->m_item.m_text = m_item.m_text;
+    obj->m_item.m_image = m_item.m_image;
+    obj->m_item.m_data = m_item.m_data;
+    obj->m_item.m_format = m_item.m_format;
+    obj->m_item.m_width = m_item.m_width;
+
+    if ( m_item.HasAttributes() )
+    {
+        obj->m_item.SetTextColour(m_item.GetTextColour());
+        obj->m_item.SetBackgroundColour(m_item.GetBackgroundColour());
+        obj->m_item.SetFont(m_item.GetFont());
+    }
+}
+
 // ----------------------------------------------------------------------------
 // wxListCtrl construction
 // ----------------------------------------------------------------------------
@@ -91,7 +126,10 @@ bool wxListCtrl::Create(wxWindow *parent,
                         const wxValidator& validator,
                         const wxString& name)
 {
+#if wxUSE_VALIDATORS
     SetValidator(validator);
+#endif // wxUSE_VALIDATORS
+
     SetName(name);
 
     int x = pos.x;
@@ -1382,9 +1420,16 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
             }
 
             // else translate it into wxEVT_COMMAND_LIST_ITEM_ACTIVATED event
+            // if it happened on an item (and not on empty place)
             {
-                eventType = wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
                 NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam;
+                if ( hdr->iItem == -1 )
+                {
+                    // not on item
+                    return FALSE;
+                }
+
+                eventType = wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
                 event.m_itemIndex = hdr->iItem;
             }
             break;
@@ -1436,7 +1481,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
             break;
 #endif // 0
 
-#ifdef NM_CUSTOMDRAW
+#if defined(_WIN32_IE) && _WIN32_IE >= 0x300
         case NM_CUSTOMDRAW:
             {
                 LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lParam;
@@ -1517,7 +1562,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
                 }
             }
             break;
-#endif // NM_CUSTOMDRAW
+#endif // _WIN32_IE >= 0x300
 
         default:
             return wxControl::MSWOnNotify(idCtrl, lParam, result);