X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/866918a854e761b3463e413a62841fe6d06cf9d7..052d2fc5818243dadbc1ec54b1120e295304fc55:/src/generic/dirctrlg.cpp diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 34c0dfe6a9..791b3a97a0 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -375,10 +375,6 @@ wxDirItemData::wxDirItemData(const wxString& path, const wxString& name, m_isDir = isDir; } -wxDirItemData::~wxDirItemData() -{ -} - void wxDirItemData::SetNewDirName(const wxString& path) { m_path = path; @@ -555,8 +551,19 @@ bool wxGenericDirCtrl::Create(wxWindow *parent, ExpandDir(m_rootId); // automatically expand first level // Expand and select the default path - if (!m_defaultPath.IsEmpty()) + if (!m_defaultPath.empty()) + { ExpandPath(m_defaultPath); + } +#ifdef __UNIX__ + else + { + // On Unix, there's only one node under the (hidden) root node. It + // represents the / path, so the user would always have to expand it; + // let's do it ourselves + ExpandPath(wxT("/")); + } +#endif SetBestSize(size); DoResize(); @@ -1545,7 +1552,11 @@ static wxBitmap CreateAntialiasedBitmap(const wxImage& img) if (smask > 2) ps[0] = ps[1] = ps[2] = mr; else - ps[0] = sr >> 2, ps[1] = sg >> 2, ps[2] = sb >> 2; + { + ps[0] = (unsigned char)(sr >> 2); + ps[1] = (unsigned char)(sg >> 2); + ps[2] = (unsigned char)(sb >> 2); + } ps += 3; } p1 += size*2 * 3, p2 += size*2 * 3;