Various things related to wxFileDialog and attributes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-12-07 10:47:21 +00:00
parent 1fb4de3138
commit 9b00bb1626
5 changed files with 53 additions and 2 deletions

View File

@@ -148,6 +148,10 @@ public:
wxListItem(); wxListItem();
~wxListItem() { delete m_attr; } ~wxListItem() { delete m_attr; }
// resetting
void Clear();
void ClearAttributes();
// setters // setters
void SetMask(long mask) { m_mask = mask; } void SetMask(long mask) { m_mask = mask; }
void SetId(long id) { m_itemId = id; } void SetId(long id) { m_itemId = id; }

View File

@@ -244,6 +244,7 @@ void wxFileData::SetNewName( const wxString &name, const wxString &fname )
void wxFileData::MakeItem( wxListItem &item ) void wxFileData::MakeItem( wxListItem &item )
{ {
item.m_text = m_name; item.m_text = m_name;
item.ClearAttributes();
if (IsExe()) item.SetTextColour(*wxRED); if (IsExe()) item.SetTextColour(*wxRED);
if (IsDir()) item.SetTextColour(*wxBLUE); if (IsDir()) item.SetTextColour(*wxBLUE);
item.m_image = IsDir() ? 0 : -1; item.m_image = IsDir() ? 0 : -1;
@@ -575,7 +576,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
m_dialogStyle = style; m_dialogStyle = style;
if ((m_dialogStyle & wxMULTIPLE ) && !(m_dialogStyle & wxOPEN)) if ((m_dialogStyle & wxMULTIPLE ) && !(m_dialogStyle & wxOPEN))
m_dialogStyle &= ~wxMULTIPLE; m_dialogStyle |= wxOPEN;
m_dir = defaultDir; m_dir = defaultDir;
if (m_dir.IsEmpty()) if (m_dir.IsEmpty())

View File

@@ -2575,6 +2575,29 @@ wxListItem::wxListItem()
m_attr = NULL; 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 // wxListEvent
// ------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------

View File

@@ -436,7 +436,7 @@ wxGenericTreeItem *wxGenericTreeItem::HitTest( const wxPoint& point,
} }
if (point.x < m_x) if (point.x < m_x)
flags |= wxTREE_HITTEST_ONITEMIDENT; flags |= wxTREE_HITTEST_ONITEMINDENT;
if (point.x > m_x+m_width) if (point.x > m_x+m_width)
flags |= wxTREE_HITTEST_ONITEMRIGHT; flags |= wxTREE_HITTEST_ONITEMRIGHT;

View File

@@ -1601,6 +1601,29 @@ wxListItem::wxListItem()
m_attr = NULL; 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) static void wxConvertFromMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_ITEM& lvItem, HWND getFullInfo)
{ {
info.m_data = lvItem.lParam; info.m_data = lvItem.lParam;