updated mac sources (CW 5.3 working , CW6 still having code gen problems)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -370,7 +370,7 @@ public:
|
|||||||
// be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this
|
// be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this
|
||||||
// code if required.
|
// code if required.
|
||||||
|
|
||||||
#if !wxUSE_GUI || defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__)
|
#if !wxUSE_GUI || defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || (defined(__DARWIN__) && defined(__WXMAC__))
|
||||||
#define IMPLEMENT_WXWIN_MAIN \
|
#define IMPLEMENT_WXWIN_MAIN \
|
||||||
extern int wxEntry( int argc, char *argv[] ); \
|
extern int wxEntry( int argc, char *argv[] ); \
|
||||||
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
|
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
|
||||||
|
@@ -21,6 +21,10 @@
|
|||||||
#include "wx/colour.h"
|
#include "wx/colour.h"
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
|
#if defined( __WXMAC__ ) && defined( TARGET_CARBON )
|
||||||
|
#include <PMApplication.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__)) && wxUSE_POSTSCRIPT
|
#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__)) && wxUSE_POSTSCRIPT
|
||||||
class WXDLLEXPORT wxPrintSetupData;
|
class WXDLLEXPORT wxPrintSetupData;
|
||||||
#endif
|
#endif
|
||||||
@@ -187,8 +191,13 @@ public:
|
|||||||
void* m_devMode;
|
void* m_devMode;
|
||||||
void* m_devNames;
|
void* m_devNames;
|
||||||
#elif defined( __WXMAC__ )
|
#elif defined( __WXMAC__ )
|
||||||
|
#if TARGET_CARBON
|
||||||
|
PMPageFormat m_macPageFormat ;
|
||||||
|
PMPrintSettings m_macPrintSettings ;
|
||||||
|
#else
|
||||||
THPrint m_macPrintInfo ;
|
THPrint m_macPrintInfo ;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -284,8 +293,6 @@ class WXDLLEXPORT wxPrintDialogData: public wxObject
|
|||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
void* m_printDlgData;
|
void* m_printDlgData;
|
||||||
#elif defined( __WXMAC__ )
|
|
||||||
THPrint m_macPrintInfo ;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -388,8 +395,6 @@ public:
|
|||||||
|
|
||||||
#if defined(__WIN95__)
|
#if defined(__WIN95__)
|
||||||
void* m_pageSetupData;
|
void* m_pageSetupData;
|
||||||
#elif defined( __WXMAC__ )
|
|
||||||
THPrint m_macPageSetupInfo ;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -36,6 +36,19 @@ class WXDLLEXPORT wxDateSpan;
|
|||||||
#define inline
|
#define inline
|
||||||
#endif // Debug
|
#endif // Debug
|
||||||
|
|
||||||
|
// not all c-runtimes are based on 1/1/1970 being (time_t) 0
|
||||||
|
// set this to the corresponding value in seconds 1/1/1970 has on your
|
||||||
|
// systems c-runtime
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
#if __MSL__ < 0x6000
|
||||||
|
#define WX_TIME_BASE_OFFSET ( 2082844800L + 126144000L )
|
||||||
|
#else
|
||||||
|
#define WX_TIME_BASE_OFFSET 0
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define WX_TIME_BASE_OFFSET 0
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
* TODO
|
* TODO
|
||||||
*
|
*
|
||||||
|
@@ -66,7 +66,7 @@ inline wxDateTime wxDateTime::Today()
|
|||||||
inline wxDateTime& wxDateTime::Set(time_t timet)
|
inline wxDateTime& wxDateTime::Set(time_t timet)
|
||||||
{
|
{
|
||||||
// assign first to avoid long multiplication overflow!
|
// assign first to avoid long multiplication overflow!
|
||||||
m_time = timet;
|
m_time = timet - WX_TIME_BASE_OFFSET ;
|
||||||
m_time *= TIME_T_FACTOR;
|
m_time *= TIME_T_FACTOR;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
@@ -146,10 +146,10 @@ inline time_t wxDateTime::GetTicks() const
|
|||||||
return (time_t)-1;
|
return (time_t)-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (time_t)((m_time / (long)TIME_T_FACTOR).GetLo());
|
return (time_t)((m_time / (long)TIME_T_FACTOR).GetLo())+WX_TIME_BASE_OFFSET ;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool wxDateTime::SetToLastWeekDay(WeekDay weekday,
|
bool wxDateTime::SetToLastWeekDay(WeekDay weekday,
|
||||||
Month month,
|
Month month,
|
||||||
int year)
|
int year)
|
||||||
{
|
{
|
||||||
|
@@ -25,7 +25,8 @@
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// define off_t
|
// define off_t
|
||||||
#ifndef __WXMAC__
|
|
||||||
|
#if !defined(__WXMAC__) || defined(__DARWIN__)
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#else
|
#else
|
||||||
typedef long off_t;
|
typedef long off_t;
|
||||||
@@ -264,7 +265,12 @@ WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0);
|
|||||||
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_UNIX
|
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_UNIX
|
||||||
#define wxPATH_SEP wxPATH_SEP_UNIX
|
#define wxPATH_SEP wxPATH_SEP_UNIX
|
||||||
#elif defined(__MAC__)
|
#elif defined(__MAC__)
|
||||||
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_MAC
|
|
||||||
|
// TODO find out whether we can really switch back to native file names
|
||||||
|
// previously this mac was emulating unix/win filename structures
|
||||||
|
// #define wxFILE_SEP_PATH wxFILE_SEP_PATH_MAC
|
||||||
|
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_DOS
|
||||||
|
#define wxPATH_SEP wxPATH_SEP_DOS
|
||||||
#else // Windows and OS/2
|
#else // Windows and OS/2
|
||||||
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_DOS
|
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_DOS
|
||||||
#define wxPATH_SEP wxPATH_SEP_DOS
|
#define wxPATH_SEP wxPATH_SEP_DOS
|
||||||
|
@@ -18,6 +18,10 @@
|
|||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
|
|
||||||
|
#ifndef wxUSE_GEOMETRY
|
||||||
|
#define wxUSE_GEOMETRY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if wxUSE_GEOMETRY
|
#if wxUSE_GEOMETRY
|
||||||
|
|
||||||
#include "wx/utils.h"
|
#include "wx/utils.h"
|
||||||
|
@@ -147,10 +147,10 @@ public :
|
|||||||
virtual void MacHandleHighLevelEvent( EventRecord *ev ) ;
|
virtual void MacHandleHighLevelEvent( EventRecord *ev ) ;
|
||||||
virtual void MacHandleMenuSelect( int menuid , int menuitem ) ;
|
virtual void MacHandleMenuSelect( int menuid , int menuitem ) ;
|
||||||
|
|
||||||
virtual OSErr MacHandleAEODoc(AppleEvent *event , AppleEvent *reply) ;
|
virtual OSErr MacHandleAEODoc(const AppleEvent *event , AppleEvent *reply) ;
|
||||||
virtual OSErr MacHandleAEPDoc(AppleEvent *event , AppleEvent *reply) ;
|
virtual OSErr MacHandleAEPDoc(const AppleEvent *event , AppleEvent *reply) ;
|
||||||
virtual OSErr MacHandleAEOApp(AppleEvent *event , AppleEvent *reply) ;
|
virtual OSErr MacHandleAEOApp(const AppleEvent *event , AppleEvent *reply) ;
|
||||||
virtual OSErr MacHandleAEQuit(AppleEvent *event , AppleEvent *reply) ;
|
virtual OSErr MacHandleAEQuit(const AppleEvent *event , AppleEvent *reply) ;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
@@ -26,9 +26,10 @@ class WXDLLEXPORT wxChoice: public wxControl
|
|||||||
DECLARE_DYNAMIC_CLASS(wxChoice)
|
DECLARE_DYNAMIC_CLASS(wxChoice)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline wxChoice() {}
|
wxChoice() {}
|
||||||
|
~wxChoice() ;
|
||||||
|
|
||||||
inline wxChoice(wxWindow *parent, wxWindowID id,
|
wxChoice(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
int n = 0, const wxString choices[] = NULL,
|
int n = 0, const wxString choices[] = NULL,
|
||||||
|
@@ -33,7 +33,11 @@ class WXDLLEXPORT wxPrinterDC: public wxDC
|
|||||||
virtual void StartPage(void) ;
|
virtual void StartPage(void) ;
|
||||||
virtual void EndPage(void) ;
|
virtual void EndPage(void) ;
|
||||||
protected :
|
protected :
|
||||||
|
#if TARGET_CARBON
|
||||||
|
PMPrintContext m_macPrintPort ;
|
||||||
|
#else
|
||||||
TPPrPort m_macPrintPort ;
|
TPPrPort m_macPrintPort ;
|
||||||
|
#endif
|
||||||
wxPrintData m_printData ;
|
wxPrintData m_printData ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -35,6 +35,8 @@ protected:
|
|||||||
wxString m_dir;
|
wxString m_dir;
|
||||||
wxString m_path; // Full path
|
wxString m_path; // Full path
|
||||||
wxString m_fileName;
|
wxString m_fileName;
|
||||||
|
wxArrayString m_fileNames;
|
||||||
|
wxArrayString m_paths;
|
||||||
wxString m_wildCard;
|
wxString m_wildCard;
|
||||||
int m_filterIndex;
|
int m_filterIndex;
|
||||||
public:
|
public:
|
||||||
@@ -54,6 +56,8 @@ public:
|
|||||||
inline wxString GetPath() const { return m_path; }
|
inline wxString GetPath() const { return m_path; }
|
||||||
inline wxString GetDirectory() const { return m_dir; }
|
inline wxString GetDirectory() const { return m_dir; }
|
||||||
inline wxString GetFilename() const { return m_fileName; }
|
inline wxString GetFilename() const { return m_fileName; }
|
||||||
|
void GetPaths(wxArrayString& paths) const { paths = m_paths; }
|
||||||
|
void GetFilenames(wxArrayString& files) const { files = m_fileNames; }
|
||||||
inline wxString GetWildcard() const { return m_wildCard; }
|
inline wxString GetWildcard() const { return m_wildCard; }
|
||||||
inline long GetStyle() const { return m_dialogStyle; }
|
inline long GetStyle() const { return m_dialogStyle; }
|
||||||
inline int GetFilterIndex() const { return m_filterIndex ; }
|
inline int GetFilterIndex() const { return m_filterIndex ; }
|
||||||
|
@@ -23,8 +23,8 @@ class WXDLLEXPORT wxStatusBarMac : public wxStatusBarGeneric
|
|||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxStatusBarMac);
|
DECLARE_DYNAMIC_CLASS(wxStatusBarMac);
|
||||||
|
|
||||||
wxStatusBarMac(void);
|
wxStatusBarMac();
|
||||||
inline wxStatusBarMac(wxWindow *parent, wxWindowID id,
|
wxStatusBarMac(wxWindow *parent, wxWindowID id,
|
||||||
long style = 0,
|
long style = 0,
|
||||||
const wxString& name = wxPanelNameStr)
|
const wxString& name = wxPanelNameStr)
|
||||||
{
|
{
|
||||||
@@ -34,7 +34,7 @@ class WXDLLEXPORT wxStatusBarMac : public wxStatusBarGeneric
|
|||||||
~wxStatusBarMac();
|
~wxStatusBarMac();
|
||||||
|
|
||||||
bool Create(wxWindow *parent, wxWindowID id,
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
long style,
|
long style ,
|
||||||
const wxString& name = wxPanelNameStr) ;
|
const wxString& name = wxPanelNameStr) ;
|
||||||
|
|
||||||
virtual void DrawFieldText(wxDC& dc, int i);
|
virtual void DrawFieldText(wxDC& dc, int i);
|
||||||
|
@@ -16,6 +16,11 @@
|
|||||||
|
|
||||||
#define UMA_USE_8_6 0
|
#define UMA_USE_8_6 0
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
|
#undef UMA_USE_8_6
|
||||||
|
#define UMA_USE_8_6 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__POWERPC__) || defined(__MACH__)
|
#if defined(__POWERPC__) || defined(__MACH__)
|
||||||
#define UMA_USE_APPEARANCE 1
|
#define UMA_USE_APPEARANCE 1
|
||||||
#define UMA_USE_WINDOWMGR 1
|
#define UMA_USE_WINDOWMGR 1
|
||||||
@@ -35,6 +40,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
|
void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
|
||||||
|
void UMACleanupToolbox() ;
|
||||||
bool UMAHasAppearance() ;
|
bool UMAHasAppearance() ;
|
||||||
long UMAGetAppearanceVersion() ;
|
long UMAGetAppearanceVersion() ;
|
||||||
|
|
||||||
@@ -69,8 +75,8 @@ void UMADrawMenuBar() ;
|
|||||||
void UMAShowWatchCursor() ;
|
void UMAShowWatchCursor() ;
|
||||||
void UMAShowArrowCursor() ;
|
void UMAShowArrowCursor() ;
|
||||||
|
|
||||||
void UMAPrOpen() ;
|
OSStatus UMAPrOpen() ;
|
||||||
void UMAPrClose() ;
|
OSStatus UMAPrClose() ;
|
||||||
|
|
||||||
// window manager
|
// window manager
|
||||||
|
|
||||||
|
@@ -28,14 +28,17 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
bool Create(const wxString& fileName, bool isResource = FALSE);
|
bool Create(const wxString& fileName, bool isResource = FALSE);
|
||||||
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
|
bool IsOk() const { return !m_sndname.IsEmpty(); }
|
||||||
bool Play(bool async = TRUE, bool looped = FALSE) const;
|
bool Play(bool async = TRUE, bool looped = FALSE) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool Free();
|
bool Free();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char* m_waveData;
|
SndChannelPtr m_sndChan;
|
||||||
|
|
||||||
|
wxString m_sndname;
|
||||||
|
SndListHandle m_hSnd;
|
||||||
int m_waveLength;
|
int m_waveLength;
|
||||||
bool m_isResource;
|
bool m_isResource;
|
||||||
};
|
};
|
||||||
|
@@ -246,7 +246,12 @@ public :
|
|||||||
WindowRef GetMacRootWindow() const ;
|
WindowRef GetMacRootWindow() const ;
|
||||||
|
|
||||||
virtual ControlHandle MacGetContainerForEmbedding() ;
|
virtual ControlHandle MacGetContainerForEmbedding() ;
|
||||||
virtual long MacGetBorderSize() const ;
|
|
||||||
|
virtual long MacGetLeftBorderSize() const ;
|
||||||
|
virtual long MacGetRightBorderSize() const ;
|
||||||
|
virtual long MacGetTopBorderSize() const ;
|
||||||
|
virtual long MacGetBottomBorderSize() const ;
|
||||||
|
|
||||||
static long MacRemoveBordersFromStyle( long style ) ;
|
static long MacRemoveBordersFromStyle( long style ) ;
|
||||||
virtual void MacSuperChangedPosition() ;
|
virtual void MacSuperChangedPosition() ;
|
||||||
virtual void MacSuperShown( bool show ) ;
|
virtual void MacSuperShown( bool show ) ;
|
||||||
|
@@ -255,6 +255,12 @@ WXDLLEXPORT const wxMB2WXbuf wxGetUserHome(const wxString& user = wxEmptyString)
|
|||||||
WXDLLEXPORT wxChar* wxGetUserHome(const wxString& user = wxEmptyString);
|
WXDLLEXPORT wxChar* wxGetUserHome(const wxString& user = wxEmptyString);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
WXDLLEXPORT wxString wxMacFindFolder(short vRefNum,
|
||||||
|
OSType folderType,
|
||||||
|
Boolean createFolder);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if wxUSE_GUI // GUI only things from now on
|
#if wxUSE_GUI // GUI only things from now on
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -9,6 +9,8 @@
|
|||||||
#include "wx/qt/wave.h"
|
#include "wx/qt/wave.h"
|
||||||
#elif defined(__WXPM__)
|
#elif defined(__WXPM__)
|
||||||
#include "wx/os2/wave.h"
|
#include "wx/os2/wave.h"
|
||||||
|
#elif defined(__WXMAC__)
|
||||||
|
#include "wx/mac/wave.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Binary file not shown.
@@ -172,6 +172,10 @@ wxPrintData::wxPrintData()
|
|||||||
m_devMode = (void*) NULL;
|
m_devMode = (void*) NULL;
|
||||||
m_devNames = (void*) NULL;
|
m_devNames = (void*) NULL;
|
||||||
#elif defined( __WXMAC__ )
|
#elif defined( __WXMAC__ )
|
||||||
|
#if TARGET_CARBON
|
||||||
|
m_macPageFormat = kPMNoPageFormat;
|
||||||
|
m_macPrintSettings = kPMNoPrintSettings;
|
||||||
|
#else
|
||||||
m_macPrintInfo = (THPrint) NewHandleClear( sizeof( TPrint ) ) ;
|
m_macPrintInfo = (THPrint) NewHandleClear( sizeof( TPrint ) ) ;
|
||||||
(**m_macPrintInfo).iPrVersion = 0; // something invalid
|
(**m_macPrintInfo).iPrVersion = 0; // something invalid
|
||||||
|
|
||||||
@@ -184,14 +188,7 @@ wxPrintData::wxPrintData()
|
|||||||
(**m_macPrintInfo).rPaper = r2;
|
(**m_macPrintInfo).rPaper = r2;
|
||||||
(**m_macPrintInfo).prStl.iPageV = 11 * 120 ; // 11 inches in 120th of an inch
|
(**m_macPrintInfo).prStl.iPageV = 11 * 120 ; // 11 inches in 120th of an inch
|
||||||
(**m_macPrintInfo).prStl.iPageH = 8 * 120 ; // 8 inches in 120th of an inch
|
(**m_macPrintInfo).prStl.iPageH = 8 * 120 ; // 8 inches in 120th of an inch
|
||||||
/*
|
#endif
|
||||||
UMAPrOpen() ;
|
|
||||||
m_macPrintInfo = (THPrint) NewHandleClear( sizeof( TPrint ) ) ;
|
|
||||||
::PrintDefault( m_macPrintInfo ) ;
|
|
||||||
OSErr err = PrError() ;
|
|
||||||
UMAPrClose() ;
|
|
||||||
wxASSERT( err == noErr ) ;
|
|
||||||
*/
|
|
||||||
#endif
|
#endif
|
||||||
m_printOrientation = wxPORTRAIT;
|
m_printOrientation = wxPORTRAIT;
|
||||||
m_printNoCopies = 1;
|
m_printNoCopies = 1;
|
||||||
@@ -224,16 +221,12 @@ wxPrintData::wxPrintData(const wxPrintData& printData)
|
|||||||
m_devMode = (void*) NULL;
|
m_devMode = (void*) NULL;
|
||||||
m_devNames = (void*) NULL;
|
m_devNames = (void*) NULL;
|
||||||
#elif defined( __WXMAC__ )
|
#elif defined( __WXMAC__ )
|
||||||
|
#if TARGET_CARBON
|
||||||
|
m_macPageFormat = kPMNoPageFormat;
|
||||||
|
m_macPrintSettings = kPMNoPrintSettings;
|
||||||
|
#else
|
||||||
m_macPrintInfo = NULL ;
|
m_macPrintInfo = NULL ;
|
||||||
/*
|
#endif
|
||||||
(THPrint) NewHandleClear( sizeof( TPrint ) ) ;
|
|
||||||
UMAPrOpen() ;
|
|
||||||
m_macPrintInfo = (THPrint) NewHandleClear( sizeof( TPrint ) ) ;
|
|
||||||
::PrintDefault( m_macPrintInfo ) ;
|
|
||||||
OSErr err = PrError() ;
|
|
||||||
UMAPrClose() ;
|
|
||||||
wxASSERT( err == noErr ) ;
|
|
||||||
*/
|
|
||||||
#endif
|
#endif
|
||||||
(*this) = printData;
|
(*this) = printData;
|
||||||
}
|
}
|
||||||
@@ -248,8 +241,22 @@ wxPrintData::~wxPrintData()
|
|||||||
if ( hDevNames )
|
if ( hDevNames )
|
||||||
GlobalFree(hDevNames);
|
GlobalFree(hDevNames);
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
|
#if TARGET_CARBON
|
||||||
|
if (m_macPageFormat != kPMNoPageFormat)
|
||||||
|
{
|
||||||
|
(void)PMDisposePageFormat(m_macPageFormat);
|
||||||
|
m_macPageFormat = kPMNoPageFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_macPrintSettings != kPMNoPrintSettings)
|
||||||
|
{
|
||||||
|
(void)PMDisposePrintSettings(m_macPrintSettings);
|
||||||
|
m_macPrintSettings = kPMNoPrintSettings;
|
||||||
|
}
|
||||||
|
#else
|
||||||
wxASSERT( m_macPrintInfo ) ;
|
wxASSERT( m_macPrintInfo ) ;
|
||||||
// ::DisposeHandle( (Handle) m_macPrintInfo ) ;
|
// we should perhaps delete
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -432,6 +439,7 @@ void wxPrintData::ConvertToNative()
|
|||||||
|
|
||||||
if (m_paperId == wxPAPER_NONE)
|
if (m_paperId == wxPAPER_NONE)
|
||||||
{
|
{
|
||||||
|
// DEVMODE is in tenths of a milimeter
|
||||||
devMode->dmPaperWidth = m_paperSize.x * 10;
|
devMode->dmPaperWidth = m_paperSize.x * 10;
|
||||||
devMode->dmPaperLength = m_paperSize.y * 10;
|
devMode->dmPaperLength = m_paperSize.y * 10;
|
||||||
devMode->dmFields |= DM_PAPERWIDTH;
|
devMode->dmFields |= DM_PAPERWIDTH;
|
||||||
@@ -609,6 +617,7 @@ void wxPrintData::ConvertFromNative()
|
|||||||
}
|
}
|
||||||
else if ((devMode->dmFields & DM_PAPERWIDTH) && (devMode->dmFields & DM_PAPERLENGTH))
|
else if ((devMode->dmFields & DM_PAPERWIDTH) && (devMode->dmFields & DM_PAPERLENGTH))
|
||||||
{
|
{
|
||||||
|
// DEVMODE is in tenths of a milimeter
|
||||||
m_paperSize.x = devMode->dmPaperWidth / 10;
|
m_paperSize.x = devMode->dmPaperWidth / 10;
|
||||||
m_paperSize.y = devMode->dmPaperLength / 10;
|
m_paperSize.y = devMode->dmPaperLength / 10;
|
||||||
m_paperId = wxPAPER_NONE;
|
m_paperId = wxPAPER_NONE;
|
||||||
@@ -709,20 +718,29 @@ void wxPrintData::ConvertFromNative()
|
|||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
void wxPrintData::ConvertToNative()
|
void wxPrintData::ConvertToNative()
|
||||||
{
|
{
|
||||||
|
#ifdef TARGET_CARBON
|
||||||
|
#else
|
||||||
(**m_macPrintInfo).prJob.iCopies = m_printNoCopies ;
|
(**m_macPrintInfo).prJob.iCopies = m_printNoCopies ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPrintData::ConvertFromNative()
|
void wxPrintData::ConvertFromNative()
|
||||||
{
|
{
|
||||||
|
#ifdef TARGET_CARBON
|
||||||
|
#else
|
||||||
m_printNoCopies = (**m_macPrintInfo).prJob.iCopies ;
|
m_printNoCopies = (**m_macPrintInfo).prJob.iCopies ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void wxPrintData::operator=(const wxPrintData& data)
|
void wxPrintData::operator=(const wxPrintData& data)
|
||||||
{
|
{
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
#ifdef TARGET_CARBON
|
||||||
|
#else
|
||||||
m_macPrintInfo = data.m_macPrintInfo ;
|
m_macPrintInfo = data.m_macPrintInfo ;
|
||||||
HandToHand( (Handle*) &m_macPrintInfo ) ;
|
HandToHand( (Handle*) &m_macPrintInfo ) ;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
m_printNoCopies = data.m_printNoCopies;
|
m_printNoCopies = data.m_printNoCopies;
|
||||||
m_printCollate = data.m_printCollate;
|
m_printCollate = data.m_printCollate;
|
||||||
@@ -1019,16 +1037,22 @@ void wxPrintDialogData::SetOwnerWindow(wxWindow* win)
|
|||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
void wxPrintDialogData::ConvertToNative()
|
void wxPrintDialogData::ConvertToNative()
|
||||||
{
|
{
|
||||||
|
#ifdef TARGET_CARBON
|
||||||
|
#else
|
||||||
(**m_printData.m_macPrintInfo).prJob.iFstPage = m_printFromPage ;
|
(**m_printData.m_macPrintInfo).prJob.iFstPage = m_printFromPage ;
|
||||||
(**m_printData.m_macPrintInfo).prJob.iLstPage = m_printToPage ;
|
(**m_printData.m_macPrintInfo).prJob.iLstPage = m_printToPage ;
|
||||||
m_printData.ConvertToNative() ;
|
m_printData.ConvertToNative() ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPrintDialogData::ConvertFromNative()
|
void wxPrintDialogData::ConvertFromNative()
|
||||||
{
|
{
|
||||||
|
#ifdef TARGET_CARBON
|
||||||
|
#else
|
||||||
m_printData.ConvertFromNative() ;
|
m_printData.ConvertFromNative() ;
|
||||||
m_printFromPage = (**m_printData.m_macPrintInfo).prJob.iFstPage ;
|
m_printFromPage = (**m_printData.m_macPrintInfo).prJob.iFstPage ;
|
||||||
m_printToPage = (**m_printData.m_macPrintInfo).prJob.iLstPage ;
|
m_printToPage = (**m_printData.m_macPrintInfo).prJob.iLstPage ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1228,7 +1252,7 @@ void wxPageSetupDialogData::ConvertToNative()
|
|||||||
pd->hwndOwner=(HWND)NULL;
|
pd->hwndOwner=(HWND)NULL;
|
||||||
// pd->hDevNames=(HWND)NULL;
|
// pd->hDevNames=(HWND)NULL;
|
||||||
pd->hInstance=(HINSTANCE)NULL;
|
pd->hInstance=(HINSTANCE)NULL;
|
||||||
|
// PAGESETUPDLG is in hundreds of a mm
|
||||||
pd->ptPaperSize.x = m_paperSize.x * 100;
|
pd->ptPaperSize.x = m_paperSize.x * 100;
|
||||||
pd->ptPaperSize.y = m_paperSize.y * 100;
|
pd->ptPaperSize.y = m_paperSize.y * 100;
|
||||||
|
|
||||||
@@ -1305,6 +1329,7 @@ void wxPageSetupDialogData::ConvertFromNative()
|
|||||||
m_getDefaultInfo = ((pd->Flags & PSD_RETURNDEFAULT) == PSD_RETURNDEFAULT);
|
m_getDefaultInfo = ((pd->Flags & PSD_RETURNDEFAULT) == PSD_RETURNDEFAULT);
|
||||||
m_enableHelp = ((pd->Flags & PSD_SHOWHELP) == PSD_SHOWHELP);
|
m_enableHelp = ((pd->Flags & PSD_SHOWHELP) == PSD_SHOWHELP);
|
||||||
|
|
||||||
|
// PAGESETUPDLG is in hundreds of a mm
|
||||||
m_paperSize.x = pd->ptPaperSize.x / 100;
|
m_paperSize.x = pd->ptPaperSize.x / 100;
|
||||||
m_paperSize.y = pd->ptPaperSize.y / 100;
|
m_paperSize.y = pd->ptPaperSize.y / 100;
|
||||||
|
|
||||||
@@ -1337,6 +1362,8 @@ void wxPageSetupDialogData::ConvertToNative()
|
|||||||
{
|
{
|
||||||
m_printData.ConvertToNative() ;
|
m_printData.ConvertToNative() ;
|
||||||
// on mac the paper rect has a negative top left corner, because the page rect (printable area) is at 0,0
|
// on mac the paper rect has a negative top left corner, because the page rect (printable area) is at 0,0
|
||||||
|
#ifdef TARGET_CARBON
|
||||||
|
#else
|
||||||
(**m_printData.m_macPrintInfo).rPaper.left = int( ((double) m_minMarginTopLeft.x)*mm2pt ) ;
|
(**m_printData.m_macPrintInfo).rPaper.left = int( ((double) m_minMarginTopLeft.x)*mm2pt ) ;
|
||||||
(**m_printData.m_macPrintInfo).rPaper.top = int( ((double) m_minMarginTopLeft.y)*mm2pt ) ;
|
(**m_printData.m_macPrintInfo).rPaper.top = int( ((double) m_minMarginTopLeft.y)*mm2pt ) ;
|
||||||
|
|
||||||
@@ -1347,12 +1374,15 @@ void wxPageSetupDialogData::ConvertToNative()
|
|||||||
(**m_printData.m_macPrintInfo).prInfo.rPage.top = 0 ;
|
(**m_printData.m_macPrintInfo).prInfo.rPage.top = 0 ;
|
||||||
(**m_printData.m_macPrintInfo).prInfo.rPage.right = int( ((double) m_paperSize.x - m_minMarginTopLeft.x - m_minMarginBottomRight.x)*mm2pt ) ;
|
(**m_printData.m_macPrintInfo).prInfo.rPage.right = int( ((double) m_paperSize.x - m_minMarginTopLeft.x - m_minMarginBottomRight.x)*mm2pt ) ;
|
||||||
(**m_printData.m_macPrintInfo).prInfo.rPage.bottom = int( ((double) m_paperSize.y - m_minMarginTopLeft.y - m_minMarginBottomRight.y)*mm2pt ) ;
|
(**m_printData.m_macPrintInfo).prInfo.rPage.bottom = int( ((double) m_paperSize.y - m_minMarginTopLeft.y - m_minMarginBottomRight.y)*mm2pt ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPageSetupDialogData::ConvertFromNative()
|
void wxPageSetupDialogData::ConvertFromNative()
|
||||||
{
|
{
|
||||||
m_printData.ConvertFromNative () ;
|
m_printData.ConvertFromNative () ;
|
||||||
|
|
||||||
|
#ifdef TARGET_CARBON
|
||||||
|
#else
|
||||||
m_paperSize.x = ((double) (**m_printData.m_macPrintInfo).rPaper.right - (**m_printData.m_macPrintInfo).rPaper.left ) * pt2mm ;
|
m_paperSize.x = ((double) (**m_printData.m_macPrintInfo).rPaper.right - (**m_printData.m_macPrintInfo).rPaper.left ) * pt2mm ;
|
||||||
m_paperSize.y = ((double) (**m_printData.m_macPrintInfo).rPaper.bottom - (**m_printData.m_macPrintInfo).rPaper.top ) * pt2mm ;
|
m_paperSize.y = ((double) (**m_printData.m_macPrintInfo).rPaper.bottom - (**m_printData.m_macPrintInfo).rPaper.top ) * pt2mm ;
|
||||||
|
|
||||||
@@ -1361,7 +1391,7 @@ void wxPageSetupDialogData::ConvertFromNative()
|
|||||||
|
|
||||||
m_minMarginBottomRight.x = ((double) (**m_printData.m_macPrintInfo).rPaper.right - (**m_printData.m_macPrintInfo).prInfo.rPage.right ) * pt2mm ;
|
m_minMarginBottomRight.x = ((double) (**m_printData.m_macPrintInfo).rPaper.right - (**m_printData.m_macPrintInfo).prInfo.rPage.right ) * pt2mm ;
|
||||||
m_minMarginBottomRight.y = ((double)(**m_printData.m_macPrintInfo).rPaper.bottom - (**m_printData.m_macPrintInfo).prInfo.rPage.bottom ) * pt2mm ;
|
m_minMarginBottomRight.y = ((double)(**m_printData.m_macPrintInfo).rPaper.bottom - (**m_printData.m_macPrintInfo).prInfo.rPage.bottom ) * pt2mm ;
|
||||||
|
#endif
|
||||||
// adjust minimal values
|
// adjust minimal values
|
||||||
//TODO add custom fields in dialog for margins
|
//TODO add custom fields in dialog for margins
|
||||||
|
|
||||||
|
@@ -69,7 +69,7 @@ char *malloc();
|
|||||||
int free();
|
int free();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int read();
|
//int read();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@@ -22,10 +22,19 @@ int yylex(void);
|
|||||||
int yylook(void);
|
int yylook(void);
|
||||||
int yywrap(void);
|
int yywrap(void);
|
||||||
int yyback(int *, int);
|
int yyback(int *, int);
|
||||||
#ifdef __WXMAC__
|
#if __MSL__ < 0x6000
|
||||||
int read( int , char * , int ) ;
|
int read( int , char * , int ) ;
|
||||||
|
#else
|
||||||
|
int _read( int , void * , size_t ) ;
|
||||||
|
#define read _read
|
||||||
|
#endif
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
int fileno( FILE* ) ;
|
||||||
|
#else
|
||||||
|
#if __MSL__ < 0x6000
|
||||||
int fileno( void* ) ;
|
int fileno( void* ) ;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* You may need to put /DLEX_SCANNER in your makefile
|
/* You may need to put /DLEX_SCANNER in your makefile
|
||||||
* if you're using LEX!
|
* if you're using LEX!
|
||||||
|
@@ -68,12 +68,16 @@
|
|||||||
// Have to ifdef this for different environments
|
// Have to ifdef this for different environments
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#elif (defined(__WXMAC__))
|
#elif (defined(__WXMAC__))
|
||||||
|
#if __MSL__ < 0x6000
|
||||||
int access( const char *path, int mode ) { return 0 ; }
|
int access( const char *path, int mode ) { return 0 ; }
|
||||||
|
#else
|
||||||
|
int _access( const char *path, int mode ) { return 0 ; }
|
||||||
|
#endif
|
||||||
char* mktemp( char * path ) { return path ;}
|
char* mktemp( char * path ) { return path ;}
|
||||||
#include <unistd.h>
|
#include <stat.h>
|
||||||
#include <unix.h>
|
|
||||||
#define W_OK 2
|
#define W_OK 2
|
||||||
#define R_OK 4
|
#define R_OK 4
|
||||||
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
#error "Please specify the header with file functions declarations."
|
#error "Please specify the header with file functions declarations."
|
||||||
#endif //Win/UNIX
|
#endif //Win/UNIX
|
||||||
@@ -189,7 +193,9 @@ bool wxFile::Create(const wxChar *szFileName, bool bOverwrite, int accessMode)
|
|||||||
// if bOverwrite we create a new file or truncate the existing one,
|
// if bOverwrite we create a new file or truncate the existing one,
|
||||||
// otherwise we only create the new file and fail if it already exists
|
// otherwise we only create the new file and fail if it already exists
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
int fd = open(wxUnix2MacFilename( szFileName ), O_CREAT | (bOverwrite ? O_TRUNC : O_EXCL), access);
|
// Dominic Mazzoni [dmazzoni+@cs.cmu.edu] reports that open is still broken on the mac, so we replace
|
||||||
|
// int fd = open(wxUnix2MacFilename( szFileName ), O_CREAT | (bOverwrite ? O_TRUNC : O_EXCL), access);
|
||||||
|
int fd = creat(wxUnix2MacFilename( szFileName ), accessMode);
|
||||||
#else
|
#else
|
||||||
int fd = wxOpen(wxFNCONV(szFileName),
|
int fd = wxOpen(wxFNCONV(szFileName),
|
||||||
O_BINARY | O_WRONLY | O_CREAT |
|
O_BINARY | O_WRONLY | O_CREAT |
|
||||||
@@ -293,7 +299,11 @@ size_t wxFile::Write(const void *pBuf, size_t nCount)
|
|||||||
wxCHECK( (pBuf != NULL) && IsOpened(), 0 );
|
wxCHECK( (pBuf != NULL) && IsOpened(), 0 );
|
||||||
|
|
||||||
#ifdef __MWERKS__
|
#ifdef __MWERKS__
|
||||||
|
#if __MSL__ >= 0x6000
|
||||||
|
int iRc = ::write(m_fd, (void*) pBuf, nCount);
|
||||||
|
#else
|
||||||
int iRc = ::write(m_fd, (const char*) pBuf, nCount);
|
int iRc = ::write(m_fd, (const char*) pBuf, nCount);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
int iRc = ::write(m_fd, pBuf, nCount);
|
int iRc = ::write(m_fd, pBuf, nCount);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -199,19 +199,7 @@ wxString wxFileConfig::GetGlobalDir()
|
|||||||
#elif defined(__WXSTUBS__)
|
#elif defined(__WXSTUBS__)
|
||||||
wxASSERT_MSG( FALSE, wxT("TODO") ) ;
|
wxASSERT_MSG( FALSE, wxT("TODO") ) ;
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
{
|
strDir = wxMacFindFolder( (short) kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder ) ;
|
||||||
short vRefNum ;
|
|
||||||
long dirID ;
|
|
||||||
|
|
||||||
if ( FindFolder( (short) kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder, &vRefNum, &dirID) == noErr)
|
|
||||||
{
|
|
||||||
FSSpec file ;
|
|
||||||
if ( FSMakeFSSpec( vRefNum , dirID , "\p" , &file ) == noErr )
|
|
||||||
{
|
|
||||||
strDir = wxMacFSSpec2UnixFilename( &file ) + "/" ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else // Windows
|
#else // Windows
|
||||||
wxChar szWinDir[MAX_PATH];
|
wxChar szWinDir[MAX_PATH];
|
||||||
::GetWindowsDirectory(szWinDir, MAX_PATH);
|
::GetWindowsDirectory(szWinDir, MAX_PATH);
|
||||||
|
@@ -57,6 +57,7 @@
|
|||||||
#else
|
#else
|
||||||
#include <stat.h>
|
#include <stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <unix.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __UNIX__
|
#ifdef __UNIX__
|
||||||
@@ -1682,6 +1683,29 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
if (_getcwd(buf, sz) == NULL) {
|
if (_getcwd(buf, sz) == NULL) {
|
||||||
#elif defined( __WXMAC__)
|
#elif defined( __WXMAC__)
|
||||||
|
FSSpec cwdSpec ;
|
||||||
|
FCBPBRec pb;
|
||||||
|
OSErr error;
|
||||||
|
Str255 fileName ;
|
||||||
|
pb.ioNamePtr = (StringPtr) &fileName;
|
||||||
|
pb.ioVRefNum = 0;
|
||||||
|
pb.ioRefNum = LMGetCurApRefNum();
|
||||||
|
pb.ioFCBIndx = 0;
|
||||||
|
error = PBGetFCBInfoSync(&pb);
|
||||||
|
if ( error == noErr )
|
||||||
|
{
|
||||||
|
cwdSpec.vRefNum = pb.ioFCBVRefNum;
|
||||||
|
cwdSpec.parID = pb.ioFCBParID;
|
||||||
|
cwdSpec.name[0] = 0 ;
|
||||||
|
wxString res = wxMacFSSpec2UnixFilename( &cwdSpec ) ;
|
||||||
|
|
||||||
|
strcpy( buf , res ) ;
|
||||||
|
buf[res.length()-1]=0 ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
buf[0] = 0 ;
|
||||||
|
/*
|
||||||
|
this version will not always give back the application directory on mac
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
SFSaveDisk = 0x214, CurDirStore = 0x398
|
SFSaveDisk = 0x214, CurDirStore = 0x398
|
||||||
@@ -1691,6 +1715,7 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
|
|||||||
FSMakeFSSpec( - *(short *) SFSaveDisk , *(long *) CurDirStore , NULL , &cwdSpec ) ;
|
FSMakeFSSpec( - *(short *) SFSaveDisk , *(long *) CurDirStore , NULL , &cwdSpec ) ;
|
||||||
wxString res = wxMacFSSpec2UnixFilename( &cwdSpec ) ;
|
wxString res = wxMacFSSpec2UnixFilename( &cwdSpec ) ;
|
||||||
strcpy( buf , res ) ;
|
strcpy( buf , res ) ;
|
||||||
|
*/
|
||||||
if (0) {
|
if (0) {
|
||||||
#elif(__VISAGECPP__)
|
#elif(__VISAGECPP__)
|
||||||
APIRET rc;
|
APIRET rc;
|
||||||
|
@@ -2615,6 +2615,7 @@ AGAPortHelper::~AGAPortHelper()
|
|||||||
TextSize( size );
|
TextSize( size );
|
||||||
TextFace( style );
|
TextFace( style );
|
||||||
TextMode( mode );
|
TextMode( mode );
|
||||||
|
SetOrigin( 0 , 0 ) ;
|
||||||
SetPort( port ) ;
|
SetPort( port ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -89,28 +89,28 @@ wxString wxApp::s_macHelpMenuTitleName = "&Help" ;
|
|||||||
pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||||
{
|
{
|
||||||
wxApp* app = (wxApp*) refcon ;
|
wxApp* app = (wxApp*) refcon ;
|
||||||
return wxTheApp->MacHandleAEODoc( event , reply) ;
|
return wxTheApp->MacHandleAEODoc( (AppleEvent*) event , reply) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||||
{
|
{
|
||||||
wxApp* app = (wxApp*) refcon ;
|
wxApp* app = (wxApp*) refcon ;
|
||||||
return wxTheApp->MacHandleAEOApp( event , reply ) ;
|
return wxTheApp->MacHandleAEOApp( (AppleEvent*) event , reply ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||||
{
|
{
|
||||||
wxApp* app = (wxApp*) refcon ;
|
wxApp* app = (wxApp*) refcon ;
|
||||||
return wxTheApp->MacHandleAEPDoc( event , reply ) ;
|
return wxTheApp->MacHandleAEPDoc( (AppleEvent*) event , reply ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||||
{
|
{
|
||||||
wxApp* app = (wxApp*) refcon ;
|
wxApp* app = (wxApp*) refcon ;
|
||||||
return wxTheApp->MacHandleAEQuit( event , reply) ;
|
return wxTheApp->MacHandleAEQuit( (AppleEvent*) event , reply) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSErr wxApp::MacHandleAEODoc(AppleEvent *event , AppleEvent *reply)
|
OSErr wxApp::MacHandleAEODoc(const AppleEvent *event , AppleEvent *reply)
|
||||||
{
|
{
|
||||||
ProcessSerialNumber PSN ;
|
ProcessSerialNumber PSN ;
|
||||||
PSN.highLongOfPSN = 0 ;
|
PSN.highLongOfPSN = 0 ;
|
||||||
@@ -119,17 +119,17 @@ OSErr wxApp::MacHandleAEODoc(AppleEvent *event , AppleEvent *reply)
|
|||||||
return noErr ;
|
return noErr ;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSErr wxApp::MacHandleAEPDoc(AppleEvent *event , AppleEvent *reply)
|
OSErr wxApp::MacHandleAEPDoc(const AppleEvent *event , AppleEvent *reply)
|
||||||
{
|
{
|
||||||
return noErr ;
|
return noErr ;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSErr wxApp::MacHandleAEOApp(AppleEvent *event , AppleEvent *reply)
|
OSErr wxApp::MacHandleAEOApp(const AppleEvent *event , AppleEvent *reply)
|
||||||
{
|
{
|
||||||
return noErr ;
|
return noErr ;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSErr wxApp::MacHandleAEQuit(AppleEvent *event , AppleEvent *reply)
|
OSErr wxApp::MacHandleAEQuit(const AppleEvent *event , AppleEvent *reply)
|
||||||
{
|
{
|
||||||
wxWindow* win = GetTopWindow() ;
|
wxWindow* win = GetTopWindow() ;
|
||||||
if ( win )
|
if ( win )
|
||||||
@@ -510,6 +510,7 @@ void wxApp::CleanUp()
|
|||||||
delete wxLog::SetActiveTarget(NULL);
|
delete wxLog::SetActiveTarget(NULL);
|
||||||
#endif // wxUSE_LOG
|
#endif // wxUSE_LOG
|
||||||
|
|
||||||
|
UMACleanupToolbox() ;
|
||||||
if (s_macCursorRgn)
|
if (s_macCursorRgn)
|
||||||
::DisposeRgn(s_macCursorRgn);
|
::DisposeRgn(s_macCursorRgn);
|
||||||
|
|
||||||
@@ -1044,15 +1045,17 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
|
|||||||
int newHeight = HiWord(growResult);
|
int newHeight = HiWord(growResult);
|
||||||
int oldWidth, oldHeight;
|
int oldWidth, oldHeight;
|
||||||
|
|
||||||
|
|
||||||
|
if (win)
|
||||||
|
{
|
||||||
win->GetSize(&oldWidth, &oldHeight);
|
win->GetSize(&oldWidth, &oldHeight);
|
||||||
if (newWidth == 0)
|
if (newWidth == 0)
|
||||||
newWidth = oldWidth;
|
newWidth = oldWidth;
|
||||||
if (newHeight == 0)
|
if (newHeight == 0)
|
||||||
newHeight = oldHeight;
|
newHeight = oldHeight;
|
||||||
|
|
||||||
if (win)
|
|
||||||
win->SetSize( -1, -1, newWidth, newHeight, wxSIZE_USE_EXISTING);
|
win->SetSize( -1, -1, newWidth, newHeight, wxSIZE_USE_EXISTING);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
s_lastMouseDown = 0;
|
s_lastMouseDown = 0;
|
||||||
break;
|
break;
|
||||||
case inZoomIn:
|
case inZoomIn:
|
||||||
@@ -1253,7 +1256,10 @@ void wxApp::MacHandleKeyDownEvent( EventRecord *ev )
|
|||||||
|
|
||||||
UInt32 menuresult = UMAMenuEvent(ev) ;
|
UInt32 menuresult = UMAMenuEvent(ev) ;
|
||||||
if ( HiWord( menuresult ) )
|
if ( HiWord( menuresult ) )
|
||||||
|
{
|
||||||
|
if ( !s_macIsInModalLoop )
|
||||||
MacHandleMenuSelect( HiWord( menuresult ) , LoWord( menuresult ) ) ;
|
MacHandleMenuSelect( HiWord( menuresult ) , LoWord( menuresult ) ) ;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
short keycode ;
|
short keycode ;
|
||||||
@@ -1373,6 +1379,14 @@ void wxApp::MacHandleUpdateEvent( EventRecord *ev )
|
|||||||
{
|
{
|
||||||
win->MacUpdate( ev ) ;
|
win->MacUpdate( ev ) ;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// since there is no way of telling this foreign window to update itself
|
||||||
|
// we have to invalidate the update region otherwise we keep getting the same
|
||||||
|
// event over and over again
|
||||||
|
BeginUpdate( window ) ;
|
||||||
|
EndUpdate( window ) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxApp::MacHandleDiskEvent( EventRecord *ev )
|
void wxApp::MacHandleDiskEvent( EventRecord *ev )
|
||||||
@@ -1490,9 +1504,12 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
|
|||||||
|
|
||||||
switch (windowPart)
|
switch (windowPart)
|
||||||
{
|
{
|
||||||
|
// fixes for setting the cursor back from dominic mazzoni
|
||||||
case inMenuBar :
|
case inMenuBar :
|
||||||
|
UMAShowArrowCursor();
|
||||||
break ;
|
break ;
|
||||||
case inSysWindow :
|
case inSysWindow :
|
||||||
|
UMAShowArrowCursor();
|
||||||
break ;
|
break ;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
@@ -1502,6 +1519,9 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
|
|||||||
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
||||||
if ( win )
|
if ( win )
|
||||||
win->MacMouseMoved( ev , windowPart ) ;
|
win->MacMouseMoved( ev , windowPart ) ;
|
||||||
|
else
|
||||||
|
UMAShowArrowCursor();
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -2615,6 +2615,7 @@ AGAPortHelper::~AGAPortHelper()
|
|||||||
TextSize( size );
|
TextSize( size );
|
||||||
TextFace( style );
|
TextFace( style );
|
||||||
TextMode( mode );
|
TextMode( mode );
|
||||||
|
SetOrigin( 0 , 0 ) ;
|
||||||
SetPort( port ) ;
|
SetPort( port ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -89,28 +89,28 @@ wxString wxApp::s_macHelpMenuTitleName = "&Help" ;
|
|||||||
pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||||
{
|
{
|
||||||
wxApp* app = (wxApp*) refcon ;
|
wxApp* app = (wxApp*) refcon ;
|
||||||
return wxTheApp->MacHandleAEODoc( event , reply) ;
|
return wxTheApp->MacHandleAEODoc( (AppleEvent*) event , reply) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||||
{
|
{
|
||||||
wxApp* app = (wxApp*) refcon ;
|
wxApp* app = (wxApp*) refcon ;
|
||||||
return wxTheApp->MacHandleAEOApp( event , reply ) ;
|
return wxTheApp->MacHandleAEOApp( (AppleEvent*) event , reply ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||||
{
|
{
|
||||||
wxApp* app = (wxApp*) refcon ;
|
wxApp* app = (wxApp*) refcon ;
|
||||||
return wxTheApp->MacHandleAEPDoc( event , reply ) ;
|
return wxTheApp->MacHandleAEPDoc( (AppleEvent*) event , reply ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||||
{
|
{
|
||||||
wxApp* app = (wxApp*) refcon ;
|
wxApp* app = (wxApp*) refcon ;
|
||||||
return wxTheApp->MacHandleAEQuit( event , reply) ;
|
return wxTheApp->MacHandleAEQuit( (AppleEvent*) event , reply) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSErr wxApp::MacHandleAEODoc(AppleEvent *event , AppleEvent *reply)
|
OSErr wxApp::MacHandleAEODoc(const AppleEvent *event , AppleEvent *reply)
|
||||||
{
|
{
|
||||||
ProcessSerialNumber PSN ;
|
ProcessSerialNumber PSN ;
|
||||||
PSN.highLongOfPSN = 0 ;
|
PSN.highLongOfPSN = 0 ;
|
||||||
@@ -119,17 +119,17 @@ OSErr wxApp::MacHandleAEODoc(AppleEvent *event , AppleEvent *reply)
|
|||||||
return noErr ;
|
return noErr ;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSErr wxApp::MacHandleAEPDoc(AppleEvent *event , AppleEvent *reply)
|
OSErr wxApp::MacHandleAEPDoc(const AppleEvent *event , AppleEvent *reply)
|
||||||
{
|
{
|
||||||
return noErr ;
|
return noErr ;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSErr wxApp::MacHandleAEOApp(AppleEvent *event , AppleEvent *reply)
|
OSErr wxApp::MacHandleAEOApp(const AppleEvent *event , AppleEvent *reply)
|
||||||
{
|
{
|
||||||
return noErr ;
|
return noErr ;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSErr wxApp::MacHandleAEQuit(AppleEvent *event , AppleEvent *reply)
|
OSErr wxApp::MacHandleAEQuit(const AppleEvent *event , AppleEvent *reply)
|
||||||
{
|
{
|
||||||
wxWindow* win = GetTopWindow() ;
|
wxWindow* win = GetTopWindow() ;
|
||||||
if ( win )
|
if ( win )
|
||||||
@@ -510,6 +510,7 @@ void wxApp::CleanUp()
|
|||||||
delete wxLog::SetActiveTarget(NULL);
|
delete wxLog::SetActiveTarget(NULL);
|
||||||
#endif // wxUSE_LOG
|
#endif // wxUSE_LOG
|
||||||
|
|
||||||
|
UMACleanupToolbox() ;
|
||||||
if (s_macCursorRgn)
|
if (s_macCursorRgn)
|
||||||
::DisposeRgn(s_macCursorRgn);
|
::DisposeRgn(s_macCursorRgn);
|
||||||
|
|
||||||
@@ -1044,15 +1045,17 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
|
|||||||
int newHeight = HiWord(growResult);
|
int newHeight = HiWord(growResult);
|
||||||
int oldWidth, oldHeight;
|
int oldWidth, oldHeight;
|
||||||
|
|
||||||
|
|
||||||
|
if (win)
|
||||||
|
{
|
||||||
win->GetSize(&oldWidth, &oldHeight);
|
win->GetSize(&oldWidth, &oldHeight);
|
||||||
if (newWidth == 0)
|
if (newWidth == 0)
|
||||||
newWidth = oldWidth;
|
newWidth = oldWidth;
|
||||||
if (newHeight == 0)
|
if (newHeight == 0)
|
||||||
newHeight = oldHeight;
|
newHeight = oldHeight;
|
||||||
|
|
||||||
if (win)
|
|
||||||
win->SetSize( -1, -1, newWidth, newHeight, wxSIZE_USE_EXISTING);
|
win->SetSize( -1, -1, newWidth, newHeight, wxSIZE_USE_EXISTING);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
s_lastMouseDown = 0;
|
s_lastMouseDown = 0;
|
||||||
break;
|
break;
|
||||||
case inZoomIn:
|
case inZoomIn:
|
||||||
@@ -1253,7 +1256,10 @@ void wxApp::MacHandleKeyDownEvent( EventRecord *ev )
|
|||||||
|
|
||||||
UInt32 menuresult = UMAMenuEvent(ev) ;
|
UInt32 menuresult = UMAMenuEvent(ev) ;
|
||||||
if ( HiWord( menuresult ) )
|
if ( HiWord( menuresult ) )
|
||||||
|
{
|
||||||
|
if ( !s_macIsInModalLoop )
|
||||||
MacHandleMenuSelect( HiWord( menuresult ) , LoWord( menuresult ) ) ;
|
MacHandleMenuSelect( HiWord( menuresult ) , LoWord( menuresult ) ) ;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
short keycode ;
|
short keycode ;
|
||||||
@@ -1373,6 +1379,14 @@ void wxApp::MacHandleUpdateEvent( EventRecord *ev )
|
|||||||
{
|
{
|
||||||
win->MacUpdate( ev ) ;
|
win->MacUpdate( ev ) ;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// since there is no way of telling this foreign window to update itself
|
||||||
|
// we have to invalidate the update region otherwise we keep getting the same
|
||||||
|
// event over and over again
|
||||||
|
BeginUpdate( window ) ;
|
||||||
|
EndUpdate( window ) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxApp::MacHandleDiskEvent( EventRecord *ev )
|
void wxApp::MacHandleDiskEvent( EventRecord *ev )
|
||||||
@@ -1490,9 +1504,12 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
|
|||||||
|
|
||||||
switch (windowPart)
|
switch (windowPart)
|
||||||
{
|
{
|
||||||
|
// fixes for setting the cursor back from dominic mazzoni
|
||||||
case inMenuBar :
|
case inMenuBar :
|
||||||
|
UMAShowArrowCursor();
|
||||||
break ;
|
break ;
|
||||||
case inSysWindow :
|
case inSysWindow :
|
||||||
|
UMAShowArrowCursor();
|
||||||
break ;
|
break ;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
@@ -1502,6 +1519,9 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
|
|||||||
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
||||||
if ( win )
|
if ( win )
|
||||||
win->MacMouseMoved( ev , windowPart ) ;
|
win->MacMouseMoved( ev , windowPart ) ;
|
||||||
|
else
|
||||||
|
UMAShowArrowCursor();
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -21,6 +21,14 @@
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
short nextMenuId = 100 ; // wxMenu takes the lower ids
|
||||||
|
|
||||||
|
wxChoice::~wxChoice()
|
||||||
|
{
|
||||||
|
// DeleteMenu( m_macPopUpMenuId ) ;
|
||||||
|
DisposeMenu( m_macPopUpMenuHandle ) ;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
@@ -35,6 +43,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
|
MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
|
||||||
|
|
||||||
|
m_macPopUpMenuHandle = NewMenu( 1 , "\pPopUp Menu" ) ;
|
||||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , -12345 , 0 ,
|
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , -12345 , 0 ,
|
||||||
kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ;
|
kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ;
|
||||||
|
|
||||||
|
@@ -394,11 +394,11 @@ resource 'ldes' ( 128 )
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
resource 'CURS' (9, "Hand") {
|
resource 'CURS' (9, "Hand") {
|
||||||
$"01 80 1A 70 26 48 26 4A 12 4D 12 49 68 09 98 01"
|
$"0380 04C0 04C0 04C0 04C0 04C0 74F8 9CAE"
|
||||||
$"88 02 40 02 20 02 20 04 10 04 08 08 04 08 04 08",
|
$"4CAB 240B 2403 1003 0803 0806 0406 0406",
|
||||||
$"01 80 1B F0 3F F8 3F FA 1F FF 1F FF 7F FF FF FF"
|
$"0380 07C0 07C0 07C0 07C0 07C0 77F8 FFFE"
|
||||||
$"FF FE 7F FE 3F FE 3F FC 1F FC 0F F8 07 F8 07 F8",
|
$"7FFF 3FFF 3FFF 1FFF 0FFF 0FFE 07FE 07FE",
|
||||||
{9, 8}
|
{0, 7}
|
||||||
};
|
};
|
||||||
|
|
||||||
resource 'CURS' (10, "SizeWE") {
|
resource 'CURS' (10, "SizeWE") {
|
||||||
|
@@ -16,6 +16,10 @@
|
|||||||
#include "wx/dc.h"
|
#include "wx/dc.h"
|
||||||
#include "wx/mac/uma.h"
|
#include "wx/mac/uma.h"
|
||||||
|
|
||||||
|
#if __MSL__ >= 0x6000
|
||||||
|
#include "math.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
||||||
#endif
|
#endif
|
||||||
@@ -128,7 +132,7 @@ wxDC::~wxDC(void)
|
|||||||
|
|
||||||
void wxDC::MacSetupPort() const
|
void wxDC::MacSetupPort() const
|
||||||
{
|
{
|
||||||
AGAPortHelper* help = &m_macPortHelper ;
|
AGAPortHelper* help = (AGAPortHelper*) &m_macPortHelper ;
|
||||||
help->Setup( m_macPort ) ;
|
help->Setup( m_macPort ) ;
|
||||||
m_macPortId = ++m_macCurrentPortId ;
|
m_macPortId = ++m_macCurrentPortId ;
|
||||||
::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v);
|
::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v);
|
||||||
@@ -427,7 +431,12 @@ void wxDC::ComputeScaleAndOrigin(void)
|
|||||||
// CMB: if scale has changed call SetPen to recalulate the line width
|
// CMB: if scale has changed call SetPen to recalulate the line width
|
||||||
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
|
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
|
||||||
{
|
{
|
||||||
// TODO : set internal flags for recalc
|
// this is a bit artificial, but we need to force wxDC to think
|
||||||
|
// the pen has changed
|
||||||
|
wxPen* pen = & GetPen();
|
||||||
|
wxPen tempPen;
|
||||||
|
m_pen = tempPen;
|
||||||
|
SetPen(* pen);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -36,15 +36,13 @@ GrafPtr macPrintFormerPort = NULL ;
|
|||||||
|
|
||||||
wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
|
wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
OSStatus err ;
|
||||||
OSErr err ;
|
|
||||||
wxString message ;
|
wxString message ;
|
||||||
|
|
||||||
m_printData = printdata ;
|
m_printData = printdata ;
|
||||||
m_printData.ConvertToNative() ;
|
m_printData.ConvertToNative() ;
|
||||||
|
|
||||||
::UMAPrOpen() ;
|
err = UMAPrOpen() ;
|
||||||
err = PrError() ;
|
|
||||||
if ( err )
|
if ( err )
|
||||||
{
|
{
|
||||||
message.Printf( "Print Error %d", err ) ;
|
message.Printf( "Print Error %d", err ) ;
|
||||||
@@ -52,6 +50,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
|
|||||||
UMAPrClose() ;
|
UMAPrClose() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !TARGET_CARBON
|
||||||
if ( ::PrValidate( m_printData.m_macPrintInfo ) )
|
if ( ::PrValidate( m_printData.m_macPrintInfo ) )
|
||||||
{
|
{
|
||||||
::PrStlDialog( m_printData.m_macPrintInfo ) ;
|
::PrStlDialog( m_printData.m_macPrintInfo ) ;
|
||||||
@@ -75,23 +74,37 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
|
|||||||
}
|
}
|
||||||
// sets current port
|
// sets current port
|
||||||
m_macPort = (GrafPtr ) m_macPrintPort ;
|
m_macPort = (GrafPtr ) m_macPrintPort ;
|
||||||
|
#else
|
||||||
|
m_macPrintPort = kPMNoReference ;
|
||||||
|
err = PMBeginDocument(
|
||||||
|
m_printData.m_macPrintSettings,
|
||||||
|
m_printData.m_macPageFormat,
|
||||||
|
&m_macPrintPort);
|
||||||
|
if ( err != noErr || m_macPrintPort == kPMNoReference )
|
||||||
|
{
|
||||||
|
message.Printf( "Print Error %d", err ) ;
|
||||||
|
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||||
|
UMAPrClose() ;
|
||||||
|
}
|
||||||
|
// sets current port
|
||||||
|
::GetPort( &m_macPort ) ;
|
||||||
|
#endif
|
||||||
m_ok = TRUE ;
|
m_ok = TRUE ;
|
||||||
m_minY = m_minX = 0 ;
|
m_minY = m_minX = 0 ;
|
||||||
|
#if TARGET_CARBON
|
||||||
|
#else
|
||||||
m_maxX = (**m_printData.m_macPrintInfo).rPaper.right - (**m_printData.m_macPrintInfo).rPaper.left ;
|
m_maxX = (**m_printData.m_macPrintInfo).rPaper.right - (**m_printData.m_macPrintInfo).rPaper.left ;
|
||||||
m_maxY = (**m_printData.m_macPrintInfo).rPaper.bottom - (**m_printData.m_macPrintInfo).rPaper.top ;
|
m_maxY = (**m_printData.m_macPrintInfo).rPaper.bottom - (**m_printData.m_macPrintInfo).rPaper.top ;
|
||||||
#else
|
|
||||||
#pragma warning "TODO:printing support for carbon"
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPrinterDC::~wxPrinterDC(void)
|
wxPrinterDC::~wxPrinterDC(void)
|
||||||
{
|
{
|
||||||
|
OSStatus err ;
|
||||||
|
wxString message ;
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
if ( m_ok )
|
if ( m_ok )
|
||||||
{
|
{
|
||||||
OSErr err ;
|
|
||||||
wxString message ;
|
|
||||||
|
|
||||||
::PrCloseDoc( m_macPrintPort ) ;
|
::PrCloseDoc( m_macPrintPort ) ;
|
||||||
err = PrError() ;
|
err = PrError() ;
|
||||||
|
|
||||||
@@ -115,7 +128,17 @@ wxPrinterDC::~wxPrinterDC(void)
|
|||||||
m_macPortHelper.Clear() ;
|
m_macPortHelper.Clear() ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#pragma warning "TODO:printing support for carbon"
|
if ( m_ok )
|
||||||
|
{
|
||||||
|
err = PMEndDocument(m_macPrintPort);
|
||||||
|
if ( !err )
|
||||||
|
{
|
||||||
|
message.Printf( "Print Error %d", err ) ;
|
||||||
|
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||||
|
UMAPrClose() ;
|
||||||
|
}
|
||||||
|
UMAPrClose() ;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +153,6 @@ void wxPrinterDC::EndDoc(void)
|
|||||||
|
|
||||||
void wxPrinterDC::StartPage(void)
|
void wxPrinterDC::StartPage(void)
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
|
||||||
if ( !m_ok )
|
if ( !m_ok )
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
@@ -150,11 +172,15 @@ void wxPrinterDC::StartPage(void)
|
|||||||
m_macPenInstalled = false ;
|
m_macPenInstalled = false ;
|
||||||
|
|
||||||
|
|
||||||
OSErr err ;
|
OSStatus err ;
|
||||||
wxString message ;
|
wxString message ;
|
||||||
|
|
||||||
|
#if !TARGET_CARBON
|
||||||
PrOpenPage( m_macPrintPort , NULL ) ;
|
PrOpenPage( m_macPrintPort , NULL ) ;
|
||||||
SetOrigin( - (**m_printData.m_macPrintInfo).rPaper.left , - (**m_printData.m_macPrintInfo).rPaper.top ) ;
|
m_macLocalOrigin.h = (**m_printData.m_macPrintInfo).rPaper.left ;
|
||||||
|
m_macLocalOrigin.v = (**m_printData.m_macPrintInfo).rPaper.top ;
|
||||||
|
|
||||||
|
SetOrigin( - m_macLocalOrigin.h , - m_macLocalOrigin.v ) ;
|
||||||
Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
|
Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
|
||||||
::ClipRect( &clip ) ;
|
::ClipRect( &clip ) ;
|
||||||
err = PrError() ;
|
err = PrError() ;
|
||||||
@@ -169,19 +195,29 @@ void wxPrinterDC::StartPage(void)
|
|||||||
m_ok = FALSE ;
|
m_ok = FALSE ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#pragma warning "TODO:printing support for carbon"
|
err = PMBeginPage(m_macPrintPort, nil);
|
||||||
|
if ( err )
|
||||||
|
{
|
||||||
|
message.Printf( "Print Error %d", err ) ;
|
||||||
|
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||||
|
PMEndPage(m_macPrintPort);
|
||||||
|
PMEndDocument(m_macPrintPort);
|
||||||
|
UMAPrClose() ;
|
||||||
|
::SetPort( macPrintFormerPort ) ;
|
||||||
|
m_ok = FALSE ;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPrinterDC::EndPage(void)
|
void wxPrinterDC::EndPage(void)
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
|
||||||
if ( !m_ok )
|
if ( !m_ok )
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
OSErr err ;
|
OSStatus err ;
|
||||||
wxString message ;
|
wxString message ;
|
||||||
|
|
||||||
|
#if !TARGET_CARBON
|
||||||
PrClosePage( (TPrPort*) m_macPort ) ;
|
PrClosePage( (TPrPort*) m_macPort ) ;
|
||||||
err = PrError() ;
|
err = PrError() ;
|
||||||
if ( err )
|
if ( err )
|
||||||
@@ -194,7 +230,16 @@ void wxPrinterDC::EndPage(void)
|
|||||||
m_ok = FALSE ;
|
m_ok = FALSE ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#pragma warning "TODO:printing support for carbon"
|
err = PMEndPage(m_macPrintPort);
|
||||||
|
if ( err )
|
||||||
|
{
|
||||||
|
message.Printf( "Print Error %d", err ) ;
|
||||||
|
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||||
|
PMEndDocument(m_macPrintPort);
|
||||||
|
UMAPrClose() ;
|
||||||
|
::SetPort( macPrintFormerPort ) ;
|
||||||
|
m_ok = FALSE ;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -20,16 +20,22 @@
|
|||||||
|
|
||||||
#include "wx/cmndata.h"
|
#include "wx/cmndata.h"
|
||||||
|
|
||||||
|
#include "Navigation.h"
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
|
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool gUseNavServices = NavServicesAvailable() ;
|
||||||
|
|
||||||
// the data we need to pass to our standard file hook routine
|
// the data we need to pass to our standard file hook routine
|
||||||
// includes a pointer to the dialog, a pointer to the standard
|
// includes a pointer to the dialog, a pointer to the standard
|
||||||
// file reply record (so we can inspect the current selection)
|
// file reply record (so we can inspect the current selection)
|
||||||
// and a copy of the "previous" file spec of the reply record
|
// and a copy of the "previous" file spec of the reply record
|
||||||
// so we can see if the selection has changed
|
// so we can see if the selection has changed
|
||||||
|
|
||||||
|
#if !TARGET_CARBON
|
||||||
|
|
||||||
struct UserDataRec {
|
struct UserDataRec {
|
||||||
StandardFileReply *sfrPtr;
|
StandardFileReply *sfrPtr;
|
||||||
FSSpec oldSelectionFSSpec;
|
FSSpec oldSelectionFSSpec;
|
||||||
@@ -38,8 +44,6 @@ struct UserDataRec {
|
|||||||
typedef struct UserDataRec
|
typedef struct UserDataRec
|
||||||
UserDataRec, *UserDataRecPtr;
|
UserDataRec, *UserDataRecPtr;
|
||||||
|
|
||||||
#if !TARGET_CARBON
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kSelectItem = 10, // select button item number
|
kSelectItem = 10, // select button item number
|
||||||
kSFGetFolderDlgID = 250, // dialog resource number
|
kSFGetFolderDlgID = 250, // dialog resource number
|
||||||
@@ -307,7 +311,6 @@ static pascal short SFGetFolderDialogHook(short item, DialogPtr theDlgPtr, Ptr d
|
|||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void StandardGetFolder( ConstStr255Param message , ConstStr255Param path , FileFilterYDUPP fileFilter, StandardFileReply *theSFR)
|
void StandardGetFolder( ConstStr255Param message , ConstStr255Param path , FileFilterYDUPP fileFilter, StandardFileReply *theSFR)
|
||||||
{
|
{
|
||||||
@@ -433,6 +436,9 @@ static pascal Boolean OnlyVisibleFoldersCustomFileFilter(CInfoPBPtr myCInfoPBPtr
|
|||||||
return !(visibleFlag && folderFlag);
|
return !(visibleFlag && folderFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
|
wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
|
||||||
const wxString& defaultPath,
|
const wxString& defaultPath,
|
||||||
long style, const wxPoint& pos)
|
long style, const wxPoint& pos)
|
||||||
@@ -445,6 +451,8 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
|
|||||||
|
|
||||||
int wxDirDialog::ShowModal()
|
int wxDirDialog::ShowModal()
|
||||||
{
|
{
|
||||||
|
#if !TARGET_CARBON
|
||||||
|
if ( !gUseNavServices )
|
||||||
{
|
{
|
||||||
Str255 prompt ;
|
Str255 prompt ;
|
||||||
Str255 path ;
|
Str255 path ;
|
||||||
@@ -457,16 +465,15 @@ int wxDirDialog::ShowModal()
|
|||||||
|
|
||||||
StandardFileReply reply ;
|
StandardFileReply reply ;
|
||||||
FileFilterYDUPP invisiblesExcludedCustomFilterUPP = 0 ;
|
FileFilterYDUPP invisiblesExcludedCustomFilterUPP = 0 ;
|
||||||
#if !TARGET_CARBON
|
|
||||||
invisiblesExcludedCustomFilterUPP =
|
invisiblesExcludedCustomFilterUPP =
|
||||||
NewFileFilterYDProc(OnlyVisibleFoldersCustomFileFilter);
|
NewFileFilterYDProc(OnlyVisibleFoldersCustomFileFilter);
|
||||||
#endif
|
|
||||||
|
|
||||||
StandardGetFolder( prompt , path , invisiblesExcludedCustomFilterUPP, &reply);
|
StandardGetFolder( prompt , path , invisiblesExcludedCustomFilterUPP, &reply);
|
||||||
|
|
||||||
#if !TARGET_CARBON
|
|
||||||
DisposeRoutineDescriptor(invisiblesExcludedCustomFilterUPP);
|
DisposeRoutineDescriptor(invisiblesExcludedCustomFilterUPP);
|
||||||
#endif
|
|
||||||
if ( reply.sfGood == false )
|
if ( reply.sfGood == false )
|
||||||
{
|
{
|
||||||
m_path = "" ;
|
m_path = "" ;
|
||||||
@@ -477,7 +484,105 @@ int wxDirDialog::ShowModal()
|
|||||||
m_path = wxMacFSSpec2UnixFilename( &reply.sfFile ) ;
|
m_path = wxMacFSSpec2UnixFilename( &reply.sfFile ) ;
|
||||||
return wxID_OK ;
|
return wxID_OK ;
|
||||||
}
|
}
|
||||||
|
return wxID_CANCEL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
NavDialogOptions mNavOptions;
|
||||||
|
NavObjectFilterUPP mNavFilterUPP = NULL;
|
||||||
|
NavPreviewUPP mNavPreviewUPP = NULL ;
|
||||||
|
NavReplyRecord mNavReply;
|
||||||
|
AEDesc* mDefaultLocation = NULL ;
|
||||||
|
bool mSelectDefault = false ;
|
||||||
|
|
||||||
|
::NavGetDefaultDialogOptions(&mNavOptions);
|
||||||
|
|
||||||
|
mNavFilterUPP = nil;
|
||||||
|
mNavPreviewUPP = nil;
|
||||||
|
mSelectDefault = false;
|
||||||
|
mNavReply.validRecord = false;
|
||||||
|
mNavReply.replacing = false;
|
||||||
|
mNavReply.isStationery = false;
|
||||||
|
mNavReply.translationNeeded = false;
|
||||||
|
mNavReply.selection.descriptorType = typeNull;
|
||||||
|
mNavReply.selection.dataHandle = nil;
|
||||||
|
mNavReply.keyScript = smSystemScript;
|
||||||
|
mNavReply.fileTranslation = nil;
|
||||||
|
|
||||||
|
// Set default location, the location
|
||||||
|
// that's displayed when the dialog
|
||||||
|
// first appears
|
||||||
|
|
||||||
|
if ( mDefaultLocation ) {
|
||||||
|
|
||||||
|
if (mSelectDefault) {
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation;
|
||||||
|
} else {
|
||||||
|
mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OSErr err = ::NavChooseFolder(
|
||||||
|
mDefaultLocation,
|
||||||
|
&mNavReply,
|
||||||
|
&mNavOptions,
|
||||||
|
NULL,
|
||||||
|
mNavFilterUPP,
|
||||||
|
0L); // User Data
|
||||||
|
|
||||||
|
if ( (err != noErr) && (err != userCanceledErr) ) {
|
||||||
|
m_path = "" ;
|
||||||
|
return wxID_CANCEL ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mNavReply.validRecord) { // User chose a folder
|
||||||
|
|
||||||
|
FSSpec folderInfo;
|
||||||
|
FSSpec outFileSpec ;
|
||||||
|
AEDesc specDesc ;
|
||||||
|
|
||||||
|
OSErr err = ::AECoerceDesc( &mNavReply.selection , typeFSS, &specDesc);
|
||||||
|
if ( err != noErr ) {
|
||||||
|
m_path = "" ;
|
||||||
|
return wxID_CANCEL ;
|
||||||
|
}
|
||||||
|
folderInfo = **(FSSpec**) specDesc.dataHandle;
|
||||||
|
if (specDesc.dataHandle != nil) {
|
||||||
|
::AEDisposeDesc(&specDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
// mNavReply.GetFileSpec(folderInfo);
|
||||||
|
|
||||||
|
// The FSSpec from NavChooseFolder is NOT the file spec
|
||||||
|
// for the folder. The parID field is actually the DirID
|
||||||
|
// of the folder itself, not the folder's parent, and
|
||||||
|
// the name field is empty. We must call PBGetCatInfo
|
||||||
|
// to get the parent DirID and folder name
|
||||||
|
|
||||||
|
Str255 name;
|
||||||
|
CInfoPBRec thePB; // Directory Info Parameter Block
|
||||||
|
thePB.dirInfo.ioCompletion = nil;
|
||||||
|
thePB.dirInfo.ioVRefNum = folderInfo.vRefNum; // Volume is right
|
||||||
|
thePB.dirInfo.ioDrDirID = folderInfo.parID; // Folder's DirID
|
||||||
|
thePB.dirInfo.ioNamePtr = name;
|
||||||
|
thePB.dirInfo.ioFDirIndex = -1; // Lookup using Volume and DirID
|
||||||
|
|
||||||
|
err = ::PBGetCatInfoSync(&thePB);
|
||||||
|
if ( err != noErr ) {
|
||||||
|
m_path = "" ;
|
||||||
|
return wxID_CANCEL ;
|
||||||
|
}
|
||||||
|
// Create cannonical FSSpec
|
||||||
|
::FSMakeFSSpec(thePB.dirInfo.ioVRefNum, thePB.dirInfo.ioDrParID,
|
||||||
|
name, &outFileSpec);
|
||||||
|
|
||||||
|
// outFolderDirID = thePB.dirInfo.ioDrDirID;
|
||||||
|
m_path = wxMacFSSpec2UnixFilename( &outFileSpec ) ;
|
||||||
|
return wxID_OK ;
|
||||||
}
|
}
|
||||||
return wxID_CANCEL;
|
return wxID_CANCEL;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,18 +19,55 @@
|
|||||||
#include "wx/filedlg.h"
|
#include "wx/filedlg.h"
|
||||||
#include "wx/intl.h"
|
#include "wx/intl.h"
|
||||||
|
|
||||||
|
#include "PLStringFuncs.h"
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
|
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// begin wxmac
|
// begin wxmac
|
||||||
|
|
||||||
|
#include "Navigation.h"
|
||||||
|
|
||||||
#include "morefile.h"
|
#include "morefile.h"
|
||||||
#include "moreextr.h"
|
#include "moreextr.h"
|
||||||
#include "fullpath.h"
|
#include "fullpath.h"
|
||||||
#include "fspcompa.h"
|
#include "fspcompa.h"
|
||||||
#include "PLStringFuncs.h"
|
#include "PLStringFuncs.h"
|
||||||
|
|
||||||
|
extern bool gUseNavServices ;
|
||||||
|
|
||||||
|
static pascal void NavEventProc(
|
||||||
|
NavEventCallbackMessage inSelector,
|
||||||
|
NavCBRecPtr ioParams,
|
||||||
|
NavCallBackUserData ioUserData);
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
|
static NavEventUPP sStandardNavEventFilter = NewNavEventUPP(NavEventProc);
|
||||||
|
#else
|
||||||
|
static NavEventUPP sStandardNavEventFilter = NewNavEventProc(NavEventProc);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static pascal void
|
||||||
|
NavEventProc(
|
||||||
|
NavEventCallbackMessage inSelector,
|
||||||
|
NavCBRecPtr ioParams,
|
||||||
|
NavCallBackUserData /* ioUserData */)
|
||||||
|
{
|
||||||
|
if (inSelector == kNavCBEvent) {
|
||||||
|
// In Universal Headers 3.2, Apple changed the definition of
|
||||||
|
/*
|
||||||
|
#if UNIVERSAL_INTERFACES_VERSION >= 0x0320 // Universal Headers 3.2
|
||||||
|
UModalAlerts::ProcessModalEvent(*(ioParams->eventData.eventDataParms.event));
|
||||||
|
|
||||||
|
#else
|
||||||
|
UModalAlerts::ProcessModalEvent(*(ioParams->eventData.event));
|
||||||
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char * gfilters[] =
|
char * gfilters[] =
|
||||||
{
|
{
|
||||||
"*.TXT" ,
|
"*.TXT" ,
|
||||||
@@ -189,7 +226,7 @@ static pascal Boolean SFGetFolderModalDialogFilter(DialogPtr theDlgPtr, EventRec
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif !TARGET_CARBON
|
||||||
|
|
||||||
void ExtendedOpenFile( ConstStr255Param message , ConstStr255Param path , const char *filter , FileFilterYDUPP fileFilter, StandardFileReply *theSFR)
|
void ExtendedOpenFile( ConstStr255Param message , ConstStr255Param path , const char *filter , FileFilterYDUPP fileFilter, StandardFileReply *theSFR)
|
||||||
{
|
{
|
||||||
@@ -451,6 +488,9 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
|||||||
|
|
||||||
int wxFileDialog::ShowModal()
|
int wxFileDialog::ShowModal()
|
||||||
{
|
{
|
||||||
|
#if !TARGET_CARBON
|
||||||
|
if ( !gUseNavServices )
|
||||||
|
{
|
||||||
if ( m_dialogStyle & wxSAVE )
|
if ( m_dialogStyle & wxSAVE )
|
||||||
{
|
{
|
||||||
StandardFileReply reply ;
|
StandardFileReply reply ;
|
||||||
@@ -488,7 +528,7 @@ int wxFileDialog::ShowModal()
|
|||||||
strcpy((char *)prompt, m_message) ;
|
strcpy((char *)prompt, m_message) ;
|
||||||
c2pstr((char *)prompt ) ;
|
c2pstr((char *)prompt ) ;
|
||||||
|
|
||||||
strcpy((char *)path, m_path ) ;
|
strcpy((char *)path, m_dir ) ;
|
||||||
c2pstr((char *)path ) ;
|
c2pstr((char *)path ) ;
|
||||||
|
|
||||||
StandardFileReply reply ;
|
StandardFileReply reply ;
|
||||||
@@ -515,6 +555,137 @@ int wxFileDialog::ShowModal()
|
|||||||
}
|
}
|
||||||
return wxID_CANCEL;
|
return wxID_CANCEL;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
NavDialogOptions mNavOptions;
|
||||||
|
NavObjectFilterUPP mNavFilterUPP = NULL;
|
||||||
|
NavPreviewUPP mNavPreviewUPP = NULL ;
|
||||||
|
NavReplyRecord mNavReply;
|
||||||
|
AEDesc mDefaultLocation ;
|
||||||
|
bool mSelectDefault = false ;
|
||||||
|
|
||||||
|
::NavGetDefaultDialogOptions(&mNavOptions);
|
||||||
|
|
||||||
|
mNavFilterUPP = nil;
|
||||||
|
mNavPreviewUPP = nil;
|
||||||
|
mSelectDefault = false;
|
||||||
|
mNavReply.validRecord = false;
|
||||||
|
mNavReply.replacing = false;
|
||||||
|
mNavReply.isStationery = false;
|
||||||
|
mNavReply.translationNeeded = false;
|
||||||
|
mNavReply.selection.descriptorType = typeNull;
|
||||||
|
mNavReply.selection.dataHandle = nil;
|
||||||
|
mNavReply.keyScript = smSystemScript;
|
||||||
|
mNavReply.fileTranslation = nil;
|
||||||
|
|
||||||
|
// Set default location, the location
|
||||||
|
// that's displayed when the dialog
|
||||||
|
// first appears
|
||||||
|
|
||||||
|
FSSpec location ;
|
||||||
|
wxUnixFilename2FSSpec( m_dir , &location ) ;
|
||||||
|
OSErr err = noErr ;
|
||||||
|
|
||||||
|
mDefaultLocation.descriptorType = typeNull;
|
||||||
|
mDefaultLocation.dataHandle = nil;
|
||||||
|
|
||||||
|
err = ::AECreateDesc(typeFSS, &location, sizeof(FSSpec), &mDefaultLocation );
|
||||||
|
|
||||||
|
if ( mDefaultLocation.dataHandle ) {
|
||||||
|
|
||||||
|
if (mSelectDefault) {
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation;
|
||||||
|
} else {
|
||||||
|
mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy((char *)mNavOptions.message, m_message) ;
|
||||||
|
c2pstr((char *)mNavOptions.message ) ;
|
||||||
|
|
||||||
|
strcpy((char *)mNavOptions.savedFileName, m_fileName) ;
|
||||||
|
c2pstr((char *)mNavOptions.savedFileName ) ;
|
||||||
|
|
||||||
|
if ( m_dialogStyle & wxSAVE )
|
||||||
|
{
|
||||||
|
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavNoTypePopup ;
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavDontAutoTranslate ;
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavDontAddTranslateItems ;
|
||||||
|
|
||||||
|
err = ::NavPutFile(
|
||||||
|
&mDefaultLocation,
|
||||||
|
&mNavReply,
|
||||||
|
&mNavOptions,
|
||||||
|
sStandardNavEventFilter ,
|
||||||
|
'TEXT',
|
||||||
|
'TEXT',
|
||||||
|
0L); // User Data
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( m_dialogStyle & wxMULTIPLE )
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavAllowMultipleFiles ;
|
||||||
|
else
|
||||||
|
mNavOptions.dialogOptionFlags &= ~kNavAllowMultipleFiles ;
|
||||||
|
|
||||||
|
err = ::NavGetFile(
|
||||||
|
&mDefaultLocation,
|
||||||
|
&mNavReply,
|
||||||
|
&mNavOptions,
|
||||||
|
sStandardNavEventFilter ,
|
||||||
|
mNavPreviewUPP,
|
||||||
|
mNavFilterUPP,
|
||||||
|
0L /*inFileTypes.TypeListHandle() */,
|
||||||
|
0L); // User Data
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( mDefaultLocation.dataHandle != nil )
|
||||||
|
{
|
||||||
|
::AEDisposeDesc(&mDefaultLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (err != noErr) && (err != userCanceledErr) ) {
|
||||||
|
m_path = "" ;
|
||||||
|
return wxID_CANCEL ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mNavReply.validRecord) {
|
||||||
|
|
||||||
|
FSSpec outFileSpec ;
|
||||||
|
AEDesc specDesc ;
|
||||||
|
|
||||||
|
long count ;
|
||||||
|
::AECountItems( &mNavReply.selection , &count ) ;
|
||||||
|
for ( long i = 1 ; i <= count ; ++i )
|
||||||
|
{
|
||||||
|
OSErr err = ::AEGetNthDesc( &mNavReply.selection , i , typeFSS, NULL , &specDesc);
|
||||||
|
if ( err != noErr ) {
|
||||||
|
m_path = "" ;
|
||||||
|
return wxID_CANCEL ;
|
||||||
|
}
|
||||||
|
outFileSpec = **(FSSpec**) specDesc.dataHandle;
|
||||||
|
if (specDesc.dataHandle != nil) {
|
||||||
|
::AEDisposeDesc(&specDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// outFolderDirID = thePB.dirInfo.ioDrDirID;
|
||||||
|
m_path = wxMacFSSpec2UnixFilename( &outFileSpec ) ;
|
||||||
|
m_paths.Add( m_path ) ;
|
||||||
|
m_fileNames.Add(m_fileName);
|
||||||
|
}
|
||||||
|
// set these to the first hit
|
||||||
|
m_path = m_paths[ 0 ] ;
|
||||||
|
m_fileName = wxFileNameFromPath(m_path);
|
||||||
|
m_dir = wxPathOnly(m_path);
|
||||||
|
|
||||||
|
return wxID_OK ;
|
||||||
|
}
|
||||||
|
return wxID_CANCEL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Generic file load/save dialog
|
// Generic file load/save dialog
|
||||||
static wxString
|
static wxString
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/string.h"
|
#include "wx/string.h"
|
||||||
#include "wx/font.h"
|
#include "wx/font.h"
|
||||||
|
#include "wx/fontutil.h"
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
#include "wx/fontutil.h"
|
#include "wx/fontutil.h"
|
||||||
@@ -119,6 +120,12 @@ void wxFont::Init()
|
|||||||
wxTheFontList->Append(this);
|
wxTheFontList->Append(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxFont::Create(const wxNativeFontInfo& info)
|
||||||
|
{
|
||||||
|
return Create(info.pointSize, info.family, info.style, info.weight,
|
||||||
|
info.underlined, info.faceName, info.encoding);
|
||||||
|
}
|
||||||
|
|
||||||
wxFont::wxFont(const wxString& fontdesc)
|
wxFont::wxFont(const wxString& fontdesc)
|
||||||
{
|
{
|
||||||
wxNativeFontInfo info;
|
wxNativeFontInfo info;
|
||||||
@@ -143,12 +150,6 @@ bool wxFont::Create(int pointSize,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFont::Create(const wxNativeFontInfo& info)
|
|
||||||
{
|
|
||||||
return Create(info.pointSize, info.family, info.style, info.weight,
|
|
||||||
info.underlined, info.faceName, info.encoding);
|
|
||||||
}
|
|
||||||
|
|
||||||
wxFont::~wxFont()
|
wxFont::~wxFont()
|
||||||
{
|
{
|
||||||
if (wxTheFontList)
|
if (wxTheFontList)
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/fontenum.h"
|
#include "wx/fontenum.h"
|
||||||
|
#include "wx/fontutil.h"
|
||||||
#include "wx/fontmap.h"
|
#include "wx/fontmap.h"
|
||||||
#include "wx/fontutil.h"
|
#include "wx/fontutil.h"
|
||||||
|
|
||||||
|
@@ -199,8 +199,9 @@ wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
|
|||||||
{
|
{
|
||||||
wxStatusBar *statusBar = NULL;
|
wxStatusBar *statusBar = NULL;
|
||||||
|
|
||||||
statusBar = new wxStatusBar(this, id, style, name);
|
statusBar = new wxStatusBar(this, id,
|
||||||
|
style, name);
|
||||||
|
statusBar->SetSize( 100 , 15 ) ;
|
||||||
statusBar->SetFieldsCount(number);
|
statusBar->SetFieldsCount(number);
|
||||||
return statusBar;
|
return statusBar;
|
||||||
}
|
}
|
||||||
@@ -216,7 +217,7 @@ void wxFrame::PositionStatusBar()
|
|||||||
|
|
||||||
// Since we wish the status bar to be directly under the client area,
|
// Since we wish the status bar to be directly under the client area,
|
||||||
// we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
|
// we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
|
||||||
m_frameStatusBar->SetSize(0, h, w, WX_MAC_STATUSBAR_HEIGHT );
|
m_frameStatusBar->SetSize(0, h, w, sh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,8 +297,7 @@ void wxFrame::DoGetClientSize(int *x, int *y) const
|
|||||||
{
|
{
|
||||||
int statusX, statusY;
|
int statusX, statusY;
|
||||||
GetStatusBar()->GetClientSize(&statusX, &statusY);
|
GetStatusBar()->GetClientSize(&statusX, &statusY);
|
||||||
// right now this is a constant, this might change someday
|
*y -= statusY;
|
||||||
*y -= WX_MAC_STATUSBAR_HEIGHT ;
|
|
||||||
}
|
}
|
||||||
#endif // wxUSE_STATUSBAR
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
|
@@ -180,6 +180,7 @@ int wxListBox::DoAppend(const wxString& item)
|
|||||||
m_dataArray.Add( NULL );
|
m_dataArray.Add( NULL );
|
||||||
}
|
}
|
||||||
m_noItems ++;
|
m_noItems ++;
|
||||||
|
DoSetItemClientData( index , NULL ) ;
|
||||||
MacAppend( item ) ;
|
MacAppend( item ) ;
|
||||||
|
|
||||||
return index ;
|
return index ;
|
||||||
@@ -255,6 +256,16 @@ int wxListBox::FindString(const wxString& st) const
|
|||||||
if ( EqualString( s1 , s2 , false , false ) )
|
if ( EqualString( s1 , s2 , false , false ) )
|
||||||
return i ;
|
return i ;
|
||||||
}
|
}
|
||||||
|
if ( s.Left(1) = "*" && s.Length() > 1 )
|
||||||
|
{
|
||||||
|
s.MakeLower() ;
|
||||||
|
for ( int i = 0 ; i < m_noItems ; ++i )
|
||||||
|
{
|
||||||
|
if ( GetString(i).Lower().Matches(s) )
|
||||||
|
return i ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -700,8 +700,37 @@ void wxMenuBar::MacInstallMenuBar()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if( m_titles[i] == "?" || m_titles[i] == "&?" || m_titles[i] == wxApp::s_macHelpMenuTitleName )
|
||||||
|
{
|
||||||
|
wxMenuItem::MacBuildMenuString( label, NULL , NULL , m_titles[i] , false );
|
||||||
|
UMASetMenuTitle( menu->GetHMenu() , label ) ;
|
||||||
|
|
||||||
|
for (pos = 0 , node = menu->GetMenuItems().First(); node; node = node->Next(), pos++)
|
||||||
|
{
|
||||||
|
item = (wxMenuItem *)node->Data();
|
||||||
|
subMenu = item->GetSubMenu() ;
|
||||||
|
if (subMenu)
|
||||||
|
{
|
||||||
|
UMAInsertMenu( subMenu->GetHMenu() , -1 ) ;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if ( item->GetId() == wxApp::s_macAboutMenuItemId )
|
||||||
|
{
|
||||||
|
Str255 label ;
|
||||||
|
UInt8 modifiers ;
|
||||||
|
SInt16 key ;
|
||||||
|
wxMenuItem::MacBuildMenuString( label, &key , &modifiers , item->GetText(), item->GetId() != wxApp::s_macAboutMenuItemId); // no shortcut in about menu
|
||||||
|
UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , label );
|
||||||
|
UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UMAInsertMenu(m_menus[i]->GetHMenu(), 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
else
|
||||||
{
|
{
|
||||||
wxMenuItem::MacBuildMenuString( label, NULL , NULL , m_titles[i] , false );
|
wxMenuItem::MacBuildMenuString( label, NULL , NULL , m_titles[i] , false );
|
||||||
UMASetMenuTitle( menu->GetHMenu() , label ) ;
|
UMASetMenuTitle( menu->GetHMenu() , label ) ;
|
||||||
|
@@ -42,6 +42,9 @@ const short kwxMacTabBottomMargin = 16 ;
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARIES
|
#if !USE_SHARED_LIBRARIES
|
||||||
|
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
|
||||||
|
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
|
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
|
||||||
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
|
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
|
||||||
|
|
||||||
|
@@ -136,7 +136,6 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
|||||||
// Create an abort window
|
// Create an abort window
|
||||||
wxBeginBusyCursor();
|
wxBeginBusyCursor();
|
||||||
|
|
||||||
/*
|
|
||||||
wxWindow *win = CreateAbortWindow(parent, printout);
|
wxWindow *win = CreateAbortWindow(parent, printout);
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
@@ -149,7 +148,6 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
|||||||
sm_abortWindow = win;
|
sm_abortWindow = win;
|
||||||
sm_abortWindow->Show(TRUE);
|
sm_abortWindow->Show(TRUE);
|
||||||
wxYield();
|
wxYield();
|
||||||
*/
|
|
||||||
|
|
||||||
printout->OnBeginPrinting();
|
printout->OnBeginPrinting();
|
||||||
|
|
||||||
@@ -178,6 +176,11 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
GrafPtr thePort ;
|
||||||
|
GetPort( &thePort ) ;
|
||||||
|
wxYield() ;
|
||||||
|
SetPort( thePort ) ;
|
||||||
|
|
||||||
dc->StartPage();
|
dc->StartPage();
|
||||||
keepGoing = printout->OnPrintPage(pn);
|
keepGoing = printout->OnPrintPage(pn);
|
||||||
dc->EndPage();
|
dc->EndPage();
|
||||||
|
@@ -111,6 +111,14 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
wxString value ;
|
wxString value ;
|
||||||
|
|
||||||
|
{
|
||||||
|
TEHandle teH ;
|
||||||
|
long size ;
|
||||||
|
|
||||||
|
UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ;
|
||||||
|
(*teH)->lineHeight = -1 ;
|
||||||
|
}
|
||||||
|
|
||||||
if( wxApp::s_macDefaultEncodingIsPC )
|
if( wxApp::s_macDefaultEncodingIsPC )
|
||||||
value = wxMacMakeMacStringFromPC( st ) ;
|
value = wxMacMakeMacStringFromPC( st ) ;
|
||||||
else
|
else
|
||||||
@@ -152,8 +160,7 @@ void wxTextCtrl::SetValue(const wxString& st)
|
|||||||
else
|
else
|
||||||
value = st ;
|
value = st ;
|
||||||
UMASetControlData( m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ;
|
UMASetControlData( m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ;
|
||||||
Refresh() ;
|
UMADrawControl( m_macControl ) ;
|
||||||
// MacInvalidateControl() ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clipboard operations
|
// Clipboard operations
|
||||||
@@ -208,7 +215,7 @@ void wxTextCtrl::Paste()
|
|||||||
UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ;
|
UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ;
|
||||||
TEFromScrap() ;
|
TEFromScrap() ;
|
||||||
TEPaste( teH ) ;
|
TEPaste( teH ) ;
|
||||||
// MacInvalidateControl() ;
|
UMADrawControl( m_macControl ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -801,9 +801,11 @@ bool wxThreadModule::OnInit()
|
|||||||
long response;
|
long response;
|
||||||
bool hasThreadManager ;
|
bool hasThreadManager ;
|
||||||
hasThreadManager = Gestalt( gestaltThreadMgrAttr, &response) == noErr && response & 1;
|
hasThreadManager = Gestalt( gestaltThreadMgrAttr, &response) == noErr && response & 1;
|
||||||
#if TARGET_RT_MAC_CFM
|
#if !TARGET_CARBON
|
||||||
|
#if GENERATINGCFM
|
||||||
// verify presence of shared library
|
// verify presence of shared library
|
||||||
hasThreadManager = hasThreadManager && ((Ptr)NewThread != (Ptr)kUnresolvedCFragSymbolAddress);
|
hasThreadManager = hasThreadManager && ((Ptr)NewThread != (Ptr)kUnresolvedCFragSymbolAddress);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if ( !hasThreadManager )
|
if ( !hasThreadManager )
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
#include <wx/mac/uma.h>
|
#include <wx/mac/uma.h>
|
||||||
#include <wx/mac/aga.h>
|
#include <wx/mac/aga.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include "Navigation.h"
|
||||||
|
|
||||||
// init
|
// init
|
||||||
|
|
||||||
static bool sUMAHasAppearance = false ;
|
static bool sUMAHasAppearance = false ;
|
||||||
@@ -14,7 +17,19 @@ static long sUMAWindowManagerAttr = 0 ;
|
|||||||
|
|
||||||
bool UMAHasWindowManager() { return sUMAHasWindowManager ; }
|
bool UMAHasWindowManager() { return sUMAHasWindowManager ; }
|
||||||
long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr ; }
|
long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr ; }
|
||||||
|
void UMACleanupToolbox()
|
||||||
|
{
|
||||||
|
#if UMA_USE_APPEARANCE
|
||||||
|
if ( sUMAHasAppearance )
|
||||||
|
{
|
||||||
|
UnregisterAppearanceClient() ;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if ( NavServicesAvailable() )
|
||||||
|
{
|
||||||
|
NavUnload() ;
|
||||||
|
}
|
||||||
|
}
|
||||||
void UMAInitToolbox( UInt16 inMoreMastersCalls )
|
void UMAInitToolbox( UInt16 inMoreMastersCalls )
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
@@ -24,7 +39,6 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls )
|
|||||||
|
|
||||||
::InitGraf(&qd.thePort);
|
::InitGraf(&qd.thePort);
|
||||||
::InitFonts();
|
::InitFonts();
|
||||||
::InitWindows();
|
|
||||||
::InitMenus();
|
::InitMenus();
|
||||||
::TEInit();
|
::TEInit();
|
||||||
::InitDialogs(0L);
|
::InitDialogs(0L);
|
||||||
@@ -60,6 +74,16 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls )
|
|||||||
}
|
}
|
||||||
#endif // UMA_USE_WINDOWMGR
|
#endif // UMA_USE_WINDOWMGR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if ( sUMAHasWindowManager )
|
||||||
|
InitFloatingWindows() ;
|
||||||
|
else
|
||||||
|
InitWindows();
|
||||||
|
|
||||||
|
if ( NavServicesAvailable() )
|
||||||
|
{
|
||||||
|
NavLoad() ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// process manager
|
// process manager
|
||||||
@@ -250,7 +274,7 @@ void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId )
|
|||||||
|
|
||||||
int gPrOpenCounter = 0 ;
|
int gPrOpenCounter = 0 ;
|
||||||
|
|
||||||
void UMAPrOpen()
|
OSStatus UMAPrOpen()
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
OSErr err = noErr ;
|
OSErr err = noErr ;
|
||||||
@@ -261,12 +285,20 @@ void UMAPrOpen()
|
|||||||
err = PrError() ;
|
err = PrError() ;
|
||||||
wxASSERT( err == noErr ) ;
|
wxASSERT( err == noErr ) ;
|
||||||
}
|
}
|
||||||
|
return err ;
|
||||||
#else
|
#else
|
||||||
#pragma warning "TODO Printing for Carbon"
|
OSStatus err = noErr ;
|
||||||
|
++gPrOpenCounter ;
|
||||||
|
if ( gPrOpenCounter == 1 )
|
||||||
|
{
|
||||||
|
err = PMBegin() ;
|
||||||
|
wxASSERT( err == noErr ) ;
|
||||||
|
}
|
||||||
|
return err ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMAPrClose()
|
OSStatus UMAPrClose()
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
OSErr err = noErr ;
|
OSErr err = noErr ;
|
||||||
@@ -278,8 +310,16 @@ void UMAPrClose()
|
|||||||
wxASSERT( err == noErr ) ;
|
wxASSERT( err == noErr ) ;
|
||||||
}
|
}
|
||||||
--gPrOpenCounter ;
|
--gPrOpenCounter ;
|
||||||
|
return err ;
|
||||||
#else
|
#else
|
||||||
#pragma warning "TODO Printing for Carbon"
|
OSStatus err = noErr ;
|
||||||
|
wxASSERT( gPrOpenCounter >= 1 ) ;
|
||||||
|
if ( gPrOpenCounter == 1 )
|
||||||
|
{
|
||||||
|
err = PMEnd() ;
|
||||||
|
}
|
||||||
|
--gPrOpenCounter ;
|
||||||
|
return err ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,6 +47,14 @@ bool wxGetUserId(char *buf, int maxSize)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wxChar* wxGetHomeDir(wxString *pstr)
|
||||||
|
{
|
||||||
|
*pstr = wxMacFindFolder( (short) kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder ) ;
|
||||||
|
return pstr->c_str() ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Get user name e.g. AUTHOR
|
// Get user name e.g. AUTHOR
|
||||||
bool wxGetUserName(char *buf, int maxSize)
|
bool wxGetUserName(char *buf, int maxSize)
|
||||||
{
|
{
|
||||||
|
@@ -18,12 +18,12 @@
|
|||||||
#include "wx/mac/wave.h"
|
#include "wx/mac/wave.h"
|
||||||
|
|
||||||
wxWave::wxWave()
|
wxWave::wxWave()
|
||||||
: m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
|
: m_hSnd(NULL), m_waveLength(0), m_isResource(true), m_sndChan(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWave::wxWave(const wxString& sFileName, bool isResource)
|
wxWave::wxWave(const wxString& sFileName, bool isResource)
|
||||||
: m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
|
: m_hSnd(NULL), m_waveLength(0), m_isResource(true), m_sndChan(0)
|
||||||
{
|
{
|
||||||
Create(sFileName, isResource);
|
Create(sFileName, isResource);
|
||||||
}
|
}
|
||||||
@@ -34,28 +34,196 @@ wxWave::~wxWave()
|
|||||||
Free();
|
Free();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool wxWave::Create(const wxString& fileName, bool isResource)
|
bool wxWave::Create(const wxString& fileName, bool isResource)
|
||||||
{
|
{
|
||||||
Free();
|
bool ret = false;
|
||||||
|
m_sndname = fileName;
|
||||||
|
m_isResource = isResource;
|
||||||
|
|
||||||
// TODO
|
if (m_isResource)
|
||||||
|
ret = true;
|
||||||
|
else
|
||||||
|
{ /*
|
||||||
|
if (sndChan)
|
||||||
|
{ // we're playing
|
||||||
|
FSClose(SndRefNum);
|
||||||
|
SndRefNum = 0;
|
||||||
|
SndDisposeChannel(sndChan, TRUE);
|
||||||
|
free(sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
KillTimer(0,timerID);
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
if (!lpSnd)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (_access(lpSnd,0)) // no file, no service
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Allocate SndChannel
|
||||||
|
sndChan = (SndChannelPtr) malloc (sizeof(SndChannel));
|
||||||
|
|
||||||
|
if (!sndChan)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
sndChan->qLength = 128;
|
||||||
|
|
||||||
|
if (noErr != SndNewChannel (&sndChan, sampledSynth, initMono | initNoInterp, 0))
|
||||||
|
{
|
||||||
|
free(sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(SndRefNum = MacOpenSndFile ((char *)lpSnd)))
|
||||||
|
{
|
||||||
|
SndDisposeChannel(sndChan, TRUE);
|
||||||
|
free(sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool async = false;
|
||||||
|
|
||||||
|
if (fdwSound & SND_ASYNC)
|
||||||
|
async = true;
|
||||||
|
|
||||||
|
if (SndStartFilePlay(sndChan, SndRefNum, 0, 81920, 0, 0, 0, async) != noErr)
|
||||||
|
{
|
||||||
|
FSClose (SndRefNum);
|
||||||
|
SndRefNum = 0;
|
||||||
|
SndDisposeChannel (sndChan, TRUE);
|
||||||
|
free (sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (async)
|
||||||
|
{ // haven't finish yet
|
||||||
|
timerID = SetTimer(0, 0, 250, TimerCallBack);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FSClose (SndRefNum);
|
||||||
|
SndRefNum = 0;
|
||||||
|
SndDisposeChannel (sndChan, TRUE);
|
||||||
|
free (sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//don't know what to do with looped, wth
|
||||||
bool wxWave::Play(bool async, bool looped) const
|
bool wxWave::Play(bool async, bool looped) const
|
||||||
{
|
{
|
||||||
if (!IsOk())
|
char lpSnd[32];
|
||||||
return FALSE;
|
bool ret = false;
|
||||||
|
|
||||||
// TODO
|
if (m_isResource)
|
||||||
return FALSE;
|
{
|
||||||
|
strcpy(lpSnd, m_sndname);
|
||||||
|
c2pstr((char *) lpSnd);
|
||||||
|
SndListHandle hSnd;
|
||||||
|
|
||||||
|
hSnd = (SndListHandle) GetNamedResource('snd ',(const unsigned char *) lpSnd);
|
||||||
|
|
||||||
|
if ((hSnd != NULL) && (SndPlay(m_sndChan, hSnd, async) == noErr))
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool wxWave::Free()
|
bool wxWave::Free()
|
||||||
{
|
{
|
||||||
// TODO
|
bool ret = false;
|
||||||
return FALSE;
|
|
||||||
|
if (m_isResource)
|
||||||
|
{
|
||||||
|
m_sndname.Empty();
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//TODO,
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//code below is from an old implementation used for telinfo with MSVC crossplatform support
|
||||||
|
//technology proceeds, so it would be the wisest to drop this code, but it's left here just
|
||||||
|
//for the sake of a reference. BTW: Wave files can now be played with QT, starting from V3
|
||||||
|
|
||||||
|
/*static short MacOpenSndFile (char * path)
|
||||||
|
{
|
||||||
|
VolumeParam vp;
|
||||||
|
FSSpec fspec;
|
||||||
|
Str255 name;
|
||||||
|
char *c;
|
||||||
|
|
||||||
|
// first, get the volume reference number for the file. Start by
|
||||||
|
// making a Pstring with just the volume name
|
||||||
|
strcpy ((char *) name, path);
|
||||||
|
if (c = strchr ((char *) name, ':'))
|
||||||
|
{
|
||||||
|
c++;
|
||||||
|
*c = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
c2pstr ((char *) name);
|
||||||
|
vp.ioCompletion = 0;
|
||||||
|
vp.ioVolIndex = -1;
|
||||||
|
vp.ioNamePtr = name;
|
||||||
|
vp.ioVRefNum = 0;
|
||||||
|
|
||||||
|
if (PBGetVInfo((ParamBlockRec *)&vp, 0) != noErr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// next, buld an FSSpec for the file
|
||||||
|
strcpy ((char *) name, path);
|
||||||
|
c2pstr ((char *) name);
|
||||||
|
if (FSMakeFSSpec (vp.ioVRefNum, 0, name, &fspec) != noErr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
short frefnum;
|
||||||
|
// now open the file, and return it's reference number
|
||||||
|
if (FSpOpenDF(&fspec, fsRdPerm, &frefnum) != noErr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return frefnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TimerCallBack(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime)
|
||||||
|
{
|
||||||
|
if(!sndChan)
|
||||||
|
{
|
||||||
|
KillTimer(0,timerID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCStatus scstat;
|
||||||
|
|
||||||
|
if (noErr == SndChannelStatus (sndChan, sizeof (SCStatus), &scstat)) {
|
||||||
|
if (scstat.scChannelPaused || scstat.scChannelBusy)
|
||||||
|
return; // not done yet
|
||||||
|
}
|
||||||
|
|
||||||
|
// either error or done.
|
||||||
|
FSClose (SndRefNum);
|
||||||
|
SndRefNum = 0;
|
||||||
|
SndDisposeChannel (sndChan, TRUE);
|
||||||
|
free (sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
KillTimer(0,timerID);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -437,8 +437,8 @@ void wxWindow::DoGetClientSize(int *x, int *y) const
|
|||||||
*x = m_width ;
|
*x = m_width ;
|
||||||
*y = m_height ;
|
*y = m_height ;
|
||||||
|
|
||||||
*x -= 2 * MacGetBorderSize( ) ;
|
*x -= MacGetLeftBorderSize( ) + MacGetRightBorderSize( ) ;
|
||||||
*y -= 2 * MacGetBorderSize( ) ;
|
*y -= MacGetTopBorderSize( ) + MacGetBottomBorderSize( );
|
||||||
|
|
||||||
if ( (m_vScrollBar && m_vScrollBar->IsShown()) || (m_hScrollBar && m_hScrollBar->IsShown()) )
|
if ( (m_vScrollBar && m_vScrollBar->IsShown()) || (m_hScrollBar && m_hScrollBar->IsShown()) )
|
||||||
{
|
{
|
||||||
@@ -627,7 +627,7 @@ void wxWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
|
|
||||||
wxPoint wxWindow::GetClientAreaOrigin() const
|
wxPoint wxWindow::GetClientAreaOrigin() const
|
||||||
{
|
{
|
||||||
return wxPoint(MacGetBorderSize( ) , MacGetBorderSize( ) );
|
return wxPoint(MacGetLeftBorderSize( ) , MacGetTopBorderSize( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Makes an adjustment to the window position (for example, a frame that has
|
// Makes an adjustment to the window position (for example, a frame that has
|
||||||
@@ -725,7 +725,7 @@ void wxWindow::GetTextExtent(const wxString& string, int *x, int *y,
|
|||||||
if ( !fontToUse )
|
if ( !fontToUse )
|
||||||
fontToUse = &m_font;
|
fontToUse = &m_font;
|
||||||
|
|
||||||
wxClientDC dc( this ) ;
|
wxClientDC dc( (wxWindow*) this ) ;
|
||||||
long lx,ly,ld,le ;
|
long lx,ly,ld,le ;
|
||||||
dc.GetTextExtent( string , &lx , &ly , &ld, &le, fontToUse ) ;
|
dc.GetTextExtent( string , &lx , &ly , &ld, &le, fontToUse ) ;
|
||||||
if ( externalLeading )
|
if ( externalLeading )
|
||||||
@@ -1417,8 +1417,8 @@ void wxWindow::DoSetClientSize(int width, int height)
|
|||||||
if ( height != -1 && m_vScrollBar )
|
if ( height != -1 && m_vScrollBar )
|
||||||
height += MAC_SCROLLBAR_SIZE ;
|
height += MAC_SCROLLBAR_SIZE ;
|
||||||
|
|
||||||
width += 2 * MacGetBorderSize( ) ;
|
width += MacGetLeftBorderSize( ) + MacGetRightBorderSize( ) ;
|
||||||
height += 2 * MacGetBorderSize( ) ;
|
height += MacGetTopBorderSize( ) + MacGetBottomBorderSize( ) ;
|
||||||
|
|
||||||
DoSetSize( -1 , -1 , width , height ) ;
|
DoSetSize( -1 , -1 , width , height ) ;
|
||||||
}
|
}
|
||||||
@@ -1443,7 +1443,8 @@ bool wxWindow::MacGetWindowFromPointSub( const wxPoint &point , wxWindow** outWi
|
|||||||
for (wxNode *node = GetChildren().First(); node; node = node->Next())
|
for (wxNode *node = GetChildren().First(); node; node = node->Next())
|
||||||
{
|
{
|
||||||
wxWindow *child = (wxWindow*)node->Data();
|
wxWindow *child = (wxWindow*)node->Data();
|
||||||
if ( child->GetMacRootWindow() == window )
|
// added the m_isShown test --dmazzoni
|
||||||
|
if ( child->GetMacRootWindow() == window && child->m_isShown )
|
||||||
{
|
{
|
||||||
if (child->MacGetWindowFromPointSub(newPoint , outWin ))
|
if (child->MacGetWindowFromPointSub(newPoint , outWin ))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -1462,9 +1463,12 @@ bool wxWindow::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindow** ou
|
|||||||
{
|
{
|
||||||
wxPoint point( screenpoint ) ;
|
wxPoint point( screenpoint ) ;
|
||||||
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
||||||
|
if ( win )
|
||||||
|
{
|
||||||
win->ScreenToClient( point ) ;
|
win->ScreenToClient( point ) ;
|
||||||
return win->MacGetWindowFromPointSub( point , outWin ) ;
|
return win->MacGetWindowFromPointSub( point , outWin ) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return FALSE ;
|
return FALSE ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1907,8 +1911,8 @@ void wxWindow::MacRepositionScrollBars()
|
|||||||
int width = m_width ;
|
int width = m_width ;
|
||||||
int height = m_height ;
|
int height = m_height ;
|
||||||
|
|
||||||
width -= 2 * MacGetBorderSize() ;
|
width -= MacGetLeftBorderSize() + MacGetRightBorderSize();
|
||||||
height -= 2 * MacGetBorderSize() ;
|
height -= MacGetTopBorderSize() + MacGetBottomBorderSize();
|
||||||
|
|
||||||
wxPoint vPoint(width-MAC_SCROLLBAR_SIZE, 0) ;
|
wxPoint vPoint(width-MAC_SCROLLBAR_SIZE, 0) ;
|
||||||
wxSize vSize(MAC_SCROLLBAR_SIZE, height - adjust) ;
|
wxSize vSize(MAC_SCROLLBAR_SIZE, height - adjust) ;
|
||||||
@@ -2183,7 +2187,7 @@ void wxWindow::MacGetPortClientParams(Point* localOrigin, Rect* clipRect, Window
|
|||||||
SectRect(clipRect, &myClip, clipRect);
|
SectRect(clipRect, &myClip, clipRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxWindow::MacGetBorderSize( ) const
|
long wxWindow::MacGetLeftBorderSize( ) const
|
||||||
{
|
{
|
||||||
if( m_macWindowData )
|
if( m_macWindowData )
|
||||||
return 0 ;
|
return 0 ;
|
||||||
@@ -2203,6 +2207,66 @@ long wxWindow::MacGetBorderSize( ) const
|
|||||||
return 0 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long wxWindow::MacGetRightBorderSize( ) const
|
||||||
|
{
|
||||||
|
if( m_macWindowData )
|
||||||
|
return 0 ;
|
||||||
|
|
||||||
|
if (m_windowStyle & wxRAISED_BORDER || m_windowStyle & wxSUNKEN_BORDER )
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
else if ( m_windowStyle &wxDOUBLE_BORDER)
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
else if (m_windowStyle &wxSIMPLE_BORDER)
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
return 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
long wxWindow::MacGetTopBorderSize( ) const
|
||||||
|
{
|
||||||
|
if( m_macWindowData )
|
||||||
|
return 0 ;
|
||||||
|
|
||||||
|
if (m_windowStyle & wxRAISED_BORDER || m_windowStyle & wxSUNKEN_BORDER )
|
||||||
|
{
|
||||||
|
return 2 ;
|
||||||
|
}
|
||||||
|
else if ( m_windowStyle &wxDOUBLE_BORDER)
|
||||||
|
{
|
||||||
|
return 2 ;
|
||||||
|
}
|
||||||
|
else if (m_windowStyle &wxSIMPLE_BORDER)
|
||||||
|
{
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
return 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
long wxWindow::MacGetBottomBorderSize( ) const
|
||||||
|
{
|
||||||
|
if( m_macWindowData )
|
||||||
|
return 0 ;
|
||||||
|
|
||||||
|
if (m_windowStyle & wxRAISED_BORDER || m_windowStyle & wxSUNKEN_BORDER )
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
else if ( m_windowStyle &wxDOUBLE_BORDER)
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
else if (m_windowStyle &wxSIMPLE_BORDER)
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
return 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
long wxWindow::MacRemoveBordersFromStyle( long style )
|
long wxWindow::MacRemoveBordersFromStyle( long style )
|
||||||
{
|
{
|
||||||
return style & ~( wxDOUBLE_BORDER | wxSUNKEN_BORDER | wxRAISED_BORDER | wxBORDER | wxSTATIC_BORDER ) ;
|
return style & ~( wxDOUBLE_BORDER | wxSUNKEN_BORDER | wxRAISED_BORDER | wxBORDER | wxSTATIC_BORDER ) ;
|
||||||
|
@@ -21,6 +21,14 @@
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
short nextMenuId = 100 ; // wxMenu takes the lower ids
|
||||||
|
|
||||||
|
wxChoice::~wxChoice()
|
||||||
|
{
|
||||||
|
// DeleteMenu( m_macPopUpMenuId ) ;
|
||||||
|
DisposeMenu( m_macPopUpMenuHandle ) ;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
@@ -35,6 +43,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
|
MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
|
||||||
|
|
||||||
|
m_macPopUpMenuHandle = NewMenu( 1 , "\pPopUp Menu" ) ;
|
||||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , -12345 , 0 ,
|
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , -12345 , 0 ,
|
||||||
kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ;
|
kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ;
|
||||||
|
|
||||||
|
@@ -394,11 +394,11 @@ resource 'ldes' ( 128 )
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
resource 'CURS' (9, "Hand") {
|
resource 'CURS' (9, "Hand") {
|
||||||
$"01 80 1A 70 26 48 26 4A 12 4D 12 49 68 09 98 01"
|
$"0380 04C0 04C0 04C0 04C0 04C0 74F8 9CAE"
|
||||||
$"88 02 40 02 20 02 20 04 10 04 08 08 04 08 04 08",
|
$"4CAB 240B 2403 1003 0803 0806 0406 0406",
|
||||||
$"01 80 1B F0 3F F8 3F FA 1F FF 1F FF 7F FF FF FF"
|
$"0380 07C0 07C0 07C0 07C0 07C0 77F8 FFFE"
|
||||||
$"FF FE 7F FE 3F FE 3F FC 1F FC 0F F8 07 F8 07 F8",
|
$"7FFF 3FFF 3FFF 1FFF 0FFF 0FFE 07FE 07FE",
|
||||||
{9, 8}
|
{0, 7}
|
||||||
};
|
};
|
||||||
|
|
||||||
resource 'CURS' (10, "SizeWE") {
|
resource 'CURS' (10, "SizeWE") {
|
||||||
|
@@ -16,6 +16,10 @@
|
|||||||
#include "wx/dc.h"
|
#include "wx/dc.h"
|
||||||
#include "wx/mac/uma.h"
|
#include "wx/mac/uma.h"
|
||||||
|
|
||||||
|
#if __MSL__ >= 0x6000
|
||||||
|
#include "math.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
||||||
#endif
|
#endif
|
||||||
@@ -128,7 +132,7 @@ wxDC::~wxDC(void)
|
|||||||
|
|
||||||
void wxDC::MacSetupPort() const
|
void wxDC::MacSetupPort() const
|
||||||
{
|
{
|
||||||
AGAPortHelper* help = &m_macPortHelper ;
|
AGAPortHelper* help = (AGAPortHelper*) &m_macPortHelper ;
|
||||||
help->Setup( m_macPort ) ;
|
help->Setup( m_macPort ) ;
|
||||||
m_macPortId = ++m_macCurrentPortId ;
|
m_macPortId = ++m_macCurrentPortId ;
|
||||||
::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v);
|
::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v);
|
||||||
@@ -427,7 +431,12 @@ void wxDC::ComputeScaleAndOrigin(void)
|
|||||||
// CMB: if scale has changed call SetPen to recalulate the line width
|
// CMB: if scale has changed call SetPen to recalulate the line width
|
||||||
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
|
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
|
||||||
{
|
{
|
||||||
// TODO : set internal flags for recalc
|
// this is a bit artificial, but we need to force wxDC to think
|
||||||
|
// the pen has changed
|
||||||
|
wxPen* pen = & GetPen();
|
||||||
|
wxPen tempPen;
|
||||||
|
m_pen = tempPen;
|
||||||
|
SetPen(* pen);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -36,15 +36,13 @@ GrafPtr macPrintFormerPort = NULL ;
|
|||||||
|
|
||||||
wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
|
wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
OSStatus err ;
|
||||||
OSErr err ;
|
|
||||||
wxString message ;
|
wxString message ;
|
||||||
|
|
||||||
m_printData = printdata ;
|
m_printData = printdata ;
|
||||||
m_printData.ConvertToNative() ;
|
m_printData.ConvertToNative() ;
|
||||||
|
|
||||||
::UMAPrOpen() ;
|
err = UMAPrOpen() ;
|
||||||
err = PrError() ;
|
|
||||||
if ( err )
|
if ( err )
|
||||||
{
|
{
|
||||||
message.Printf( "Print Error %d", err ) ;
|
message.Printf( "Print Error %d", err ) ;
|
||||||
@@ -52,6 +50,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
|
|||||||
UMAPrClose() ;
|
UMAPrClose() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !TARGET_CARBON
|
||||||
if ( ::PrValidate( m_printData.m_macPrintInfo ) )
|
if ( ::PrValidate( m_printData.m_macPrintInfo ) )
|
||||||
{
|
{
|
||||||
::PrStlDialog( m_printData.m_macPrintInfo ) ;
|
::PrStlDialog( m_printData.m_macPrintInfo ) ;
|
||||||
@@ -75,23 +74,37 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
|
|||||||
}
|
}
|
||||||
// sets current port
|
// sets current port
|
||||||
m_macPort = (GrafPtr ) m_macPrintPort ;
|
m_macPort = (GrafPtr ) m_macPrintPort ;
|
||||||
|
#else
|
||||||
|
m_macPrintPort = kPMNoReference ;
|
||||||
|
err = PMBeginDocument(
|
||||||
|
m_printData.m_macPrintSettings,
|
||||||
|
m_printData.m_macPageFormat,
|
||||||
|
&m_macPrintPort);
|
||||||
|
if ( err != noErr || m_macPrintPort == kPMNoReference )
|
||||||
|
{
|
||||||
|
message.Printf( "Print Error %d", err ) ;
|
||||||
|
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||||
|
UMAPrClose() ;
|
||||||
|
}
|
||||||
|
// sets current port
|
||||||
|
::GetPort( &m_macPort ) ;
|
||||||
|
#endif
|
||||||
m_ok = TRUE ;
|
m_ok = TRUE ;
|
||||||
m_minY = m_minX = 0 ;
|
m_minY = m_minX = 0 ;
|
||||||
|
#if TARGET_CARBON
|
||||||
|
#else
|
||||||
m_maxX = (**m_printData.m_macPrintInfo).rPaper.right - (**m_printData.m_macPrintInfo).rPaper.left ;
|
m_maxX = (**m_printData.m_macPrintInfo).rPaper.right - (**m_printData.m_macPrintInfo).rPaper.left ;
|
||||||
m_maxY = (**m_printData.m_macPrintInfo).rPaper.bottom - (**m_printData.m_macPrintInfo).rPaper.top ;
|
m_maxY = (**m_printData.m_macPrintInfo).rPaper.bottom - (**m_printData.m_macPrintInfo).rPaper.top ;
|
||||||
#else
|
|
||||||
#pragma warning "TODO:printing support for carbon"
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPrinterDC::~wxPrinterDC(void)
|
wxPrinterDC::~wxPrinterDC(void)
|
||||||
{
|
{
|
||||||
|
OSStatus err ;
|
||||||
|
wxString message ;
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
if ( m_ok )
|
if ( m_ok )
|
||||||
{
|
{
|
||||||
OSErr err ;
|
|
||||||
wxString message ;
|
|
||||||
|
|
||||||
::PrCloseDoc( m_macPrintPort ) ;
|
::PrCloseDoc( m_macPrintPort ) ;
|
||||||
err = PrError() ;
|
err = PrError() ;
|
||||||
|
|
||||||
@@ -115,7 +128,17 @@ wxPrinterDC::~wxPrinterDC(void)
|
|||||||
m_macPortHelper.Clear() ;
|
m_macPortHelper.Clear() ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#pragma warning "TODO:printing support for carbon"
|
if ( m_ok )
|
||||||
|
{
|
||||||
|
err = PMEndDocument(m_macPrintPort);
|
||||||
|
if ( !err )
|
||||||
|
{
|
||||||
|
message.Printf( "Print Error %d", err ) ;
|
||||||
|
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||||
|
UMAPrClose() ;
|
||||||
|
}
|
||||||
|
UMAPrClose() ;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +153,6 @@ void wxPrinterDC::EndDoc(void)
|
|||||||
|
|
||||||
void wxPrinterDC::StartPage(void)
|
void wxPrinterDC::StartPage(void)
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
|
||||||
if ( !m_ok )
|
if ( !m_ok )
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
@@ -150,11 +172,15 @@ void wxPrinterDC::StartPage(void)
|
|||||||
m_macPenInstalled = false ;
|
m_macPenInstalled = false ;
|
||||||
|
|
||||||
|
|
||||||
OSErr err ;
|
OSStatus err ;
|
||||||
wxString message ;
|
wxString message ;
|
||||||
|
|
||||||
|
#if !TARGET_CARBON
|
||||||
PrOpenPage( m_macPrintPort , NULL ) ;
|
PrOpenPage( m_macPrintPort , NULL ) ;
|
||||||
SetOrigin( - (**m_printData.m_macPrintInfo).rPaper.left , - (**m_printData.m_macPrintInfo).rPaper.top ) ;
|
m_macLocalOrigin.h = (**m_printData.m_macPrintInfo).rPaper.left ;
|
||||||
|
m_macLocalOrigin.v = (**m_printData.m_macPrintInfo).rPaper.top ;
|
||||||
|
|
||||||
|
SetOrigin( - m_macLocalOrigin.h , - m_macLocalOrigin.v ) ;
|
||||||
Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
|
Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
|
||||||
::ClipRect( &clip ) ;
|
::ClipRect( &clip ) ;
|
||||||
err = PrError() ;
|
err = PrError() ;
|
||||||
@@ -169,19 +195,29 @@ void wxPrinterDC::StartPage(void)
|
|||||||
m_ok = FALSE ;
|
m_ok = FALSE ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#pragma warning "TODO:printing support for carbon"
|
err = PMBeginPage(m_macPrintPort, nil);
|
||||||
|
if ( err )
|
||||||
|
{
|
||||||
|
message.Printf( "Print Error %d", err ) ;
|
||||||
|
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||||
|
PMEndPage(m_macPrintPort);
|
||||||
|
PMEndDocument(m_macPrintPort);
|
||||||
|
UMAPrClose() ;
|
||||||
|
::SetPort( macPrintFormerPort ) ;
|
||||||
|
m_ok = FALSE ;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPrinterDC::EndPage(void)
|
void wxPrinterDC::EndPage(void)
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
|
||||||
if ( !m_ok )
|
if ( !m_ok )
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
OSErr err ;
|
OSStatus err ;
|
||||||
wxString message ;
|
wxString message ;
|
||||||
|
|
||||||
|
#if !TARGET_CARBON
|
||||||
PrClosePage( (TPrPort*) m_macPort ) ;
|
PrClosePage( (TPrPort*) m_macPort ) ;
|
||||||
err = PrError() ;
|
err = PrError() ;
|
||||||
if ( err )
|
if ( err )
|
||||||
@@ -194,7 +230,16 @@ void wxPrinterDC::EndPage(void)
|
|||||||
m_ok = FALSE ;
|
m_ok = FALSE ;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#pragma warning "TODO:printing support for carbon"
|
err = PMEndPage(m_macPrintPort);
|
||||||
|
if ( err )
|
||||||
|
{
|
||||||
|
message.Printf( "Print Error %d", err ) ;
|
||||||
|
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||||
|
PMEndDocument(m_macPrintPort);
|
||||||
|
UMAPrClose() ;
|
||||||
|
::SetPort( macPrintFormerPort ) ;
|
||||||
|
m_ok = FALSE ;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -20,16 +20,22 @@
|
|||||||
|
|
||||||
#include "wx/cmndata.h"
|
#include "wx/cmndata.h"
|
||||||
|
|
||||||
|
#include "Navigation.h"
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
|
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool gUseNavServices = NavServicesAvailable() ;
|
||||||
|
|
||||||
// the data we need to pass to our standard file hook routine
|
// the data we need to pass to our standard file hook routine
|
||||||
// includes a pointer to the dialog, a pointer to the standard
|
// includes a pointer to the dialog, a pointer to the standard
|
||||||
// file reply record (so we can inspect the current selection)
|
// file reply record (so we can inspect the current selection)
|
||||||
// and a copy of the "previous" file spec of the reply record
|
// and a copy of the "previous" file spec of the reply record
|
||||||
// so we can see if the selection has changed
|
// so we can see if the selection has changed
|
||||||
|
|
||||||
|
#if !TARGET_CARBON
|
||||||
|
|
||||||
struct UserDataRec {
|
struct UserDataRec {
|
||||||
StandardFileReply *sfrPtr;
|
StandardFileReply *sfrPtr;
|
||||||
FSSpec oldSelectionFSSpec;
|
FSSpec oldSelectionFSSpec;
|
||||||
@@ -38,8 +44,6 @@ struct UserDataRec {
|
|||||||
typedef struct UserDataRec
|
typedef struct UserDataRec
|
||||||
UserDataRec, *UserDataRecPtr;
|
UserDataRec, *UserDataRecPtr;
|
||||||
|
|
||||||
#if !TARGET_CARBON
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kSelectItem = 10, // select button item number
|
kSelectItem = 10, // select button item number
|
||||||
kSFGetFolderDlgID = 250, // dialog resource number
|
kSFGetFolderDlgID = 250, // dialog resource number
|
||||||
@@ -307,7 +311,6 @@ static pascal short SFGetFolderDialogHook(short item, DialogPtr theDlgPtr, Ptr d
|
|||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void StandardGetFolder( ConstStr255Param message , ConstStr255Param path , FileFilterYDUPP fileFilter, StandardFileReply *theSFR)
|
void StandardGetFolder( ConstStr255Param message , ConstStr255Param path , FileFilterYDUPP fileFilter, StandardFileReply *theSFR)
|
||||||
{
|
{
|
||||||
@@ -433,6 +436,9 @@ static pascal Boolean OnlyVisibleFoldersCustomFileFilter(CInfoPBPtr myCInfoPBPtr
|
|||||||
return !(visibleFlag && folderFlag);
|
return !(visibleFlag && folderFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
|
wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
|
||||||
const wxString& defaultPath,
|
const wxString& defaultPath,
|
||||||
long style, const wxPoint& pos)
|
long style, const wxPoint& pos)
|
||||||
@@ -445,6 +451,8 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
|
|||||||
|
|
||||||
int wxDirDialog::ShowModal()
|
int wxDirDialog::ShowModal()
|
||||||
{
|
{
|
||||||
|
#if !TARGET_CARBON
|
||||||
|
if ( !gUseNavServices )
|
||||||
{
|
{
|
||||||
Str255 prompt ;
|
Str255 prompt ;
|
||||||
Str255 path ;
|
Str255 path ;
|
||||||
@@ -457,16 +465,15 @@ int wxDirDialog::ShowModal()
|
|||||||
|
|
||||||
StandardFileReply reply ;
|
StandardFileReply reply ;
|
||||||
FileFilterYDUPP invisiblesExcludedCustomFilterUPP = 0 ;
|
FileFilterYDUPP invisiblesExcludedCustomFilterUPP = 0 ;
|
||||||
#if !TARGET_CARBON
|
|
||||||
invisiblesExcludedCustomFilterUPP =
|
invisiblesExcludedCustomFilterUPP =
|
||||||
NewFileFilterYDProc(OnlyVisibleFoldersCustomFileFilter);
|
NewFileFilterYDProc(OnlyVisibleFoldersCustomFileFilter);
|
||||||
#endif
|
|
||||||
|
|
||||||
StandardGetFolder( prompt , path , invisiblesExcludedCustomFilterUPP, &reply);
|
StandardGetFolder( prompt , path , invisiblesExcludedCustomFilterUPP, &reply);
|
||||||
|
|
||||||
#if !TARGET_CARBON
|
|
||||||
DisposeRoutineDescriptor(invisiblesExcludedCustomFilterUPP);
|
DisposeRoutineDescriptor(invisiblesExcludedCustomFilterUPP);
|
||||||
#endif
|
|
||||||
if ( reply.sfGood == false )
|
if ( reply.sfGood == false )
|
||||||
{
|
{
|
||||||
m_path = "" ;
|
m_path = "" ;
|
||||||
@@ -477,7 +484,105 @@ int wxDirDialog::ShowModal()
|
|||||||
m_path = wxMacFSSpec2UnixFilename( &reply.sfFile ) ;
|
m_path = wxMacFSSpec2UnixFilename( &reply.sfFile ) ;
|
||||||
return wxID_OK ;
|
return wxID_OK ;
|
||||||
}
|
}
|
||||||
|
return wxID_CANCEL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
NavDialogOptions mNavOptions;
|
||||||
|
NavObjectFilterUPP mNavFilterUPP = NULL;
|
||||||
|
NavPreviewUPP mNavPreviewUPP = NULL ;
|
||||||
|
NavReplyRecord mNavReply;
|
||||||
|
AEDesc* mDefaultLocation = NULL ;
|
||||||
|
bool mSelectDefault = false ;
|
||||||
|
|
||||||
|
::NavGetDefaultDialogOptions(&mNavOptions);
|
||||||
|
|
||||||
|
mNavFilterUPP = nil;
|
||||||
|
mNavPreviewUPP = nil;
|
||||||
|
mSelectDefault = false;
|
||||||
|
mNavReply.validRecord = false;
|
||||||
|
mNavReply.replacing = false;
|
||||||
|
mNavReply.isStationery = false;
|
||||||
|
mNavReply.translationNeeded = false;
|
||||||
|
mNavReply.selection.descriptorType = typeNull;
|
||||||
|
mNavReply.selection.dataHandle = nil;
|
||||||
|
mNavReply.keyScript = smSystemScript;
|
||||||
|
mNavReply.fileTranslation = nil;
|
||||||
|
|
||||||
|
// Set default location, the location
|
||||||
|
// that's displayed when the dialog
|
||||||
|
// first appears
|
||||||
|
|
||||||
|
if ( mDefaultLocation ) {
|
||||||
|
|
||||||
|
if (mSelectDefault) {
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation;
|
||||||
|
} else {
|
||||||
|
mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OSErr err = ::NavChooseFolder(
|
||||||
|
mDefaultLocation,
|
||||||
|
&mNavReply,
|
||||||
|
&mNavOptions,
|
||||||
|
NULL,
|
||||||
|
mNavFilterUPP,
|
||||||
|
0L); // User Data
|
||||||
|
|
||||||
|
if ( (err != noErr) && (err != userCanceledErr) ) {
|
||||||
|
m_path = "" ;
|
||||||
|
return wxID_CANCEL ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mNavReply.validRecord) { // User chose a folder
|
||||||
|
|
||||||
|
FSSpec folderInfo;
|
||||||
|
FSSpec outFileSpec ;
|
||||||
|
AEDesc specDesc ;
|
||||||
|
|
||||||
|
OSErr err = ::AECoerceDesc( &mNavReply.selection , typeFSS, &specDesc);
|
||||||
|
if ( err != noErr ) {
|
||||||
|
m_path = "" ;
|
||||||
|
return wxID_CANCEL ;
|
||||||
|
}
|
||||||
|
folderInfo = **(FSSpec**) specDesc.dataHandle;
|
||||||
|
if (specDesc.dataHandle != nil) {
|
||||||
|
::AEDisposeDesc(&specDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
// mNavReply.GetFileSpec(folderInfo);
|
||||||
|
|
||||||
|
// The FSSpec from NavChooseFolder is NOT the file spec
|
||||||
|
// for the folder. The parID field is actually the DirID
|
||||||
|
// of the folder itself, not the folder's parent, and
|
||||||
|
// the name field is empty. We must call PBGetCatInfo
|
||||||
|
// to get the parent DirID and folder name
|
||||||
|
|
||||||
|
Str255 name;
|
||||||
|
CInfoPBRec thePB; // Directory Info Parameter Block
|
||||||
|
thePB.dirInfo.ioCompletion = nil;
|
||||||
|
thePB.dirInfo.ioVRefNum = folderInfo.vRefNum; // Volume is right
|
||||||
|
thePB.dirInfo.ioDrDirID = folderInfo.parID; // Folder's DirID
|
||||||
|
thePB.dirInfo.ioNamePtr = name;
|
||||||
|
thePB.dirInfo.ioFDirIndex = -1; // Lookup using Volume and DirID
|
||||||
|
|
||||||
|
err = ::PBGetCatInfoSync(&thePB);
|
||||||
|
if ( err != noErr ) {
|
||||||
|
m_path = "" ;
|
||||||
|
return wxID_CANCEL ;
|
||||||
|
}
|
||||||
|
// Create cannonical FSSpec
|
||||||
|
::FSMakeFSSpec(thePB.dirInfo.ioVRefNum, thePB.dirInfo.ioDrParID,
|
||||||
|
name, &outFileSpec);
|
||||||
|
|
||||||
|
// outFolderDirID = thePB.dirInfo.ioDrDirID;
|
||||||
|
m_path = wxMacFSSpec2UnixFilename( &outFileSpec ) ;
|
||||||
|
return wxID_OK ;
|
||||||
}
|
}
|
||||||
return wxID_CANCEL;
|
return wxID_CANCEL;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,18 +19,55 @@
|
|||||||
#include "wx/filedlg.h"
|
#include "wx/filedlg.h"
|
||||||
#include "wx/intl.h"
|
#include "wx/intl.h"
|
||||||
|
|
||||||
|
#include "PLStringFuncs.h"
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
|
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// begin wxmac
|
// begin wxmac
|
||||||
|
|
||||||
|
#include "Navigation.h"
|
||||||
|
|
||||||
#include "morefile.h"
|
#include "morefile.h"
|
||||||
#include "moreextr.h"
|
#include "moreextr.h"
|
||||||
#include "fullpath.h"
|
#include "fullpath.h"
|
||||||
#include "fspcompa.h"
|
#include "fspcompa.h"
|
||||||
#include "PLStringFuncs.h"
|
#include "PLStringFuncs.h"
|
||||||
|
|
||||||
|
extern bool gUseNavServices ;
|
||||||
|
|
||||||
|
static pascal void NavEventProc(
|
||||||
|
NavEventCallbackMessage inSelector,
|
||||||
|
NavCBRecPtr ioParams,
|
||||||
|
NavCallBackUserData ioUserData);
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
|
static NavEventUPP sStandardNavEventFilter = NewNavEventUPP(NavEventProc);
|
||||||
|
#else
|
||||||
|
static NavEventUPP sStandardNavEventFilter = NewNavEventProc(NavEventProc);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static pascal void
|
||||||
|
NavEventProc(
|
||||||
|
NavEventCallbackMessage inSelector,
|
||||||
|
NavCBRecPtr ioParams,
|
||||||
|
NavCallBackUserData /* ioUserData */)
|
||||||
|
{
|
||||||
|
if (inSelector == kNavCBEvent) {
|
||||||
|
// In Universal Headers 3.2, Apple changed the definition of
|
||||||
|
/*
|
||||||
|
#if UNIVERSAL_INTERFACES_VERSION >= 0x0320 // Universal Headers 3.2
|
||||||
|
UModalAlerts::ProcessModalEvent(*(ioParams->eventData.eventDataParms.event));
|
||||||
|
|
||||||
|
#else
|
||||||
|
UModalAlerts::ProcessModalEvent(*(ioParams->eventData.event));
|
||||||
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char * gfilters[] =
|
char * gfilters[] =
|
||||||
{
|
{
|
||||||
"*.TXT" ,
|
"*.TXT" ,
|
||||||
@@ -189,7 +226,7 @@ static pascal Boolean SFGetFolderModalDialogFilter(DialogPtr theDlgPtr, EventRec
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif !TARGET_CARBON
|
||||||
|
|
||||||
void ExtendedOpenFile( ConstStr255Param message , ConstStr255Param path , const char *filter , FileFilterYDUPP fileFilter, StandardFileReply *theSFR)
|
void ExtendedOpenFile( ConstStr255Param message , ConstStr255Param path , const char *filter , FileFilterYDUPP fileFilter, StandardFileReply *theSFR)
|
||||||
{
|
{
|
||||||
@@ -451,6 +488,9 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
|||||||
|
|
||||||
int wxFileDialog::ShowModal()
|
int wxFileDialog::ShowModal()
|
||||||
{
|
{
|
||||||
|
#if !TARGET_CARBON
|
||||||
|
if ( !gUseNavServices )
|
||||||
|
{
|
||||||
if ( m_dialogStyle & wxSAVE )
|
if ( m_dialogStyle & wxSAVE )
|
||||||
{
|
{
|
||||||
StandardFileReply reply ;
|
StandardFileReply reply ;
|
||||||
@@ -488,7 +528,7 @@ int wxFileDialog::ShowModal()
|
|||||||
strcpy((char *)prompt, m_message) ;
|
strcpy((char *)prompt, m_message) ;
|
||||||
c2pstr((char *)prompt ) ;
|
c2pstr((char *)prompt ) ;
|
||||||
|
|
||||||
strcpy((char *)path, m_path ) ;
|
strcpy((char *)path, m_dir ) ;
|
||||||
c2pstr((char *)path ) ;
|
c2pstr((char *)path ) ;
|
||||||
|
|
||||||
StandardFileReply reply ;
|
StandardFileReply reply ;
|
||||||
@@ -515,6 +555,137 @@ int wxFileDialog::ShowModal()
|
|||||||
}
|
}
|
||||||
return wxID_CANCEL;
|
return wxID_CANCEL;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
NavDialogOptions mNavOptions;
|
||||||
|
NavObjectFilterUPP mNavFilterUPP = NULL;
|
||||||
|
NavPreviewUPP mNavPreviewUPP = NULL ;
|
||||||
|
NavReplyRecord mNavReply;
|
||||||
|
AEDesc mDefaultLocation ;
|
||||||
|
bool mSelectDefault = false ;
|
||||||
|
|
||||||
|
::NavGetDefaultDialogOptions(&mNavOptions);
|
||||||
|
|
||||||
|
mNavFilterUPP = nil;
|
||||||
|
mNavPreviewUPP = nil;
|
||||||
|
mSelectDefault = false;
|
||||||
|
mNavReply.validRecord = false;
|
||||||
|
mNavReply.replacing = false;
|
||||||
|
mNavReply.isStationery = false;
|
||||||
|
mNavReply.translationNeeded = false;
|
||||||
|
mNavReply.selection.descriptorType = typeNull;
|
||||||
|
mNavReply.selection.dataHandle = nil;
|
||||||
|
mNavReply.keyScript = smSystemScript;
|
||||||
|
mNavReply.fileTranslation = nil;
|
||||||
|
|
||||||
|
// Set default location, the location
|
||||||
|
// that's displayed when the dialog
|
||||||
|
// first appears
|
||||||
|
|
||||||
|
FSSpec location ;
|
||||||
|
wxUnixFilename2FSSpec( m_dir , &location ) ;
|
||||||
|
OSErr err = noErr ;
|
||||||
|
|
||||||
|
mDefaultLocation.descriptorType = typeNull;
|
||||||
|
mDefaultLocation.dataHandle = nil;
|
||||||
|
|
||||||
|
err = ::AECreateDesc(typeFSS, &location, sizeof(FSSpec), &mDefaultLocation );
|
||||||
|
|
||||||
|
if ( mDefaultLocation.dataHandle ) {
|
||||||
|
|
||||||
|
if (mSelectDefault) {
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation;
|
||||||
|
} else {
|
||||||
|
mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy((char *)mNavOptions.message, m_message) ;
|
||||||
|
c2pstr((char *)mNavOptions.message ) ;
|
||||||
|
|
||||||
|
strcpy((char *)mNavOptions.savedFileName, m_fileName) ;
|
||||||
|
c2pstr((char *)mNavOptions.savedFileName ) ;
|
||||||
|
|
||||||
|
if ( m_dialogStyle & wxSAVE )
|
||||||
|
{
|
||||||
|
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavNoTypePopup ;
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavDontAutoTranslate ;
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavDontAddTranslateItems ;
|
||||||
|
|
||||||
|
err = ::NavPutFile(
|
||||||
|
&mDefaultLocation,
|
||||||
|
&mNavReply,
|
||||||
|
&mNavOptions,
|
||||||
|
sStandardNavEventFilter ,
|
||||||
|
'TEXT',
|
||||||
|
'TEXT',
|
||||||
|
0L); // User Data
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( m_dialogStyle & wxMULTIPLE )
|
||||||
|
mNavOptions.dialogOptionFlags |= kNavAllowMultipleFiles ;
|
||||||
|
else
|
||||||
|
mNavOptions.dialogOptionFlags &= ~kNavAllowMultipleFiles ;
|
||||||
|
|
||||||
|
err = ::NavGetFile(
|
||||||
|
&mDefaultLocation,
|
||||||
|
&mNavReply,
|
||||||
|
&mNavOptions,
|
||||||
|
sStandardNavEventFilter ,
|
||||||
|
mNavPreviewUPP,
|
||||||
|
mNavFilterUPP,
|
||||||
|
0L /*inFileTypes.TypeListHandle() */,
|
||||||
|
0L); // User Data
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( mDefaultLocation.dataHandle != nil )
|
||||||
|
{
|
||||||
|
::AEDisposeDesc(&mDefaultLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (err != noErr) && (err != userCanceledErr) ) {
|
||||||
|
m_path = "" ;
|
||||||
|
return wxID_CANCEL ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mNavReply.validRecord) {
|
||||||
|
|
||||||
|
FSSpec outFileSpec ;
|
||||||
|
AEDesc specDesc ;
|
||||||
|
|
||||||
|
long count ;
|
||||||
|
::AECountItems( &mNavReply.selection , &count ) ;
|
||||||
|
for ( long i = 1 ; i <= count ; ++i )
|
||||||
|
{
|
||||||
|
OSErr err = ::AEGetNthDesc( &mNavReply.selection , i , typeFSS, NULL , &specDesc);
|
||||||
|
if ( err != noErr ) {
|
||||||
|
m_path = "" ;
|
||||||
|
return wxID_CANCEL ;
|
||||||
|
}
|
||||||
|
outFileSpec = **(FSSpec**) specDesc.dataHandle;
|
||||||
|
if (specDesc.dataHandle != nil) {
|
||||||
|
::AEDisposeDesc(&specDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// outFolderDirID = thePB.dirInfo.ioDrDirID;
|
||||||
|
m_path = wxMacFSSpec2UnixFilename( &outFileSpec ) ;
|
||||||
|
m_paths.Add( m_path ) ;
|
||||||
|
m_fileNames.Add(m_fileName);
|
||||||
|
}
|
||||||
|
// set these to the first hit
|
||||||
|
m_path = m_paths[ 0 ] ;
|
||||||
|
m_fileName = wxFileNameFromPath(m_path);
|
||||||
|
m_dir = wxPathOnly(m_path);
|
||||||
|
|
||||||
|
return wxID_OK ;
|
||||||
|
}
|
||||||
|
return wxID_CANCEL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Generic file load/save dialog
|
// Generic file load/save dialog
|
||||||
static wxString
|
static wxString
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/string.h"
|
#include "wx/string.h"
|
||||||
#include "wx/font.h"
|
#include "wx/font.h"
|
||||||
|
#include "wx/fontutil.h"
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
#include "wx/fontutil.h"
|
#include "wx/fontutil.h"
|
||||||
@@ -119,6 +120,12 @@ void wxFont::Init()
|
|||||||
wxTheFontList->Append(this);
|
wxTheFontList->Append(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxFont::Create(const wxNativeFontInfo& info)
|
||||||
|
{
|
||||||
|
return Create(info.pointSize, info.family, info.style, info.weight,
|
||||||
|
info.underlined, info.faceName, info.encoding);
|
||||||
|
}
|
||||||
|
|
||||||
wxFont::wxFont(const wxString& fontdesc)
|
wxFont::wxFont(const wxString& fontdesc)
|
||||||
{
|
{
|
||||||
wxNativeFontInfo info;
|
wxNativeFontInfo info;
|
||||||
@@ -143,12 +150,6 @@ bool wxFont::Create(int pointSize,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFont::Create(const wxNativeFontInfo& info)
|
|
||||||
{
|
|
||||||
return Create(info.pointSize, info.family, info.style, info.weight,
|
|
||||||
info.underlined, info.faceName, info.encoding);
|
|
||||||
}
|
|
||||||
|
|
||||||
wxFont::~wxFont()
|
wxFont::~wxFont()
|
||||||
{
|
{
|
||||||
if (wxTheFontList)
|
if (wxTheFontList)
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/fontenum.h"
|
#include "wx/fontenum.h"
|
||||||
|
#include "wx/fontutil.h"
|
||||||
#include "wx/fontmap.h"
|
#include "wx/fontmap.h"
|
||||||
#include "wx/fontutil.h"
|
#include "wx/fontutil.h"
|
||||||
|
|
||||||
|
@@ -199,8 +199,9 @@ wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
|
|||||||
{
|
{
|
||||||
wxStatusBar *statusBar = NULL;
|
wxStatusBar *statusBar = NULL;
|
||||||
|
|
||||||
statusBar = new wxStatusBar(this, id, style, name);
|
statusBar = new wxStatusBar(this, id,
|
||||||
|
style, name);
|
||||||
|
statusBar->SetSize( 100 , 15 ) ;
|
||||||
statusBar->SetFieldsCount(number);
|
statusBar->SetFieldsCount(number);
|
||||||
return statusBar;
|
return statusBar;
|
||||||
}
|
}
|
||||||
@@ -216,7 +217,7 @@ void wxFrame::PositionStatusBar()
|
|||||||
|
|
||||||
// Since we wish the status bar to be directly under the client area,
|
// Since we wish the status bar to be directly under the client area,
|
||||||
// we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
|
// we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
|
||||||
m_frameStatusBar->SetSize(0, h, w, WX_MAC_STATUSBAR_HEIGHT );
|
m_frameStatusBar->SetSize(0, h, w, sh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,8 +297,7 @@ void wxFrame::DoGetClientSize(int *x, int *y) const
|
|||||||
{
|
{
|
||||||
int statusX, statusY;
|
int statusX, statusY;
|
||||||
GetStatusBar()->GetClientSize(&statusX, &statusY);
|
GetStatusBar()->GetClientSize(&statusX, &statusY);
|
||||||
// right now this is a constant, this might change someday
|
*y -= statusY;
|
||||||
*y -= WX_MAC_STATUSBAR_HEIGHT ;
|
|
||||||
}
|
}
|
||||||
#endif // wxUSE_STATUSBAR
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
|
@@ -180,6 +180,7 @@ int wxListBox::DoAppend(const wxString& item)
|
|||||||
m_dataArray.Add( NULL );
|
m_dataArray.Add( NULL );
|
||||||
}
|
}
|
||||||
m_noItems ++;
|
m_noItems ++;
|
||||||
|
DoSetItemClientData( index , NULL ) ;
|
||||||
MacAppend( item ) ;
|
MacAppend( item ) ;
|
||||||
|
|
||||||
return index ;
|
return index ;
|
||||||
@@ -255,6 +256,16 @@ int wxListBox::FindString(const wxString& st) const
|
|||||||
if ( EqualString( s1 , s2 , false , false ) )
|
if ( EqualString( s1 , s2 , false , false ) )
|
||||||
return i ;
|
return i ;
|
||||||
}
|
}
|
||||||
|
if ( s.Left(1) = "*" && s.Length() > 1 )
|
||||||
|
{
|
||||||
|
s.MakeLower() ;
|
||||||
|
for ( int i = 0 ; i < m_noItems ; ++i )
|
||||||
|
{
|
||||||
|
if ( GetString(i).Lower().Matches(s) )
|
||||||
|
return i ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -700,8 +700,37 @@ void wxMenuBar::MacInstallMenuBar()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if( m_titles[i] == "?" || m_titles[i] == "&?" || m_titles[i] == wxApp::s_macHelpMenuTitleName )
|
||||||
|
{
|
||||||
|
wxMenuItem::MacBuildMenuString( label, NULL , NULL , m_titles[i] , false );
|
||||||
|
UMASetMenuTitle( menu->GetHMenu() , label ) ;
|
||||||
|
|
||||||
|
for (pos = 0 , node = menu->GetMenuItems().First(); node; node = node->Next(), pos++)
|
||||||
|
{
|
||||||
|
item = (wxMenuItem *)node->Data();
|
||||||
|
subMenu = item->GetSubMenu() ;
|
||||||
|
if (subMenu)
|
||||||
|
{
|
||||||
|
UMAInsertMenu( subMenu->GetHMenu() , -1 ) ;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if ( item->GetId() == wxApp::s_macAboutMenuItemId )
|
||||||
|
{
|
||||||
|
Str255 label ;
|
||||||
|
UInt8 modifiers ;
|
||||||
|
SInt16 key ;
|
||||||
|
wxMenuItem::MacBuildMenuString( label, &key , &modifiers , item->GetText(), item->GetId() != wxApp::s_macAboutMenuItemId); // no shortcut in about menu
|
||||||
|
UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , label );
|
||||||
|
UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UMAInsertMenu(m_menus[i]->GetHMenu(), 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
else
|
||||||
{
|
{
|
||||||
wxMenuItem::MacBuildMenuString( label, NULL , NULL , m_titles[i] , false );
|
wxMenuItem::MacBuildMenuString( label, NULL , NULL , m_titles[i] , false );
|
||||||
UMASetMenuTitle( menu->GetHMenu() , label ) ;
|
UMASetMenuTitle( menu->GetHMenu() , label ) ;
|
||||||
|
@@ -42,6 +42,9 @@ const short kwxMacTabBottomMargin = 16 ;
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARIES
|
#if !USE_SHARED_LIBRARIES
|
||||||
|
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
|
||||||
|
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
|
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
|
||||||
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
|
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
|
||||||
|
|
||||||
|
@@ -136,7 +136,6 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
|||||||
// Create an abort window
|
// Create an abort window
|
||||||
wxBeginBusyCursor();
|
wxBeginBusyCursor();
|
||||||
|
|
||||||
/*
|
|
||||||
wxWindow *win = CreateAbortWindow(parent, printout);
|
wxWindow *win = CreateAbortWindow(parent, printout);
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
@@ -149,7 +148,6 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
|||||||
sm_abortWindow = win;
|
sm_abortWindow = win;
|
||||||
sm_abortWindow->Show(TRUE);
|
sm_abortWindow->Show(TRUE);
|
||||||
wxYield();
|
wxYield();
|
||||||
*/
|
|
||||||
|
|
||||||
printout->OnBeginPrinting();
|
printout->OnBeginPrinting();
|
||||||
|
|
||||||
@@ -178,6 +176,11 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
GrafPtr thePort ;
|
||||||
|
GetPort( &thePort ) ;
|
||||||
|
wxYield() ;
|
||||||
|
SetPort( thePort ) ;
|
||||||
|
|
||||||
dc->StartPage();
|
dc->StartPage();
|
||||||
keepGoing = printout->OnPrintPage(pn);
|
keepGoing = printout->OnPrintPage(pn);
|
||||||
dc->EndPage();
|
dc->EndPage();
|
||||||
|
@@ -111,6 +111,14 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
wxString value ;
|
wxString value ;
|
||||||
|
|
||||||
|
{
|
||||||
|
TEHandle teH ;
|
||||||
|
long size ;
|
||||||
|
|
||||||
|
UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ;
|
||||||
|
(*teH)->lineHeight = -1 ;
|
||||||
|
}
|
||||||
|
|
||||||
if( wxApp::s_macDefaultEncodingIsPC )
|
if( wxApp::s_macDefaultEncodingIsPC )
|
||||||
value = wxMacMakeMacStringFromPC( st ) ;
|
value = wxMacMakeMacStringFromPC( st ) ;
|
||||||
else
|
else
|
||||||
@@ -152,8 +160,7 @@ void wxTextCtrl::SetValue(const wxString& st)
|
|||||||
else
|
else
|
||||||
value = st ;
|
value = st ;
|
||||||
UMASetControlData( m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ;
|
UMASetControlData( m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , value.Length() , (char*) ((const char*)value) ) ;
|
||||||
Refresh() ;
|
UMADrawControl( m_macControl ) ;
|
||||||
// MacInvalidateControl() ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clipboard operations
|
// Clipboard operations
|
||||||
@@ -208,7 +215,7 @@ void wxTextCtrl::Paste()
|
|||||||
UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ;
|
UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ;
|
||||||
TEFromScrap() ;
|
TEFromScrap() ;
|
||||||
TEPaste( teH ) ;
|
TEPaste( teH ) ;
|
||||||
// MacInvalidateControl() ;
|
UMADrawControl( m_macControl ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -801,9 +801,11 @@ bool wxThreadModule::OnInit()
|
|||||||
long response;
|
long response;
|
||||||
bool hasThreadManager ;
|
bool hasThreadManager ;
|
||||||
hasThreadManager = Gestalt( gestaltThreadMgrAttr, &response) == noErr && response & 1;
|
hasThreadManager = Gestalt( gestaltThreadMgrAttr, &response) == noErr && response & 1;
|
||||||
#if TARGET_RT_MAC_CFM
|
#if !TARGET_CARBON
|
||||||
|
#if GENERATINGCFM
|
||||||
// verify presence of shared library
|
// verify presence of shared library
|
||||||
hasThreadManager = hasThreadManager && ((Ptr)NewThread != (Ptr)kUnresolvedCFragSymbolAddress);
|
hasThreadManager = hasThreadManager && ((Ptr)NewThread != (Ptr)kUnresolvedCFragSymbolAddress);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if ( !hasThreadManager )
|
if ( !hasThreadManager )
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
#include <wx/mac/uma.h>
|
#include <wx/mac/uma.h>
|
||||||
#include <wx/mac/aga.h>
|
#include <wx/mac/aga.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include "Navigation.h"
|
||||||
|
|
||||||
// init
|
// init
|
||||||
|
|
||||||
static bool sUMAHasAppearance = false ;
|
static bool sUMAHasAppearance = false ;
|
||||||
@@ -14,7 +17,19 @@ static long sUMAWindowManagerAttr = 0 ;
|
|||||||
|
|
||||||
bool UMAHasWindowManager() { return sUMAHasWindowManager ; }
|
bool UMAHasWindowManager() { return sUMAHasWindowManager ; }
|
||||||
long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr ; }
|
long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr ; }
|
||||||
|
void UMACleanupToolbox()
|
||||||
|
{
|
||||||
|
#if UMA_USE_APPEARANCE
|
||||||
|
if ( sUMAHasAppearance )
|
||||||
|
{
|
||||||
|
UnregisterAppearanceClient() ;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if ( NavServicesAvailable() )
|
||||||
|
{
|
||||||
|
NavUnload() ;
|
||||||
|
}
|
||||||
|
}
|
||||||
void UMAInitToolbox( UInt16 inMoreMastersCalls )
|
void UMAInitToolbox( UInt16 inMoreMastersCalls )
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
@@ -24,7 +39,6 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls )
|
|||||||
|
|
||||||
::InitGraf(&qd.thePort);
|
::InitGraf(&qd.thePort);
|
||||||
::InitFonts();
|
::InitFonts();
|
||||||
::InitWindows();
|
|
||||||
::InitMenus();
|
::InitMenus();
|
||||||
::TEInit();
|
::TEInit();
|
||||||
::InitDialogs(0L);
|
::InitDialogs(0L);
|
||||||
@@ -60,6 +74,16 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls )
|
|||||||
}
|
}
|
||||||
#endif // UMA_USE_WINDOWMGR
|
#endif // UMA_USE_WINDOWMGR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if ( sUMAHasWindowManager )
|
||||||
|
InitFloatingWindows() ;
|
||||||
|
else
|
||||||
|
InitWindows();
|
||||||
|
|
||||||
|
if ( NavServicesAvailable() )
|
||||||
|
{
|
||||||
|
NavLoad() ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// process manager
|
// process manager
|
||||||
@@ -250,7 +274,7 @@ void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId )
|
|||||||
|
|
||||||
int gPrOpenCounter = 0 ;
|
int gPrOpenCounter = 0 ;
|
||||||
|
|
||||||
void UMAPrOpen()
|
OSStatus UMAPrOpen()
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
OSErr err = noErr ;
|
OSErr err = noErr ;
|
||||||
@@ -261,12 +285,20 @@ void UMAPrOpen()
|
|||||||
err = PrError() ;
|
err = PrError() ;
|
||||||
wxASSERT( err == noErr ) ;
|
wxASSERT( err == noErr ) ;
|
||||||
}
|
}
|
||||||
|
return err ;
|
||||||
#else
|
#else
|
||||||
#pragma warning "TODO Printing for Carbon"
|
OSStatus err = noErr ;
|
||||||
|
++gPrOpenCounter ;
|
||||||
|
if ( gPrOpenCounter == 1 )
|
||||||
|
{
|
||||||
|
err = PMBegin() ;
|
||||||
|
wxASSERT( err == noErr ) ;
|
||||||
|
}
|
||||||
|
return err ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void UMAPrClose()
|
OSStatus UMAPrClose()
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
OSErr err = noErr ;
|
OSErr err = noErr ;
|
||||||
@@ -278,8 +310,16 @@ void UMAPrClose()
|
|||||||
wxASSERT( err == noErr ) ;
|
wxASSERT( err == noErr ) ;
|
||||||
}
|
}
|
||||||
--gPrOpenCounter ;
|
--gPrOpenCounter ;
|
||||||
|
return err ;
|
||||||
#else
|
#else
|
||||||
#pragma warning "TODO Printing for Carbon"
|
OSStatus err = noErr ;
|
||||||
|
wxASSERT( gPrOpenCounter >= 1 ) ;
|
||||||
|
if ( gPrOpenCounter == 1 )
|
||||||
|
{
|
||||||
|
err = PMEnd() ;
|
||||||
|
}
|
||||||
|
--gPrOpenCounter ;
|
||||||
|
return err ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,6 +47,14 @@ bool wxGetUserId(char *buf, int maxSize)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wxChar* wxGetHomeDir(wxString *pstr)
|
||||||
|
{
|
||||||
|
*pstr = wxMacFindFolder( (short) kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder ) ;
|
||||||
|
return pstr->c_str() ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Get user name e.g. AUTHOR
|
// Get user name e.g. AUTHOR
|
||||||
bool wxGetUserName(char *buf, int maxSize)
|
bool wxGetUserName(char *buf, int maxSize)
|
||||||
{
|
{
|
||||||
|
190
src/mac/wave.cpp
190
src/mac/wave.cpp
@@ -18,12 +18,12 @@
|
|||||||
#include "wx/mac/wave.h"
|
#include "wx/mac/wave.h"
|
||||||
|
|
||||||
wxWave::wxWave()
|
wxWave::wxWave()
|
||||||
: m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
|
: m_hSnd(NULL), m_waveLength(0), m_isResource(true), m_sndChan(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWave::wxWave(const wxString& sFileName, bool isResource)
|
wxWave::wxWave(const wxString& sFileName, bool isResource)
|
||||||
: m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
|
: m_hSnd(NULL), m_waveLength(0), m_isResource(true), m_sndChan(0)
|
||||||
{
|
{
|
||||||
Create(sFileName, isResource);
|
Create(sFileName, isResource);
|
||||||
}
|
}
|
||||||
@@ -34,28 +34,196 @@ wxWave::~wxWave()
|
|||||||
Free();
|
Free();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool wxWave::Create(const wxString& fileName, bool isResource)
|
bool wxWave::Create(const wxString& fileName, bool isResource)
|
||||||
{
|
{
|
||||||
Free();
|
bool ret = false;
|
||||||
|
m_sndname = fileName;
|
||||||
|
m_isResource = isResource;
|
||||||
|
|
||||||
// TODO
|
if (m_isResource)
|
||||||
|
ret = true;
|
||||||
|
else
|
||||||
|
{ /*
|
||||||
|
if (sndChan)
|
||||||
|
{ // we're playing
|
||||||
|
FSClose(SndRefNum);
|
||||||
|
SndRefNum = 0;
|
||||||
|
SndDisposeChannel(sndChan, TRUE);
|
||||||
|
free(sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
KillTimer(0,timerID);
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
if (!lpSnd)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (_access(lpSnd,0)) // no file, no service
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Allocate SndChannel
|
||||||
|
sndChan = (SndChannelPtr) malloc (sizeof(SndChannel));
|
||||||
|
|
||||||
|
if (!sndChan)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
sndChan->qLength = 128;
|
||||||
|
|
||||||
|
if (noErr != SndNewChannel (&sndChan, sampledSynth, initMono | initNoInterp, 0))
|
||||||
|
{
|
||||||
|
free(sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(SndRefNum = MacOpenSndFile ((char *)lpSnd)))
|
||||||
|
{
|
||||||
|
SndDisposeChannel(sndChan, TRUE);
|
||||||
|
free(sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool async = false;
|
||||||
|
|
||||||
|
if (fdwSound & SND_ASYNC)
|
||||||
|
async = true;
|
||||||
|
|
||||||
|
if (SndStartFilePlay(sndChan, SndRefNum, 0, 81920, 0, 0, 0, async) != noErr)
|
||||||
|
{
|
||||||
|
FSClose (SndRefNum);
|
||||||
|
SndRefNum = 0;
|
||||||
|
SndDisposeChannel (sndChan, TRUE);
|
||||||
|
free (sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (async)
|
||||||
|
{ // haven't finish yet
|
||||||
|
timerID = SetTimer(0, 0, 250, TimerCallBack);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FSClose (SndRefNum);
|
||||||
|
SndRefNum = 0;
|
||||||
|
SndDisposeChannel (sndChan, TRUE);
|
||||||
|
free (sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//don't know what to do with looped, wth
|
||||||
bool wxWave::Play(bool async, bool looped) const
|
bool wxWave::Play(bool async, bool looped) const
|
||||||
{
|
{
|
||||||
if (!IsOk())
|
char lpSnd[32];
|
||||||
return FALSE;
|
bool ret = false;
|
||||||
|
|
||||||
// TODO
|
if (m_isResource)
|
||||||
return FALSE;
|
{
|
||||||
|
strcpy(lpSnd, m_sndname);
|
||||||
|
c2pstr((char *) lpSnd);
|
||||||
|
SndListHandle hSnd;
|
||||||
|
|
||||||
|
hSnd = (SndListHandle) GetNamedResource('snd ',(const unsigned char *) lpSnd);
|
||||||
|
|
||||||
|
if ((hSnd != NULL) && (SndPlay(m_sndChan, hSnd, async) == noErr))
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool wxWave::Free()
|
bool wxWave::Free()
|
||||||
{
|
{
|
||||||
// TODO
|
bool ret = false;
|
||||||
return FALSE;
|
|
||||||
|
if (m_isResource)
|
||||||
|
{
|
||||||
|
m_sndname.Empty();
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//TODO,
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//code below is from an old implementation used for telinfo with MSVC crossplatform support
|
||||||
|
//technology proceeds, so it would be the wisest to drop this code, but it's left here just
|
||||||
|
//for the sake of a reference. BTW: Wave files can now be played with QT, starting from V3
|
||||||
|
|
||||||
|
/*static short MacOpenSndFile (char * path)
|
||||||
|
{
|
||||||
|
VolumeParam vp;
|
||||||
|
FSSpec fspec;
|
||||||
|
Str255 name;
|
||||||
|
char *c;
|
||||||
|
|
||||||
|
// first, get the volume reference number for the file. Start by
|
||||||
|
// making a Pstring with just the volume name
|
||||||
|
strcpy ((char *) name, path);
|
||||||
|
if (c = strchr ((char *) name, ':'))
|
||||||
|
{
|
||||||
|
c++;
|
||||||
|
*c = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
c2pstr ((char *) name);
|
||||||
|
vp.ioCompletion = 0;
|
||||||
|
vp.ioVolIndex = -1;
|
||||||
|
vp.ioNamePtr = name;
|
||||||
|
vp.ioVRefNum = 0;
|
||||||
|
|
||||||
|
if (PBGetVInfo((ParamBlockRec *)&vp, 0) != noErr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// next, buld an FSSpec for the file
|
||||||
|
strcpy ((char *) name, path);
|
||||||
|
c2pstr ((char *) name);
|
||||||
|
if (FSMakeFSSpec (vp.ioVRefNum, 0, name, &fspec) != noErr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
short frefnum;
|
||||||
|
// now open the file, and return it's reference number
|
||||||
|
if (FSpOpenDF(&fspec, fsRdPerm, &frefnum) != noErr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return frefnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TimerCallBack(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime)
|
||||||
|
{
|
||||||
|
if(!sndChan)
|
||||||
|
{
|
||||||
|
KillTimer(0,timerID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCStatus scstat;
|
||||||
|
|
||||||
|
if (noErr == SndChannelStatus (sndChan, sizeof (SCStatus), &scstat)) {
|
||||||
|
if (scstat.scChannelPaused || scstat.scChannelBusy)
|
||||||
|
return; // not done yet
|
||||||
|
}
|
||||||
|
|
||||||
|
// either error or done.
|
||||||
|
FSClose (SndRefNum);
|
||||||
|
SndRefNum = 0;
|
||||||
|
SndDisposeChannel (sndChan, TRUE);
|
||||||
|
free (sndChan);
|
||||||
|
sndChan = 0;
|
||||||
|
KillTimer(0,timerID);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -437,8 +437,8 @@ void wxWindow::DoGetClientSize(int *x, int *y) const
|
|||||||
*x = m_width ;
|
*x = m_width ;
|
||||||
*y = m_height ;
|
*y = m_height ;
|
||||||
|
|
||||||
*x -= 2 * MacGetBorderSize( ) ;
|
*x -= MacGetLeftBorderSize( ) + MacGetRightBorderSize( ) ;
|
||||||
*y -= 2 * MacGetBorderSize( ) ;
|
*y -= MacGetTopBorderSize( ) + MacGetBottomBorderSize( );
|
||||||
|
|
||||||
if ( (m_vScrollBar && m_vScrollBar->IsShown()) || (m_hScrollBar && m_hScrollBar->IsShown()) )
|
if ( (m_vScrollBar && m_vScrollBar->IsShown()) || (m_hScrollBar && m_hScrollBar->IsShown()) )
|
||||||
{
|
{
|
||||||
@@ -627,7 +627,7 @@ void wxWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
|
|
||||||
wxPoint wxWindow::GetClientAreaOrigin() const
|
wxPoint wxWindow::GetClientAreaOrigin() const
|
||||||
{
|
{
|
||||||
return wxPoint(MacGetBorderSize( ) , MacGetBorderSize( ) );
|
return wxPoint(MacGetLeftBorderSize( ) , MacGetTopBorderSize( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Makes an adjustment to the window position (for example, a frame that has
|
// Makes an adjustment to the window position (for example, a frame that has
|
||||||
@@ -725,7 +725,7 @@ void wxWindow::GetTextExtent(const wxString& string, int *x, int *y,
|
|||||||
if ( !fontToUse )
|
if ( !fontToUse )
|
||||||
fontToUse = &m_font;
|
fontToUse = &m_font;
|
||||||
|
|
||||||
wxClientDC dc( this ) ;
|
wxClientDC dc( (wxWindow*) this ) ;
|
||||||
long lx,ly,ld,le ;
|
long lx,ly,ld,le ;
|
||||||
dc.GetTextExtent( string , &lx , &ly , &ld, &le, fontToUse ) ;
|
dc.GetTextExtent( string , &lx , &ly , &ld, &le, fontToUse ) ;
|
||||||
if ( externalLeading )
|
if ( externalLeading )
|
||||||
@@ -1417,8 +1417,8 @@ void wxWindow::DoSetClientSize(int width, int height)
|
|||||||
if ( height != -1 && m_vScrollBar )
|
if ( height != -1 && m_vScrollBar )
|
||||||
height += MAC_SCROLLBAR_SIZE ;
|
height += MAC_SCROLLBAR_SIZE ;
|
||||||
|
|
||||||
width += 2 * MacGetBorderSize( ) ;
|
width += MacGetLeftBorderSize( ) + MacGetRightBorderSize( ) ;
|
||||||
height += 2 * MacGetBorderSize( ) ;
|
height += MacGetTopBorderSize( ) + MacGetBottomBorderSize( ) ;
|
||||||
|
|
||||||
DoSetSize( -1 , -1 , width , height ) ;
|
DoSetSize( -1 , -1 , width , height ) ;
|
||||||
}
|
}
|
||||||
@@ -1443,7 +1443,8 @@ bool wxWindow::MacGetWindowFromPointSub( const wxPoint &point , wxWindow** outWi
|
|||||||
for (wxNode *node = GetChildren().First(); node; node = node->Next())
|
for (wxNode *node = GetChildren().First(); node; node = node->Next())
|
||||||
{
|
{
|
||||||
wxWindow *child = (wxWindow*)node->Data();
|
wxWindow *child = (wxWindow*)node->Data();
|
||||||
if ( child->GetMacRootWindow() == window )
|
// added the m_isShown test --dmazzoni
|
||||||
|
if ( child->GetMacRootWindow() == window && child->m_isShown )
|
||||||
{
|
{
|
||||||
if (child->MacGetWindowFromPointSub(newPoint , outWin ))
|
if (child->MacGetWindowFromPointSub(newPoint , outWin ))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -1462,9 +1463,12 @@ bool wxWindow::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindow** ou
|
|||||||
{
|
{
|
||||||
wxPoint point( screenpoint ) ;
|
wxPoint point( screenpoint ) ;
|
||||||
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
||||||
|
if ( win )
|
||||||
|
{
|
||||||
win->ScreenToClient( point ) ;
|
win->ScreenToClient( point ) ;
|
||||||
return win->MacGetWindowFromPointSub( point , outWin ) ;
|
return win->MacGetWindowFromPointSub( point , outWin ) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return FALSE ;
|
return FALSE ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1907,8 +1911,8 @@ void wxWindow::MacRepositionScrollBars()
|
|||||||
int width = m_width ;
|
int width = m_width ;
|
||||||
int height = m_height ;
|
int height = m_height ;
|
||||||
|
|
||||||
width -= 2 * MacGetBorderSize() ;
|
width -= MacGetLeftBorderSize() + MacGetRightBorderSize();
|
||||||
height -= 2 * MacGetBorderSize() ;
|
height -= MacGetTopBorderSize() + MacGetBottomBorderSize();
|
||||||
|
|
||||||
wxPoint vPoint(width-MAC_SCROLLBAR_SIZE, 0) ;
|
wxPoint vPoint(width-MAC_SCROLLBAR_SIZE, 0) ;
|
||||||
wxSize vSize(MAC_SCROLLBAR_SIZE, height - adjust) ;
|
wxSize vSize(MAC_SCROLLBAR_SIZE, height - adjust) ;
|
||||||
@@ -2183,7 +2187,7 @@ void wxWindow::MacGetPortClientParams(Point* localOrigin, Rect* clipRect, Window
|
|||||||
SectRect(clipRect, &myClip, clipRect);
|
SectRect(clipRect, &myClip, clipRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxWindow::MacGetBorderSize( ) const
|
long wxWindow::MacGetLeftBorderSize( ) const
|
||||||
{
|
{
|
||||||
if( m_macWindowData )
|
if( m_macWindowData )
|
||||||
return 0 ;
|
return 0 ;
|
||||||
@@ -2203,6 +2207,66 @@ long wxWindow::MacGetBorderSize( ) const
|
|||||||
return 0 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long wxWindow::MacGetRightBorderSize( ) const
|
||||||
|
{
|
||||||
|
if( m_macWindowData )
|
||||||
|
return 0 ;
|
||||||
|
|
||||||
|
if (m_windowStyle & wxRAISED_BORDER || m_windowStyle & wxSUNKEN_BORDER )
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
else if ( m_windowStyle &wxDOUBLE_BORDER)
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
else if (m_windowStyle &wxSIMPLE_BORDER)
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
return 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
long wxWindow::MacGetTopBorderSize( ) const
|
||||||
|
{
|
||||||
|
if( m_macWindowData )
|
||||||
|
return 0 ;
|
||||||
|
|
||||||
|
if (m_windowStyle & wxRAISED_BORDER || m_windowStyle & wxSUNKEN_BORDER )
|
||||||
|
{
|
||||||
|
return 2 ;
|
||||||
|
}
|
||||||
|
else if ( m_windowStyle &wxDOUBLE_BORDER)
|
||||||
|
{
|
||||||
|
return 2 ;
|
||||||
|
}
|
||||||
|
else if (m_windowStyle &wxSIMPLE_BORDER)
|
||||||
|
{
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
return 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
long wxWindow::MacGetBottomBorderSize( ) const
|
||||||
|
{
|
||||||
|
if( m_macWindowData )
|
||||||
|
return 0 ;
|
||||||
|
|
||||||
|
if (m_windowStyle & wxRAISED_BORDER || m_windowStyle & wxSUNKEN_BORDER )
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
else if ( m_windowStyle &wxDOUBLE_BORDER)
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
else if (m_windowStyle &wxSIMPLE_BORDER)
|
||||||
|
{
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
return 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
long wxWindow::MacRemoveBordersFromStyle( long style )
|
long wxWindow::MacRemoveBordersFromStyle( long style )
|
||||||
{
|
{
|
||||||
return style & ~( wxDOUBLE_BORDER | wxSUNKEN_BORDER | wxRAISED_BORDER | wxBORDER | wxSTATIC_BORDER ) ;
|
return style & ~( wxDOUBLE_BORDER | wxSUNKEN_BORDER | wxRAISED_BORDER | wxBORDER | wxSTATIC_BORDER ) ;
|
||||||
|
@@ -423,7 +423,7 @@ xpmParseHeader(data)
|
|||||||
if (!l)
|
if (!l)
|
||||||
return (XpmFileInvalid);
|
return (XpmFileInvalid);
|
||||||
buf[l] = '\0';
|
buf[l] = '\0';
|
||||||
#if defined(macintosh) ||<EFBFBD>defined(__APPLE__)
|
#if defined(macintosh) || defined(__APPLE__)
|
||||||
ptr = strrchr(buf, '_');
|
ptr = strrchr(buf, '_');
|
||||||
#else
|
#else
|
||||||
ptr = rindex(buf, '_');
|
ptr = rindex(buf, '_');
|
||||||
|
BIN
src/makemac.mcp
BIN
src/makemac.mcp
Binary file not shown.
Reference in New Issue
Block a user