void AGASetThemeWindowBackground (WindowRef inWindow,
ThemeBrush inBrush,
Boolean inUpdate) ;
+void AGAApplyThemeBackground (ThemeBackgroundKind inKind,
+ const Rect * bounds,
+ ThemeDrawState inState,
+ SInt16 inDepth,
+ Boolean inColorDev) ;
void AGAMoveControl( ControlHandle inControl , short x , short y ) ;
void AGASizeControl( ControlHandle inControl , short x , short y ) ;
+class AGAPortHelper
+{
+public :
+ AGAPortHelper( GrafPtr newport) ;
+ AGAPortHelper() ;
+ void Setup( GrafPtr newport ) ;
+ void Clear() ;
+ bool IsCleared() { return clip == NULL ; }
+ GrafPtr GetCurrentPort() { return nport ; }
+ ~AGAPortHelper() ;
+
+private :
+ GrafPtr nport ;
+ GrafPtr port ;
+ PenState oldPenState ;
+ RGBColor oldForeColor ;
+ RGBColor oldBackColor ;
+ RgnHandle clip ;
+ short font ;
+ short size ;
+ short style ;
+ short mode ;
+} ;
+
#endif
\ No newline at end of file
// Represents the application. Derive OnInit and declare
// a new App object to start application
-class WXDLLEXPORT wxApp: public wxEvtHandler
+class WXDLLEXPORT wxApp: public wxAppBase
{
DECLARE_DYNAMIC_CLASS(wxApp)
wxApp();
- inline ~wxApp() {}
-
- static void SetInitializerFunction(wxAppInitializerFunction fn) { m_appInitFn = fn; }
- static wxAppInitializerFunction GetInitializerFunction() { return m_appInitFn; }
+ virtual ~wxApp() {}
virtual int MainLoop();
- void ExitMainLoop();
- bool Initialized();
+ virtual void ExitMainLoop();
+ virtual bool Initialized();
virtual bool Pending() ;
virtual void Dispatch() ;
- void OnIdle(wxIdleEvent& event);
-
-// Generic
- virtual bool OnInit() { return FALSE; };
-
- // No specific tasks to do here.
- virtual bool OnInitGui() { return TRUE; }
-
- // Called to set off the main loop
- virtual int OnRun() { return MainLoop(); };
- virtual int OnExit() { return 0; }
-
- inline void SetPrintMode(int mode) { m_printMode = mode; }
- inline int GetPrintMode() const { return m_printMode; }
-
- inline void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
- inline bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; }
-
- inline wxString GetAppName() const {
- if (m_appName != "")
- return m_appName;
- else return m_className;
- }
+ virtual wxIcon GetStdIcon(int which) const;
+ virtual void SetPrintMode(int mode) { m_printMode = mode; }
+ virtual int GetPrintMode() const { return m_printMode; }
- inline void SetAppName(const wxString& name) { m_appName = name; };
- inline wxString GetClassName() const { return m_className; }
- inline void SetClassName(const wxString& name) { m_className = name; }
-
- void SetVendorName(const wxString& vendorName) { m_vendorName = vendorName; }
- const wxString& GetVendorName() const { return m_vendorName; }
-
- wxWindow *GetTopWindow() const ;
- inline void SetTopWindow(wxWindow *win) { m_topWindow = win; }
-
- inline void SetWantDebugOutput(bool flag) { m_wantDebugOutput = flag; }
- inline bool GetWantDebugOutput() { return m_wantDebugOutput; }
+ // implementation only
+ void OnIdle(wxIdleEvent& event);
+ void OnEndSession(wxCloseEvent& event);
+ void OnQueryEndSession(wxCloseEvent& event);
// Send idle event to all top-level windows.
// Returns TRUE if more idle time is requested.
inline void SetAuto3D(bool flag) { m_auto3D = flag; }
inline bool GetAuto3D() const { return m_auto3D; }
- // Creates a log object
- virtual wxLog* CreateLogTarget();
-
-public:
- // Will always be set to the appropriate, main-style values.
- int argc;
- char ** argv;
-
protected:
- bool m_wantDebugOutput ;
- wxString m_className;
- wxString m_appName,
- m_vendorName;
- wxWindow * m_topWindow;
- bool m_exitOnFrameDelete;
bool m_showOnInit;
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
bool m_auto3D ; // Always use 3D controls, except
// where overriden
- static wxAppInitializerFunction m_appInitFn;
-
public:
// Implementation
void DeletePendingObjects();
bool ProcessIdle();
+ bool IsExiting() { return !m_keepGoing ; }
public:
static long sm_lastMessageTime;
};
// TODO: add platform-specific arguments
-int WXDLLEXPORT wxEntry( int argc, char *argv[] );
+int WXDLLEXPORT wxEntry( int argc, char *argv[] , bool enterLoop = TRUE);
void wxMacConvertFromPCForControls( char * p ) ;
DECLARE_DYNAMIC_CLASS(wxChoice)
public:
- inline wxChoice() { m_noStrings = 0; }
+ inline wxChoice() {}
inline wxChoice(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
virtual wxString GetStringSelection() const ;
virtual bool SetStringSelection(const wxString& sel);
- virtual inline int Number() const { return m_noStrings; }
+ virtual inline int Number() const { return m_strings.GetCount(); }
virtual void Command(wxCommandEvent& event);
virtual inline void SetColumns(int WXUNUSED(n) = 1 ) { /* No effect */ } ;
void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
protected:
- int m_noStrings;
+ wxArrayString m_strings;
MenuHandle m_macPopUpMenuHandle ;
};
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxDataObject;
-class WXDLLEXPORT wxClipboard : public wxObject
+class WXDLLEXPORT wxClipboard : public wxClipboardBase
{
DECLARE_DYNAMIC_CLASS(wxClipboard)
virtual bool AddData( wxDataObject *data );
// ask if data in correct format is available
- virtual bool IsSupported( wxDataFormat format );
+ virtual bool IsSupported( const wxDataFormat& format );
// fill data with data on the clipboard (if available)
virtual bool GetData( wxDataObject& data );
public:
wxControl();
- virtual ~wxControl();
+ wxControl(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxControlNameStr)
+ {
+ Create(parent, id, pos, size, style, validator, name);
+ }
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
+ virtual ~wxControl();
// Simulates an event
virtual void Command(wxCommandEvent& event) { ProcessCommand(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,
protected:
// For controls like radiobuttons which are really composite
- ControlHandle m_macControl ;
- int m_macHorizontalBorder ;
- int m_macVerticalBorder ;
- wxList m_subControls;
+ ControlHandle m_macControl ;
+ wxList m_subControls;
+ int m_macHorizontalBorder ;
+ int m_macVerticalBorder ;
- virtual wxSize DoGetBestSize() const ;
+ virtual wxSize DoGetBestSize() const;
private:
DECLARE_EVENT_TABLE()
///////////////////////////////////////////////////////////////////////////////
-// Name: os2/dataform.h
+// Name: mac/dataform.h
// Purpose: declaration of the wxDataFormat class
-// Author: David Webster (lifted from dnd.h)
+// Author: Stefan Csomor (lifted from dnd.h)
// Modified by:
// Created: 10/21/99
// RCS-ID: $Id$
-// Copyright: (c) 1999 David Webster
+// Copyright: (c) 1999 Stefan Csomor
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
-#ifndef _WX_OS2_DATAFORM_H
-#define _WX_OS2_DATAFORM_H
+#ifndef _WX_MAC_DATAFORM_H
+#define _WX_MAC_DATAFORM_H
class wxDataFormat
{
public:
- // the clipboard formats under GDK are GdkAtoms
- typedef unsigned short NativeFormat;
+ typedef OSType NativeFormat;
wxDataFormat();
wxDataFormat(wxDataFormatId vType);
{ SetId(vFormat); return *this; }
// comparison (must have both versions)
- bool operator==(NativeFormat vFormat) const
- { return m_vFormat == (NativeFormat)vFormat; }
- bool operator!=(NativeFormat vFormat) const
- { return m_vFormat != (NativeFormat)vFormat; }
+ bool operator==(NativeFormat format) const
+ { return m_format == (NativeFormat)format; }
+ bool operator!=(NativeFormat format) const
+ { return m_format != (NativeFormat)format; }
+ bool operator==(wxDataFormatId format) const
+ { return m_type == (wxDataFormatId)format; }
+ bool operator!=(wxDataFormatId format) const
+ { return m_type != (wxDataFormatId)format; }
// explicit and implicit conversions to NativeFormat which is one of
// standard data types (implicit conversion is useful for preserving the
// compatibility with old code)
- NativeFormat GetFormatId() const { return m_vFormat; }
- operator NativeFormat() const { return m_vFormat; }
+ NativeFormat GetFormatId() const { return m_format; }
+ operator NativeFormat() const { return m_format; }
- void SetId(NativeFormat vFormat);
+ void SetId(NativeFormat format);
// string ids are used for custom types - this SetId() must be used for
// application-specific formats
// implementation
wxDataFormatId GetType() const;
+ void SetType( wxDataFormatId type );
private:
- wxDataFormatId m_vType;
- NativeFormat m_vFormat;
-
- void PrepareFormats();
- void SetType(wxDataFormatId vType);
+ wxDataFormatId m_type;
+ NativeFormat m_format;
};
-#endif // _WX_GTK_DATAFORM_H
+#endif // _WX_MAC_DATAFORM_H
#include "wx/icon.h"
#include "wx/font.h"
#include "wx/gdicmn.h"
+#include "wx/mac/aga.h"
//-----------------------------------------------------------------------------
// constants
// wxDC
//-----------------------------------------------------------------------------
-class WXDLLEXPORT wxDC: public wxObject
+class WXDLLEXPORT wxDC: public wxDCBase
{
- DECLARE_ABSTRACT_CLASS(wxDC)
+ DECLARE_DYNAMIC_CLASS(wxDC)
public:
- wxDC(void);
- ~wxDC(void);
+ wxDC();
+ ~wxDC();
+
+ // implement base class pure virtuals
+ // ----------------------------------
+
+ virtual void Clear();
+
+ virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; };
+ virtual void EndDoc(void) {};
+
+ virtual void StartPage(void) {};
+ virtual void EndPage(void) {};
+
+ virtual void SetFont(const wxFont& font);
+ virtual void SetPen(const wxPen& pen);
+ virtual void SetBrush(const wxBrush& brush);
+ virtual void SetBackground(const wxBrush& brush);
+ virtual void SetBackgroundMode(int mode);
+ virtual void SetPalette(const wxPalette& palette);
+
+ virtual void DestroyClippingRegion();
+
+ virtual wxCoord GetCharHeight() const;
+ virtual wxCoord GetCharWidth() const;
+ virtual void DoGetTextExtent(const wxString& string,
+ wxCoord *x, wxCoord *y,
+ wxCoord *descent = NULL,
+ wxCoord *externalLeading = NULL,
+ wxFont *theFont = NULL) const;
+
+ virtual bool CanDrawBitmap() const;
+ virtual bool CanGetTextExtent() const;
+ virtual int GetDepth() const;
+ virtual wxSize GetPPI() const;
+
+ virtual void SetMapMode(int mode);
+ virtual void SetUserScale(double x, double y);
+
+ virtual void SetLogicalScale(double x, double y);
+ virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
+ virtual void SetDeviceOrigin(wxCoord x, wxCoord y);
+ virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
+ virtual void SetLogicalFunction(int function);
+
+ virtual void SetTextForeground(const wxColour& colour) ;
+ virtual void SetTextBackground(const wxColour& colour) ;
+
+//
+//
+
+/*
void BeginDrawing(void) {};
void EndDrawing(void) {};
}
virtual bool CanGetTextExtent(void) const ;
- virtual void GetTextExtent( const wxString &string, long *width, long *height,
- long *descent = NULL, long *externalLeading = NULL,
- wxFont *theFont = NULL, bool use16 = FALSE ) const ;
virtual void GetTextExtent( const wxString &string, int *width, int *height,
int *descent = NULL, int *externalLeading = NULL,
- wxFont *theFont = NULL, bool use16 = FALSE ) const
- {
- long lwidth,lheight,ldescent,lexternal ;
- GetTextExtent( string, &lwidth,&lheight,&ldescent,&lexternal,theFont,use16 ) ;
- *width = lwidth ;
- *height = lheight ;
- if (descent) *descent = ldescent ;
- if (externalLeading) *externalLeading = lexternal ;
- }
+ wxFont *theFont = NULL, bool use16 = FALSE ) const ;
virtual wxCoord GetCharWidth(void) const;
virtual wxCoord GetCharHeight(void) const;
inline wxSize GetSize(void) const { int w, h; GetSize(&w, &h); return wxSize(w, h); }
virtual void GetSizeMM( long* width, long* height ) const;
- virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; };
- virtual void EndDoc(void) {};
- virtual void StartPage(void) {};
- virtual void EndPage(void) {};
- virtual void SetMapMode( int mode );
virtual int GetMapMode(void) const { return m_mappingMode; };
- virtual void SetUserScale( double x, double y );
virtual void GetUserScale( double *x, double *y );
- virtual void SetLogicalScale( double x, double y );
virtual void GetLogicalScale( double *x, double *y );
- virtual void SetLogicalOrigin( long x, long y );
virtual void GetLogicalOrigin( long *x, long *y );
- virtual void SetDeviceOrigin( long x, long y );
virtual void GetDeviceOrigin( long *x, long *y );
virtual void SetInternalDeviceOrigin( long x, long y );
virtual void GetInternalDeviceOrigin( long *x, long *y );
-
- virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
virtual void SetOptimization( bool WXUNUSED(optimize) ) {};
virtual bool GetOptimization(void) { return m_optimize; };
virtual long LogicalToDeviceXRel(long x) const;
virtual long LogicalToDeviceYRel(long y) const;
- public:
-
void CalcBoundingBox( long x, long y );
+*/
+
void ComputeScaleAndOrigin(void);
+ public:
+
long XDEV2LOG(long x) const
{
return (long)((double)(y) * m_scaleY - 0.5);
}
+//
+
+protected:
+ virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
+ int style = wxFLOOD_SURFACE);
+
+ virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
+
+ virtual void DoDrawPoint(wxCoord x, wxCoord y);
+ virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
+
+ virtual void DoDrawArc(wxCoord x1, wxCoord y1,
+ wxCoord x2, wxCoord y2,
+ wxCoord xc, wxCoord yc);
+
+ virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
+ double sa, double ea);
+
+ virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
+ virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
+ wxCoord width, wxCoord height,
+ double radius);
+ virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
+
+ virtual void DoCrossHair(wxCoord x, wxCoord y);
+
+ virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
+ virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
+ bool useMask = FALSE);
+
+ virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
+ virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
+ double angle);
+
+ virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
+ wxDC *source, wxCoord xsrc, wxCoord ysrc,
+ int rop = wxCOPY, bool useMask = FALSE);
+
+ // this is gnarly - we can't even call this function DoSetClippingRegion()
+ // because of virtual function hiding
+ virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
+ virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
+ wxCoord width, wxCoord height);
+ virtual void DoGetClippingRegion(wxCoord *x, wxCoord *y,
+ wxCoord *width, wxCoord *height)
+ {
+ GetClippingBox(x, y, width, height);
+ }
+
+ virtual void DoGetSize(int *width, int *height) const;
+ virtual void DoGetSizeMM(int* width, int* height) const;
+
+ virtual void DoDrawLines(int n, wxPoint points[],
+ wxCoord xoffset, wxCoord yoffset);
+ virtual void DoDrawPolygon(int n, wxPoint points[],
+ wxCoord xoffset, wxCoord yoffset,
+ int fillStyle = wxODDEVEN_RULE);
+
+#if wxUSE_SPLINES
+ virtual void DoDrawSpline(wxList *points);
+#endif // wxUSE_SPLINES
+
+
+//
+
public:
bool m_ok;
bool m_needComputeScaleX,m_needComputeScaleY; // not yet used
+ float m_scaleFactor; // wxPSDC wants to have this. Will disappear.
+
long m_clipX1,m_clipY1,m_clipX2,m_clipY2;
long m_minX,m_maxX,m_minY,m_maxY;
GrafPtr m_macOrigPort ;
Rect m_macClipRect ;
Point m_macLocalOrigin ;
-
+ AGAPortHelper m_macPortHelper ;
void MacSetupPort() const ;
void MacVerifySetup() const { if ( m_macPortId != m_macCurrentPortId ) MacSetupPort() ; }
~wxDialog();
virtual bool Destroy();
+ bool Show(bool show);
+ void Iconize(bool iconize);
+ virtual bool IsIconized() const;
- virtual void DoSetClientSize(int width, int height);
+ virtual bool IsTopLevel() const { return TRUE; }
- virtual void GetPosition(int *x, int *y) const;
+ void SetModal(bool flag);
+ virtual bool IsModal() const;
- bool Show(bool show);
- bool IsShown() const;
- void Iconize(bool iconize);
+ // For now, same as Show(TRUE) but returns return code
+ virtual int ShowModal();
+
+ // may be called to terminate the dialog with the given return code
+ virtual void EndModal(int retCode);
+
+ // returns TRUE if we're in a modal loop
+ bool IsModalShowing() const;
#if WXWIN_COMPATIBILITY
bool Iconized() const { return IsIconized(); };
#endif
- virtual bool IsIconized() const;
- void Fit();
-
- void SetTitle(const wxString& title);
- wxString GetTitle() const ;
+ // implementation
+ // --------------
- void OnSize(wxSizeEvent& event);
+ // event handlers
bool OnClose();
void OnCharHook(wxKeyEvent& event);
- void OnPaint(wxPaintEvent& event);
void OnCloseWindow(wxCloseEvent& event);
- void SetModal(bool flag);
-
- virtual void Centre(int direction = wxBOTH);
- virtual bool IsModal() const;
-
- // For now, same as Show(TRUE) but returns return code
- virtual int ShowModal();
- virtual void EndModal(int retCode);
-
// Standard buttons
void OnOK(wxCommandEvent& event);
void OnApply(wxCommandEvent& event);
// Responds to colour changes
void OnSysColourChanged(wxSysColourChangedEvent& event);
- // implementation
- // --------------
-
- bool IsModalShowing() const { return m_modalShowing; }
- virtual bool IsTopLevel() const { return TRUE; }
-
- // tooltip management
-#if wxUSE_TOOLTIPS
- wxMacToolTip* GetToolTipCtrl() const { return m_hwndToolTip; }
- void SetToolTipCtrl(wxMacToolTip *tt) { m_hwndToolTip = tt; }
- wxMacToolTip* m_hwndToolTip ;
-#endif // tooltips
+ // override more base class virtuals
+ virtual void DoGetPosition(int *x, int *y) const;
+ virtual void DoSetClientSize(int width, int height);
-protected:
- bool m_modalShowing;
- WXHWND m_hwndOldFocus; // the window which had focus before we were shown
+ // show modal dialog and enter modal loop
+ void DoShowModal();
private:
DECLARE_EVENT_TABLE()
class WXDLLEXPORT wxStatusBar;
class WXDLLEXPORT wxMacToolTip ;
-class WXDLLEXPORT wxFrame: public wxWindow {
+class WXDLLEXPORT wxFrame: public wxFrameBase {
DECLARE_DYNAMIC_CLASS(wxFrame)
public:
- wxFrame();
- inline wxFrame(wxWindow *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE,
- const wxString& name = wxFrameNameStr)
- {
- Create(parent, id, title, pos, size, style, name);
- }
-
- ~wxFrame();
-
- bool Create(wxWindow *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE,
- const wxString& name = wxFrameNameStr);
-
- virtual bool Destroy();
- virtual bool IsTopLevel() const { return TRUE; }
-
- void OnSize(wxSizeEvent& event);
- void OnMenuHighlight(wxMenuEvent& event);
- void OnActivate(wxActivateEvent& event);
- void OnIdle(wxIdleEvent& event);
- void OnCloseWindow(wxCloseEvent& event);
-
- // Set menu bar
- void SetMenuBar(wxMenuBar *menu_bar);
- virtual wxMenuBar *GetMenuBar() const ;
-
- // Call this to simulate a menu command
- virtual void Command(int id);
- virtual void ProcessCommand(int id);
-
- // Set icon
- virtual void SetIcon(const wxIcon& icon);
-
- // Create status line
- virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
- const wxString& name = "statusBar");
- inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
- virtual void PositionStatusBar();
- virtual wxStatusBar *OnCreateStatusBar(int number, long style, wxWindowID id,
- const wxString& name);
-
+ // construction
+ wxFrame() { Init(); }
+ wxFrame(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE,
+ const wxString& name = wxFrameNameStr)
+ {
+ Init();
+
+ Create(parent, id, title, pos, size, style, name);
+ }
+
+ bool Create(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE,
+ const wxString& name = wxFrameNameStr);
+
+ virtual ~wxFrame();
+
+ // implement base class pure virtuals
+ virtual void Maximize(bool maximize = TRUE);
+ virtual bool IsMaximized() const;
+ virtual void Iconize(bool iconize = TRUE);
+ virtual bool IsIconized() const;
+ virtual void Restore();
+ virtual void SetMenuBar(wxMenuBar *menubar);
+ virtual void SetIcon(const wxIcon& icon);
+
+ // implementation only from now on
+ // -------------------------------
+
+ // override some more virtuals
+ virtual bool Enable(bool enable) ;
+
+ // get the origin of the client area (which may be different from (0, 0)
+ // if the frame has a toolbar) in client coordinates
+ virtual wxPoint GetClientAreaOrigin() const;
+
+ // event handlers
+ void OnActivate(wxActivateEvent& event);
+ void OnSysColourChanged(wxSysColourChangedEvent& event);
+
+ // Toolbar
#if wxUSE_TOOLBAR
+ virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT,
+ wxWindowID id = -1,
+ const wxString& name = wxToolBarNameStr);
- // Create toolbar
- virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name = wxToolBarNameStr);
- virtual wxToolBar *OnCreateToolBar(long style, wxWindowID id, const wxString& name);
- // If made known to the frame, the frame will manage it automatically.
- virtual inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
- virtual inline wxToolBar *GetToolBar() const { return m_frameToolBar; }
- virtual void PositionToolBar();
-
-#endif
+ virtual void PositionToolBar();
+#endif // wxUSE_TOOLBAR
- // Set status line text
- virtual void SetStatusText(const wxString& text, int number = 0);
+ // Status bar
+#if wxUSE_STATUSBAR
+ virtual wxStatusBar* OnCreateStatusBar(int number = 1,
+ long style = wxST_SIZEGRIP,
+ wxWindowID id = 0,
+ const wxString& name = wxStatusLineNameStr);
- // Set status line widths
- virtual void SetStatusWidths(int n, const int widths_field[]);
+ virtual void PositionStatusBar();
// Hint to tell framework which status bar to use
// TODO: should this go into a wxFrameworkSettings class perhaps?
static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; };
static bool UsesNativeStatusBar() { return m_useNativeStatusBar; };
+#endif // wxUSE_STATUSBAR
- // Fit frame around subwindows
- virtual void Fit();
-
- // Iconize
- virtual void Iconize(bool iconize);
-
- virtual bool IsIconized() const ;
-
- // Compatibility
- inline bool Iconized() const { return IsIconized(); }
-
- // Is the frame maximized?
- virtual bool IsMaximized(void) const ;
-
- virtual void Maximize(bool maximize);
-
- // Responds to colour changes
- void OnSysColourChanged(wxSysColourChangedEvent& event);
-
- // Query app for menu item updates (called from OnIdle)
- // Query app for menu item updates (called from OnIdle)
- void DoMenuUpdates();
- void DoMenuUpdates(wxMenu* menu, wxWindow* focusWin);
-
- // Checks if there is a toolbar, and returns the first free client position
- virtual wxPoint GetClientAreaOrigin() const;
- virtual void DoGetClientSize(int *x, int *y) const ;
- virtual void DoSetClientSize(int clientwidth, int clientheight) ;
-
- // tooltip management
+ // tooltip management
#if wxUSE_TOOLTIPS
wxMacToolTip* GetToolTipCtrl() const { return m_hwndToolTip; }
void SetToolTipCtrl(wxMacToolTip *tt) { m_hwndToolTip = tt; }
#endif // tooltips
protected:
- wxMenuBar * m_frameMenuBar;
- wxStatusBar * m_frameStatusBar;
- wxIcon m_icon;
+ // common part of all ctors
+ void Init();
+
+ // override base class virtuals
+ virtual void DoGetClientSize(int *width, int *height) const;
+ virtual void DoSetClientSize(int width, int height);
+
+protected:
bool m_iconized;
- static bool m_useNativeStatusBar;
-#if wxUSE_TOOLBAR
- wxToolBar * m_frameToolBar ;
-#endif
+#if wxUSE_STATUSBAR
+ static bool m_useNativeStatusBar;
+#endif // wxUSE_STATUSBAR
- DECLARE_EVENT_TABLE()
+private:
+ DECLARE_EVENT_TABLE()
};
#endif
int m_noItems;
int m_selected;
- virtual wxSize DoGetBestSize() const ;
+ virtual wxSize DoGetBestSize() const;
#if wxUSE_OWNER_DRAWN
// control items
// menu handle depending on what we're
int GetRealId() const;
+ static MacBuildMenuString(StringPtr outMacItemText, SInt16 *outMacShortcutChar , UInt8 *outMacModifiers , const char *inItemName , bool useShortcuts ) ;
+
private:
DECLARE_DYNAMIC_CLASS(wxMenuItem)
};
#include "wx/colour.h"
#include "wx/bitmap.h"
-typedef long wxMACDash;
-
class WXDLLEXPORT wxPen;
class WXDLLEXPORT wxPenRefData: public wxGDIRefData
int m_cap ;
wxBitmap m_stipple ;
int m_nbDash ;
- wxMACDash * m_dash ;
+ wxDash * m_dash ;
wxColour m_colour;
/* TODO: implementation
WXHPEN m_hPen;
inline int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); };
inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
- inline int GetDashes(wxDash **ptr) const
- {
- *ptr = (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*) NULL);
- return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
+ inline int GetDashes(wxDash **ptr) const {
+ *ptr = (M_PENDATA ? M_PENDATA->m_dash : (wxDash*) NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
}
inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); };
#include "wx/colour.h"
#include "wx/font.h"
+#define wxSYS_WHITE_BRUSH 0
+#define wxSYS_LTGRAY_BRUSH 1
+#define wxSYS_GRAY_BRUSH 2
+#define wxSYS_DKGRAY_BRUSH 3
+#define wxSYS_BLACK_BRUSH 4
+#define wxSYS_NULL_BRUSH 5
+#define wxSYS_HOLLOW_BRUSH wxSYS_NULL_BRUSH
+#define wxSYS_WHITE_PEN 6
+#define wxSYS_BLACK_PEN 7
+#define wxSYS_NULL_PEN 8
+#define wxSYS_OEM_FIXED_FONT 10
+#define wxSYS_ANSI_FIXED_FONT 11
+#define wxSYS_ANSI_VAR_FONT 12
+#define wxSYS_SYSTEM_FONT 13
+#define wxSYS_DEVICE_DEFAULT_FONT 14
+#define wxSYS_DEFAULT_PALETTE 15
+#define wxSYS_SYSTEM_FIXED_FONT 16 // Obsolete
+#define wxSYS_DEFAULT_GUI_FONT 17
+
+#define wxSYS_COLOUR_SCROLLBAR 0
+#define wxSYS_COLOUR_BACKGROUND 1
+#define wxSYS_COLOUR_ACTIVECAPTION 2
+#define wxSYS_COLOUR_INACTIVECAPTION 3
+#define wxSYS_COLOUR_MENU 4
+#define wxSYS_COLOUR_WINDOW 5
+#define wxSYS_COLOUR_WINDOWFRAME 6
+#define wxSYS_COLOUR_MENUTEXT 7
+#define wxSYS_COLOUR_WINDOWTEXT 8
+#define wxSYS_COLOUR_CAPTIONTEXT 9
+#define wxSYS_COLOUR_ACTIVEBORDER 10
+#define wxSYS_COLOUR_INACTIVEBORDER 11
+#define wxSYS_COLOUR_APPWORKSPACE 12
+#define wxSYS_COLOUR_HIGHLIGHT 13
+#define wxSYS_COLOUR_HIGHLIGHTTEXT 14
+#define wxSYS_COLOUR_BTNFACE 15
+#define wxSYS_COLOUR_BTNSHADOW 16
+#define wxSYS_COLOUR_GRAYTEXT 17
+#define wxSYS_COLOUR_BTNTEXT 18
+#define wxSYS_COLOUR_INACTIVECAPTIONTEXT 19
+#define wxSYS_COLOUR_BTNHIGHLIGHT 20
+
+#define wxSYS_COLOUR_3DDKSHADOW 21
+#define wxSYS_COLOUR_3DLIGHT 22
+#define wxSYS_COLOUR_INFOTEXT 23
+#define wxSYS_COLOUR_INFOBK 24
+
+#define wxSYS_COLOUR_DESKTOP wxSYS_COLOUR_BACKGROUND
+#define wxSYS_COLOUR_3DFACE wxSYS_COLOUR_BTNFACE
+#define wxSYS_COLOUR_3DSHADOW wxSYS_COLOUR_BTNSHADOW
+#define wxSYS_COLOUR_3DHIGHLIGHT wxSYS_COLOUR_BTNHIGHLIGHT
+#define wxSYS_COLOUR_3DHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
+#define wxSYS_COLOUR_BTNHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
+
+// Metrics
+#define wxSYS_MOUSE_BUTTONS 1
+#define wxSYS_BORDER_X 2
+#define wxSYS_BORDER_Y 3
+#define wxSYS_CURSOR_X 4
+#define wxSYS_CURSOR_Y 5
+#define wxSYS_DCLICK_X 6
+#define wxSYS_DCLICK_Y 7
+#define wxSYS_DRAG_X 8
+#define wxSYS_DRAG_Y 9
+#define wxSYS_EDGE_X 10
+#define wxSYS_EDGE_Y 11
+#define wxSYS_HSCROLL_ARROW_X 12
+#define wxSYS_HSCROLL_ARROW_Y 13
+#define wxSYS_HTHUMB_X 14
+#define wxSYS_ICON_X 15
+#define wxSYS_ICON_Y 16
+#define wxSYS_ICONSPACING_X 17
+#define wxSYS_ICONSPACING_Y 18
+#define wxSYS_WINDOWMIN_X 19
+#define wxSYS_WINDOWMIN_Y 20
+#define wxSYS_SCREEN_X 21
+#define wxSYS_SCREEN_Y 22
+#define wxSYS_FRAMESIZE_X 23
+#define wxSYS_FRAMESIZE_Y 24
+#define wxSYS_SMALLICON_X 25
+#define wxSYS_SMALLICON_Y 26
+#define wxSYS_HSCROLL_Y 27
+#define wxSYS_VSCROLL_X 28
+#define wxSYS_VSCROLL_ARROW_X 29
+#define wxSYS_VSCROLL_ARROW_Y 30
+#define wxSYS_VTHUMB_Y 31
+#define wxSYS_CAPTION_Y 32
+#define wxSYS_MENU_Y 33
+#define wxSYS_NETWORK_PRESENT 34
+#define wxSYS_PENWINDOWS_PRESENT 35
+#define wxSYS_SHOW_SOUNDS 36
+#define wxSYS_SWAP_BUTTONS 37
class WXDLLEXPORT wxSystemSettings: public wxObject
{
#ifndef _WX_SETUP_H_
#define _WX_SETUP_H_
-// ----------------------------------------------------------------------------
-// global settings
-// ----------------------------------------------------------------------------
-
-// define this to 0 when building wxBase library
-#define wxUSE_GUI 1
+/*
+ * General features
+ *
+ */
-// ----------------------------------------------------------------------------
-// compatibility settings
-// ----------------------------------------------------------------------------
-
-// This setting determines the compatibility with 1.68 API:
-// Level 0: no backward compatibility, all new features
-// Level 1: some extra methods are defined for compatibility.
-//
-// Default is 0.
-//
-// Recommended setting: 0 (in fact the compatibility code is now very minimal
-// so there is little advantage to setting it to 1.
-#define WXWIN_COMPATIBILITY 0
-
+#define wxUSE_GEOMETRY 1
#define WORDS_BIGENDIAN 1
-// ----------------------------------------------------------------------------
-// non GUI features selection
-// ----------------------------------------------------------------------------
-
-// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
-// integer which is implemented in terms of native 64 bit integers if any or
-// uses emulation otherwise.
-//
-// This class is required by wxDateTime and so you should enable it if you want
-// to use wxDateTime. For most modern platforms, it will use the native 64 bit
-// integers in which case (almost) all of its functions are inline and it
-// almost does not take any space, so there should be no reason to switch it
-// off.
-//
-// Recommended setting: 1
-#define wxUSE_LONGLONG 1
-
-
-// Set wxUSE_TIMEDATE to 1 to compile the wxDateTime and related classes which
-// allow to manipulate dates, times and time intervals. wxDateTime replaces the
-// old wxTime and wxDate classes which are still provided for backwards
-// compatibility (and implemented in terms of wxDateTime).
-//
-// Note that this class is relatively new and is still officially in alpha
-// stage because some features are not yet (fully) implemented. It is already
-// quite useful though and should only be disabled if you are aiming at
-// absolutely minimal version of the library.
-//
-// Requires: wxUSE_LONGLONG
-//
-// Recommended setting: 1
-#define wxUSE_TIMEDATE 1
-
-// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes
-// which allow the application to store its settings in the persistent
-// storage. Setting this to 1 will also enable on-demand creation of the
-// global config object in wxApp.
-//
-// See also wxUSE_CONFIG_NATIVE below.
-//
-// Recommended setting: 1
#define wxUSE_CONFIG 1
+ // Use wxConfig, with CreateConfig in wxApp
-// ----------------------------------------------------------------------------
-// Optional controls
-// ----------------------------------------------------------------------------
-
-// wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar
-// classes at all. Otherwise, use the native toolbar class unless
-// wxUSE_TOOLBAR_NATIVE is 0. Additionally, the generic toolbar class which
-// supports some features which might not be supported by the native wxToolBar
-// class may be compiled in if wxUSE_TOOLBAR_SIMPLE is 1.
-//
-// Default is 1 for all settings.
-//
-// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE and 0 for
-// wxUSE_TOOLBAR_SIMPLE (the default is 1 mainly for backwards compatibility).
-#define wxUSE_TOOLBAR 1
-#define wxUSE_TOOLBAR_NATIVE 1
-#define wxUSE_TOOLBAR_SIMPLE 0
-
-// wxNotebook is a control with several "tabs" located on one of its sides. It
-// may be used ot logically organise the data presented to the user instead of
-// putting everything in one huge dialog. It replaces wxTabControl and related
-// classes of wxWin 1.6x.
-//
-// Default is 1.
-//
-// Recommended setting: 1
-#define wxUSE_NOTEBOOK 1
-
-
-// The corresponding controls will be compiled in if wxUSE_<CONTROL> is set to
-// 1 and not compiled into the library otherwise.
-//
-// Default is 1 for everything.
-//
-// Recommended setting: 1 (library might fail to compile for some combinations
-// of disabled controls)
-#define wxUSE_COMBOBOX 1
-#define wxUSE_CHOICE 1
-#define wxUSE_RADIOBTN 1
-#define wxUSE_RADIOBOX 1
-#define wxUSE_SCROLLBAR 1
-#define wxUSE_CHECKBOX 1
-#define wxUSE_LISTBOX 1
-#define wxUSE_SPINBTN 1
-#define wxUSE_SPINCTRL 1
-#define wxUSE_STATLINE 1
-#define wxUSE_CHECKLISTBOX 1
-#define wxUSE_CHOICE 1
-#define wxUSE_CARET 1
-#define wxUSE_SLIDER 1
-
-// ----------------------------------------------------------------------------
-// Postscript support settings
-// ----------------------------------------------------------------------------
-
-
+#define WXWIN_COMPATIBILITY 0
+ // Compatibility with 1.66 API.
+ // Level 0: no backward compatibility, all new features
+ // Level 1: wxDC, OnSize (etc.) compatibility, but
+ // some new features such as event tables
#define wxUSE_POSTSCRIPT 0
// 0 for no PostScript device context
#define wxUSE_AFM_FOR_POSTSCRIPT 0
// 0 for no Metafile and metafile device context
#define wxUSE_IPC 0
// 0 for no interprocess comms
-#define wxUSE_HELP 0
+#define wxUSE_HELP 1
// 0 for no help facility
#define wxUSE_RESOURCES 1
// 0 for no wxGetResource/wxWriteResource
// 0 for no drag and drop
#define wxUSE_TOOLBAR 1
+#define wxUSE_TOOLBAR_NATIVE 1
// Define 1 to use toolbar classes
#define wxUSE_BUTTONBAR 1
// Define 1 to use buttonbar classes (enhanced toolbar
// wxObject::delete *IF* __WXDEBUG__ is also defined.
// WARNING: this code may not work with all architectures, especially
// if alignment is an issue.
+#ifndef __MWERKS__
+#define wxUSE_DEBUG_CONTEXT 0
+#else
#define wxUSE_DEBUG_CONTEXT 1
+#endif
// If 1, enables wxDebugContext, for
// writing error messages to file, etc.
// If __WXDEBUG__ is not defined, will still use
// Set this to 0 if your compiler can't cope
// with omission of prototype parameters.
-#define wxUSE_ODBC 1
- // Define 1 to use ODBC classes
-
+#define wxUSE_ODBC 1
+ // Define 1 to use ODBC classes
-#define wxODBC_FWD_ONLY_CURSORS 1
- // For backward compatibility reasons, this parameter now only
- // controls the default scrolling method used by cursors. This
- // default behavior can be overriden by setting the second param
- // of wxDB::GetDbConnection() to indicate whether the connection
- // (and any wxTable()s that use the connection) should support
- // forward only scrolling of cursors, or both forward and backward
- // Support for backward scrolling cursors is dependent on the
- // data source as well as the ODBC driver being used.
-#define wxODBC_BACKWARD_COMPATABILITY 0
- // Default is 0. Set to 1 to use the deprecated classes, enum
- // types, function, member variables. With a setting of 1, full
- // backward compatability with the 2.0.x release is possible.
- // It is STRONGLY recommended that this be set to 0, as
- // future development will be done only on the non-deprecated
- // functions/classes/member variables/etc.
+#define wxODBC_FWD_ONLY_CURSORS 1
+ // Some databases/ODBC drivers only allow forward scrolling cursors.
+ // Unless you specifically want to use backward scrolling
+ // cursors, and you know that all of the databases/ODBC drivers
+ // that you will use these odbc classes with allow backward
+ // scrolling cursors, this setting should remain set to 1
+ // for maximum database/driver compatibilty
#define wxUSE_STREAMS 1
// If enabled (1), compiles wxWindows streams classes
+#ifndef __MWERKS__
+#define wxUSE_STD_IOSTREAM 0
+#else
#define wxUSE_STD_IOSTREAM 1
// Use standard C++ streams if 1. If 0, use wxWin
// streams implementation.
+#endif
#define wxUSE_WXCONFIG 1
// if enabled, compiles built-in OS independent wxConfig
// Use zlib for compression in streams and PNG code
#define wxUSE_LIBPNG 1
// Use PNG bitmap code
-#define wxUSE_LIBJPEG 0
+#define wxUSE_LIBJPEG 1
// Use JPEG bitmap code
+#define wxUSE_LIBTIFF 1
+ // Use TIFF bitmap code
+#define wxUSE_GIF 1
+ // Use GIF bitmap code
+
#define wxUSE_SERIAL 0
// Use serialization (requires utils/serialize)
#define wxUSE_DYNLIB_CLASS 0
#define wxUSE_TOOLTIPS 1
// Define to use wxToolTip class and
// wxWindow::SetToolTip() method
-#define wxUSE_SOCKETS 0 // 0
+#define wxUSE_SOCKETS 1 // 0
// Set to 1 to use socket classes
#define wxUSE_HTML 1 // 0
// Set to 1 to use wxHTML sub-library
+#define wxUSE_FILESYSTEM 1
+
#define wxUSE_FS_ZIP 1 // 0
#define wxUSE_FS_INET 1 // 0 // Set to 1 to enable virtual file systems
// text entry dialog and wxGetTextFromUser function
#define wxUSE_TEXTDLG 1
-// wxToolBar class
-#define wxUSE_TOOLBAR 1
-
// wxStatusBar class
#define wxUSE_STATUSBAR 1
const wxString& name = wxStaticTextNameStr);
// accessors
- void SetLabel(const wxString& , bool resize );
- void SetLabel( const wxString &str ) { SetLabel( str , true ) ; }
+ void SetLabel( const wxString &str ) ;
// operations
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
// events
void OnPaint( wxPaintEvent &event ) ;
+ void OnDraw( wxDC &dc ) ;
wxSize DoGetBestSize() const ;
+ virtual bool AcceptsFocus() const { return FALSE; }
private :
wxString m_label ;
#include "wx/generic/statusbr.h"
-class WXDLLEXPORT wxStatusBarMac : public wxStatusBar
+class WXDLLEXPORT wxStatusBarMac : public wxStatusBarGeneric
{
- DECLARE_DYNAMIC_CLASS(wxStatusBarXX);
+ DECLARE_DYNAMIC_CLASS(wxStatusBarMac);
-public:
- // ctors
- wxStatusBarXX();
- wxStatusBarXX(wxWindow *parent, wxWindowID id = -1, long style = wxST_SIZEGRIP);
+ wxStatusBarMac(void);
+ inline wxStatusBarMac(wxWindow *parent, wxWindowID id,
+ long style = 0,
+ const wxString& name = wxPanelNameStr)
+ {
+ Create(parent, id, style, name);
+ }
- // create status line
- bool Create(wxWindow *parent, wxWindowID id = -1, long style = wxST_SIZEGRIP);
+ ~wxStatusBarMac();
- // a status line can have several (<256) fields numbered from 0
- virtual void SetFieldsCount(int number = 1, const int widths[] = NULL);
+ bool Create(wxWindow *parent, wxWindowID id,
+ long style,
+ const wxString& name = wxPanelNameStr) ;
- // each field of status line has its own text
- virtual void SetStatusText(const wxString& text, int number = 0);
- virtual wxString GetStatusText(int number = 0) const;
+ virtual void DrawFieldText(wxDC& dc, int i);
+ virtual void DrawField(wxDC& dc, int i);
- // set status line fields' widths
- virtual void SetStatusWidths(int n, const int widths_field[]);
+ ////////////////////////////////////////////////////////////////////////
+ // Implementation
- void OnSize(wxSizeEvent& event);
+ void OnPaint(wxPaintEvent& event);
+protected:
DECLARE_EVENT_TABLE()
-
-protected:
- void CopyFieldsWidth(const int widths[]);
- void SetFieldsWidth();
};
#endif
#include "wx/control.h"
-#if wxUSE_IOSTREAMH
-#include <iostream.h>
-#else
-#include <iostream>
-#endif
-
WXDLLEXPORT_DATA(extern const char*) wxTextCtrlNameStr;
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
// Single-line text item
-class WXDLLEXPORT wxTextCtrl: public wxControl
-
-// TODO Some platforms/compilers don't like inheritance from streambuf.
-
-#if (defined(__BORLANDC__) && !defined(__WIN32__)) || defined(__MWERKS__)
-#define NO_TEXT_WINDOW_STREAM
-#endif
-
-#ifndef NO_TEXT_WINDOW_STREAM
-, public streambuf
-#endif
-
+class WXDLLEXPORT wxTextCtrl: public wxTextCtrlBase
{
DECLARE_DYNAMIC_CLASS(wxTextCtrl)
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTextCtrlNameStr)
-#ifndef NO_TEXT_WINDOW_STREAM
- :streambuf()
-#endif
{
Create(parent, id, value, pos, size, style, validator, name);
}
virtual wxString GetLineText(long lineNo) const;
virtual int GetNumberOfLines() const;
+ virtual bool IsModified() const;
+ virtual bool IsEditable() const;
+
+ // If the return values from and to are the same, there is no selection.
+ virtual void GetSelection(long* from, long* to) const;
+
// operations
// ----------
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
-
+
+ // editing
+
+ virtual void Clear();
+ virtual void Replace(long from, long to, const wxString& value);
+ virtual void Remove(long from, long to);
+
+ // load the controls contents from the file
+ virtual bool LoadFile(const wxString& file);
+
+ // clears the dirty flag
+ virtual void DiscardEdits();
+
+ // writing text inserts it at the current position, appending always
+ // inserts it at the end
+ virtual void WriteText(const wxString& text);
+ virtual void AppendText(const wxString& text);
+
+ // translate between the position (which is just an index in the text ctrl
+ // considering all its contents as a single strings) and (x, y) coordinates
+ // which represent column and line.
+ virtual long XYToPosition(long x, long y) const;
+ virtual bool PositionToXY(long pos, long *x, long *y) const;
+
+ virtual void ShowPosition(long pos);
+
// Clipboard operations
virtual void Copy();
virtual void Cut();
virtual void Paste();
+ virtual bool CanCopy() const;
+ virtual bool CanCut() const;
+ virtual bool CanPaste() const;
+
+ // Undo/redo
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual bool CanUndo() const;
+ virtual bool CanRedo() const;
+
+ // Insertion point
virtual void SetInsertionPoint(long pos);
virtual void SetInsertionPointEnd();
- virtual long GetInsertionPoint() const ;
- virtual long GetLastPosition() const ;
- virtual void Replace(long from, long to, const wxString& value);
- virtual void Remove(long from, long to);
+ virtual long GetInsertionPoint() const;
+ virtual long GetLastPosition() const;
+
virtual void SetSelection(long from, long to);
virtual void SetEditable(bool editable);
-
- // streambuf implementation
-#ifndef NO_TEXT_WINDOW_STREAM
- int overflow(int i);
- int sync();
- int underflow();
-#endif
-
- wxTextCtrl& operator<<(const wxString& s);
- wxTextCtrl& operator<<(int i);
- wxTextCtrl& operator<<(long i);
- wxTextCtrl& operator<<(float f);
- wxTextCtrl& operator<<(double d);
- wxTextCtrl& operator<<(const char c);
-
- virtual bool LoadFile(const wxString& file);
- virtual bool SaveFile(const wxString& file);
- virtual void WriteText(const wxString& text);
- virtual void AppendText(const wxString& text);
- virtual void DiscardEdits();
- virtual bool IsModified() const;
-
- virtual long XYToPosition(long x, long y) const ;
- virtual void PositionToXY(long pos, long *x, long *y) const ;
- virtual void ShowPosition(long pos);
- virtual void Clear();
- virtual bool MacCanFocus() const { return true ; }
-
- // callbacks
- // ---------
- void OnDropFiles(wxDropFilesEvent& event);
- void OnChar(wxKeyEvent& event); // Process 'enter' if required
-// void OnEraseBackground(wxEraseEvent& event);
-
- // Implementation
- // --------------
- virtual void Command(wxCommandEvent& event);
+ // Implementation from now on
+ // --------------------------
+
+ // Implementation
+ // --------------
+ virtual void Command(wxCommandEvent& event);
+
+ virtual bool AcceptsFocus() const;
+
+ // callbacks
+ void OnDropFiles(wxDropFilesEvent& event);
+ void OnChar(wxKeyEvent& event); // Process 'enter' if required
+
+ void OnCut(wxCommandEvent& event);
+ void OnCopy(wxCommandEvent& event);
+ void OnPaste(wxCommandEvent& event);
+ void OnUndo(wxCommandEvent& event);
+ void OnRedo(wxCommandEvent& event);
+
+ void OnUpdateCut(wxUpdateUIEvent& event);
+ void OnUpdateCopy(wxUpdateUIEvent& event);
+ void OnUpdatePaste(wxUpdateUIEvent& event);
+ void OnUpdateUndo(wxUpdateUIEvent& event);
+ void OnUpdateRedo(wxUpdateUIEvent& event);
+
+ virtual bool MacCanFocus() const { return true ; }
+
protected:
- wxString m_fileName;
+ virtual wxSize DoGetBestSize() const;
DECLARE_EVENT_TABLE()
};
#endif
#include "wx/object.h"
+#include "wx/mac/macnotfy.h"
-class WXDLLEXPORT wxTimer: public wxObject
+class wxTimer ;
+
+typedef struct MacTimerInfo
+{
+ TMTask m_task;
+ wxMacNotifierTableRef m_table ;
+ wxTimer* m_timer ;
+} ;
+
+class WXDLLEXPORT wxTimer: public wxTimerBase
{
public:
wxTimer();
bool one_shot = FALSE); // Start timer
virtual void Stop(); // Stop timer
- virtual void Notify() = 0; // Override this member
-
- // Returns the current interval time (0 if stop)
- int Interval() const { return m_milli; };
- bool OneShot() const { return m_oneShot; }
-
-protected:
- bool m_oneShot ;
- int m_milli ;
- int m_lastMilli ;
-
- long m_id;
+ virtual bool IsRunning() const ;
+ MacTimerInfo m_info;
private:
DECLARE_ABSTRACT_CLASS(wxTimer)
};
// Add all the buttons
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
+ virtual wxString MacGetToolTipString( wxPoint &where ) ;
+ void OnPaint(wxPaintEvent& event) ;
+ void OnMouse(wxMouseEvent& event) ;
protected:
// common part of all ctors
void Init();
///////////////////////////////////////////////////////////////////////////////
// Name: mac/tooltip.h
// Purpose: wxToolTip class - tooltip control
-// Author: Vadim Zeitlin
+// Author: Stefan Csomor
// Modified by:
// Created: 31.01.99
// RCS-ID: $Id$
-// Copyright: (c) 1999 Robert Roebling, Vadim Zeitlin
+// Copyright: (c) 1999 Robert Roebling, Vadim Zeitlin, Stefan Csomor
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
-//TO ADAPT...
-
class wxToolTip : public wxObject
{
public:
static void Enable(bool flag);
// set the delay after which the tooltip appears
static void SetDelay(long milliseconds);
+ static void NotifyWindowDelete( WindowRef win ) ;
- // implementation
- //void RelayEvent(WXMSG *msg);
-
-private:
- // create the tooltip ctrl for our parent frame if it doesn't exist yet
- // and return its window handle
- WXHWND GetToolTipCtrl();
+ // implementation only from now on
+ // -------------------------------
- // remove this tooltip from the tooltip control
- void Remove();
+ // should be called in response to mouse events
+ static void RelayEvent(wxWindow *win , wxMouseEvent &event);
+ static void RemoveToolTips();
+private:
wxString m_text; // tooltip text
wxWindow *m_window; // window we're associated with
};
#define UMA_USE_8_6 0
-// define this to be 1 if you have the carbon libs (weak linked or PreCarbon.lib)
-
-#define UMA_USE_CARBON 0
-
+#if __POWERPC__
#define UMA_USE_APPEARANCE 1
#define UMA_USE_WINDOWMGR 1
+#else
+#define UMA_USE_APPEARANCE 0
+#define UMA_USE_WINDOWMGR 0
+#endif
#if !UMA_USE_8_6 && UMA_USE_WINDOWMGR
#undef UMA_USE_WINDOWMGR
#endif
#if !TARGET_CARBON
- typedef short MenuItemIndex ;
+// this is now defined in the latest headers
+// typedef short MenuItemIndex ;
#endif
void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
// menu manager
-void UMASetMenuTitle( MenuRef menu , ConstStr255Param title ) ;
-UInt32 UMAMenuEvent( EventRecord *inEvent ) ;
+void UMASetMenuTitle( MenuRef menu , StringPtr title ) ;
+UInt32 UMAMenuEvent( EventRecord *inEvent ) ;
void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex item ) ;
+void UMAAppendSubMenuItem( MenuRef menu , StringPtr label , SInt16 submenuid ) ;
+void UMAInsertSubMenuItem( MenuRef menu , StringPtr label , MenuItemIndex item , SInt16 submenuid ) ;
+void UMAAppendMenuItem( MenuRef menu , StringPtr label , SInt16 key= 0, UInt8 modifiers = 0 ) ;
+void UMAInsertMenuItem( MenuRef menu , StringPtr label , MenuItemIndex item , SInt16 key = 0 , UInt8 modifiers = 0 ) ;
+void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label ) ;
+
+MenuRef UMANewMenu( SInt16 menuid , StringPtr label ) ;
+void UMADisposeMenu( MenuRef menu ) ;
+
+// handling the menubar
+
+void UMADeleteMenu( SInt16 menuId ) ;
+void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) ;
+void UMADrawMenuBar() ;
+
// quickdraw
void UMAShowWatchCursor() ;
void UMAShowArrowCursor() ;
+void UMAPrOpen() ;
+void UMAPrClose() ;
+
// window manager
GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) ;
void UMAActivateControl( ControlHandle inControl ) ;
void UMADeactivateControl( ControlHandle inControl ) ;
+void UMAApplyThemeBackground (ThemeBackgroundKind inKind,
+ const Rect * bounds,
+ ThemeDrawState inState,
+ SInt16 inDepth,
+ Boolean inColorDev);
void UMASetThemeWindowBackground (WindowRef inWindow,
ThemeBrush inBrush,
Boolean inUpdate) ;
void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
+#if !TARGET_CARBON
+#define GetPortTextFont( p) ((p)->txFont )
+#define GetPortTextSize( p) ((p)->txSize )
+#define GetPortTextFace( p) ((p)->txFace )
+#define GetPortTextMode( p) ((p)->txMode )
+#define GetRegionBounds( r , b) ((*b) = (**r).rgnBBox)
+#define GetPortBounds( p , b) ((*b) = p->portRect )
+#define GetWindowPortBounds( p , b) ((*b) = p->portRect )
+#define GetPortVisibleRegion( p, r ) CopyRgn( p->visRgn , r )
+#define GetQDGlobalsWhite( a ) (&((*a) = qd.white))
+#define GetQDGlobalsBlack( a ) (&((*a) = qd.black))
+#define GetQDGlobalsScreenBits( a ) (*a) = qd.screenBits
+#define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow))
+#define GetControlBounds( c , b ) ((*b) = (**c).contrlRect )
+#define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap ))
+#endif
+
+// Appearance Drawing
+
+OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
#endif
\ No newline at end of file
virtual void SetFocus();
-
virtual void WarpPointer(int x, int y);
virtual void CaptureMouse();
virtual void ReleaseMouse();
void MacClientToRootWindow( int *x , int *y ) const ;
void MacRootWindowToClient( int *x , int *y ) const ;
-
+
+ virtual wxString MacGetToolTipString( wxPoint &where ) ;
// simple accessors
// ----------------
// Responds to colour changes: passes event on to children.
void OnSysColourChanged(wxSysColourChangedEvent& event);
-
public :
+ virtual void MacCreateRealWindow( const wxString& title,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style,
+ const wxString& name ) ;
static bool MacGetWindowFromPoint( const wxPoint &point , wxWindow** outWin ) ;
virtual void MacActivate( EventRecord *ev , bool inIsActivating ) ;
virtual void MacUpdate( EventRecord *ev ) ;
virtual void MacFireMouseEvent( EventRecord *ev ) ;
virtual bool MacDispatchMouseEvent(wxMouseEvent& event ) ;
virtual void MacEraseBackground( Rect *rect ) ;
+ virtual void MacPaintBorders() ;
+ // obsolete : only for link compatibility
virtual void MacPaint( wxPaintEvent &event ) ;
- WindowRef GetMacRootWindow() const ;
+ WindowRef GetMacRootWindow() const ;
- virtual ControlHandle MacGetContainerForEmbedding() ;
+ virtual ControlHandle MacGetContainerForEmbedding() ;
+ virtual long MacGetBorderSize() const ;
+ static long MacRemoveBordersFromStyle( long style ) ;
virtual void MacSuperChangedPosition() ;
virtual void MacSuperShown( bool show ) ;
-
+/*
bool MacSetupFocusPort() ;
bool MacSetupDrawingPort() ;
bool MacSetupFocusClientPort() ;
bool MacSetupDrawingClientPort() ;
-
+*/
virtual bool MacSetPortFocusParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindow* rootwin ) ;
virtual bool MacSetPortDrawingParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindow* rootwin ) ;
virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindow** rootwin ) ;
virtual void MacGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindow** rootwin) ;
+ virtual void MacDoGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindow** rootwin) ;
MacWindowData* MacGetWindowData() { return m_macWindowData ; }
static WindowRef MacGetWindowInUpdate() { return s_macWindowInUpdate ; }
bool MacIsWindowScrollbar( const wxScrollBar* sb ) { return (m_hScrollBar == sb || m_vScrollBar == sb) ; }
MacWindowData* m_macWindowData ;
static WindowRef s_macWindowInUpdate ;
+ RgnHandle m_macUpdateRgn ;
int m_x ;
int m_y ;
void wxAssociateWinWithMacWindow(WindowRef inWindow, wxWindow *win) ;
void wxRemoveMacWindowAssociation(wxWindow *win) ;
+/*
class wxMacFocusHelper
{
public :
GrafPtr m_currentPort ;
bool m_ok ;
} ;
+*/
class wxMacDrawingHelper
{
PenState m_savedPenState ;
bool m_ok ;
} ;
-
+/*
class wxMacFocusClientHelper
{
public :
GrafPtr m_currentPort ;
bool m_ok ;
} ;
-
+*/
class wxMacDrawingClientHelper
{
public :