]> git.saurik.com Git - wxWidgets.git/commitdiff
Various things related to wxFileDialog and attributes.
authorRobert Roebling <robert@roebling.de>
Tue, 7 Dec 1999 10:47:21 +0000 (10:47 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 7 Dec 1999 10:47:21 +0000 (10:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/listctrl.h
src/generic/filedlgg.cpp
src/generic/listctrl.cpp
src/generic/treectrl.cpp
src/msw/listctrl.cpp

index 667d975b4d4f2065effba054fd7b216aaa1b6e03..8807a74488ed8f1fa66552a9d45d763b1829ad63 100644 (file)
@@ -148,6 +148,10 @@ public:
     wxListItem();
     ~wxListItem() { delete m_attr; }
 
+    // resetting
+    void Clear();
+    void ClearAttributes();
+
     // setters
     void SetMask(long mask) { m_mask = mask; }
     void SetId(long id) { m_itemId = id; }
index c76bb9c2c680925e50f833864984b676bad61c84..78ceba169a93b70deb856d6261ba8ce72ba1ccf6 100644 (file)
@@ -244,6 +244,7 @@ void wxFileData::SetNewName( const wxString &name, const wxString &fname )
 void wxFileData::MakeItem( wxListItem &item )
 {
     item.m_text = m_name;
+    item.ClearAttributes();
     if (IsExe()) item.SetTextColour(*wxRED);
     if (IsDir()) item.SetTextColour(*wxBLUE);
     item.m_image = IsDir() ? 0 : -1;
@@ -575,7 +576,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
     m_dialogStyle = style;
     
     if ((m_dialogStyle & wxMULTIPLE ) && !(m_dialogStyle & wxOPEN))
-        m_dialogStyle &= ~wxMULTIPLE;
+        m_dialogStyle |= wxOPEN;
     
     m_dir = defaultDir;
     if (m_dir.IsEmpty())
index 8194d9692571ca5482834de73073546088a0909b..816c94f3da97b492c3a8f275a901bd6f2457bb0b 100644 (file)
@@ -2575,6 +2575,29 @@ wxListItem::wxListItem()
     m_attr = NULL;
 }
 
+void wxListItem::Clear()
+{
+    m_mask = 0;
+    m_itemId = 0;
+    m_col = 0;
+    m_state = 0;
+    m_stateMask = 0;
+    m_image = 0;
+    m_data = 0;
+    m_format = wxLIST_FORMAT_CENTRE;
+    m_width = 0;
+    m_text = wxEmptyString;
+
+    if (m_attr) delete m_attr;
+    m_attr = NULL;
+}
+
+void wxListItem::ClearAttributes()
+{
+    if (m_attr) delete m_attr;
+    m_attr = NULL;
+}
+
 // -------------------------------------------------------------------------------------
 // wxListEvent
 // -------------------------------------------------------------------------------------
index b9fcda141482e9e93fee53eb4acf3d5bd284d0f5..36f8be5bfa143882acc66f71193c2556005eaf85 100644 (file)
@@ -436,7 +436,7 @@ wxGenericTreeItem *wxGenericTreeItem::HitTest( const wxPoint& point,
     }
 
     if (point.x < m_x)
-        flags |= wxTREE_HITTEST_ONITEMIDENT;
+        flags |= wxTREE_HITTEST_ONITEMINDENT;
     if (point.x > m_x+m_width)
         flags |= wxTREE_HITTEST_ONITEMRIGHT;
 
index 3c11d4448f086a3fe6c39ff7031f690abd000a88..756a9bea2c0e037cb12ceadc2de5522609dc9e9c 100644 (file)
@@ -1601,6 +1601,29 @@ wxListItem::wxListItem()
     m_attr = NULL;
 }
 
+void wxListItem::Clear()
+{
+    m_mask = 0;
+    m_itemId = 0;
+    m_col = 0;
+    m_state = 0;
+    m_stateMask = 0;
+    m_image = 0;
+    m_data = 0;
+    m_format = wxLIST_FORMAT_CENTRE;
+    m_width = 0;
+    m_text = wxEmptyString;
+
+    if (m_attr) delete m_attr;
+    m_attr = NULL;
+}
+
+void wxListItem::ClearAttributes()
+{
+    if (m_attr) delete m_attr;
+    m_attr = NULL;
+}
+
 static void wxConvertFromMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_ITEM& lvItem, HWND getFullInfo)
 {
     info.m_data = lvItem.lParam;