Merge branch 'master' into web-request

Merge with the latest master in preparation for merging into master.

Rebake to resolve conflicts in generated files.
This commit is contained in:
Vadim Zeitlin
2020-12-12 17:44:45 +01:00
3934 changed files with 147571 additions and 96246 deletions

View File

@@ -77,12 +77,12 @@ public:
{ m_macCurrentEvent = event ; m_macCurrentEventHandlerCallRef = handler ; }
// adding a CFType object to be released only at the end of the current event cycle (increases the
// refcount of the object passed), needed in case we are in the middle of an event concering an object
// refcount of the object passed), needed in case we are in the middle of an event concerning an object
// we want to delete and cannot do it immediately
// TODO change semantics to be in line with cocoa (make autrelease NOT increase the count)
void MacAddToAutorelease( void* cfrefobj );
void MacReleaseAutoreleasePool();
public:
static wxWindow* s_captureWindow ;
static long s_lastModifiers ;
@@ -95,7 +95,7 @@ protected:
// override for support of custom app controllers
virtual WX_NSObject OSXCreateAppController();
#endif
private:
virtual bool DoInitGui();
virtual void DoCleanUp();
@@ -139,6 +139,9 @@ public:
// override this to return false from a non-bundled console app in order to stay in background ...
virtual bool OSXIsGUIApplication() { return true; }
// Allow the user to disable the tab bar support in the application
void OSXEnableAutomaticTabbing(bool enable);
#if wxOSX_USE_COCOA_OR_IPHONE
// immediately before the native event loop launches
virtual void OSXOnWillFinishLaunching();
@@ -155,14 +158,14 @@ private:
wxArrayString m_openFiles;
wxArrayString m_printFiles;
wxString m_getURL;
public:
bool OSXInitWasCalled() { return m_inited; }
void OSXStoreOpenFiles(const wxArrayString &files ) { m_openFiles = files ; }
void OSXStorePrintFiles(const wxArrayString &files ) { m_printFiles = files ; }
void OSXStoreOpenURL(const wxString &url ) { m_getURL = url ; }
#endif
// Hide the application windows the same as the system hide command would do it.
void MacHideApp();

View File

@@ -66,7 +66,7 @@ public:
WXHBITMAP GetHBITMAP() const ;
// implementation helper only : construct a mask from a 32 bit memory buffer
// implementation helper only : construct a mask from a 8 bpp memory buffer
bool OSXCreate(const wxMemoryBuffer& buf, int width , int height , int bytesPerRow ) ;
protected:
@@ -107,7 +107,7 @@ public:
// Constructor for generalised creation from data
wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
// creates an bitmap from the native image format
wxBitmap(CGImageRef image, double scale = 1.0);
wxBitmap(WXImage image);
@@ -115,7 +115,7 @@ public:
// Create a bitmap compatible with the given DC
wxBitmap(int width, int height, const wxDC& dc);
// If depth is omitted, will create a bitmap compatible with the display
wxBitmap(int width, int height, int depth = -1) { (void)Create(width, height, depth); }
wxBitmap(const wxSize& sz, int depth = -1) { (void)Create(sz, depth); }
@@ -128,29 +128,29 @@ public:
virtual ~wxBitmap() {}
wxImage ConvertToImage() const;
wxImage ConvertToImage() const wxOVERRIDE;
// get the given part of bitmap
wxBitmap GetSubBitmap( const wxRect& rect ) const;
wxBitmap GetSubBitmap( const wxRect& rect ) const wxOVERRIDE;
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH)
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) wxOVERRIDE;
virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) wxOVERRIDE
{ return Create(sz.GetWidth(), sz.GetHeight(), depth); }
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
bool Create( CGImageRef image, double scale = 1.0 );
bool Create( WXImage image );
bool Create( CGContextRef bitmapcontext);
// Create a bitmap compatible with the given DC, inheriting its magnification factor
bool Create(int width, int height, const wxDC& dc);
// Create a bitmap with a scale factor, width and height are multiplied with that factor
bool CreateScaled(int logwidth, int logheight, int depth, double logicalScale);
bool CreateScaled(int logwidth, int logheight, int depth, double logicalScale) wxOVERRIDE;
// virtual bool Create( WXHICON icon) ;
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE) wxOVERRIDE;
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const wxOVERRIDE;
const wxBitmapRefData *GetBitmapData() const
{ return (const wxBitmapRefData *)m_refData; }
@@ -159,28 +159,28 @@ public:
{ return (wxBitmapRefData *)m_refData; }
// copies the contents and mask of the given (colour) icon to the bitmap
virtual bool CopyFromIcon(const wxIcon& icon);
virtual bool CopyFromIcon(const wxIcon& icon) wxOVERRIDE;
int GetWidth() const;
int GetHeight() const;
int GetDepth() const;
int GetWidth() const wxOVERRIDE;
int GetHeight() const wxOVERRIDE;
int GetDepth() const wxOVERRIDE;
#if WXWIN_COMPATIBILITY_3_0
wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies")
void SetWidth(int width);
void SetWidth(int width) wxOVERRIDE;
wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies")
void SetHeight(int height);
void SetHeight(int height) wxOVERRIDE;
wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies")
void SetDepth(int depth);
void SetDepth(int depth) wxOVERRIDE;
#endif
#if wxUSE_PALETTE
wxPalette* GetPalette() const;
void SetPalette(const wxPalette& palette);
wxPalette* GetPalette() const wxOVERRIDE;
void SetPalette(const wxPalette& palette) wxOVERRIDE;
#endif // wxUSE_PALETTE
wxMask *GetMask() const;
void SetMask(wxMask *mask) ;
wxMask *GetMask() const wxOVERRIDE;
void SetMask(wxMask *mask) wxOVERRIDE;
static void InitStandardHandlers();
@@ -233,14 +233,14 @@ public:
void EndRawAccess();
#endif
double GetScaleFactor() const;
double GetScaleFactor() const wxOVERRIDE;
void SetSelectedInto(wxDC *dc);
wxDC *GetSelectedInto() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
};
#endif // _WX_BITMAP_H_

View File

@@ -26,7 +26,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
const wxString& name = wxASCII_STR(wxButtonNameStr))
{
Create(parent, id, bitmap, pos, size, style, validator, name);
}
@@ -35,11 +35,14 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
const wxString& name = wxASCII_STR(wxButtonNameStr));
bool CreateCloseButton(wxWindow* parent,
wxWindowID winid,
const wxString& name = wxString());
protected:
virtual wxSize DoGetBestSize() const;
virtual wxSize DoGetBestSize() const wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxBitmapButton);
};

View File

@@ -26,17 +26,17 @@ public:
wxBrush(const wxBitmap& stipple);
virtual ~wxBrush();
virtual void SetColour(const wxColour& col) ;
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
virtual void SetStyle(wxBrushStyle style) ;
virtual void SetStipple(const wxBitmap& stipple) ;
virtual void SetColour(const wxColour& col) wxOVERRIDE;
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) wxOVERRIDE;
virtual void SetStyle(wxBrushStyle style) wxOVERRIDE;
virtual void SetStipple(const wxBitmap& stipple) wxOVERRIDE;
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
wxColour GetColour() const;
wxBrushStyle GetStyle() const ;
wxBitmap *GetStipple() const ;
wxColour GetColour() const wxOVERRIDE;
wxBrushStyle GetStyle() const wxOVERRIDE;
wxBitmap *GetStipple() const wxOVERRIDE;
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants")
@@ -46,8 +46,8 @@ public:
void SetStyle(int style) { SetStyle((wxBrushStyle)style); }
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxBrush);

View File

@@ -26,7 +26,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
const wxString& name = wxASCII_STR(wxButtonNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
@@ -38,15 +38,15 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
const wxString& name = wxASCII_STR(wxButtonNameStr));
virtual void SetLabel(const wxString& label);
virtual wxWindow *SetDefault();
virtual void Command(wxCommandEvent& event);
virtual void SetLabel(const wxString& label) wxOVERRIDE;
virtual wxWindow *SetDefault() wxOVERRIDE;
virtual void Command(wxCommandEvent& event) wxOVERRIDE;
// osx specific event handling common for all osx-ports
virtual bool OSXHandleClicked( double timestampsec );
virtual bool OSXHandleClicked(double timestampsec) wxOVERRIDE;
#if wxOSX_USE_COCOA
void OSXUpdateAfterLabelChange(const wxString& label);

View File

@@ -1,57 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/osx/carbon/private/overlay.h
// Purpose: wxOverlayImpl declaration
// Author: Stefan Csomor
// Modified by:
// Created: 2006-10-20
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MAC_CARBON_PRIVATE_OVERLAY_H_
#define _WX_MAC_CARBON_PRIVATE_OVERLAY_H_
#include "wx/osx/private.h"
#include "wx/toplevel.h"
#include "wx/graphics.h"
class wxOverlayImpl
{
public:
wxOverlayImpl() ;
~wxOverlayImpl() ;
// clears the overlay without restoring the former state
// to be done eg when the window content has been changed and repainted
void Reset();
// returns true if it has been setup
bool IsOk();
void Init( wxDC* dc, int x , int y , int width , int height );
void BeginDrawing( wxDC* dc);
void EndDrawing( wxDC* dc);
void Clear( wxDC* dc);
private:
OSStatus CreateOverlayWindow();
void MacGetBounds( Rect *bounds );
WindowRef m_overlayWindow;
WindowRef m_overlayParentWindow;
CGContextRef m_overlayContext ;
// we store the window in case we would have to issue a Refresh()
wxWindow* m_window ;
int m_x ;
int m_y ;
int m_width ;
int m_height ;
} ;
#endif // _WX_MAC_CARBON_PRIVATE_OVERLAY_H_

View File

@@ -23,13 +23,13 @@ public:
wxOSXPrintData();
virtual ~wxOSXPrintData();
virtual bool TransferTo( wxPrintData &data );
virtual bool TransferFrom( const wxPrintData &data );
virtual bool TransferTo( wxPrintData &data ) wxOVERRIDE;
virtual bool TransferFrom( const wxPrintData &data ) wxOVERRIDE;
virtual bool IsOk() const ;
virtual bool IsOk() const wxOVERRIDE;
virtual void TransferFrom( const wxPageSetupDialogData * );
virtual void TransferTo( wxPageSetupDialogData * );
virtual void TransferFrom( const wxPageSetupDialogData * ) wxOVERRIDE;
virtual void TransferTo( wxPageSetupDialogData * ) wxOVERRIDE;
virtual void TransferFrom( const wxPrintDialogData * );
virtual void TransferTo( wxPrintDialogData * );
@@ -69,8 +69,8 @@ public:
WX_NSPrintInfo GetNSPrintInfo() { return m_macPrintInfo; }
protected:
virtual void UpdateFromPMState();
virtual void UpdateToPMState();
virtual void UpdateFromPMState() wxOVERRIDE;
virtual void UpdateToPMState() wxOVERRIDE;
WX_NSPrintInfo m_macPrintInfo;
private:

View File

@@ -37,24 +37,24 @@ public:
virtual ~wxRegion();
// wxRegionBase methods
virtual void Clear();
virtual bool IsEmpty() const;
virtual void Clear() wxOVERRIDE;
virtual bool IsEmpty() const wxOVERRIDE;
// Internal
WXHRGN GetWXHRGN() const ;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
virtual bool DoIsEqual(const wxRegion& region) const;
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const;
virtual wxRegionContain DoContainsRect(const wxRect& rect) const;
virtual bool DoIsEqual(const wxRegion& region) const wxOVERRIDE;
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const wxOVERRIDE;
virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const wxOVERRIDE;
virtual wxRegionContain DoContainsRect(const wxRect& rect) const wxOVERRIDE;
virtual bool DoOffset(wxCoord x, wxCoord y);
virtual bool DoCombine(const wxRegion& region, wxRegionOp op);
virtual bool DoUnionWithRect(const wxRect& rect);
virtual bool DoOffset(wxCoord x, wxCoord y) wxOVERRIDE;
virtual bool DoCombine(const wxRegion& region, wxRegionOp op) wxOVERRIDE;
virtual bool DoUnionWithRect(const wxRect& rect) wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxRegion);

View File

@@ -20,7 +20,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
const wxString& name = wxASCII_STR(wxCheckBoxNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
@@ -29,18 +29,18 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
virtual void SetValue(bool);
virtual bool GetValue() const;
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
virtual void SetValue(bool) wxOVERRIDE;
virtual bool GetValue() const wxOVERRIDE;
virtual void Command(wxCommandEvent& event);
virtual void Command(wxCommandEvent& event) wxOVERRIDE;
// osx specific event handling common for all osx-ports
virtual bool OSXHandleClicked( double timestampsec );
virtual bool OSXHandleClicked( double timestampsec ) wxOVERRIDE;
protected:
void DoSet3StateValue(wxCheckBoxState val);
virtual wxCheckBoxState DoGet3StateValue() const;
void DoSet3StateValue(wxCheckBoxState val) wxOVERRIDE;
virtual wxCheckBoxState DoGet3StateValue() const wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxCheckBox);
};
@@ -60,7 +60,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
const wxString& name = wxASCII_STR(wxCheckBoxNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
@@ -69,12 +69,11 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
virtual void SetValue(bool);
virtual bool GetValue() const;
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
virtual void SetValue(bool) wxOVERRIDE;
virtual bool GetValue() const wxOVERRIDE;
virtual void SetLabel(const wxBitmap *bitmap);
virtual void SetLabel( const wxString & WXUNUSED(name) ) {}
virtual void SetLabel( const wxString & WXUNUSED(name) ) wxOVERRIDE {}
wxDECLARE_DYNAMIC_CLASS(wxBitmapCheckBox);
};

View File

@@ -25,7 +25,7 @@ public:
const wxString *choices = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
const wxString& name = wxASCII_STR(wxListBoxNameStr))
{
Init();
@@ -38,7 +38,7 @@ public:
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
const wxString& name = wxASCII_STR(wxListBoxNameStr))
{
Init();
@@ -53,7 +53,7 @@ public:
const wxString *choices = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
const wxString& name = wxASCII_STR(wxListBoxNameStr));
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
@@ -61,7 +61,7 @@ public:
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
const wxString& name = wxASCII_STR(wxListBoxNameStr));
// items may be checked
bool IsChecked(unsigned int uiIndex) const wxOVERRIDE;

View File

@@ -36,7 +36,7 @@ public:
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr)
const wxString& name = wxASCII_STR(wxChoiceNameStr))
{
Create(parent, id, pos, size, n, choices, style, validator, name);
}
@@ -46,7 +46,7 @@ public:
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr)
const wxString& name = wxASCII_STR(wxChoiceNameStr))
{
Create(parent, id, pos, size, choices, style, validator, name);
}
@@ -57,37 +57,37 @@ public:
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
const wxString& name = wxASCII_STR(wxChoiceNameStr));
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
const wxString& name = wxASCII_STR(wxChoiceNameStr));
virtual unsigned int GetCount() const ;
virtual int GetSelection() const ;
virtual void SetSelection(int n);
virtual unsigned int GetCount() const wxOVERRIDE;
virtual int GetSelection() const wxOVERRIDE;
virtual void SetSelection(int n) wxOVERRIDE;
virtual int FindString(const wxString& s, bool bCase = false) const;
virtual wxString GetString(unsigned int n) const ;
virtual void SetString(unsigned int pos, const wxString& s);
virtual int FindString(const wxString& s, bool bCase = false) const wxOVERRIDE;
virtual wxString GetString(unsigned int n) const wxOVERRIDE;
virtual void SetString(unsigned int pos, const wxString& s) wxOVERRIDE;
// osx specific event handling common for all osx-ports
virtual bool OSXHandleClicked( double timestampsec );
virtual bool OSXHandleClicked(double timestampsec) wxOVERRIDE;
protected:
virtual void DoDeleteOneItem(unsigned int n);
virtual void DoClear();
virtual void DoDeleteOneItem(unsigned int n) wxOVERRIDE;
virtual void DoClear() wxOVERRIDE;
virtual wxSize DoGetBestSize() const ;
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
unsigned int pos,
void **clientData, wxClientDataType type);
void **clientData, wxClientDataType type) wxOVERRIDE;
virtual void DoSetItemClientData(unsigned int n, void* clientData);
virtual void* DoGetItemClientData(unsigned int n) const;
virtual void DoSetItemClientData(unsigned int n, void* clientData) wxOVERRIDE;
virtual void* DoGetItemClientData(unsigned int n) const wxOVERRIDE;
wxArrayString m_strings;
wxChoiceDataArray m_datas ;

View File

@@ -26,33 +26,33 @@ public:
virtual ~wxClipboard();
// open the clipboard before SetData() and GetData()
virtual bool Open();
virtual bool Open() wxOVERRIDE;
// close the clipboard after SetData() and GetData()
virtual void Close();
virtual void Close() wxOVERRIDE;
// query whether the clipboard is opened
virtual bool IsOpened() const;
virtual bool IsOpened() const wxOVERRIDE;
// set the clipboard data. all other formats will be deleted.
virtual bool SetData( wxDataObject *data );
virtual bool SetData( wxDataObject *data ) wxOVERRIDE;
// add to the clipboard data.
virtual bool AddData( wxDataObject *data );
virtual bool AddData( wxDataObject *data ) wxOVERRIDE;
// ask if data in correct format is available
virtual bool IsSupported( const wxDataFormat& format );
virtual bool IsSupported( const wxDataFormat& format ) wxOVERRIDE;
// fill data with data on the clipboard (if available)
virtual bool GetData( wxDataObject& data );
virtual bool GetData( wxDataObject& data ) wxOVERRIDE;
// clears wxTheClipboard and the system's clipboard if possible
virtual void Clear();
virtual void Clear() wxOVERRIDE;
// flushes the clipboard: this means that the data which is currently on
// clipboard will stay available even after the application exits (possibly
// eating memory), otherwise the clipboard will be emptied on exit
virtual bool Flush();
virtual bool Flush() wxOVERRIDE;
private:
wxDataObject *m_data;

View File

@@ -22,7 +22,7 @@
/*
* leave is isFlipped and don't override
*/
#ifndef wxOSX_USE_NATIVE_FLIPPED
#ifndef wxOSX_USE_NATIVE_FLIPPED
#define wxOSX_USE_NATIVE_FLIPPED 1
#endif

View File

@@ -142,6 +142,7 @@ public:
[m_origFont release];
[m_origTextColour release];
[m_origBackgroundColour release];
}
NSCell* GetColumnCell() const { return m_ColumnCell; }
@@ -186,6 +187,7 @@ public:
// ones that do.
NSFont *GetOriginalFont() const { return m_origFont; }
NSColor *GetOriginalTextColour() const { return m_origTextColour; }
NSColor *GetOriginalBackgroundColour() const { return m_origBackgroundColour; }
void SaveOriginalFont(NSFont *font)
{
@@ -197,6 +199,11 @@ public:
m_origTextColour = [textColour retain];
}
void SaveOriginalBackgroundColour(NSColor *backgroundColour)
{
m_origBackgroundColour = [backgroundColour retain];
}
// The ellipsization mode which we need to set for each cell being rendered.
void SetEllipsizeMode(wxEllipsizeMode mode) { m_ellipsizeMode = mode; }
wxEllipsizeMode GetEllipsizeMode() const { return m_ellipsizeMode; }
@@ -226,6 +233,7 @@ private:
// we own those if they're non-NULL
NSFont *m_origFont;
NSColor *m_origTextColour;
NSColor *m_origBackgroundColour;
wxEllipsizeMode m_ellipsizeMode;
@@ -486,10 +494,7 @@ public:
virtual wxDataViewItem GetTopItem() const;
virtual bool IsExpanded(const wxDataViewItem& item) const;
virtual bool Reload();
virtual bool Remove(const wxDataViewItem& parent,
const wxDataViewItem& item);
virtual bool Remove(const wxDataViewItem& parent,
const wxDataViewItemArray& item);
virtual bool Remove(const wxDataViewItem& parent);
virtual bool Update(const wxDataViewColumn* columnPtr);
virtual bool Update(const wxDataViewItem& parent,
const wxDataViewItem& item);
@@ -509,6 +514,7 @@ public:
virtual int GetSelections(wxDataViewItemArray& sel) const;
virtual bool IsSelected(const wxDataViewItem& item) const;
virtual void Select(const wxDataViewItem& item);
virtual void Select(const wxDataViewItemArray& items);
virtual void SelectAll();
virtual void Unselect(const wxDataViewItem& item);
virtual void UnselectAll();
@@ -524,7 +530,7 @@ public:
//
virtual void DoSetIndent(int indent);
virtual void DoExpand(const wxDataViewItem& item);
virtual void DoExpand(const wxDataViewItem& item, bool expandChildren);
virtual void HitTest(const wxPoint& point,
wxDataViewItem& item,
@@ -532,7 +538,7 @@ public:
virtual void SetRowHeight(int height);
virtual void SetRowHeight(const wxDataViewItem& item, unsigned int height);
virtual void OnSize();
virtual void StartEditor( const wxDataViewItem & item, unsigned int column );
// drag & drop helper methods
@@ -542,7 +548,7 @@ public:
// Cocoa-specific helpers
id GetItemAtRow(int row) const;
virtual void SetFont(const wxFont& font, const wxColour& foreground, long windowStyle, bool ignoreBlack = true);
virtual void SetFont(const wxFont& font);
private:
void InitOutlineView(long style);
@@ -551,6 +557,9 @@ private:
wxCocoaOutlineDataSource* m_DataSource;
wxCocoaOutlineView* m_OutlineView;
// Width of expander in pixels, computed on demand.
int m_expanderWidth;
};
#endif // _WX_DATAVIEWCTRL_COCOOA_H_

View File

@@ -3,7 +3,7 @@
// Purpose: declaration of wxGUIEventLoop for wxOSX/Cocoa
// Author: Vadim Zeitlin
// Created: 2008-12-28
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@@ -15,32 +15,32 @@ class WXDLLIMPEXP_BASE wxGUIEventLoop : public wxCFEventLoop
public:
wxGUIEventLoop();
~wxGUIEventLoop();
void BeginModalSession( wxWindow* modalWindow );
void EndModalSession();
virtual void WakeUp();
virtual void WakeUp() wxOVERRIDE;
void OSXUseLowLevelWakeup(bool useIt)
{ m_osxLowLevelWakeUp = useIt ; }
protected:
virtual int DoDispatchTimeout(unsigned long timeout);
virtual int DoDispatchTimeout(unsigned long timeout) wxOVERRIDE;
virtual void OSXDoRun();
virtual void OSXDoStop();
virtual void OSXDoRun() wxOVERRIDE;
virtual void OSXDoStop() wxOVERRIDE;
virtual CFRunLoopRef CFGetCurrentRunLoop() const wxOVERRIDE;
virtual CFRunLoopRef CFGetCurrentRunLoop() const;
void* m_modalSession;
wxWindow* m_modalWindow;
WXWindow m_dummyWindow;
int m_modalNestedLevel;
bool m_osxLowLevelWakeUp;
};

View File

@@ -39,6 +39,7 @@ void WXDLLIMPEXP_CORE wxOSXDrawNSImage(
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetSystemImage(const wxString& name);
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image, double scale = 1.0, bool isTemplate = false);
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromIconRef( WXHICON iconref );
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCFURL( CFURLRef urlref );
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetIconForType(OSType type );
void WXDLLIMPEXP_CORE wxOSXSetImageSize(WX_NSImage image, CGFloat width, CGFloat height);
wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size);
@@ -47,17 +48,37 @@ WXWindow WXDLLIMPEXP_CORE wxOSXGetKeyWindow();
class WXDLLIMPEXP_FWD_CORE wxDialog;
class WXDLLIMPEXP_FWD_CORE wxWidgetCocoaImpl;
// a class which disables sending wx keydown events useful when adding text programmatically, for wx-internal use only
class wxWidgetCocoaNativeKeyDownSuspender
{
public:
// stops sending keydown events for text inserted into this widget
explicit wxWidgetCocoaNativeKeyDownSuspender(wxWidgetCocoaImpl *target);
// resumes sending keydown events
~wxWidgetCocoaNativeKeyDownSuspender();
private:
wxWidgetCocoaImpl *m_target;
NSEvent* m_nsevent;
bool m_wxsent;
wxDECLARE_NO_COPY_CLASS(wxWidgetCocoaNativeKeyDownSuspender);
};
class WXDLLIMPEXP_CORE wxWidgetCocoaImpl : public wxWidgetImpl
{
public :
wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false, bool isUserPane = false ) ;
wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, int flags = 0 ) ;
wxWidgetCocoaImpl() ;
~wxWidgetCocoaImpl();
void Init();
virtual bool IsVisible() const ;
virtual void SetVisibility(bool);
virtual bool IsVisible() const wxOVERRIDE;
virtual void SetVisibility(bool) wxOVERRIDE;
// we provide a static function which can be reused from
// wxNonOwnedWindowCocoaImpl too
@@ -68,70 +89,72 @@ public :
virtual bool ShowWithEffect(bool show,
wxShowEffect effect,
unsigned timeout);
unsigned timeout) wxOVERRIDE;
virtual void Raise();
virtual void Raise() wxOVERRIDE;
virtual void Lower();
virtual void Lower() wxOVERRIDE;
virtual void ScrollRect( const wxRect *rect, int dx, int dy );
virtual void ScrollRect( const wxRect *rect, int dx, int dy ) wxOVERRIDE;
virtual WXWidget GetWXWidget() const { return m_osxView; }
virtual WXWidget GetWXWidget() const wxOVERRIDE { return m_osxView; }
virtual void SetBackgroundColour(const wxColour&);
virtual bool SetBackgroundStyle(wxBackgroundStyle style);
virtual void SetBackgroundColour(const wxColour&) wxOVERRIDE;
virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE;
virtual void GetContentArea( int &left , int &top , int &width , int &height ) const;
virtual void Move(int x, int y, int width, int height);
virtual void GetPosition( int &x, int &y ) const;
virtual void GetSize( int &width, int &height ) const;
virtual void SetControlSize( wxWindowVariant variant );
virtual void GetContentArea( int &left, int &top, int &width, int &height ) const wxOVERRIDE;
virtual void Move(int x, int y, int width, int height) wxOVERRIDE;
virtual void GetPosition( int &x, int &y ) const wxOVERRIDE;
virtual void GetSize( int &width, int &height ) const wxOVERRIDE;
virtual void SetControlSize( wxWindowVariant variant ) wxOVERRIDE;
virtual void SetNeedsDisplay( const wxRect* where = NULL );
virtual bool GetNeedsDisplay() const;
virtual void SetNeedsDisplay( const wxRect* where = NULL ) wxOVERRIDE;
virtual bool GetNeedsDisplay() const wxOVERRIDE;
virtual void SetDrawingEnabled(bool enabled);
virtual void EnableFocusRing(bool enabled) wxOVERRIDE;
virtual bool CanFocus() const;
virtual void SetDrawingEnabled(bool enabled) wxOVERRIDE;
virtual bool CanFocus() const wxOVERRIDE;
// return true if successful
virtual bool SetFocus();
virtual bool HasFocus() const;
virtual bool SetFocus() wxOVERRIDE;
virtual bool HasFocus() const wxOVERRIDE;
void RemoveFromParent();
void Embed( wxWidgetImpl *parent );
void RemoveFromParent() wxOVERRIDE;
void Embed( wxWidgetImpl *parent ) wxOVERRIDE;
void SetDefaultButton( bool isDefault );
void PerformClick();
virtual void SetLabel(const wxString& title, wxFontEncoding encoding);
void SetDefaultButton( bool isDefault ) wxOVERRIDE;
void PerformClick() wxOVERRIDE;
virtual void SetLabel(const wxString& title, wxFontEncoding encoding) wxOVERRIDE;
void SetCursor( const wxCursor & cursor );
void CaptureMouse();
void ReleaseMouse();
void SetCursor( const wxCursor & cursor ) wxOVERRIDE;
void CaptureMouse() wxOVERRIDE;
void ReleaseMouse() wxOVERRIDE;
#if wxUSE_DRAG_AND_DROP
void SetDropTarget(wxDropTarget* target);
void SetDropTarget(wxDropTarget* target) wxOVERRIDE;
#endif
wxInt32 GetValue() const;
void SetValue( wxInt32 v );
wxBitmap GetBitmap() const;
void SetBitmap( const wxBitmap& bitmap );
void SetBitmapPosition( wxDirection dir );
void SetupTabs( const wxNotebook &notebook );
void GetBestRect( wxRect *r ) const;
bool IsEnabled() const;
void Enable( bool enable );
bool ButtonClickDidStateChange() { return true ;}
void SetMinimum( wxInt32 v );
void SetMaximum( wxInt32 v );
wxInt32 GetMinimum() const;
wxInt32 GetMaximum() const;
void PulseGauge();
void SetScrollThumb( wxInt32 value, wxInt32 thumbSize );
wxInt32 GetValue() const wxOVERRIDE;
void SetValue( wxInt32 v ) wxOVERRIDE;
wxBitmap GetBitmap() const wxOVERRIDE;
void SetBitmap( const wxBitmap& bitmap ) wxOVERRIDE;
void SetBitmapPosition( wxDirection dir ) wxOVERRIDE;
void SetupTabs( const wxNotebook &notebook ) wxOVERRIDE;
void GetBestRect( wxRect *r ) const wxOVERRIDE;
bool IsEnabled() const wxOVERRIDE;
void Enable( bool enable ) wxOVERRIDE;
bool ButtonClickDidStateChange() wxOVERRIDE { return true; }
void SetMinimum( wxInt32 v ) wxOVERRIDE;
void SetMaximum( wxInt32 v ) wxOVERRIDE;
wxInt32 GetMinimum() const wxOVERRIDE;
wxInt32 GetMaximum() const wxOVERRIDE;
void PulseGauge() wxOVERRIDE;
void SetScrollThumb( wxInt32 value, wxInt32 thumbSize ) wxOVERRIDE;
void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
void SetToolTip( wxToolTip* tooltip );
void SetFont(const wxFont & font) wxOVERRIDE;
void SetToolTip( wxToolTip* tooltip ) wxOVERRIDE;
void InstallEventHandler( WXWidget control = NULL );
bool EnableTouchEvents(int eventsMask);
void InstallEventHandler( WXWidget control = NULL ) wxOVERRIDE;
bool EnableTouchEvents(int eventsMask) wxOVERRIDE;
virtual bool ShouldHandleKeyNavigation(const wxKeyEvent &event) const;
bool DoHandleKeyNavigation(const wxKeyEvent &event);
@@ -147,23 +170,31 @@ public :
void SetupCoordinates(wxCoord &x, wxCoord &y, NSEvent *nsEvent);
virtual bool SetupCursor(NSEvent* event);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
virtual void PanGestureEvent(NSPanGestureRecognizer *panGestureRecognizer);
virtual void ZoomGestureEvent(NSMagnificationGestureRecognizer *magnificationGestureRecognizer);
virtual void RotateGestureEvent(NSRotationGestureRecognizer *rotationGestureRecognizer);
virtual void LongPressEvent(NSPressGestureRecognizer *pressGestureRecognizer);
virtual void TouchesBegan(NSEvent *event);
virtual void TouchesMoved(NSEvent *event);
virtual void TouchesEnded(NSEvent *event);
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
#ifdef API_AVAILABLE
#define WX_AVAILABLE_10_10 API_AVAILABLE(macos(10.10))
#else
#define WX_AVAILABLE_10_10
#endif
WX_AVAILABLE_10_10 virtual void PanGestureEvent(NSPanGestureRecognizer *panGestureRecognizer);
WX_AVAILABLE_10_10 virtual void ZoomGestureEvent(NSMagnificationGestureRecognizer *magnificationGestureRecognizer);
WX_AVAILABLE_10_10 virtual void RotateGestureEvent(NSRotationGestureRecognizer *rotationGestureRecognizer);
WX_AVAILABLE_10_10 virtual void LongPressEvent(NSPressGestureRecognizer *pressGestureRecognizer);
WX_AVAILABLE_10_10 virtual void TouchesBegan(NSEvent *event);
WX_AVAILABLE_10_10 virtual void TouchesMoved(NSEvent *event);
WX_AVAILABLE_10_10 virtual void TouchesEnded(NSEvent *event);
#undef WX_AVAILABLE_10_10
#endif // __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
#if !wxOSX_USE_NATIVE_FLIPPED
void SetFlipped(bool flipped);
virtual bool IsFlipped() const { return m_isFlipped; }
#endif
virtual double GetContentScaleFactor() const;
virtual double GetContentScaleFactor() const wxOVERRIDE;
// cocoa thunk connected calls
#if wxUSE_DRAG_AND_DROP
@@ -177,7 +208,6 @@ public :
virtual void keyEvent(WX_NSEvent event, WXWidget slf, void* _cmd);
virtual void insertText(NSString* text, WXWidget slf, void* _cmd);
virtual void doCommandBySelector(void* sel, WXWidget slf, void* _cmd);
virtual bool performKeyEquivalent(WX_NSEvent event, WXWidget slf, void* _cmd);
virtual bool acceptsFirstResponder(WXWidget slf, void* _cmd);
virtual bool becomeFirstResponder(WXWidget slf, void* _cmd);
virtual bool resignFirstResponder(WXWidget slf, void* _cmd);
@@ -195,7 +225,24 @@ public :
protected:
WXWidget m_osxView;
// begins processing of native key down event, storing the native event for later wx event generation
void BeginNativeKeyDownEvent( NSEvent* event );
// done with the current native key down event
void EndNativeKeyDownEvent();
// allow executing text changes without triggering key down events
// is currently processing a native key down event
bool IsInNativeKeyDown() const;
// the native key event
NSEvent* GetLastNativeKeyDownEvent();
// did send the wx event for the current native key down event
void SetKeyDownSent();
// was the wx event for the current native key down event sent
bool WasKeyDownSent() const;
NSEvent* m_lastKeyDownEvent;
bool m_lastKeyDownWXSent;
#if !wxOSX_USE_NATIVE_FLIPPED
bool m_isFlipped;
#endif
@@ -203,6 +250,8 @@ protected:
// events, don't resend them
bool m_hasEditor;
friend class wxWidgetCocoaNativeKeyDownSuspender;
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxWidgetCocoaImpl);
};
@@ -242,7 +291,7 @@ public :
void GetPosition( int &x, int &y ) const wxOVERRIDE;
void GetSize( int &width, int &height ) const wxOVERRIDE;
void GetContentArea( int &left , int &top , int &width , int &height ) const wxOVERRIDE;
void GetContentArea( int &left, int &top, int &width, int &height ) const wxOVERRIDE;
bool SetShape(const wxRegion& region) wxOVERRIDE;
virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) wxOVERRIDE;
@@ -281,20 +330,20 @@ public :
virtual void SetRepresentedFilename(const wxString& filename) wxOVERRIDE;
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
CGWindowLevel GetWindowLevel() const wxOVERRIDE { return m_macWindowLevel; }
void RestoreWindowLevel() wxOVERRIDE;
static WX_NSResponder GetNextFirstResponder() ;
static WX_NSResponder GetFormerFirstResponder() ;
protected :
CGWindowLevel m_macWindowLevel;
WXWindow m_macWindow;
void * m_macFullScreenData ;
private:
void SetUpForModalParent();
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCocoaImpl);
};
@@ -304,13 +353,13 @@ class wxButtonCocoaImpl : public wxWidgetCocoaImpl, public wxButtonImpl
{
public:
wxButtonCocoaImpl(wxWindowMac *wxpeer, wxNSButton *v);
virtual void SetBitmap(const wxBitmap& bitmap);
virtual void SetBitmap(const wxBitmap& bitmap) wxOVERRIDE;
#if wxUSE_MARKUP
virtual void SetLabelMarkup(const wxString& markup);
virtual void SetLabelMarkup(const wxString& markup) wxOVERRIDE;
#endif // wxUSE_MARKUP
void SetPressedBitmap( const wxBitmap& bitmap );
void GetLayoutInset(int &left , int &top , int &right, int &bottom) const;
void SetPressedBitmap( const wxBitmap& bitmap ) wxOVERRIDE;
void GetLayoutInset(int &left, int &top, int &right, int &bottom) const wxOVERRIDE;
void SetAcceleratorFromLabel(const wxString& label);
NSButton *GetNSButton() const;
@@ -510,11 +559,6 @@ extern ClassicCursor gMacCursors[];
extern NSLayoutManager* gNSLayoutManager;
// NSString<->wxString
wxString wxStringWithNSString(NSString *nsstring);
NSString* wxNSStringWithWxString(const wxString &wxstring);
// helper class for setting the current appearance to the
// effective appearance and restore when exiting scope
@@ -531,4 +575,3 @@ private:
#endif
// _WX_PRIVATE_COCOA_H_

View File

@@ -32,6 +32,12 @@ public :
virtual ~wxNSTextBase() { }
virtual bool ShouldHandleKeyNavigation(const wxKeyEvent &event) const wxOVERRIDE;
virtual void SetInitialLabel(const wxString& WXUNUSED(title), wxFontEncoding WXUNUSED(encoding)) wxOVERRIDE
{
// Don't do anything here, text controls don't have any label and
// setting it would overwrite the string value set when creating it.
}
};
// implementation exposed, so that search control can pull it
@@ -97,7 +103,7 @@ public:
virtual ~wxNSTextViewControl();
virtual void insertText(NSString* text, WXWidget slf, void *_cmd) wxOVERRIDE;
virtual wxString GetStringValue() const wxOVERRIDE ;
virtual void SetStringValue( const wxString &str) wxOVERRIDE ;
virtual void Copy() wxOVERRIDE ;
@@ -112,7 +118,7 @@ public:
virtual long XYToPosition(long x, long y) const wxOVERRIDE;
virtual void ShowPosition(long pos) wxOVERRIDE;
virtual void WriteText(const wxString& str) wxOVERRIDE ;
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ) wxOVERRIDE;
virtual void SetFont(const wxFont & font) wxOVERRIDE;
virtual bool GetStyle(long position, wxTextAttr& style) wxOVERRIDE;
virtual void SetStyle(long start, long end, const wxTextAttr& style) wxOVERRIDE;

View File

@@ -23,11 +23,11 @@ class WXDLLIMPEXP_CORE wxColourDialog: public wxDialog
wxDECLARE_DYNAMIC_CLASS(wxColourDialog);
public:
wxColourDialog();
wxColourDialog(wxWindow *parent, wxColourData *data = NULL);
wxColourDialog(wxWindow *parent, const wxColourData *data = NULL);
bool Create(wxWindow *parent, wxColourData *data = NULL);
bool Create(wxWindow *parent, const wxColourData *data = NULL);
int ShowModal();
int ShowModal() wxOVERRIDE;
wxColourData& GetColourData() { return m_colourData; }
protected:

View File

@@ -47,7 +47,7 @@ class WXDLLIMPEXP_CORE wxComboBox :
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
const wxString& name = wxASCII_STR(wxComboBoxNameStr))
{
Create(parent, id, value, pos, size, n, choices, style, validator, name);
}
@@ -59,7 +59,7 @@ class WXDLLIMPEXP_CORE wxComboBox :
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
const wxString& name = wxASCII_STR(wxComboBoxNameStr))
{
Create(parent, id, value, pos, size, choices, style, validator, name);
}
@@ -71,7 +71,7 @@ class WXDLLIMPEXP_CORE wxComboBox :
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
const wxString& name = wxASCII_STR(wxComboBoxNameStr));
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value,
@@ -80,61 +80,70 @@ class WXDLLIMPEXP_CORE wxComboBox :
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
const wxString& name = wxASCII_STR(wxComboBoxNameStr));
virtual int GetSelection() const;
virtual void GetSelection(long *from, long *to) const;
virtual void SetSelection(int n);
virtual void SetSelection(long from, long to);
virtual int FindString(const wxString& s, bool bCase = false) const;
virtual wxString GetString(unsigned int n) const;
virtual wxString GetStringSelection() const;
virtual void SetString(unsigned int n, const wxString& s);
virtual int GetSelection() const wxOVERRIDE;
virtual void GetSelection(long *from, long *to) const wxOVERRIDE;
virtual void SetSelection(int n) wxOVERRIDE;
virtual void SetSelection(long from, long to) wxOVERRIDE;
virtual int FindString(const wxString& s, bool bCase = false) const wxOVERRIDE;
virtual wxString GetString(unsigned int n) const wxOVERRIDE;
virtual wxString GetStringSelection() const wxOVERRIDE;
virtual void SetString(unsigned int n, const wxString& s) wxOVERRIDE;
virtual unsigned int GetCount() const;
virtual unsigned int GetCount() const wxOVERRIDE;
virtual void SetValue(const wxString& value);
virtual void SetValue(const wxString& value) wxOVERRIDE;
// these methods are provided by wxTextEntry for the native impl.
#if wxOSX_USE_COCOA
virtual void Popup();
virtual void Dismiss();
virtual void Popup() wxOVERRIDE;
virtual void Dismiss() wxOVERRIDE;
#endif // wxOSX_USE_COCOA
virtual const wxTextEntry* WXGetTextEntry() const wxOVERRIDE { return this; }
// osx specific event handling common for all osx-ports
virtual bool OSXHandleClicked( double timestampsec );
virtual bool OSXHandleClicked(double timestampsec) wxOVERRIDE;
#if wxOSX_USE_COCOA
wxComboWidgetImpl* GetComboPeer() const;
#endif
protected:
// List functions
virtual void DoDeleteOneItem(unsigned int n);
virtual void DoClear();
virtual void DoDeleteOneItem(unsigned int n) wxOVERRIDE;
virtual void DoClear() wxOVERRIDE;
// wxTextEntry functions
virtual wxWindow *GetEditableWindow() { return this; }
virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; }
// override the base class virtuals involved in geometry calculations
virtual wxSize DoGetBestSize() const;
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
unsigned int pos,
void **clientData, wxClientDataType type);
void **clientData, wxClientDataType type) wxOVERRIDE;
virtual void DoSetItemClientData(unsigned int n, void* clientData);
virtual void * DoGetItemClientData(unsigned int n) const;
virtual void DoSetItemClientData(unsigned int n, void* clientData) wxOVERRIDE;
virtual void * DoGetItemClientData(unsigned int n) const wxOVERRIDE;
virtual void EnableTextChangedEvents(bool enable);
virtual void EnableTextChangedEvents(bool enable) wxOVERRIDE;
// callbacks
void OnChar(wxKeyEvent& event); // Process 'enter' if required
void OnKeyDown(wxKeyEvent& event); // Process clipboard shortcuts
// the subcontrols
wxComboBoxText* m_text;
wxComboBoxChoice* m_choice;
wxComboBoxDataArray m_datas;
private:
wxDECLARE_EVENT_TABLE();
};
#endif // _WX_COMBOBOX_H_

View File

@@ -22,7 +22,6 @@
#define wx_USE_NANOX 0
#define HAVE_VA_COPY 1
#define HAVE_VARIADIC_MACROS 1
#define HAVE_STD_WSTRING 1
#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 2 )
#if !defined(__has_include)
@@ -87,7 +86,6 @@
#define SIZEOF_LONG_LONG 8
#define wxSIZE_T_IS_ULONG 1
#define wxWCHAR_T_IS_REAL_TYPE 1
#define HAVE_DLERROR 1
#define HAVE_FCNTL 1
#define HAVE_GETHOSTBYNAME 1
#define HAVE_GETSERVBYNAME 1
@@ -126,9 +124,9 @@
#define PACKAGE_BUGREPORT "wx-dev@googlegroups.com"
#define PACKAGE_NAME "wxWidgets"
#define PACKAGE_STRING "wxWidgets 3.1.3"
#define PACKAGE_STRING "wxWidgets 3.1.5"
#define PACKAGE_TARNAME "wxwidgets"
#define PACKAGE_VERSION "3.1.3"
#define PACKAGE_VERSION "3.1.5"
// for regex
#define WX_NO_REGEX_ADVANCED 1

View File

@@ -24,7 +24,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr)
const wxString& name = wxASCII_STR(wxControlNameStr))
{
Create(parent, winid, pos, size, style, validator, name);
}
@@ -33,10 +33,10 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
const wxString& name = wxASCII_STR(wxControlNameStr));
// Simulates an event
virtual void Command(wxCommandEvent& event) { ProcessCommand(event); }
virtual void Command(wxCommandEvent& event) wxOVERRIDE { ProcessCommand(event); }
// implementation from now on
// --------------------------

View File

@@ -56,10 +56,7 @@ public:
@discussion Ownership will be shared by the original ref and the newly created ref. That is,
the object will be explicitly retained by this new ref.
*/
wxCFDictionaryRefCommon(const wxCFDictionaryRefCommon& otherRef)
: super_type(otherRef)
{
}
wxCFDictionaryRefCommon(const wxCFDictionaryRefCommon&) = default;
wxCFTypeRef GetValue(const void* key)
{
@@ -119,7 +116,7 @@ public:
{
SetValue(key, wxCFNumberRef(v));
}
CFMutableDictionaryRef CreateCopy() const
{
return CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, this->m_ptr);

View File

@@ -18,8 +18,16 @@
// Include unistd to ensure that NULL is defined
#include <unistd.h>
// Include AvailabilityMacros for DEPRECATED_ATTRIBUTE
#include <AvailabilityMacros.h>
// Include Availability for __AVAILABILITY_INTERNAL_DEPRECATED
#include <Availability.h>
#if __has_feature(objc_arc)
#define WX_OSX_BRIDGE_RETAINED __bridge_retained
#define WX_OSX_BRIDGE __bridge
#else
#define WX_OSX_BRIDGE_RETAINED
#define WX_OSX_BRIDGE
#endif
// #include <CoreFoundation/CFBase.h>
/* Don't include CFBase.h such that this header can be included from public
@@ -27,12 +35,15 @@
* Note that Darwin CF uses extern for CF_EXPORT. If we need this on Win32
* or non-Darwin Mac OS we'll need to define the appropriate __declspec.
*/
typedef const void *CFTypeRef;
extern "C" {
extern /* CF_EXPORT */
CFTypeRef CFRetain(CFTypeRef cf);
extern /* CF_EXPORT */
void CFRelease(CFTypeRef cf);
extern /* CF_EXPORT */
CFTypeRef CFAutorelease(CFTypeRef cf);
} // extern "C"
@@ -48,6 +59,19 @@ inline void wxCFRelease(Type *r)
::CFRelease((CFTypeRef)r);
}
/*! @function wxCFAutorelease
@abstract A CFAutorelease variant that checks for NULL before releasing.
@discussion The parameter is template not for type safety but to ensure the argument
is a raw pointer and not a ref holder of any type.
*/
template <class Type>
inline Type* wxCFAutorelease(Type *r)
{
if ( r != NULL )
r = const_cast<Type*>(static_cast<const Type*>(::CFAutorelease(static_cast<CFTypeRef>(r))));
return r;
}
/*! @function wxCFRetain
@abstract A typesafe CFRetain variant that checks for NULL.
*/
@@ -58,7 +82,7 @@ inline Type* wxCFRetain(Type *r)
// Casting r to CFTypeRef ensures we are calling the real C version defined in CFBase.h
// and not any possibly templated/overloaded CFRetain.
if ( r != NULL )
r = (Type*)::CFRetain((CFTypeRef)r);
r = const_cast<Type*>(static_cast<const Type*>(::CFRetain(static_cast<CFTypeRef>(r))));
return r;
}
@@ -176,7 +200,7 @@ public:
*/
wxCFRef(refType p) : m_ptr(p)
{
}
/*! @method wxCFRef
@abstract Assumes ownership of p and creates a reference to it.
@@ -190,7 +214,7 @@ public:
This method is templated and takes an otherType *p. This prevents implicit conversion
using an operator refType() in a different ref-holding class type.
*/
template <class otherType>
explicit wxCFRef(otherType *p)
: m_ptr(p) // Implicit conversion from otherType* to refType should occur.
@@ -332,6 +356,15 @@ public:
m_ptr = NULL;
return p;
}
// Autorelease the pointer, i.e. during the next cleanup it will be released
refType autorelease()
{
refType p = m_ptr;
m_ptr = NULL;
return wxCFAutorelease(p);
}
protected:
/*! @var m_ptr The raw pointer.
@@ -383,7 +416,7 @@ inline wxCFWeakRef<refType> static_cfref_cast(const wxCFRef<otherRefType> &other
Normally, this function is unimplemented resulting in a linker error if used.
*/
template <class T>
inline void CFRelease(const wxCFRef<T*> & cfref) DEPRECATED_ATTRIBUTE;
inline void CFRelease(const wxCFRef<T*> & cfref) __AVAILABILITY_INTERNAL_DEPRECATED;
/*! @function CFRetain
@abstract Overloads CFRetain so that the user is warned of bad behaviour.
@@ -392,7 +425,7 @@ inline void CFRelease(const wxCFRef<T*> & cfref) DEPRECATED_ATTRIBUTE;
Normally, this function is unimplemented resulting in a linker error if used.
*/
template <class T>
inline void CFRetain(const wxCFRef<T*>& cfref) DEPRECATED_ATTRIBUTE;
inline void CFRetain(const wxCFRef<T*>& cfref) __AVAILABILITY_INTERNAL_DEPRECATED;
// Change the 0 to a 1 if you want the functions to work (no link errors)
// Neither function will cause retain/release side-effects if implemented.

View File

@@ -12,8 +12,6 @@
#ifndef __WX_CFSTRINGHOLDER_H__
#define __WX_CFSTRINGHOLDER_H__
#include <CoreFoundation/CFString.h>
#include "wx/dlimpexp.h"
#include "wx/fontenc.h"
#include "wx/osx/core/cfref.h"
@@ -43,9 +41,9 @@ public:
wxCFStringRef(const wxString &str,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) ;
#ifdef __WXMAC__
wxCFStringRef(NSString* ref)
: wxCFRef< CFStringRef >((CFStringRef) ref)
#ifdef __OBJC__
wxCFStringRef(WX_NSString ref)
: wxCFRef< CFStringRef >((WX_OSX_BRIDGE_RETAINED CFStringRef) ref)
{
}
#endif
@@ -69,29 +67,37 @@ public:
static wxString AsString( CFStringRef ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
static wxString AsStringWithNormalizationFormC( CFStringRef ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
#ifdef __WXMAC__
static wxString AsString( NSString* ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
static wxString AsStringWithNormalizationFormC( NSString* ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
NSString* AsNSString() const { return (NSString*)(CFStringRef) *this; }
static wxString AsString( WX_NSString ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
static wxString AsStringWithNormalizationFormC( WX_NSString ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
#endif
#ifdef __OBJC__
WX_NSString AsNSString() const { return (WX_OSX_BRIDGE WX_NSString)(CFStringRef) *this; }
#endif
private:
} ;
// corresponding class for holding UniChars (native unicode characters)
class WXDLLIMPEXP_BASE wxMacUniCharBuffer
/*! @function wxCFStringRefFromGet
@abstract Factory function to create wxCFStringRefRef from a CFStringRef obtained from a Get-rule function
@param p The CFStringRef to retain and create a wxCFStringRefRef from. May be NULL.
@discussion Unlike the wxCFStringRef raw pointer constructor, this function explicitly retains its
argument. This can be used for functions ) which return a temporary reference (Get-rule functions).
*/
inline wxCFStringRef wxCFStringRefFromGet(CFStringRef p)
{
public :
wxMacUniCharBuffer( const wxString &str ) ;
return wxCFStringRef(wxCFRetain(p));
}
~wxMacUniCharBuffer() ;
#ifdef __WXMAC__
/*! @function wxCFStringRefFromGet
@abstract Factory function to create wxCFStringRefRef from a NSString* obtained from a Get-rule function
@param p The NSString pointer to retain and create a wxCFStringRefRef from. May be NULL.
@discussion Unlike the wxCFStringRef raw pointer constructor, this function explicitly retains its
argument. This can be used for functions ) which return a temporary reference (Get-rule functions).
*/
inline wxCFStringRef wxCFStringRefFromGet(NSString *p)
{
return wxCFStringRefFromGet((WX_OSX_BRIDGE CFStringRef)p);
}
#endif
UniCharPtr GetBuffer() ;
UniCharCount GetChars() ;
private :
UniCharPtr m_ubuf ;
UniCharCount m_chars ;
};
#endif //__WXCFSTRINGHOLDER_H__

View File

@@ -36,8 +36,6 @@ public:
virtual bool IsSolid() const wxOVERRIDE;
wxColour& operator=(const wxColour& col);
// comparison
bool operator == (const wxColour& colour) const;
bool operator != (const wxColour& colour) const { return !(*this == colour); }
@@ -47,10 +45,10 @@ public:
// This ctor does take ownership of the color.
wxColour( CGColorRef col );
// don't take ownership of the returned value
CGColorRef GetCGColor() const;
// do take ownership of the returned value
CGColorRef CreateCGColor() const { return wxCFRetain(GetCGColor()); }
@@ -68,8 +66,9 @@ public:
// This ctor does not take ownership of the color.
explicit wxColour(WX_NSColor color);
WX_NSColor OSXGetNSColor() const;
WX_NSImage OSXGetNSPatternImage() const;
#endif
protected :
virtual void
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a) wxOVERRIDE;
@@ -87,21 +86,22 @@ class wxColourRefData : public wxGDIRefData
public:
wxColourRefData() {}
virtual ~wxColourRefData() {}
virtual CGFloat Red() const = 0;
virtual CGFloat Green() const = 0;
virtual CGFloat Blue() const = 0;
virtual CGFloat Alpha() const = 0;
virtual bool IsSolid() const
{ return true; }
virtual CGColorRef GetCGColor() const = 0;
virtual wxColourRefData* Clone() const = 0;
#if wxOSX_USE_COCOA
virtual WX_NSColor GetNSColor() const;
virtual WX_NSImage GetNSPatternImage() const;
#endif
};

View File

@@ -39,14 +39,14 @@ public:
//
// constructors / destructor
//
virtual ~wxDataViewWidgetImpl(void)
virtual ~wxDataViewWidgetImpl()
{
}
//
// column related methods
//
virtual bool ClearColumns (void) = 0; // deletes all columns in the native control
virtual bool ClearColumns() = 0; // deletes all columns in the native control
virtual bool DeleteColumn (wxDataViewColumn* columnPtr) = 0; // deletes the column in the native control
virtual void DoSetExpanderColumn(wxDataViewColumn const* columnPtr) = 0; // sets the disclosure column in the native control
virtual wxDataViewColumn* GetColumn (unsigned int pos) const = 0; // returns the column belonging to 'pos' in the native control
@@ -59,17 +59,16 @@ public:
// item related methods
//
virtual bool Add (wxDataViewItem const& parent, wxDataViewItem const& item) = 0; // adds an item to the native control
virtual bool Add (wxDataViewItem const& parent, wxDataViewItemArray const& itesm) = 0; // adds a items to the native control
virtual bool Add (wxDataViewItem const& parent, wxDataViewItemArray const& items) = 0; // adds items to the native control
virtual void Collapse (wxDataViewItem const& item) = 0; // collapses the passed item in the native control
virtual void EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) = 0; // ensures that the passed item's value in the passed column is visible (column pointer can be NULL)
virtual unsigned int GetCount (void) const = 0; // returns the number of items in the native control
virtual int GetCountPerPage(void) const = 0; // get number of items that fit into a single page
virtual unsigned int GetCount() const = 0; // returns the number of items in the native control
virtual int GetCountPerPage() const = 0; // get number of items that fit into a single page
virtual wxRect GetRectangle (wxDataViewItem const& item, wxDataViewColumn const* columnPtr) = 0; // returns the rectangle that is used by the passed item and column in the native control
virtual wxDataViewItem GetTopItem (void) const = 0; // get top-most visible item
virtual wxDataViewItem GetTopItem() const = 0; // get top-most visible item
virtual bool IsExpanded (wxDataViewItem const& item) const = 0; // checks if the passed item is expanded in the native control
virtual bool Reload (void) = 0; // clears the native control and reloads all data
virtual bool Remove (wxDataViewItem const& parent, wxDataViewItem const& item) = 0; // removes an item from the native control
virtual bool Remove (wxDataViewItem const& parent, wxDataViewItemArray const& item) = 0; // removes items from the native control
virtual bool Reload() = 0; // clears the native control and reloads all data
virtual bool Remove (wxDataViewItem const& parent) = 0; // removes one or more items under the given parent from the native control
virtual bool Update (wxDataViewColumn const* columnPtr) = 0; // updates the items in the passed column of the native control
virtual bool Update (wxDataViewItem const& parent, wxDataViewItem const& item) = 0; // updates the passed item in the native control
virtual bool Update (wxDataViewItem const& parent, wxDataViewItemArray const& items) = 0; // updates the passed items in the native control
@@ -91,26 +90,27 @@ public:
virtual int GetSelections(wxDataViewItemArray& sel) const = 0; // returns all selected items in the native control
virtual bool IsSelected (wxDataViewItem const& item) const = 0; // checks if the passed item is selected in the native control
virtual void Select (wxDataViewItem const& item) = 0; // selects the passed item in the native control
virtual void SelectAll (void) = 0; // selects all items in the native control
virtual void Select (wxDataViewItemArray const& items) = 0; // selects the passed items in the native control
virtual void SelectAll() = 0; // selects all items in the native control
virtual void Unselect (wxDataViewItem const& item) = 0; // unselects the passed item in the native control
virtual void UnselectAll (void) = 0; // unselects all items in the native control
virtual void UnselectAll() = 0; // unselects all items in the native control
//
// sorting related methods
//
virtual wxDataViewColumn* GetSortingColumn (void) const = 0; // returns the column that is primarily responsible for sorting in the native control
virtual void Resort (void) = 0; // asks the native control to start a resorting process
virtual wxDataViewColumn* GetSortingColumn() const = 0; // returns the column that is primarily responsible for sorting in the native control
virtual void Resort() = 0; // asks the native control to start a resorting process
//
// other methods
//
virtual void DoSetIndent (int indent) = 0; // sets the indention in the native control
virtual void DoExpand (wxDataViewItem const& item) = 0; // expands the passed item in the native control
virtual void DoSetIndent (int indent) = 0; // sets the indentation in the native control
virtual void DoExpand (wxDataViewItem const& item, bool expandChildren) = 0; // expands the passed item in the native control
virtual void HitTest (wxPoint const& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const = 0; // return the item and column pointer that contains with the passed point
virtual void SetRowHeight(int height) = 0; // sets the height of all rows
virtual void SetRowHeight(wxDataViewItem const& item, unsigned int height) = 0; // sets the height of the row containg the passed item in the native control
virtual void OnSize (void) = 0; // updates the layout of the native control after a size event
virtual void SetRowHeight(wxDataViewItem const& item, unsigned int height) = 0; // sets the height of the row containing the passed item in the native control
virtual void OnSize() = 0; // updates the layout of the native control after a size event
virtual void StartEditor( const wxDataViewItem & item, unsigned int column ) = 0; // starts editing the passed in item and column
};

View File

@@ -4,7 +4,7 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 2006-01-12
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@@ -25,25 +25,25 @@ public:
// sets the "should exit" flag and wakes up the loop so that it terminates
// soon
virtual void ScheduleExit(int rc = 0);
virtual void ScheduleExit(int rc = 0) wxOVERRIDE;
// return true if any events are available
virtual bool Pending() const;
virtual bool Pending() const wxOVERRIDE;
// dispatch a single event, return false if we should exit from the loop
virtual bool Dispatch();
virtual bool Dispatch() wxOVERRIDE;
// same as Dispatch() but doesn't wait for longer than the specified (in
// ms) timeout, return true if an event was processed, false if we should
// exit the loop or -1 if timeout expired
virtual int DispatchTimeout(unsigned long timeout);
virtual int DispatchTimeout(unsigned long timeout) wxOVERRIDE;
// implement this to wake up the loop: usually done by posting a dummy event
// to it (can be called from non main thread)
virtual void WakeUp();
virtual void WakeUp() wxOVERRIDE;
bool ShouldProcessIdleEvents() const { return m_processIdleEvents ; }
#if wxUSE_UIACTIONSIMULATOR
// notifies Yield and Dispatch to wait for at least one event before
// returning, this is necessary, because the synthesized events need to be
@@ -53,13 +53,13 @@ public:
protected:
// enters a loop calling OnNextIteration(), Pending() and Dispatch() and
// terminating when Exit() is called
virtual int DoRun();
virtual int DoRun() wxOVERRIDE;
// may be overridden to perform some action at the start of each new event
// loop iteration
virtual void OnNextIteration() {}
virtual void DoYieldFor(long eventsToProcess);
virtual void DoYieldFor(long eventsToProcess) wxOVERRIDE;
void CommonModeObserverCallBack(CFRunLoopObserverRef observer, int activity);
void DefaultModeObserverCallBack(CFRunLoopObserverRef observer, int activity);

View File

@@ -104,7 +104,7 @@ public:
static int GetCount();
bool Create(int nDev = 1);
void AddCookie(CFTypeRef Data, int i);
virtual void BuildCookies(CFArrayRef Array);
virtual void BuildCookies(CFArrayRef Array) wxOVERRIDE;
void DoBuildCookies(CFArrayRef Array);
};

View File

@@ -59,6 +59,13 @@ WXDLLIMPEXP_BASE long wxMacTranslateKey(unsigned char key, unsigned char code);
#endif
// NSString<->wxString
WXDLLIMPEXP_BASE wxString wxStringWithNSString(NSString *nsstring);
WXDLLIMPEXP_BASE NSString* wxNSStringWithWxString(const wxString &wxstring);
WXDLLIMPEXP_BASE CFURLRef wxOSXCreateURLFromFileSystemPath( const wxString& path);
#if wxUSE_GUI
#if wxOSX_USE_IPHONE
@@ -108,7 +115,7 @@ WXDLLIMPEXP_CORE CGDataProviderRef wxMacCGDataProviderCreateWithCFData( CFDataRe
WXDLLIMPEXP_CORE CGDataConsumerRef wxMacCGDataConsumerCreateWithCFData( CFMutableDataRef data );
WXDLLIMPEXP_CORE CGDataProviderRef wxMacCGDataProviderCreateWithMemoryBuffer( const wxMemoryBuffer& buf );
WXDLLIMPEXP_CORE CGColorSpaceRef wxMacGetGenericRGBColorSpace(void);
WXDLLIMPEXP_CORE CGColorSpaceRef wxMacGetGenericRGBColorSpace();
WXDLLIMPEXP_CORE double wxOSXGetMainScreenContentScaleFactor();
@@ -168,7 +175,7 @@ public :
const wxString& strHelp,
wxItemKind kind,
wxMenu *pSubMenu );
// handle OS specific menu items if they weren't handled during normal processing
virtual bool DoDefault() { return false; }
protected :
@@ -197,7 +204,7 @@ public :
wxMenu* GetWXPeer() { return m_peer ; }
virtual void PopUp( wxWindow *win, int x, int y ) = 0;
virtual void GetMenuBarDimensions(int &x, int &y, int &width, int &height) const
{
x = y = width = height = -1;
@@ -216,16 +223,32 @@ protected :
class WXDLLIMPEXP_CORE wxWidgetImpl : public wxObject
{
public :
wxWidgetImpl( wxWindowMac* peer , bool isRootControl = false, bool isUserPane = false );
enum WidgetFlags
{
Widget_IsRoot = 0x0001,
Widget_IsUserPane = 0x0002,
Widget_UserKeyEvents = 0x0004,
Widget_UserMouseEvents = 0x0008,
};
wxWidgetImpl( wxWindowMac* peer , bool isRootControl, bool isUserPane, bool wantsUserKey );
wxWidgetImpl( wxWindowMac* peer , int flags = 0 );
wxWidgetImpl();
virtual ~wxWidgetImpl();
void Init();
bool IsRootControl() const { return m_isRootControl; }
// is a custom control that has all events handled in wx code, no built-ins
bool IsUserPane() const { return m_isUserPane; }
// we are doing keyboard handling in wx code, other events might be handled natively
virtual bool HasUserKeyHandling() const { return m_wantsUserKey; }
// we are doing mouse handling in wx code, other events might be handled natively
virtual bool HasUserMouseHandling() const { return m_wantsUserMouse; }
wxWindowMac* GetWXPeer() const { return m_wxPeer; }
bool IsOk() const { return GetWXWidget() != NULL; }
@@ -264,7 +287,7 @@ public :
{
return 1.0;
}
// the native coordinates may have an 'aura' for shadows etc, if this is the case the layout
// inset indicates on which insets the real control is drawn
virtual void GetLayoutInset(int &left , int &top , int &right, int &bottom) const
@@ -278,12 +301,11 @@ public :
virtual void SetNeedsDisplay( const wxRect* where = NULL ) = 0;
virtual bool GetNeedsDisplay() const = 0;
virtual bool NeedsFocusRect() const;
virtual void SetNeedsFocusRect( bool needs );
virtual void EnableFocusRing(bool WXUNUSED(enabled)) {}
virtual bool NeedsFrame() const;
virtual void SetNeedsFrame( bool needs );
virtual void SetDrawingEnabled(bool enabled);
virtual bool CanFocus() const = 0;
@@ -306,7 +328,7 @@ public :
virtual void SetCursor( const wxCursor & cursor ) = 0;
virtual void CaptureMouse() = 0;
virtual void ReleaseMouse() = 0;
virtual void SetDropTarget( wxDropTarget * WXUNUSED(dropTarget) ) {}
virtual wxInt32 GetValue() const = 0;
@@ -326,7 +348,7 @@ public :
virtual void PulseGauge() = 0;
virtual void SetScrollThumb( wxInt32 value, wxInt32 thumbSize ) = 0;
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ) = 0;
virtual void SetFont(const wxFont & font) = 0;
virtual void SetToolTip(wxToolTip* WXUNUSED(tooltip)) { }
@@ -355,7 +377,7 @@ public :
// of a known control
static wxWidgetImpl*
FindBestFromWXWidget(WXWidget control);
static void RemoveAssociations( wxWidgetImpl* impl);
static void RemoveAssociation(WXWidget control);
@@ -572,8 +594,9 @@ public :
protected :
bool m_isRootControl;
bool m_isUserPane;
bool m_wantsUserKey;
bool m_wantsUserMouse;
wxWindowMac* m_wxPeer;
bool m_needsFocusRect;
bool m_needsFrame;
bool m_shouldSendEvents;
@@ -937,7 +960,7 @@ public :
virtual void ScreenToWindow( int *x, int *y ) = 0;
virtual void WindowToScreen( int *x, int *y ) = 0;
virtual bool IsActive() = 0;
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
@@ -995,6 +1018,83 @@ void wxMacCocoaRelease( void* obj );
void wxMacCocoaAutorelease( void* obj );
void* wxMacCocoaRetain( void* obj );
// shared_ptr like API for NSObject and subclasses
template <class T>
class wxNSObjRef
{
public:
typedef T element_type;
wxNSObjRef()
: m_ptr(NULL)
{
}
wxNSObjRef( T p )
: m_ptr(p)
{
}
wxNSObjRef( const wxNSObjRef& otherRef )
: m_ptr(wxMacCocoaRetain(otherRef.m_ptr))
{
}
wxNSObjRef& operator=( const wxNSObjRef& otherRef )
{
if (this != &otherRef)
{
wxMacCocoaRetain(otherRef.m_ptr);
wxMacCocoaRelease(m_ptr);
m_ptr = otherRef.m_ptr;
}
return *this;
}
wxNSObjRef& operator=( T ptr )
{
if (get() != ptr)
{
wxMacCocoaRetain(ptr);
wxMacCocoaRelease(m_ptr);
m_ptr = ptr;
}
return *this;
}
T get() const
{
return m_ptr;
}
operator T() const
{
return m_ptr;
}
T operator->() const
{
return m_ptr;
}
void reset( T p = NULL )
{
wxMacCocoaRelease(m_ptr);
m_ptr = p; // Automatic conversion should occur
}
// Release the pointer, i.e. give up its ownership.
T release()
{
T p = m_ptr;
m_ptr = NULL;
return p;
}
protected:
T m_ptr;
};
#endif
// _WX_PRIVATE_CORE_H_

View File

@@ -13,6 +13,7 @@
#include <CoreFoundation/CFString.h>
#include <CoreFoundation/CFStringEncodingExt.h>
#include "wx/fontmap.h"
// ============================================================================
// CoreFoundation conversion classes
@@ -289,41 +290,50 @@ inline CFStringEncoding wxCFStringEncFromFontEnc(wxFontEncoding encoding)
class wxMBConv_cf : public wxMBConv
{
public:
enum NormalizationForm
{
None = 0x00,
FromWChar_D = 0x01,
ToWChar_C = 0x02
};
wxMBConv_cf()
{
Init(CFStringGetSystemEncoding()) ;
Init(CFStringGetSystemEncoding(), ToWChar_C) ;
}
wxMBConv_cf(const wxMBConv_cf& conv) : wxMBConv()
{
m_encoding = conv.m_encoding;
m_normalization = conv.m_normalization;
}
#if wxUSE_FONTMAP
wxMBConv_cf(const char* name)
wxMBConv_cf(const char* name, NormalizationForm normalization = ToWChar_C)
{
Init( wxCFStringEncFromFontEnc(wxFontMapperBase::Get()->CharsetToEncoding(name, false) ) ) ;
Init( wxCFStringEncFromFontEnc(wxFontMapperBase::Get()->CharsetToEncoding(name, false) ) , normalization) ;
}
#endif
wxMBConv_cf(wxFontEncoding encoding)
wxMBConv_cf(wxFontEncoding encoding, NormalizationForm normalization = ToWChar_C )
{
Init( wxCFStringEncFromFontEnc(encoding) );
Init( wxCFStringEncFromFontEnc(encoding) , normalization);
}
virtual ~wxMBConv_cf()
{
}
void Init( CFStringEncoding encoding)
void Init( CFStringEncoding encoding, NormalizationForm normalization )
{
m_encoding = encoding ;
m_normalization = normalization;
}
virtual size_t ToWChar(wchar_t * dst, size_t dstSize, const char * src, size_t srcSize = wxNO_LEN) const;
virtual size_t FromWChar(char *dst, size_t dstSize, const wchar_t *src, size_t srcSize = wxNO_LEN) const;
virtual size_t ToWChar(wchar_t * dst, size_t dstSize, const char * src, size_t srcSize = wxNO_LEN) const wxOVERRIDE;
virtual size_t FromWChar(char *dst, size_t dstSize, const wchar_t *src, size_t srcSize = wxNO_LEN) const wxOVERRIDE;
virtual wxMBConv *Clone() const { return new wxMBConv_cf(*this); }
virtual wxMBConv *Clone() const wxOVERRIDE { return new wxMBConv_cf(*this); }
bool IsOk() const
{
@@ -332,6 +342,33 @@ public:
}
private:
NormalizationForm m_normalization ;
CFStringEncoding m_encoding ;
};
// This "decomposing" converter is used as wxConvFileName in wxOSX.
class wxMBConvD_cf : public wxMBConv_cf
{
public:
wxMBConvD_cf(wxFontEncoding encoding) : wxMBConv_cf(encoding, (NormalizationForm) (ToWChar_C | FromWChar_D) )
{
}
};
// corresponding class for holding UniChars (native unicode characters)
class WXDLLIMPEXP_BASE wxMacUniCharBuffer
{
public :
wxMacUniCharBuffer( const wxString &str ) ;
~wxMacUniCharBuffer() ;
UniCharPtr GetBuffer() ;
UniCharCount GetChars() ;
private :
UniCharPtr m_ubuf ;
UniCharCount m_chars ;
};

View File

@@ -20,10 +20,10 @@ public:
wxOSXTimerImpl(wxTimer *timer);
virtual ~wxOSXTimerImpl();
virtual bool Start(int milliseconds = -1, bool one_shot = false);
virtual void Stop();
virtual bool Start(int milliseconds = -1, bool one_shot = false) wxOVERRIDE;
virtual void Stop() wxOVERRIDE;
virtual bool IsRunning() const;
virtual bool IsRunning() const wxOVERRIDE;
private:
wxOSXTimerInfo *m_info;

View File

@@ -36,8 +36,8 @@ public:
WXHCURSOR GetHCURSOR() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
private:
void InitFromStock(wxStockCursor);
@@ -47,6 +47,4 @@ private:
wxDECLARE_DYNAMIC_CLASS(wxCursor);
};
extern WXDLLIMPEXP_CORE void wxSetCursor(const wxCursor& cursor);
#endif // _WX_CURSOR_H_

View File

@@ -11,10 +11,12 @@
#ifndef _WX_MAC_DATAFORM_H
#define _WX_MAC_DATAFORM_H
#include "wx/osx/core/cfstring.h"
class WXDLLIMPEXP_CORE wxDataFormat
{
public:
typedef unsigned long NativeFormat;
typedef CFStringRef NativeFormat;
wxDataFormat();
wxDataFormat(wxDataFormatId vType);
@@ -45,7 +47,7 @@ public:
operator NativeFormat() const { return m_format; }
void SetId(NativeFormat format);
// string ids are used for custom types - this SetId() must be used for
// application-specific formats
wxString GetId() const;
@@ -54,15 +56,24 @@ public:
// implementation
wxDataFormatId GetType() const { return m_type; }
void SetType( wxDataFormatId type );
static NativeFormat GetFormatForType(wxDataFormatId type);
// returns true if the format is one of those defined in wxDataFormatId
bool IsStandard() const { return m_type > 0 && m_type < wxDF_PRIVATE; }
// adds all the native formats for this format when calling a GetData
void AddSupportedTypesForGetting(CFMutableArrayRef types) const;
// adds all the native formats for this format when calling a SetData
void AddSupportedTypesForSetting(CFMutableArrayRef types) const;
private:
wxDataFormatId m_type;
NativeFormat m_format;
// indicates the type in case of wxDF_PRIVATE :
wxString m_id ;
void DoAddSupportedTypes(CFMutableArrayRef types, bool forSetting) const;
void ClearNativeFormat();
wxDataFormatId m_type;
wxString m_id;
wxCFStringRef m_format;
};
#endif // _WX_MAC_DATAFORM_H

View File

@@ -11,28 +11,29 @@
#ifndef _WX_MAC_DATAOBJ_H_
#define _WX_MAC_DATAOBJ_H_
// ----------------------------------------------------------------------------
// wxDataObject is the same as wxDataObjectBase under wxGTK
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxOSXDataSink;
class WXDLLIMPEXP_CORE wxOSXDataSource;
class WXDLLIMPEXP_CORE wxDataObject : public wxDataObjectBase
{
public:
wxDataObject();
#ifdef __DARWIN__
virtual ~wxDataObject() { }
#endif
virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const;
void AddToPasteboard( void * pasteboardRef , wxIntPtr itemID );
// returns true if the passed in format is present in the pasteboard
static bool IsFormatInPasteboard( void * pasteboardRef, const wxDataFormat &dataFormat );
// returns true if any of the accepted formats of this dataobj is in the pasteboard
bool HasDataInPasteboard( void * pasteboardRef );
bool GetFromPasteboard( void * pasteboardRef );
void WriteToSink(wxOSXDataSink *sink) const;
bool ReadFromSource(wxOSXDataSource *source);
bool ReadFromSource(wxDataObject *source);
bool CanReadFromSource(wxOSXDataSource *source) const;
bool CanReadFromSource(wxDataObject *source) const;
wxDataFormat GetSupportedFormatInSource(wxOSXDataSource *source) const;
wxDataFormat GetSupportedFormatInSource(wxDataObject *source) const;
#if wxOSX_USE_COCOA
virtual void AddSupportedTypes( void* cfarray);
// adds all the native formats (in descending order of preference) this data object supports
virtual void AddSupportedTypes( CFMutableArrayRef cfarray, Direction dir ) const;
#endif
};

View File

@@ -26,24 +26,24 @@ public:
virtual ~wxBitmapDataObject();
// override base class virtual to update PNG data too
virtual void SetBitmap(const wxBitmap& bitmap);
virtual void SetBitmap(const wxBitmap& bitmap) wxOVERRIDE;
// implement base class pure virtuals
// ----------------------------------
virtual size_t GetDataSize() const ;
virtual bool GetDataHere(void *buf) const ;
virtual bool SetData(size_t len, const void *buf);
virtual size_t GetDataSize() const wxOVERRIDE;
virtual bool GetDataHere(void *buf) const wxOVERRIDE;
virtual bool SetData(size_t len, const void *buf) wxOVERRIDE;
// Must provide overloads to avoid hiding them (and warnings about it)
virtual size_t GetDataSize(const wxDataFormat&) const
virtual size_t GetDataSize(const wxDataFormat&) const wxOVERRIDE
{
return GetDataSize();
}
virtual bool GetDataHere(const wxDataFormat&, void *buf) const
virtual bool GetDataHere(const wxDataFormat&, void *buf) const wxOVERRIDE
{
return GetDataHere(buf);
}
virtual bool SetData(const wxDataFormat&, size_t len, const void *buf)
virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) wxOVERRIDE
{
return SetData(len, buf);
}
@@ -52,8 +52,7 @@ protected :
void Init() ;
void Clear() ;
void* m_pictHandle ;
bool m_pictCreated ;
CFDataRef m_pictData ;
};
// ----------------------------------------------------------------------------
@@ -68,19 +67,19 @@ public:
void AddFile( const wxString &filename );
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t len, const void *buf);
virtual size_t GetDataSize() const wxOVERRIDE;
virtual bool GetDataHere(void *buf) const wxOVERRIDE;
virtual bool SetData(size_t len, const void *buf) wxOVERRIDE;
// Must provide overloads to avoid hiding them (and warnings about it)
virtual size_t GetDataSize(const wxDataFormat&) const
virtual size_t GetDataSize(const wxDataFormat&) const wxOVERRIDE
{
return GetDataSize();
}
virtual bool GetDataHere(const wxDataFormat&, void *buf) const
virtual bool GetDataHere(const wxDataFormat&, void *buf) const wxOVERRIDE
{
return GetDataHere(buf);
}
virtual bool SetData(const wxDataFormat&, size_t len, const void *buf)
virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) wxOVERRIDE
{
return SetData(len, buf);
}

View File

@@ -42,29 +42,29 @@ public:
virtual ~wxDataViewColumn();
// implement wxHeaderColumnBase pure virtual methods
virtual wxAlignment GetAlignment() const { return m_alignment; }
virtual int GetFlags() const { return m_flags; }
virtual wxAlignment GetAlignment() const wxOVERRIDE { return m_alignment; }
virtual int GetFlags() const wxOVERRIDE { return m_flags; }
virtual int GetMaxWidth() const { return m_maxWidth; }
virtual int GetMinWidth() const { return m_minWidth; }
virtual wxString GetTitle() const { return m_title; }
virtual int GetWidth() const;
virtual bool IsSortOrderAscending() const { return m_ascending; }
virtual bool IsSortKey() const;
virtual bool IsHidden() const;
virtual int GetMinWidth() const wxOVERRIDE { return m_minWidth; }
virtual wxString GetTitle() const wxOVERRIDE { return m_title; }
virtual int GetWidth() const wxOVERRIDE;
virtual bool IsSortOrderAscending() const wxOVERRIDE { return m_ascending; }
virtual bool IsSortKey() const wxOVERRIDE;
virtual bool IsHidden() const wxOVERRIDE;
virtual void SetAlignment (wxAlignment align);
virtual void SetBitmap (wxBitmap const& bitmap);
virtual void SetFlags (int flags) { m_flags = flags; /*SetIndividualFlags(flags); */ }
virtual void SetHidden (bool hidden);
virtual void SetAlignment (wxAlignment align) wxOVERRIDE;
virtual void SetBitmap (wxBitmap const& bitmap) wxOVERRIDE;
virtual void SetFlags (int flags) wxOVERRIDE { m_flags = flags; /*SetIndividualFlags(flags); */ }
virtual void SetHidden (bool hidden) wxOVERRIDE;
virtual void SetMaxWidth (int maxWidth);
virtual void SetMinWidth (int minWidth);
virtual void SetReorderable(bool reorderable);
virtual void SetResizeable (bool resizable);
virtual void UnsetAsSortKey();
virtual void SetSortable (bool sortable);
virtual void SetSortOrder (bool ascending);
virtual void SetTitle (wxString const& title);
virtual void SetWidth (int width);
virtual void SetMinWidth (int minWidth) wxOVERRIDE;
virtual void SetReorderable(bool reorderable) wxOVERRIDE;
virtual void SetResizeable (bool resizable) wxOVERRIDE;
virtual void UnsetAsSortKey() wxOVERRIDE;
virtual void SetSortable (bool sortable) wxOVERRIDE;
virtual void SetSortOrder (bool ascending) wxOVERRIDE;
virtual void SetTitle (wxString const& title) wxOVERRIDE;
virtual void SetWidth (int width) wxOVERRIDE;
// implementation only
wxDataViewColumnNativeData* GetNativeData() const
@@ -134,7 +134,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr )
const wxString& name = wxASCII_STR(wxDataViewCtrlNameStr) )
{
Init();
Create(parent, winid, pos, size, style, validator, name);
@@ -148,7 +148,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr);
const wxString& name = wxASCII_STR(wxDataViewCtrlNameStr));
virtual wxWindow* GetMainWindow() // not used for the native implementation
{
@@ -205,7 +205,7 @@ public:
// finishes editing of custom items; if no custom item is currently edited the method does nothing
void FinishCustomItemEditing();
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column) wxOVERRIDE;
// returns the n-th pointer to a column;
@@ -276,7 +276,7 @@ protected:
virtual void DoSetExpanderColumn() wxOVERRIDE;
virtual void DoSetIndent() wxOVERRIDE;
virtual void DoExpand(const wxDataViewItem& item) wxOVERRIDE;
virtual void DoExpand(const wxDataViewItem& item, bool expandChildren) wxOVERRIDE;
virtual wxSize DoGetBestSize() const wxOVERRIDE;
@@ -306,7 +306,7 @@ private:
wxDataViewColumnPtrArrayType m_ColumnPtrs; // all column pointers are stored in an array
wxDataViewModelNotifier* m_ModelNotifier; // stores the model notifier for the control (does not own the notifier)
class wxOSXDataViewModelNotifier* m_ModelNotifier; // stores the model notifier for the control (does not own the notifier)
// wxWidget internal stuff:
wxDECLARE_DYNAMIC_CLASS(wxDataViewCtrl);

View File

@@ -42,10 +42,10 @@ public:
const wxString& name = wxDatePickerCtrlNameStr);
// Implement the base class pure virtuals.
virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2);
virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const;
virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2) wxOVERRIDE;
virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const wxOVERRIDE;
virtual void OSXGenerateEvent(const wxDateTime& dt);
virtual void OSXGenerateEvent(const wxDateTime& dt) wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDatePickerCtrl);

View File

@@ -20,8 +20,8 @@ class WXDLLIMPEXP_ADV wxDateTimePickerCtrl : public wxDateTimePickerCtrlBase
{
public:
// Implement the base class pure virtuals.
virtual void SetValue(const wxDateTime& dt);
virtual wxDateTime GetValue() const;
virtual void SetValue(const wxDateTime& dt) wxOVERRIDE;
virtual wxDateTime GetValue() const wxOVERRIDE;
// Implementation only.
virtual void OSXGenerateEvent(const wxDateTime& dt) = 0;

View File

@@ -28,8 +28,8 @@ public:
wxWindowDCImpl( wxDC *owner, wxWindow *window );
virtual ~wxWindowDCImpl();
virtual void DoGetSize( int *width, int *height ) const;
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const;
virtual void DoGetSize( int *width, int *height ) const wxOVERRIDE;
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const wxOVERRIDE;
protected:
bool m_release;

View File

@@ -22,14 +22,14 @@ public:
virtual ~wxMemoryDCImpl();
virtual void DoGetSize( int *width, int *height ) const;
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
virtual void DoGetSize( int *width, int *height ) const wxOVERRIDE;
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const wxOVERRIDE
{ return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect); }
virtual void DoSelect(const wxBitmap& bitmap);
virtual void DoSelect(const wxBitmap& bitmap) wxOVERRIDE;
virtual const wxBitmap& GetSelectedBitmap() const
virtual const wxBitmap& GetSelectedBitmap() const wxOVERRIDE
{ return m_selected; }
virtual wxBitmap& GetSelectedBitmap()
virtual wxBitmap& GetSelectedBitmap() wxOVERRIDE
{ return m_selected; }
private:

View File

@@ -25,18 +25,18 @@ public:
wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& printdata );
virtual ~wxPrinterDCImpl();
virtual bool StartDoc( const wxString& WXUNUSED(message) ) ;
virtual void EndDoc(void) ;
virtual void StartPage(void) ;
virtual void EndPage(void) ;
virtual bool StartDoc( const wxString& WXUNUSED(message) ) wxOVERRIDE;
virtual void EndDoc() wxOVERRIDE;
virtual void StartPage() wxOVERRIDE;
virtual void EndPage() wxOVERRIDE;
wxRect GetPaperRect() const;
wxRect GetPaperRect() const wxOVERRIDE;
wxPrintData& GetPrintData() { return m_printData; }
virtual wxSize GetPPI() const;
virtual wxSize GetPPI() const wxOVERRIDE;
protected:
virtual void DoGetSize( int *width, int *height ) const;
virtual void DoGetSize( int *width, int *height ) const wxOVERRIDE;
wxPrintData m_printData ;
wxNativePrinterDC* m_nativePrinterDC ;

View File

@@ -20,9 +20,7 @@ public:
wxScreenDCImpl( wxDC *owner );
virtual ~wxScreenDCImpl();
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const;
private:
void* m_overlayWindow;
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const wxOVERRIDE;
private:
wxDECLARE_CLASS(wxScreenDCImpl);

View File

@@ -30,7 +30,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr)
const wxString& name = wxASCII_STR(wxDialogNameStr))
{
Init();
Create(parent, id, title, pos, size, style, name);
@@ -41,28 +41,28 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr);
const wxString& name = wxASCII_STR(wxDialogNameStr));
virtual ~wxDialog();
// virtual bool Destroy();
virtual bool Show(bool show = true);
virtual bool Show(bool show = true) wxOVERRIDE;
// return true if we're showing the dialog modally
virtual bool IsModal() const;
virtual bool IsModal() const wxOVERRIDE;
// show the dialog modally and return the value passed to EndModal()
virtual int ShowModal();
virtual int ShowModal() wxOVERRIDE;
virtual void ShowWindowModal();
virtual void ShowWindowModal() wxOVERRIDE;
// may be called to terminate the dialog with the given return code
virtual void EndModal(int retCode);
virtual void EndModal(int retCode) wxOVERRIDE;
static bool OSXHasModalDialogsOpen();
void OSXBeginModalDialog();
void OSXEndModalDialog();
#if wxOSX_USE_COCOA
bool OSXGetWorksWhenModal();
void OSXSetWorksWhenModal(bool worksWhenModal);
@@ -71,7 +71,7 @@ public:
// implementation
// --------------
wxDialogModality GetModality() const;
wxDialogModality GetModality() const wxOVERRIDE;
#if wxOSX_USE_COCOA
virtual void ModalFinishedCallback(void* WXUNUSED(panel), int WXUNUSED(returnCode)) {}
@@ -85,7 +85,7 @@ protected:
void EndWindowModal();
// mac also takes command-period as cancel
virtual bool IsEscapeKey(const wxKeyEvent& event);
virtual bool IsEscapeKey(const wxKeyEvent& event) wxOVERRIDE;
wxDialogModality m_modality;
@@ -94,7 +94,7 @@ protected:
private:
void Init();
static wxVector<wxDialog*> s_modalStack;
#if wxOSX_USE_COCOA
static wxVector<bool> s_modalWorksStack;

View File

@@ -21,12 +21,12 @@ public:
wxDirDialog() { Init(); }
wxDirDialog(wxWindow *parent,
const wxString& message = wxDirSelectorPromptStr,
const wxString& message = wxASCII_STR(wxDirSelectorPromptStr),
const wxString& defaultPath = wxT(""),
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxDirDialogNameStr)
const wxString& name = wxASCII_STR(wxDirDialogNameStr))
{
Init();
@@ -34,22 +34,26 @@ public:
}
void Create(wxWindow *parent,
const wxString& message = wxDirSelectorPromptStr,
const wxString& message = wxASCII_STR(wxDirSelectorPromptStr),
const wxString& defaultPath = wxT(""),
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxDirDialogNameStr);
const wxString& name = wxASCII_STR(wxDirDialogNameStr));
#if wxOSX_USE_COCOA
~wxDirDialog();
#endif
virtual int ShowModal();
virtual int ShowModal() wxOVERRIDE;
// MacOS 10.11 has removed the titlebar from the dialog, so this is provided
// only for compatibility with older versions
virtual void SetTitle(const wxString& title) wxOVERRIDE;
#if wxOSX_USE_COCOA
virtual void ShowWindowModal();
virtual void ModalFinishedCallback(void* panel, int returnCode);
virtual void ShowWindowModal() wxOVERRIDE;
virtual void ModalFinishedCallback(void* panel, int returnCode) wxOVERRIDE;
#endif
private:
@@ -57,13 +61,13 @@ private:
// Create and initialize NSOpenPanel that we use in both ShowModal() and
// ShowWindowModal().
WX_NSOpenPanel OSXCreatePanel() const;
WX_NSObject m_sheetDelegate;
#endif
// Common part of all ctors.
void Init();
wxString m_title;
wxDECLARE_DYNAMIC_CLASS(wxDirDialog);
};

View File

@@ -30,6 +30,8 @@ class WXDLLIMPEXP_FWD_CORE wxFileDropTarget;
class WXDLLIMPEXP_FWD_CORE wxDropSource;
class WXDLLIMPEXP_FWD_CORE wxOSXDataSource;
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
@@ -50,17 +52,18 @@ class WXDLLIMPEXP_CORE wxDropTarget: public wxDropTargetBase
wxDropTarget(wxDataObject *dataObject = NULL );
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
virtual bool OnDrop(wxCoord x, wxCoord y);
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
virtual bool GetData();
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def) wxOVERRIDE;
virtual bool OnDrop(wxCoord x, wxCoord y) wxOVERRIDE;
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) wxOVERRIDE;
virtual bool GetData() wxOVERRIDE;
// NOTE: This is needed by the generic wxDataViewCtrl, not sure how to implement.
virtual wxDataFormat GetMatchingPair();
bool CurrentDragHasSupportedFormat() ;
void SetCurrentDragPasteboard( void* dragpasteboard ) { m_currentDragPasteboard = dragpasteboard ; }
void SetCurrentDragSource( wxOSXDataSource* dragpasteboard ) { m_currentDragPasteboard = dragpasteboard ; }
protected :
void* m_currentDragPasteboard ;
wxOSXDataSource* m_currentDragPasteboard ;
};
//-------------------------------------------------------------------------
@@ -90,7 +93,7 @@ public:
// do it (call this in response to a mouse button press, for example)
// params: if bAllowMove is false, data can be only copied
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly) wxOVERRIDE;
wxWindow* GetWindow() { return m_window ; }
void SetCurrentDragPasteboard( void* dragpasteboard ) { m_currentDragPasteboard = dragpasteboard ; }

View File

@@ -29,9 +29,9 @@ public:
// implementation only
// -------------------
virtual bool MacRender();
virtual bool MacRender() wxOVERRIDE;
virtual wxDC* GetDC(); // creates a device context and keeps it
virtual wxDC* GetDC() wxOVERRIDE; // creates a device context and keeps it
void SetDC(wxDC* newDCPtr); // this method takes ownership of the pointer
private:
@@ -82,11 +82,11 @@ public:
void EnableMarkup(bool enable = true);
#endif // wxUSE_MARKUP && Cocoa
virtual bool MacRender();
virtual bool MacRender() wxOVERRIDE;
virtual void OSXOnCellChanged(NSObject *value,
const wxDataViewItem& item,
unsigned col);
unsigned col) wxOVERRIDE;
private:
#if wxUSE_MARKUP && wxOSX_USE_COCOA
@@ -110,7 +110,7 @@ public:
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT);
virtual bool MacRender();
virtual bool MacRender() wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer);
@@ -128,14 +128,14 @@ public:
wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE,
int alignment = wxDVR_DEFAULT_ALIGNMENT );
virtual bool MacRender();
virtual bool MacRender() wxOVERRIDE;
wxString GetChoice(size_t index) const { return m_choices[index]; }
const wxArrayString& GetChoices() const { return m_choices; }
virtual void OSXOnCellChanged(NSObject *value,
const wxDataViewItem& item,
unsigned col);
unsigned col) wxOVERRIDE;
private:
wxArrayString m_choices;
@@ -174,16 +174,50 @@ public:
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT);
virtual bool MacRender();
virtual bool MacRender() wxOVERRIDE;
virtual void OSXOnCellChanged(NSObject *value,
const wxDataViewItem& item,
unsigned col);
unsigned col) wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer);
};
// ---------------------------------------------------------
// wxDataViewIconTextRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewCheckIconTextRenderer
: public wxDataViewRenderer
{
public:
static wxString GetDefaultType() { return wxS("wxDataViewCheckIconText"); }
explicit wxDataViewCheckIconTextRenderer
(
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
int align = wxDVR_DEFAULT_ALIGNMENT
);
// This renderer can always display the 3rd ("indeterminate") checkbox
// state if the model contains cells with wxCHK_UNDETERMINED value, but it
// doesn't allow the user to set it by default. Call this method to allow
// this to happen.
void Allow3rdStateForUser(bool allow = true);
virtual bool MacRender() wxOVERRIDE;
virtual void OSXOnCellChanged(NSObject *value,
const wxDataViewItem& item,
unsigned col) wxOVERRIDE;
private:
bool m_allow3rdStateForUser;
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCheckIconTextRenderer);
};
// ---------------------------------------------------------
// wxDataViewToggleRenderer
// ---------------------------------------------------------
@@ -200,11 +234,11 @@ public:
void ShowAsRadio();
virtual bool MacRender();
virtual bool MacRender() wxOVERRIDE;
virtual void OSXOnCellChanged(NSObject *value,
const wxDataViewItem& item,
unsigned col);
unsigned col) wxOVERRIDE;
private:
void DoInitButtonCell(int buttonType);
@@ -226,11 +260,11 @@ public:
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT);
virtual bool MacRender();
virtual bool MacRender() wxOVERRIDE;
virtual void OSXOnCellChanged(NSObject *value,
const wxDataViewItem& item,
unsigned col);
unsigned col) wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer);
@@ -249,11 +283,11 @@ public:
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
int align = wxDVR_DEFAULT_ALIGNMENT);
virtual bool MacRender();
virtual bool MacRender() wxOVERRIDE;
virtual void OSXOnCellChanged(NSObject *value,
const wxDataViewItem& item,
unsigned col);
unsigned col) wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer);

View File

@@ -6,7 +6,7 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 2006-01-12
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@@ -23,14 +23,14 @@ class WXDLLIMPEXP_CORE wxModalEventLoop : public wxGUIEventLoop
public:
wxModalEventLoop(wxWindow *modalWindow);
wxModalEventLoop(WXWindow modalNativeWindow);
#ifdef __WXOSX_COCOA__
// skip wxGUIEventLoop to avoid missing Enter/Exit notifications
virtual int Run() { return wxCFEventLoop::Run(); }
virtual int Run() wxOVERRIDE { return wxCFEventLoop::Run(); }
#endif
protected:
virtual void OSXDoRun();
virtual void OSXDoStop();
virtual void OSXDoRun() wxOVERRIDE;
virtual void OSXDoStop() wxOVERRIDE;
// (in case) the modal window for this event loop
wxNonOwnedWindow* m_modalWindow;

View File

@@ -17,7 +17,7 @@ class WXDLLIMPEXP_FWD_CORE wxChoice;
// wxFileDialog
//-------------------------------------------------------------------------
// set this system option to 1 in order to always show the filetypes popup in
// set this system option to 1 in order to always show the filetypes popup in
// file open dialogs if possible
#define wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES wxT("osx.openfiledialog.always-show-types")
@@ -32,14 +32,14 @@ protected:
public:
wxFileDialog() { Init(); }
wxFileDialog(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& message = wxASCII_STR(wxFileSelectorPromptStr),
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr)
const wxString& name = wxASCII_STR(wxFileDialogNameStr))
{
Init();
@@ -47,50 +47,46 @@ public:
}
void Create(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& message = wxASCII_STR(wxFileSelectorPromptStr),
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr);
const wxString& name = wxASCII_STR(wxFileDialogNameStr));
#if wxOSX_USE_COCOA
~wxFileDialog();
#endif
virtual void GetPaths(wxArrayString& paths) const { paths = m_paths; }
virtual void GetFilenames(wxArrayString& files) const { files = m_fileNames ; }
virtual int ShowModal();
virtual void GetPaths(wxArrayString& paths) const wxOVERRIDE { paths = m_paths; }
virtual void GetFilenames(wxArrayString& files) const wxOVERRIDE { files = m_fileNames ; }
virtual int ShowModal() wxOVERRIDE;
#if wxOSX_USE_COCOA
virtual void ShowWindowModal();
virtual void ModalFinishedCallback(void* panel, int resultCode);
virtual void ShowWindowModal() wxOVERRIDE;
virtual void ModalFinishedCallback(void* panel, int resultCode) wxOVERRIDE;
#endif
virtual bool SupportsExtraControl() const;
virtual bool SupportsExtraControl() const wxOVERRIDE;
// implementation only
#if wxOSX_USE_COCOA
// returns true if the file can be shown as active
bool CheckFile( const wxString& filename );
#endif
protected:
// not supported for file dialog, RR
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(width), int WXUNUSED(height),
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) wxOVERRIDE {}
void SetupExtraControls(WXWindow nativeWindow);
#if wxOSX_USE_COCOA
virtual wxWindow* CreateFilterPanel(wxWindow *extracontrol);
void DoOnFilterSelected(int index);
virtual void OnFilterSelected(wxCommandEvent &event);
int GetMatchingFilterExtension(const wxString& filename);
wxArrayString m_filterExtensions;
wxArrayString m_filterNames;
@@ -99,8 +95,6 @@ protected:
bool m_useFileTypeFilter;
int m_firstFileTypeFilter;
wxArrayString m_currentExtensions;
WX_NSObject m_delegate;
WX_NSObject m_sheetDelegate;
#endif
private:

View File

@@ -26,7 +26,8 @@ enum wxOSXSystemFont
wxOSX_SYSTEM_FONT_MINI,
wxOSX_SYSTEM_FONT_MINI_BOLD,
wxOSX_SYSTEM_FONT_LABELS,
wxOSX_SYSTEM_FONT_VIEWS
wxOSX_SYSTEM_FONT_VIEWS,
wxOSX_SYSTEM_FONT_FIXED
};
@@ -88,7 +89,7 @@ public:
virtual ~wxFont();
// implement base class pure virtuals
virtual float GetFractionalPointSize() const wxOVERRIDE;
virtual double GetFractionalPointSize() const wxOVERRIDE;
virtual wxSize GetPixelSize() const wxOVERRIDE;
virtual wxFontStyle GetStyle() const wxOVERRIDE;
virtual int GetNumericWeight() const wxOVERRIDE;
@@ -100,7 +101,7 @@ public:
virtual bool IsFixedWidth() const wxOVERRIDE;
virtual void SetFractionalPointSize(float pointSize) wxOVERRIDE;
virtual void SetFractionalPointSize(double pointSize) wxOVERRIDE;
virtual void SetFamily(wxFontFamily family) wxOVERRIDE;
virtual void SetStyle(wxFontStyle style) wxOVERRIDE;
virtual void SetNumericWeight(int weight) wxOVERRIDE;

View File

@@ -41,7 +41,7 @@ public:
bool Create(wxWindow *parent);
bool Create(wxWindow *parent, const wxFontData& data);
int ShowModal();
int ShowModal() wxOVERRIDE;
wxFontData& GetFontData() { return m_fontData; }
protected:

View File

@@ -28,7 +28,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr)
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Create(parent, id, title, pos, size, style, name);
}
@@ -39,7 +39,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
const wxString& name = wxASCII_STR(wxFrameNameStr));
// implementation only from now on
// -------------------------------
@@ -60,7 +60,7 @@ public:
#if wxUSE_TOOLBAR
virtual wxToolBar* CreateToolBar(long style = -1,
wxWindowID id = -1,
const wxString& name = wxToolBarNameStr) wxOVERRIDE;
const wxString& name = wxASCII_STR(wxToolBarNameStr)) wxOVERRIDE;
virtual void SetToolBar(wxToolBar *toolbar) wxOVERRIDE;
#endif // wxUSE_TOOLBAR
@@ -70,7 +70,7 @@ public:
virtual wxStatusBar* OnCreateStatusBar(int number = 1,
long style = wxSTB_DEFAULT_STYLE,
wxWindowID id = 0,
const wxString& name = wxStatusLineNameStr) wxOVERRIDE;
const wxString& name = wxASCII_STR(wxStatusLineNameStr)) wxOVERRIDE;
#endif // wxUSE_STATUSBAR
void PositionBars();
@@ -90,7 +90,7 @@ protected:
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE;
virtual void DoSetClientSize(int width, int height) wxOVERRIDE;
#if wxUSE_MENUS
#if wxUSE_MENUBAR
virtual void DetachMenuBar() wxOVERRIDE;
virtual void AttachMenuBar(wxMenuBar *menubar) wxOVERRIDE;
#endif

View File

@@ -15,11 +15,8 @@
#if wxUSE_FSWATCHER
#include <CoreServices/CoreServices.h>
#include "wx/unix/fswatcher_kqueue.h"
WX_DECLARE_STRING_HASH_MAP(FSEventStreamRef, FSEventStreamRefMap);
/*
The FSEvents watcher uses the newer FSEvents service
that is available in OS X, the service allows for
@@ -78,8 +75,10 @@ public:
private:
// map of path => FSEventStreamRef
FSEventStreamRefMap m_streams;
// use the pImpl idiom to eliminate this header's dependency
// on CoreServices.h (and ultimately AssertMacros.h)
struct PrivateData;
PrivateData *m_pImpl;
};

View File

@@ -25,7 +25,7 @@ class WXDLLIMPEXP_CORE wxGauge: public wxGaugeBase
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr)
const wxString& name = wxASCII_STR(wxGaugeNameStr))
{
Create(parent, id, range, pos, size, style, validator, name);
}
@@ -36,14 +36,14 @@ class WXDLLIMPEXP_CORE wxGauge: public wxGaugeBase
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr);
const wxString& name = wxASCII_STR(wxGaugeNameStr));
// set gauge range/value
virtual void SetRange(int range);
virtual void SetValue(int pos);
virtual int GetValue() const ;
virtual void SetRange(int range) wxOVERRIDE;
virtual void SetValue(int pos) wxOVERRIDE;
virtual int GetValue() const wxOVERRIDE;
void Pulse();
void Pulse() wxOVERRIDE;
protected:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxGauge);

View File

@@ -16,6 +16,9 @@
#import <OpenGLES/ES1/glext.h>
#define wxUSE_OPENGL_EMULATION 1
#else
#ifndef GL_SILENCE_DEPRECATION
#define GL_SILENCE_DEPRECATION
#endif
#include <OpenGL/gl.h>
#endif
@@ -43,7 +46,7 @@ public:
const wxGLContextAttrs *ctxAttrs = NULL);
virtual ~wxGLContext();
virtual bool SetCurrent(const wxGLCanvas& win) const;
virtual bool SetCurrent(const wxGLCanvas& win) const wxOVERRIDE;
// Mac-specific
WXGLContext GetWXGLContext() const { return m_glContext; }
@@ -98,7 +101,6 @@ public:
// implement wxGLCanvasBase methods
virtual bool SwapBuffers() wxOVERRIDE;
// Mac-specific functions
// ----------------------

View File

@@ -213,6 +213,7 @@
#undef wxUSE_FINDREPLDLG
#undef wxUSE_TASKBARICON
#undef wxUSE_REARRANGECTRL
#undef wxUSE_NATIVE_DATAVIEWCTRL
#define wxUSE_LOGWINDOW 0
#define wxUSE_LOG_DIALOG 0
@@ -235,6 +236,7 @@
#define wxUSE_FINDREPLDLG 0
#define wxUSE_TASKBARICON 0
#define wxUSE_REARRANGECTRL 0
#define wxUSE_NATIVE_DATAVIEWCTRL 0
#if wxUSE_WXHTML_HELP
#undef wxUSE_WXHTML_HELP
@@ -253,7 +255,12 @@
#if wxUSE_MENUS
#undef wxUSE_MENUS
#define wxUSE_MENUS 0
#define wxUSE_MENUS 1
#endif
#if wxUSE_MENUBAR
#undef wxUSE_MENUBAR
#define wxUSE_MENUBAR 0
#endif
/*

View File

@@ -37,7 +37,7 @@ wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxSt
class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl
{
public :
wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false, bool isUserPane = false ) ;
wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, int flags = 0 ) ;
wxWidgetIPhoneImpl() ;
~wxWidgetIPhoneImpl();
@@ -63,7 +63,7 @@ public :
virtual void GetSize( int &width, int &height ) const;
virtual void SetControlSize( wxWindowVariant variant );
virtual double GetContentScaleFactor() const ;
virtual void SetNeedsDisplay( const wxRect* where = NULL );
virtual bool GetNeedsDisplay() const;
@@ -102,7 +102,7 @@ public :
void PulseGauge();
void SetScrollThumb( wxInt32 value, wxInt32 thumbSize );
void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
void SetFont(const wxFont & font);
void InstallEventHandler( WXWidget control = NULL );
bool EnableTouchEvents(int WXUNUSED(eventsMask)) { return false; }
@@ -176,7 +176,7 @@ public :
virtual bool IsFullScreen() const;
virtual bool EnableFullScreenView(bool enable);
virtual bool ShowFullScreen(bool show, long style);
virtual void RequestUserAttention(int flags);

View File

@@ -34,10 +34,10 @@ public :
virtual void WriteText(const wxString& str) ;
virtual bool HasOwnContextMenu() const { return true; }
virtual wxSize GetBestSize() const;
virtual wxSize GetBestSize() const;
virtual bool SetHint(const wxString& hint);
virtual void controlAction(WXWidget slf, void* _cmd, void *sender);
protected :
UITextField* m_textField;
@@ -62,7 +62,7 @@ public:
virtual void GetSelection( long* from, long* to) const ;
virtual void SetSelection( long from , long to );
virtual void WriteText(const wxString& str) ;
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
virtual void SetFont(const wxFont & font);
virtual bool GetStyle(long position, wxTextAttr& style);
virtual void SetStyle(long start, long end, const wxTextAttr& style);

View File

@@ -49,7 +49,7 @@ public:
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
const wxString& name = wxASCII_STR(wxListBoxNameStr))
{
Create(parent, winid, pos, size, n, choices, style, validator, name);
}
@@ -62,7 +62,7 @@ public:
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
const wxString& name = wxASCII_STR(wxListBoxNameStr))
{
Create(parent, winid, pos, size, choices, style, validator, name);
}
@@ -76,7 +76,7 @@ public:
const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
const wxString& name = wxASCII_STR(wxListBoxNameStr));
bool Create(
wxWindow *parent,
@@ -86,13 +86,11 @@ public:
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
const wxString& name = wxASCII_STR(wxListBoxNameStr));
virtual ~wxListBox();
// implement base class pure virtuals
virtual void Refresh(bool eraseBack = true, const wxRect *rect = NULL) wxOVERRIDE;
virtual unsigned int GetCount() const wxOVERRIDE;
virtual wxString GetString(unsigned int n) const wxOVERRIDE;
virtual void SetString(unsigned int n, const wxString& s) wxOVERRIDE;
@@ -172,6 +170,8 @@ protected:
wxArrayPtrVoid m_itemsClientData;
private:
// Mostly the same as DoSetSelection() but doesn't call EnsureVisible().
void DoSetSelectionWithoutEnsureVisible(int n, bool select);
wxDECLARE_DYNAMIC_CLASS(wxListBox);
wxDECLARE_EVENT_TABLE();

View File

@@ -1,398 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/osx/listctrl.h
// Purpose: wxListCtrl class
// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LISTCTRL_H_
#define _WX_LISTCTRL_H_
#include "wx/defs.h"
#include "wx/generic/listctrl.h"
#define wxMAC_ALWAYS_USE_GENERIC_LISTCTRL wxT("mac.listctrl.always_use_generic")
class wxMacDataBrowserListCtrlControl;
class wxListCtrlTextCtrlWrapper;
class wxListCtrlRenameTimer;
WX_DECLARE_EXPORTED_LIST(wxListItem, wxColumnList);
class WXDLLIMPEXP_CORE wxListCtrl: public wxListCtrlBase
{
wxDECLARE_DYNAMIC_CLASS(wxListCtrl);
public:
/*
* Public interface
*/
wxListCtrl() { Init(); }
wxListCtrl(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListCtrlNameStr)
{
Init();
Create(parent, id, pos, size, style, validator, name);
}
virtual ~wxListCtrl();
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListCtrlNameStr);
// Attributes
////////////////////////////////////////////////////////////////////////////
// Gets information about this column
bool GetColumn(int col, wxListItem& item) const;
// Sets information about this column
bool SetColumn(int col, const wxListItem& item) ;
// Gets the column width
int GetColumnWidth(int col) const;
// Sets the column width
bool SetColumnWidth(int col, int width) ;
// Gets the number of items that can fit vertically in the
// visible area of the list control (list or report view)
// or the total number of items in the list control (icon
// or small icon view)
int GetCountPerPage() const;
// Gets the edit control for editing labels.
wxTextCtrl* GetEditControl() const;
// Gets information about the item
bool GetItem(wxListItem& info) const ;
// Sets information about the item
bool SetItem(wxListItem& info) ;
// Sets a string field at a particular column
long SetItem(long index, int col, const wxString& label, int imageId = -1);
// Gets the item state
int GetItemState(long item, long stateMask) const ;
// Sets the item state
bool SetItemState(long item, long state, long stateMask) ;
void AssignImageList(wxImageList *imageList, int which);
// Sets the item image
bool SetItemImage(long item, int image, int selImage = -1) ;
bool SetItemColumnImage(long item, long column, int image);
// Gets the item text
wxString GetItemText(long item, int col = 0) const ;
// Sets the item text
void SetItemText(long item, const wxString& str) ;
void SetItemTextColour(long item, const wxColour& colour) ;
wxColour GetItemTextColour(long item) const;
void SetItemBackgroundColour(long item, const wxColour& colour) ;
wxColour GetItemBackgroundColour(long item) const;
void SetItemFont( long item, const wxFont &f);
wxFont GetItemFont( long item ) const;
// Gets the item data
long GetItemData(long item) const ;
// Sets the item data
bool SetItemPtrData(long item, wxUIntPtr data);
bool SetItemData(long item, long data) { return SetItemPtrData(item, data); }
// Gets the item rectangle
bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
// Gets the item rectangle of a subitem
bool GetSubItemRect( long item, long subItem, wxRect& rect, int code = wxLIST_RECT_BOUNDS ) const;
// Gets the item position
bool GetItemPosition(long item, wxPoint& pos) const ;
// Sets the item position
bool SetItemPosition(long item, const wxPoint& pos) ;
// Gets the number of items in the list control
int GetItemCount() const;
// Gets the number of columns in the list control
int GetColumnCount() const;
void SetItemSpacing( int spacing, bool isSmall = false );
wxSize GetItemSpacing() const;
// Gets the number of selected items in the list control
int GetSelectedItemCount() const;
wxRect GetViewRect() const;
// Gets the text colour of the listview
wxColour GetTextColour() const;
// Sets the text colour of the listview
void SetTextColour(const wxColour& col);
// Gets the index of the topmost visible item when in
// list or report view
long GetTopItem() const ;
// Add or remove a single window style
void SetSingleStyle(long style, bool add = true) ;
// Set the whole window style
void SetWindowStyleFlag(long style) ;
// Searches for an item, starting from 'item'.
// item can be -1 to find the first item that matches the
// specified flags.
// Returns the item or -1 if unsuccessful.
long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ;
// Gets one of the three image lists
wxImageList *GetImageList(int which) const ;
// Sets the image list
void SetImageList(wxImageList *imageList, int which) ;
// Operations
////////////////////////////////////////////////////////////////////////////
// Arranges the items
bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
// Deletes an item
bool DeleteItem(long item);
// Deletes all items
bool DeleteAllItems() ;
// Deletes a column
bool DeleteColumn(int col);
// Deletes all columns
bool DeleteAllColumns();
// Clears items, and columns if there are any.
void ClearAll();
// Edit the label
wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = wxCLASSINFO(wxTextCtrl));
// End label editing, optionally cancelling the edit
bool EndEditLabel(bool cancel);
// Ensures this item is visible
bool EnsureVisible(long item) ;
// Find an item whose label matches this string, starting from the item after 'start'
// or the beginning if 'start' is -1.
long FindItem(long start, const wxString& str, bool partial = false);
// Find an item whose data matches this data, starting from the item after 'start'
// or the beginning if 'start' is -1.
long FindItem(long start, long data);
// Find an item nearest this position in the specified direction, starting from
// the item after 'start' or the beginning if 'start' is -1.
long FindItem(long start, const wxPoint& pt, int direction);
// Determines which item (if any) is at the specified point,
// giving details in 'flags' (see wxLIST_HITTEST_... flags above)
// Request the subitem number as well at the given coordinate.
long HitTest(const wxPoint& point, int& flags, long* ptrSubItem = NULL) const;
// Inserts an item, returning the index of the new item if successful,
// -1 otherwise.
// TOD: Should also have some further convenience functions
// which don't require setting a wxListItem object
long InsertItem(wxListItem& info);
// Insert a string item
long InsertItem(long index, const wxString& label);
// Insert an image item
long InsertItem(long index, int imageIndex);
// Insert an image/string item
long InsertItem(long index, const wxString& label, int imageIndex);
// Scrolls the list control. If in icon, small icon or report view mode,
// x specifies the number of pixels to scroll. If in list view mode, x
// specifies the number of columns to scroll.
// If in icon, small icon or list view mode, y specifies the number of pixels
// to scroll. If in report view mode, y specifies the number of lines to scroll.
bool ScrollList(int dx, int dy);
// Sort items.
// fn is a function which takes 3 long arguments: item1, item2, data.
// item1 is the long data associated with a first item (NOT the index).
// item2 is the long data associated with a second item (NOT the index).
// data is the same value as passed to SortItems.
// The return value is a negative number if the first item should precede the second
// item, a positive number of the second item should precede the first,
// or zero if the two items are equivalent.
// data is arbitrary data to be passed to the sort function.
bool SortItems(wxListCtrlCompare fn, wxIntPtr data);
wxMacDataBrowserListCtrlControl* GetListPeer() const;
// these functions are only used for virtual list view controls, i.e. the
// ones with wxLC_VIRTUAL style
void SetItemCount(long count);
void RefreshItem(long item);
void RefreshItems(long itemFrom, long itemTo);
// return the text for the given column of the given item
virtual wxString OnGetItemText(long item, long column) const;
// return the icon for the given item. In report view, OnGetItemImage will
// only be called for the first column. See OnGetItemColumnImage for
// details.
virtual int OnGetItemImage(long item) const;
// return the icon for the given item and column.
virtual int OnGetItemColumnImage(long item, long column) const;
/* Why should we need this function? Leave for now.
* We might need it because item data may have changed,
* but the display needs refreshing (in string callback mode)
// Updates an item. If the list control has the wxLI_AUTO_ARRANGE style,
// the items will be rearranged.
bool Update(long item);
*/
void Command(wxCommandEvent& event) { ProcessCommand(event); }
wxListCtrlCompare GetCompareFunc() { return m_compareFunc; }
wxIntPtr GetCompareFuncData() { return m_compareFuncData; }
// public overrides needed for pimpl approach
virtual bool SetFont(const wxFont& font);
virtual bool SetForegroundColour(const wxColour& colour);
virtual bool SetBackgroundColour(const wxColour& colour);
virtual wxColour GetBackgroundColour() const;
virtual void Freeze ();
virtual void Thaw ();
virtual void Update ();
// functions for editing/timer
void OnRenameTimer();
bool OnRenameAccept(long itemEdit, const wxString& value);
void OnRenameCancelled(long itemEdit);
void ChangeCurrent(long current);
void ResetCurrent() { ChangeCurrent((long)-1); }
bool HasCurrent() const { return m_current != (long)-1; }
void OnLeftDown(wxMouseEvent& event);
void OnDblClick(wxMouseEvent& event);
void FinishEditing(wxTextCtrl *text)
{
delete text;
m_textctrlWrapper = NULL;
SetFocus();
}
virtual int GetScrollPos(int orient) const;
void OnRightDown(wxMouseEvent& event);
void OnMiddleDown(wxMouseEvent& event);
void OnChar(wxKeyEvent& event);
virtual void SetFocus();
void FireMouseEvent(wxEventType eventType, wxPoint position);
virtual void SetDropTarget( wxDropTarget *dropTarget );
virtual wxDropTarget* GetDropTarget() const;
// with CG, we need to get the context from an kEventControlDraw event
// unfortunately, the DataBrowser callbacks don't provide the context
// and we need it, so we need to set/remove it before and after draw
// events so we can access it in the callbacks.
void MacSetDrawingContext(void* context) { m_cgContext = context; }
void* MacGetDrawingContext() { return m_cgContext; }
virtual wxVisualAttributes GetDefaultAttributes() const
{
return GetClassDefaultAttributes(GetWindowVariant());
}
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
protected:
// Implement base class pure virtual methods.
long DoInsertColumn(long col, const wxListItem& info);
// protected overrides needed for pimpl approach
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
long m_current;
wxListCtrlTextCtrlWrapper *m_textctrlWrapper;
wxListCtrlRenameTimer *m_renameTimer;
// common part of all ctors
void Init();
wxGenericListCtrl* m_genericImpl; // allow use of the generic impl.
wxMacDataBrowserListCtrlControl* m_dbImpl;
void* m_macListCtrlEventHandler;
void* m_cgContext;
wxListCtrlCompare m_compareFunc;
wxIntPtr m_compareFuncData;
wxTextCtrl* m_textCtrl; // The control used for editing a label
wxImageList * m_imageListNormal; // The image list for normal icons
wxImageList * m_imageListSmall; // The image list for small icons
wxImageList * m_imageListState; // The image list state icons (not implemented yet)
wxColumnList m_colsInfo; // for storing info about each column
wxColour m_textColor;
wxColour m_bgColor;
// keep track of whether or not we should delete the image list ourselves.
bool m_ownsImageListNormal,
m_ownsImageListSmall,
m_ownsImageListState;
long m_baseStyle; // Basic Windows style flags, for recreation purposes
int m_colCount; // Windows doesn't have GetColumnCount so must
// keep track of inserted/deleted columns
int m_count; // for virtual lists, store item count
private:
int CalcColumnAutoWidth(int col) const;
};
#endif
// _WX_LISTCTRL_H_

View File

@@ -22,7 +22,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr)
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Init();
Create(parent, id, title, pos, size, style, name);
@@ -34,7 +34,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr);
const wxString& name = wxASCII_STR(wxFrameNameStr));
virtual ~wxMDIParentFrame();
@@ -102,7 +102,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr)
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Init() ;
Create(parent, id, title, pos, size, style, name);
@@ -114,19 +114,19 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
const wxString& name = wxASCII_STR(wxFrameNameStr));
virtual ~wxMDIChildFrame();
// un-override the base class override
virtual bool IsTopLevel() const { return true; }
virtual bool IsTopLevel() const wxOVERRIDE { return true; }
// implement MDI operations
virtual void Activate();
virtual void Activate() wxOVERRIDE;
// Mac OS activate event
virtual void MacActivate(long timestamp, bool activating);
virtual void MacActivate(long timestamp, bool activating) wxOVERRIDE;
protected:
// common part of all ctors
@@ -142,10 +142,10 @@ public:
virtual ~wxMDIClientWindow();
virtual bool CreateClient(wxMDIParentFrame *parent,
long style = wxVSCROLL | wxHSCROLL);
long style = wxVSCROLL | wxHSCROLL) wxOVERRIDE;
protected:
virtual void DoGetClientSize(int *width, int *height) const;
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxMDIClientWindow);
};

View File

@@ -34,9 +34,7 @@ public:
virtual ~wxMenu();
virtual void Break();
virtual void SetTitle(const wxString& title);
virtual void SetTitle(const wxString& title) wxOVERRIDE;
bool ProcessCommand(wxCommandEvent& event);
@@ -73,9 +71,9 @@ protected:
// that are expected in the app menu
void DoRearrange() ;
virtual wxMenuItem* DoAppend(wxMenuItem *item);
virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item);
virtual wxMenuItem* DoRemove(wxMenuItem *item);
virtual wxMenuItem* DoAppend(wxMenuItem *item) wxOVERRIDE;
virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item) wxOVERRIDE;
virtual wxMenuItem* DoRemove(wxMenuItem *item) wxOVERRIDE;
private:
// common part of all ctors
@@ -104,7 +102,7 @@ private:
wxDECLARE_DYNAMIC_CLASS(wxMenu);
};
#if wxOSX_USE_COCOA_OR_CARBON
#if wxUSE_MENUBAR
// the iphone only has popup-menus
@@ -125,16 +123,16 @@ public:
virtual ~wxMenuBar();
// menubar construction
virtual bool Append( wxMenu *menu, const wxString &title );
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
virtual wxMenu *Remove(size_t pos);
virtual bool Append( wxMenu *menu, const wxString &title ) wxOVERRIDE;
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title) wxOVERRIDE;
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title) wxOVERRIDE;
virtual wxMenu *Remove(size_t pos) wxOVERRIDE;
virtual void EnableTop( size_t pos, bool flag );
virtual bool IsEnabledTop(size_t pos) const;
virtual void SetMenuLabel( size_t pos, const wxString& label );
virtual wxString GetMenuLabel( size_t pos ) const;
virtual bool Enable( bool enable = true );
virtual void EnableTop( size_t pos, bool flag ) wxOVERRIDE;
virtual bool IsEnabledTop(size_t pos) const wxOVERRIDE;
virtual void SetMenuLabel( size_t pos, const wxString& label ) wxOVERRIDE;
virtual wxString GetMenuLabel( size_t pos ) const wxOVERRIDE;
virtual bool Enable( bool enable = true ) wxOVERRIDE;
// for virtual function hiding
virtual void Enable( int itemid, bool enable )
{
@@ -142,18 +140,15 @@ public:
}
// implementation from now on
void Detach();
// returns TRUE if we're attached to a frame
bool IsAttached() const { return m_menuBarFrame != NULL; }
// get the frame we live in
wxFrame *GetFrame() const { return m_menuBarFrame; }
// attach to a frame
void Attach(wxFrame *frame);
// if the menubar is modified, the display is not updated automatically,
// call this function to update it (m_menuBarFrame should be !NULL)
void Refresh(bool eraseBackground = true, const wxRect *rect = NULL);
void Refresh(bool eraseBackground = true, const wxRect *rect = NULL) wxOVERRIDE;
#if wxABI_VERSION >= 30001
wxMenu *OSXGetAppleMenu() const { return m_appleMenu; }
@@ -170,10 +165,10 @@ public:
static WXHMENU MacGetWindowMenuHMenu() { return s_macWindowMenuHandle ; }
virtual void DoGetPosition(int *x, int *y) const;
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetClientSize(int *width, int *height) const;
virtual void DoGetPosition(int *x, int *y) const wxOVERRIDE;
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE;
protected:
// common part of all ctors

View File

@@ -37,10 +37,10 @@ public:
virtual ~wxMenuItem();
// override base class virtuals
virtual void SetItemLabel(const wxString& strName);
virtual void SetItemLabel(const wxString& strName) wxOVERRIDE;
virtual void Enable(bool bDoEnable = true);
virtual void Check(bool bDoCheck = true);
virtual void Enable(bool bDoEnable = true) wxOVERRIDE;
virtual void Check(bool bDoCheck = true) wxOVERRIDE;
virtual void SetBitmap(const wxBitmap& bitmap) ;
virtual const wxBitmap& GetBitmap() const { return m_bitmap; }

View File

@@ -40,7 +40,7 @@ class WXDLLIMPEXP_CORE wxMetafile : public wxGDIObject
{
public:
wxMetafile(const wxString& file = wxEmptyString);
virtual ~wxMetafile(void);
virtual ~wxMetafile();
// After this is called, the metafile cannot be used for anything
// since it is now owned by the clipboard.
@@ -56,8 +56,8 @@ public:
WXHMETAFILE GetHMETAFILE() const ;
void SetHMETAFILE(WXHMETAFILE mf) ;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxMetafile);
};
@@ -77,11 +77,11 @@ public:
virtual wxMetafile *Close();
// Implementation
wxMetafile *GetMetaFile(void) const { return m_metaFile; }
wxMetafile *GetMetaFile() const { return m_metaFile; }
void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; }
protected:
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
wxMetafile* m_metaFile;
@@ -122,10 +122,10 @@ private:
// No origin or extent
#define wxMakeMetaFilePlaceable wxMakeMetafilePlaceable
bool WXDLLIMPEXP_CORE wxMakeMetafilePlaceable(const wxString& filename, float scale = 1.0);
bool WXDLLIMPEXP_CORE wxMakeMetafilePlaceable(const wxString& filename, float scale = 1.0f);
// Optional origin and extent
bool WXDLLIMPEXP_CORE wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = true);
bool WXDLLIMPEXP_CORE wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0f, bool useOriginAndExtent = true);
// ----------------------------------------------------------------------------
// wxMetafileDataObject is a specialization of wxDataObject for metafile data
@@ -149,17 +149,17 @@ public:
{ return m_metafile; }
// implement base class pure virtuals
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t len, const void *buf);
virtual size_t GetDataSize() const wxOVERRIDE;
virtual bool GetDataHere(void *buf) const wxOVERRIDE;
virtual bool SetData(size_t len, const void *buf) wxOVERRIDE;
virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const
virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const wxOVERRIDE
{ return GetDataSize(); }
virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format),
void *buf) const
void *buf) const wxOVERRIDE
{ return GetDataHere(buf); }
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
size_t len, const void *buf)
size_t len, const void *buf) wxOVERRIDE
{ return SetData(len, buf); }
protected:
wxMetafile m_metafile;

View File

@@ -27,7 +27,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAPTION | wxRESIZE_BORDER | wxTINY_CAPTION,
const wxString& name = wxFrameNameStr)
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
// Use wxFrame constructor in absence of more specific code.
Create(parent, id, title, pos, size, style | wxFRAME_TOOL_WINDOW | wxFRAME_FLOAT_ON_PARENT , name);

View File

@@ -17,26 +17,22 @@ class WXDLLIMPEXP_CORE wxMessageDialog : public wxMessageDialogBase
public:
wxMessageDialog(wxWindow *parent,
const wxString& message,
const wxString& caption = wxMessageBoxCaptionStr,
const wxString& caption = wxASCII_STR(wxMessageBoxCaptionStr),
long style = wxOK|wxCENTRE,
const wxPoint& pos = wxDefaultPosition);
#if wxOSX_USE_COCOA
~wxMessageDialog();
#endif
virtual int ShowModal();
virtual int ShowModal() wxOVERRIDE;
#if wxOSX_USE_COCOA
virtual void ShowWindowModal();
virtual void ModalFinishedCallback(void* panel, int resultCode);
virtual void ShowWindowModal() wxOVERRIDE;
virtual void ModalFinishedCallback(void* panel, int resultCode) wxOVERRIDE;
#endif
protected:
// not supported for message dialog
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(width), int WXUNUSED(height),
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) wxOVERRIDE {}
#if wxOSX_USE_COCOA
void* ConstructNSAlert();
@@ -45,9 +41,6 @@ protected:
int m_buttonId[4];
int m_buttonCount;
#if wxOSX_USE_COCOA
WX_NSObject m_sheetDelegate;
#endif
wxDECLARE_DYNAMIC_CLASS(wxMessageDialog);
};

View File

@@ -42,7 +42,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr)
const wxString& name = wxASCII_STR(wxPanelNameStr))
{
Init();
@@ -54,7 +54,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
const wxString& name = wxASCII_STR(wxPanelNameStr));
bool Create(wxWindow *parent, WXWindow nativeWindow);
@@ -63,16 +63,16 @@ public:
virtual void SubclassWin(WXWindow nativeWindow);
virtual void UnsubclassWin();
virtual wxPoint GetClientAreaOrigin() const;
virtual wxPoint GetClientAreaOrigin() const wxOVERRIDE;
// implement base class pure virtuals
virtual bool SetTransparent(wxByte alpha);
virtual bool CanSetTransparent();
virtual bool SetTransparent(wxByte alpha) wxOVERRIDE;
virtual bool CanSetTransparent() wxOVERRIDE;
virtual bool SetBackgroundStyle(wxBackgroundStyle style);
virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE;
virtual void Update();
virtual void Update() wxOVERRIDE;
WXWindow GetWXWindow() const ;
static wxNonOwnedWindow* GetFromWXWindow( WXWindow win );
@@ -90,21 +90,21 @@ public:
static void MacDelayedDeactivation(long timestamp);
virtual void MacActivate( long timestamp , bool inIsActivating ) ;
virtual void SetWindowStyleFlag(long flags);
virtual void SetWindowStyleFlag(long flags) wxOVERRIDE;
virtual void Raise();
virtual void Lower();
virtual bool Show( bool show = true );
virtual void Raise() wxOVERRIDE;
virtual void Lower() wxOVERRIDE;
virtual bool Show( bool show = true ) wxOVERRIDE;
virtual void SetExtraStyle(long exStyle) ;
virtual void SetExtraStyle(long exStyle) wxOVERRIDE;
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetBackgroundColour( const wxColour &colour ) wxOVERRIDE;
wxNonOwnedWindowImpl* GetNonOwnedPeer() const { return m_nowpeer; }
#if wxOSX_USE_COCOA_OR_IPHONE
// override the base class method to return an NSWindow instead of NSView
virtual void *OSXGetViewOrWindow() const;
virtual void *OSXGetViewOrWindow() const wxOVERRIDE;
#endif // Cocoa
// osx specific event handling common for all osx-ports
@@ -120,25 +120,25 @@ public:
void WindowWasPainted();
virtual bool Destroy();
virtual bool Destroy() wxOVERRIDE;
protected:
// common part of all ctors
void Init();
virtual void DoGetPosition( int *x, int *y ) const;
virtual void DoGetSize( int *width, int *height ) const;
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoGetClientSize(int *width, int *height) const;
virtual void DoGetPosition( int *x, int *y ) const wxOVERRIDE;
virtual void DoGetSize( int *width, int *height ) const wxOVERRIDE;
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE;
virtual bool OSXShowWithEffect(bool show,
wxShowEffect effect,
unsigned timeout);
unsigned timeout) wxOVERRIDE;
virtual bool DoClearShape();
virtual bool DoSetRegionShape(const wxRegion& region);
virtual bool DoClearShape() wxOVERRIDE;
virtual bool DoSetRegionShape(const wxRegion& region) wxOVERRIDE;
#if wxUSE_GRAPHICS_CONTEXT
virtual bool DoSetPathShape(const wxGraphicsPath& path);
virtual bool DoSetPathShape(const wxGraphicsPath& path) wxOVERRIDE;
#endif // wxUSE_GRAPHICS_CONTEXT
virtual void WillBeDestroyed();
@@ -151,7 +151,7 @@ protected:
private :
static clock_t s_lastFlush;
wxRegion m_shape;
#if wxUSE_GRAPHICS_CONTEXT
wxGraphicsPath m_shapePath;

View File

@@ -40,7 +40,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxNotebookNameStr)
const wxString& name = wxASCII_STR(wxNotebookNameStr))
{ Create( parent, id, pos, size, style, name ); }
// Create() function
bool Create(wxWindow *parent,
@@ -48,7 +48,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxNotebookNameStr);
const wxString& name = wxASCII_STR(wxNotebookNameStr));
// dtor
virtual ~wxNotebook();

View File

@@ -27,11 +27,11 @@ public:
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
virtual int GetColoursCount() const;
virtual int GetColoursCount() const wxOVERRIDE;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxPalette);

View File

@@ -32,25 +32,25 @@ public:
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
// Override in order to recreate the pen
void SetColour(const wxColour& col) ;
void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
void SetColour(const wxColour& col) wxOVERRIDE;
void SetColour(unsigned char r, unsigned char g, unsigned char b) wxOVERRIDE;
void SetWidth(int width) ;
void SetStyle(wxPenStyle style) ;
void SetStipple(const wxBitmap& stipple) ;
void SetDashes(int nb_dashes, const wxDash *dash) ;
void SetJoin(wxPenJoin join) ;
void SetCap(wxPenCap cap) ;
void SetWidth(int width) wxOVERRIDE;
void SetStyle(wxPenStyle style) wxOVERRIDE;
void SetStipple(const wxBitmap& stipple) wxOVERRIDE;
void SetDashes(int nb_dashes, const wxDash *dash) wxOVERRIDE;
void SetJoin(wxPenJoin join) wxOVERRIDE;
void SetCap(wxPenCap cap) wxOVERRIDE;
wxColour GetColour() const ;
int GetWidth() const;
wxPenStyle GetStyle() const;
wxPenJoin GetJoin() const;
wxPenCap GetCap() const;
int GetDashes(wxDash **ptr) const;
wxColour GetColour() const wxOVERRIDE;
int GetWidth() const wxOVERRIDE;
wxPenStyle GetStyle() const wxOVERRIDE;
wxPenJoin GetJoin() const wxOVERRIDE;
wxPenCap GetCap() const wxOVERRIDE;
int GetDashes(wxDash **ptr) const wxOVERRIDE;
int GetDashCount() const;
wxBitmap *GetStipple() const ;
wxBitmap *GetStipple() const wxOVERRIDE;
wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants")
@@ -65,8 +65,8 @@ public:
bool RealizeResource();
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
private:
void Unshare();

View File

@@ -26,8 +26,8 @@ public:
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
virtual bool Show(bool show = true);
virtual bool Show(bool show = true) wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow);
};

View File

@@ -33,11 +33,11 @@ public:
virtual ~wxMacPrintDialog();
bool Create(wxWindow *parent, wxPrintDialogData* data = NULL);
virtual int ShowModal();
virtual int ShowModal() wxOVERRIDE;
virtual wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
virtual wxPrintData& GetPrintData() { return m_printDialogData.GetPrintData(); }
virtual wxDC *GetPrintDC();
virtual wxPrintDialogData& GetPrintDialogData() wxOVERRIDE { return m_printDialogData; }
virtual wxPrintData& GetPrintData() wxOVERRIDE { return m_printDialogData.GetPrintData(); }
virtual wxDC *GetPrintDC() wxOVERRIDE;
private:
wxPrintDialogData m_printDialogData;
@@ -60,10 +60,10 @@ public:
wxMacPageSetupDialog(wxWindow *parent, wxPageSetupDialogData *data = NULL);
virtual ~wxMacPageSetupDialog();
virtual wxPageSetupDialogData& GetPageSetupDialogData();
virtual wxPageSetupDialogData& GetPageSetupDialogData() wxOVERRIDE;
bool Create(wxWindow *parent, wxPageSetupDialogData *data = NULL);
virtual int ShowModal();
virtual int ShowModal() wxOVERRIDE;
private:
wxPageSetupDialogData m_pageSetupData;
@@ -86,7 +86,7 @@ class WXDLLIMPEXP_CORE wxMacPageMarginsDialog : public wxDialog
public:
wxMacPageMarginsDialog(wxFrame* parent, wxPageSetupDialogData* data);
bool TransferToWindow();
bool TransferDataFromWindow();
bool TransferDataFromWindow() wxOVERRIDE;
virtual wxPageSetupDialogData& GetPageSetupDialogData() { return *m_pageSetupDialogData; }

View File

@@ -27,9 +27,9 @@ public:
virtual bool Print(wxWindow *parent,
wxPrintout *printout,
bool prompt = true);
virtual wxDC* PrintDialog(wxWindow *parent);
virtual bool Setup(wxWindow *parent);
bool prompt = true) wxOVERRIDE;
virtual wxDC* PrintDialog(wxWindow *parent) wxOVERRIDE;
virtual bool Setup(wxWindow *parent) wxOVERRIDE;
};
@@ -51,8 +51,8 @@ public:
wxPrintData *data);
virtual ~wxMacPrintPreview();
virtual bool Print(bool interactive);
virtual void DetermineScaling();
virtual bool Print(bool interactive) wxOVERRIDE;
virtual void DetermineScaling() wxOVERRIDE;
};
#endif

View File

@@ -0,0 +1,51 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/osx/private/available.h
// Purpose: Helper for checking API availability under macOS.
// Author: Vadim Zeitlin
// Created: 2019-04-17
// Copyright: (c) 2019 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_OSX_PRIVATE_AVAILABLE_H_
#define _WX_OSX_PRIVATE_AVAILABLE_H_
// Xcode 9 adds new @available keyword and the corresponding __builtin_available
// builtin which should be used instead of manual checks for API availability
// as using this builtin suppresses the compiler -Wunguarded-availability
// warnings, so use it if possible for the implementation of our own macro.
#if defined(__clang__) && __has_builtin(__builtin_available)
#define WX_IS_MACOS_AVAILABLE(major, minor) \
__builtin_available(macOS major ## . ## minor, *)
#define WX_IS_MACOS_OR_IOS_AVAILABLE(macmajor, macminor, imajor, iminor) \
__builtin_available(macOS macmajor ## . ## macminor, iOS imajor ##. ## iminor, *)
#define WX_IS_MACOS_AVAILABLE_FULL(major, minor, micro) \
__builtin_available(macOS major ## . ## minor ## . ## micro, *)
// Note that we can't easily forward to API_AVAILABLE macro here, so go
// directly to its expansion instead.
#define WX_API_AVAILABLE_MACOS(major, minor) \
__attribute__((availability(macos,introduced=major ## . ## minor)))
#else // Not clang or old clang version without __builtin_available
#include "wx/platinfo.h"
#define WX_IS_MACOS_AVAILABLE(major, minor) \
wxPlatformInfo::Get().CheckOSVersion(major, minor)
#ifdef wxOSX_USE_IPHONE
#define WX_IS_MACOS_OR_IOS_AVAILABLE(macmajor, macminor, imajor, iminor) \
wxPlatformInfo::Get().CheckOSVersion(imajor, iminor)
#else
#define WX_IS_MACOS_OR_IOS_AVAILABLE(macmajor, macminor, imajor, iminor) \
wxPlatformInfo::Get().CheckOSVersion(macmajor, macminor)
#endif
#define WX_IS_MACOS_AVAILABLE_FULL(major, minor, micro) \
wxPlatformInfo::Get().CheckOSVersion(major, minor, micro)
#define WX_API_AVAILABLE_MACOS(major, minor)
#endif
#endif // _WX_OSX_PRIVATE_AVAILABLE_H_

View File

@@ -0,0 +1,113 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/osx/private/datatransfer.h
// Purpose: OS X specific data transfer implementation
// Author: Stefan Csomor
// Created: 2019-03-29
// Copyright: (c) 2019 Stefan Csomor <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_OSX_PRIVATE_DATATRANSFER_H_
#define _WX_OSX_PRIVATE_DATATRANSFER_H_
#include "wx/osx/private.h"
#include "wx/osx/dataform.h"
class WXDLLIMPEXP_FWD_CORE wxDataObject;
class WXDLLIMPEXP_CORE wxOSXDataSourceItem
{
public:
virtual ~wxOSXDataSourceItem();
virtual wxDataFormat::NativeFormat AvailableType(CFArrayRef types) const = 0;
virtual bool GetData( const wxDataFormat& dataFormat, wxMemoryBuffer& target) = 0;
virtual bool GetData( wxDataFormat::NativeFormat type, wxMemoryBuffer& target) = 0;
virtual CFDataRef DoGetData(wxDataFormat::NativeFormat type) const = 0;
};
class WXDLLIMPEXP_CORE wxOSXDataSource
{
public:
// the number of source items
virtual size_t GetItemCount() const = 0;
// get source item by index, needs to be deleted after use
virtual const wxOSXDataSourceItem* GetItem(size_t pos) const = 0;
// returns true if there is any data in this source conforming to dataFormat
virtual bool IsSupported(const wxDataFormat &dataFormat);
// returns true if there is any data in this source supported by dataobj
virtual bool IsSupported(const wxDataObject &dataobj);
// returns true if there is any data in this source of types
virtual bool HasData(CFArrayRef types) const = 0;
};
class WXDLLIMPEXP_CORE wxOSXDataSinkItem
{
public:
virtual ~wxOSXDataSinkItem();
virtual void SetFilename(const wxString& filename);
// translating from wx into native representation
virtual void SetData(const wxDataFormat& format, const void *buf, size_t size) = 0;
// translating from wx into native representation
virtual void SetData(wxDataFormat::NativeFormat format, const void *buf, size_t size) = 0;
// native implementation for setting data
virtual void DoSetData(wxDataFormat::NativeFormat format, CFDataRef data) = 0;
};
class WXDLLIMPEXP_CORE wxOSXDataSink
{
public:
// delete all created sink items
virtual void Clear() = 0;
// create a new sink item
virtual wxOSXDataSinkItem* CreateItem() = 0;
// flush the created sink items into the system sink representation
virtual void Flush() = 0 ;
};
class WXDLLIMPEXP_CORE wxOSXPasteboard : public wxOSXDataSink, public wxOSXDataSource
{
public:
wxOSXPasteboard(OSXPasteboard native);
~wxOSXPasteboard();
// sink methods
virtual wxOSXDataSinkItem* CreateItem() wxOVERRIDE;
void Clear() wxOVERRIDE;
void Flush() wxOVERRIDE;
// source methods
virtual size_t GetItemCount() const wxOVERRIDE;
virtual const wxOSXDataSourceItem* GetItem(size_t pos) const wxOVERRIDE;
virtual bool HasData(CFArrayRef types) const wxOVERRIDE;
static wxOSXPasteboard* GetGeneralClipboard();
private:
void DeleteSinkItems();
OSXPasteboard m_pasteboard;
wxVector<wxOSXDataSinkItem*> m_sinkItems;
};
#endif

View File

@@ -28,7 +28,7 @@ public:
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
const wxValidator& val = wxDefaultValidator, const wxString& name = wxASCII_STR(wxRadioBoxNameStr))
{
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
}
@@ -37,7 +37,7 @@ public:
const wxArrayString& choices,
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr)
const wxString& name = wxASCII_STR(wxRadioBoxNameStr))
{
Create(parent, id, title, pos, size, choices,
majorDim, style, val, name);
@@ -47,13 +47,13 @@ public:
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
const wxValidator& val = wxDefaultValidator, const wxString& name = wxASCII_STR(wxRadioBoxNameStr));
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
int majorDim = 0, long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
const wxString& name = wxASCII_STR(wxRadioBoxNameStr));
// Enabling
virtual bool Enable(bool enable = true) wxOVERRIDE;
@@ -74,9 +74,6 @@ public:
virtual wxString GetString(unsigned int item) const wxOVERRIDE;
virtual void SetString(unsigned int item, const wxString& label) wxOVERRIDE;
virtual wxString GetLabel() const wxOVERRIDE;
virtual void SetLabel(const wxString& label) wxOVERRIDE;
// protect native font of box
virtual bool SetFont( const wxFont &font ) wxOVERRIDE;
// Other external functions

View File

@@ -11,7 +11,7 @@
#ifndef _WX_RADIOBUT_H_
#define _WX_RADIOBUT_H_
class WXDLLIMPEXP_CORE wxRadioButton: public wxControl
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase
{
wxDECLARE_DYNAMIC_CLASS(wxRadioButton);
@@ -22,7 +22,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxRadioButtonNameStr)
const wxString& name = wxASCII_STR(wxRadioButtonNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
@@ -33,21 +33,21 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxRadioButtonNameStr);
const wxString& name = wxASCII_STR(wxRadioButtonNameStr));
virtual void SetValue(bool val);
virtual bool GetValue() const ;
virtual void SetValue(bool val) wxOVERRIDE;
virtual bool GetValue() const wxOVERRIDE;
// implementation
void Command(wxCommandEvent& event);
void Command(wxCommandEvent& event) wxOVERRIDE;
wxRadioButton *AddInCycle(wxRadioButton *cycle);
void RemoveFromCycle();
wxRadioButton *NextInCycle() {return m_cycle;}
// osx specific event handling common for all osx-ports
virtual bool OSXHandleClicked( double timestampsec );
virtual bool OSXHandleClicked(double timestampsec) wxOVERRIDE;
protected:
wxRadioButton *m_cycle;

View File

@@ -24,7 +24,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxScrollBarNameStr)
const wxString& name = wxASCII_STR(wxScrollBarNameStr))
{
Create(parent, id, pos, size, style, validator, name);
}
@@ -34,7 +34,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxScrollBarNameStr);
const wxString& name = wxASCII_STR(wxScrollBarNameStr));
virtual int GetThumbPosition() const wxOVERRIDE;
virtual int GetThumbSize() const wxOVERRIDE { return m_viewSize; }

View File

@@ -190,7 +190,7 @@
// Unicode support
// ----------------------------------------------------------------------------
// These settings are obsolete: the library is always built in Unicode mode
// This option is deprecated: the library should be always built in Unicode mode
// now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if
// absolutely necessary -- updating it is strongly recommended as the ANSI mode
// will disappear completely in future wxWidgets releases.
@@ -198,9 +198,6 @@
#define wxUSE_UNICODE 1
#endif
// wxUSE_WCHAR_T is required by wxWidgets now, don't change.
#define wxUSE_WCHAR_T 1
// ----------------------------------------------------------------------------
// global features
// ----------------------------------------------------------------------------
@@ -398,18 +395,6 @@
// wxWidgets.
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
// VC++ 4.2 and above allows <iostream> and <iostream.h> but you can't mix
// them. Set this option to 1 to use <iostream.h>, 0 to use <iostream>.
//
// Note that newer compilers (including VC++ 7.1 and later) don't support
// wxUSE_IOSTREAMH == 1 and so <iostream> will be used anyhow.
//
// Default is 0.
//
// Recommended setting: 0, only set to 1 if you use a really old compiler
#define wxUSE_IOSTREAMH 0
// ----------------------------------------------------------------------------
// non GUI features selection
// ----------------------------------------------------------------------------
@@ -828,6 +813,13 @@
#define wxUSE_WEBVIEW_IE 0
#endif
// Use the Edge (Chromium) wxWebView backend (Requires WebView2 SDK)
//
// Default is 0 because WebView2 is not always available, set it to 1 if you do have it.
//
// Recommended setting: 1 when building for Windows with WebView2 SDK
#define wxUSE_WEBVIEW_EDGE 0
// Use the WebKit wxWebView backend
//
// Default is 1 on GTK and OSX
@@ -976,6 +968,14 @@
#define wxUSE_TREECTRL 1 // wxTreeCtrl
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
// Use generic version of wxDataViewCtrl even if a native one is available?
//
// Default is 1.
//
// Recommended setting: 1, but can be set to 0 if your program is affected by
// the native control limitations.
#define wxUSE_NATIVE_DATAVIEWCTRL 1
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
// below either wxStatusBar95 or a generic wxStatusBar will be used.
//
@@ -1183,13 +1183,20 @@
// depends on it)
#define wxUSE_INFOBAR 1
// Use wxMenu, wxMenuBar, wxMenuItem.
// Use wxMenu, wxMenuItem.
//
// Default is 1.
//
// Recommended setting: 1 (can't be disabled under MSW)
#define wxUSE_MENUS 1
// Use wxMenuBar.
//
// Default is 1.
//
// Recommended setting: 1 (can't be disabled under MSW)
#define wxUSE_MENUBAR 1
// Use wxNotificationMessage.
//
// wxNotificationMessage allows to show non-intrusive messages to the user
@@ -1436,6 +1443,13 @@
// otherwise.
#define wxUSE_GLCANVAS 1
// Setting wxUSE_GLCANVAS_EGL to 1 enables OpenGL EGL backend. This will be
// automatically enabled if EGL support is detected.
//
// Default is 0.
//
#define wxUSE_GLCANVAS_EGL 0
// wxRichTextCtrl allows editing of styled text.
//
// Default is 1.
@@ -1616,7 +1630,6 @@
#define wxUSE_THEME_MONO 0
#define wxUSE_THEME_WIN32 0
/* --- end common options --- */
/* --- start OSX options --- */

View File

@@ -28,7 +28,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSliderNameStr)
const wxString& name = wxASCII_STR(wxSliderNameStr))
{
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
}
@@ -41,7 +41,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSliderNameStr);
const wxString& name = wxASCII_STR(wxSliderNameStr));
virtual int GetValue() const wxOVERRIDE;
virtual void SetValue(int) wxOVERRIDE;
@@ -81,7 +81,6 @@ protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual void DoSetSize(int x, int y, int w, int h, int sizeFlags) wxOVERRIDE;
virtual void DoMoveWindow(int x, int y, int w, int h) wxOVERRIDE;
// set min/max size of the slider
virtual void DoSetSizeHints( int minW, int minH,

View File

@@ -64,7 +64,7 @@ public:
static void SoundStopped(const wxSoundData* data);
protected:
bool DoPlay(unsigned flags) const;
bool DoPlay(unsigned flags) const wxOVERRIDE;
void Init();
private:

View File

@@ -51,22 +51,22 @@ public:
// accessors
virtual void SetRange(int minVal, int maxVal);
virtual int GetValue() const ;
virtual void SetValue(int val);
virtual void SetRange(int minVal, int maxVal) wxOVERRIDE;
virtual int GetValue() const wxOVERRIDE;
virtual void SetValue(int val) wxOVERRIDE;
// implementation
virtual void TriggerScrollEvent( wxEventType scrollEvent ) ;
virtual void TriggerScrollEvent( wxEventType scrollEvent ) wxOVERRIDE;
// osx specific event handling common for all osx-ports
virtual bool OSXHandleClicked( double timestampsec );
virtual bool OSXHandleClicked( double timestampsec ) wxOVERRIDE;
protected:
void SendThumbTrackEvent() ;
virtual wxSize DoGetBestSize() const;
virtual wxSize DoGetBestSize() const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxSpinButton);

View File

@@ -27,7 +27,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSearchCtrlNameStr);
const wxString& name = wxASCII_STR(wxSearchCtrlNameStr));
virtual ~wxSearchCtrl();
@@ -37,7 +37,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSearchCtrlNameStr);
const wxString& name = wxASCII_STR(wxSearchCtrlNameStr));
#if wxUSE_MENUS
// get/set search button menu

View File

@@ -13,7 +13,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBitmapNameStr)
const wxString& name = wxASCII_STR(wxStaticBitmapNameStr))
{
Create(parent, id, bitmap, pos, size, style, name);
}
@@ -24,7 +24,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBitmapNameStr);
const wxString& name = wxASCII_STR(wxStaticBitmapNameStr));
virtual void SetBitmap(const wxBitmap& bitmap) wxOVERRIDE;

View File

@@ -22,7 +22,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBoxNameStr)
const wxString& name = wxASCII_STR(wxStaticBoxNameStr))
{
Create(parent, id, label, pos, size, style, name);
}
@@ -32,17 +32,17 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBoxNameStr);
const wxString& name = wxASCII_STR(wxStaticBoxNameStr));
virtual void Command(wxCommandEvent& WXUNUSED(event)) {}
virtual void Command(wxCommandEvent& WXUNUSED(event)) wxOVERRIDE {}
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}
virtual void GetBordersForSizer(int *borderTop, int *borderOther) const;
virtual void GetBordersForSizer(int *borderTop, int *borderOther) const wxOVERRIDE;
virtual bool AcceptsFocus() const { return false; }
virtual bool AcceptsFocus() const wxOVERRIDE { return false; }
// protect native font of box
virtual bool SetFont( const wxFont &font );
virtual bool SetFont( const wxFont &font ) wxOVERRIDE;
};
#endif

View File

@@ -27,7 +27,7 @@ public:
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString &name = wxStaticLineNameStr )
const wxString &name = wxASCII_STR(wxStaticLineNameStr) )
: m_statbox(NULL)
{
Create(parent, id, pos, size, style, name);
@@ -38,7 +38,7 @@ public:
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString &name = wxStaticLineNameStr );
const wxString &name = wxASCII_STR(wxStaticLineNameStr) );
// it's necessary to override this wxWindow function because we
// will want to return the main widget for m_statbox

View File

@@ -21,7 +21,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticTextNameStr)
const wxString& name = wxASCII_STR(wxStaticTextNameStr))
{
Create(parent, id, label, pos, size, style, name);
}
@@ -31,23 +31,23 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticTextNameStr);
const wxString& name = wxASCII_STR(wxStaticTextNameStr));
// accessors
void SetLabel( const wxString &str ) ;
bool SetFont( const wxFont &font );
void SetLabel( const wxString &str ) wxOVERRIDE;
bool SetFont( const wxFont &font ) wxOVERRIDE;
virtual bool AcceptsFocus() const { return false; }
virtual bool AcceptsFocus() const wxOVERRIDE { return false; }
protected :
virtual wxString DoGetLabel() const;
virtual void DoSetLabel(const wxString& str);
virtual wxString WXGetVisibleLabel() const wxOVERRIDE;
virtual void WXSetVisibleLabel(const wxString& str) wxOVERRIDE;
virtual wxSize DoGetBestSize() const ;
virtual wxSize DoGetBestSize() const wxOVERRIDE;
#if wxUSE_MARKUP && wxOSX_USE_COCOA
virtual bool DoSetLabelMarkup(const wxString& markup);
virtual bool DoSetLabelMarkup(const wxString& markup) wxOVERRIDE;
#endif // wxUSE_MARKUP && wxOSX_USE_COCOA
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticText);

View File

@@ -18,13 +18,13 @@ public:
wxStatusBarMac();
wxStatusBarMac(wxWindow *parent, wxWindowID id = wxID_ANY,
long style = wxSTB_DEFAULT_STYLE,
const wxString& name = wxStatusBarNameStr);
const wxString& name = wxASCII_STR(wxStatusBarNameStr));
virtual ~wxStatusBarMac();
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
long style = wxSTB_DEFAULT_STYLE,
const wxString& name = wxStatusBarNameStr);
const wxString& name = wxASCII_STR(wxStatusBarNameStr));
// Implementation
virtual void MacHiliteChanged() wxOVERRIDE;

View File

@@ -40,7 +40,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTextCtrlNameStr)
const wxString& name = wxASCII_STR(wxTextCtrlNameStr))
{
Init();
Create(parent, id, value, pos, size, style, validator, name);
@@ -55,7 +55,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTextCtrlNameStr);
const wxString& name = wxASCII_STR(wxTextCtrlNameStr));
// accessors
// ---------
@@ -99,7 +99,6 @@ public:
// --------------
virtual void Command(wxCommandEvent& event) wxOVERRIDE;
virtual bool AcceptsFocus() const wxOVERRIDE;
virtual void SetWindowStyleFlag(long style) wxOVERRIDE;
// callbacks
@@ -140,6 +139,7 @@ protected:
void Init();
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen) const wxOVERRIDE;
// flag is set to true when the user edits the controls contents
bool m_dirty;

View File

@@ -34,58 +34,58 @@ public:
wxTextEntry();
virtual ~wxTextEntry();
virtual bool IsEditable() const;
virtual bool IsEditable() const wxOVERRIDE;
// If the return values from and to are the same, there is no selection.
virtual void GetSelection(long* from, long* to) const;
virtual void GetSelection(long* from, long* to) const wxOVERRIDE;
// operations
// ----------
// editing
virtual void Clear();
virtual void Remove(long from, long to);
virtual void Clear() wxOVERRIDE;
virtual void Remove(long from, long to) wxOVERRIDE;
// set the max number of characters which may be entered
// in a single line text control
virtual void SetMaxLength(unsigned long len);
virtual void SetMaxLength(unsigned long len) wxOVERRIDE;
virtual void ForceUpper();
virtual void ForceUpper() wxOVERRIDE;
// writing text inserts it at the current position;
// appending always inserts it at the end
virtual void WriteText(const wxString& text);
virtual void WriteText(const wxString& text) wxOVERRIDE;
// Clipboard operations
virtual void Copy();
virtual void Cut();
virtual void Paste();
virtual void Copy() wxOVERRIDE;
virtual void Cut() wxOVERRIDE;
virtual void Paste() wxOVERRIDE;
virtual bool CanCopy() const;
virtual bool CanCut() const;
virtual bool CanPaste() const;
virtual bool CanCopy() const wxOVERRIDE;
virtual bool CanCut() const wxOVERRIDE;
virtual bool CanPaste() const wxOVERRIDE;
// Undo/redo
virtual void Undo();
virtual void Redo();
virtual void Undo() wxOVERRIDE;
virtual void Redo() wxOVERRIDE;
virtual bool CanUndo() const;
virtual bool CanRedo() const;
virtual bool CanUndo() const wxOVERRIDE;
virtual bool CanRedo() const wxOVERRIDE;
// Insertion point
virtual void SetInsertionPoint(long pos);
virtual void SetInsertionPointEnd();
virtual long GetInsertionPoint() const;
virtual wxTextPos GetLastPosition() const;
virtual void SetInsertionPoint(long pos) wxOVERRIDE;
virtual void SetInsertionPointEnd() wxOVERRIDE;
virtual long GetInsertionPoint() const wxOVERRIDE;
virtual wxTextPos GetLastPosition() const wxOVERRIDE;
virtual void SetSelection(long from, long to);
virtual void SetEditable(bool editable);
virtual void SetSelection(long from, long to) wxOVERRIDE;
virtual void SetEditable(bool editable) wxOVERRIDE;
virtual bool SendMaxLenEvent();
// set the grayed out hint text
virtual bool SetHint(const wxString& hint);
virtual wxString GetHint() const;
virtual bool SetHint(const wxString& hint) wxOVERRIDE;
virtual wxString GetHint() const wxOVERRIDE;
// Implementation
// --------------
@@ -95,10 +95,10 @@ public:
protected:
virtual wxString DoGetValue() const;
virtual wxString DoGetValue() const wxOVERRIDE;
virtual bool DoAutoCompleteStrings(const wxArrayString& choices);
virtual bool DoAutoCompleteCustom(wxTextCompleter *completer);
virtual bool DoAutoCompleteStrings(const wxArrayString& choices) wxOVERRIDE;
virtual bool DoAutoCompleteCustom(wxTextCompleter *completer) wxOVERRIDE;
// The object providing auto-completions or NULL if none.
wxTextCompleter *m_completer;

View File

@@ -23,7 +23,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
const wxString& name = wxASCII_STR(wxCheckBoxNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
@@ -35,17 +35,17 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
virtual void SetValue(bool value);
virtual bool GetValue() const ;
virtual void SetValue(bool value) wxOVERRIDE;
virtual bool GetValue() const wxOVERRIDE;
virtual bool OSXHandleClicked( double timestampsec );
virtual bool OSXHandleClicked( double timestampsec ) wxOVERRIDE;
virtual void Command(wxCommandEvent& event);
virtual void Command(wxCommandEvent& event) wxOVERRIDE;
protected:
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton);
@@ -63,7 +63,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
const wxString& name = wxASCII_STR(wxCheckBoxNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
@@ -75,7 +75,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapToggleButton);

View File

@@ -41,7 +41,7 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTimePickerCtrlNameStr);
virtual void OSXGenerateEvent(const wxDateTime& dt);
virtual void OSXGenerateEvent(const wxDateTime& dt) wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTimePickerCtrl);

View File

@@ -29,7 +29,7 @@ public:
wxToolBar(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxTB_DEFAULT_STYLE,
const wxString& name = wxToolBarNameStr)
const wxString& name = wxASCII_STR(wxToolBarNameStr))
{
Init();
Create(parent, id, pos, size, style, name);
@@ -38,7 +38,7 @@ public:
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxTB_DEFAULT_STYLE,
const wxString& name = wxToolBarNameStr);
const wxString& name = wxASCII_STR(wxToolBarNameStr));
virtual void SetWindowStyleFlag(long style) wxOVERRIDE;
@@ -95,9 +95,9 @@ public:
protected:
// common part of all ctors
void Init();
void DoLayout();
void DoSetSize(int x, int y, int width, int height, int sizeFlags) wxOVERRIDE;
#ifndef __WXOSX_IPHONE__

View File

@@ -27,7 +27,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr)
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Init();
@@ -42,7 +42,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
const wxString& name = wxASCII_STR(wxFrameNameStr));
bool Create(wxWindow *parent, WXWindow nativeWindow);
@@ -82,7 +82,7 @@ public:
virtual void SetLabel(const wxString& label) wxOVERRIDE { SetTitle( label ); }
virtual wxString GetLabel() const wxOVERRIDE { return GetTitle(); }
virtual void OSXSetModified(bool modified) wxOVERRIDE;
virtual bool OSXIsModified() const wxOVERRIDE;

View File

@@ -14,7 +14,7 @@
#include "wx/defs.h"
#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXOSX__)
#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXOSX__)
#include "wx/control.h"
#include "wx/webview.h"
@@ -33,19 +33,19 @@ public:
wxWebViewWebKit() {}
wxWebViewWebKit(wxWindow *parent,
wxWindowID winID = wxID_ANY,
const wxString& strURL = wxWebViewDefaultURLStr,
const wxString& strURL = wxASCII_STR(wxWebViewDefaultURLStr),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxWebViewNameStr)
const wxString& name = wxASCII_STR(wxWebViewNameStr))
{
Create(parent, winID, strURL, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID winID = wxID_ANY,
const wxString& strURL = wxWebViewDefaultURLStr,
const wxString& strURL = wxASCII_STR(wxWebViewDefaultURLStr),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxWebViewNameStr) wxOVERRIDE;
const wxString& name = wxASCII_STR(wxWebViewNameStr)) wxOVERRIDE;
virtual ~wxWebViewWebKit();
virtual bool CanGoBack() const wxOVERRIDE;
@@ -63,7 +63,9 @@ public:
virtual wxString GetCurrentURL() const wxOVERRIDE;
virtual wxString GetCurrentTitle() const wxOVERRIDE;
virtual wxWebViewZoom GetZoom() const wxOVERRIDE;
virtual float GetZoomFactor() const wxOVERRIDE;
virtual void SetZoom(wxWebViewZoom zoom) wxOVERRIDE;
virtual void SetZoomFactor(float zoom) wxOVERRIDE;
virtual void SetZoomType(wxWebViewZoomType zoomType) wxOVERRIDE;
virtual wxWebViewZoomType GetZoomType() const wxOVERRIDE;
@@ -86,10 +88,10 @@ public:
//Find function
virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT) wxOVERRIDE
{
{
wxUnusedVar(text);
wxUnusedVar(flags);
return wxNOT_FOUND;
return wxNOT_FOUND;
}
//Clipboard functions
@@ -160,11 +162,13 @@ private:
OSXWebViewPtr m_webView;
WX_NSObject m_loadDelegate;
WX_NSObject m_policyDelegate;
WX_NSObject m_UIDelegate;
// we may use this later to setup our own mouse events,
// so leave it in for now.
void* m_webKitCtrlEventHandler;
//It should be WebView*, but WebView is an Objective-C class
//TODO: look into using DECLARE_WXCOCOA_OBJC_CLASS rather than this.
};
class WXDLLIMPEXP_WEBVIEW wxWebViewFactoryWebKit : public wxWebViewFactory
@@ -177,7 +181,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxWebViewNameStr)
const wxString& name = wxASCII_STR(wxWebViewNameStr))
{ return new wxWebViewWebKit(parent, id, url, pos, size, style, name); }
};

View File

@@ -40,7 +40,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr );
const wxString& name = wxASCII_STR(wxPanelNameStr) );
virtual ~wxWindowMac();
@@ -49,10 +49,10 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr );
const wxString& name = wxASCII_STR(wxPanelNameStr) );
virtual void SendSizeEvent(int flags = 0) wxOVERRIDE;
// implement base class pure virtuals
virtual void SetLabel( const wxString& label ) wxOVERRIDE;
virtual wxString GetLabel() const wxOVERRIDE;
@@ -72,8 +72,6 @@ public:
return OSXShowWithEffect(false, effect, timeout);
}
virtual bool IsShownOnScreen() const wxOVERRIDE;
virtual void SetFocus() wxOVERRIDE;
virtual void WarpPointer( int x, int y ) wxOVERRIDE;
@@ -92,10 +90,10 @@ public:
virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE;
virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const wxOVERRIDE;
virtual int GetCharHeight() const wxOVERRIDE;
virtual int GetCharWidth() const wxOVERRIDE;
public:
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh = true ) wxOVERRIDE;
@@ -117,16 +115,17 @@ public:
#if wxUSE_HOTKEY && wxOSX_USE_COCOA_OR_CARBON
// hot keys (system wide accelerators)
// -----------------------------------
virtual bool RegisterHotKey(int hotkeyId, int modifiers, int keycode) wxOVERRIDE;
virtual bool UnregisterHotKey(int hotkeyId) wxOVERRIDE;
#endif // wxUSE_HOTKEY
virtual wxSize GetDPI() const wxOVERRIDE;
virtual double GetDPIScaleFactor() const wxOVERRIDE;
#if wxUSE_DRAG_AND_DROP
virtual void SetDropTarget( wxDropTarget *dropTarget ) wxOVERRIDE;
// Accept files for dragging
virtual void DragAcceptFiles( bool accept ) wxOVERRIDE;
#endif
// implementation from now on
@@ -153,10 +152,12 @@ public:
// --------------
void OnMouseEvent( wxMouseEvent &event );
void OnDPIChanged( wxDPIChangedEvent& event );
void MacOnScroll( wxScrollEvent&event );
virtual bool AcceptsFocus() const wxOVERRIDE;
virtual void EnableVisibleFocus(bool enabled) wxOVERRIDE;
virtual bool IsDoubleBuffered() const wxOVERRIDE { return true; }
@@ -255,7 +256,7 @@ public:
// the 'true' OS level control for this wxWindow
wxOSXWidgetImpl* GetPeer() const;
// optimization to avoid creating a user pane in wxWindow::Create if we already know
// we will replace it with our own peer
void DontCreatePeer();
@@ -263,10 +264,10 @@ public:
// return true unless DontCreatePeer() had been called
bool ShouldCreatePeer() const;
// sets the native implementation wrapper, can replace an existing peer, use peer = NULL to
// sets the native implementation wrapper, can replace an existing peer, use peer = NULL to
// release existing peer
void SetPeer(wxOSXWidgetImpl* peer);
// wraps the already existing peer with the wrapper
void SetWrappingPeer(wxOSXWidgetImpl* wrapper);
@@ -289,12 +290,15 @@ public:
virtual void OSXSimulateFocusEvents();
bool IsNativeWindowWrapper() const { return m_isNativeWindowWrapper; }
double GetContentScaleFactor() const wxOVERRIDE;
// internal response to size events
virtual void MacOnInternalSize() {}
// Return the DPI corresponding to the given scale factor.
static wxSize OSXMakeDPIFromScaleFactor(double scaleFactor);
protected:
// For controls like radio buttons which are genuinely composite
wxList m_subControls;