OS/2 updates (mostly executing MSW code)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -57,6 +57,16 @@
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __WXPM__
|
||||
|
||||
#define INCL_BASE
|
||||
#include <os2.h>
|
||||
#include <direct.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#endif // __WXPM__
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#include "dos.h"
|
||||
#endif
|
||||
@@ -66,7 +76,7 @@
|
||||
#undef GetFirstChild
|
||||
#endif
|
||||
|
||||
#if !defined(__WXMSW__) || wxUSE_XPM_IN_MSW
|
||||
#if !defined(__WXMSW__) || wxUSE_XPM_IN_MSW || wxUSE_XPM_IN_OS2
|
||||
/* Closed folder */
|
||||
static char * icon1_xpm[] = {
|
||||
/* width height ncolors chars_per_pixel */
|
||||
@@ -297,7 +307,7 @@ static const int ID_CANCEL = 1003;
|
||||
static const int ID_NEW = 1004;
|
||||
//static const int ID_CHECK = 1005;
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
static bool wxIsDriveAvailable(const wxString dirName)
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
@@ -448,7 +458,7 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
|
||||
|
||||
wxString rootName;
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
rootName = _("Computer");
|
||||
#else
|
||||
rootName = _("Sections");
|
||||
@@ -487,8 +497,8 @@ void wxGenericDirCtrl::AddSection(const wxString& path, const wxString& name, in
|
||||
{
|
||||
wxDirItemDataEx *dir_item = new wxDirItemDataEx(path,name,TRUE);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// Windows: sections are displayed as drives
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
// Windows and OS/2: sections are displayed as drives
|
||||
wxTreeItemId id = m_treeCtrl->AppendItem( m_rootId, name, imageId, -1, dir_item);
|
||||
#else
|
||||
// Unix: sections are displayed as folders
|
||||
@@ -502,7 +512,7 @@ void wxGenericDirCtrl::AddSection(const wxString& path, const wxString& name, in
|
||||
|
||||
void wxGenericDirCtrl::SetupSections()
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
|
||||
#ifdef __WIN32__
|
||||
wxChar driveBuffer[256];
|
||||
@@ -686,7 +696,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
|
||||
|
||||
wxString dirName(data->m_path);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
// Check if this is a root directory and if so,
|
||||
// whether the drive is avaiable.
|
||||
if (!wxIsDriveAvailable(dirName))
|
||||
@@ -700,7 +710,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
|
||||
// This may take a longish time. Go to busy cursor
|
||||
wxBusyCursor busy;
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
if (dirName.Last() == ':')
|
||||
dirName += wxString(wxFILE_SEP_PATH);
|
||||
#endif
|
||||
@@ -820,8 +830,8 @@ wxTreeItemId wxGenericDirCtrl::FindChild(wxTreeItemId parentId, const wxString&
|
||||
// Append a separator to foil bogus substring matching
|
||||
path2 += wxString(wxFILE_SEP_PATH);
|
||||
|
||||
// In MSW, case is not significant
|
||||
#ifdef __WXMSW__
|
||||
// In MSW or PM, case is not significant
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
path2.MakeLower();
|
||||
#endif
|
||||
|
||||
@@ -837,8 +847,8 @@ wxTreeItemId wxGenericDirCtrl::FindChild(wxTreeItemId parentId, const wxString&
|
||||
if (childPath.Last() != wxFILE_SEP_PATH)
|
||||
childPath += wxString(wxFILE_SEP_PATH);
|
||||
|
||||
// In MSW, case is not significant
|
||||
#ifdef __WXMSW__
|
||||
// In MSW and PM, case is not significant
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
childPath.MakeLower();
|
||||
#endif
|
||||
|
||||
@@ -970,7 +980,7 @@ void wxGenericDirCtrl::FindChildFiles(wxTreeItemId id, int dirFlags, wxArrayStri
|
||||
|
||||
wxString dirName(data->m_path);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
if (dirName.Last() == ':')
|
||||
dirName += wxString(wxFILE_SEP_PATH);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user