public:
// the virtual functions which may/must be overridden in the derived class
// -----------------------------------------------------------------------
-
+#ifdef __WXMAC_X__
+ virtual ~wxAppBase() {} // Added min for Mac X
+#endif
// called during the program initialization, returning FALSE from here
// prevents the program from continuing - it's a good place to create
// the top level program window and return TRUE.
// be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this
// code if required.
-#if !wxUSE_GUI || defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || (defined(__DARWIN__) && defined(__WXMAC__))
+#if !wxUSE_GUI || defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || (defined(__WXMAC__) && defined(__UNIX__))
#define IMPLEMENT_WXWIN_MAIN \
extern int wxEntry( int argc, char *argv[] ); \
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
#include "wx/colour.h"
#include "wx/gdicmn.h"
-#if defined( __WXMAC__ ) && defined( TARGET_CARBON )
-#include <PMApplication.h>
+#if defined(__WXMAC__) && defined(TARGET_CARBON)
+ #if !defined(__UNIX__)
+ #include <PMApplication.h>
+ #endif
#endif
-#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__)) && wxUSE_POSTSCRIPT
+#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || defined(__WXMAC__)) && wxUSE_POSTSCRIPT
class WXDLLEXPORT wxPrintSetupData;
#endif
void operator=(const wxPrintData& data);
// For compatibility
-#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__)) && wxUSE_POSTSCRIPT
+#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || defined(__WXMAC__)) && wxUSE_POSTSCRIPT
void operator=(const wxPrintSetupData& setupData);
#endif
void SetNativeData(void* data) { m_devMode = data; }
void* GetNativeDataDevNames() const { return m_devNames; }
void SetNativeDataDevNames(void* data) { m_devNames = data; }
-#elif defined( __WXMAC__)
+#elif defined(__WXMAC__)
void ConvertToNative();
void ConvertFromNative();
#endif
void ConvertFromNative();
void SetOwnerWindow(wxWindow* win);
void* GetNativeData() const { return m_printDlgData; }
-#elif defined( __WXMAC__)
+#elif defined(__WXMAC__)
void ConvertToNative();
void ConvertFromNative();
#endif
void ConvertFromNative();
void SetOwnerWindow(wxWindow* win);
void* GetNativeData() const { return m_pageSetupData; }
-#elif defined( __WXMAC__)
+#elif defined(__WXMAC__)
void ConvertToNative();
void ConvertFromNative();
#endif
class WXDLLEXPORT wxControlBase : public wxWindow
{
public:
+#ifdef __WXMAC_X__
+ virtual ~wxControlBase() {} // Added min for Mac X
+#endif
// simulates the event of given type (i.e. wxButton::Command() is just as
// if the button was clicked)
virtual void Command(wxCommandEvent &event);
{
public:
wxControlWithItems() { m_clientDataItemsType = ClientData_None; }
+#ifdef __WXMAC_X__
+ virtual ~wxControlWithItems() {} // Added min for Mac X
+#endif
// adding items
// ------------
#define OS2EMX_PLAIN_CHAR
#endif
-#elif defined(applec) || defined(THINK_C) || ( defined( __MWERKS__ ) && !defined(__INTEL__) )
+ #if defined(__APPLE__)
+ // MacOS X
+ #ifndef __WXMAC__
+ #define __WXMAC__
+ #endif
+ #ifndef __WXMAC_X__
+ #define __WXMAC_X__
+ #endif
+
+ #define PM_USE_SESSION_APIS 0
+ #include <Carbon/Carbon.h>
+ #endif
+#elif defined(applec) || defined(THINK_C) || (defined(__MWERKS__) && !defined(__INTEL__))
// MacOS
+#elif defined(__WXMAC__) && defined(__APPLE__)
+ // MacOS X
+ #define __UNIX_LIKE__
+
+ #ifndef __WXMAC__
+ #define __WXMAC__
+ #endif
+ #ifndef __WXMAC_X__
+ #define __WXMAC_X__
+ #endif
+
+ #define PM_USE_SESSION_APIS 0
+ #include <Carbon/Carbon.h>
#elif defined(__OS2__)
#if defined(__IBMCPP__)
#define __VISAGEAVER__ __IBMCPP__
class WXDLLEXPORT wxDialogBase : public wxPanel
{
public:
+#ifdef __WXMAC_X__
+ ~wxDialogBase() {} // Added min for Mac X
+#endif
// the modal dialogs have a return code - usually the id of the last
// pressed button
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
#elif defined(__WXQT__)
#include "wx/qt/dirdlg.h"
#elif defined(__WXMAC__)
+#ifdef __WXMAC_X__
+#include "wx/generic/dirdlgg.h"
+#else
#include "wx/mac/dirdlg.h"
+#endif
#elif defined(__WXPM__)
#include "wx/os2/dirdlg.h"
#elif defined(__WXSTUBS__)
// { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src);
// so using a temporary variable instead.
// ----------------------------------------------------------------------------
+// __MAC_X__ added min ~name() below for compiling Mac X
#define _WX_DEFINE_ARRAY(T, name, classexp) \
typedef int (CMPFUNC_CONV *CMPFUNC##T)(T *pItem1, T *pItem2); \
classexp name : public wxBaseArray \
if ( type > sizelong ) \
{ wxFAIL_MSG( _WX_ERROR_SIZEOF ); } \
} \
+ ~name() {} \
\
name& operator=(const name& src) \
{ wxBaseArray* temp = (wxBaseArray*) this; \
#elif defined(__WINDOWS__)
# include <windows.h> // needed to get HMODULE
typedef HMODULE wxDllType;
+#elif defined(__APPLE__) && defined(__UNIX__)
+ typedef void *wxDllType;
#elif defined(__WXMAC__)
typedef CFragConnectionID wxDllType;
#else
#elif defined(__WXQT__)
#include "wx/qt/filedlg.h"
#elif defined(__WXMAC__)
+#ifdef __WXMAC_X__
+#include "wx/generic/filedlgg.h"
+#else
#include "wx/mac/filedlg.h"
+#endif
#elif defined(__WXPM__)
#include "wx/os2/filedlg.h"
#elif defined(__WXSTUBS__)
// ----------------------------------------------------------------------------
// define off_t
-
-#if !defined(__WXMAC__) || defined(__DARWIN__)
+#if !defined(__WXMAC__) || defined(__UNIX__)
#include <sys/types.h>
#else
typedef long off_t;
#define wxFILE_SEP_PATH_MAC wxT(':')
// separator in the path list (as in PATH environment variable)
+// there is no PATH variable in Classic Mac OS so just use the
+// semicolon (it must be different from the file name separator)
// NB: these are strings and not characters on purpose!
#define wxPATH_SEP_DOS wxT(";")
#define wxPATH_SEP_UNIX wxT(":")
+#define wxPATH_SEP_MAC wxT(";")
// platform independent versions
#ifdef __UNIX__
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_UNIX
#define wxPATH_SEP wxPATH_SEP_UNIX
#elif defined(__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
{
public:
// creator function
+#ifdef __WXMAC_X__
+ virtual ~wxFontBase() {} // Added min for Mac X
+#endif
// from the font components
static wxFont *New(
public:
// construction
wxFrameBase();
+#ifdef __WXMAC_X__
+ virtual ~wxFrameBase() {} // Added min for Mac X
+#endif
wxFrame *New(wxWindow *parent,
wxWindowID id,
#ifdef __WXMSW__
#define wxMulDivInt32( a , b , c ) ::MulDiv( a , b , c )
#elif defined( __WXMAC__ )
+ #ifdef __WXMAC_X__
+ #include <CarbonCore/Math64.h>
+ #else
#include "Math64.h"
+ #endif
#define wxMulDivInt32( a , b , c ) S32Set( S64Div( S64Multiply( S64Set(a) , S64Set(b) ) , S64Set(c) ) )
#else
#define wxMulDivInt32( a , b , c ) ((wxInt32)((a)*(((wxDouble)b)/((wxDouble)c))))
{
public:
wxList(int key_type = wxKEY_NONE) : wxObjectList((wxKeyType)key_type) { }
+#ifdef __WXMAC_X__
+ ~wxList() {} // Added min for Mac X
+#endif
wxList& operator=(const wxList& list)
{ return (wxList&)wxListBase::operator=(list); }
public:
// all generic methods are in wxControlWithItems, except for the following
// ones which are not yet implemented by wxChoice/wxCombobox
+#ifdef __WXMAC_X__
+ virtual ~wxListBoxBase() {} // Added min for Mac X
+#endif
void Insert(const wxString& item, int pos)
{ DoInsert(item, pos); }
class WXDLLEXPORT wxIcon;
class WXDLLEXPORT wxCursor;
-GWorldPtr wxMacCreateGWorld( int height , int widtdh , int depth ) ;
-void wxMacDestroyGWorld( GWorldPtr gw ) ;
+GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
+void wxMacDestroyGWorld( GWorldPtr gw ) ;
PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL ) ;
-void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
+void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
CTabHandle wxMacCreateColorTable( int numColors ) ;
// A mask is a mono bitmap used for drawing bitmaps
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
public:
wxBitmapHandler() { m_name = ""; m_extension = ""; m_type = 0; };
+#ifdef __WXMAC_X__
+ virtual ~wxBitmapHandler() {} // Added min for Mac X
+#endif
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
// Initialize with XPM data
wxBitmap(const char **data);
+ wxBitmap(char **data);
// Load a file or resource
wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_PICT_RESOURCE);
public:
void SetHBITMAP(WXHBITMAP bmp);
inline WXHBITMAP GetHBITMAP() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hBitmap : 0); }
+
bool FreeResource(bool force = FALSE);
};
#endif
#include "wx/listbox.h"
-#if !defined(__MWERKS__) && !defined(__MACH__)
+#if !defined(__MWERKS__) && !defined(__UNIX__)
typedef unsigned int size_t;
#endif
const wxString& name = wxChoiceNameStr);
virtual void Append(const wxString& item);
+ // Added min Append and GetClientData
+ virtual void Append(const wxString& item, void *client_data);
+ virtual void *GetClientData(int index) const;
virtual void Delete(int n);
virtual void Clear();
virtual int GetSelection() const ;
virtual void SetLabel(const wxString& title) ;
wxList& GetSubcontrols() { return m_subControls; }
-
+
void OnEraseBackground(wxEraseEvent& event);
-
- virtual bool Enable(bool enabled) ;
- virtual bool Show(bool show) ;
-
- virtual void MacRedrawControl () ;
- virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
- virtual void MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label ,
- const wxPoint& pos,
- const wxSize& size, long style,
- const wxValidator& validator,
- const wxString& name , Rect *outBounds , StringPtr maclabel ) ;
- virtual void MacPostControlCreate() ;
- virtual void MacAdjustControlRect() ;
- virtual ControlHandle MacGetContainerForEmbedding() ;
- virtual void MacSuperChangedPosition() ;
- virtual void MacSuperEnabled( bool enabled ) ;
- virtual void MacSuperShown( bool show ) ;
- virtual bool MacCanFocus() const ;
-
- virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags ) ;
- virtual void OnKeyDown( wxKeyEvent &event ) ;
- virtual void OnMouseEvent( wxMouseEvent &event ) ;
- virtual void OnPaint(wxPaintEvent& event) ;
- virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL) ;
- ControlHandle GetMacControl() { return m_macControl ;}
+
+ virtual bool Enable(bool enabled) ;
+ virtual bool Show(bool show = TRUE) ;
+
+ virtual void MacRedrawControl () ;
+ virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
+ virtual void MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label ,
+ const wxPoint& pos,
+ const wxSize& size, long style,
+ const wxValidator& validator,
+ const wxString& name ,
+ Rect *outBounds ,
+ StringPtr maclabel ) ;
+ virtual void MacPostControlCreate() ;
+ virtual void MacAdjustControlRect() ;
+ virtual ControlHandle MacGetContainerForEmbedding() ;
+ virtual void MacSuperChangedPosition() ;
+ virtual void MacSuperEnabled( bool enabled ) ;
+ virtual void MacSuperShown( bool show ) ;
+ virtual bool MacCanFocus() const ;
+
+ virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags ) ;
+ virtual void OnKeyDown( wxKeyEvent &event ) ;
+ virtual void OnMouseEvent( wxMouseEvent &event ) ;
+ virtual void OnPaint(wxPaintEvent& event) ;
+ virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL) ;
+ ControlHandle GetMacControl() { return m_macControl ;}
#if WXWIN_COMPATIBILITY
virtual void SetButtonColour(const wxColour& WXUNUSED(col)) { }
{
public:
wxDataObject();
+#ifdef __WXMAC_X__
+ ~wxDataObject() {} // Added min for Mac X
+#endif
virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const;
};
public:
- long XDEV2LOG(long x) const
+ wxCoord XDEV2LOG(wxCoord x) const
{
long new_x = x - m_deviceOriginX;
if (new_x > 0)
- return (long)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
+ return (wxCoord)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
else
- return (long)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
+ return (wxCoord)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
}
- long XDEV2LOGREL(long x) const
+ wxCoord XDEV2LOGREL(wxCoord x) const
{
if (x > 0)
- return (long)((double)(x) / m_scaleX + 0.5);
+ return (wxCoord)((double)(x) / m_scaleX + 0.5);
else
- return (long)((double)(x) / m_scaleX - 0.5);
+ return (wxCoord)((double)(x) / m_scaleX - 0.5);
}
- long YDEV2LOG(long y) const
+ wxCoord YDEV2LOG(wxCoord y) const
{
long new_y = y - m_deviceOriginY;
if (new_y > 0)
- return (long)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
+ return (wxCoord)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
else
- return (long)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
+ return (wxCoord)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
}
- long YDEV2LOGREL(long y) const
+ wxCoord YDEV2LOGREL(wxCoord y) const
{
if (y > 0)
- return (long)((double)(y) / m_scaleY + 0.5);
+ return (wxCoord)((double)(y) / m_scaleY + 0.5);
else
- return (long)((double)(y) / m_scaleY - 0.5);
+ return (wxCoord)((double)(y) / m_scaleY - 0.5);
}
- long XLOG2DEV(long x) const
+ wxCoord XLOG2DEV(wxCoord x) const
{
long new_x = x - m_logicalOriginX;
if (new_x > 0)
- return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
+ return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
else
- return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
+ return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
}
- long XLOG2DEVREL(long x) const
+ wxCoord XLOG2DEVREL(wxCoord x) const
{
if (x > 0)
- return (long)((double)(x) * m_scaleX + 0.5);
+ return (wxCoord)((double)(x) * m_scaleX + 0.5);
else
- return (long)((double)(x) * m_scaleX - 0.5);
+ return (wxCoord)((double)(x) * m_scaleX - 0.5);
}
- long YLOG2DEV(long y) const
+ wxCoord YLOG2DEV(wxCoord y) const
{
long new_y = y - m_logicalOriginY;
if (new_y > 0)
- return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
+ return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
else
- return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
+ return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
}
- long YLOG2DEVREL(long y) const
+ wxCoord YLOG2DEVREL(wxCoord y) const
{
if (y > 0)
- return (long)((double)(y) * m_scaleY + 0.5);
+ return (wxCoord)((double)(y) * m_scaleY + 0.5);
else
- return (long)((double)(y) * m_scaleY - 0.5);
+ return (wxCoord)((double)(y) * m_scaleY - 0.5);
}
//
GrafPtr m_macOrigPort ;
Rect m_macClipRect ;
Point m_macLocalOrigin ;
- AGAPortHelper m_macPortHelper ;
+ mutable AGAPortHelper m_macPortHelper ;
void MacSetupPort() const ;
void MacVerifySetup() const { if ( m_macPortId != m_macCurrentPortId ) MacSetupPort() ; }
public:
DECLARE_CLASS(wxPrinterDC)
+#if wxUSE_PRINTING_ARCHITECTURE
// Create a printer DC
wxPrinterDC(const wxPrintData& printdata );
~wxPrinterDC();
TPPrPort m_macPrintPort ;
#endif
wxPrintData m_printData ;
+#endif // wxUSE_PRINTING_ARCHITECTURE
};
#endif
class WXDLLEXPORT wxWindow;
+#ifndef __WXMAC_X__
class WXDLLEXPORT wxDataObject;
class WXDLLEXPORT wxTextDataObject;
class WXDLLEXPORT wxFileDataObject;
+#endif
class WXDLLEXPORT wxDropTarget;
class WXDLLEXPORT wxTextDropTarget;
class WXDLLEXPORT wxDropSource;
+#ifndef __WXMAC_X__
//-------------------------------------------------------------------------
// wxDataObject
//-------------------------------------------------------------------------
-class WXDLLEXPORT wxDataObject: public wxObject
+class WXDLLEXPORT wxDataObject : public wxObject
{
public:
// all data formats (values are the same as in windows.h, do not change!)
wxString m_files;
};
+#endif
+
//-------------------------------------------------------------------------
// wxDropTarget
//-------------------------------------------------------------------------
virtual wxDataFormat GetFormat(size_t n) const = 0;
};
+#ifndef __WXMAC_X__
//-------------------------------------------------------------------------
// wxTextDropTarget
//-------------------------------------------------------------------------
virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const;
};
+#endif
//-------------------------------------------------------------------------
// wxDropSource
//-------------------------------------------------------------------------
-enum wxDragResult
- {
- wxDragError, // error prevented the d&d operation from completing
- wxDragNone, // drag target didn't accept the data
- wxDragCopy, // the data was successfully copied
- wxDragMove, // the data was successfully moved
- wxDragCancel // the operation was cancelled by user (not an error)
- };
-
class WXDLLEXPORT wxDropSource: public wxObject
{
public:
// Returns the number of images in the image list.
int GetImageCount() const;
+
+ bool GetSize(int index, int&width, int &height) const;
// Operations
////////////////////////////////////////////////////////////////////////////
// implement containing class functions
wxFileType *GetFileTypeFromExtension(const wxString& ext);
+ wxFileType *GetOrAllocateFileTypeFromExtension(const wxString& ext) ;
wxFileType *GetFileTypeFromMimeType(const wxString& mimeType);
size_t EnumAllFileTypes(wxArrayString& mimetypes);
void AddFallback(const wxFileTypeInfo& ft) { m_fallbacks.Add(ft); }
+ // create a new filetype association
+ wxFileType *Associate(const wxFileTypeInfo& ftInfo);
+
+ // create a new filetype with the given name and extension
+ wxFileType *CreateFileType(const wxString& filetype, const wxString& ext);
+
private:
wxArrayFileTypeInfo m_fallbacks;
};
const wxFileType::MessageParameters&) const
{ return GetCommand(printCmd, "print"); }
+ size_t GetAllCommands(wxArrayString * verbs, wxArrayString * commands,
+ const wxFileType::MessageParameters& params) const;
+
+ bool Unassociate();
+
private:
// helper function
bool GetCommand(wxString *command, const char *verb) const;
#pragma interface "palette.h"
#endif
+#include "wx/colour.h"
#include "wx/gdiobj.h"
class WXDLLEXPORT wxPalette;
protected:
int filetype;
char filename[255];
- ImagePointerType RawImage; // Image data
+ ImagePointerType RawImage; // Image data
- int Width, Height; // Dimensions
- int Depth; // (bits x pixel)
- int ColorType; // Bit 1 = Palette used
- // Bit 2 = Color used
- // Bit 3 = Alpha used
+ int Width, Height; // Dimensions
+ int Depth; // (bits x pixel)
+ int ColorType; // Bit 1 = Palette used
+ // Bit 2 = Color used
+ // Bit 3 = Alpha used
- long EfeWidth; // Efective Width
+ long EfeWidth; // Efective Width
GWorldPtr lpbi;
int bgindex;
public:
wxPNGReader(void);
wxPNGReader (char* ImageFileName); // Read an image file
- ~wxPNGReader ();
+ virtual ~wxPNGReader ();
void Create(int width, int height, int deep, int colortype=-1);
#endif
#include "wx/control.h"
+#include "wx/slider.h"
+#include "wx/stattext.h"
WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
{
public:
// construction
- wxSpinButton() { }
+ wxSpinButton();
wxSpinButton(wxWindow *parent,
wxWindowID id = -1,
// accessors
+ virtual int GetMin() const;
+ virtual int GetMax() const;
virtual int GetValue() const;
virtual void SetValue(int val);
virtual void SetRange(int minVal, int maxVal);
#define UMA_USE_8_6 1
#endif
-#if defined(__POWERPC__) || defined(__MACH__)
-#define UMA_USE_APPEARANCE 1
-#define UMA_USE_WINDOWMGR 1
+#if defined(__POWERPC__) || defined(__APPLE__)
+ #define UMA_USE_APPEARANCE 1
+ #define UMA_USE_WINDOWMGR 1
+ #if defined(__APPLE__)
+ #include <Carbon/Carbon.h>
+ #endif
#else
-#define UMA_USE_APPEARANCE 0
-#define UMA_USE_WINDOWMGR 0
+ #define UMA_USE_APPEARANCE 0
+ #define UMA_USE_WINDOWMGR 0
#endif
#if !UMA_USE_8_6 && UMA_USE_WINDOWMGR
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
-#endif
\ No newline at end of file
+#endif
};
#endif
-#ifdef __UNIX__
+#if defined(__UNIX__) && !defined(__APPLE__)
#include <sys/socket.h>
#ifndef __VMS__
# include <sys/un.h>
#include "wx/msw/statbr95.h"
typedef wxStatusBar95 wxStatusBarReal;
-#elif defined(__WXMAC__)
+#elif defined(__WXMAC__) && !defined(__UNIX__)
#include "wx/mac/statusbr.h"
typedef wxStatusBarMac wxStatusBarReal;
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
-#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_ITEM_COLLAPSED(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_ITEM_COLLAPSING(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
-
#endif
// _WX_TREECTRL_H_
{ _T("%H:%M:%S"), _T("%H:%M") } // wx24h
};
- static wxChar s_bufTime[128];
+ wxStrncpy(ms_bufTime, m_time.Format(formats[ms_Format][ms_Precision]),
+ WXSIZEOF(ms_bufTime));
- wxStrncpy(s_bufTime, m_time.Format(formats[ms_Format][ms_Precision]),
- WXSIZEOF(s_bufTime));
-
- return s_bufTime;
+ return ms_bufTime;
}
private:
static tFormat ms_Format;
static tPrecision ms_Precision;
+ static wxChar ms_bufTime[128];
#if 0 // old wxTime members unused any more
clockTy sec; /* seconds since 1/1/1901 */
void SetOwner(wxEvtHandler *owner, int id = -1)
{ m_owner = owner; m_idTimer = id; }
+#ifdef __WXMAC_X__
+ virtual ~wxTimerBase() {} // Added min for Mac X
+#endif
+
// working with the timer
// ----------------------
#include "wx/gtk/wave.h"
#elif defined(__WXQT__)
#include "wx/qt/wave.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/wave.h"
#elif defined(__WXPM__)
#include "wx/os2/wave.h"
#elif defined(__WXMAC__)
#endif
*/
#else
- #define USE_PRECOMPILED_MAC_HEADERS 1 /*Set to 0 if you don't want to use precompiled MacHeaders*/
+ #define USE_PRECOMPILED_MAC_HEADERS 1 /*Set to 0 if you don't want to use precompiled MacHeaders*/
#endif
// automatically includes MacHeaders
#elif (__MWERKS__ >= 0x0900) && __INTEL__
# define wxUChar unsigned char
# endif
-# if defined(__FreeBSD__) || defined(__MACH__)
+# if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__UNIX__))
# undef _T
# endif
# elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS__) && defined(__INTEL__))
# define wxStricmp _stricmp
# define wxStrnicmp _strnicmp
-# elif defined(__UNIX__) || defined(__GNUWIN32__) || defined(__MACH__)
+# elif defined(__UNIX__) || defined(__GNUWIN32__)
# define wxStricmp strcasecmp
# define wxStrnicmp strncasecmp
# elif defined(__MWERKS__) && !defined(__INTEL__)
#undef WX_PRECOMP
#define wxUSE_GUI 1
#define OLDP2C 1
+#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
#include "wx/wx_cw_cm.h"
#ifdef __WXMSW__
#include <windows.h>
#define WX_PRECOMP
#define wxUSE_GUI 1
#define OLDP2C 1
+#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
#include "wx/wx_cw_cm.h"
#ifdef WX_PRECOMP
#include "wx/wxprec.h"
#define __WXDEBUG__ 1
#define wxUSE_GUI 1
#define OLDP2C 1
+#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
#include "wx/wx_cw_cm.h"
#ifdef __WXMSW__
#include <windows.h>
#define __WXDEBUG__ 1
#define wxUSE_GUI 1
#define OLDP2C 1
+#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
#include "wx/wx_cw_cm.h"
#ifdef WX_PRECOMP
#include "wx/wxprec.h"
else
return (void *)0;
}
+#elif defined(__APPLE__) && defined(__UNIX__)
+char *dlopen(char *path, int mode /* mode is ignored */);
+void *dlsym(void *handle, char *symbol);
+int dlclose(void *handle);
+char *dlerror();
+
+# define wxDllOpen(lib) dlopen(lib.fn_str(), 0)
+# define wxDllGetSymbol(handle, name) dlsym(handle, name)
+# define wxDllClose dlclose
#elif defined(__WINDOWS__)
// using LoadLibraryEx under Win32 to avoid name clash with LoadLibrary
# ifdef __WIN32__
{
wxDllType handle;
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && !defined(__UNIX__)
FSSpec myFSSpec ;
Ptr myMainAddr ;
Str255 myErrName ;
{
void *symbol = NULL; // return value
-#if defined( __WXMAC__ )
+#if defined(__WXMAC__) && !defined(__UNIX__)
Ptr symAddress ;
CFragSymbolClass symClass ;
Str255 symName ;
- strcpy( (char*) symName , name ) ;
- c2pstr( (char*) symName ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) symName , name ) ;
+#else
+ strcpy( (char *) symName , name ) ;
+ c2pstr( (char *) symName ) ;
+#endif
if ( FindSymbol( dllHandle , symName , &symAddress , &symClass ) == noErr )
symbol = (void *)symAddress ;
extern wxChar *wxBuffer;
-#ifdef __WXMAC__
-#include "morefile.h"
-#include "moreextr.h"
-#include "fullpath.h"
-#include "fspcompa.h"
+#if defined(__WXMAC__) && !defined(__UNIX__)
+ #include "morefile.h"
+ #include "moreextr.h"
+ #include "fullpath.h"
+ #include "fspcompa.h"
#endif
IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxStringList)
// and back again - or we get nasty problems with delimiters.
// Also, convert to lower case, since case is significant in UNIX.
-#ifdef __WXMAC__
+#if defined(__WXMAC__) && !defined(__UNIX__)
static char sMacFileNameConversion[ 1000 ] ;
return FALSE;
}
-#ifndef __VISAGECPP__
+#if !defined(__VISAGECPP__) && !defined(__WXMAC__)
// no chmod in VA. SHould be some permission API for HPFS386 partitions however
if ( chmod(file2, fbuf.st_mode) != 0 )
{
#include "wx/protocol/ftp.h"
#if defined(__WXMAC__)
- #include "/wx/mac/macsock.h"
+ #include "wx/mac/macsock.h"
#endif
#ifndef __MWERKS__
#ifdef __WXMAC__
-#include <PictUtils.h>
+#ifdef __UNIX__
+ #include <QD/PictUtils.h>
+#else
+ #include <PictUtils.h>
+#endif
extern CTabHandle wxMacCreateColorTable( int numColors ) ;
extern void wxMacDestroyColorTable( CTabHandle colors ) ;
extern void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
-extern GWorldPtr wxMacCreateGWorld( int height , int width , int depth ) ;
+extern GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
extern void wxMacDestroyGWorld( GWorldPtr gw ) ;
wxBitmap wxImage::ConvertToBitmap() const
m_fp = fp;
}
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && !defined(__UNIX__)
#define kDebuggerSignature 'MWDB'
static Boolean FindProcessBySignature(OSType signature, ProcessInfoRec* info)
str += wxT("\r\n") ;
OutputDebugString(str.c_str());
#endif // MSW
-#if defined(__WXMAC__) && wxUSE_GUI
+#if defined(__WXMAC__) && !defined(__WXMAC_X__) && wxUSE_GUI
Str255 pstr ;
strcpy( (char*) pstr , str.c_str() ) ;
strcat( (char*) pstr , ";g" ) ;
DebugStr(pstr);
#endif
}
-#endif // MSW
+#endif // Mac
}
// ----------------------------------------------------------------------------
#ifdef ENABLE_IPV6
IMPLEMENT_DYNAMIC_CLASS(wxIPV6address, wxSockAddress)
#endif
-#ifdef __UNIX__
+#if defined(__UNIX__) && !defined(__WXMAC_X__)
IMPLEMENT_DYNAMIC_CLASS(wxUNIXaddress, wxSockAddress)
#endif
#endif
-#ifdef __UNIX__
+#if defined(__UNIX__) && !defined(__WXMAC_X__)
// ---------------------------------------------------------------------------
// wxUNIXaddress
// ---------------------------------------------------------------------------
#if defined(__VISUALC__) || (defined(__MINGW32__) && wxUSE_NORLANDER_HEADERS)
#define wxVsnprintfA _vsnprintf
#endif
+#elif defined(__WXMAC__)
+ #define wxVsnprintfA vsnprintf
#else // !Windows
#ifdef HAVE_VSNPRINTF
#define wxVsnprintfA vsnprintf
#if defined(__VISUALC__)
#pragma message("Using sprintf() because no snprintf()-like function defined")
- #elif defined(__GNUG__) && !defined(__UNIX__)
- #warning "Using sprintf() because no snprintf()-like function defined"
- #elif defined(__MWERKS__)
+ #elif defined(__GNUG__)
#warning "Using sprintf() because no snprintf()-like function defined"
#endif //compiler
#endif // no vsnprintf
// NB: wxVsnprintf() may return either less than the buffer size or -1 if
// there is not enough place depending on implementation
- int iLen = wxVsnprintfA(szScratch, WXSIZEOF(szScratch), pszFormat, argptr);
+ int iLen = wxVsnprintfA(szScratch, WXSIZEOF(szScratch), (char *)pszFormat, argptr);
if ( iLen != -1 ) {
// the whole string is in szScratch
*this = szScratch;
wxTime::tFormat wxTime::ms_Format = wxTime::wx12h;
wxTime::tPrecision wxTime::ms_Precision = wxTime::wxStdMinSec;
+wxChar wxTime::ms_bufTime[128];
#endif
IMPLEMENT_ABSTRACT_CLASS(wxVariantData, wxObject)
// the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here
#if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH)
#include "../zlib/zlib.h"
+#elif defined(__WXMAC__) && defined(__UNIX__)
+ #include <Zip/zlib.h>
#else
#include <zlib.h>
#endif
{
// set colours
SetForegroundColour(*wxBLACK);
-#if !defined(__WXPM__)
+#if !defined(__WXPM__) && !defined(__WXMAC__)
SetBackgroundColour(wxColour(0xc3ffff));
#else
// What is 0xc3ffff, try some legable documentation for those of us who don't memorize hex codes??
-#include <wx/mac/uma.h>
-#include <wx/mac/aga.h>
+#include "wx/mac/uma.h"
+#include "wx/mac/aga.h"
#if !TARGET_CARBON
pascal SInt32 AGAEditTextDefProc (SInt16 procID, ControlHandle theControl, ControlDefProcMessage message, SInt32 param) ;
pascal SInt32 AGAStaticGroupBoxTextDefProc (SInt16 procID, ControlHandle theControl, ControlDefProcMessage message, SInt32 param) ;
-#define B 13
-#define W 0
+#define B 13
+#define W 0
SInt16 kAGARootControlProcID ;
int gAGABackgroundColor = 0 ;
-const RGBColor gAGAColorArray[] = { {0xFFFF, 0xFFFF, 0xFFFF}, // W
- {0xEEEE, 0xEEEE, 0xEEEE}, // 1
- {0xDDDD, 0xDDDD, 0xDDDD}, // 2
- {0xCCCC, 0xCCCC, 0xCCCC}, // 3
- {0xBBBB, 0xBBBB, 0xBBBB}, // 4
- {0xAAAA, 0xAAAA, 0xAAAA}, // 5
- {0x9999, 0x9999, 0x9999}, // 6
- {0x8888, 0x8888, 0x8888}, // 7
- {0x7777, 0x7777, 0x7777}, // 8
- {0x6666, 0x6666, 0x6666}, // 9
- {0x5555, 0x5555, 0x5555}, // 10
- {0x4444, 0x4444, 0x4444}, // 11
- {0x2222, 0x2222, 0x2222}, // 12
- {0x0000, 0x0000, 0x0000} // B
+const RGBColor gAGAColorArray[] = {
+ {0xFFFF, 0xFFFF, 0xFFFF}, // W
+ {0xEEEE, 0xEEEE, 0xEEEE}, // 1
+ {0xDDDD, 0xDDDD, 0xDDDD}, // 2
+ {0xCCCC, 0xCCCC, 0xCCCC}, // 3
+ {0xBBBB, 0xBBBB, 0xBBBB}, // 4
+ {0xAAAA, 0xAAAA, 0xAAAA}, // 5
+ {0x9999, 0x9999, 0x9999}, // 6
+ {0x8888, 0x8888, 0x8888}, // 7
+ {0x7777, 0x7777, 0x7777}, // 8
+ {0x6666, 0x6666, 0x6666}, // 9
+ {0x5555, 0x5555, 0x5555}, // 10
+ {0x4444, 0x4444, 0x4444}, // 11
+ {0x2222, 0x2222, 0x2222}, // 12
+ {0x0000, 0x0000, 0x0000} // B
};
char LAGADefaultOutline_mCorners[4][5][5] = {
{
}
-#endif
+#endif // !TARGET_CARBON
+
AGAPortHelper::AGAPortHelper( GrafPtr newport)
{
GetPort( &port ) ;
#pragma implementation "app.h"
#endif
+#include "wx/window.h"
#include "wx/frame.h"
#include "wx/app.h"
#include "wx/utils.h"
#include "wx/module.h"
#include "wx/memory.h"
#include "wx/tooltip.h"
+#include "wx/menu.h"
#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
#endif
// mac
-#if __option(profile)
+#ifndef __UNIX__
+ #if __option(profile)
#include <profiler.h>
+ #endif
#endif
#include "apprsrc.h"
-#include <wx/mac/uma.h>
-#include <wx/mac/macnotfy.h>
+#include "wx/mac/uma.h"
+#include "wx/mac/macnotfy.h"
#if wxUSE_SOCKETS
-#include <OpenTransport.h>
-#include <OpenTptInternet.h>
+ #ifdef __APPLE__
+ #include <OT/OpenTransport.h>
+ #else
+ #include <OpenTransport.h>
+ #include <OpenTptInternet.h>
+ #endif
#endif
extern char *wxBuffer;
UMAInitToolbox( 4 ) ;
UMAShowWatchCursor() ;
- AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , NewAEEventHandlerProc(AEHandleODoc) , (long) wxTheApp , FALSE ) ;
- AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , NewAEEventHandlerProc(AEHandleOApp) , (long) wxTheApp , FALSE ) ;
- AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , NewAEEventHandlerProc(AEHandlePDoc) , (long) wxTheApp , FALSE ) ;
- AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , NewAEEventHandlerProc(AEHandleQuit) , (long) wxTheApp , FALSE ) ;
+#ifdef __UNIX__
+ AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , AEHandleODoc ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , AEHandleOApp ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , AEHandlePDoc ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , AEHandleQuit ,
+ (long) wxTheApp , FALSE ) ;
+#else
+ AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , NewAEEventHandlerProc(AEHandleODoc) ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , NewAEEventHandlerProc(AEHandleOApp) ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , NewAEEventHandlerProc(AEHandlePDoc) ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , NewAEEventHandlerProc(AEHandleQuit) ,
+ (long) wxTheApp , FALSE ) ;
+#endif
// test the minimal configuration necessary
return FALSE ;
}
-#if __option(profile)
+#ifndef __UNIX__
+ #if __option(profile)
ProfilerInit( collectDetailed, bestTimeBase , 20000 , 40 ) ;
+ #endif
#endif
// now avoid exceptions thrown for new (bad_alloc)
+#ifndef __UNIX__
std::__throws_bad_alloc = FALSE ;
+#endif
s_macCursorRgn = ::NewRgn() ;
wxBitmap::InitStandardHandlers();
wxModule::RegisterModules();
- if (!wxModule::InitializeModules())
+ if (!wxModule::InitializeModules()) {
return FALSE;
+ }
wxWinMacWindowList = new wxList(wxKEY_INTEGER);
wxWinMacControlList = new wxList(wxKEY_INTEGER);
wxClassInfo::CleanUpClasses();
-#if __option(profile)
- ProfilerDump( "\papp.prof" ) ;
- ProfilerTerm() ;
+#ifndef __UNIX__
+ #if __option(profile)
+ ProfilerDump( "\papp.prof" ) ;
+ ProfilerTerm() ;
+ #endif
#endif
delete wxTheApp;
wxDebugContext::SetCheckpoint();
#endif
#endif
- if (!wxApp::Initialize())
+ if (!wxApp::Initialize()) {
return 0;
+ }
// create the application object or ensure that one already exists
if (!wxTheApp)
{
wxApp::CleanUp();
return retValue;
-};
+}
// Static member initialization
wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction) NULL;
s_lastMouseDown = 0;
break;
case inGrow:
+ {
int growResult = GrowWindow(window , ev->where, &screenBits.bounds);
if (growResult != 0)
{
}
}
s_lastMouseDown = 0;
+ }
break;
case inZoomIn:
case inZoomOut:
wxWindow* currentMouseWindow = NULL ;
- MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) , ¤tMouseWindow ) ;
+ wxWindow::MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) ,
+ ¤tMouseWindow ) ;
if ( currentMouseWindow != wxWindow::s_lastMouseWindow )
{
#pragma implementation "bitmap.h"
#endif
+#include "wx/wx.h"
#include "wx/setup.h"
#include "wx/utils.h"
#include "wx/palette.h"
extern "C"
{
+#ifdef __UNIX__
+ #include "xpm/xpm.h"
+#else
#include "xpm.h"
+#endif
} ;
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
#endif
-#include <PictUtils.h>
+#ifdef __UNIX__
+ #include <QD/PictUtils.h>
+#else
+ #include <PictUtils.h>
+#endif
CTabHandle wxMacCreateColorTable( int numColors )
{
CTabHandle newColors; /* Handle to the new color table */
- short index; /* Index into the table of colors */
+
/* Allocate memory for the color table */
newColors = (CTabHandle)NewHandleClear( sizeof (ColorTable) +
sizeof (ColorSpec) * (numColors - 1) );
(**newColors).ctTable[index].rgb.blue = 0 ; // someBlueValue;
}
-GWorldPtr wxMacCreateGWorld( int height , int width , int depth )
+GWorldPtr wxMacCreateGWorld( int width , int height , int depth )
{
OSErr err = noErr ;
GWorldPtr port ;
- Rect rect = { 0 , 0 , width , height } ;
+ Rect rect = { 0 , 0 , height , width } ;
if ( depth < 0 )
{
return port ;
}
return NULL ;
-}
+}
void wxMacDestroyGWorld( GWorldPtr gw )
{
default :
// unkown type ?
break ;
- } ;
+ }
if (m_bitmapMask)
{
M_BITMAPDATA->m_numColors = 0;
if ( no_bits == 1 )
{
- M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
- M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ;
+ M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
+ M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ;
M_BITMAPDATA->m_ok = (M_BITMAPDATA->m_hBitmap != NULL ) ;
CGrafPtr origPort ;
if ( the_width % 16 )
{
linesize += 2 ;
- } ;
+ }
RGBColor colors[2] = {
{ 0xFFFF , 0xFFFF , 0xFFFF } ,
{ 0, 0 , 0 }
} ;
- for( int y = 0 ; y < the_height ; ++y , linestart += linesize )
+ for ( int y = 0 ; y < the_height ; ++y , linestart += linesize )
{
- for( int x = 0 ; x < the_width ; ++x )
+ for ( int x = 0 ; x < the_width ; ++x )
{
int index = x / 8 ;
int bit = x % 8 ;
}
else
{
- //multicolor BITMAPs not yet implemented
+ wxFAIL_MSG(wxT("multicolor BITMAPs not yet implemented"));
}
if ( wxTheBitmapList )
(void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
}
+wxBitmap::wxBitmap(char **data)
+{
+ (void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
+}
+
bool wxBitmap::Create(int w, int h, int d)
{
UnRef();
{
Str255 theName ;
- strcpy( (char*) theName , name ) ;
- c2pstr( (char*) theName ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) theName , name ) ;
+#else
+ strcpy( (char *) theName , name ) ;
+ c2pstr( (char *)theName ) ;
+#endif
PicHandle thePict = (PicHandle ) GetNamedResource( 'PICT' , theName ) ;
if ( thePict )
#endif
#include "wx/button.h"
+#include "wx/panel.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
btnOldDefault = panel->GetDefaultItem();
panel->SetDefaultItem(this);
}
-
- if ( btnOldDefault && btnOldDefault->m_macControl )
- {
- UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart , kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)0) ) ;
- }
- if ( m_macControl )
- {
- UMASetControlData( m_macControl , kControlButtonPart , kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)1) ) ;
- }
+
+#ifdef __UNIX__
+ Boolean inData;
+ if ( btnOldDefault && btnOldDefault->m_macControl )
+ {
+ inData = 0;
+ UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
+ kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
+ }
+ if ( m_macControl )
+ {
+ inData = 1;
+ UMASetControlData( m_macControl , kControlButtonPart ,
+ kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
+ }
+#else
+ if ( btnOldDefault && btnOldDefault->m_macControl )
+ {
+ UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
+ kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)0) ) ;
+ }
+ if ( m_macControl )
+ {
+ UMASetControlData( m_macControl , kControlButtonPart ,
+ kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)1) ) ;
+ }
+#endif
}
wxSize wxButton::DoGetBestSize() const
-#include <wx/mac/uma.h>
-#include <wx/mac/aga.h>
+#include "wx/mac/uma.h"
+#include "wx/mac/aga.h"
#if !TARGET_CARBON
pascal SInt32 AGAEditTextDefProc (SInt16 procID, ControlHandle theControl, ControlDefProcMessage message, SInt32 param) ;
pascal SInt32 AGAStaticGroupBoxTextDefProc (SInt16 procID, ControlHandle theControl, ControlDefProcMessage message, SInt32 param) ;
-#define B 13
-#define W 0
+#define B 13
+#define W 0
SInt16 kAGARootControlProcID ;
int gAGABackgroundColor = 0 ;
-const RGBColor gAGAColorArray[] = { {0xFFFF, 0xFFFF, 0xFFFF}, // W
- {0xEEEE, 0xEEEE, 0xEEEE}, // 1
- {0xDDDD, 0xDDDD, 0xDDDD}, // 2
- {0xCCCC, 0xCCCC, 0xCCCC}, // 3
- {0xBBBB, 0xBBBB, 0xBBBB}, // 4
- {0xAAAA, 0xAAAA, 0xAAAA}, // 5
- {0x9999, 0x9999, 0x9999}, // 6
- {0x8888, 0x8888, 0x8888}, // 7
- {0x7777, 0x7777, 0x7777}, // 8
- {0x6666, 0x6666, 0x6666}, // 9
- {0x5555, 0x5555, 0x5555}, // 10
- {0x4444, 0x4444, 0x4444}, // 11
- {0x2222, 0x2222, 0x2222}, // 12
- {0x0000, 0x0000, 0x0000} // B
+const RGBColor gAGAColorArray[] = {
+ {0xFFFF, 0xFFFF, 0xFFFF}, // W
+ {0xEEEE, 0xEEEE, 0xEEEE}, // 1
+ {0xDDDD, 0xDDDD, 0xDDDD}, // 2
+ {0xCCCC, 0xCCCC, 0xCCCC}, // 3
+ {0xBBBB, 0xBBBB, 0xBBBB}, // 4
+ {0xAAAA, 0xAAAA, 0xAAAA}, // 5
+ {0x9999, 0x9999, 0x9999}, // 6
+ {0x8888, 0x8888, 0x8888}, // 7
+ {0x7777, 0x7777, 0x7777}, // 8
+ {0x6666, 0x6666, 0x6666}, // 9
+ {0x5555, 0x5555, 0x5555}, // 10
+ {0x4444, 0x4444, 0x4444}, // 11
+ {0x2222, 0x2222, 0x2222}, // 12
+ {0x0000, 0x0000, 0x0000} // B
};
char LAGADefaultOutline_mCorners[4][5][5] = {
{
}
-#endif
+#endif // !TARGET_CARBON
+
AGAPortHelper::AGAPortHelper( GrafPtr newport)
{
GetPort( &port ) ;
#pragma implementation "app.h"
#endif
+#include "wx/window.h"
#include "wx/frame.h"
#include "wx/app.h"
#include "wx/utils.h"
#include "wx/module.h"
#include "wx/memory.h"
#include "wx/tooltip.h"
+#include "wx/menu.h"
#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
#endif
// mac
-#if __option(profile)
+#ifndef __UNIX__
+ #if __option(profile)
#include <profiler.h>
+ #endif
#endif
#include "apprsrc.h"
-#include <wx/mac/uma.h>
-#include <wx/mac/macnotfy.h>
+#include "wx/mac/uma.h"
+#include "wx/mac/macnotfy.h"
#if wxUSE_SOCKETS
-#include <OpenTransport.h>
-#include <OpenTptInternet.h>
+ #ifdef __APPLE__
+ #include <OT/OpenTransport.h>
+ #else
+ #include <OpenTransport.h>
+ #include <OpenTptInternet.h>
+ #endif
#endif
extern char *wxBuffer;
UMAInitToolbox( 4 ) ;
UMAShowWatchCursor() ;
- AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , NewAEEventHandlerProc(AEHandleODoc) , (long) wxTheApp , FALSE ) ;
- AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , NewAEEventHandlerProc(AEHandleOApp) , (long) wxTheApp , FALSE ) ;
- AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , NewAEEventHandlerProc(AEHandlePDoc) , (long) wxTheApp , FALSE ) ;
- AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , NewAEEventHandlerProc(AEHandleQuit) , (long) wxTheApp , FALSE ) ;
+#ifdef __UNIX__
+ AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , AEHandleODoc ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , AEHandleOApp ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , AEHandlePDoc ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , AEHandleQuit ,
+ (long) wxTheApp , FALSE ) ;
+#else
+ AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , NewAEEventHandlerProc(AEHandleODoc) ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , NewAEEventHandlerProc(AEHandleOApp) ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , NewAEEventHandlerProc(AEHandlePDoc) ,
+ (long) wxTheApp , FALSE ) ;
+ AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , NewAEEventHandlerProc(AEHandleQuit) ,
+ (long) wxTheApp , FALSE ) ;
+#endif
// test the minimal configuration necessary
return FALSE ;
}
-#if __option(profile)
+#ifndef __UNIX__
+ #if __option(profile)
ProfilerInit( collectDetailed, bestTimeBase , 20000 , 40 ) ;
+ #endif
#endif
// now avoid exceptions thrown for new (bad_alloc)
+#ifndef __UNIX__
std::__throws_bad_alloc = FALSE ;
+#endif
s_macCursorRgn = ::NewRgn() ;
wxBitmap::InitStandardHandlers();
wxModule::RegisterModules();
- if (!wxModule::InitializeModules())
+ if (!wxModule::InitializeModules()) {
return FALSE;
+ }
wxWinMacWindowList = new wxList(wxKEY_INTEGER);
wxWinMacControlList = new wxList(wxKEY_INTEGER);
wxClassInfo::CleanUpClasses();
-#if __option(profile)
- ProfilerDump( "\papp.prof" ) ;
- ProfilerTerm() ;
+#ifndef __UNIX__
+ #if __option(profile)
+ ProfilerDump( "\papp.prof" ) ;
+ ProfilerTerm() ;
+ #endif
#endif
delete wxTheApp;
wxDebugContext::SetCheckpoint();
#endif
#endif
- if (!wxApp::Initialize())
+ if (!wxApp::Initialize()) {
return 0;
+ }
// create the application object or ensure that one already exists
if (!wxTheApp)
{
wxApp::CleanUp();
return retValue;
-};
+}
// Static member initialization
wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction) NULL;
s_lastMouseDown = 0;
break;
case inGrow:
+ {
int growResult = GrowWindow(window , ev->where, &screenBits.bounds);
if (growResult != 0)
{
}
}
s_lastMouseDown = 0;
+ }
break;
case inZoomIn:
case inZoomOut:
wxWindow* currentMouseWindow = NULL ;
- MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) , ¤tMouseWindow ) ;
+ wxWindow::MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) ,
+ ¤tMouseWindow ) ;
if ( currentMouseWindow != wxWindow::s_lastMouseWindow )
{
#pragma implementation "bitmap.h"
#endif
+#include "wx/wx.h"
#include "wx/setup.h"
#include "wx/utils.h"
#include "wx/palette.h"
extern "C"
{
+#ifdef __UNIX__
+ #include "xpm/xpm.h"
+#else
#include "xpm.h"
+#endif
} ;
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
#endif
-#include <PictUtils.h>
+#ifdef __UNIX__
+ #include <QD/PictUtils.h>
+#else
+ #include <PictUtils.h>
+#endif
CTabHandle wxMacCreateColorTable( int numColors )
{
CTabHandle newColors; /* Handle to the new color table */
- short index; /* Index into the table of colors */
+
/* Allocate memory for the color table */
newColors = (CTabHandle)NewHandleClear( sizeof (ColorTable) +
sizeof (ColorSpec) * (numColors - 1) );
(**newColors).ctTable[index].rgb.blue = 0 ; // someBlueValue;
}
-GWorldPtr wxMacCreateGWorld( int height , int width , int depth )
+GWorldPtr wxMacCreateGWorld( int width , int height , int depth )
{
OSErr err = noErr ;
GWorldPtr port ;
- Rect rect = { 0 , 0 , width , height } ;
+ Rect rect = { 0 , 0 , height , width } ;
if ( depth < 0 )
{
return port ;
}
return NULL ;
-}
+}
void wxMacDestroyGWorld( GWorldPtr gw )
{
default :
// unkown type ?
break ;
- } ;
+ }
if (m_bitmapMask)
{
M_BITMAPDATA->m_numColors = 0;
if ( no_bits == 1 )
{
- M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
- M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ;
+ M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
+ M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ;
M_BITMAPDATA->m_ok = (M_BITMAPDATA->m_hBitmap != NULL ) ;
CGrafPtr origPort ;
if ( the_width % 16 )
{
linesize += 2 ;
- } ;
+ }
RGBColor colors[2] = {
{ 0xFFFF , 0xFFFF , 0xFFFF } ,
{ 0, 0 , 0 }
} ;
- for( int y = 0 ; y < the_height ; ++y , linestart += linesize )
+ for ( int y = 0 ; y < the_height ; ++y , linestart += linesize )
{
- for( int x = 0 ; x < the_width ; ++x )
+ for ( int x = 0 ; x < the_width ; ++x )
{
int index = x / 8 ;
int bit = x % 8 ;
}
else
{
- //multicolor BITMAPs not yet implemented
+ wxFAIL_MSG(wxT("multicolor BITMAPs not yet implemented"));
}
if ( wxTheBitmapList )
(void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
}
+wxBitmap::wxBitmap(char **data)
+{
+ (void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
+}
+
bool wxBitmap::Create(int w, int h, int d)
{
UnRef();
{
Str255 theName ;
- strcpy( (char*) theName , name ) ;
- c2pstr( (char*) theName ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) theName , name ) ;
+#else
+ strcpy( (char *) theName , name ) ;
+ c2pstr( (char *)theName ) ;
+#endif
PicHandle thePict = (PicHandle ) GetNamedResource( 'PICT' , theName ) ;
if ( thePict )
#endif
#include "wx/button.h"
+#include "wx/panel.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
btnOldDefault = panel->GetDefaultItem();
panel->SetDefaultItem(this);
}
-
- if ( btnOldDefault && btnOldDefault->m_macControl )
- {
- UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart , kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)0) ) ;
- }
- if ( m_macControl )
- {
- UMASetControlData( m_macControl , kControlButtonPart , kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)1) ) ;
- }
+
+#ifdef __UNIX__
+ Boolean inData;
+ if ( btnOldDefault && btnOldDefault->m_macControl )
+ {
+ inData = 0;
+ UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
+ kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
+ }
+ if ( m_macControl )
+ {
+ inData = 1;
+ UMASetControlData( m_macControl , kControlButtonPart ,
+ kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
+ }
+#else
+ if ( btnOldDefault && btnOldDefault->m_macControl )
+ {
+ UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
+ kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)0) ) ;
+ }
+ if ( m_macControl )
+ {
+ UMASetControlData( m_macControl , kControlButtonPart ,
+ kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)1) ) ;
+ }
+#endif
}
wxSize wxButton::DoGetBestSize() const
// For compilers that support precompilation, includes "wx.h".
#include "wx/choice.h"
+#include "wx/menu.h"
#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
- int n, const wxString choices[],
- long style,
+ int n, const wxString choices[],
+ long style,
const wxValidator& validator,
const wxString& name)
{
SetControlMaximum( m_macControl , Number()) ;
}
+void wxChoice::Append(const wxString &item, void *client_data)
+{
+}
+
+void *wxChoice::GetClientData(int index) const
+{
+ return NULL;
+}
+
void wxChoice::Delete(int n)
{
::DeleteMenuItem( m_macPopUpMenuHandle , n + 1) ;
#endif
#include "wx/combobox.h"
+#include "wx/menu.h"
#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
wxString wxComboBox::GetString(int n) const
{
- Str255 text ;
- ::GetMenuItemText( m_macPopUpMenuHandle , n+1 , text ) ;
- p2cstr( text ) ;
- return wxString( text );
+ Str255 p_text ;
+ char c_text[255];
+ ::GetMenuItemText( m_macPopUpMenuHandle , n+1 , p_text ) ;
+#if TARGET_CARBON
+ p2cstrcpy( c_text, p_text ) ;
+#else
+ p2cstr( p_text ) ;
+ strcpy( c_text, (char *) p_text ) ;
+#endif
+ return wxString( c_text );
}
wxString wxComboBox::GetStringSelection() const
#endif
#include "wx/control.h"
+#include "wx/panel.h"
+#include "wx/app.h"
#include "wx/notebook.h"
#include "wx/tabctrl.h"
#include "wx/radiobox.h"
#include "wx/spinbutt.h"
+#include "wx/scrolbar.h"
+#include "wx/button.h"
+#include "wx/dialog.h"
+#include "wx/statbox.h"
+#include "wx/sizer.h"
+#include "wx/stattext.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
if ( wxMacLiveScrollbarActionUPP == NULL )
{
+#ifdef __UNIX__
+ wxMacLiveScrollbarActionUPP = NewControlActionUPP( wxMacLiveScrollbarActionProc );
+#else
wxMacLiveScrollbarActionUPP = NewControlActionProc( wxMacLiveScrollbarActionProc ) ;
+#endif
}
}
else
label = title ;
- strcpy( (char*) maclabel , label ) ;
- c2pstr( (char*) maclabel ) ;
-
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) maclabel , label ) ;
+#else
+ strcpy( (char *) maclabel , label ) ;
+ c2pstr( (char *) maclabel ) ;
+#endif
::SetControlTitle( m_macControl , maclabel ) ;
}
}
outBounds->bottom = outBounds->top + m_height - 2 * m_macVerticalBorder;
outBounds->right = outBounds->left + m_width - 2 * m_macHorizontalBorder ;
- strcpy( (char*) maclabel , label ) ;
+ char c_text[255];
+ strcpy( c_text , label ) ;
if( wxApp::s_macDefaultEncodingIsPC )
{
- wxMacConvertFromPCForControls( (char*) maclabel ) ;
+ wxMacConvertFromPCForControls( c_text ) ;
}
- c2pstr( (char*) maclabel ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) maclabel , c_text ) ;
+#else
+ strcpy( (char *) maclabel , c_text ) ;
+ c2pstr( (char *) maclabel ) ;
+#endif
}
void wxControl::MacPostControlCreate()
#endif
#include "wx/dc.h"
+#include "wx/app.h"
#include "wx/mac/uma.h"
#if __MSL__ >= 0x6000
{
if ( bmap->m_bitmapType == kMacBitmapTypePict )
{
- Rect bitmaprect = { 0 , 0 , bmap->m_height * scale , bmap->m_width * scale} ;
+ Rect bitmaprect = { 0 , 0 , int(bmap->m_height * scale) , int(bmap->m_width * scale)} ;
::OffsetRect( &bitmaprect , xx1 , yy1 ) ;
::DrawPicture( bmap->m_hPict , &bitmaprect ) ;
}
if (m_pen.GetStyle() == wxTRANSPARENT)
return;
- MacInstallPen() ;
+ MacInstallPen() ;
- int offset = (m_pen.GetWidth() - 1 ) / 2 ;
+ int offset = (m_pen.GetWidth() - 1 ) / 2 ;
long x1, x2 , y1 , y2 ;
x1 = XLOG2DEV(points[0].x + xoffset);
- y1 = YLOG2DEV(points[0].y + yoffset);
- ::MoveTo(x1 - offset ,y1 - offset );
+ y1 = YLOG2DEV(points[0].y + yoffset);
+ ::MoveTo(x1 - offset ,y1 - offset );
for (int i = 0; i < n-1; i++)
{
- long x2 = XLOG2DEV(points[i+1].x + xoffset);
- long y2 = YLOG2DEV(points[i+1].y + yoffset);
- ::LineTo(x2 - offset , y2 - offset );
+ x2 = XLOG2DEV(points[i+1].x + xoffset);
+ y2 = YLOG2DEV(points[i+1].y + yoffset);
+ ::LineTo(x2 - offset , y2 - offset );
}
}
PolyHandle polygon = OpenPoly() ;
long x1, x2 , y1 , y2 ;
x1 = XLOG2DEV(points[0].x + xoffset);
- y1 = YLOG2DEV(points[0].y + yoffset);
- ::MoveTo(x1,y1);
+ y1 = YLOG2DEV(points[0].y + yoffset);
+ ::MoveTo(x1,y1);
for (int i = 0; i < n-1; i++)
{
- long x2 = XLOG2DEV(points[i+1].x + xoffset);
- long y2 = YLOG2DEV(points[i+1].y + yoffset);
- ::LineTo(x2, y2);
+ x2 = XLOG2DEV(points[i+1].x + xoffset);
+ y2 = YLOG2DEV(points[i+1].y + yoffset);
+ ::LineTo(x2, y2);
}
ClosePoly() ;
if (m_brush.GetStyle() != wxTRANSPARENT)
{
MacInstallBrush() ;
- ::PaintRoundRect( &rect , radius * 2 , radius * 2 ) ;
+ ::PaintRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
};
if (m_pen.GetStyle() != wxTRANSPARENT)
{
MacInstallPen() ;
- ::FrameRoundRect( &rect , radius * 2 , radius * 2 ) ;
+ ::FrameRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
};
}
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
- RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ;
- RGBColor black = { 0,0,0} ;
- RGBForeColor( &m_textForegroundColour.GetPixel() ) ;
- RGBBackColor( &m_textBackgroundColour.GetPixel() ) ;
+ RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ;
+ RGBColor black = { 0,0,0} ;
+ RGBColor forecolor = m_textForegroundColour.GetPixel();
+ RGBColor backcolor = m_textBackgroundColour.GetPixel();
+ RGBForeColor( &forecolor ) ;
+ RGBBackColor( &backcolor ) ;
if ( LockPixels(bmappixels) )
{
if ( font )
{
::TextFont( font->m_macFontNum ) ;
- ::TextSize( m_scaleY * font->m_macFontSize ) ;
+ ::TextSize( short(m_scaleY * font->m_macFontSize) ) ;
::TextFace( font->m_macFontStyle ) ;
m_macFontInstalled = true ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
-
- ::RGBForeColor(&m_textForegroundColour.GetPixel() );
- ::RGBBackColor(&m_textBackgroundColour.GetPixel() );
+
+ RGBColor forecolor = m_textForegroundColour.GetPixel();
+ RGBColor backcolor = m_textBackgroundColour.GetPixel();
+ ::RGBForeColor( &forecolor );
+ ::RGBBackColor( &backcolor );
}
else
{
GetFNum( "\pGeneva" , &fontnum ) ;
::TextFont( fontnum ) ;
- ::TextSize( m_scaleY * 10 ) ;
+ ::TextSize( short(m_scaleY * 10) ) ;
::TextFace( 0 ) ;
// todo reset after spacing changes - or store the current spacing somewhere
m_macFontInstalled = true ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
- ::RGBForeColor( &(m_textForegroundColour.GetPixel()) );
- ::RGBBackColor(&m_textBackgroundColour.GetPixel() );
- }
+ RGBColor forecolor = m_textForegroundColour.GetPixel();
+ RGBColor backcolor = m_textBackgroundColour.GetPixel();
+ ::RGBForeColor( &forecolor );
+ ::RGBBackColor( &backcolor );
+ }
short mode = patCopy ;
if ( m_macPenInstalled )
return ;
- ::RGBForeColor(&m_pen.GetColour().GetPixel() );
- ::RGBBackColor(&m_backgroundBrush.GetColour().GetPixel() );
+ RGBColor forecolor = m_pen.GetColour().GetPixel();
+ RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
+ ::RGBForeColor( &forecolor );
+ ::RGBBackColor( &backcolor );
::PenNormal() ;
int penWidth = m_pen.GetWidth();
int penStyle = m_pen.GetStyle();
if (penStyle == wxSOLID)
+ {
::PenPat(GetQDGlobalsBlack(&blackColor));
+ }
else if (IS_HATCH(penStyle))
{
Pattern pat ;
// foreground
- ::RGBForeColor(&m_brush.GetColour().GetPixel() );
- ::RGBBackColor(&m_backgroundBrush.GetColour().GetPixel() );
+ RGBColor forecolor = m_brush.GetColour().GetPixel();
+ RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
+ ::RGBForeColor( &forecolor );
+ ::RGBBackColor( &backcolor );
int brushStyle = m_brush.GetStyle();
if (brushStyle == wxSOLID)
#include "wx/dcclient.h"
#include "wx/dcmemory.h"
#include "wx/region.h"
+#include "wx/window.h"
#include <math.h>
//-----------------------------------------------------------------------------
m_macPort = UMAGetWindowPort( windowref ) ;
MacSetupPort() ;
m_ok = TRUE ;
- long x , y ,w , h ;
+ wxCoord x , y ,w , h ;
window->GetUpdateRegion().GetBox( x , y , w , h ) ;
m_minY = m_minX = 0;
wxSize size = window->GetSize() ;
#endif
#include "wx/dcprint.h"
-#include "math.h"
+#include "wx/msgdlg.h"
+#include <math.h>
#include "wx/mac/uma.h"
-
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxPrinterDC, wxDC)
#endif
#include "wx/dir.h"
#include "wx/filefn.h" // for wxPathExists()
-#include <windows.h>
-
-#ifdef __WXMAC__
+#ifndef __WXMAC_X__
+ #include <windows.h>
+#endif
-#include "morefile.h"
-#include "moreextr.h"
-#include "fullpath.h"
-#include "fspcompa.h"
+#if defined(__WXMAC__) && !defined(__UNIX__)
+ #include "morefile.h"
+ #include "moreextr.h"
+ #include "fullpath.h"
+ #include "fspcompa.h"
#endif
// ----------------------------------------------------------------------------
m_CPB.hFileInfo.ioVRefNum = fsspec.vRefNum ;
m_CPB.hFileInfo.ioNamePtr = m_name ;
m_index = 0 ;
-
+
+#ifdef __WXMAC_X__
+ // TODO: what are we supposed to do for Mac OS X
+#else
FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ;
+#endif
}
wxDirData::~wxDirData()
bool wxDirData::Read(wxString *filename)
{
- if ( !m_isDir )
- return FALSE ;
+ if ( !m_isDir )
+ return FALSE ;
+#if TARGET_CARBON
+ char c_name[256] ;
+#endif
wxString result;
short err = noErr ;
err = PBGetCatInfoSync((CInfoPBPtr)&m_CPB);
if ( err != noErr )
break ;
-
+
+#if TARGET_CARBON
+ p2cstrcpy( c_name, m_name ) ;
+ strcpy( (char *)m_name, c_name);
+#else
p2cstr( m_name ) ;
+#endif
if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) ) // we have a directory
break ;
#include "wx/cmndata.h"
-#include "Navigation.h"
+#if defined(__UNIX__)
+ #include <NavigationServices/Navigation.h>
+#else
+ #include <Navigation.h>
+#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
Str255 prompt ;
Str255 path ;
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)prompt, m_message) ;
+#else
strcpy((char *)prompt, m_message) ;
c2pstr((char *)prompt ) ;
-
+#endif
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)path, m_path ) ;
+#else
strcpy((char *)path, m_path ) ;
c2pstr((char *)path ) ;
+#endif
StandardFileReply reply ;
FileFilterYDUPP invisiblesExcludedCustomFilterUPP = 0 ;
return wxDragError;
};
-#endif
\ No newline at end of file
+#endif
#include "wx/filedlg.h"
#include "wx/intl.h"
-#include "PLStringFuncs.h"
+#if !defined(__UNIX__)
+ #include "PLStringFuncs.h"
+#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
// begin wxmac
-#include "Navigation.h"
+#if defined(__UNIX__)
+ #include <NavigationServices/Navigation.h>
+#else
+ #include <Navigation.h>
+#endif
-#include "morefile.h"
-#include "moreextr.h"
-#include "fullpath.h"
-#include "fspcompa.h"
-#include "PLStringFuncs.h"
+#ifndef __UNIX__
+ #include "morefile.h"
+ #include "moreextr.h"
+ #include "fullpath.h"
+ #include "fspcompa.h"
+ #include "PLStringFuncs.h"
+#endif
extern bool gUseNavServices ;
Str255 prompt ;
Str255 filename ;
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)prompt, m_message) ;
+#else
strcpy((char *)prompt, m_message) ;
c2pstr((char *)prompt ) ;
-
+#endif
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)filename, m_fileName) ;
+#else
strcpy((char *)filename, m_fileName) ;
c2pstr((char *)filename ) ;
+#endif
+
#if !TARGET_CARBON
StandardPutFile( prompt , filename , &reply ) ;
Str255 prompt ;
Str255 path ;
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)prompt, m_message) ;
+#else
strcpy((char *)prompt, m_message) ;
c2pstr((char *)prompt ) ;
-
- strcpy((char *)path, m_dir ) ;
+#endif
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)path, m_dir ) ;
+#else
+ strcpy((char *)path, m_dir ) ;
c2pstr((char *)path ) ;
+#endif
StandardFileReply reply ;
FileFilterYDUPP crossPlatformFileFilterUPP = 0 ;
}
}
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)mNavOptions.message, m_message) ;
+#else
strcpy((char *)mNavOptions.message, m_message) ;
c2pstr((char *)mNavOptions.message ) ;
-
+#endif
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)mNavOptions.savedFileName, m_fileName) ;
+#else
strcpy((char *)mNavOptions.savedFileName, m_fileName) ;
c2pstr((char *)mNavOptions.savedFileName ) ;
+#endif
if ( m_dialogStyle & wxSAVE )
{
#include "wx/font.h"
#include "wx/fontutil.h"
#include "wx/gdicmn.h"
+#include "wx/utils.h"
#include "wx/fontutil.h"
m_macFontNum = ::GetAppFont() ;
else
{
- strcpy(wxBuffer, m_faceName);
- C2PStr(wxBuffer);
- ::GetFNum( (unsigned char*) wxBuffer, &m_macFontNum);
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) wxBuffer, m_faceName ) ;
+#else
+ strcpy( (char *) wxBuffer, m_faceName ) ;
+ c2pstr( (char *) wxBuffer ) ;
+#endif
+ ::GetFNum( (StringPtr) wxBuffer, &m_macFontNum);
}
}
void wxFontEnumeratorHelper::DoEnumerate()
{
MenuHandle menu ;
- Str255 name ;
+ Str255 p_name ;
+ char c_name[256] ;
short lines ;
menu = NewMenu( 32000 , "\pFont" ) ;
for ( int i = 1 ; i < lines+1 ; i ++ )
{
- GetMenuItemText( menu , i , name ) ;
- p2cstr( name ) ;
- /*
-
- if ( m_fixedOnly )
+ GetMenuItemText( menu , i , p_name ) ;
+#if TARGET_CARBON
+ p2cstrcpy( c_name, p_name ) ;
+#else
+ p2cstr( p_name ) ;
+ strcpy( c_name, (char *)p_name ) ;
+#endif
+ /*
+
+ if ( m_fixedOnly )
{
// check that it's a fixed pitch font (there is *no* error here, the
// flag name is misleading!)
}
*/
- m_fontEnum->OnFacename( name ) ;
+ m_fontEnum->OnFacename( c_name ) ;
}
DisposeMenu( menu ) ;
}
#endif
#include "wx/frame.h"
-#include "wx/mac/statusbr.h"
+#include "wx/statusbr.h"
#include "wx/toolbar.h"
#include "wx/menuitem.h"
#include "wx/menu.h"
#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__)
+#define OTUNIXERRORS 1
+#ifdef __UNIX__
+ #include <CarbonCore/CarbonCore.h>
+ #include <OT/OpenTransport.h>
+ #include <OT/OpenTransportProviders.h>
+
+ #ifndef FALSE
+ #define FALSE 0
+ #endif
+ #ifndef TRUE
+ #define TRUE 1
+ #endif
+#else
+ #include <OpenTransport.h>
+ #include <OpenTransportProviders.h>
+ #include <OpenTptInternet.h>
+#endif
+#if TARGET_CARBON
+ #define OTAssert( str , cond ) /* does not exists in Carbon */
+#endif
+
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <ctype.h>
-#define OTUNIXERRORS 1
-#include <OpenTransport.h>
-#include <OpenTransportProviders.h>
-#include <OpenTptInternet.h>
-#if TARGET_CARBON
- #define OTAssert( str , cond ) /* does not exists in Carbon */
-#endif
#include <utime.h>
/*
#define qDebug2 1
extern pascal void OTDebugStr(const char* str);
#endif
-#include <OTDebug.h>
+#ifndef __UNIX__
+ #include <OTDebug.h>
+#endif
InetSvcRef gInetSvcRef = 0 ;
GAddress *GSocket_GetLocal(GSocket *socket)
{
GAddress *address = NULL ;
- InetAddress addr;
GSocketError err;
InetAddress loc ;
}
+/* Hack added for Mac OS X */
+GSocketError GAddress_UNIX_GetPath(GAddress *addr, char *path, size_t buf)
+{
+}
+
+GSocketError GAddress_UNIX_SetPath(GAddress *addr, const char *path)
+{
+}
+
#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */
Str255 theName ;
short theId ;
OSType theType ;
- strcpy( (char*) theName , name ) ;
- c2pstr( (char*) theName ) ;
+
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) theName , name ) ;
+#else
+ strcpy( (char *) theName , name ) ;
+ c2pstr( (char *) theName ) ;
+#endif
Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
if ( resHandle != 0L )
}
}
return FALSE ;
-}
\ No newline at end of file
+}
// TODO: destroy image list handle, if any
}
-
// Attributes
////////////////////////////////////////////////////////////////////////////
// Returns the number of images in the image list.
int wxImageList::GetImageCount() const
{
- // TODO
- return 0;
+ // TODO
+ return 0;
+}
+
+#if 0
+bool wxImageList::GetSize(int index, int &width, int &hieght) const
+{
+ // TODO
+ return false;
}
+#endif
// Operations
////////////////////////////////////////////////////////////////////////////
#pragma implementation "listbox.h"
#endif
+#include "wx/app.h"
#include "wx/listbox.h"
#include "wx/settings.h"
#include "wx/dynarray.h"
#include "wx/log.h"
#include "wx/utils.h"
-#include "extldef.h"
+#ifdef __UNIX__
+ #include "ldef/extldef.h"
+#else
+ #include "extldef.h"
+#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
{
wxString search = s.Left( s.Length() - 1 ) ;
int len = search.Length() ;
- Str255 s1 , s2 ;
- strcpy( (char*) s2 , search.c_str() ) ;
- c2pstr( (char*) s2 ) ;
+ Str255 s1 , s2 ;
+
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) s2 , search.c_str() ) ;
+#else
+ strcpy( (char *) s2 , search.c_str() ) ;
+ c2pstr( (char *) s2 ) ;
+#endif
+
for ( int i = 0 ; i < m_noItems ; ++ i )
{
- strcpy( (char*) s1 , m_stringArray[i].Left( len ).c_str() ) ;
- c2pstr( (char*) s1 ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) s1 , m_stringArray[i].Left( len ).c_str() ) ;
+#else
+ strcpy( (char *) s1 , m_stringArray[i].Left( len ).c_str() ) ;
+ c2pstr( (char *) s1 ) ;
+#endif
if ( EqualString( s1 , s2 , false , false ) )
return i ;
}
else
{
Str255 s1 , s2 ;
- strcpy( (char*) s2 , s.c_str() ) ;
- c2pstr( (char*) s2 ) ;
+
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) s2 , s.c_str() ) ;
+#else
+ strcpy( (char *) s2 , s.c_str() ) ;
+ c2pstr( (char *) s2 ) ;
+#endif
+
for ( int i = 0 ; i < m_noItems ; ++ i )
{
- strcpy( (char*) s1 , m_stringArray[i].c_str() ) ;
- c2pstr( (char*) s1 ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) s1 , m_stringArray[i].c_str() ) ;
+#else
+ strcpy( (char *) s1 , m_stringArray[i].c_str() ) ;
+ c2pstr( (char *) s1 ) ;
+#endif
if ( EqualString( s1 , s2 , false , false ) )
return i ;
}
{
ListHandle list ;
long result ;
- Cell cell = { 0 , 0 } ;
UMAGetControlData( m_macControl , kControlNoPart , kControlListBoxListHandleTag , sizeof( ListHandle ) , (char*) &list , &result ) ;
LDelRow( 1 , N , list ) ;
}
* -------------------------------------------------------------------------
*/
+#include "wx/wx.h"
#include "wx/mac/macnotfy.h"
const short kMaxEvents = 1000 ;
#pragma implementation "menuitem.h"
#endif
+#include "wx/app.h"
#include "wx/menu.h"
#include "wx/menuitem.h"
+#include "wx/window.h"
#include "wx/log.h"
#include "wx/utils.h"
if ( m_invokingWindow != NULL )
return m_invokingWindow;
else if ( m_menuBar != NULL)
- return m_menuBar->GetFrame();
+ return (wxWindow *) m_menuBar->GetFrame();
return NULL;
}
return true ;
}
}
+#ifndef __WXMAC_X__
else if ( macMenuId == kHMHelpMenuID )
{
int menuItem = formerHelpMenuItems ;
}
}
}
+#endif // __WXMAC_X__
for (pos = 0, node = GetMenuItems().First(); node; node = node->Next(), pos++)
{
{
for (int i = 0; i < m_menus.GetCount() ; i++)
{
- if ( m_menus[i]->MacGetMenuId() == macMenuId ||
+ if ( m_menus[i]->MacGetMenuId() == macMenuId
+#ifndef __WXMAC_X__
+ ||
( macMenuId == kHMHelpMenuID && ( m_titles[i] == "?" || m_titles[i] == "&?" || m_titles[i] == wxApp::s_macHelpMenuTitleName ) )
+#endif
)
{
if ( m_menus[i]->MacMenuSelect( handler , when , macMenuId , macMenuItemNum ) )
// headers & declarations
// ============================================================================
+#include "wx/app.h"
#include "wx/menu.h"
#include "wx/menuitem.h"
#pragma implementation "msgdlg.h"
#endif
+#include "wx/app.h"
#include "wx/msgdlg.h"
#include "wx/mac/uma.h"
short result ;
Str255 pascalTitle ;
Str255 pascalText ;
+ char cText[256] ;
if (wxApp::s_macDefaultEncodingIsPC)
{
- strcpy( (char*) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ;
- strcpy( (char*) pascalText , wxMacMakeMacStringFromPC( m_message) ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ;
+#else
+ strcpy( (char *) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ;
+ c2pstr( (char *) pascalTitle ) ;
+#endif
+ strcpy(cText , wxMacMakeMacStringFromPC( m_message) ) ;
}
else
{
- strcpy( (char*) pascalTitle , m_caption ) ;
- strcpy( (char*) pascalText , m_message ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) pascalTitle , m_caption ) ;
+#else
+ strcpy( (char *) pascalTitle , m_caption ) ;
+ c2pstr( (char *) pascalTitle ) ;
+#endif
+ strcpy( cText , m_message ) ;
}
- c2pstr( (char*) pascalTitle ) ;
- wxMacConvertNewlines( (char*)pascalText ,(char*) pascalText) ;
- c2pstr( (char*) pascalText ) ;
+ wxMacConvertNewlines( cText , cText ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) pascalText , cText ) ;
+#else
+ strcpy( (char *) pascalText , cText ) ;
+ c2pstr( (char *) pascalText ) ;
+#endif
wxASSERT_MSG( ( m_dialogStyle & 0x3F ) != wxYES , "this style is not supported on mac" ) ;
tie.version = 0 ;
tie.iconSuiteID = 0 ;
- strcpy( (char*) tie.name , strText ) ;
- c2pstr( (char*) tie.name ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) tie.name , strText ) ;
+#else
+ strcpy( (char *) tie.name , strText ) ;
+ c2pstr( (char *) tie.name ) ;
+#endif
SetControlData( m_macControl, nPage + 1, kControlTabInfoTag , sizeof( ControlTabInfoRec) , (char*) &tie ) ;
SetControlData( m_macControl, m_nSelection + 1, kControlTabEnabledFlagTag, sizeof( Boolean ), (Ptr)&enabled );
// event table
// ----------------------------------------------------------------------------
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
+
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
tie.version = 0 ;
tie.iconSuiteID = 0 ;
- strcpy( (char*) tie.name , strText ) ;
- c2pstr( (char*) tie.name ) ;
+ c2pstrcpy( (StringPtr) tie.name , strText ) ;
SetControlData( m_macControl, nPage + 1, kControlTabInfoTag , sizeof( ControlTabInfoRec) , (char*) &tie ) ;
SetControlData( m_macControl, m_nSelection + 1, kControlTabEnabledFlagTag, sizeof( Boolean ), (Ptr)&enabled );
# include <fstream>
#endif
-#include <windows.h>
-#include <wx/palette.h>
-#include <wx/bitmap.h>
-#include <wx/mac/pnghand.h>
-#include <wx/mac/pngread.h>
+#ifndef __WXMAC_X__
+# include <windows.h>
+#endif
+#include "wx/msgdlg.h"
+#include "wx/palette.h"
+#include "wx/bitmap.h"
+#include "wx/mac/pnghand.h"
+#include "wx/mac/pngread.h"
extern "C" {
#include "png.h"
extern CTabHandle wxMacCreateColorTable( int numColors ) ;
extern void wxMacDestroyColorTable( CTabHandle colors ) ;
extern void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
-extern GWorldPtr wxMacCreateGWorld( int height , int width , int depth ) ;
+extern GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
extern void wxMacDestroyGWorld( GWorldPtr gw ) ;
void
{
wxMacDestroyGWorld( lpbi ) ;
}
- if (lpbi = wxMacCreateGWorld( Width , Height , Depth) )
+ lpbi = wxMacCreateGWorld( Width , Height , Depth);
+ if (lpbi)
{
EfeWidth = (long)(((long)Width*Depth + 31) / 32) * 4;
int bitwidth = width ;
int wxPrintDialog::ShowModal()
{
int result = wxID_CANCEL ;
- #if !TARGET_CARBON
+#if !TARGET_CARBON
OSErr err ;
wxString message ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
}
::UMAPrClose() ;
- #else
- #pragma warning "TODO:Printing for carbon"
- #endif
+#else
+ #if __UNIX__
+ #warning "TODO:Printing for carbon"
+ #else
+ #pragma warning "TODO:Printing for carbon"
+ #endif
+#endif
return result ;
}
}
::UMAPrClose() ;
#else
-#pragma warning "TODO:printing for carbon"
+ #if __UNIX__
+ #warning "TODO:Printing for carbon"
+ #else
+ #pragma warning "TODO:Printing for carbon"
+ #endif
#endif
return result ;
}
#endif
#include "wx/radiobox.h"
-#include <wx/mac/uma.h>
+#include "wx/radiobut.h"
+#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
#endif
#include "wx/settings.h"
+#include "wx/gdicmn.h"
wxColour wxSystemSettings::GetSystemColour(int index)
{
const wxValidator& validator,
const wxString& name)
{
- Rect bounds ;
- Str255 title ;
-
- MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
-
- m_macMinimumStatic = NULL ;
-
+ Rect bounds ;
+ Str255 title ;
+ wxSize slsize;
+ int maxtextwidth, textheight;
+
+ // Is control horizontal or vertical (Can be ambigous if user selects
+ // another style without also specifying horz or vert
+ if (!(style & wxSL_HORIZONTAL) && !(style & wxSL_VERTICAL)) {
+ // Default is horizontal so make it so
+ style |= wxSL_HORIZONTAL;
+ }
+ slsize = size;
+ // Check that size corresponds with users selection of vertical or
+ // horizontal slider and insert suitable default values
+ if (style & wxSL_HORIZONTAL)
+ {
+ slsize.y = 15; // Slider width
+ if (slsize.x == -1) {
+ slsize.x = 150; // Slider default length
+ }
+ }
+ else
+ {
+ slsize.x = 15; // Slider width
+ if (slsize.y == -1) {
+ slsize.y = 150; // Slider default length
+ }
+ }
+ /* Set the height and width for the slider control region. The actual
+ * slider is set at 10 pixels across. If the slider has labels then the
+ * control region must be large enough to contain these labels
+ */
+ if (style & wxSL_LABELS)
+ {
+ wxString text;
+ int ht, wd;
+
+ // Get maximum text label width and height
+ text.Printf("%d", minValue);
+ parent->GetTextExtent(text, &maxtextwidth, &textheight);
+ text.Printf("%d", maxValue);
+ parent->GetTextExtent(text, &wd, &ht);
+ if(ht > textheight) {
+ textheight = ht;
+ }
+ if (wd > maxtextwidth) {
+ maxtextwidth = wd;
+ }
+
+ if (style & wxSL_VERTICAL) {
+ slsize.x = (15 + maxtextwidth + 2); // Slider wd plus mac text width
+ }
+ if (style & wxSL_HORIZONTAL) {
+ slsize.y = (15 + textheight); // Slider ht plus text ht.
+ }
+ }
+
+ MacPreControlCreate( parent , id , "" , pos , slsize , style,
+ validator , name , &bounds , title ) ;
+
+ m_macMinimumStatic = NULL ;
+ m_macMaximumStatic = NULL ;
+ m_macValueStatic = NULL ;
+
m_lineSize = 1;
m_tickFreq = 0;
m_rangeMin = minValue;
m_pageSize = (int)((maxValue-minValue)/10);
- if ( m_width == -1 )
- {
- m_width = 20 ;
- if ( style & wxSL_LABELS && style & wxSL_VERTICAL )
- m_width += 24 ;
- bounds.right = bounds.left + m_width ;
- }
- if ( m_height == -1 )
+
+ // Must modify bounds to that of the slider dimensions from slider
+ // dimensions plus text labels.
+ if (style & wxSL_LABELS)
+ {
+ if ( style & wxSL_HORIZONTAL )
{
- m_height = 20 ;
- if ( style & wxSL_LABELS && style & wxSL_HORIZONTAL )
- m_height += 24 ;
- bounds.bottom = bounds.top + m_height ;
+ bounds.bottom = bounds.top + 15;
+ bounds.right -= (5 + maxtextwidth);
}
-
- if ( style & wxSL_LABELS && style & wxSL_HORIZONTAL )
+ else // Vertical slider
{
- bounds.top += 12 ;
- bounds.right -= 24 ;
+ bounds.right = bounds.left + 15;
+ bounds.bottom -= (5 + textheight);
}
-
- if ( style & wxSL_LABELS && style & wxSL_VERTICAL )
+ }
+
+ m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds ,
+ title , true , value , minValue , maxValue,
+ kControlSliderProc + kControlSliderLiveFeedback + ( ( style & wxSL_AUTOTICKS ) ? kControlSliderHasTickMarks : 0 ) , (long) this ) ;
+
+ wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
+
+ ::SetControlAction( m_macControl , wxMacLiveScrollbarActionUPP ) ;
+
+ MacPostControlCreate() ;
+
+ if ( style & wxSL_LABELS )
+ {
+ if ( style & wxSL_HORIZONTAL )
{
- bounds.left += 24 ;
- bounds.top += 12 ;
+ wxPoint leftpos( 0 , 15 ) ;
+ wxPoint rightpos( m_width - (maxtextwidth + 20) , 15 ) ;
+ wxPoint valuepos( m_width - maxtextwidth , 0 ) ;
+ wxString valuestring ;
+
+ valuestring.Printf( "%d" , minValue ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , leftpos ) ;
+
+ valuestring.Printf( "%d" , maxValue ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , rightpos ) ;
+
+ valuestring.Printf( "%d" , value ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos ) ;
}
-
- m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , value , minValue , maxValue,
- kControlSliderProc + kControlSliderLiveFeedback + ( ( style & wxSL_AUTOTICKS ) ? kControlSliderHasTickMarks : 0 ) , (long) this ) ;
-
- wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
-
- ::SetControlAction( m_macControl , wxMacLiveScrollbarActionUPP ) ;
-
- MacPostControlCreate() ;
-
- if ( style & wxSL_LABELS )
+ else // Vertical slider
{
- if ( style & wxSL_HORIZONTAL )
- {
- wxSize size( 24 , 12 ) ;
- wxPoint leftpos( 0 , 0 ) ;
- wxPoint rightpos( m_width - 2 * 12 , 0 ) ;
- wxPoint valuepos( m_width - 12 , 20 ) ;
- wxString valuestring ;
-
- valuestring.Printf( "%d" , minValue ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , leftpos , size ) ;
- valuestring.Printf( "%d" , maxValue ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , rightpos , size ) ;
- valuestring.Printf( "%d" , value ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos , size ) ;
- }
- else
- {
- wxSize size( 24 , 12 ) ;
- wxPoint toppos( 0 , 12 ) ;
- wxPoint bottompos( 0 , m_height - 12 ) ;
- wxPoint valuepos( 20 , 0 ) ;
- wxString valuestring ;
-
- valuestring.Printf( "%d" , minValue ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , bottompos , size ) ;
- valuestring.Printf( "%d" , maxValue ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , toppos , size ) ;
- valuestring.Printf( "%d" , value ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos , size ) ;
- }
+ wxPoint toppos( 17 , 0 ) ;
+ wxPoint bottompos( 17 , m_height - (textheight + 15) ) ;
+ wxPoint valuepos( 0 , m_height - textheight ) ;
+ wxString valuestring ;
+
+ valuestring.Printf( "%d" , minValue ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , bottompos ) ;
+
+ valuestring.Printf( "%d" , maxValue ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , toppos ) ;
+
+ valuestring.Printf( "%d" , value ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos ) ;
}
-
- return TRUE;
-
+ }
+
+ return true;
}
wxSlider::~wxSlider()
{
wxString valuestring ;
valuestring.Printf( "%d" , value ) ;
- if ( m_macMinimumStatic )
+ if ( m_macMinimumStatic )
m_macMinimumStatic->SetLabel( valuestring ) ;
SetControlValue( m_macControl , value ) ;
}
void wxSlider::SetRange(int minValue, int maxValue)
{
- m_rangeMin = minValue;
- m_rangeMax = maxValue;
+ wxString value;
- // TODO
+ m_rangeMin = minValue;
+ m_rangeMax = maxValue;
+
+ // TODO
+ SetControlMinimum(m_macControl, m_rangeMin);
+ SetControlMaximum(m_macControl, m_rangeMax);
+
+ if(m_macMinimumStatic) {
+ value.Printf("%d", m_rangeMin);
+ m_macMinimumStatic->SetLabel(value);
+ }
+ if(m_macMaximumStatic) {
+ value.Printf("%d", m_rangeMax);
+ m_macMaximumStatic->SetLabel(value);
+ }
+ SetValue(m_rangeMin);
}
// For trackbars only
#ifdef __GNUG__
#pragma implementation "spinbutt.h"
+#pragma implementation "spinbuttbase.h"
#endif
#include "wx/spinbutt.h"
IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent);
#endif
+wxSpinButton::wxSpinButton()
+ : wxSpinButtonBase()
+{
+}
+
bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, const wxString& name)
{
// Attributes
////////////////////////////////////////////////////////////////////////////
+int wxSpinButton::GetMin() const
+{
+ return m_min;
+}
+
+int wxSpinButton::GetMax() const
+{
+ return m_max;
+}
+
int wxSpinButton::GetValue() const
{
return m_value;
return ;
wxEventType scrollEvent = wxEVT_NULL;
- int nScrollInc;
+ int nScrollInc = 0;
switch( controlpart )
{
#endif
#include "wx/statbmp.h"
+#include "wx/dcclient.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
// headers
// ----------------------------------------------------------------------------
-#include "wx/mac/statusbr.h"
+#include "wx/statusbr.h"
+#include "wx/dc.h"
+#include "wx/dcclient.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStatusBarMac, wxStatusBarGeneric);
// ============================================================================
// ----------------------------------------------------------------------------
-// wxStatusBarXX class
+// wxStatusBarMac class
// ----------------------------------------------------------------------------
wxStatusBarMac::wxStatusBarMac()
# ifdef __WXMSW__
dc.SetFont(wxNullFont);
# endif // MSW
-}
\ No newline at end of file
+}
#include "wx/app.h"
#include "wx/stattext.h"
+#include "wx/dc.h"
+#include "wx/dcclient.h"
#include <stdio.h>
#pragma implementation "textctrl.h"
#endif
-#ifndef __WXMAC__
-#include <sys/types.h>
-#include <sys/stat.h>
+#ifdef __UNIX__
+ #include <sys/types.h>
+ #include <sys/stat.h>
#else
-#include <stat.h>
+ #include <stat.h>
#endif
#include <fstream.h>
+#include "wx/app.h"
+#include "wx/button.h"
+#include "wx/panel.h"
#include "wx/textctrl.h"
#include "wx/settings.h"
#include "wx/filefn.h"
#include "wx/utils.h"
#if defined(__BORLANDC__) && !defined(__WIN32__)
-#include <alloc.h>
-#else
-#ifndef __MWERKS__
-#ifndef __GNUWIN32__
-#include <malloc.h>
-#endif
-#endif
+ #include <alloc.h>
+#elif !defined(__MWERKS__) && !defined(__GNUWIN32) && !defined(__WXMAC_X__)
+ #include <malloc.h>
#endif
#include "wx/mac/uma.h"
wxCHECK_MSG( m_info.m_task.tmAddr == NULL , FALSE, wxT("attempting to restart a timer") );
m_milli = milliseconds;
- m_info.m_task.tmAddr = NewTimerProc( MacTimerProc ) ;
- m_info.m_task.tmWakeUp = 0 ;
- m_info.m_task.tmReserved = 0 ;
+#ifdef __UNIX__
+ m_info.m_task.tmAddr = NewTimerUPP( MacTimerProc ) ;
+#else
+ m_info.m_task.tmAddr = NewTimerProc( MacTimerProc ) ;
+#endif
+ m_info.m_task.tmWakeUp = 0 ;
+ m_info.m_task.tmReserved = 0 ;
InsXTime((QElemPtr) &m_info.m_task ) ;
PrimeTime( (QElemPtr) &m_info.m_task , m_milli ) ;
return FALSE;
#if wxUSE_TOOLTIPS
+#include "wx/app.h"
#include "wx/window.h"
#include "wx/tooltip.h"
+#include "wx/timer.h"
#include "wx/geometry.h"
#include "wx/mac/aga.h"
#include "wx/mac/uma.h"
#endif
#include "wx/stubs/textctrl.h"
+#include "wx/treebase.h"
#include "wx/stubs/treectrl.h"
#if !USE_SHARED_LIBRARY
-#include <wx/mac/uma.h>
-#include <wx/mac/aga.h>
+#include "wx/defs.h"
+#include "wx/mac/uma.h"
+#include "wx/mac/aga.h"
-
-#include "Navigation.h"
+#ifdef __UNIX__
+ #include <NavigationServices/Navigation.h>
+#else
+ #include <Navigation.h>
+#endif
// init
#endif // UMA_USE_WINDOWMGR
#endif
+#ifndef __UNIX__
if ( sUMAHasWindowManager )
InitFloatingWindows() ;
else
InitWindows();
+#endif
if ( NavServicesAvailable() )
{
Str255 ptitle ;
strncpy( (char*)ptitle , title , 96 ) ;
ptitle[96] = 0 ;
+#if TARGET_CARBON
+ c2pstrcpy( ptitle, (char *)ptitle ) ;
+#else
c2pstr( (char*)ptitle ) ;
+#endif
SetWTitle( inWindowRef , ptitle ) ;
}
+
void UMAGetWTitleC( WindowRef inWindowRef , char *title )
{
GetWTitle( inWindowRef , (unsigned char*)title ) ;
+#if TARGET_CARBON
+ p2cstrcpy( title, (unsigned char *)title ) ;
+#else
p2cstr( (unsigned char*)title ) ;
+#endif
}
void UMAShowWindow( WindowRef inWindowRef )
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
{
#if UMA_USE_APPEARANCE
- if ( UMAHasAppearance() )
- {
- ::DrawThemePlacard( inRect , inState ) ;
- }
- else
+ if ( UMAHasAppearance() )
+ {
+ ::DrawThemePlacard( inRect , inState ) ;
+ }
+ else
#endif
#if !TARGET_CARBON
- {
- }
+ {
+ }
#else
- {
- }
+ {
+ }
#endif
}
#include <string.h>
#include <stdarg.h>
+#ifndef __UNIX__
+// defined in unix/utilsunx.cpp for Mac OS X
+
// get full hostname (with domain name if possible)
bool wxGetFullHostName(wxChar *buf, int maxSize)
{
{
// TODO
}
+#endif // !__UNIX__
// Emit a beeeeeep
void wxBell()
return strDir ;
}
+#ifndef __UNIX__
char *wxGetUserHome (const wxString& user)
{
// TODO
return NULL;
}
+#endif
// Check whether this window wants to process messages, e.g. Stop button
// in long calculations.
*width = screenBits.bounds.right - screenBits.bounds.left ;
*height = screenBits.bounds.bottom - screenBits.bounds.top ;
- #if TARGET_CARBON
+#if TARGET_CARBON
SInt16 mheight ;
GetThemeMenuBarHeight( &mheight ) ;
*height -= mheight ;
#else
*height -= LMGetMBarHeight() ;
- #endif
+#endif
}
wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
#include "wx/object.h"
#include "wx/string.h"
-#include "wx/mac/wave.h"
+#include "wx/wave.h"
wxWave::wxWave()
- : m_hSnd(NULL), m_waveLength(0), m_isResource(true), m_sndChan(0)
+ : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
{
}
wxWave::wxWave(const wxString& sFileName, bool isResource)
- : m_hSnd(NULL), m_waveLength(0), m_isResource(true), m_sndChan(0)
+ : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
{
Create(sFileName, isResource);
}
#include "wx/layout.h"
#include "wx/dialog.h"
#include "wx/listbox.h"
+#include "wx/scrolbar.h"
+#include "wx/statbox.h"
#include "wx/button.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
#include "wx/tabctrl.h"
#include "wx/tooltip.h"
// TODO remove the line below, just for lookup-up convenience CS
-#include "wx/mac/window.h"
+#include "wx/window.h"
#include "wx/menuitem.h"
#include "wx/log.h"
// translate the window attributes in the appropriate window class and attributes
- WindowClass wclass ;
- WindowAttributes attr ;
+ WindowClass wclass = 0;
+ WindowAttributes attr = kWindowNoAttributes ;
if ( HasFlag(wxTINY_CAPTION_HORIZ) || HasFlag(wxTINY_CAPTION_VERT) )
{
wclass = kModalWindowClass ;
}
- attr = kWindowNoAttributes ;
-
if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) )
{
attr |= kWindowFullZoomAttribute ;
// For compilers that support precompilation, includes "wx.h".
#include "wx/choice.h"
+#include "wx/menu.h"
#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
- int n, const wxString choices[],
- long style,
+ int n, const wxString choices[],
+ long style,
const wxValidator& validator,
const wxString& name)
{
SetControlMaximum( m_macControl , Number()) ;
}
+void wxChoice::Append(const wxString &item, void *client_data)
+{
+}
+
+void *wxChoice::GetClientData(int index) const
+{
+ return NULL;
+}
+
void wxChoice::Delete(int n)
{
::DeleteMenuItem( m_macPopUpMenuHandle , n + 1) ;
#endif
#include "wx/combobox.h"
+#include "wx/menu.h"
#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
wxString wxComboBox::GetString(int n) const
{
- Str255 text ;
- ::GetMenuItemText( m_macPopUpMenuHandle , n+1 , text ) ;
- p2cstr( text ) ;
- return wxString( text );
+ Str255 p_text ;
+ char c_text[255];
+ ::GetMenuItemText( m_macPopUpMenuHandle , n+1 , p_text ) ;
+#if TARGET_CARBON
+ p2cstrcpy( c_text, p_text ) ;
+#else
+ p2cstr( p_text ) ;
+ strcpy( c_text, (char *) p_text ) ;
+#endif
+ return wxString( c_text );
}
wxString wxComboBox::GetStringSelection() const
#endif
#include "wx/control.h"
+#include "wx/panel.h"
+#include "wx/app.h"
#include "wx/notebook.h"
#include "wx/tabctrl.h"
#include "wx/radiobox.h"
#include "wx/spinbutt.h"
+#include "wx/scrolbar.h"
+#include "wx/button.h"
+#include "wx/dialog.h"
+#include "wx/statbox.h"
+#include "wx/sizer.h"
+#include "wx/stattext.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
if ( wxMacLiveScrollbarActionUPP == NULL )
{
+#ifdef __UNIX__
+ wxMacLiveScrollbarActionUPP = NewControlActionUPP( wxMacLiveScrollbarActionProc );
+#else
wxMacLiveScrollbarActionUPP = NewControlActionProc( wxMacLiveScrollbarActionProc ) ;
+#endif
}
}
else
label = title ;
- strcpy( (char*) maclabel , label ) ;
- c2pstr( (char*) maclabel ) ;
-
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) maclabel , label ) ;
+#else
+ strcpy( (char *) maclabel , label ) ;
+ c2pstr( (char *) maclabel ) ;
+#endif
::SetControlTitle( m_macControl , maclabel ) ;
}
}
outBounds->bottom = outBounds->top + m_height - 2 * m_macVerticalBorder;
outBounds->right = outBounds->left + m_width - 2 * m_macHorizontalBorder ;
- strcpy( (char*) maclabel , label ) ;
+ char c_text[255];
+ strcpy( c_text , label ) ;
if( wxApp::s_macDefaultEncodingIsPC )
{
- wxMacConvertFromPCForControls( (char*) maclabel ) ;
+ wxMacConvertFromPCForControls( c_text ) ;
}
- c2pstr( (char*) maclabel ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) maclabel , c_text ) ;
+#else
+ strcpy( (char *) maclabel , c_text ) ;
+ c2pstr( (char *) maclabel ) ;
+#endif
}
void wxControl::MacPostControlCreate()
#endif
#include "wx/dc.h"
+#include "wx/app.h"
#include "wx/mac/uma.h"
#if __MSL__ >= 0x6000
{
if ( bmap->m_bitmapType == kMacBitmapTypePict )
{
- Rect bitmaprect = { 0 , 0 , bmap->m_height * scale , bmap->m_width * scale} ;
+ Rect bitmaprect = { 0 , 0 , int(bmap->m_height * scale) , int(bmap->m_width * scale)} ;
::OffsetRect( &bitmaprect , xx1 , yy1 ) ;
::DrawPicture( bmap->m_hPict , &bitmaprect ) ;
}
if (m_pen.GetStyle() == wxTRANSPARENT)
return;
- MacInstallPen() ;
+ MacInstallPen() ;
- int offset = (m_pen.GetWidth() - 1 ) / 2 ;
+ int offset = (m_pen.GetWidth() - 1 ) / 2 ;
long x1, x2 , y1 , y2 ;
x1 = XLOG2DEV(points[0].x + xoffset);
- y1 = YLOG2DEV(points[0].y + yoffset);
- ::MoveTo(x1 - offset ,y1 - offset );
+ y1 = YLOG2DEV(points[0].y + yoffset);
+ ::MoveTo(x1 - offset ,y1 - offset );
for (int i = 0; i < n-1; i++)
{
- long x2 = XLOG2DEV(points[i+1].x + xoffset);
- long y2 = YLOG2DEV(points[i+1].y + yoffset);
- ::LineTo(x2 - offset , y2 - offset );
+ x2 = XLOG2DEV(points[i+1].x + xoffset);
+ y2 = YLOG2DEV(points[i+1].y + yoffset);
+ ::LineTo(x2 - offset , y2 - offset );
}
}
PolyHandle polygon = OpenPoly() ;
long x1, x2 , y1 , y2 ;
x1 = XLOG2DEV(points[0].x + xoffset);
- y1 = YLOG2DEV(points[0].y + yoffset);
- ::MoveTo(x1,y1);
+ y1 = YLOG2DEV(points[0].y + yoffset);
+ ::MoveTo(x1,y1);
for (int i = 0; i < n-1; i++)
{
- long x2 = XLOG2DEV(points[i+1].x + xoffset);
- long y2 = YLOG2DEV(points[i+1].y + yoffset);
- ::LineTo(x2, y2);
+ x2 = XLOG2DEV(points[i+1].x + xoffset);
+ y2 = YLOG2DEV(points[i+1].y + yoffset);
+ ::LineTo(x2, y2);
}
ClosePoly() ;
if (m_brush.GetStyle() != wxTRANSPARENT)
{
MacInstallBrush() ;
- ::PaintRoundRect( &rect , radius * 2 , radius * 2 ) ;
+ ::PaintRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
};
if (m_pen.GetStyle() != wxTRANSPARENT)
{
MacInstallPen() ;
- ::FrameRoundRect( &rect , radius * 2 , radius * 2 ) ;
+ ::FrameRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
};
}
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
- RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ;
- RGBColor black = { 0,0,0} ;
- RGBForeColor( &m_textForegroundColour.GetPixel() ) ;
- RGBBackColor( &m_textBackgroundColour.GetPixel() ) ;
+ RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ;
+ RGBColor black = { 0,0,0} ;
+ RGBColor forecolor = m_textForegroundColour.GetPixel();
+ RGBColor backcolor = m_textBackgroundColour.GetPixel();
+ RGBForeColor( &forecolor ) ;
+ RGBBackColor( &backcolor ) ;
if ( LockPixels(bmappixels) )
{
if ( font )
{
::TextFont( font->m_macFontNum ) ;
- ::TextSize( m_scaleY * font->m_macFontSize ) ;
+ ::TextSize( short(m_scaleY * font->m_macFontSize) ) ;
::TextFace( font->m_macFontStyle ) ;
m_macFontInstalled = true ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
-
- ::RGBForeColor(&m_textForegroundColour.GetPixel() );
- ::RGBBackColor(&m_textBackgroundColour.GetPixel() );
+
+ RGBColor forecolor = m_textForegroundColour.GetPixel();
+ RGBColor backcolor = m_textBackgroundColour.GetPixel();
+ ::RGBForeColor( &forecolor );
+ ::RGBBackColor( &backcolor );
}
else
{
GetFNum( "\pGeneva" , &fontnum ) ;
::TextFont( fontnum ) ;
- ::TextSize( m_scaleY * 10 ) ;
+ ::TextSize( short(m_scaleY * 10) ) ;
::TextFace( 0 ) ;
// todo reset after spacing changes - or store the current spacing somewhere
m_macFontInstalled = true ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
- ::RGBForeColor( &(m_textForegroundColour.GetPixel()) );
- ::RGBBackColor(&m_textBackgroundColour.GetPixel() );
- }
+ RGBColor forecolor = m_textForegroundColour.GetPixel();
+ RGBColor backcolor = m_textBackgroundColour.GetPixel();
+ ::RGBForeColor( &forecolor );
+ ::RGBBackColor( &backcolor );
+ }
short mode = patCopy ;
if ( m_macPenInstalled )
return ;
- ::RGBForeColor(&m_pen.GetColour().GetPixel() );
- ::RGBBackColor(&m_backgroundBrush.GetColour().GetPixel() );
+ RGBColor forecolor = m_pen.GetColour().GetPixel();
+ RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
+ ::RGBForeColor( &forecolor );
+ ::RGBBackColor( &backcolor );
::PenNormal() ;
int penWidth = m_pen.GetWidth();
int penStyle = m_pen.GetStyle();
if (penStyle == wxSOLID)
+ {
::PenPat(GetQDGlobalsBlack(&blackColor));
+ }
else if (IS_HATCH(penStyle))
{
Pattern pat ;
// foreground
- ::RGBForeColor(&m_brush.GetColour().GetPixel() );
- ::RGBBackColor(&m_backgroundBrush.GetColour().GetPixel() );
+ RGBColor forecolor = m_brush.GetColour().GetPixel();
+ RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
+ ::RGBForeColor( &forecolor );
+ ::RGBBackColor( &backcolor );
int brushStyle = m_brush.GetStyle();
if (brushStyle == wxSOLID)
#include "wx/dcclient.h"
#include "wx/dcmemory.h"
#include "wx/region.h"
+#include "wx/window.h"
#include <math.h>
//-----------------------------------------------------------------------------
m_macPort = UMAGetWindowPort( windowref ) ;
MacSetupPort() ;
m_ok = TRUE ;
- long x , y ,w , h ;
+ wxCoord x , y ,w , h ;
window->GetUpdateRegion().GetBox( x , y , w , h ) ;
m_minY = m_minX = 0;
wxSize size = window->GetSize() ;
#endif
#include "wx/dcprint.h"
-#include "math.h"
+#include "wx/msgdlg.h"
+#include <math.h>
#include "wx/mac/uma.h"
-
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxPrinterDC, wxDC)
#endif
#include "wx/dir.h"
#include "wx/filefn.h" // for wxPathExists()
-#include <windows.h>
-
-#ifdef __WXMAC__
+#ifndef __WXMAC_X__
+ #include <windows.h>
+#endif
-#include "morefile.h"
-#include "moreextr.h"
-#include "fullpath.h"
-#include "fspcompa.h"
+#if defined(__WXMAC__) && !defined(__UNIX__)
+ #include "morefile.h"
+ #include "moreextr.h"
+ #include "fullpath.h"
+ #include "fspcompa.h"
#endif
// ----------------------------------------------------------------------------
m_CPB.hFileInfo.ioVRefNum = fsspec.vRefNum ;
m_CPB.hFileInfo.ioNamePtr = m_name ;
m_index = 0 ;
-
+
+#ifdef __WXMAC_X__
+ // TODO: what are we supposed to do for Mac OS X
+#else
FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ;
+#endif
}
wxDirData::~wxDirData()
bool wxDirData::Read(wxString *filename)
{
- if ( !m_isDir )
- return FALSE ;
+ if ( !m_isDir )
+ return FALSE ;
+#if TARGET_CARBON
+ char c_name[256] ;
+#endif
wxString result;
short err = noErr ;
err = PBGetCatInfoSync((CInfoPBPtr)&m_CPB);
if ( err != noErr )
break ;
-
+
+#if TARGET_CARBON
+ p2cstrcpy( c_name, m_name ) ;
+ strcpy( (char *)m_name, c_name);
+#else
p2cstr( m_name ) ;
+#endif
if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) ) // we have a directory
break ;
#include "wx/cmndata.h"
-#include "Navigation.h"
+#if defined(__UNIX__)
+ #include <NavigationServices/Navigation.h>
+#else
+ #include <Navigation.h>
+#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
Str255 prompt ;
Str255 path ;
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)prompt, m_message) ;
+#else
strcpy((char *)prompt, m_message) ;
c2pstr((char *)prompt ) ;
-
+#endif
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)path, m_path ) ;
+#else
strcpy((char *)path, m_path ) ;
c2pstr((char *)path ) ;
+#endif
StandardFileReply reply ;
FileFilterYDUPP invisiblesExcludedCustomFilterUPP = 0 ;
return wxDragError;
};
-#endif
\ No newline at end of file
+#endif
#include "wx/filedlg.h"
#include "wx/intl.h"
-#include "PLStringFuncs.h"
+#if !defined(__UNIX__)
+ #include "PLStringFuncs.h"
+#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
// begin wxmac
-#include "Navigation.h"
+#if defined(__UNIX__)
+ #include <NavigationServices/Navigation.h>
+#else
+ #include <Navigation.h>
+#endif
-#include "morefile.h"
-#include "moreextr.h"
-#include "fullpath.h"
-#include "fspcompa.h"
-#include "PLStringFuncs.h"
+#ifndef __UNIX__
+ #include "morefile.h"
+ #include "moreextr.h"
+ #include "fullpath.h"
+ #include "fspcompa.h"
+ #include "PLStringFuncs.h"
+#endif
extern bool gUseNavServices ;
Str255 prompt ;
Str255 filename ;
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)prompt, m_message) ;
+#else
strcpy((char *)prompt, m_message) ;
c2pstr((char *)prompt ) ;
-
+#endif
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)filename, m_fileName) ;
+#else
strcpy((char *)filename, m_fileName) ;
c2pstr((char *)filename ) ;
+#endif
+
#if !TARGET_CARBON
StandardPutFile( prompt , filename , &reply ) ;
Str255 prompt ;
Str255 path ;
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)prompt, m_message) ;
+#else
strcpy((char *)prompt, m_message) ;
c2pstr((char *)prompt ) ;
-
- strcpy((char *)path, m_dir ) ;
+#endif
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)path, m_dir ) ;
+#else
+ strcpy((char *)path, m_dir ) ;
c2pstr((char *)path ) ;
+#endif
StandardFileReply reply ;
FileFilterYDUPP crossPlatformFileFilterUPP = 0 ;
}
}
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)mNavOptions.message, m_message) ;
+#else
strcpy((char *)mNavOptions.message, m_message) ;
c2pstr((char *)mNavOptions.message ) ;
-
+#endif
+#if TARGET_CARBON
+ c2pstrcpy((StringPtr)mNavOptions.savedFileName, m_fileName) ;
+#else
strcpy((char *)mNavOptions.savedFileName, m_fileName) ;
c2pstr((char *)mNavOptions.savedFileName ) ;
+#endif
if ( m_dialogStyle & wxSAVE )
{
#include "wx/font.h"
#include "wx/fontutil.h"
#include "wx/gdicmn.h"
+#include "wx/utils.h"
#include "wx/fontutil.h"
m_macFontNum = ::GetAppFont() ;
else
{
- strcpy(wxBuffer, m_faceName);
- C2PStr(wxBuffer);
- ::GetFNum( (unsigned char*) wxBuffer, &m_macFontNum);
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) wxBuffer, m_faceName ) ;
+#else
+ strcpy( (char *) wxBuffer, m_faceName ) ;
+ c2pstr( (char *) wxBuffer ) ;
+#endif
+ ::GetFNum( (StringPtr) wxBuffer, &m_macFontNum);
}
}
void wxFontEnumeratorHelper::DoEnumerate()
{
MenuHandle menu ;
- Str255 name ;
+ Str255 p_name ;
+ char c_name[256] ;
short lines ;
menu = NewMenu( 32000 , "\pFont" ) ;
for ( int i = 1 ; i < lines+1 ; i ++ )
{
- GetMenuItemText( menu , i , name ) ;
- p2cstr( name ) ;
- /*
-
- if ( m_fixedOnly )
+ GetMenuItemText( menu , i , p_name ) ;
+#if TARGET_CARBON
+ p2cstrcpy( c_name, p_name ) ;
+#else
+ p2cstr( p_name ) ;
+ strcpy( c_name, (char *)p_name ) ;
+#endif
+ /*
+
+ if ( m_fixedOnly )
{
// check that it's a fixed pitch font (there is *no* error here, the
// flag name is misleading!)
}
*/
- m_fontEnum->OnFacename( name ) ;
+ m_fontEnum->OnFacename( c_name ) ;
}
DisposeMenu( menu ) ;
}
#endif
#include "wx/frame.h"
-#include "wx/mac/statusbr.h"
+#include "wx/statusbr.h"
#include "wx/toolbar.h"
#include "wx/menuitem.h"
#include "wx/menu.h"
#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__)
+#define OTUNIXERRORS 1
+#ifdef __UNIX__
+ #include <CarbonCore/CarbonCore.h>
+ #include <OT/OpenTransport.h>
+ #include <OT/OpenTransportProviders.h>
+
+ #ifndef FALSE
+ #define FALSE 0
+ #endif
+ #ifndef TRUE
+ #define TRUE 1
+ #endif
+#else
+ #include <OpenTransport.h>
+ #include <OpenTransportProviders.h>
+ #include <OpenTptInternet.h>
+#endif
+#if TARGET_CARBON
+ #define OTAssert( str , cond ) /* does not exists in Carbon */
+#endif
+
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <ctype.h>
-#define OTUNIXERRORS 1
-#include <OpenTransport.h>
-#include <OpenTransportProviders.h>
-#include <OpenTptInternet.h>
-#if TARGET_CARBON
- #define OTAssert( str , cond ) /* does not exists in Carbon */
-#endif
#include <utime.h>
/*
#define qDebug2 1
extern pascal void OTDebugStr(const char* str);
#endif
-#include <OTDebug.h>
+#ifndef __UNIX__
+ #include <OTDebug.h>
+#endif
InetSvcRef gInetSvcRef = 0 ;
GAddress *GSocket_GetLocal(GSocket *socket)
{
GAddress *address = NULL ;
- InetAddress addr;
GSocketError err;
InetAddress loc ;
}
+/* Hack added for Mac OS X */
+GSocketError GAddress_UNIX_GetPath(GAddress *addr, char *path, size_t buf)
+{
+}
+
+GSocketError GAddress_UNIX_SetPath(GAddress *addr, const char *path)
+{
+}
+
#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */
Str255 theName ;
short theId ;
OSType theType ;
- strcpy( (char*) theName , name ) ;
- c2pstr( (char*) theName ) ;
+
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) theName , name ) ;
+#else
+ strcpy( (char *) theName , name ) ;
+ c2pstr( (char *) theName ) ;
+#endif
Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
if ( resHandle != 0L )
}
}
return FALSE ;
-}
\ No newline at end of file
+}
// TODO: destroy image list handle, if any
}
-
// Attributes
////////////////////////////////////////////////////////////////////////////
// Returns the number of images in the image list.
int wxImageList::GetImageCount() const
{
- // TODO
- return 0;
+ // TODO
+ return 0;
+}
+
+#if 0
+bool wxImageList::GetSize(int index, int &width, int &hieght) const
+{
+ // TODO
+ return false;
}
+#endif
// Operations
////////////////////////////////////////////////////////////////////////////
#pragma once
-#include <Lists.h>
+#if defined(__UNIX__)
+ #include <HIToolbox/lists.h>
+#else
+ #include <Lists.h>
+#endif
#include <stdlib.h>
#define kExtLDEFID 128 // resource id of our LDEF resource
#pragma implementation "listbox.h"
#endif
+#include "wx/app.h"
#include "wx/listbox.h"
#include "wx/settings.h"
#include "wx/dynarray.h"
#include "wx/log.h"
#include "wx/utils.h"
-#include "extldef.h"
+#ifdef __UNIX__
+ #include "ldef/extldef.h"
+#else
+ #include "extldef.h"
+#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
{
wxString search = s.Left( s.Length() - 1 ) ;
int len = search.Length() ;
- Str255 s1 , s2 ;
- strcpy( (char*) s2 , search.c_str() ) ;
- c2pstr( (char*) s2 ) ;
+ Str255 s1 , s2 ;
+
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) s2 , search.c_str() ) ;
+#else
+ strcpy( (char *) s2 , search.c_str() ) ;
+ c2pstr( (char *) s2 ) ;
+#endif
+
for ( int i = 0 ; i < m_noItems ; ++ i )
{
- strcpy( (char*) s1 , m_stringArray[i].Left( len ).c_str() ) ;
- c2pstr( (char*) s1 ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) s1 , m_stringArray[i].Left( len ).c_str() ) ;
+#else
+ strcpy( (char *) s1 , m_stringArray[i].Left( len ).c_str() ) ;
+ c2pstr( (char *) s1 ) ;
+#endif
if ( EqualString( s1 , s2 , false , false ) )
return i ;
}
else
{
Str255 s1 , s2 ;
- strcpy( (char*) s2 , s.c_str() ) ;
- c2pstr( (char*) s2 ) ;
+
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) s2 , s.c_str() ) ;
+#else
+ strcpy( (char *) s2 , s.c_str() ) ;
+ c2pstr( (char *) s2 ) ;
+#endif
+
for ( int i = 0 ; i < m_noItems ; ++ i )
{
- strcpy( (char*) s1 , m_stringArray[i].c_str() ) ;
- c2pstr( (char*) s1 ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) s1 , m_stringArray[i].c_str() ) ;
+#else
+ strcpy( (char *) s1 , m_stringArray[i].c_str() ) ;
+ c2pstr( (char *) s1 ) ;
+#endif
if ( EqualString( s1 , s2 , false , false ) )
return i ;
}
{
ListHandle list ;
long result ;
- Cell cell = { 0 , 0 } ;
UMAGetControlData( m_macControl , kControlNoPart , kControlListBoxListHandleTag , sizeof( ListHandle ) , (char*) &list , &result ) ;
LDelRow( 1 , N , list ) ;
}
* -------------------------------------------------------------------------
*/
+#include "wx/wx.h"
#include "wx/mac/macnotfy.h"
const short kMaxEvents = 1000 ;
#pragma implementation "menuitem.h"
#endif
+#include "wx/app.h"
#include "wx/menu.h"
#include "wx/menuitem.h"
+#include "wx/window.h"
#include "wx/log.h"
#include "wx/utils.h"
if ( m_invokingWindow != NULL )
return m_invokingWindow;
else if ( m_menuBar != NULL)
- return m_menuBar->GetFrame();
+ return (wxWindow *) m_menuBar->GetFrame();
return NULL;
}
return true ;
}
}
+#ifndef __WXMAC_X__
else if ( macMenuId == kHMHelpMenuID )
{
int menuItem = formerHelpMenuItems ;
}
}
}
+#endif // __WXMAC_X__
for (pos = 0, node = GetMenuItems().First(); node; node = node->Next(), pos++)
{
{
for (int i = 0; i < m_menus.GetCount() ; i++)
{
- if ( m_menus[i]->MacGetMenuId() == macMenuId ||
+ if ( m_menus[i]->MacGetMenuId() == macMenuId
+#ifndef __WXMAC_X__
+ ||
( macMenuId == kHMHelpMenuID && ( m_titles[i] == "?" || m_titles[i] == "&?" || m_titles[i] == wxApp::s_macHelpMenuTitleName ) )
+#endif
)
{
if ( m_menus[i]->MacMenuSelect( handler , when , macMenuId , macMenuItemNum ) )
// headers & declarations
// ============================================================================
+#include "wx/app.h"
#include "wx/menu.h"
#include "wx/menuitem.h"
#pragma implementation "msgdlg.h"
#endif
+#include "wx/app.h"
#include "wx/msgdlg.h"
#include "wx/mac/uma.h"
short result ;
Str255 pascalTitle ;
Str255 pascalText ;
+ char cText[256] ;
if (wxApp::s_macDefaultEncodingIsPC)
{
- strcpy( (char*) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ;
- strcpy( (char*) pascalText , wxMacMakeMacStringFromPC( m_message) ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ;
+#else
+ strcpy( (char *) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ;
+ c2pstr( (char *) pascalTitle ) ;
+#endif
+ strcpy(cText , wxMacMakeMacStringFromPC( m_message) ) ;
}
else
{
- strcpy( (char*) pascalTitle , m_caption ) ;
- strcpy( (char*) pascalText , m_message ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) pascalTitle , m_caption ) ;
+#else
+ strcpy( (char *) pascalTitle , m_caption ) ;
+ c2pstr( (char *) pascalTitle ) ;
+#endif
+ strcpy( cText , m_message ) ;
}
- c2pstr( (char*) pascalTitle ) ;
- wxMacConvertNewlines( (char*)pascalText ,(char*) pascalText) ;
- c2pstr( (char*) pascalText ) ;
+ wxMacConvertNewlines( cText , cText ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) pascalText , cText ) ;
+#else
+ strcpy( (char *) pascalText , cText ) ;
+ c2pstr( (char *) pascalText ) ;
+#endif
wxASSERT_MSG( ( m_dialogStyle & 0x3F ) != wxYES , "this style is not supported on mac" ) ;
tie.version = 0 ;
tie.iconSuiteID = 0 ;
- strcpy( (char*) tie.name , strText ) ;
- c2pstr( (char*) tie.name ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) tie.name , strText ) ;
+#else
+ strcpy( (char *) tie.name , strText ) ;
+ c2pstr( (char *) tie.name ) ;
+#endif
SetControlData( m_macControl, nPage + 1, kControlTabInfoTag , sizeof( ControlTabInfoRec) , (char*) &tie ) ;
SetControlData( m_macControl, m_nSelection + 1, kControlTabEnabledFlagTag, sizeof( Boolean ), (Ptr)&enabled );
// event table
// ----------------------------------------------------------------------------
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
+
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
tie.version = 0 ;
tie.iconSuiteID = 0 ;
- strcpy( (char*) tie.name , strText ) ;
- c2pstr( (char*) tie.name ) ;
+ c2pstrcpy( (StringPtr) tie.name , strText ) ;
SetControlData( m_macControl, nPage + 1, kControlTabInfoTag , sizeof( ControlTabInfoRec) , (char*) &tie ) ;
SetControlData( m_macControl, m_nSelection + 1, kControlTabEnabledFlagTag, sizeof( Boolean ), (Ptr)&enabled );
# include <fstream>
#endif
-#include <windows.h>
-#include <wx/palette.h>
-#include <wx/bitmap.h>
-#include <wx/mac/pnghand.h>
-#include <wx/mac/pngread.h>
+#ifndef __WXMAC_X__
+# include <windows.h>
+#endif
+#include "wx/msgdlg.h"
+#include "wx/palette.h"
+#include "wx/bitmap.h"
+#include "wx/mac/pnghand.h"
+#include "wx/mac/pngread.h"
extern "C" {
#include "png.h"
extern CTabHandle wxMacCreateColorTable( int numColors ) ;
extern void wxMacDestroyColorTable( CTabHandle colors ) ;
extern void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
-extern GWorldPtr wxMacCreateGWorld( int height , int width , int depth ) ;
+extern GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
extern void wxMacDestroyGWorld( GWorldPtr gw ) ;
void
{
wxMacDestroyGWorld( lpbi ) ;
}
- if (lpbi = wxMacCreateGWorld( Width , Height , Depth) )
+ lpbi = wxMacCreateGWorld( Width , Height , Depth);
+ if (lpbi)
{
EfeWidth = (long)(((long)Width*Depth + 31) / 32) * 4;
int bitwidth = width ;
int wxPrintDialog::ShowModal()
{
int result = wxID_CANCEL ;
- #if !TARGET_CARBON
+#if !TARGET_CARBON
OSErr err ;
wxString message ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
}
::UMAPrClose() ;
- #else
- #pragma warning "TODO:Printing for carbon"
- #endif
+#else
+ #if __UNIX__
+ #warning "TODO:Printing for carbon"
+ #else
+ #pragma warning "TODO:Printing for carbon"
+ #endif
+#endif
return result ;
}
}
::UMAPrClose() ;
#else
-#pragma warning "TODO:printing for carbon"
+ #if __UNIX__
+ #warning "TODO:Printing for carbon"
+ #else
+ #pragma warning "TODO:Printing for carbon"
+ #endif
#endif
return result ;
}
#endif
#include "wx/radiobox.h"
-#include <wx/mac/uma.h>
+#include "wx/radiobut.h"
+#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
#endif
#include "wx/settings.h"
+#include "wx/gdicmn.h"
wxColour wxSystemSettings::GetSystemColour(int index)
{
const wxValidator& validator,
const wxString& name)
{
- Rect bounds ;
- Str255 title ;
-
- MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
-
- m_macMinimumStatic = NULL ;
-
+ Rect bounds ;
+ Str255 title ;
+ wxSize slsize;
+ int maxtextwidth, textheight;
+
+ // Is control horizontal or vertical (Can be ambigous if user selects
+ // another style without also specifying horz or vert
+ if (!(style & wxSL_HORIZONTAL) && !(style & wxSL_VERTICAL)) {
+ // Default is horizontal so make it so
+ style |= wxSL_HORIZONTAL;
+ }
+ slsize = size;
+ // Check that size corresponds with users selection of vertical or
+ // horizontal slider and insert suitable default values
+ if (style & wxSL_HORIZONTAL)
+ {
+ slsize.y = 15; // Slider width
+ if (slsize.x == -1) {
+ slsize.x = 150; // Slider default length
+ }
+ }
+ else
+ {
+ slsize.x = 15; // Slider width
+ if (slsize.y == -1) {
+ slsize.y = 150; // Slider default length
+ }
+ }
+ /* Set the height and width for the slider control region. The actual
+ * slider is set at 10 pixels across. If the slider has labels then the
+ * control region must be large enough to contain these labels
+ */
+ if (style & wxSL_LABELS)
+ {
+ wxString text;
+ int ht, wd;
+
+ // Get maximum text label width and height
+ text.Printf("%d", minValue);
+ parent->GetTextExtent(text, &maxtextwidth, &textheight);
+ text.Printf("%d", maxValue);
+ parent->GetTextExtent(text, &wd, &ht);
+ if(ht > textheight) {
+ textheight = ht;
+ }
+ if (wd > maxtextwidth) {
+ maxtextwidth = wd;
+ }
+
+ if (style & wxSL_VERTICAL) {
+ slsize.x = (15 + maxtextwidth + 2); // Slider wd plus mac text width
+ }
+ if (style & wxSL_HORIZONTAL) {
+ slsize.y = (15 + textheight); // Slider ht plus text ht.
+ }
+ }
+
+ MacPreControlCreate( parent , id , "" , pos , slsize , style,
+ validator , name , &bounds , title ) ;
+
+ m_macMinimumStatic = NULL ;
+ m_macMaximumStatic = NULL ;
+ m_macValueStatic = NULL ;
+
m_lineSize = 1;
m_tickFreq = 0;
m_rangeMin = minValue;
m_pageSize = (int)((maxValue-minValue)/10);
- if ( m_width == -1 )
- {
- m_width = 20 ;
- if ( style & wxSL_LABELS && style & wxSL_VERTICAL )
- m_width += 24 ;
- bounds.right = bounds.left + m_width ;
- }
- if ( m_height == -1 )
+
+ // Must modify bounds to that of the slider dimensions from slider
+ // dimensions plus text labels.
+ if (style & wxSL_LABELS)
+ {
+ if ( style & wxSL_HORIZONTAL )
{
- m_height = 20 ;
- if ( style & wxSL_LABELS && style & wxSL_HORIZONTAL )
- m_height += 24 ;
- bounds.bottom = bounds.top + m_height ;
+ bounds.bottom = bounds.top + 15;
+ bounds.right -= (5 + maxtextwidth);
}
-
- if ( style & wxSL_LABELS && style & wxSL_HORIZONTAL )
+ else // Vertical slider
{
- bounds.top += 12 ;
- bounds.right -= 24 ;
+ bounds.right = bounds.left + 15;
+ bounds.bottom -= (5 + textheight);
}
-
- if ( style & wxSL_LABELS && style & wxSL_VERTICAL )
+ }
+
+ m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds ,
+ title , true , value , minValue , maxValue,
+ kControlSliderProc + kControlSliderLiveFeedback + ( ( style & wxSL_AUTOTICKS ) ? kControlSliderHasTickMarks : 0 ) , (long) this ) ;
+
+ wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
+
+ ::SetControlAction( m_macControl , wxMacLiveScrollbarActionUPP ) ;
+
+ MacPostControlCreate() ;
+
+ if ( style & wxSL_LABELS )
+ {
+ if ( style & wxSL_HORIZONTAL )
{
- bounds.left += 24 ;
- bounds.top += 12 ;
+ wxPoint leftpos( 0 , 15 ) ;
+ wxPoint rightpos( m_width - (maxtextwidth + 20) , 15 ) ;
+ wxPoint valuepos( m_width - maxtextwidth , 0 ) ;
+ wxString valuestring ;
+
+ valuestring.Printf( "%d" , minValue ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , leftpos ) ;
+
+ valuestring.Printf( "%d" , maxValue ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , rightpos ) ;
+
+ valuestring.Printf( "%d" , value ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos ) ;
}
-
- m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , value , minValue , maxValue,
- kControlSliderProc + kControlSliderLiveFeedback + ( ( style & wxSL_AUTOTICKS ) ? kControlSliderHasTickMarks : 0 ) , (long) this ) ;
-
- wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
-
- ::SetControlAction( m_macControl , wxMacLiveScrollbarActionUPP ) ;
-
- MacPostControlCreate() ;
-
- if ( style & wxSL_LABELS )
+ else // Vertical slider
{
- if ( style & wxSL_HORIZONTAL )
- {
- wxSize size( 24 , 12 ) ;
- wxPoint leftpos( 0 , 0 ) ;
- wxPoint rightpos( m_width - 2 * 12 , 0 ) ;
- wxPoint valuepos( m_width - 12 , 20 ) ;
- wxString valuestring ;
-
- valuestring.Printf( "%d" , minValue ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , leftpos , size ) ;
- valuestring.Printf( "%d" , maxValue ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , rightpos , size ) ;
- valuestring.Printf( "%d" , value ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos , size ) ;
- }
- else
- {
- wxSize size( 24 , 12 ) ;
- wxPoint toppos( 0 , 12 ) ;
- wxPoint bottompos( 0 , m_height - 12 ) ;
- wxPoint valuepos( 20 , 0 ) ;
- wxString valuestring ;
-
- valuestring.Printf( "%d" , minValue ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , bottompos , size ) ;
- valuestring.Printf( "%d" , maxValue ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , toppos , size ) ;
- valuestring.Printf( "%d" , value ) ;
- m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos , size ) ;
- }
+ wxPoint toppos( 17 , 0 ) ;
+ wxPoint bottompos( 17 , m_height - (textheight + 15) ) ;
+ wxPoint valuepos( 0 , m_height - textheight ) ;
+ wxString valuestring ;
+
+ valuestring.Printf( "%d" , minValue ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , bottompos ) ;
+
+ valuestring.Printf( "%d" , maxValue ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , toppos ) ;
+
+ valuestring.Printf( "%d" , value ) ;
+ m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos ) ;
}
-
- return TRUE;
-
+ }
+
+ return true;
}
wxSlider::~wxSlider()
{
wxString valuestring ;
valuestring.Printf( "%d" , value ) ;
- if ( m_macMinimumStatic )
+ if ( m_macMinimumStatic )
m_macMinimumStatic->SetLabel( valuestring ) ;
SetControlValue( m_macControl , value ) ;
}
void wxSlider::SetRange(int minValue, int maxValue)
{
- m_rangeMin = minValue;
- m_rangeMax = maxValue;
+ wxString value;
- // TODO
+ m_rangeMin = minValue;
+ m_rangeMax = maxValue;
+
+ // TODO
+ SetControlMinimum(m_macControl, m_rangeMin);
+ SetControlMaximum(m_macControl, m_rangeMax);
+
+ if(m_macMinimumStatic) {
+ value.Printf("%d", m_rangeMin);
+ m_macMinimumStatic->SetLabel(value);
+ }
+ if(m_macMaximumStatic) {
+ value.Printf("%d", m_rangeMax);
+ m_macMaximumStatic->SetLabel(value);
+ }
+ SetValue(m_rangeMin);
}
// For trackbars only
#ifdef __GNUG__
#pragma implementation "spinbutt.h"
+#pragma implementation "spinbuttbase.h"
#endif
#include "wx/spinbutt.h"
IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent);
#endif
+wxSpinButton::wxSpinButton()
+ : wxSpinButtonBase()
+{
+}
+
bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, const wxString& name)
{
// Attributes
////////////////////////////////////////////////////////////////////////////
+int wxSpinButton::GetMin() const
+{
+ return m_min;
+}
+
+int wxSpinButton::GetMax() const
+{
+ return m_max;
+}
+
int wxSpinButton::GetValue() const
{
return m_value;
return ;
wxEventType scrollEvent = wxEVT_NULL;
- int nScrollInc;
+ int nScrollInc = 0;
switch( controlpart )
{
#endif
#include "wx/statbmp.h"
+#include "wx/dcclient.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
// headers
// ----------------------------------------------------------------------------
-#include "wx/mac/statusbr.h"
+#include "wx/statusbr.h"
+#include "wx/dc.h"
+#include "wx/dcclient.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStatusBarMac, wxStatusBarGeneric);
// ============================================================================
// ----------------------------------------------------------------------------
-// wxStatusBarXX class
+// wxStatusBarMac class
// ----------------------------------------------------------------------------
wxStatusBarMac::wxStatusBarMac()
# ifdef __WXMSW__
dc.SetFont(wxNullFont);
# endif // MSW
-}
\ No newline at end of file
+}
#include "wx/app.h"
#include "wx/stattext.h"
+#include "wx/dc.h"
+#include "wx/dcclient.h"
#include <stdio.h>
#pragma implementation "textctrl.h"
#endif
-#ifndef __WXMAC__
-#include <sys/types.h>
-#include <sys/stat.h>
+#ifdef __UNIX__
+ #include <sys/types.h>
+ #include <sys/stat.h>
#else
-#include <stat.h>
+ #include <stat.h>
#endif
#include <fstream.h>
+#include "wx/app.h"
+#include "wx/button.h"
+#include "wx/panel.h"
#include "wx/textctrl.h"
#include "wx/settings.h"
#include "wx/filefn.h"
#include "wx/utils.h"
#if defined(__BORLANDC__) && !defined(__WIN32__)
-#include <alloc.h>
-#else
-#ifndef __MWERKS__
-#ifndef __GNUWIN32__
-#include <malloc.h>
-#endif
-#endif
+ #include <alloc.h>
+#elif !defined(__MWERKS__) && !defined(__GNUWIN32) && !defined(__WXMAC_X__)
+ #include <malloc.h>
#endif
#include "wx/mac/uma.h"
wxCHECK_MSG( m_info.m_task.tmAddr == NULL , FALSE, wxT("attempting to restart a timer") );
m_milli = milliseconds;
- m_info.m_task.tmAddr = NewTimerProc( MacTimerProc ) ;
- m_info.m_task.tmWakeUp = 0 ;
- m_info.m_task.tmReserved = 0 ;
+#ifdef __UNIX__
+ m_info.m_task.tmAddr = NewTimerUPP( MacTimerProc ) ;
+#else
+ m_info.m_task.tmAddr = NewTimerProc( MacTimerProc ) ;
+#endif
+ m_info.m_task.tmWakeUp = 0 ;
+ m_info.m_task.tmReserved = 0 ;
InsXTime((QElemPtr) &m_info.m_task ) ;
PrimeTime( (QElemPtr) &m_info.m_task , m_milli ) ;
return FALSE;
#if wxUSE_TOOLTIPS
+#include "wx/app.h"
#include "wx/window.h"
#include "wx/tooltip.h"
+#include "wx/timer.h"
#include "wx/geometry.h"
#include "wx/mac/aga.h"
#include "wx/mac/uma.h"
#endif
#include "wx/stubs/textctrl.h"
+#include "wx/treebase.h"
#include "wx/stubs/treectrl.h"
#if !USE_SHARED_LIBRARY
-#include <wx/mac/uma.h>
-#include <wx/mac/aga.h>
+#include "wx/defs.h"
+#include "wx/mac/uma.h"
+#include "wx/mac/aga.h"
-
-#include "Navigation.h"
+#ifdef __UNIX__
+ #include <NavigationServices/Navigation.h>
+#else
+ #include <Navigation.h>
+#endif
// init
#endif // UMA_USE_WINDOWMGR
#endif
+#ifndef __UNIX__
if ( sUMAHasWindowManager )
InitFloatingWindows() ;
else
InitWindows();
+#endif
if ( NavServicesAvailable() )
{
Str255 ptitle ;
strncpy( (char*)ptitle , title , 96 ) ;
ptitle[96] = 0 ;
+#if TARGET_CARBON
+ c2pstrcpy( ptitle, (char *)ptitle ) ;
+#else
c2pstr( (char*)ptitle ) ;
+#endif
SetWTitle( inWindowRef , ptitle ) ;
}
+
void UMAGetWTitleC( WindowRef inWindowRef , char *title )
{
GetWTitle( inWindowRef , (unsigned char*)title ) ;
+#if TARGET_CARBON
+ p2cstrcpy( title, (unsigned char *)title ) ;
+#else
p2cstr( (unsigned char*)title ) ;
+#endif
}
void UMAShowWindow( WindowRef inWindowRef )
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
{
#if UMA_USE_APPEARANCE
- if ( UMAHasAppearance() )
- {
- ::DrawThemePlacard( inRect , inState ) ;
- }
- else
+ if ( UMAHasAppearance() )
+ {
+ ::DrawThemePlacard( inRect , inState ) ;
+ }
+ else
#endif
#if !TARGET_CARBON
- {
- }
+ {
+ }
#else
- {
- }
+ {
+ }
#endif
}
#include <string.h>
#include <stdarg.h>
+#ifndef __UNIX__
+// defined in unix/utilsunx.cpp for Mac OS X
+
// get full hostname (with domain name if possible)
bool wxGetFullHostName(wxChar *buf, int maxSize)
{
{
// TODO
}
+#endif // !__UNIX__
// Emit a beeeeeep
void wxBell()
return strDir ;
}
+#ifndef __UNIX__
char *wxGetUserHome (const wxString& user)
{
// TODO
return NULL;
}
+#endif
// Check whether this window wants to process messages, e.g. Stop button
// in long calculations.
*width = screenBits.bounds.right - screenBits.bounds.left ;
*height = screenBits.bounds.bottom - screenBits.bounds.top ;
- #if TARGET_CARBON
+#if TARGET_CARBON
SInt16 mheight ;
GetThemeMenuBarHeight( &mheight ) ;
*height -= mheight ;
#else
*height -= LMGetMBarHeight() ;
- #endif
+#endif
}
wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
#include "wx/object.h"
#include "wx/string.h"
-#include "wx/mac/wave.h"
+#include "wx/wave.h"
wxWave::wxWave()
- : m_hSnd(NULL), m_waveLength(0), m_isResource(true), m_sndChan(0)
+ : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
{
}
wxWave::wxWave(const wxString& sFileName, bool isResource)
- : m_hSnd(NULL), m_waveLength(0), m_isResource(true), m_sndChan(0)
+ : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
{
Create(sFileName, isResource);
}
#include "wx/layout.h"
#include "wx/dialog.h"
#include "wx/listbox.h"
+#include "wx/scrolbar.h"
+#include "wx/statbox.h"
#include "wx/button.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
#include "wx/tabctrl.h"
#include "wx/tooltip.h"
// TODO remove the line below, just for lookup-up convenience CS
-#include "wx/mac/window.h"
+#include "wx/window.h"
#include "wx/menuitem.h"
#include "wx/log.h"
// translate the window attributes in the appropriate window class and attributes
- WindowClass wclass ;
- WindowAttributes attr ;
+ WindowClass wclass = 0;
+ WindowAttributes attr = kWindowNoAttributes ;
if ( HasFlag(wxTINY_CAPTION_HORIZ) || HasFlag(wxTINY_CAPTION_VERT) )
{
wclass = kModalWindowClass ;
}
- attr = kWindowNoAttributes ;
-
if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) )
{
attr |= kWindowFullZoomAttribute ;