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:
David Webster
2001-01-29 05:47:27 +00:00
parent 8bb6da4ae6
commit ec1b28a357

View File

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