virtual wxColour GetTransparentColour(unsigned int frame) const;
// implementation of wxAnimationDecoder's pure virtuals
-
+
virtual bool Load( wxInputStream& stream );
bool ConvertToImage(unsigned int frame, wxImage *image) const;
// wxAnimationDecoder pure virtual:
virtual bool DoCanRead( wxInputStream& stream ) const;
// modifies current stream position (see wxAnimationDecoder::CanRead)
-
+
// frames stored as wxImage(s): ANI files are meant to be used mostly for animated
// cursors and thus they do not use any optimization to encode differences between
// two frames: they are just a list of images to display sequentially.
}
virtual bool Load( wxInputStream& stream ) = 0;
-
+
bool CanRead( wxInputStream& stream ) const
{
// NOTE: this code is the same of wxImageHandler::CallDoCanRead
-
+
if ( !stream.IsSeekable() )
return false; // can't test unseekable stream
// this function should modify the stream current position without taking care
// of restoring it since CanRead() will do it.
virtual bool DoCanRead(wxInputStream& stream) const = 0;
-
+
wxSize m_szAnimation;
unsigned int m_nFrames;
const wxAuiPaneInfo& pane,
wxWindowID id = wxID_ANY,
long style = wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION |
- wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT |
+ wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT |
wxCLIP_CHILDREN
);
virtual ~wxAuiFloatingFrame();
void SetPaneWindow(const wxAuiPaneInfo& pane);
wxAuiManager* GetOwnerManager() const;
-
+
protected:
virtual void OnMoveStart();
virtual void OnMoving(const wxRect& window_rect, wxDirection dir);
virtual void OnMoveFinished();
-
+
private:
void OnSize(wxSizeEvent& event);
void OnClose(wxCloseEvent& event);
void OnIdle(wxIdleEvent& event);
void OnActivate(wxActivateEvent& event);
static bool isMouseDown();
-
+
private:
wxWindow* m_pane_window; // pane window being managed
bool m_solid_drag; // true if system uses solid window drag
wxCairoLibrary();
~wxCairoLibrary();
-
+
bool IsOk();
bool InitializeMethods();
wxDynamicLibrary m_libCairo;
wxDynamicLibrary m_libPangoCairo;
-
+
// true if we successfully loaded the libraries and can use them
//
// note that this field must have this name as it's used by wxDL_XXX macros
WX_DECLARE_OBJC_HASHMAP(NSSlider);
// For when we're not in Objective-C mode:
-typedef struct objc_selector *SEL;
+typedef struct objc_selector *SEL;
class wxCocoaNSSliderLastSelectorChanger;
// Name: wx/cocoa/ObjcRef.h
// Purpose: wxObjcAutoRef template class
// Author: David Elliott
-// Modified by:
+// Modified by:
// Created: 2004/03/28
// RCS-ID: $Id$
// Copyright: (c) 2004 David Elliott <dfe@cox.net>
wxGCSafeRelease(m_obj); // release current object (if any)
m_obj = wxGCSafeRetain([[NSObject alloc] init]);
[m_obj release]; // balance alloc
-
+
Consider the effect on the retain count from each statement (alloc, CFRetain, release)
In RR mode: retainCount = 1, +1, -1
In GC mode: strongRetainCount = 0, +1, -0
it will use a method (currently CFRetain/CFRelease) to ensure the object will never be
finalized until this object is destroyed.
*/
-
+
template <class T>
class wxObjcAutoRefFromAlloc: wxObjcAutoRefBase
{
// Name: wx/cocoa/autorelease.h
// Purpose: Automatic NSAutoreleasePool functionality
// Author: David Elliott
-// Modified by:
+// Modified by:
// Created: 2003/07/11
// RCS-ID: $Id$
// Copyright: (c) 2003 David Elliott <dfe@cox.net>
virtual ~wxDirDialog();
virtual int ShowModal();
-
+
inline WX_NSSavePanel GetNSSavePanel()
{ return (WX_NSSavePanel)m_cocoaNSWindow; }
virtual void GetFilenames(wxArrayString& files) const;
virtual int ShowModal();
-
+
inline WX_NSSavePanel GetNSSavePanel()
{ return (WX_NSSavePanel)m_cocoaNSWindow; }
{
(void)Create(size, family, style, weight, underlined, face, encoding);
}
-
+
wxFont(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
Create(10, family, style, weight, underlined, face, encoding);
SetPixelSize(pixelSize);
}
-
+
/*! @abstract Construction with opaque wxNativeFontInfo
*/
wxFont(const wxNativeFontInfo& info)
// these methods get/set the length of the slider pointer in pixels
virtual void SetThumbLength(int lenPixels);
virtual int GetThumbLength() const;
-
+
// copied from (wxSliderCocoa.h)
virtual void SetTickFreq(int n, int pos);
virtual int GetTickFreq() const;
// Purpose: wxSound class (loads and plays short Windows .wav files).
// Optional on non-Windows platforms.
// Authors: David Elliott, Ryan Norton
-// Modified by:
+// Modified by:
// Created: 2004-10-02
// RCS-ID: $Id$
// Copyright: (c) 2004 David Elliott, Ryan Norton
void SetNSSound(WX_NSSound cocoaNSSound);
inline WX_NSSound GetNSSound()
{ return m_cocoaNSSound; }
-protected:
+protected:
bool DoPlay(unsigned flags) const;
bool LoadWAV(const wxUint8 *data, size_t length, bool copyData);
private:
wxString m_text; // tooltip text
wxWindow *m_window; // window we're associated with
-
+
DECLARE_ABSTRACT_CLASS(wxToolTip)
};
// should the focus be reset to the textctrl in idle time?
bool m_resetFocus;
-
+
private:
void Init();
}
#endif // wxHAS_CONFIG_TEMPLATE_RW
- // convenience functions returning directly the value
+ // convenience functions returning directly the value
wxString Read(const wxString& key,
const wxString& defVal = wxEmptyString) const
{ wxString s; (void)Read(key, &s, defVal); return s; }
#include "wx/gtk/dataobj2.h"
// wxURLDataObject defined in msw/ole/dataobj2.h
-#else
+#else
#if defined(__WXGTK__)
#include "wx/gtk1/dataobj2.h"
#elif defined(__WXX11__)
wxDataInputStream& operator>>(float& f);
void BigEndianOrdered(bool be_order) { m_be_order = be_order; }
-
+
#if wxUSE_UNICODE
void SetConv( const wxMBConv &conv );
wxMBConv *GetConv() const { return m_conv; }
#endif
wxGCDC();
virtual ~wxGCDC();
-
+
wxGraphicsContext* GetGraphicsContext();
void SetGraphicsContext( wxGraphicsContext* ctx );
-
+
DECLARE_DYNAMIC_CLASS(wxGCDC)
wxDECLARE_NO_COPY_CLASS(wxGCDC);
};
wxGCDCImpl( wxDC *owner, const wxPrinterDC& dc );
#endif
wxGCDCImpl( wxDC *owner );
-
+
virtual ~wxGCDCImpl();
void Init();
virtual void StartPage();
virtual void EndPage();
-
+
// flushing the content of this dc immediately onto screen
virtual void Flush();
wxGraphicsContext* GetGraphicsContext() { return m_graphicContext; }
virtual void SetGraphicsContext( wxGraphicsContext* ctx );
-
+
// the true implementations
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE);
virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
- wxRasterOperationMode rop = wxCOPY, bool useMask = false,
+ wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
virtual bool DoStretchBlit(wxCoord xdest, wxCoord ydest,
double m_formerScaleX, m_formerScaleY;
wxGraphicsContext* m_graphicContext;
-
+
DECLARE_CLASS(wxGCDCImpl)
wxDECLARE_NO_COPY_CLASS(wxGCDCImpl);
};
wxMemoryDC();
wxMemoryDC( wxBitmap& bitmap );
wxMemoryDC( wxDC *dc );
-
+
// select the given bitmap to draw on it
void SelectObject(wxBitmap& bmp);
// select the given bitmap for read-only
void SelectObjectAsSource(const wxBitmap& bmp);
-
+
// get selected bitmap
const wxBitmap& GetSelectedBitmap() const;
wxBitmap& GetSelectedBitmap();
private:
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
};
-
+
#endif
// _WX_DCMEMORY_H_BASE_
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord w, wxCoord h,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
- wxRasterOperationMode rop = wxCOPY,
+ wxRasterOperationMode rop = wxCOPY,
bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord)
{
{ return true; }
static bool StartDrawingOnTop(wxRect * WXUNUSED(rect) = NULL)
{ return true; }
- static bool EndDrawingOnTop()
+ static bool EndDrawingOnTop()
{ return true; }
private:
class WXDLLIMPEXP_CORE wxSVGFileDCImpl : public wxDCImpl
{
public:
- wxSVGFileDCImpl( wxSVGFileDC *owner, const wxString &filename,
+ wxSVGFileDCImpl( wxSVGFileDC *owner, const wxString &filename,
int width=320, int height=240, double dpi=72.0 );
virtual ~wxSVGFileDCImpl();
-
+
bool IsOk() const { return m_OK; }
virtual bool CanDrawBitmap() const { return true; }
virtual void DoDrawPoint(wxCoord, wxCoord);
- virtual void DoDrawPolygon(int n, wxPoint points[],
+ virtual void DoDrawPolygon(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle);
}
virtual void DoGetSizeMM( int *width, int *height ) const;
-
+
virtual wxSize GetPPI() const;
void Init (const wxString &filename, int width, int height, double dpi);
class WXDLLIMPEXP_CORE wxSVGFileDC : public wxDC
{
public:
- wxSVGFileDC(const wxString& filename,
+ wxSVGFileDC(const wxString& filename,
int width = 320,
int height = 240,
double dpi = 72.0)
: wxDC(new wxSVGFileDCImpl(this, filename, width, height, dpi))
- {
+ {
}
};
{
Create(size, family, style, weight, underlined, face, encoding);
}
-
+
wxFont(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
Create(10, family, style, weight, underlined, face, encoding);
SetPixelSize(pixelSize);
}
-
+
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
enum wxDialogModality
{
- wxDIALOG_MODALITY_NONE = 0,
- wxDIALOG_MODALITY_WINDOW_MODAL = 1,
- wxDIALOG_MODALITY_APP_MODAL = 2
+ wxDIALOG_MODALITY_NONE = 0,
+ wxDIALOG_MODALITY_WINDOW_MODAL = 1,
+ wxDIALOG_MODALITY_APP_MODAL = 2
};
extern WXDLLIMPEXP_DATA_CORE(const char) wxDialogNameStr[];
wxDialog *GetDialog() const
{ return wxStaticCast(GetEventObject(), wxDialog); }
-
- int GetReturnCode() const
+
+ int GetReturnCode() const
{ return GetDialog()->GetReturnCode(); }
virtual wxEvent *Clone() const { return new wxWindowModalDialogEvent (*this); }
public:
/*
derived classes should provide the following ctors:
-
+
wxFont();
wxFont(const wxString& nativeFontInfoString);
wxFont(const wxNativeFontInfo& info);
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
*/
-
+
// creator function
virtual ~wxFontBase();
void Free();
void EnsureValid();
-
+
bool m_descriptorValid;
#if wxOSX_USE_CORE_TEXT
CTFontDescriptorRef m_ctFontDescriptor;
// in-place editing
virtual bool HasEditorCtrl() const;
- virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
+ virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
const wxVariant &value );
virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
virtual wxSize GetSize() const;
virtual bool HasEditorCtrl() const { return true; }
- virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
+ virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
const wxVariant &value );
virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
virtual bool Render( wxRect cell, wxDC *dc, int state );
virtual wxSize GetSize() const;
virtual bool Activate( wxRect cell,
- wxDataViewModel *model,
- const wxDataViewItem& item,
+ wxDataViewModel *model,
+ const wxDataViewItem& item,
unsigned int col );
private:
virtual void EnsureVisible( const wxDataViewItem & item,
const wxDataViewColumn *column = NULL );
- virtual void HitTest( const wxPoint & point, wxDataViewItem & item,
+ virtual void HitTest( const wxPoint & point, wxDataViewItem & item,
wxDataViewColumn* &column ) const;
- virtual wxRect GetItemRect( const wxDataViewItem & item,
+ virtual wxRect GetItemRect( const wxDataViewItem & item,
const wxDataViewColumn *column = NULL ) const;
virtual void Expand( const wxDataViewItem & item );
virtual wxRect GetPaperRect() const;
protected:
- bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col,
+ bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col,
wxFloodFillStyle style = wxFLOOD_SURFACE);
bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const;
void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea);
void DoDrawPoint(wxCoord x, wxCoord y);
void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0);
- void DoDrawPolygon(int n, wxPoint points[],
- wxCoord xoffset = 0, wxCoord yoffset = 0,
+ void DoDrawPolygon(int n, wxPoint points[],
+ wxCoord xoffset = 0, wxCoord yoffset = 0,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
- void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
- wxCoord xoffset = 0, wxCoord yoffset = 0,
+ void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
+ wxCoord xoffset = 0, wxCoord yoffset = 0,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20);
void DoDrawSpline(const wxPointList *points);
#endif
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
- wxDC *source, wxCoord xsrc, wxCoord ysrc,
+ wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
virtual wxBitmap GetBitmap() const { return m_bitmap; }
- virtual void SetIcon(const wxIcon& icon)
- {
- m_bitmap.CopyFromIcon(icon);
+ virtual void SetIcon(const wxIcon& icon)
+ {
+ m_bitmap.CopyFromIcon(icon);
SetInitialSize(GetBitmapSize());
Refresh();
}
private:
- wxSize GetBitmapSize()
+ wxSize GetBitmapSize()
{
return m_bitmap.Ok() ? wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight())
: wxSize(16, 16); // this is completely arbitrary
wxCursor m_oldCursor; // cursor is changed while dragging
wxGenericTreeItem *m_oldSelection;
wxGenericTreeItem *m_underMouse; // for visual effects
-
+
enum { NoEffect, BorderEffect, AboveEffect, BelowEffect } m_dndEffect;
- wxGenericTreeItem *m_dndEffectItem;
-
+ wxGenericTreeItem *m_dndEffectItem;
+
wxTreeTextCtrl *m_textCtrl;
-
+
wxTimer *m_renameTimer;
// the common part of all ctors
void Init();
- // overridden wxWindow methods
+ // overridden wxWindow methods
virtual void DoThaw();
// misc helpers
wxGIFErrorCode dgif(wxInputStream& stream,
GIFImage *img, int interl, int bits);
-
+
// array of all frames
wxArrayPtrVoid m_frames;
// miscellaneous helper functions
// ------------------------------
-#ifndef wxHAS_OPENGL_ES
+#ifndef wxHAS_OPENGL_ES
// call glcolor() for the colour with the given name, return false if
// colour not found
bool SetColour(const wxString& colour);
{
// R = Result, S = Source, D = Destination, premultiplied with alpha
// Ra, Sa, Da their alpha components
-
+
// classic Porter-Duff compositions
// http://keithp.com/~keithp/porterduff/p253-porter.pdf
-
+
wxCOMPOSITION_CLEAR, /* R = 0 */
wxCOMPOSITION_SOURCE, /* R = S */
wxCOMPOSITION_OVER, /* R = S + D*(1 - Sa) */
wxCOMPOSITION_DEST_OUT, /* R = D*(1 - Sa) */
wxCOMPOSITION_DEST_ATOP, /* R = S*(1 - Da) + D*Sa */
wxCOMPOSITION_XOR, /* R = S*(1 - Da) + D*(1 - Sa) */
-
+
// mathematical compositions
wxCOMPOSITION_ADD, /* R = S + D */
};
// returns the current shape antialiasing mode
virtual wxAntialiasMode GetAntialiasMode() const { return m_antialias; }
-
+
// sets the antialiasing mode, returns true if it supported
virtual bool SetAntialiasMode(wxAntialiasMode antialias) = 0;
// returns the current compositing operator
virtual wxCompositionMode GetCompositionMode() const { return m_composition; }
-
+
// sets the compositing operator, returns true if it supported
virtual bool SetCompositionMode(wxCompositionMode op) = 0;
// all rendering is done into a fully transparent temporary context
virtual void BeginLayer(wxDouble opacity) = 0;
- // composites back the drawings into the context with the opacity given at
+ // composites back the drawings into the context with the opacity given at
// the BeginLayer call
virtual void EndLayer() = 0;
{
public:
wxBitmap() { }
- wxBitmap( int width, int height, int depth = wxBITMAP_SCREEN_DEPTH )
+ wxBitmap( int width, int height, int depth = wxBITMAP_SCREEN_DEPTH )
{ Create(width, height, depth); }
- wxBitmap( const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH )
+ wxBitmap( const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH )
{ Create(sz, depth); }
wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const char* const* bits );
virtual bool CanGetTextExtent() const { return true; }
virtual void DoGetSize(int *width, int *height) const;
- virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col,
+ virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style=wxFLOOD_SURFACE );
virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const;
virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y,
bool useMask = false );
- virtual bool DoBlit( wxCoord xdest, wxCoord ydest,
+ virtual bool DoBlit( wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
- wxRasterOperationMode logical_func = wxCOPY,
- bool useMask = false,
+ wxRasterOperationMode logical_func = wxCOPY,
+ bool useMask = false,
wxCoord xsrcMask = -1, wxCoord ysrcMask = -1 );
virtual void DoDrawText( const wxString &text, wxCoord x, wxCoord y );
wxMemoryDCImpl( wxMemoryDC *owner );
wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap );
wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc );
-
+
virtual ~wxMemoryDCImpl();
// these get reimplemented for mono-bitmaps to behave
private:
wxBitmap m_selected;
-
+
void Init();
DECLARE_ABSTRACT_CLASS(wxMemoryDCImpl)
};
-#endif
+#endif
// _WX_GTK_DCMEMORY_H_
void StoreGdkEventForLaterProcessing(GdkEvent* ev)
{ m_arrGdkEvents.Add(ev); }
-
+
protected:
// the exit code of this event loop
GtkFileChooser *m_widget;
// First wildcard in filter, to be used when the user
// saves a file without giving an extension.
- wxArrayString m_wildcards;
+ wxArrayString m_wildcards;
};
#if wxUSE_FILECTRL
Create(10, family, style, weight, underlined, face, encoding);
SetPixelSize(pixelSize);
}
-
+
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
void SetPalette(const wxPalette& WXUNUSED(palette)) { }
protected:
- bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col,
+ bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col,
wxFloodFillStyle style=wxFLOOD_SURFACE );
bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const;
void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
void DoDrawSpline(const wxPointList *points);
#endif
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
- wxDC *source, wxCoord xsrc, wxCoord ysrc,
+ wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
void DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y );
};
#endif
- // wxUSE_MIMETYPE
+ // wxUSE_MIMETYPE
#endif
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
virtual bool Show(bool show = true);
-
+
virtual void SetFocus();
// implementation
virtual wxRect GetPaperRect() const;
protected:
- bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col,
+ bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col,
wxFloodFillStyle style=wxFLOOD_SURFACE );
void DoGradientFillConcentric(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, const wxPoint& circleCenter);
void DoGradientFillLinear(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, wxDirection nDirection = wxEAST);
void DoDrawSpline(const wxPointList *points);
#endif
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
- wxDC *source, wxCoord xsrc, wxCoord ysrc,
+ wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
void DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y );
InitRect(rect.x, rect.y, rect.width, rect.height);
}
- wxRegion( size_t n, const wxPoint *points,
+ wxRegion( size_t n, const wxPoint *points,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
#if wxUSE_IMAGE
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
-
+
protected:
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
-
+
virtual bool Enable( bool enable = true );
// implementation
protected:
void GtkDisableEvents() const;
void GtkEnableEvents() const;
-
+
virtual wxSize DoGetBestSize() const;
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
-
+
private:
wxBitmap m_bitmap;
virtual void GTKWidgetDoSetMnemonic(GtkWidget* w);
void DoApplyWidgetStyle(GtkRcStyle *style);
-
+
private:
DECLARE_DYNAMIC_CLASS(wxStaticBox)
};
void gtk_tree_entry_set_userdata (GtkTreeEntry* entry, gpointer userdata);
WXDLLIMPEXP_CORE
-void gtk_tree_entry_set_destroy_func (GtkTreeEntry* entry,
+void gtk_tree_entry_set_destroy_func (GtkTreeEntry* entry,
GtkTreeEntryDestroy destroy_func,
gpointer destroy_func_data);
{
Create(size, family, style, weight, underlined, face, encoding);
}
-
+
wxFont(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
Create(10, family, style, weight, underlined, face, encoding);
SetPixelSize(pixelSize);
}
-
+
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
virtual bool DoLoadFile( wxImage *image, wxInputStream& stream, bool verbose, int index );
-
+
protected:
virtual int DoGetImageCount( wxInputStream& stream );
virtual bool DoCanRead( wxInputStream& stream );
#if wxUSE_STREAMS
// NOTE: LoadFile and SaveFile are not pure virtuals to allow derived classes
// to implement only one of the two
- virtual bool LoadFile( wxImage *WXUNUSED(image), wxInputStream& WXUNUSED(stream),
+ virtual bool LoadFile( wxImage *WXUNUSED(image), wxInputStream& WXUNUSED(stream),
bool WXUNUSED(verbose)=true, int WXUNUSED(index)=-1 )
{ return false; }
- virtual bool SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream),
+ virtual bool SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream),
bool WXUNUSED(verbose)=true )
{ return false; }
#if wxUSE_STREAMS
// NOTE: this function is allowed to change the current stream position
// since GetImageCount() will take care of restoring it later
- virtual int DoGetImageCount( wxInputStream& WXUNUSED(stream) )
+ virtual int DoGetImageCount( wxInputStream& WXUNUSED(stream) )
{ return 1; } // default return value is 1 image
-
+
// NOTE: this function is allowed to change the current stream position
// since CallDoCanRead() will take care of restoring it later
virtual bool DoCanRead( wxInputStream& stream ) = 0;
bool Create( int width, int height, bool clear = true );
bool Create( int width, int height, unsigned char* data, bool static_data = false );
bool Create( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false );
-
+
// Create() variants using wxSize:
bool Create( const wxSize& sz, bool clear = true )
{ return Create(sz.GetWidth(), sz.GetHeight(), clear); }
{ return Create(sz.GetWidth(), sz.GetHeight(), data, alpha, static_data); }
void Destroy();
-
+
// initialize the image data with zeroes
void Clear(unsigned char value = 0);
wxDO_LOG(level)
// wxLogFatalError() is special as it can't be disabled
-#define wxLogFatalError wxDO_LOG(FatalError)
+#define wxLogFatalError wxDO_LOG(FatalError)
#define wxVLogFatalError(format, argptr) wxDO_LOGV(FatalError, format, argptr)
#define wxLogError wxDO_LOG_IF_ENABLED(Error)
#if WXWIN_COMPATIBILITY_2_8
// get or change the label of the menu at given position
// Deprecated in favour of SetMenuLabel
- wxDEPRECATED( void SetLabelTop(size_t pos, const wxString& label) );
+ wxDEPRECATED( void SetLabelTop(size_t pos, const wxString& label) );
// Deprecated in favour of GetMenuLabelText
wxDEPRECATED( wxString GetLabelTop(size_t pos) const );
#endif
template <class D, class B>
struct wxConvertibleTo_SizeHelper
{
- static char Match(B* pb);
- static int Match(...);
+ static char Match(B* pb);
+ static int Match(...);
};
// Helper to decide if an object of type D is convertible to type B (the test
template <class D, class B>
struct wxConvertibleTo
{
- enum { value = sizeof(wxConvertibleTo_SizeHelper<D,B>::Match(static_cast<D*>(NULL)))==sizeof(char)
- };
+ enum
+ {
+ value =
+ sizeof(wxConvertibleTo_SizeHelper<D,B>::Match(static_cast<D*>(NULL)))
+ ==
+ sizeof(char)
+ };
};
#endif // _WX_META_CONVERTIBLE_H_
} // namespace wxPrivate
-// wxIf<> template defines nested type "value" which is the same as
+// wxIf<> template defines nested type "value" which is the same as
// TTrue if the condition Cond (boolean compile-time constant) was met and
// TFalse if it wasn't.
//
/////////////////////////////////////////////////////////////////////////////
// Name: wx/meta/int2type.h
-// Purpose: Generate a unique type from a constant integer
+// Purpose: Generate a unique type from a constant integer
// Author: Arne Steinarson
// Created: 2008-01-10
// RCS-ID: $Id$
// implementation
wxBitmap m_selected;
-
+
wxBitmap GetSelectedObject() const { return m_selected; }
protected:
static bool StartDrawingOnTop(wxWindow *WXUNUSED(window)) { return TRUE; }
static bool StartDrawingOnTop(wxRect *WXUNUSED(rect) = NULL) { return TRUE; }
static bool EndDrawingOnTop() { return TRUE; }
-
+
private:
DECLARE_DYNAMIC_CLASS(wxScreenDC)
};
{
Create(size, family, style, weight, underlined, face, encoding);
}
-
+
wxFont(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
Create(10, family, style, weight, underlined, face, encoding);
SetPixelSize(pixelSize);
}
-
+
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
(flags & wxBORDER_MASK) | wxPOPUP_WINDOW);
}
-protected:
+protected:
DECLARE_DYNAMIC_CLASS(wxPopupWindow)
};
static void Set( wxMimeTypesManagerFactory *factory );
static wxMimeTypesManagerFactory *Get();
-
+
private:
static wxMimeTypesManagerFactory *m_factory;
};
{
Create(size, family, style, weight, underlined, face, encoding);
}
-
+
wxFont(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
Create(10, family, style, weight, underlined, face, encoding);
SetPixelSize(pixelSize);
}
-
+
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
- wxRasterOperationMode rop = wxCOPY, bool useMask = false,
+ wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
virtual bool DoStretchBlit(wxCoord xdest, wxCoord ydest,
{
public:
wxPaintDCEx(wxWindow *canvas, WXHDC dc);
-
+
DECLARE_CLASS(wxPaintDCEx)
wxDECLARE_NO_COPY_CLASS(wxPaintDCEx);
};
virtual void DoGetSize(int* width, int* height) const;
virtual void DoSelect(const wxBitmap& bitmap);
- virtual wxBitmap DoGetAsBitmap(const wxRect* subrect) const
+ virtual wxBitmap DoGetAsBitmap(const wxRect* subrect) const
{ return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmapOfHDC(*subrect, GetHDC() );}
protected:
{
Create(size, family, style, weight, underlined, face, encoding);
}
-
+
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
public:
wxWindowsPrintNativeData();
virtual ~wxWindowsPrintNativeData();
-
+
virtual bool TransferTo( wxPrintData &data );
virtual bool TransferFrom( const wxPrintData &data );
-
+
virtual bool Ok() const { return IsOk(); }
virtual bool IsOk() const;
-
+
void* GetDevMode() const { return m_devMode; }
void SetDevMode(void* data) { m_devMode = data; }
void* GetDevNames() const { return m_devNames; }
void SetDevNames(void* data) { m_devNames = data; }
-
+
private:
void* m_devMode;
void* m_devNames;
private:
DECLARE_DYNAMIC_CLASS(wxWindowsPrintNativeData)
};
-
+
// ---------------------------------------------------------------------------
// wxWindowsPrintDialog: the MSW dialog for printing
// ---------------------------------------------------------------------------
wxPrinterDC* m_printerDC;
bool m_destroyDC;
wxWindow* m_dialogParent;
-
+
private:
bool ConvertToNative( wxPrintDialogData &data );
bool ConvertFromNative( wxPrintDialogData &data );
-
+
// holds MSW handle
void* m_printDlg;
};
// ---------------------------------------------------------------------------
-// wxWindowsPageSetupDialog: the MSW page setup dialog
+// wxWindowsPageSetupDialog: the MSW page setup dialog
// ---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowsPageSetupDialog: public wxPageSetupDialogBase
private:
wxPageSetupDialogData m_pageSetupData;
wxWindow* m_dialogParent;
-
+
// holds MSW handle
void* m_pageDlg;
WXHWND m_hwndBuddy;
WXFARPROC m_wndProcBuddy;
- // Block text update event after SetValue()
+ // Block text update event after SetValue()
bool m_blockEvent;
// all existing wxSpinCtrls - this allows to find the one corresponding to
// Implementation from now on
// --------------------------
-
+
#if wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT
virtual void SetDropTarget(wxDropTarget *dropTarget);
#endif // wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT
protected:
void Init();
-
+
wxBitmap m_bitmap;
wxBitmap m_disabledBitmap;
bool m_capturing;
bool m_depressed,m_oldValue;
-
+
void OnPaint(wxPaintEvent &event);
void OnMouse(wxMouseEvent &event);
void OnChar(wxKeyEvent &event);
// ctor & dtor
wxToolTip(const wxString &tip);
virtual ~wxToolTip();
-
+
// ctor used by wxStatusBar to associate a tooltip to a portion of
// the status bar window:
- wxToolTip(wxWindow* win, unsigned int id,
+ wxToolTip(wxWindow* win, unsigned int id,
const wxString &tip, const wxRect& rc);
// accessors
// check if a native double-buffering applies for this window
virtual bool IsDoubleBuffered() const;
-
+
void SetDoubleBuffered(bool on);
-
+
// synthesize a wxEVT_LEAVE_WINDOW event and set m_mouseInWindow to false
void GenerateMouseLeave();
// #undef the macros defined in winsows.h which conflict with code elsewhere
#include "wx/msw/winundef.h"
-// Types DWORD_PTR, ULONG_PTR and so on are used for 64-bit compatability
+// Types DWORD_PTR, ULONG_PTR and so on are used for 64-bit compatability
// in the WINAPI SDK (they are an integral type that is the size of a
-// pointer) on MSVC 7 and later. However, they are not available in older
-// Platform SDKs, and since they are typedefs and not #defines we simply
+// pointer) on MSVC 7 and later. However, they are not available in older
+// Platform SDKs, and since they are typedefs and not #defines we simply
// overwrite them if there is a chance that they're not defined
#if (!defined(_MSC_VER) || (_MSC_VER < 1300)) && !defined(__WIN64__)
#define UINT_PTR unsigned int
);
virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH)
{ return Create(sz.GetWidth(), sz.GetHeight(), depth); }
-
+
virtual bool Create( const void* pData
,wxBitmapType lType
,int nWidth
virtual void DoGetSize(int* pWidth, int* pHeight) const;
virtual void DoSelect(const wxBitmap& bitmap);
- virtual wxBitmap DoGetAsBitmap(const wxRect* subrect) const
+ virtual wxBitmap DoGetAsBitmap(const wxRect* subrect) const
{ return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect);}
protected:
{
Create(size, family, style, weight, underlined, face, encoding);
}
-
+
wxFont(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
Create(10, family, style, weight, underlined, face, encoding);
SetPixelSize(pixelSize);
}
-
+
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
///////////////////////////////////////////////////////////////////////////////
// Name: wx/os2/listctrl.h
// Purpose: wxListCtrl class
-// Author:
+// Author:
// Modified by:
-// Created:
+// Created:
// RCS-ID: $Id$
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
//
// Return the icon for the given item. In report view, OnGetItemImage will
- // only be called for the first column. See OnGetItemColumnImage for
+ // only be called for the first column. See OnGetItemColumnImage for
// details.
//
virtual int OnGetItemImage(long lItem) const;
protected:
bool Free();
-
+
bool DoPlay(unsigned flags) const;
private:
{
SetMargins(wxDEFAULT_BUTTON_MARGIN, wxDEFAULT_BUTTON_MARGIN);
}
-
+
wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
const wxString& name = wxButtonNameStr);
protected:
- virtual wxSize DoGetBestSize() const;
+ virtual wxSize DoGetBestSize() const;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
#define wxOSX_USE_NATIVE_TOOLBAR 1
#endif
-/*
- * text rendering system
+/*
+ * text rendering system
*/
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
{
return this->m_PropertyID;
}
-
+
void SetPropertyID(DataBrowserPropertyID newPropertyID)
{
this->m_PropertyID = newPropertyID;
OSStatus GetPropertyFlags (DataBrowserPropertyID propertyID, DataBrowserPropertyFlags *flags ) const;
OSStatus GetPropertyID (DataBrowserItemDataRef itemData, DataBrowserPropertyID* propertyID) const; // returns for the passed item data reference the corresponding property ID
OSStatus GetPropertyID (DataBrowserTableViewColumnIndex index, DataBrowserPropertyID* propertyID) const; // returns for the passed column index the corresponding property ID
-
+
OSStatus IsUsedPropertyID(DataBrowserPropertyID propertyID) const; // checks if passed property id is used by the control; no error is returned if the id exists
OSStatus RemoveColumnByProperty(DataBrowserTableViewColumnID propertyID);
// container handling
//
OSStatus CloseContainer(DataBrowserItemID containerID);
-
+
OSStatus OpenContainer(DataBrowserItemID containerID);
protected :
// event handler for hit testing
///
void* m_macDataViewCtrlEventHandler;
-
+
private:
//
// wxWidget internal stuff
virtual bool IsVisible() const;
virtual void Raise();
-
+
virtual void Lower();
virtual void ScrollRect( const wxRect *rect, int dx, int dy );
- virtual void GetContentArea( int &left , int &top , int &width , int &height ) const;
+ 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;
// where is in native window relative coordinates
virtual void SetNeedsDisplay( const wxRect* where = NULL );
virtual bool GetNeedsDisplay() const;
-
+
virtual bool CanFocus() const;
// return true if successful
virtual bool SetFocus();
void RemoveFromParent();
void Embed( wxWidgetImpl *parent );
-
+
void SetDefaultButton( bool isDefault );
void PerformClick();
void SetLabel( const wxString& title, wxFontEncoding encoding );
virtual wxInt32 GetMaximum() const;
virtual wxInt32 GetMinimum() const;
-
+
virtual void SetValueAndRange( SInt32 value , SInt32 minimum , SInt32 maximum );
virtual void SetRange( SInt32 minimum , SInt32 maximum );
virtual void GetFeatures( UInt32 *features );
-
+
// to be moved into a tab control class
virtual OSStatus SetTabEnabled( SInt16 tabNo , bool enable );
} ;
*/
-class WXDLLIMPEXP_CORE wxMacDataItem
+class WXDLLIMPEXP_CORE wxMacDataItem
{
public :
wxMacDataItem();
class WXDLLIMPEXP_CORE wxMacDataBrowserColumn : public wxListWidgetColumn
{
public :
- wxMacDataBrowserColumn( DataBrowserPropertyID propertyId, DataBrowserPropertyType colType, bool editable )
+ wxMacDataBrowserColumn( DataBrowserPropertyID propertyId, DataBrowserPropertyType colType, bool editable )
: m_property(propertyId), m_editable(editable), m_type( colType )
{
}
{
}
DataBrowserPropertyID GetProperty() const { return m_property ; }
-
+
bool IsEditable() const { return m_editable; }
-
+
DataBrowserPropertyType GetType() const { return m_type; }
protected :
public :
wxMacDataBrowserCellValue(DataBrowserItemDataRef data) : m_data(data) {}
virtual ~wxMacDataBrowserCellValue() {}
-
+
virtual void Set( CFStringRef value );
virtual void Set( const wxString& value );
virtual void Set( int value ) ;
virtual void Check( bool check );
-
+
virtual int GetIntValue() const ;
virtual wxString GetStringValue() const ;
protected :
wxListWidgetColumn* InsertTextColumn( unsigned int pos, const wxString& title, bool editable = false,
wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) ;
- wxListWidgetColumn* InsertCheckColumn( unsigned int pos , const wxString& title, bool editable = false,
+ wxListWidgetColumn* InsertCheckColumn( unsigned int pos , const wxString& title, bool editable = false,
wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) ;
- wxMacDataBrowserColumn* DoInsertColumn( unsigned int pos, DataBrowserPropertyID property,
+ wxMacDataBrowserColumn* DoInsertColumn( unsigned int pos, DataBrowserPropertyID property,
const wxString& title, bool editable,
DataBrowserPropertyType colType, SInt16 just, int width );
// add and remove
wxNonOwnedWindowCarbonImpl( wxNonOwnedWindow* nonownedwnd) ;
wxNonOwnedWindowCarbonImpl();
virtual ~wxNonOwnedWindowCarbonImpl();
-
+
virtual void Destroy() ;
void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) ;
-
+
WXWindow GetWXWindow() const;
- void Raise();
+ void Raise();
void Lower();
- bool Show(bool show);
+ bool Show(bool show);
bool ShowWithEffect(bool show, wxShowEffect effect, unsigned timeout);
-
+
void Update();
bool SetTransparent(wxByte alpha);
bool SetBackgroundColour(const wxColour& col );
- void SetExtraStyle( long exStyle );
- bool SetBackgroundStyle(wxBackgroundStyle style);
+ void SetExtraStyle( long exStyle );
+ bool SetBackgroundStyle(wxBackgroundStyle style);
bool CanSetTransparent();
void MoveWindow(int x, int y, int width, int height);
void GetPosition( int &x, int &y ) const;
void GetSize( int &width, int &height ) const;
- void GetContentArea( int &left , int &top , int &width , int &height ) const;
+ void GetContentArea( int &left , int &top , int &width , int &height ) const;
bool SetShape(const wxRegion& region);
virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) ;
-
+
virtual bool IsMaximized() const;
-
+
virtual bool IsIconized() const;
-
+
virtual void Iconize( bool iconize );
-
+
virtual void Maximize(bool maximize);
-
+
virtual bool IsFullScreen() const;
-
+
virtual bool ShowFullScreen(bool show, long style);
virtual void RequestUserAttention(int flags);
-
+
virtual void ScreenToWindow( int *x, int *y );
-
+
virtual void WindowToScreen( int *x, int *y );
-
+
bool MacGetUnifiedAppearance() const ;
void MacChangeWindowAttributes( wxUint32 attributesToSet , wxUint32 attributesToClear ) ;
void MacSetMetalAppearance( bool set ) ;
bool MacGetMetalAppearance() const ;
void MacSetUnifiedAppearance( bool set );
-
+
WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; }
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
protected :
void MacInstallTopLevelWindowEventHandler();
-
+
WXEVENTHANDLERREF m_macEventHandler ;
WindowRef m_macWindow;
void * m_macFullScreenData ;
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCarbonImpl)
-};
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCarbonImpl)
+};
#endif // wxUSE_GUI
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 ;
virtual void TransferFrom( wxPrintDialogData * );
virtual void TransferTo( wxPrintDialogData * );
-
- PMPrintSession GetPrintSession() { return m_macPrintSession; }
- PMPageFormat GetPageFormat() { return m_macPageFormat; }
- PMPrintSettings GetPrintSettings() { return m_macPrintSettings; }
+
+ PMPrintSession GetPrintSession() { return m_macPrintSession; }
+ PMPageFormat GetPageFormat() { return m_macPageFormat; }
+ PMPrintSettings GetPrintSettings() { return m_macPrintSettings; }
protected :
virtual void UpdateFromPMState();
virtual void UpdateToPMState();
virtual wxSize DoGetBestSize() const;
wxBitmap m_bitmap;
- DECLARE_EVENT_TABLE()
+ DECLARE_EVENT_TABLE()
};
#endif
virtual void Command(wxCommandEvent& event);
// osx specific event handling common for all osx-ports
-
+
virtual bool OSXHandleClicked( double timestampsec );
protected:
void DoSet3StateValue(wxCheckBoxState val);
// the array containing the checked status of the items
wxArrayInt m_checks;
-
+
wxListWidgetColumn* m_checkColumn ;
void Init();
* we only use core graphics now on all builds, try to catch attempts
* to configure the build otherwise and give error messages
*/
-
+
#if !wxUSE_GRAPHICS_CONTEXT || ( defined( wxMAC_USE_CORE_GRAPHICS ) && !wxMAC_USE_CORE_GRAPHICS )
# error "OS X builds use CoreGraphics in this wx version, you cannot turn back to QuickDraw completely"
#endif
/*
* using mixins of cocoa functionality
*/
-
+
#ifdef __WXOSX_COCOA__
#define wxOSX_USE_COCOA 1
#else
/*
* combination flags
*/
-
+
#if wxOSX_USE_COCOA || wxOSX_USE_CARBON
#define wxOSX_USE_COCOA_OR_CARBON 1
#else
virtual wxString GetString(unsigned int n) const ;
virtual void SetString(unsigned int pos, const wxString& s);
// osx specific event handling common for all osx-ports
-
+
virtual bool OSXHandleClicked( double timestampsec );
protected:
#define wxOSX_USE_NATIVE_TOOLBAR 1
#endif
-/*
- * text rendering system
+/*
+ * text rendering system
*/
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
{
return this->m_NativeColumnPtr;
}
-
+
void SetNativeColumnPtr(NSTableColumn* newNativeColumnPtr)
{
this->m_NativeColumnPtr = newNativeColumnPtr;
NSMutableArray* children; // buffered children
NSMutableSet* items; // stores all items that are in use by the control
-
+
wxCocoaDataViewControl* implementation;
-
+
wxDataViewModel* model;
-
+
wxPointerObject* currentParentItem; // parent of the buffered children; the object is owned
}
@private
CGFloat xImageShift; // shift for the image in x-direction from border
CGFloat spaceImageText; // space between image and text ("belongs" to the image)
-
+
NSImage* image; // the image itself
-
+
NSSize imageSize; // largest size of the image; default size is (16, 16)
-
+
NSTextAlignment cellAlignment; // the text alignment is used to align the whole
// cell (image and text)
}
class WXDLLIMPEXP_CORE wxWidgetCocoaImpl : public wxWidgetImpl
{
public :
- wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false ) ;
- wxWidgetCocoaImpl() ;
- ~wxWidgetCocoaImpl();
-
+ wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false ) ;
+ wxWidgetCocoaImpl() ;
+ ~wxWidgetCocoaImpl();
+
void Init();
-
+
virtual bool IsVisible() const ;
virtual void SetVisibility(bool);
virtual void Raise();
-
+
virtual void Lower();
virtual void ScrollRect( const wxRect *rect, int dx, int dy );
void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
void InstallEventHandler( WXWidget control = NULL );
-
- virtual bool DoHandleMouseEvent(NSEvent *event);
+
+ virtual bool DoHandleMouseEvent(NSEvent *event);
virtual bool DoHandleKeyEvent(NSEvent *event);
virtual bool DoHandleCharEvent(NSEvent *event, NSString *text);
- virtual void DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* otherWindow);
+ virtual void DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* otherWindow);
void SetFlipped(bool flipped);
virtual bool IsFlipped() const { return m_isFlipped; }
virtual void resetCursorRects(WXWidget slf, void* _cmd);
virtual bool isFlipped(WXWidget slf, void* _cmd);
virtual void drawRect(void* rect, WXWidget slf, void* _cmd);
-
+
virtual void controlAction(WXWidget slf, void* _cmd, void* sender);
virtual void controlDoubleAction(WXWidget slf, void* _cmd, void *sender);
NSEvent* m_lastKeyDownEvent;
bool m_isFlipped;
// if it the control has an editor, that editor will already send some
- // events, don't resend them
+ // events, don't resend them
bool m_hasEditor;
-
+
DECLARE_DYNAMIC_CLASS_NO_COPY(wxWidgetCocoaImpl)
};
public :
wxNonOwnedWindowCocoaImpl( wxNonOwnedWindow* nonownedwnd) ;
wxNonOwnedWindowCocoaImpl();
-
+
virtual ~wxNonOwnedWindowCocoaImpl();
-
+
virtual void Destroy() ;
void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) ;
-
+
WXWindow GetWXWindow() const;
- void Raise();
+ void Raise();
void Lower();
- bool Show(bool show);
+ bool Show(bool show);
bool ShowWithEffect(bool show, wxShowEffect effect, unsigned timeout);
-
+
void Update();
bool SetTransparent(wxByte alpha);
bool SetBackgroundColour(const wxColour& col );
- void SetExtraStyle( long exStyle );
- bool SetBackgroundStyle(wxBackgroundStyle style);
+ void SetExtraStyle( long exStyle );
+ bool SetBackgroundStyle(wxBackgroundStyle style);
bool CanSetTransparent();
void MoveWindow(int x, int y, int width, int height);
void GetPosition( int &x, int &y ) const;
void GetSize( int &width, int &height ) const;
- void GetContentArea( int &left , int &top , int &width , int &height ) const;
+ void GetContentArea( int &left , int &top , int &width , int &height ) const;
bool SetShape(const wxRegion& region);
-
+
virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) ;
-
+
virtual bool IsMaximized() const;
-
+
virtual bool IsIconized() const;
-
+
virtual void Iconize( bool iconize );
-
+
virtual void Maximize(bool maximize);
-
+
virtual bool IsFullScreen() const;
-
+
virtual bool ShowFullScreen(bool show, long style);
virtual void RequestUserAttention(int flags);
-
+
virtual void ScreenToWindow( int *x, int *y );
-
+
virtual void WindowToScreen( int *x, int *y );
-
+
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
protected :
WX_wxNSWindow m_macWindow;
void * m_macFullScreenData ;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCocoaImpl)
-};
+};
#ifdef __OBJC__
WXDLLIMPEXP_CORE wxRect wxFromNSRect( NSView* parent, const NSRect& rect );
WXDLLIMPEXP_CORE NSPoint wxToNSPoint( NSView* parent, const wxPoint& p );
WXDLLIMPEXP_CORE wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p );
-
- NSRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
+
+ NSRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
bool adjustForOrigin = true );
-
+
// used for many wxControls
-
+
@interface wxNSButton : NSButton
{
}
-
+
@end
@interface wxNSBox : NSBox
@interface wxNSTextView : NSTextView
{
}
-
+
@end
@interface wxNSMenu : NSMenu
- (void) setImplementation:(wxMenuImpl*) item;
- (wxMenuImpl*) implementation;
- @end
+ @end
@interface wxNSMenuItem : NSMenuItem
{
- (void)clickedAction:(id)sender;
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem;
- @end
-
+ @end
+
void WXDLLIMPEXP_CORE wxOSXCocoaClassAddWXMethods(Class c);
/*
virtual void GetSelection( long* from, long* to) const ;
virtual void SetSelection( long from , long to );
virtual void WriteText(const wxString& str) ;
-
+
virtual void controlAction(WXWidget slf, void* _cmd, void *sender);
protected :
NSTextField* m_textField;
// Name: config_xcode.pch
// Purpose: configurations for xcode builds
// Author: Stefan Csomor
-// Modified by:
+// Modified by:
// Created: 29.04.04
// RCS-ID: $Id$
// Copyright: (c) wxWidgets team
#define HAVE_STDLIB_H 1
// OBSOLETE ?
-
+
#define HAVE_COS 1
#define HAVE_FLOOR 1
#define HAVE_INTTYPES_H 1
// Name: wx/mac/corefoundation/cfdata.h
// Purpose: wxCFDataRef class
// Author: Stefan Csomor
-// Modified by:
+// Modified by:
// Created: 2007/05/10
// RCS-ID: $Id: cfdataref.h 46095 2007-05-18 07:29:49Z SC $
// Copyright: (c) 2007 Stefan Csomor
{}
typedef wxCFRef<CFDataRef> super_type;
-
+
/*! @method wxCFDataRef
@abstract Assumes ownership of p and creates a reference to it.
@templatefield otherType Any type.
@param data The raw data.
@param length The data length.
*/
- wxCFDataRef(const UInt8* data, CFIndex length)
+ wxCFDataRef(const UInt8* data, CFIndex length)
: super_type(CFDataCreate(kCFAllocatorDefault, data, length))
{
}
else
return 0;
}
-
+
/*! @method GetBytes
@abstract Copies the data into an external buffer
@param range The desired range.
#if wxOSX_USE_COCOA_OR_IPHONE
wxCFStringRef(NSString* ref)
- : wxCFRef< CFStringRef >((CFStringRef) ref)
+ : wxCFRef< CFStringRef >((CFStringRef) ref)
{
}
#endif
wxCFStringRef(CFStringRef ref)
- : wxCFRef< CFStringRef >(ref)
+ : wxCFRef< CFStringRef >(ref)
{
}
wxCFStringRef(const wxCFStringRef& otherRef )
- : wxCFRef< CFStringRef >(otherRef)
+ : wxCFRef< CFStringRef >(otherRef)
{
}
}
wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) const;
-
+
static wxString AsString( CFStringRef ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
#if wxOSX_USE_COCOA_OR_IPHONE
static wxString AsString( NSString* ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
// ---------------------------------------------------------
// Helper functions for dataview implementation on OSX
// ---------------------------------------------------------
-wxWidgetImplType* CreateDataView(wxWindowMac* wxpeer, wxWindowMac* parent, wxWindowID id,
+wxWidgetImplType* CreateDataView(wxWindowMac* wxpeer, wxWindowMac* parent, wxWindowID id,
wxPoint const& pos, wxSize const& size,
long style, long extraStyle);
wxString ConcatenateDataViewItemValues(wxDataViewCtrl const* dataViewCtrlPtr, wxDataViewItem const& dataViewItem); // concatenates all data of the visible columns of the passed control
wxString GetCommand(const wxString &verb, size_t nIndex) const;
- // Read XDG *.desktop file
+ // Read XDG *.desktop file
void LoadXDGApp(const wxString& filename);
// Scan XDG directory
void LoadXDGAppsFilesFromDir(const wxString& dirname);
class WXDLLIMPEXP_CORE wxDeferredObjectDeleter : public wxObject
{
public :
- wxDeferredObjectDeleter( wxObject* obj ) : m_obj(obj)
+ wxDeferredObjectDeleter( wxObject* obj ) : m_obj(obj)
{
}
virtual ~wxDeferredObjectDeleter()
#endif
#if wxUSE_MENUS
-class wxMenuItemImpl : public wxObject
+class wxMenuItemImpl : public wxObject
{
public :
wxMenuItemImpl( wxMenuItem* peer ) : m_peer(peer)
{
}
-
+
virtual ~wxMenuItemImpl() ;
virtual void SetBitmap( const wxBitmap& bitmap ) = 0;
virtual void Enable( bool enable ) = 0;
virtual void Check( bool check ) = 0;
virtual void SetLabel( const wxString& text, wxAcceleratorEntry *entry ) = 0;
virtual void Hide( bool hide = true ) = 0;
-
+
virtual void * GetHMenuItem() = 0;
wxMenuItem* GetWXPeer() { return m_peer ; }
protected :
wxMenuItem* m_peer;
-
+
DECLARE_ABSTRACT_CLASS(wxMenuItemImpl)
} ;
-class wxMenuImpl : public wxObject
+class wxMenuImpl : public wxObject
{
public :
wxMenuImpl( wxMenu* peer ) : m_peer(peer)
{
}
-
- virtual ~wxMenuImpl() ;
- virtual void InsertOrAppend(wxMenuItem *pItem, size_t pos) = 0;
+
+ virtual ~wxMenuImpl() ;
+ virtual void InsertOrAppend(wxMenuItem *pItem, size_t pos) = 0;
virtual void Remove( wxMenuItem *pItem ) = 0;
-
+
virtual void MakeRoot() = 0;
virtual void SetTitle( const wxString& text ) = 0;
virtual WXHMENU GetHMenu() = 0;
-
+
wxMenu* GetWXPeer() { return m_peer ; }
virtual void PopUp( wxWindow *win, int x, int y ) = 0;
static wxMenuImpl* CreateRootMenu( wxMenu* peer );
protected :
wxMenu* m_peer;
-
+
DECLARE_ABSTRACT_CLASS(wxMenuItemImpl)
} ;
#endif
bool IsRootControl() const { return m_isRootControl; }
wxWindowMac* GetWXPeer() const { return m_wxPeer; }
-
+
bool IsOk() const { return GetWXWidget() != NULL; }
// not only the control itself, but also all its parents must be visible
virtual void SetVisibility( bool visible ) = 0;
virtual void Raise() = 0;
-
+
virtual void Lower() = 0;
virtual void ScrollRect( const wxRect *rect, int dx, int dy ) = 0;
virtual WXWidget GetWXWidget() const = 0;
-
+
virtual void SetBackgroundColour( const wxColour& col ) = 0;
// all coordinates in native parent widget relative coordinates
// return true if successful
virtual bool SetFocus() = 0;
virtual bool HasFocus() const = 0;
-
+
virtual void RemoveFromParent() = 0;
virtual void Embed( wxWidgetImpl *parent ) = 0;
-
+
virtual void SetDefaultButton( bool isDefault ) = 0;
virtual void PerformClick() = 0;
virtual void SetLabel( const wxString& title, wxFontEncoding encoding ) = 0;
// is the clicked event sent AFTER the state already changed, so no additional
// state changing logic is required from the outside
virtual bool ButtonClickDidStateChange() = 0;
-
+
virtual void InstallEventHandler( WXWidget control = NULL ) = 0;
// static methods for associating native controls and their implementations
- static wxWidgetImpl*
+ static wxWidgetImpl*
FindFromWXWidget(WXWidget control);
-
+
static void RemoveAssociations( wxWidgetImpl* impl);
-
+
static void Associate( WXWidget control, wxWidgetImpl *impl );
-
+
static WXWidget FindFocus();
-
+
// static creation methods, must be implemented by all toolkits
-
- static wxWidgetImplType* CreateUserPane( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
- const wxPoint& pos,
+
+ static wxWidgetImplType* CreateUserPane( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle) ;
static wxWidgetImplType* CreateContentView( wxNonOwnedWindow* now ) ;
- static wxWidgetImplType* CreateButton( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateButton( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
const wxString& label,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle) ;
- static wxWidgetImplType* CreateDisclosureTriangle( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateDisclosureTriangle( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
const wxString& label,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle) ;
-
- static wxWidgetImplType* CreateStaticLine( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
- const wxPoint& pos,
+
+ static wxWidgetImplType* CreateStaticLine( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle) ;
- static wxWidgetImplType* CreateGroupBox( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateGroupBox( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
const wxString& label,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle) ;
- static wxWidgetImplType* CreateStaticText( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateStaticText( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
const wxString& label,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle) ;
- static wxWidgetImplType* CreateTextControl( wxTextCtrl* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateTextControl( wxTextCtrl* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
const wxString& content,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle) ;
- static wxWidgetImplType* CreateSearchControl( wxTextCtrl* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateSearchControl( wxTextCtrl* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
const wxString& content,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle) ;
- static wxWidgetImplType* CreateCheckBox( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateCheckBox( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
const wxString& label,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
-
- static wxWidgetImplType* CreateRadioButton( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+
+ static wxWidgetImplType* CreateRadioButton( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
const wxString& label,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
- static wxWidgetImplType* CreateToggleButton( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateToggleButton( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
const wxString& label,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
- static wxWidgetImplType* CreateBitmapToggleButton( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateBitmapToggleButton( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
const wxBitmap& bitmap,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
- static wxWidgetImplType* CreateBitmapButton( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateBitmapButton( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
const wxBitmap& bitmap,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
- static wxWidgetImplType* CreateTabView( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
- const wxPoint& pos,
+ static wxWidgetImplType* CreateTabView( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
- static wxWidgetImplType* CreateGauge( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateGauge( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
wxInt32 value,
wxInt32 minimum,
wxInt32 maximum,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
- static wxWidgetImplType* CreateSlider( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateSlider( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
wxInt32 value,
wxInt32 minimum,
wxInt32 maximum,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
- static wxWidgetImplType* CreateSpinButton( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateSpinButton( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
wxInt32 value,
wxInt32 minimum,
wxInt32 maximum,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
- static wxWidgetImplType* CreateScrollBar( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
- const wxPoint& pos,
+ static wxWidgetImplType* CreateScrollBar( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
- static wxWidgetImplType* CreateChoice( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateChoice( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
wxMenu* menu,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
- static wxWidgetImplType* CreateListBox( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
- const wxPoint& pos,
+ static wxWidgetImplType* CreateListBox( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
// converts from Toplevel-Content relative to local
// the interface to be implemented eg by a listbox
//
-class WXDLLIMPEXP_CORE wxListWidgetColumn
+class WXDLLIMPEXP_CORE wxListWidgetColumn
{
public :
virtual ~wxListWidgetColumn() {}
public :
wxListWidgetCellValue() {}
virtual ~wxListWidgetCellValue() {}
-
+
virtual void Set( CFStringRef value ) = 0;
virtual void Set( const wxString& value ) = 0;
virtual void Set( int value ) = 0;
virtual void Check( bool check );
-
+
virtual bool IsChecked() const;
virtual int GetIntValue() const = 0;
virtual wxString GetStringValue() const = 0;
public:
wxListWidgetImpl() {}
virtual ~wxListWidgetImpl() { }
-
- virtual wxListWidgetColumn* InsertTextColumn( unsigned pos, const wxString& title, bool editable = false,
+
+ virtual wxListWidgetColumn* InsertTextColumn( unsigned pos, const wxString& title, bool editable = false,
wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) = 0 ;
- virtual wxListWidgetColumn* InsertCheckColumn( unsigned pos , const wxString& title, bool editable = false,
+ virtual wxListWidgetColumn* InsertCheckColumn( unsigned pos , const wxString& title, bool editable = false,
wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) = 0 ;
-
+
// add and remove
// TODO will be replaced
virtual int ListGetSelection() const = 0;
virtual int ListGetSelections( wxArrayInt& aSelections ) const = 0;
virtual bool ListIsSelected( unsigned int n ) const = 0;
-
+
// display
virtual void ListScrollTo( unsigned int n ) = 0;
virtual ~wxNonOwnedWindowImpl()
{
}
-
- virtual void Destroy()
+
+ virtual void Destroy()
{
}
virtual void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) = 0;
-
-
+
+
virtual WXWindow GetWXWindow() const = 0;
-
+
virtual void Raise()
{
}
-
+
virtual void Lower()
{
}
{
return false;
}
-
+
virtual bool ShowWithEffect(bool show, wxShowEffect WXUNUSED(effect), unsigned WXUNUSED(timeout))
{
return Show(show);
}
-
+
virtual void Update()
{
}
virtual void SetExtraStyle( long WXUNUSED(exStyle) )
{
}
-
+
virtual bool SetBackgroundStyle(wxBackgroundStyle WXUNUSED(style))
- {
+ {
return false ;
}
-
+
bool CanSetTransparent()
{
return false;
}
- virtual void GetContentArea( int &left , int &top , int &width , int &height ) const = 0;
+ virtual void GetContentArea( int &left , int &top , int &width , int &height ) const = 0;
virtual void MoveWindow(int x, int y, int width, int height) = 0;
virtual void GetPosition( int &x, int &y ) const = 0;
virtual void GetSize( int &width, int &height ) const = 0;
{
return false;
}
-
+
virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) = 0;
-
+
virtual bool IsMaximized() const = 0;
-
+
virtual bool IsIconized() const= 0;
-
+
virtual void Iconize( bool iconize )= 0;
-
+
virtual void Maximize(bool maximize) = 0;
-
+
virtual bool IsFullScreen() const= 0;
-
+
virtual bool ShowFullScreen(bool show, long style)= 0;
virtual void RequestUserAttention(int flags) = 0;
-
- virtual void ScreenToWindow( int *x, int *y ) = 0;
-
+
+ virtual void ScreenToWindow( int *x, int *y ) = 0;
+
virtual void WindowToScreen( int *x, int *y ) = 0;
-
+
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
-
+
// static creation methods, must be implemented by all toolkits
-
+
static wxNonOwnedWindowImpl* CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) ;
// ----------------------------------
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);
// constructors / destructor
//
wxDataViewRenderer(wxString const& varianttype, wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
-
+
virtual ~wxDataViewRenderer(void);
//
{
return this->m_NativeDataPtr;
}
-
+
void SetNativeData(wxDataViewColumnNativeData* newNativeDataPtr); // class takes ownership of pointer
void SetWidthVariable(int NewWidth)
{
public:
wxMemoryDCImpl( wxMemoryDC *owner );
wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap );
- wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc );
-
+ wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc );
+
virtual ~wxMemoryDCImpl();
virtual void DoGetSize( int *width, int *height ) const;
- virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
+ virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
{ return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect); }
virtual void DoSelect(const wxBitmap& bitmap);
{ return m_selected; }
virtual wxBitmap& GetSelectedBitmap()
{ return m_selected; }
-
+
private:
void Init();
wxBitmap m_selected;
-
+
DECLARE_CLASS(wxMemoryDCImpl)
wxDECLARE_NO_COPY_CLASS(wxMemoryDCImpl);
};
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const;
private:
void* m_overlayWindow;
-
+
private:
DECLARE_CLASS(wxScreenDCImpl)
wxDECLARE_NO_COPY_CLASS(wxScreenDCImpl);
virtual bool OnDrop(wxCoord x, wxCoord y);
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
virtual bool GetData();
- // NOTE: This is needed by the generic wxDataViewCtrl, not sure how to implement.
+ // NOTE: This is needed by the generic wxDataViewCtrl, not sure how to implement.
virtual wxDataFormat GetMatchingPair();
bool CurrentDragHasSupportedFormat() ;
{
Create(size, family, style, weight, underlined, face, encoding);
}
-
+
wxFont(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
Create(10, family, style, weight, underlined, face, encoding);
SetPixelSize(pixelSize);
}
-
+
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
bool Create(const wxNativeFontInfo& info);
bool CreateSystemFont(wxOSXSystemFont font);
-
+
virtual ~wxFont();
// implement base class pure virtuals
class WXDLLIMPEXP_FWD_CORE wxStatusBar;
class WXDLLIMPEXP_FWD_CORE wxMacToolTip ;
-class WXDLLIMPEXP_CORE wxFrame: public wxFrameBase
+class WXDLLIMPEXP_CORE wxFrame: public wxFrameBase
{
public:
// construction
// Mac-specific
WXGLContext GetWXGLContext() const { return m_glContext; }
-
+
private:
WXGLContext m_glContext;
virtual void MacVisibilityChanged();
void MacUpdateView();
-
+
GLint GetAglBufferName() const { return m_bufferName; }
#endif
virtual ~wxImageList();
bool Create( int width, int height, bool mask = true, int initialCount = 1 );
bool Create();
-
+
virtual int GetImageCount() const;
virtual bool GetSize( int index, int &width, int &height ) const;
-
+
int Add( const wxIcon& bitmap );
int Add( const wxBitmap& bitmap );
int Add( const wxBitmap& bitmap, const wxBitmap& mask );
bool Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask );
bool Remove( int index );
bool RemoveAll();
-
+
virtual bool Draw(int index, wxDC& dc, int x, int y,
int flags = wxIMAGELIST_DRAW_NORMAL,
bool solidBackground = false);
-
+
private:
wxList m_images;
-
+
int m_width;
int m_height;
-
+
DECLARE_DYNAMIC_CLASS(wxImageList)
};
#define wxOSX_USE_CORE_TEXT 0
#define wxOSX_USE_ATSU_TEXT 0
-#define wxHAS_OPENGL_ES
+#define wxHAS_OPENGL_ES
/*
* turning off capabilities that don't work under iphone yet
#define wxUSE_COMBOBOX 0
#endif
-#undef wxUSE_SCROLLBAR
+#undef wxUSE_SCROLLBAR
#define wxUSE_SCROLLBAR 0
-#undef wxUSE_STATUSBAR
-#undef wxUSE_NATIVE_STATUSBAR
-#undef wxUSE_TEXTCTRL
-#undef wxUSE_ABOUTDLG
-#undef wxUSE_STATTEXT
-#undef wxUSE_STATLINE
-#undef wxUSE_COLLPANE
-#undef wxUSE_STATBMP
-#undef wxUSE_STATBOX
+#undef wxUSE_STATUSBAR
+#undef wxUSE_NATIVE_STATUSBAR
+#undef wxUSE_TEXTCTRL
+#undef wxUSE_ABOUTDLG
+#undef wxUSE_STATTEXT
+#undef wxUSE_STATLINE
+#undef wxUSE_COLLPANE
+#undef wxUSE_STATBMP
+#undef wxUSE_STATBOX
#undef wxUSE_CHECKBOX
-#undef wxUSE_RADIOBTN
-#undef wxUSE_RADIOBOX
+#undef wxUSE_RADIOBTN
+#undef wxUSE_RADIOBOX
#undef wxUSE_TOGGLEBTN
#define wxUSE_RADIOBOX 0
#define wxUSE_TOGGLEBTN 0
-#undef wxUSE_TOOLBAR
-#undef wxUSE_HTML
+#undef wxUSE_TOOLBAR
+#undef wxUSE_HTML
#define wxUSE_TOOLBAR 0
#define wxUSE_HTML 0
-#undef wxUSE_RICHTEXT
+#undef wxUSE_RICHTEXT
#define wxUSE_RICHTEXT 0
-#undef wxUSE_ANIMATIONCTRL
-#undef wxUSE_CALENDARCTRL
-#undef wxUSE_COMBOCTRL
-#undef wxUSE_ODCOMBOBOX
-#undef wxUSE_BITMAPCOMBOBOX
-#undef wxUSE_BMPBUTTON
-#undef wxUSE_CHECKLISTBOX
-#undef wxUSE_GAUGE
-#undef wxUSE_GRID
-#undef wxUSE_LISTBOX
-#undef wxUSE_LISTCTRL
-#undef wxUSE_NOTEBOOK
-#undef wxUSE_SLIDER
-#undef wxUSE_SPINBTN
-#undef wxUSE_SPINCTRL
-#undef wxUSE_TREECTRL
-#undef wxUSE_DATEPICKCTRL
-#undef wxUSE_DATAVIEWCTRL
-#undef wxUSE_EDITABLELISTBOX
-#undef wxUSE_FILEPICKERCTRL
-#undef wxUSE_DIRPICKERCTRL
-#undef wxUSE_FILECTRL
-#undef wxUSE_COLOURPICKERCTRL
-#undef wxUSE_FONTPICKERCTRL
-#undef wxUSE_DEBUGREPORT
-#undef wxUSE_HYPERLINKCTRL
-#undef wxUSE_STC
+#undef wxUSE_ANIMATIONCTRL
+#undef wxUSE_CALENDARCTRL
+#undef wxUSE_COMBOCTRL
+#undef wxUSE_ODCOMBOBOX
+#undef wxUSE_BITMAPCOMBOBOX
+#undef wxUSE_BMPBUTTON
+#undef wxUSE_CHECKLISTBOX
+#undef wxUSE_GAUGE
+#undef wxUSE_GRID
+#undef wxUSE_LISTBOX
+#undef wxUSE_LISTCTRL
+#undef wxUSE_NOTEBOOK
+#undef wxUSE_SLIDER
+#undef wxUSE_SPINBTN
+#undef wxUSE_SPINCTRL
+#undef wxUSE_TREECTRL
+#undef wxUSE_DATEPICKCTRL
+#undef wxUSE_DATAVIEWCTRL
+#undef wxUSE_EDITABLELISTBOX
+#undef wxUSE_FILEPICKERCTRL
+#undef wxUSE_DIRPICKERCTRL
+#undef wxUSE_FILECTRL
+#undef wxUSE_COLOURPICKERCTRL
+#undef wxUSE_FONTPICKERCTRL
+#undef wxUSE_DEBUGREPORT
+#undef wxUSE_HYPERLINKCTRL
+#undef wxUSE_STC
#undef wxUSE_AUI
-#undef wxUSE_BUSYINFO
-#undef wxUSE_SEARCHCTRL
+#undef wxUSE_BUSYINFO
+#undef wxUSE_SEARCHCTRL
#define wxUSE_ANIMATIONCTRL 0
#define wxUSE_CALENDARCTRL 0
#define wxUSE_BUSYINFO 0
#define wxUSE_SEARCHCTRL 0
-#undef wxUSE_LOGWINDOW
-#undef wxUSE_LOG_DIALOG
-#undef wxUSE_LISTBOOK
-#undef wxUSE_CHOICEBOOK
-#undef wxUSE_TREEBOOK
-#undef wxUSE_TOOLBOOK
-#undef wxUSE_CHOICEDLG
-#undef wxUSE_HELP
-#undef wxUSE_PROGRESSDLG
-#undef wxUSE_FONTDLG
-#undef wxUSE_FILEDLG
-#undef wxUSE_CHOICEDLG
-#undef wxUSE_NUMBERDLG
-#undef wxUSE_TEXTDLG
-#undef wxUSE_DIRDLG
-#undef wxUSE_STARTUP_TIPS
-#undef wxUSE_WIZARDDLG
-#undef wxUSE_TOOLBAR_NATIVE
-#undef wxUSE_FINDREPLDLG
-#undef wxUSE_TASKBARICON
-#undef wxUSE_REARRANGECTRL
+#undef wxUSE_LOGWINDOW
+#undef wxUSE_LOG_DIALOG
+#undef wxUSE_LISTBOOK
+#undef wxUSE_CHOICEBOOK
+#undef wxUSE_TREEBOOK
+#undef wxUSE_TOOLBOOK
+#undef wxUSE_CHOICEDLG
+#undef wxUSE_HELP
+#undef wxUSE_PROGRESSDLG
+#undef wxUSE_FONTDLG
+#undef wxUSE_FILEDLG
+#undef wxUSE_CHOICEDLG
+#undef wxUSE_NUMBERDLG
+#undef wxUSE_TEXTDLG
+#undef wxUSE_DIRDLG
+#undef wxUSE_STARTUP_TIPS
+#undef wxUSE_WIZARDDLG
+#undef wxUSE_TOOLBAR_NATIVE
+#undef wxUSE_FINDREPLDLG
+#undef wxUSE_TASKBARICON
+#undef wxUSE_REARRANGECTRL
#define wxUSE_LOGWINDOW 0
#define wxUSE_LOG_DIALOG 0
class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl
{
public :
- wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false ) ;
- wxWidgetIPhoneImpl() ;
- ~wxWidgetIPhoneImpl();
-
+ wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false ) ;
+ wxWidgetIPhoneImpl() ;
+ ~wxWidgetIPhoneImpl();
+
void Init();
-
+
virtual bool IsVisible() const ;
virtual void SetVisibility( bool visible );
-
+
virtual void Raise();
-
+
virtual void Lower();
virtual void ScrollRect( const wxRect *rect, int dx, int dy );
void RemoveFromParent();
void Embed( wxWidgetImpl *parent );
-
+
void SetDefaultButton( bool isDefault );
void PerformClick();
virtual void SetLabel(const wxString& title, wxFontEncoding encoding);
virtual wxBitmap GetBitmap() const;
virtual void SetBitmap( const wxBitmap& bitmap );
virtual void SetBitmapPosition( wxDirection dir );
-
+
void SetupTabs( const wxNotebook ¬ebook );
void GetBestRect( wxRect *r ) const;
bool IsEnabled() const;
void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
void InstallEventHandler( WXWidget control = NULL );
-
- virtual void DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* otherWindow);
+
+ virtual void DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* otherWindow);
// thunk connected calls
-
+
virtual void drawRect(CGRect* rect, WXWidget slf, void* _cmd);
virtual void touchEvent(WX_NSSet touches, WX_UIEvent event, WXWidget slf, void* _cmd);
virtual bool becomeFirstResponder(WXWidget slf, void* _cmd);
virtual bool resignFirstResponder(WXWidget slf, void* _cmd);
// action
-
+
virtual void touchUpInsideAction(void* sender, WX_UIEvent evt, WXWidget slf, void* _cmd);
protected:
public :
wxNonOwnedWindowIPhoneImpl( wxNonOwnedWindow* nonownedwnd) ;
wxNonOwnedWindowIPhoneImpl();
-
+
virtual ~wxNonOwnedWindowIPhoneImpl();
-
+
virtual void Destroy() ;
void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) ;
-
+
WXWindow GetWXWindow() const;
- void Raise();
+ void Raise();
void Lower();
- bool Show(bool show);
+ bool Show(bool show);
bool ShowWithEffect(bool show, wxShowEffect effect, unsigned timeout);
-
+
void Update();
bool SetTransparent(wxByte alpha);
bool SetBackgroundColour(const wxColour& col );
- void SetExtraStyle( long exStyle );
- bool SetBackgroundStyle(wxBackgroundStyle style);
+ void SetExtraStyle( long exStyle );
+ bool SetBackgroundStyle(wxBackgroundStyle style);
bool CanSetTransparent();
void MoveWindow(int x, int y, int width, int height);
void GetPosition( int &x, int &y ) const;
void GetSize( int &width, int &height ) const;
- void GetContentArea( int &left , int &top , int &width , int &height ) const;
+ void GetContentArea( int &left , int &top , int &width , int &height ) const;
bool SetShape(const wxRegion& region);
-
+
virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) ;
-
+
virtual bool IsMaximized() const;
-
+
virtual bool IsIconized() const;
-
+
virtual void Iconize( bool iconize );
-
+
virtual void Maximize(bool maximize);
-
+
virtual bool IsFullScreen() const;
-
+
virtual bool ShowFullScreen(bool show, long style);
virtual void RequestUserAttention(int flags);
-
+
virtual void ScreenToWindow( int *x, int *y );
-
+
virtual void WindowToScreen( int *x, int *y );
-
+
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
protected :
WX_UIWindow m_macWindow;
void * m_macFullScreenData ;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowIPhoneImpl)
-};
+};
#ifdef __OBJC__
WXDLLIMPEXP_CORE wxRect wxFromNSRect( UIView* parent, const CGRect& rect );
WXDLLIMPEXP_CORE CGPoint wxToNSPoint( UIView* parent, const wxPoint& p );
WXDLLIMPEXP_CORE wxPoint wxFromNSPoint( UIView* parent, const CGPoint& p );
-
- CGRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
+
+ CGRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
bool adjustForOrigin = true );
@interface wxUIButton : UIButton
{
}
-
+
@end
void WXDLLIMPEXP_CORE wxOSXIPhoneClassAddWXMethods(Class c);
const wxString& name = wxListBoxNameStr);
virtual ~wxListBox();
-
+
// implement base class pure virtuals
virtual void Refresh(bool eraseBack = true, const wxRect *rect = NULL);
// data callbacks
virtual void GetValueCallback( unsigned int n, wxListWidgetColumn* col , wxListWidgetCellValue& value );
virtual void SetValueCallback( unsigned int n, wxListWidgetColumn* col , wxListWidgetCellValue& value );
-
+
virtual bool IsSelected(int n) const;
virtual int GetSelection() const;
virtual int GetSelections(wxArrayInt& aSelections) const;
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
wxListWidgetImpl* GetListPeer() const;
-
+
bool MacGetBlockEvents() const { return m_blockEvents; }
virtual void HandleLineEvent( unsigned int n, bool doubleClick );
virtual wxSize DoGetBestSize() const;
bool m_blockEvents;
-
+
wxListWidgetColumn* m_textColumn;
-
+
// data storage (copied from univ)
-
+
// the array containing all items (it is sorted if the listbox has
// wxLB_SORT style)
union
// and this one the client data (either void or wxClientData)
wxArrayPtrVoid m_itemsClientData;
-
+
private:
DECLARE_DYNAMIC_CLASS(wxListBox)
DECLARE_EVENT_TABLE()
void HandleMenuClosed();
wxMenuImpl* GetPeer() { return m_peer; }
-
+
// make sure we can veto
void SetAllowRearrange( bool allow );
bool AllowRearrange() const { return m_allowRearrange; }
-
+
// if a menu is used purely for internal implementation reasons (eg wxChoice)
// we don't want native menu events being triggered
void SetNoEventsMode( bool noEvents );
bool GetNoEventsMode() const { return m_noEventsMode; }
protected:
// hide special menu items like exit, preferences etc
- // that are expected in the app menu
+ // that are expected in the app menu
void DoRearrange() ;
-
+
bool DoHandleMenuEvent( wxEvent& evt );
virtual wxMenuItem* DoAppend(wxMenuItem *item);
virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item);
// in this menu rearranging of menu items (esp hiding) is allowed
bool m_allowRearrange;
-
+
// don't trigger native events
bool m_noEventsMode;
-
+
// the position of the first item in the current radio group or -1
int m_startRadioGroup;
-
+
wxMenuImpl* m_peer;
DECLARE_DYNAMIC_CLASS(wxMenu)
private:
static wxMenuBar* s_macInstalledMenuBar ;
static wxMenuBar* s_macCommonMenuBar ;
-
+
wxMenu* m_rootMenu;
wxMenu* m_appleMenu;
wxBitmap m_bitmap; // Bitmap for menuitem, if any
void* m_menu ; // the appropriate menu , may also be a system menu
-
+
wxMenuItemImpl* m_peer;
DECLARE_DYNAMIC_CLASS(wxMenuItem)
// Name: wx/mac/nonownedwnd.h
// Purpose: declares wxNonOwnedWindow class
// Author: Stefan Csomor
-// Modified by:
+// Modified by:
// Created: 2008-03-24
// RCS-ID: $Id: nonownedwnd.h 46993 2007-06-28 08:46:04Z VS $
// Copyright: (c) 2008 Stefan Csomor
virtual bool CanSetTransparent();
virtual bool SetBackgroundStyle(wxBackgroundStyle style);
-
+
virtual void Update();
WXWindow GetWXWindow() const ;
virtual void SetExtraStyle(long exStyle) ;
virtual bool SetBackgroundColour( const wxColour &colour );
-
+
wxNonOwnedWindowImpl* GetNonOwnedPeer() const { return m_nowpeer; }
-
+
// osx specific event handling common for all osx-ports
-
+
virtual void HandleActivated( double timestampsec, bool didActivate );
virtual void HandleResized( double timestampsec );
virtual void HandleMoved( double timestampsec );
virtual void HandleResizing( double timestampsec, wxRect* rect );
-
+
protected:
// common part of all ctors
void Init();
// hit test
virtual int HitTest(const wxPoint& pt, long *flags = NULL) const;
-
+
// calculate size for wxNotebookSizer
wxSize CalcSizeFromPage(const wxSize& sizePage) const;
wxRect GetPageRect() const ;
// -------------------
virtual void Command(wxCommandEvent& event);
// osx specific event handling common for all osx-ports
-
+
virtual bool OSXHandleClicked( double timestampsec );
protected:
// Name: pnghand.h
// Purpose: PNG bitmap handler
// Author: Julian Smart
-// Modified by:
+// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Purpose: wxPopupWindow class for wxMac
// Author: Stefan Csomor
// Modified by:
-// Created:
+// Created:
// RCS-ID: $Id$
// Copyright: (c) 2006 Stefan Csomor
// Licence: wxWindows licence
#include "wx/cmndata.h"
#include "wx/printdlg.h"
#include "wx/prntbase.h"
-
+
/*
* wxMacPrintDialog
* The Mac dialog for printing
wxDC* m_printerDC;
bool m_destroyDC;
wxWindow* m_dialogParent;
-
+
private:
DECLARE_DYNAMIC_CLASS(wxPrintDialog)
};
virtual ~wxMacPageSetupDialog();
virtual wxPageSetupData& GetPageSetupDialogData();
-
+
bool Create(wxWindow *parent, wxPageSetupData *data = NULL);
virtual int ShowModal();
-
+
private:
wxPageSetupData m_pageSetupData;
wxWindow* m_dialogParent;
-
+
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacPageSetupDialog)
};
private:
wxPageSetupData* m_pageSetupDialogData;
-
+
wxPoint m_MinMarginTopLeft;
wxPoint m_MinMarginBottomRight;
wxTextCtrl *m_LeftMargin;
wxTextCtrl *m_TopMargin;
wxTextCtrl *m_RightMargin;
wxTextCtrl *m_BottomMargin;
-
+
void GetMinMargins();
bool CheckValue(wxTextCtrl* textCtrl, int *value, int minValue, const wxString& name);
-
+
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacPageMarginsDialog)
};
/*
* Represents the printer: manages printing a wxPrintout object
*/
-
+
class WXDLLIMPEXP_CORE wxMacPrinter: public wxPrinterBase
{
DECLARE_DYNAMIC_CLASS(wxMacPrinter)
* wxPrintPreview
* Programmer creates an object of this class to preview a wxPrintout.
*/
-
+
class WXDLLIMPEXP_CORE wxMacPrintPreview: public wxPrintPreviewBase
{
DECLARE_CLASS(wxMacPrintPreview)
virtual void SetValue(bool val);
virtual bool GetValue() const ;
- // implementation
-
+ // implementation
+
void Command(wxCommandEvent& event);
wxRadioButton *AddInCycle(wxRadioButton *cycle);
void RemoveFromCycle();
inline wxRadioButton *NextInCycle() {return m_cycle;}
-
+
// osx specific event handling common for all osx-ports
-
+
virtual bool OSXHandleClicked( double timestampsec );
protected:
-
+
wxRadioButton *m_cycle;
};
void Command(wxCommandEvent& event);
// osx specific event handling common for all osx-ports
-
+
virtual bool OSXHandleClicked( double timestampsec );
virtual void TriggerScrollEvent( wxEventType scrollEvent ) ;
static bool IsPlaying();
void* GetHandle();
-protected:
+protected:
bool DoPlay(unsigned flags) const;
private:
virtual void SetValue(int val);
// implementation
-
+
virtual void TriggerScrollEvent( wxEventType scrollEvent ) ;
// osx specific event handling common for all osx-ports
-
+
virtual bool OSXHandleClicked( double timestampsec );
protected:
void Init();
wxMenu *m_menu;
-
+
wxString m_descriptiveText;
private:
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
virtual void GetBordersForSizer(int *borderTop, int *borderOther) const;
-
+
virtual bool AcceptsFocus() const { return false; }
// protect native font of box
#if wxOSX_USE_COCOA
, CUSTOM_STATUSITEM
#endif
-// , STATUSITEM
-// , MENUEXTRA
+// , STATUSITEM
+// , MENUEXTRA
, DEFAULT_TYPE = DOCK
};
bool PopupMenu(wxMenu *menu);
protected:
- class wxTaskBarIconImpl* m_impl;
+ class wxTaskBarIconImpl* m_impl;
friend class wxTaskBarIconImpl;
};
#endif
unsigned long m_maxLength;
virtual void EnableTextChangedEvents(bool enable)
- {
+ {
m_triggerUpdateEvents = enable;
}
-
+
bool m_triggerUpdateEvents ;
private :
int m_marginX,
m_marginY;
-
+
protected:
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual wxSize DoGetBestSize() const;
const wxString& name = wxFrameNameStr);
virtual ~wxTopLevelWindowMac();
-
+
virtual bool Destroy();
virtual wxPoint GetClientAreaOrigin() const;
- virtual bool SetShape(const wxRegion& region)
+ virtual bool SetShape(const wxRegion& region)
{ return DoSetShape(region); }
// Attracts the users attention to this window if the application is
virtual void SetTitle( const wxString& title);
virtual wxString GetTitle() const;
-
+
protected:
// common part of all ctors
void Init();
// this should not be overriden in classes above wxWindowMac
// because it is called from its destructor via DeleteChildren
virtual void RemoveChild( wxWindowBase *child );
-
+
virtual bool MacDoRedraw( long time ) ;
virtual void MacPaintChildrenBorders();
virtual void MacPaintBorders( int left , int top ) ;
// the 'true' OS level control for this wxWindow
wxOSXWidgetImpl* GetPeer() const { return m_peer ; }
-
+
void * MacGetCGContextRef() { return m_cgContextRef ; }
void MacSetCGContextRef(void * cg) { m_cgContextRef = cg ; }
// osx specific event handling common for all osx-ports
-
+
virtual bool OSXHandleClicked( double timestampsec );
virtual bool OSXHandleKeyEvent( wxKeyEvent& event );
protected:
{
Create(size, family, style, weight, underlined, face, encoding);
}
-
+
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
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
+ // only be called for the first column. See OnGetItemColumnImage for
// details.
virtual int OnGetItemImage(long item) const;
* Purpose: the missing declarations for wxPalm
* Author: Yunhui Fu
* Created: 2007-10-18
- * Modified by:
+ * Modified by:
* RCS-ID: $Id$
* Copyright: (c) 2007 Yunhui Fu
* Licence: wxWindows licence
unsigned long i[2];
double d;
};
-
+
union __fmath
{
unsigned long i[1];
float f;
};
-
+
union __ldmath
{
unsigned long i[4];
#else /* !gcc >= 3.3 */
- /* No builtins. Use floating-point unions instead. Declare as an array
- without bounds so no matter what small data support a port and/or
- library has, the reference will be via the general method for accessing
+ /* No builtins. Use floating-point unions instead. Declare as an array
+ without bounds so no matter what small data support a port and/or
+ library has, the reference will be via the general method for accessing
globals. */
#ifndef HUGE_VAL
extern int access(const char *path, int amode);
extern off_t lseek(int fildes, off_t offset, int whence);
-//TxtCharIsAlNum
+//TxtCharIsAlNum
//#define isalpha(a) TxtCharIsAlpha(a)
-//TxtCharIsCntrl TxtCharIsDelim TxtCharIsDigit TxtCharIsGraph TxtCharIsHardKey TxtCharIsHex TxtCharIsLower TxtCharIsPrint TxtCharIsPunct TxtCharIsSpace TxtCharIsUpper
+//TxtCharIsCntrl TxtCharIsDelim TxtCharIsDigit TxtCharIsGraph TxtCharIsHardKey TxtCharIsHex TxtCharIsLower TxtCharIsPrint TxtCharIsPunct TxtCharIsSpace TxtCharIsUpper
#include "pfall.h"
// Implementation from now on
// --------------------------
-
+
#if wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT
virtual void SetDropTarget(wxDropTarget *dropTarget);
#endif // wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT
#define __WXOSX_CARBON__ 1
#endif
-#if defined(__WXOSX_CARBON__) || defined(__WXOSX_COCOA__) || defined(__WXOSX_IPHONE__)
+#if defined(__WXOSX_CARBON__) || defined(__WXOSX_COCOA__) || defined(__WXOSX_IPHONE__)
# define __WXOSX__ 1
#endif
# endif
/* setup precise defines according to sdk used */
# include <TargetConditionals.h>
-# if defined(__WXOSX_IPHONE__)
+# if defined(__WXOSX_IPHONE__)
# if !( defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE )
# error "incorrect SDK for an iPhone build"
# endif
#endif
/* also the 32/64 bit universal builds must be handled accordingly */
#ifdef __DARWIN__
-# ifdef __LP64__
-# undef SIZEOF_VOID_P
-# undef SIZEOF_LONG
-# undef SIZEOF_SIZE_T
-# define SIZEOF_VOID_P 8
-# define SIZEOF_LONG 8
-# define SIZEOF_SIZE_T 8
-# else
-# undef SIZEOF_VOID_P
-# undef SIZEOF_LONG
-# undef SIZEOF_SIZE_T
-# define SIZEOF_VOID_P 4
-# define SIZEOF_LONG 4
-# define SIZEOF_SIZE_T 4
-# endif
+# ifdef __LP64__
+# undef SIZEOF_VOID_P
+# undef SIZEOF_LONG
+# undef SIZEOF_SIZE_T
+# define SIZEOF_VOID_P 8
+# define SIZEOF_LONG 8
+# define SIZEOF_SIZE_T 8
+# else
+# undef SIZEOF_VOID_P
+# undef SIZEOF_LONG
+# undef SIZEOF_SIZE_T
+# define SIZEOF_VOID_P 4
+# define SIZEOF_LONG 4
+# define SIZEOF_SIZE_T 4
+# endif
#endif
/*
check the consistency of the settings in setup.h: note that this must be
wxString Release;
wxString CodeName;
wxString Description;
-
+
bool operator==(const wxLinuxDistributionInfo& ldi) const
- {
+ {
return Id == ldi.Id &&
Release == ldi.Release &&
CodeName == ldi.CodeName &&
Description == ldi.Description;
}
-
+
bool operator!=(const wxLinuxDistributionInfo& ldi) const
{ return !(*this == ldi); }
};
static wxString GetArchName(wxArchitecture arch);
static wxString GetEndiannessName(wxEndianness end);
-
+
// getters
// -----------------
{ return m_osDesc; }
wxString GetDesktopEnvironment() const
{ return m_desktopEnv; }
-
+
static wxString GetOperatingSystemDirectory();
// doesn't make sense to store inside wxPlatformInfo the OS directory,
// thus this function is static; note that this function simply calls
- // wxGetOSDirectory() and is here just to make it easier for the user to
+ // wxGetOSDirectory() and is here just to make it easier for the user to
// find it that feature (global functions can be difficult to find in the docs)
// setters
{ m_arch = n; }
void SetEndianness(wxEndianness n)
{ m_endian = n; }
-
+
void SetDesktopEnvironment(const wxString& de)
{ m_desktopEnv = de; }
void SetLinuxDistributionInfo(const wxLinuxDistributionInfo& di)
!m_osDesc.IsEmpty() &&
m_tkVersionMajor != -1 && m_tkVersionMinor != -1 &&
m_port != wxPORT_UNKNOWN &&
- m_arch != wxARCH_INVALID &&
+ m_arch != wxARCH_INVALID &&
m_endian != wxENDIAN_INVALID;
-
+
// do not check linux-specific info; it's ok to have them empty
}
// Operating system ID.
wxOperatingSystemId m_os;
-
+
// Operating system description.
wxString m_osDesc;
-
-
+
+
// linux-specific
// -----------------
-
+
wxString m_desktopEnv;
wxLinuxDistributionInfo m_ldi;
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE);
-
+
virtual wxPrintDialogData& GetPrintDialogData() = 0;
virtual wxPrintData& GetPrintData() = 0;
virtual wxDC *GetPrintDC() = 0;
-
+
private:
DECLARE_ABSTRACT_CLASS(wxPrintDialogBase)
wxDECLARE_NO_COPY_CLASS(wxPrintDialogBase);
virtual wxPrintDialogData& GetPrintDialogData();
virtual wxPrintData& GetPrintData();
virtual wxDC *GetPrintDC();
-
+
private:
wxPrintDialogBase *m_pimpl;
-
+
private:
DECLARE_DYNAMIC_CLASS(wxPrintDialog)
wxDECLARE_NO_COPY_CLASS(wxPrintDialog);
private:
wxPageSetupDialogBase *m_pimpl;
-
+
private:
DECLARE_DYNAMIC_CLASS(wxPageSetupDialog)
wxDECLARE_NO_COPY_CLASS(wxPageSetupDialog);
// implementation only - don't use!
// --------------------------------
-
+
// needs to be public since it needs to be used from wxExecute() global func
void SetPid(long pid) { m_pid = pid; }
<b>Supported special attributes:</b>
- "DateFormat": Determines displayed date format.
- "PickerStyle": Determines window style used with wxDatePickerCtrl.
- Default is wxDP_DEFAULT | wxDP_SHOWCENTURY. Using wxDP_ALLOWNONE
+ Default is wxDP_DEFAULT | wxDP_SHOWCENTURY. Using wxDP_ALLOWNONE
enables additional support for unspecified property value.
*/
class WXDLLIMPEXP_PROPGRID wxDateProperty : public wxPGProperty
Helper class for managing choices of wxPropertyGrid properties.
Each entry can have label, value, bitmap, text colour, and background
colour.
-
+
wxPGChoices uses reference counting, similar to other wxWidgets classes.
This means that assignment operator and copy constructor only copy the
reference and not the actual data. Use Copy() member function to create a
/** Hides page selection buttons from toolbar.
*/
wxPG_EX_HIDE_PAGE_BUTTONS = 0x01000000,
-
+
/** Allows multiple properties to be selected by user (by pressing SHIFT
when clicking on a property, or by dragging with left mouse button
down).
size_t OnSysWrite(const void *buffer, size_t bufsize);
// socket streams are both un-seekable and size-less streams:
- wxFileOffset OnSysTell() const
+ wxFileOffset OnSysTell() const
{ return wxInvalidOffset; }
- wxFileOffset OnSysSeek(wxFileOffset WXUNUSED(pos), wxSeekMode WXUNUSED(mode))
+ wxFileOffset OnSysSeek(wxFileOffset WXUNUSED(pos), wxSeekMode WXUNUSED(mode))
{ return wxInvalidOffset; }
wxDECLARE_NO_COPY_CLASS(wxSocketOutputStream);
// socket streams are both un-seekable and size-less streams:
- wxFileOffset OnSysTell() const
+ wxFileOffset OnSysTell() const
{ return wxInvalidOffset; }
- wxFileOffset OnSysSeek(wxFileOffset WXUNUSED(pos), wxSeekMode WXUNUSED(mode))
+ wxFileOffset OnSysSeek(wxFileOffset WXUNUSED(pos), wxSeekMode WXUNUSED(mode))
{ return wxInvalidOffset; }
wxDECLARE_NO_COPY_CLASS(wxSocketInputStream);
/*
This file is included by wx/platform.h when gccxml is detected.
-
- Here we fix some of the things declared in the real setup.h which gccxml doesn't
+
+ Here we fix some of the things declared in the real setup.h which gccxml doesn't
like.
*/
-// gccxml 0.9.0 doesn't like the fcntl2.h which is part of GNU C library
+// gccxml 0.9.0 doesn't like the fcntl2.h which is part of GNU C library
// (at least it doesn't on x86_64 systems!)
#define _FCNTL_H
int open (const char *__path, int __oflag, ...);
#include "wx/textctrl.h"
-#if !defined(__WXUNIVERSAL__) && defined(__WXMAC__)
+#if !defined(__WXUNIVERSAL__) && defined(__WXMAC__)
// search control was introduced in Mac OS X 10.3 Panther
#define wxUSE_NATIVE_SEARCH_CONTROL 1
// convert to a double
bool ToCDouble(double *val) const;
#endif
-
+
#ifndef wxNEEDS_WXSTRING_PRINTF_MIXIN
// formatted input/output
// as sprintf(), returns the number of characters written or < 0 on error
virtual wxString GetTitle() const = 0;
// enable/disable close button [x]
- virtual bool EnableCloseButton(bool WXUNUSED(enable) ) { return false; }
+ virtual bool EnableCloseButton(bool WXUNUSED(enable) ) { return false; }
// Set the shape of the window to the given region.
// Returns true if the platform supports this feature (and the
#include "wx/combobox.h"
// VS: This is only a *temporary* implementation, real wxChoice should not
-// derive from wxComboBox and may have different l&f
+// derive from wxComboBox and may have different l&f
class WXDLLIMPEXP_CORE wxChoice : public wxComboBox
{
public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
-
+
private:
void OnComboBox(wxCommandEvent &event);
-
+
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxChoice)
};
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTextCtrlNameStr)
- : wxScrollHelper(this)
+ : wxScrollHelper(this)
{
Init();
wxString GetCommand(const wxString &verb, size_t nIndex) const;
- // Read XDG *.desktop file
+ // Read XDG *.desktop file
void LoadXDGApp(const wxString& filename);
// Scan XDG directory
void LoadXDGAppsFilesFromDir(const wxString& dirname);
#define XtCallCallbackList XTCALLCALLBACKLIST
#define XtCallCallbacks XTCALLCALLBACKS
#define XtCallConverter XTCALLCONVERTER
-#define XtCalloc XTCALLOC
+#define XtCalloc XTCALLOC
#ifndef NOXTDISPLAY
#define XtClass XTCLASS
#endif
#define XtSetTypeConverter XTSETTYPECONVERTER
#define XtSetValues XTSETVALUES
#define XtShellStrings XTSHELLSTRINGS
-#define XtStringConversionWarning XTSTRINGCONVERSIONWARNING
+#define XtStringConversionWarning XTSTRINGCONVERSIONWARNING
#define XtStrings XTSTRINGS
#define XtToolkitInitialize XTTOOLKITINITIALIZE
#define XtTranslateCoords XTTRANSLATECOORDS
#define _XEatData _XEATDATA
#define _XFlush _XFLUSH
#define _XFreeTemp _XFREETEMP
-#define _XGetAsyncReply _XGETASYNCREPLY
+#define _XGetAsyncReply _XGETASYNCREPLY
#define _XInitImageFuncPtrs _XINITIMAGEFUNCPTRS
#define _XRead _XREAD
#define _XReadPad _XREADPAD
-#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE
+#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE
#define _XReply _XREPLY
#define _XSend _XSEND
#define _XUnregisterFilter _XUNREGISTERFILTER
#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS
#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS
-#if (__VMS_VER < 80200000)
+#if (__VMS_VER < 80200000)
# define SetReqLen(req,n,badlen) \
if ((req->length + n) > (unsigned)65535) { \
n = badlen; \
long style = 0,
const wxString& name = wxPanelNameStr)
: wxPanel(),
- wxVarHVScrollHelper(this)
+ wxVarHVScrollHelper(this)
{
(void)Create(parent, id, pos, size, style, name);
}
*/
#elif defined( __WXCOCOA__) //tommy
#if defined(__OBJC__)
- #include "CocoaHeaders.m"
+ #include "CocoaHeaders.m"
#endif //defined(__OBJC__)
#endif
NB: don't include any wxWidgets headers here because almost all of them
include this one!
-
+
NB2: User code should include wx/crt.h instead of including this
header directly.
defined(__MWERKS__) || \
defined(__WATCOMC__) || \
defined(__BORLANDC__)
-
+
// If user did not request NOCPH and we're not building using configure
// then assume user wants precompiled headers.
wxBitmap() {}
wxBitmap( int width, int height, int depth = -1 ) { Create( width, height, depth ); }
wxBitmap( const wxSize& sz, int depth = -1 ) { Create( sz, depth ); }
-
+
wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const char* const* bits );
#ifdef wxNEEDS_CHARPP
public:
// the clipboard formats under Xt are Atoms
typedef Atom NativeFormat;
-
+
wxDataFormat();
wxDataFormat( wxDataFormatId type );
wxDataFormat( const wxString &id );
wxDataFormat( NativeFormat format );
-
+
wxDataFormat& operator=(NativeFormat format)
{ SetId(format); return *this; }
-
+
// comparison (must have both versions)
bool operator==(NativeFormat format) const
{ return m_format == (NativeFormat)format; }
{ return m_type == (wxDataFormatId)format; }
bool operator!=(wxDataFormatId format) const
{ return m_type != (wxDataFormatId)format; }
-
+
// explicit and implicit conversions to NativeFormat which is one of
// standard data types (implicit conversion is useful for preserving the
// compatibility with old code)
NativeFormat GetFormatId() const { return m_format; }
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;
void SetId( const wxString& id );
-
+
// implementation
wxDataFormatId GetType() const;
-
+
private:
wxDataFormatId m_type;
NativeFormat m_format;
-
+
void PrepareFormats();
void SetType( wxDataFormatId type );
};
{
public:
wxDataObject();
-
+
#ifdef __DARWIN__
virtual ~wxDataObject() { }
#endif
public:
wxWindowDCImpl( wxDC *owner );
wxWindowDCImpl( wxDC *owner, wxWindow *win );
-
+
virtual ~wxWindowDCImpl();
virtual bool CanDrawBitmap() const { return true; }
protected:
virtual void DoGetSize(int *width, int *height) const;
- virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col,
+ virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE );
virtual bool DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const;
virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
- wxRasterOperationMode rop = wxCOPY, bool useMask = false,
+ wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
virtual const wxBitmap& GetSelectedBitmap() const;
virtual wxBitmap& GetSelectedBitmap();
-
+
// implementation
wxBitmap m_selected;
class WXDLLIMPEXP_CORE wxDropTarget: public wxObject
{
public:
-
+
wxDropTarget();
virtual ~wxDropTarget();
-
+
virtual void OnEnter() { }
virtual void OnLeave() { }
virtual bool OnDrop( long x, long y, const void *data, size_t size ) = 0;
-
- // Override these to indicate what kind of data you support:
-
+
+ // Override these to indicate what kind of data you support:
+
virtual size_t GetFormatCount() const = 0;
virtual wxDataFormat GetFormat(size_t n) const = 0;
-
+
// implementation
};
class WXDLLIMPEXP_CORE wxTextDropTarget: public wxDropTarget
{
public:
-
+
wxTextDropTarget() {};
virtual bool OnDrop( long x, long y, const void *data, size_t size );
virtual bool OnDropText( long x, long y, const char *psz );
-
+
protected:
-
+
virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const;
};
class WXDLLIMPEXP_CORE wxPrivateDropTarget: public wxDropTarget
{
public:
-
+
wxPrivateDropTarget();
-
+
// you have to override OnDrop to get at the data
-
+
// the string ID identifies the format of clipboard or DnD data. a word
// processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
// to the clipboard - the latter with the Id "WXWORD_FORMAT".
-
+
void SetId( const wxString& id )
{ m_id = id; }
-
+
wxString GetId()
{ return m_id; }
-
+
private:
-
+
virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const;
-
+
wxString m_id;
};
class WXDLLIMPEXP_CORE wxFileDropTarget: public wxDropTarget
{
public:
-
+
wxFileDropTarget() {};
-
+
virtual bool OnDrop( long x, long y, const void *data, size_t size );
- virtual bool OnDropFiles( long x, long y,
+ virtual bool OnDropFiles( long x, long y,
size_t nFiles, const char * const aszFiles[] );
-
+
protected:
-
+
virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const;
};
class WXDLLIMPEXP_CORE wxDropSource: public wxObject
{
public:
-
+
wxDropSource( wxWindow *win );
wxDropSource( wxDataObject &data, wxWindow *win );
-
+
virtual ~wxDropSource(void);
-
+
void SetData( wxDataObject &data );
wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
-
+
virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; };
-
+
// implementation
#if 0
void RegisterWindow(void);
void UnregisterWindow(void);
-
+
wxWindow *m_window;
wxDragResult m_retValue;
wxDataObject *m_data;
-
+
wxCursor m_defaultCursor;
wxCursor m_goaheadCursor;
#endif
// wxUSE_DRAG_AND_DROP
-#endif
+#endif
//_WX_DND_H_
{
Create(size, family, style, weight, underlined, face, encoding);
}
-
+
wxFont(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
Create(10, family, style, weight, underlined, face, encoding);
SetPixelSize(pixelSize);
}
-
+
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
#define CWStackMode (1<<6)
/* Values */
-
+
typedef struct {
int x, y;
int width, height;
wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE)
{ (void)Create(parent, flags); }
-
+
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
virtual bool Show( bool show = TRUE );
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
-
+
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxPopupWindow)
int m_visualRedPrec;
int m_visualGreenPrec;
int m_visualBluePrec;
-
+
unsigned char *m_colorCube;
};
bool ProcessXEvent(WXEvent* event);
WXWindow FindAClientWindow(WXWindow window, const wxString& name);
-
+
static bool sm_done;
static wxAdoptedWindow* sm_toReparent;
static wxWindow* sm_newParent;
using decimal point &c.
TODO: Currently only the character classification and transformation
- functions and number <-> string functions, are implemented,
+ functions and number <-> string functions, are implemented,
we also need at least
- formatted IO: scanf_l(), printf_l() &c
- time: strftime_l(), strptime_l()
{ return wxCRT_Strtoul_lA(c, endptr, base, loc.Get()); }
#if wxUSE_UNICODE
-
+
// ctype functions
#define wxCRT_Isalnum_lW wxXLOCALE_IDENT(iswalnum_l)
#define wxCRT_Isalpha_lW wxXLOCALE_IDENT(iswalpha_l)
unsigned long WXDLLIMPEXP_BASE wxStrtoul_l(const char* str, char **endptr, int base, const wxXLocale& loc);
#endif // wxHAS_XLOCALE_SUPPORT/!wxHAS_XLOCALE_SUPPORT
-
+
#endif // wxUSE_XLOCALE
#endif // _WX_XLOCALE_H_
// Is the stream XPM file?
// NOTE: this function modifies the current stream position
bool CanRead(wxInputStream& stream);
-
+
// Read XPM file from the stream, parse it and create image from it
wxImage ReadFile(wxInputStream& stream);
#endif
// Read directly from XPM data (as passed to wxBitmap ctor):
wxImage ReadData(const char* const* xpm_data);
-
+
#ifdef __BORLANDC__
// needed for Borland 5.5
- wxImage ReadData(char** xpm_data)
+ wxImage ReadData(char** xpm_data)
{ return ReadData(const_cast<const char* const*>(xpm_data)); }
#endif
};
#include "wx/xrc/xmlres.h"
-#if wxUSE_XRC
+#if wxUSE_XRC
#if wxUSE_SPINBTN
(int) sizeof(name), \
(wxObjectConstructorFn) wxConstructorFor##name , \
name::GetPropertiesStatic(),name::GetHandlersStatic(),name::ms_constructor , name::ms_constructorProperties , \
- name::ms_constructorPropertiesCount , wxVariantOfPtrToObjectConverter##name , NULL , wxObjectToVariantConverter##name , callback);
+ name::ms_constructorPropertiesCount , wxVariantOfPtrToObjectConverter##name , NULL , wxObjectToVariantConverter##name , callback);
#define IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2) \
_IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2 , "", NULL) \
// to the child tab in the SetSelection call below
// (the child focus event will also let wxAuiManager, if any,
// know that the notebook control has been activated)
-
+
wxWindow* parent = GetParent();
if (parent)
{
#else
static unsigned char close_bits[]={
// reduced height, symmetric
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xf3, 0x9f, 0xf9,
- 0x3f, 0xfc, 0x7f, 0xfe, 0x3f, 0xfc, 0x9f, 0xf9, 0xcf, 0xf3, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xf3, 0x9f, 0xf9,
+ 0x3f, 0xfc, 0x7f, 0xfe, 0x3f, 0xfc, 0x9f, 0xf9, 0xcf, 0xf3, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
/*
// same height as maximize/restore
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xe7, 0xcf, 0xf3, 0x9f, 0xf9,
- 0x3f, 0xfc, 0x7f, 0xfe, 0x3f, 0xfc, 0x9f, 0xf9, 0xcf, 0xf3, 0xe7, 0xe7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xe7, 0xcf, 0xf3, 0x9f, 0xf9,
+ 0x3f, 0xfc, 0x7f, 0xfe, 0x3f, 0xfc, 0x9f, 0xf9, 0xcf, 0xf3, 0xe7, 0xe7,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
- */
+ */
#endif
static unsigned char maximize_bits[] = {
{
public:
wxAuiProportionalBoxSizer(int orientation) : wxBoxSizer(orientation) { }
-
+
void RecalcSizes()
{
if (m_children.GetCount() == 0)
int fixed_width = 0;
int stretchable = 0;
wxSizerItemList::compatibility_iterator node;
-
+
// find fixed width and height, as well
// as the total stretchable proportions
node = m_children.GetFirst();
while (node)
{
wxSizerItem *item = node->GetData();
-
+
if (item->IsShown())
{
stretchable += item->GetProportion();
-
+
wxSize size(item->GetMinSizeWithBorder());
if (item->GetProportion() == 0)
{
}
}
}
-
+
node = node->GetNext();
}
child_pos.y += (m_size.y - size.y) / 2;
item->SetDimension(child_pos, child_size);
-
+
pt.x += width;
}
}
int used_width = 0, used_height = 0;
wxSize client_size = m_frame->GetClientSize();
-
+
size_t dock_i, dock_count = m_docks.GetCount();
for (dock_i = 0; dock_i < dock_count; ++dock_i)
{
if (dock.resizable)
used_width += sash_size;
}
-
-
+
+
int available_width = client_size.GetWidth() - used_width;
int available_height = client_size.GetHeight() - used_height;
-
-
+
+
#if wxUSE_STATUSBAR
// if there's a status control, the available
// height decreases accordingly
}
}
#endif
-
+
wxRect& rect = m_action_part->dock->rect;
wxPoint new_pos(event.m_x - m_action_offset.x,
event.m_y - m_action_offset.y);
int new_size, old_size = m_action_part->dock->size;
-
+
switch (m_action_part->dock->dock_direction)
{
case wxAUI_DOCK_LEFT:
m_action = actionNone;
return false;
}
-
+
// calculate the new proportion of the pane
int new_proportion = (new_pixsize*total_proportion)/dock_pixels;
prop_borrow -= prop_diff;
}
-
+
dock.panes.Item(borrow_pane)->dock_proportion = prop_borrow;
pane.dock_proportion = new_proportion;
DrawResizeHint(dc, m_action_hintrect);
m_action_hintrect = wxRect();
}
-
+
// draw new resize hint, if it's inside the managed frame
wxRect frame_screen_rect = m_frame->GetScreenRect();
if (frame_screen_rect.Contains(rect))
// Created: ??/??/98
// RCS-ID: $Id$
// Copyright: (c) AUTHOR
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
if ((bmp_h < bestSize.x) && (bmp_w < bestSize.y))
{
- // the caller wants default size, which is larger than
+ // the caller wants default size, which is larger than
// the image we have; to avoid degrading it visually by
// scaling it up, paste it into transparent image instead:
wxPoint offset((bestSize.x - bmp_w)/2, (bestSize.y - bmp_h)/2);
wxCairoLibrary::wxCairoLibrary()
{
wxLogNull log;
-
+
m_libCairo.Load("libcairo.so.2");
m_ok = m_libCairo.IsLoaded();
if ( !m_ok )
ms_lib = NULL;
}
}
-
+
return ms_lib;
}
while ( m < str.length() && (wxIsalnum(str[m]) || str[m] == wxT('_')) )
m++;
-
+
wxString strVarName(str.c_str() + n + 1, m - n - 1);
#ifdef __WXWINCE__
}
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
int wxItemContainer::DoInsertItemsInLoop(const wxArrayStringsAdapter& items,
m_editorCtrl = CreateEditorCtrl( dv_ctrl->GetMainWindow(), labelRect, value );
- // there might be no editor control for the given item
+ // there might be no editor control for the given item
if(!m_editorCtrl)
return false;
case wxXOR: // src XOR dst
*op = wxCOMPOSITION_XOR;
break;
-
+
case wxAND: // src AND dst
case wxAND_INVERT: // (NOT src) AND dst
case wxAND_REVERSE:// src AND (NOT dst)
f.SetPointSize( /*LogicalToDeviceYRel*/(font.GetPointSize()));
m_graphicContext->SetFont( f, m_textForegroundColour );
#if defined(__WXGTK__) || defined(__WXOSX__)
- if ( m_font.IsOk() && m_font.GetNoAntiAliasing() )
+ if ( m_font.IsOk() && m_font.GetNoAntiAliasing() )
{
m_graphicContext->SetAntialiasMode(wxANTIALIAS_NONE);
}
return;
m_logicalFunction = function;
-
+
wxCompositionMode mode;
m_logicalFunctionSupported = TranslateRasterOp( function, &mode);
if (m_logicalFunctionSupported)
m_logicalFunctionSupported = m_graphicContext->SetCompositionMode(mode);
-
+
if (mode == wxCOMPOSITION_XOR)
m_graphicContext->SetAntialiasMode(wxANTIALIAS_NONE);
else
}
bool wxGCDCImpl::DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
- const wxColour& WXUNUSED(col),
+ const wxColour& WXUNUSED(col),
wxFloodFillStyle WXUNUSED(style))
{
return false;
bool wxGCDCImpl::DoBlit(
wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
- wxDC *source, wxCoord xsrc, wxCoord ysrc,
+ wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode logical_func , bool useMask,
wxCoord xsrcMask, wxCoord ysrcMask )
{
if ( logical_func == wxNO_OP )
return true;
-
+
wxCompositionMode mode;
if ( !TranslateRasterOp(logical_func, &mode) )
{
}
bool retval = true;
-
+
wxCompositionMode formerMode = m_graphicContext->GetCompositionMode();
if (m_graphicContext->SetCompositionMode(mode))
{
{
m_graphicContext->SetAntialiasMode(wxANTIALIAS_NONE);
}
-
+
if (xsrcMask == -1 && ysrcMask == -1)
{
xsrcMask = xsrc;
wxFAIL_MSG( wxT("Cannot Blit. Unable to get contents of DC as bitmap.") );
retval = false;
}
-
+
if (mode == wxCOMPOSITION_XOR)
{
m_graphicContext->SetAntialiasMode(formerAa);
}
// ----------------------------------------------------------------------------
-// compatibility methods for supporting the modality API
+// compatibility methods for supporting the modality API
// ----------------------------------------------------------------------------
wxDEFINE_EVENT( wxEVT_WINDOW_MODAL_DIALOG_CLOSED , wxWindowModalDialogEvent );
{
wxCommandEvent event ( type, GetId());
event.SetEventObject(this);
-
+
if ( !GetEventHandler()->ProcessEvent(event) )
{
// the event is not propagated upwards to the parent automatically
// in 9 cases of 10 the message must be processed by the dialog
// owner and not the dialog itself
(void)GetParent()->GetEventHandler()->ProcessEvent(event);
- }
+ }
}
// realLen = fileLen - numOfLinesInTheFile)
length = fread(buf.data(), sizeof(char), length, m_fp);
- if ( Error() )
+ if ( Error() )
{
wxLogSysError(_("Read error on file '%s'"), m_name.c_str());
return len;
}
-
+
size_t wxBackedInputStream::OnSysRead(void *buffer, size_t size)
{
if (!IsOk())
wxTheMimeTypesManager->AddFallbacks(fallbacks);
s_MinimalMimeEnsured = true;
}
-
+
wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext);
if ( !ft || !ft -> GetMimeType(&mime) )
{
mime = wxEmptyString;
}
-
+
delete ft;
-
+
return mime;
}
else
wxFONTENCODING_GB2312,
wxFONTENCODING_ISO2022_JP,
- wxFONTENCODING_MACROMAN,
+ wxFONTENCODING_MACROMAN,
wxFONTENCODING_MACJAPANESE,
wxFONTENCODING_MACCHINESETRAD,
wxFONTENCODING_MACKOREAN,
{ wxT( "GB2312" ), NULL },
{ wxT( "ISO-2022-JP" ), NULL },
-
+
{ wxT( "MacRoman" ), NULL },
{ wxT( "MacJapanese" ), NULL },
{ wxT( "MacChineseTrad" ), NULL },
// NOTE: this algorithm for adjusting the font size is used by all
// implementations of wxFont except under wxMSW and wxGTK where
// native support to font creation using pixel-size is provided.
-
+
int largestGood = 0;
int smallestBad = 0;
token.Trim(true).Trim(false).MakeLower();
if (insideQuotes)
{
- if (token.StartsWith("'") ||
+ if (token.StartsWith("'") ||
token.EndsWith("'"))
{
insideQuotes = false;
family = wxFONTFAMILY_TELETYPE;
else
return false;
-
+
SetFamily(family);
}
// NB: the check on the facename is implemented in wxFontBase::SetFaceName
#ifdef __WXMSW__
// Quoting the MSDN:
- // "MS Shell Dlg is a mapping mechanism that enables
- // U.S. English Microsoft Windows NT, and Microsoft Windows 2000 to
- // support locales that have characters that are not contained in code
+ // "MS Shell Dlg is a mapping mechanism that enables
+ // U.S. English Microsoft Windows NT, and Microsoft Windows 2000 to
+ // support locales that have characters that are not contained in code
// page 1252. It is not a font but a face name for a nonexistent font."
// Thus we need to consider "Ms Shell Dlg" and "Ms Shell Dlg 2" as valid
// font face names even if they are not enumerated by wxFontEnumerator
return true;
}
- virtual void OnExit()
+ virtual void OnExit()
{
delete wxFileSystem::RemoveHandler(m_handler);
}
void wxGridBagSizer::AdjustForOverflow()
{
int row, col;
-
+
for (row=0; row<(int)m_rowHeights.GetCount(); row++)
{
int rowExtra=INT_MAX;
int endrow, endcol;
item->GetEndPos(endrow, endcol);
-
+
// If the item starts in this position and doesn't span rows, then
// just look at the whole item height
if ( item->GetPos() == pos && endrow == row )
if ( itemHeight < 0 )
itemHeight = 0;
-
+
// and check how much is left
rowExtra = wxMin(rowExtra, rowHeight - itemHeight);
}
int endrow, endcol;
item->GetEndPos(endrow, endcol);
-
+
if ( item->GetPos() == pos && endcol == col )
{
int itemWidth = item->CalcMin().GetWidth();
if ( itemWidth < 0 )
itemWidth = 0;
-
+
colExtra = wxMin(colExtra, colWidth - itemWidth);
}
}
m_colWidths[col] -= colExtra;
}
-
+
}
//---------------------------------------------------------------------------
return context.SetCurrent(*static_cast<const wxGLCanvas *>(this));
}
-#ifndef wxHAS_OPENGL_ES
+#ifndef wxHAS_OPENGL_ES
bool wxGLCanvasBase::SetColour(const wxString& colour)
{
wxColour col = wxTheColourDatabase->Find(colour);
IMPLEMENT_ABSTRACT_CLASS(wxGraphicsContext, wxObject)
-wxGraphicsContext::wxGraphicsContext(wxGraphicsRenderer* renderer) :
+wxGraphicsContext::wxGraphicsContext(wxGraphicsRenderer* renderer) :
wxGraphicsObject(renderer),
m_antialias(wxANTIALIAS_DEFAULT),
m_composition(wxCOMPOSITION_OVER)
stream.Read(&IconDir, sizeof(IconDir));
wxUint16 nIcons = wxUINT16_SWAP_ON_BE(IconDir.idCount);
-
+
// nType is 1 for Icons, 2 for Cursors:
wxUint16 nType = wxUINT16_SWAP_ON_BE(IconDir.idType);
// remember how many bytes we read from the stream:
wxFileOffset alreadySeeked = sizeof(IconDir);
-
+
for (unsigned int i = 0; i < nIcons; i++ )
{
alreadySeeked += stream.Read(pCurrentEntry, sizeof(ICONDIRENTRY)).LastRead();
-
+
// bHeight and bColorCount are wxUint8
if ( pCurrentEntry->bWidth >= wMax )
{
colmax = pCurrentEntry->bColorCount;
}
}
-
+
pCurrentEntry++;
}
{
// seek to selected icon:
pCurrentEntry = pIconDirEntry + iSel;
-
+
// NOTE: seeking a positive amount in wxFromCurrent mode allows us to
// load even non-seekable streams (see wxInputStream::SeekI docs)!
wxFileOffset offset = wxUINT32_SWAP_ON_BE(pCurrentEntry->dwImageOffset) - alreadySeeked;
if (offset != 0 && stream.SeekI(offset, wxFromCurrent) == wxInvalidOffset)
return false;
-
+
bResult = LoadDib(image, stream, true, IsBmp);
bool bIsCursorType = (this->GetType() == wxBITMAP_TYPE_CUR) || (this->GetType() == wxBITMAP_TYPE_ANI);
if ( bResult && bIsCursorType && nType == 2 )
image->SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, wxUINT16_SWAP_ON_BE(pCurrentEntry->wBitCount));
}
}
-
+
delete [] pIconDirEntry;
-
+
return bResult;
}
if (stream.Read(&IconDir, sizeof(IconDir)).LastRead() != sizeof(IconDir))
// it's ok to modify the stream position here
return 0;
-
+
return (int)wxUINT16_SWAP_ON_BE(IconDir.idCount);
}
{
// NOTE: this code is the same of wxAnimationDecoder::CanRead and
// wxImageHandler::GetImageCount
-
+
if ( !stream.IsSeekable() )
return false; // can't test unseekable stream
wxGIFErrorCode error = decod.LoadGIF(stream);
if ( (error != wxGIF_OK) && (error != wxGIF_TRUNCATED) )
return -1;
-
+
// NOTE: this function modifies the current stream position but it's ok
// (see wxImageHandler::GetImageCount)
// constructor, destructor, etc.
wxIFFDecoder(wxInputStream *s);
~wxIFFDecoder() { Destroy(); }
-
+
// NOTE: this function modifies the current stream position
bool CanRead();
-
+
int ReadIFF();
bool ConvertToImage(wxImage *image) const;
};
// A hack based on one from tif_jpeg.c to overcome the problem on Windows
// of rpcndr.h defining boolean with a different type to the jpeg headers.
-//
+//
// This hack is only necessary for an external jpeg library, the builtin one
// usually used on Windows doesn't use the type boolean, so always works.
//
} while (TIFFReadDirectory(tif));
TIFFClose( tif );
-
+
// NOTE: this function modifies the current stream position but it's ok
// (see wxImageHandler::GetImageCount)
char chLast = '\0';
size_t lastCount = 0;
-
- const char* formatchars =
+
+ const char* formatchars =
"dghHmMsSy"
#ifdef __WXMSW__
"t"
// strftime() doesn't have era string,
// ignore this format
wxASSERT_MSG( lastCount <= 2, "too many 'g's" );
-
+
break;
#ifndef __WXMSW__
case 'a':
// this one is used for protecting ms_aTraceMasks from concurrent access
WX_DEFINE_LOG_CS(TraceMask);
-// and this one is used for GetComponentLevels()
+// and this one is used for GetComponentLevels()
WX_DEFINE_LOG_CS(Levels);
} // anonymous namespace
wxPERSIST_DEFINE_SAVE_RESTORE_FOR(long)
wxPERSIST_DEFINE_SAVE_RESTORE_FOR(wxString)
-#undef wxPERSIST_DEFINE_SAVE_RESTORE_FOR
+#undef wxPERSIST_DEFINE_SAVE_RESTORE_FOR
#endif // wxUSE_CONFIG
// remove any border style from our style as wxPickerBase's window must be
// invisible (user styles must be set on the textctrl or the platform-dependent picker)
style &= ~wxBORDER_MASK;
-
+
if (!wxControl::Create(parent, id, pos, size, style | wxNO_BORDER | wxTAB_TRAVERSAL,
validator, name))
return false;
-
+
SetMinSize( size );
-
+
m_sizer = new wxBoxSizer(wxHORIZONTAL);
if (HasFlag(wxPB_USE_TEXTCTRL))
// the text control's proportion values defaults to 2
m_sizer->Add(m_text, 2, GetDefaultTextCtrlFlag(), 5);
}
-
+
return true;
}
m_sizer->Add(m_picker, HasTextCtrl() ? 0 : 1, GetDefaultPickerCtrlFlag(), 5);
SetSizer(m_sizer);
-
+
SetInitialSize( GetMinSize() );
}
m_osDesc = wxGetOsDescription();
m_endian = wxIsPlatformLittleEndian() ? wxENDIAN_LITTLE : wxENDIAN_BIG;
m_arch = wxIsPlatform64Bit() ? wxARCH_64 : wxARCH_32;
-
+
#ifdef __LINUX__
m_ldi = wxGetLinuxDistributionInfo();
#endif
float scaleX = ((float(paperRect.width) * w) / (float(pw) * imageSize.x));
float scaleY = ((float(paperRect.height) * h) / (float(ph) * imageSize.y));
float actualScale = wxMin(scaleX, scaleY);
- m_printoutDC->SetUserScale(actualScale, actualScale);
+ m_printoutDC->SetUserScale(actualScale, actualScale);
m_printoutDC->SetDeviceOrigin(0, 0);
wxRect logicalPaperRect = GetLogicalPaperRect();
SetLogicalOrigin(logicalPaperRect.x, logicalPaperRect.y);
float scaleX = float(w) / imageSize.x;
float scaleY = float(h) / imageSize.y;
float actualScale = wxMin(scaleX, scaleY);
- m_printoutDC->SetUserScale(actualScale, actualScale);
+ m_printoutDC->SetUserScale(actualScale, actualScale);
m_printoutDC->SetDeviceOrigin(0, 0);
}
float scaleX = (float(pageMarginsRect.width) * w) / (float(pw) * imageSize.x);
float scaleY = (float(pageMarginsRect.height) * h) / (float(ph) * imageSize.y);
float actualScale = wxMin(scaleX, scaleY);
- m_printoutDC->SetUserScale(actualScale, actualScale);
+ m_printoutDC->SetUserScale(actualScale, actualScale);
m_printoutDC->SetDeviceOrigin(0, 0);
wxRect logicalPageMarginsRect = GetLogicalPageMarginsRect(pageSetupData);
SetLogicalOrigin(logicalPageMarginsRect.x, logicalPageMarginsRect.y);
// Set the DC scale and origin so that an image on the screen is the same
// size on the paper and the origin is at the top left of the printable area.
if (!m_printoutDC) return;
- int ppiScreenX, ppiScreenY;
- GetPPIScreen(&ppiScreenX, &ppiScreenY);
- int ppiPrinterX, ppiPrinterY;
- GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
- int w, h;
- m_printoutDC->GetSize(&w, &h);
- int pageSizePixelsX, pageSizePixelsY;
- GetPageSizePixels(&pageSizePixelsX, &pageSizePixelsY);
- float userScaleX = (float(ppiPrinterX) * w) / (float(ppiScreenX) * pageSizePixelsX);
- float userScaleY = (float(ppiPrinterY) * h) / (float(ppiScreenY) * pageSizePixelsY);
+ int ppiScreenX, ppiScreenY;
+ GetPPIScreen(&ppiScreenX, &ppiScreenY);
+ int ppiPrinterX, ppiPrinterY;
+ GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
+ int w, h;
+ m_printoutDC->GetSize(&w, &h);
+ int pageSizePixelsX, pageSizePixelsY;
+ GetPageSizePixels(&pageSizePixelsX, &pageSizePixelsY);
+ float userScaleX = (float(ppiPrinterX) * w) / (float(ppiScreenX) * pageSizePixelsX);
+ float userScaleY = (float(ppiPrinterY) * h) / (float(ppiScreenY) * pageSizePixelsY);
m_printoutDC->SetUserScale(userScaleX, userScaleY);
m_printoutDC->SetDeviceOrigin(0, 0);
}
// Set the DC scale so that a screen pixel is the same size as a device
// pixel and the origin is at the top left of the printable area.
if (!m_printoutDC) return;
- int w, h;
- m_printoutDC->GetSize(&w, &h);
- int pageSizePixelsX, pageSizePixelsY;
- GetPageSizePixels(&pageSizePixelsX, &pageSizePixelsY);
- float userScaleX = float(w) / pageSizePixelsX;
- float userScaleY = float(h) / pageSizePixelsY;
+ int w, h;
+ m_printoutDC->GetSize(&w, &h);
+ int pageSizePixelsX, pageSizePixelsY;
+ GetPageSizePixels(&pageSizePixelsX, &pageSizePixelsY);
+ float userScaleX = float(w) / pageSizePixelsX;
+ float userScaleY = float(h) / pageSizePixelsY;
m_printoutDC->SetUserScale(userScaleX, userScaleY);
m_printoutDC->SetDeviceOrigin(0, 0);
}
m_printoutDC->GetSize(&w, &h);
if (w == pw && h == ph) {
// this DC matches the printed page, so no scaling
- return wxRect(m_printoutDC->DeviceToLogicalX(paperRect.x),
- m_printoutDC->DeviceToLogicalY(paperRect.y),
- m_printoutDC->DeviceToLogicalXRel(paperRect.width),
+ return wxRect(m_printoutDC->DeviceToLogicalX(paperRect.x),
+ m_printoutDC->DeviceToLogicalY(paperRect.y),
+ m_printoutDC->DeviceToLogicalXRel(paperRect.width),
m_printoutDC->DeviceToLogicalYRel(paperRect.height));
}
// This DC doesn't match the printed page, so we have to scale.
float scaleX = float(w) / pw;
float scaleY = float(h) / ph;
- return wxRect(m_printoutDC->DeviceToLogicalX(wxRound(paperRect.x * scaleX)),
- m_printoutDC->DeviceToLogicalY(wxRound(paperRect.y * scaleY)),
- m_printoutDC->DeviceToLogicalXRel(wxRound(paperRect.width * scaleX)),
+ return wxRect(m_printoutDC->DeviceToLogicalX(wxRound(paperRect.x * scaleX)),
+ m_printoutDC->DeviceToLogicalY(wxRound(paperRect.y * scaleY)),
+ m_printoutDC->DeviceToLogicalXRel(wxRound(paperRect.width * scaleX)),
m_printoutDC->DeviceToLogicalYRel(wxRound(paperRect.height * scaleY)));
}
// area.
int w, h;
m_printoutDC->GetSize(&w, &h);
- return wxRect(m_printoutDC->DeviceToLogicalX(0),
- m_printoutDC->DeviceToLogicalY(0),
- m_printoutDC->DeviceToLogicalXRel(w),
+ return wxRect(m_printoutDC->DeviceToLogicalX(0),
+ m_printoutDC->DeviceToLogicalY(0),
+ m_printoutDC->DeviceToLogicalXRel(w),
m_printoutDC->DeviceToLogicalYRel(h));
}
// Return the rectangle in logical units that corresponds to the region
// within the page margins as specified by the given wxPageSetupDialogData
// object.
-
+
// We get the paper size in device units and the margins in mm,
// so we need to calculate the conversion with this trick
wxCoord pw, ph;
float mmToDeviceX = float(pw) / mw;
float mmToDeviceY = float(ph) / mh;
- // paper size in device units
+ // paper size in device units
wxRect paperRect = GetPaperRectPixels();
-
+
// margins in mm
wxPoint topLeft = pageSetupData.GetMarginTopLeft();
wxPoint bottomRight = pageSetupData.GetMarginBottomRight();
-
+
// calculate margins in device units
wxRect pageMarginsRect(
paperRect.x + wxRound(mmToDeviceX * topLeft.x),
paperRect.y + wxRound(mmToDeviceY * topLeft.y),
paperRect.width - wxRound(mmToDeviceX * (topLeft.x + bottomRight.x)),
paperRect.height - wxRound(mmToDeviceY * (topLeft.y + bottomRight.y)));
-
+
wxCoord w, h;
m_printoutDC->GetSize(&w, &h);
- if (w == pw && h == ph)
+ if (w == pw && h == ph)
{
// this DC matches the printed page, so no scaling
return wxRect(
- m_printoutDC->DeviceToLogicalX(pageMarginsRect.x),
- m_printoutDC->DeviceToLogicalY(pageMarginsRect.y),
- m_printoutDC->DeviceToLogicalXRel(pageMarginsRect.width),
+ m_printoutDC->DeviceToLogicalX(pageMarginsRect.x),
+ m_printoutDC->DeviceToLogicalY(pageMarginsRect.y),
+ m_printoutDC->DeviceToLogicalXRel(pageMarginsRect.width),
m_printoutDC->DeviceToLogicalYRel(pageMarginsRect.height));
}
-
+
// This DC doesn't match the printed page, so we have to scale.
float scaleX = float(w) / pw;
float scaleY = float(h) / ph;
- return wxRect(m_printoutDC->DeviceToLogicalX(wxRound(pageMarginsRect.x * scaleX)),
- m_printoutDC->DeviceToLogicalY(wxRound(pageMarginsRect.y * scaleY)),
- m_printoutDC->DeviceToLogicalXRel(wxRound(pageMarginsRect.width * scaleX)),
+ return wxRect(m_printoutDC->DeviceToLogicalX(wxRound(pageMarginsRect.x * scaleX)),
+ m_printoutDC->DeviceToLogicalY(wxRound(pageMarginsRect.y * scaleY)),
+ m_printoutDC->DeviceToLogicalXRel(wxRound(pageMarginsRect.width * scaleX)),
m_printoutDC->DeviceToLogicalYRel(wxRound(pageMarginsRect.height * scaleY)));
}
{
// Set the device origin by specifying a point in logical coordinates.
m_printoutDC->SetDeviceOrigin(
- m_printoutDC->LogicalToDeviceX(x),
+ m_printoutDC->LogicalToDeviceX(x),
m_printoutDC->LogicalToDeviceY(y) );
}
-
+
void wxPrintout::OffsetLogicalOrigin(wxCoord xoff, wxCoord yoff)
{
// Offset the device origin by a specified distance in device coordinates.
wxPoint dev_org = m_printoutDC->GetDeviceOrigin();
m_printoutDC->SetDeviceOrigin(
- dev_org.x + m_printoutDC->LogicalToDeviceXRel(xoff),
+ dev_org.x + m_printoutDC->LogicalToDeviceXRel(xoff),
dev_org.y + m_printoutDC->LogicalToDeviceYRel(yoff) );
}
-
+
//----------------------------------------------------------------------------
// wxPreviewCanvas
wxMemoryDC temp_dc;
temp_dc.SelectObject(*m_previewBitmap);
- dc.Blit(pageRect.x, pageRect.y,
+ dc.Blit(pageRect.x, pageRect.y,
m_previewBitmap->GetWidth(), m_previewBitmap->GetHeight(), &temp_dc, 0, 0);
temp_dc.SelectObject(wxNullBitmap);
// Draw blank page allowing for 1-pixel border AROUND the actual paper
dc.SetPen(*wxBLACK_PEN);
dc.SetBrush(*wxWHITE_BRUSH);
- dc.DrawRectangle(paperRect.x - 2, paperRect.y - 1,
+ dc.DrawRectangle(paperRect.x - 2, paperRect.y - 1,
paperRect.width + 3, paperRect.height + 2);
return true;
{
// we just detach from the next handler of the chain (i.e. our "parent" -- see ctor)
// not also from the previous handler like wxEvtHandler::Unlink() would do:
-
+
if (m_nextHandler)
m_nextHandler->SetPreviousHandler(m_previousHandler);
textstr + matchStart,
#else
textstr.data() + matchStart,
-#endif
+#endif
countRepl ? wxRE_NOTBOL : 0
WXREGEX_IF_NEED_LEN(textlen - matchStart)) )
{
}
else
{
+ textNew += wxString(
#ifndef WXREGEX_CONVERT_TO_MB
- textNew += wxString(textstr + matchStart + start,
+ textstr
#else
- textNew += wxString(textstr.data() + matchStart +
- start,
+ textstr.data()
#endif
- *wxConvCurrent, len);
+ + matchStart + start,
+ *wxConvCurrent, len);
mayHaveBackrefs = true;
}
#ifndef WXREGEX_CONVERT_TO_MB
result.append(*text, matchStart, start);
#else
- result.append(wxString(textstr.data() + matchStart, *wxConvCurrent,
- start));
+ result.append(wxString(textstr.data() + matchStart, *wxConvCurrent, start));
#endif
matchStart += start;
result.append(textNew);
#if defined( __WXGTK20__ )
// if the wxStaticBox has created a wxPizza to contain its children
// (see wxStaticBox::AddChild) then we need to place the items it contains
- // in the wxBoxSizer::RecalcSizes() call below using coordinates relative
+ // in the wxBoxSizer::RecalcSizes() call below using coordinates relative
// to the top-left corner of the staticbox:
m_position.x = m_position.y = 0;
#else
// if the wxStaticBox has childrens, then these windows must be placed
- // by the wxBoxSizer::RecalcSizes() call below using coordinates relative
+ // by the wxBoxSizer::RecalcSizes() call below using coordinates relative
// to the top-left corner of the staticbox (but unlike wxGTK, we need
// to keep in count the static borders here!):
m_position.x = other_border;
// ----------------------------------------------------------------------------
// TODO: Do we want to include the null char in the stream? If so then
-// just add +1 to m_len in the ctor
+// just add +1 to m_len in the ctor
wxStringInputStream::wxStringInputStream(const wxString& s)
#if wxUSE_UNICODE
// FIXME-UTF8: use wxCharBufferWithLength if we have it
// getlength
// ----------------------------------------------------------------------------
-wxFileOffset wxStringInputStream::GetLength() const
-{
- return m_len;
+wxFileOffset wxStringInputStream::GetLength() const
+{
+ return m_len;
}
// ----------------------------------------------------------------------------
bytes_read = Read(buf, WXSIZEOF(buf)).LastRead();
if ( m_lasterror != wxSTREAM_NO_ERROR )
return wxInvalidOffset;
-
+
wxASSERT(bytes_read == WXSIZEOF(buf));
}
-
+
// read the last 'pos' bytes
bytes_read = Read(buf, (size_t)pos).LastRead();
if ( m_lasterror != wxSTREAM_NO_ERROR )
return wxInvalidOffset;
-
+
wxASSERT(bytes_read == (size_t)pos);
-
+
// we should now have seeked to the right position...
return TellI();
}
bool wxVariantDataLongLong::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == wxS("longlong")),
+ wxASSERT_MSG( (data.GetType() == wxS("longlong")),
"wxVariantDataLongLong::Eq: argument mismatch" );
wxVariantDataLongLong& otherData = (wxVariantDataLongLong&) data;
bool wxVariantDataULongLong::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == wxS("ulonglong")),
+ wxASSERT_MSG( (data.GetType() == wxS("ulonglong")),
"wxVariantDataULongLong::Eq: argument mismatch" );
wxVariantDataULongLong& otherData = (wxVariantDataULongLong&) data;
#endif
#if defined(__DARWIN__)
- #include "wx/osx/core/cfref.h"
- #include <CoreFoundation/CFLocale.h>
- #include "wx/osx/core/cfstring.h"
+ #include "wx/osx/core/cfref.h"
+ #include <CoreFoundation/CFLocale.h>
+ #include "wx/osx/core/cfstring.h"
#include <xlocale.h>
#endif
#if wxUSE_UNICODE_WCHAR
#ifdef __DMC__
/*
-This fails with a bug similar to
+This fails with a bug similar to
http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=c++.beta&artnum=680
in DMC 8.49 and 8.50
I don't see it being used in the wxWidgets sources at present (oct 2007) CE
#endif // wxCRT_StrdupW
#ifndef wxWCHAR_T_IS_WXCHAR16
-size_t wxStrlen(const wxChar16 *s )
-{
- if (!s) return 0;
- size_t i=0;
- while (*s!=0) { ++i; ++s; };
+size_t wxStrlen(const wxChar16 *s )
+{
+ if (!s) return 0;
+ size_t i=0;
+ while (*s!=0) { ++i; ++s; };
return i;
}
wxChar16* wxStrdup(const wxChar16* s)
-{
- size_t size = (wxStrlen(s) + 1) * sizeof(wxChar16);
+{
+ size_t size = (wxStrlen(s) + 1) * sizeof(wxChar16);
wxChar16 *ret = (wxChar16*) malloc(size);
memcpy(ret, s, size);
return ret;
#endif
#ifndef wxWCHAR_T_IS_WXCHAR32
-size_t wxStrlen(const wxChar32 *s )
-{
- if (!s) return 0;
- size_t i=0;
- while (*s!=0) { ++i; ++s; };
+size_t wxStrlen(const wxChar32 *s )
+{
+ if (!s) return 0;
+ size_t i=0;
+ while (*s!=0) { ++i; ++s; };
return i;
}
wxChar32* wxStrdup(const wxChar32* s)
-{
- size_t size = (wxStrlen(s) + 1) * sizeof(wxChar32);
+{
+ size_t size = (wxStrlen(s) + 1) * sizeof(wxChar32);
wxChar32 *ret = (wxChar32*) malloc(size);
memcpy(ret, s, size);
return ret;
m_locale = newlocale(LC_ALL_MASK, buf2.c_str(), NULL);
}
}
-
+
// TODO: wxLocale performs many more manipulations of the given locale
// string in the attempt to set a valid locale; reusing that code
// (changing it to take a generic wxTryLocale callback) would be nice
}
long wxStrtol_l(const wchar_t* str, wchar_t **endptr, int base, const wxXLocale& loc)
-{
+{
IMPLEMENT_STRTOX_L_START
long ret = wxStrtol(str, endptr, base);
IMPLEMENT_STRTOX_L_END
const wxChar * const *
wxGzipClassFactory::GetProtocols(wxStreamProtocolType type) const
{
- static const wxChar *protos[] =
+ static const wxChar *protos[] =
{ wxT("gzip"), NULL };
- static const wxChar *mimes[] =
+ static const wxChar *mimes[] =
{ wxT("application/gzip"), wxT("application/x-gzip"), NULL };
- static const wxChar *encs[] =
+ static const wxChar *encs[] =
{ wxT("gzip"), NULL };
- static const wxChar *exts[] =
+ static const wxChar *exts[] =
{ wxT(".gz"), wxT(".gzip"), NULL };
static const wxChar *empty[] =
{ NULL };
}
void wxAnimationCtrl::DisposeToBackground(wxDC& dc)
-{
+{
wxColour col = IsUsingWindowBackgroundColour()
? GetBackgroundColour()
: m_animation.GetBackgroundColour();
if ( m_backingStore.IsOk() )
{
// NOTE: we draw the bitmap explicitely ignoring the mask (if any);
- // i.e. we don't want to combine the backing store with the
+ // i.e. we don't want to combine the backing store with the
// possibly wrong preexisting contents of the window!
dc.DrawBitmap(m_backingStore, 0, 0, false /* no mask */);
}
// when using them inside sizers.
if (m_animation.IsOk())
{
- // be careful to change the backing store *only* if we are
- // playing the animation as otherwise we may be displaying
- // the inactive bitmap and overwriting the backing store
+ // be careful to change the backing store *only* if we are
+ // playing the animation as otherwise we may be displaying
+ // the inactive bitmap and overwriting the backing store
// with the last played frame is wrong in this case
if (IsPlaying())
{
{
text = GetString(item);
}
-
+
wxBitmapComboBoxBase::DrawItem(dc, rect, item, text, flags);
}
// clear main background
dc.DrawRectangle(rect);
-
+
if ( !m_btn )
{
// Standard button rendering
wxDataViewVirtualListModel *list_model =
(wxDataViewVirtualListModel*) GetOwner()->GetModel();
m_count = list_model->GetCount();
-
+
if( m_currentRow > GetRowCount() )
m_currentRow = m_count - 1;
{
wxDataViewTreeNode* node = GetTreeNodeByRow(row);
indent = GetOwner()->GetIndent() * node->GetIndentLevel();
- indent = indent + m_lineHeight; // use m_lineHeight as the width of the expander
+ indent = indent + m_lineHeight; // use m_lineHeight as the width of the expander
if(!node->HasChildren())
delete node;
{
wxDataViewVirtualListModel *list_model =
(wxDataViewVirtualListModel*) GetOwner()->GetModel();
-
+
return list_model->GetCount();
}
else
wxCoord fwidth, wxCoord fheight,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
- wxRasterOperationMode rop,
+ wxRasterOperationMode rop,
bool WXUNUSED(useMask), wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask) )
{
wxCHECK_MSG( m_ok, false, wxT("invalid postscript dc") );
virtual void BeginLayer(wxDouble opacity);
virtual void EndLayer();
-
+
virtual void StrokePath( const wxGraphicsPath& p );
virtual void FillPath( const wxGraphicsPath& p , wxPolygonFillMode fillStyle = wxWINDING_RULE );
void Init(cairo_t *context);
cairo_t* m_context;
-
+
wxVector<float> m_layerOpacities;
wxDECLARE_NO_COPY_CLASS(wxCairoContext);
wxCairoFontData* font_data = (wxCairoFontData*) m_font.GetRefData();
pango_layout_set_font_description( layout, font_data->GetFont());
pango_layout_set_text(layout, data, datalen);
-
- if (font_data->GetUnderlined())
+
+ if (font_data->GetUnderlined())
{
PangoAttrList *attrs = pango_attr_list_new();
PangoAttribute *attr = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
return true;
m_antialias = antialias;
-
+
cairo_antialias_t antialiasMode;
switch (antialias)
{
{
if ( m_composition == op )
return true;
-
+
m_composition = op;
cairo_operator_t cop;
switch (op)
cairo_pop_group_to_source(m_context);
cairo_paint_with_alpha(m_context,opacity);
}
-
+
//-----------------------------------------------------------------------------
// wxCairoRenderer declaration
//-----------------------------------------------------------------------------
#include "wx/textctrl.h"
#include "wx/dc.h"
#include "wx/combobox.h"
- #include "wx/settings.h"
+ #include "wx/settings.h"
#include "wx/log.h"
#include "wx/checkbox.h"
#endif // WX_PRECOMP
{
int w, h;
GetClientSize(&w, &h);
-
+
#ifdef __WXGTK__
// int vw;
// GetVirtualSize(&vw, NULL);
{
state = wxCONTROL_DISABLED;
}
-
+
if (i == 0)
state |= wxCONTROL_SPECIAL;
params.m_labelText = col.GetTitle();
params.m_labelBitmap = col.GetBitmap();
params.m_labelAlignment = col.GetAlignment();
-
+
#ifdef __WXGTK__
if (i == count-1)
{
void wxGenericHyperlinkCtrl::OnLeftUp(wxMouseEvent& event)
{
// the click must be started and ended in the hyperlink rect
- if (!m_clicking || !GetLabelRect().Contains(event.GetPosition()))
+ if (!m_clicking || !GetLabelRect().Contains(event.GetPosition()))
return;
SetForegroundColour(m_visitedColour);
{
if (m_refData)
return M_PALETTEDATA->m_count;
-
- return 0;
+
+ return 0;
}
bool wxPalette::Create(int n,
wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
wxPrintDialogData* data)
- : wxPrintDialogBase(GetParentForModalDialog(parent),
+ : wxPrintDialogBase(GetParentForModalDialog(parent),
wxID_ANY, _("Print"),
wxPoint(0,0), wxSize(600, 600),
wxDEFAULT_DIALOG_STYLE |
wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
wxPrintData* data)
- : wxPrintDialogBase(GetParentForModalDialog(parent),
+ : wxPrintDialogBase(GetParentForModalDialog(parent),
wxID_ANY, _("Print"),
wxPoint(0,0), wxSize(600, 600),
wxDEFAULT_DIALOG_STYLE |
/* width height ncolors chars_per_pixel */
"16 16 3 1",
/* colors */
-" s None c None",
-"X c #000000",
-". c #808080",
+" s None c None",
+"X c #000000",
+". c #808080",
/* pixels */
" ",
" ",
m_refData = new wxRegionRefData(topLeft, bottomRight);
}
-wxRegionGeneric::wxRegionGeneric(const wxBitmap& bmp)
+wxRegionGeneric::wxRegionGeneric(const wxBitmap& bmp)
{
wxFAIL_MSG("NOT IMPLEMENTED: wxRegionGeneric::wxRegionGeneric(const wxBitmap& bmp)");
}
const wxString& str = statbar->GetStatusText(n);
if (str.empty())
return FALSE;
-
+
gtk_tooltip_set_text(tooltip, wxGTK_CONV_SYS(str));
return TRUE;
}
SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height);
SetFieldsCount(1);
-
+
#if defined( __WXGTK20__ )
#if GTK_CHECK_VERSION(2,12,0)
if (HasFlag(wxSTB_SHOW_TIPS) && !gtk_check_version(2,12,0))
{
- g_object_set(m_widget, "has-tooltip", TRUE, NULL);
- g_signal_connect(m_widget, "query-tooltip",
- G_CALLBACK(statusbar_query_tooltip), this);
+ g_object_set(m_widget, "has-tooltip", TRUE, NULL);
+ g_signal_connect(m_widget, "query-tooltip",
+ G_CALLBACK(statusbar_query_tooltip), this);
}
#endif
#endif
}
// eventually ellipsize the text so that it fits the field width
-
+
wxEllipsizeMode ellmode = (wxEllipsizeMode)-1;
if (HasFlag(wxSTB_ELLIPSIZE_START)) ellmode = wxELLIPSIZE_START;
else if (HasFlag(wxSTB_ELLIPSIZE_MIDDLE)) ellmode = wxELLIPSIZE_MIDDLE;
wxELLIPSIZE_EXPAND_TAB);
// Ellipsize() will do something only if necessary
- // update the ellipsization status for this pane; this is used later to
- // decide whether a tooltip should be shown or not for this pane
+ // update the ellipsization status for this pane; this is used later to
+ // decide whether a tooltip should be shown or not for this pane
// (if we have wxSTB_SHOW_TIPS)
SetEllipsizedFlag(i, text != GetStatusText(i));
}
// draw the text
dc.DrawText(text, xpos, ypos);
-
+
if (ellmode == (wxEllipsizeMode)-1)
dc.DestroyClippingRegion();
}
// NOTE: we explicitely don't take in count the borders since they are only
// useful when rendering the status text, not for hit-test computations
-
+
if (pt.y <= 0 || pt.y >= m_lastClientHeight)
return wxNOT_FOUND;
{
if (pt.x > x && pt.x < x+m_widthsAbs[i])
return i;
-
+
x += m_widthsAbs[i];
}
// wxVarVScrollLegacyAdaptor
// ===========================================================================
-size_t wxVarVScrollLegacyAdaptor::GetFirstVisibleLine() const
+size_t wxVarVScrollLegacyAdaptor::GetFirstVisibleLine() const
{ return GetVisibleRowsBegin(); }
size_t wxVarVScrollLegacyAdaptor::GetLastVisibleLine() const
void wxVarVScrollLegacyAdaptor::RefreshLines(size_t from, size_t to)
{ RefreshRows(from, to); }
-
+
bool wxVarVScrollLegacyAdaptor::ScrollToLine(size_t line)
{ return ScrollToRow(line); }
bool wxVarVScrollLegacyAdaptor::ScrollLines(int lines)
{ return ScrollRows(lines); }
-
+
bool wxVarVScrollLegacyAdaptor::ScrollPages(int pages)
{ return ScrollRowPages(pages); }
// Size event doesn't get sent soon enough on wxGTK
DoLayout();
-
+
SetLayoutAdaptationDone(true);
return true;
{
g_signal_handlers_block_by_func(m_widget,
(gpointer) gtk_day_selected_callback, this);
-
+
m_selectedDate = date;
int year = date.GetYear();
int month = date.GetMonth();
int day = date.GetDay();
gtk_calendar_select_month(GTK_CALENDAR(m_widget), month, year);
gtk_calendar_select_day(GTK_CALENDAR(m_widget), day);
-
+
g_signal_handlers_unblock_by_func( m_widget,
(gpointer) gtk_day_selected_callback, this);
-
+
return true;
}
if (state == GetValue())
return;
-
+
GTKDisableEvents();
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(m_widgetCheckbox), state );
wxImage img;
if (!img.LoadFile(cursor_file, type))
return;
-
+
// eventually set the hotspot:
if (!img.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X))
img.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, hotSpotX);
if (!img.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y))
img.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, hotSpotY);
-
+
InitFromImage(img);
}
struct _GtkWxCellRendererText
{
GtkCellRendererText parent;
-
+
wxDataViewRenderer *wx_renderer;
};
event.SetColumn( wx_renderer->GetOwner()->GetModelColumn() );
event.SetItem( item );
dv->HandleWindowEvent( event );
-
+
if (event.IsAllowed())
return GTK_CELL_RENDERER_CLASS(text_cell_parent_class)->
start_editing( gtk_renderer, gdk_event, widget, path, background_area, cell_area, flags );
bool wxGtkDataViewModelNotifier::Cleared()
{
m_owner->GtkGetInternal()->Cleared();
-
+
return true;
}
if (!gtk_check_version(2,6,0))
{
g_signal_connect (GTK_CELL_RENDERER(m_renderer), "editing_started",
- G_CALLBACK (wxgtk_renderer_editing_started),
- this);
+ G_CALLBACK (wxgtk_renderer_editing_started),
+ this);
}
}
// Sort the ptrs
gs_internal = m_internal;
ptrs.Sort( &wxGtkTreeModelChildPtrCmp );
-
+
wxGtkTreeModelChildren temp;
void** base_ptr = &(m_children[0]);
- // Transfer positions to new_order array and
+ // Transfer positions to new_order array and
// IDs to temp
for (i = 0; i < child_count; i++)
{
#if 0
// Too slow
-
+
wxGtkTreeModelChildren temp;
WX_APPEND_ARRAY( temp, m_children );
gs_internal = m_internal;
m_children.Sort( &wxGtkTreeModelChildCmp );
-
+
unsigned int pos;
for (pos = 0; pos < child_count; pos++)
{
gtk_tree_path_free (path);
delete [] new_order;
-
+
unsigned int pos;
for (pos = 0; pos < node_count; pos++)
{
GtkWidget* tree_widget = GetOwner()->GtkGetTreeView();
gtk_tree_view_set_model( GTK_TREE_VIEW(tree_widget), NULL );
gtk_tree_view_set_model( GTK_TREE_VIEW(tree_widget), GTK_TREE_MODEL(m_gtk_model) );
-
+
if (m_root)
{
delete m_root;
InitTree();
}
-
+
return true;
}
if (m_wx_model->IsVirtualListModel())
{
wxDataViewVirtualListModel *wx_model = (wxDataViewVirtualListModel*) m_wx_model;
-
+
unsigned int i = (unsigned int)gtk_tree_path_get_indices (path)[0];
-
+
if (i >= wx_model->GetCount())
return FALSE;
iter->user_data = NULL;
return FALSE;
}
-
+
// user_data is just the index +1 (+2 because we need the next)
iter->user_data = (gpointer) (n+2);
}
iter->user_data = (gpointer) m_root->GetChildren().Item( 0 );
return TRUE;
}
-
+
wxDataViewItem item( (void*) parent->user_data );
if (!m_wx_model->IsContainer( item ))
if (iter == NULL)
return (wx_model->GetCount() > 0);
-
+
// this is a list, nodes have no children
return FALSE;
}
{
if (iter == NULL)
return (m_root->GetChildCount() > 0);
-
+
wxDataViewItem item( (void*) iter->user_data );
bool is_container = m_wx_model->IsContainer( item );
IMPLEMENT_ABSTRACT_CLASS(wxGTKDCImpl, wxDCImpl)
-wxGTKDCImpl::wxGTKDCImpl( wxDC *owner )
+wxGTKDCImpl::wxGTKDCImpl( wxDC *owner )
: wxDCImpl( owner )
{
m_ok = FALSE;
IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl, wxWindowDCImpl)
-wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
: wxWindowDCImpl( owner )
-{
- Init();
+{
+ Init();
}
-wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap)
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap)
: wxWindowDCImpl( owner )
-{
- Init();
- DoSelect(bitmap);
+{
+ Init();
+ DoSelect(bitmap);
}
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *WXUNUSED(dc) )
IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl)
-wxScreenDCImpl::wxScreenDCImpl( wxScreenDC *owner )
+wxScreenDCImpl::wxScreenDCImpl( wxScreenDC *owner )
: wxWindowDCImpl( owner )
-{
- Init();
+{
+ Init();
}
void wxScreenDCImpl::Init()
else if (drop_target->GetDefaultAction() == wxDragMove &&
(context->actions & GDK_ACTION_MOVE))
{
-
+
result = wxDragMove;
}
else
// categorize the GDK event according to wxEventCategory.
// See http://library.gnome.org/devel/gdk/unstable/gdk-Events.html#GdkEventType
// for more info.
-
+
// NOTE: GDK_* constants which were not present in the GDK2.0 can be tested for
// only at compile-time; when running the program (compiled with a recent GDK)
- // on a system with an older GDK lib we can be sure there won't be problems
- // because event->type will never assume those values corresponding to
+ // on a system with an older GDK lib we can be sure there won't be problems
+ // because event->type will never assume those values corresponding to
// new event types (since new event types are always added in GDK with non
// conflicting values for ABI compatibility).
gtk_file_filter_set_name( filter, wxGTK_CONV_SYS( wildDescriptions[n] ) );
wxStringTokenizer exttok( wildFilters[n], wxT( ";" ) );
-
+
int n1 = 1;
while ( exttok.HasMoreTokens() )
{
wxString token = exttok.GetNextToken();
gtk_file_filter_add_pattern( filter, wxGTK_CONV_SYS( token ) );
-
+
if (n1 == 1)
m_wildcards.Add( token ); // Only add first pattern to list, used later when saving
n1++;
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#if wxUSE_FILEDLG
+#if wxUSE_FILEDLG
#include "wx/filedlg.h"
return wxDialog::ShowModal();
}
-void wxFileDialog::DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
- int WXUNUSED(width), int WXUNUSED(height),
+void wxFileDialog::DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
+ int WXUNUSED(width), int WXUNUSED(height),
int WXUNUSED(sizeFlags))
{
}
wxString wxFileDialog::GetPath() const
{
wxFileName fn = m_fc.GetPath();
-
+
if (HasFdFlag(wxFD_SAVE))
{
// add extension
return m_fc.GetFilterIndex();
}
-#endif // wxUSE_FILEDLG
+#endif // wxUSE_FILEDLG
m_wildcard = wildcard;
if ((m_dialog = CreateDialog()) == NULL)
return false;
-
+
// little trick used to avoid problems when there are other GTK windows 'grabbed':
// GtkFileChooserDialog won't be responsive to user events if there is another
// window which called gtk_grab_add (and this happens if e.g. a wxDialog is running
// use as label the currently selected file
m_widget = gtk_file_chooser_button_new_with_dialog( m_dialog->m_widget );
-
+
g_object_ref(m_widget);
gtk_widget_show(m_widget);
void wxFileButton::SetPath(const wxString &str)
{
m_path = str;
-
+
if (m_dialog)
UpdateDialogPath(m_dialog);
}
m_widget = gtk_file_chooser_button_new_with_dialog( m_dialog->m_widget );
g_object_ref(m_widget);
-
+
gtk_widget_show(m_widget);
// GtkFileChooserButton signals
}
void wxDirButton::GTKUpdatePath(const char *gtkpath)
-{
+{
m_path = wxString::FromUTF8(gtkpath);
}
void wxDirButton::SetPath(const wxString& str)
return false;
}
- pango_font_description_set_absolute_size( m_nativeFontInfo.description,
+ pango_font_description_set_absolute_size( m_nativeFontInfo.description,
pixelSize.GetHeight() * PANGO_SCALE );
return true;
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#if wxUSE_FONTPICKERCTRL
+#if wxUSE_FONTPICKERCTRL
#include "wx/fontpicker.h"
wxAcceleratorEntry* entry = (wxAcceleratorEntry*) accelEntries.Item(i)->GetData();
entries[i] = (*entry);
delete entry;
-
+
}
wxAcceleratorTable table(n, entries);
GdkEventKey *gdk_event,
wxListBox *listbox )
{
- if ((gdk_event->keyval == GDK_Return) ||
+ if ((gdk_event->keyval == GDK_Return) ||
(gdk_event->keyval == GDK_ISO_Enter) ||
(gdk_event->keyval == GDK_KP_Enter))
{
return FALSE;
index = sels[0];
}
-
+
if (index != wxNOT_FOUND)
{
wxCommandEvent event(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, listbox->GetId() );
event.SetEventObject( listbox );
-
+
GtkTreeEntry* entry = listbox->GtkGetEntry( index );
// indicate that this is a selection
/* bool ret = */ listbox->HandleWindowEvent( event );
g_object_unref (entry);
-
+
// wxMac and wxMSW always invoke default action
// if (!ret)
{
gtk_window_activate_default( gtk_window );
}
}
-
+
// Always intercept, otherwise we'd get another dclick
// event from row_activated
return TRUE;
}
}
-
+
return FALSE;
}
}
g_signal_connect_after (selection, "changed",
G_CALLBACK (gtk_listitem_changed_callback), this);
-
+
return true;
}
g_signal_handlers_unblock_by_func(selection,
(gpointer) gtk_listitem_changed_callback, this);
-
+
UpdateOldSelections();
}
void wxListBox::Update()
{
wxWindow::Update();
-
+
if (m_treeview)
gdk_window_process_updates(GTK_WIDGET(m_treeview)->window, TRUE);
}
InvalidateBestSize();
gtk_list_store_clear( m_liststore ); /* well, THAT was easy :) */
-
+
GtkEnableEvents();
}
// this returns false if iter is invalid (e.g. deleting item at end) but
// since we don't use iter, we ignore the return value
gtk_list_store_remove(m_liststore, &iter);
-
+
GtkEnableEvents();
}
wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
GtkDisableEvents();
-
+
GtkTreeSelection* selection = gtk_tree_view_get_selection(m_treeview);
// passing -1 to SetSelection() is documented to deselect all items
wxCHECK_RET( IsValid(n), wxT("invalid index in wxListBox::SetSelection") );
-
+
GtkTreeIter iter;
wxCHECK_RET( GtkGetIteratorFor(n, &iter), wxT("Invalid index") );
// a call to gtk_mdi_page_change_callback with an invalid parent
// (because gtk_mdi_page_change_callback expects a wxMDIClientWindow but
// at that point of the dtor chain we are a simple wxWindow!)
- g_signal_handlers_disconnect_by_func(m_widget,
+ g_signal_handlers_disconnect_by_func(m_widget,
(gpointer)gtk_mdi_page_change_callback,
GetParent());
}
wxBrush brush( LightContrastColour( wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT) ) );
dc.SetBrush( brush );
dc.SetPen( *wxTRANSPARENT_PEN );
- dc.DrawRectangle( win->m_miniEdge-1,
- win->m_miniEdge-1,
+ dc.DrawRectangle( win->m_miniEdge-1,
+ win->m_miniEdge-1,
win->m_width - (2*(win->m_miniEdge-1)),
15 );
if (style & wxCLOSE_BOX)
dc.DrawBitmap( win->m_closeButton, win->m_width-18, 3, true );
}
-
+
return false;
}
}
wxGtkNotebookPage* p = GetNotebookPage(page);
m_pagesData.DeleteObject(p);
delete p;
-
+
return client;
}
if (!gtk_check_version(2,10,0))
gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (toplevel)), GTK_WINDOW (m_widget));
#endif
-
+
gtk_window_set_transient_for (GTK_WINDOW (m_widget), GTK_WINDOW (toplevel));
}
gtk_window_set_resizable (GTK_WINDOW (m_widget), FALSE);
return;
}
}
-
+
wxPopupWindowBase::SetFocus();
}
cairo_stroke ( m_cairo);
}
-void wxGtkPrinterDCImpl::DoDrawPolygon(int n, wxPoint points[],
- wxCoord xoffset, wxCoord yoffset,
+void wxGtkPrinterDCImpl::DoDrawPolygon(int n, wxPoint points[],
+ wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle)
{
if (n==0) return;
}
void wxGtkPrinterDCImpl::DoDrawPolyPolygon(int n, int count[], wxPoint points[],
- wxCoord xoffset, wxCoord yoffset,
+ wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle)
{
wxDCImpl::DoDrawPolyPolygon( n, count, points, xoffset, yoffset, fillStyle );
// Get the dummy tree widget, give it a column, and then use the
// widget in the column header for the rendering code.
GtkWidget* treewidget = GetTreeWidget();
-
+
GtkTreeViewColumn *column = gtk_tree_view_column_new();
gtk_tree_view_append_column(GTK_TREE_VIEW(treewidget), column);
s_first_button = column->button;
-
+
column = gtk_tree_view_column_new();
gtk_tree_view_append_column(GTK_TREE_VIEW(treewidget), column);
s_other_button = column->button;
-
+
column = gtk_tree_view_column_new();
gtk_tree_view_append_column(GTK_TREE_VIEW(treewidget), column);
s_last_button = column->button;
}
-
+
GtkWidget *GetHeaderButtonWidgetFirst()
{
if (!s_first_button)
M_REGIONDATA->m_region = gdk_region_copy( region );
}
-wxRegion::wxRegion( size_t n, const wxPoint *points,
+wxRegion::wxRegion( size_t n, const wxPoint *points,
wxPolygonFillMode fillStyle )
{
GdkPoint *gdkpoints = new GdkPoint[n];
wxNativeFontInfo info;
info.description = ButtonStyle()->font_desc;
gs_fontSystem = wxFont(info);
-
+
// (try to) heal the default font (on some common systems e.g. Ubuntu
// it's "Sans Serif" but the real font is called "Sans"):
if (!wxFontEnumerator::IsValidFacename(gs_fontSystem.GetFaceName()) &&
gs_fontSystem.GetFaceName() == "Sans Serif")
gs_fontSystem.SetFaceName("Sans");
-
+
info.description = NULL;
}
font = gs_fontSystem;
GtkWidget* label_widget = gtk_frame_get_label_widget(GTK_FRAME(widget));
int w = alloc->width -
2 * widget->style->xthickness - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD;
- if (w < 0)
+ if (w < 0)
w = 0;
if (label_widget->allocation.width > w)
GTKSetLabelForLabel(GTK_LABEL(m_widget), label);
// adjust the label size to the new label unless disabled
- if ( !HasFlag(wxST_NO_AUTORESIZE) &&
+ if ( !HasFlag(wxST_NO_AUTORESIZE) &&
!IsEllipsized() ) // if ellipsize is ON, then we don't want to get resized!
SetSize( GetBestSize() );
}
void wxTopLevelWindowGTK::Refresh( bool WXUNUSED(eraseBackground), const wxRect *WXUNUSED(rect) )
{
wxCHECK_RET( m_widget, wxT("invalid frame") );
-
+
gtk_widget_queue_draw( m_widget );
if (m_wxwindow && m_wxwindow->window)
// NOTE: you don't need to use this macro to check for Pango features
// added in pango-1.4 or earlier since GTK 2.4 (our minimum requirement
// for GTK lib) required pango 1.4...
-
+
#ifdef PANGO_VERSION_MAJOR
if (!gtk_check_version (2,11,0))
{
}
widget->allocation = *alloc;
-
+
// adjust child positions
for (const GList* list = pizza->m_fixed.children; list; list = list->next)
{
if (GTK_WIDGET_VISIBLE(child->widget))
{
GtkAllocation child_old_alloc = child->widget->allocation;
-
+
GtkAllocation child_alloc;
// note that child positions do not take border into
// account, they need to be relative to widget->window,
const AdjustData* p = static_cast<AdjustData*>(data);
widget->allocation.x += p->dx;
widget->allocation.y += p->dy;
-
+
if (widget->window == p->window)
{
// GtkFrame requires a queue_resize, otherwise parts of
x = y = 0;
if (m_border_style == 0)
return;
-
+
#ifndef __WXUNIVERSAL__
if (m_border_style & wxBORDER_SIMPLE)
x = y = 1;
else if (m_is_scrollable || (m_border_style & wxBORDER_THEME))
{
GtkWidget *style_widget = wxGTKPrivate::GetTreeWidget();
-
+
if (style_widget->style)
{
x = style_widget->style->xthickness;
y = style_widget->style->ythickness;
}
}
- else
+ else
{
GtkWidget *style_widget = wxGTKPrivate::GetEntryWidget();
-
+
if (style_widget->style)
{
x = style_widget->style->xthickness;
gtk_im_context_set_client_window( win->m_imData->context,
widget->window);
}
-
+
// We cannot set colours and fonts before the widget
// been realized, so we do this directly after realization
// or otherwise in idle time
void wxWindowGTK::AddChildGTK(wxWindowGTK* child)
{
wxASSERT_MSG(m_wxwindow, "Cannot add a child to a window without a client area");
-
+
// the window might have been scrolled already, we
// have to adapt the position
wxPizza* pizza = WX_PIZZA(m_wxwindow);
void wxWindowGTK::DoMoveWindow(int x, int y, int width, int height)
{
gtk_widget_set_size_request(m_widget, width, height);
-
+
// inform the parent to perform the move
- wxASSERT_MSG(m_parent && m_parent->m_wxwindow,
+ wxASSERT_MSG(m_parent && m_parent->m_wxwindow,
"the parent window has no client area?");
WX_PIZZA(m_parent->m_wxwindow)->move(m_widget, x, y);
}
event.SetEventObject( this );
HandleWindowEvent( event );
}
- } else
+ } else
if (sizeFlags & wxSIZE_FORCE_EVENT)
{
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
gdk_display_sync(display);
gdk_window_process_updates(m_widget->window, TRUE);
-
+
// Flush again, but no need to wait for it to finish
gdk_display_flush(display);
}
if (!the_one.IsOk())
{
- the_one = GetBitmapLabel();
- if (!the_one.IsOk())
- return;
+ the_one = GetBitmapLabel();
+ if (!the_one.IsOk())
+ return;
}
GdkBitmap *mask = NULL;
// don't start dragging if no button is down
if (g_lastButtonNumber == 0)
return wxDragNone;
-
+
// we can only start a drag after a mouse event
if (g_lastMouseEvent == NULL)
return wxDragNone;
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// empty bitmap, so that we can create GtkPixmap widget:
static char * bogus_xpm[] = {
"2 2 1 1",
-" c None",
+" c None",
" ",
" "};
break;
}
}
-
+
int cnt = m_bookRecords.GetCount();
-
+
if (!has_non_ascii)
{
wxFileSystem fsys;
m_HtmlHelpWin->SetController(m_helpController);
if ( config)
m_HtmlHelpWin->UseConfig(config, rootpath);
-
+
wxFrame::Create(parent, id, _("Help"),
wxPoint(m_HtmlHelpWin->GetCfgData().x, m_HtmlHelpWin->GetCfgData().y),
wxSize(m_HtmlHelpWin->GetCfgData().w, m_HtmlHelpWin->GetCfgData().h),
if (m_Border == 1)
{
- // draw thin border using lines
+ // draw thin border using lines
wxPen mypen1(m_BorderColour1, 1, wxPENSTYLE_SOLID);
wxPen mypen2(m_BorderColour2, 1, wxPENSTYLE_SOLID);
dc.DrawLine(xlocal, ylocal + m_Height - 1, xlocal + m_Width, ylocal + m_Height - 1);
}
else if (m_Border> 0)
- {
+ {
wxBrush mybrush1(m_BorderColour1, wxBRUSHSTYLE_SOLID);
wxBrush mybrush2(m_BorderColour2, wxBRUSHSTYLE_SOLID);
-
+
// draw upper left corner
// 0---------------5
// | /
// | |
// | 2
// |/
- // 1
+ // 1
wxPoint poly[6];
poly[0].x =m_PosX; poly[0].y = m_PosY ;
dc.SetBrush(mybrush1);
dc.SetPen(*wxTRANSPARENT_PEN);
dc.DrawPolygon(6, poly, x, y);
-
+
// draw lower right corner reusing point 1,2,4 and 5
// 5
// /|
poly[3].x = poly[4].x; poly[3].y = poly[2].y;
dc.DrawPolygon(6, poly, x, y);
- // smooth color transition like firefox
+ // smooth color transition like firefox
wxColour borderMediumColour(
(m_BorderColour1.Red() + m_BorderColour2.Red()) /2 ,
(m_BorderColour1.Green() + m_BorderColour2.Green()) /2 ,
- (m_BorderColour1.Blue() + m_BorderColour2.Blue()) /2
+ (m_BorderColour1.Blue() + m_BorderColour2.Blue()) /2
);
wxPen mypen3(borderMediumColour, 1, wxPENSTYLE_SOLID);
dc.SetPen(mypen3);
s->Read( buf.data(), size );
*(buf.data() + size) = 0;
wxString tmpdoc( buf, wxConvISO8859_1);
-
+
wxString charset = wxHtmlParser::ExtractCharsetInformation(tmpdoc);
if (charset.empty())
doc = tmpdoc;
m_FontBold = m_FontItalic = m_FontUnderlined = m_FontFixed = FALSE;
m_FontSize = 3; //default one
CreateCurrentFont(); // we're selecting default font into
-
+
// we're not using GetCharWidth/Height() because of
// differences under X and win
wxCoord w,h;
Create(bits, width, height, hotSpotX, hotSpotY, maskBits);
}
-wxCursor::wxCursor(const wxString& name, wxBitmapType type, int hotSpotX,
- int hotSpotY )
+wxCursor::wxCursor(const wxString& name, wxBitmapType type,
+ int hotSpotX, int hotSpotY)
{
// Must be an XBM file
if (type != wxBITMAP_TYPE_XBM) {
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// We don't put main() in the library any more. GD.
#endif
NULL);
}
-
+
PostCreation();
AttachWidget (parent, m_mainWidget, NULL, pos.x, pos.y, size.x, size.y);
return false;
const bool hasAlpha = image.HasAlpha();
-
+
if (depth == -1)
depth = dib.GetDepth();
return true;
}
-
+
return false;
}
if ( pos == -1 )
return FALSE;
- int flags = 0;
+ int flags = 0;
if ( lpDrawItem->itemState & ODS_COMBOBOXEDIT )
flags |= wxODCB_PAINTING_CONTROL;
if ( lpDrawItem->itemState & ODS_SELECTED )
if ( !MSWCreateControl(clsname, wxEmptyString, pos, size) )
return false;
- // initialize the control
+ // initialize the control
UpdateFirstDayOfWeek();
SetDate(dt.IsValid() ? dt : wxDateTime::Today());
{
if (m_windowSizer)
return wxControlBase::DoGetBestSize();
-
+
return wxSize(DEFAULT_ITEM_WIDTH, DEFAULT_ITEM_HEIGHT);
}
IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl, wxMSWDCImpl)
-wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
: wxMSWDCImpl( owner )
{
- CreateCompatible(NULL);
- Init();
+ CreateCompatible(NULL);
+ Init();
}
-wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap )
- : wxMSWDCImpl( owner )
-{
- CreateCompatible(NULL);
- Init();
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap )
+ : wxMSWDCImpl( owner )
+{
+ CreateCompatible(NULL);
+ Init();
DoSelect(bitmap);
}
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc )
- : wxMSWDCImpl( owner )
+ : wxMSWDCImpl( owner )
{
wxCHECK_RET( dc, wxT("NULL dc in wxMemoryDC ctor") );
bool wxDir::Open(const wxString& dirname)
{
delete M_DIR;
-
+
// The Unix code does a similar test
if (wxDirExists(dirname))
{
else
{
m_data = NULL;
-
+
return false;
}
}
if ((eventsToProcess & wxEVT_CATEGORY_UI) == 0)
{
// this msg is not going to be dispatched...
- // however WM_PAINT is special: until there are damaged
+ // however WM_PAINT is special: until there are damaged
// windows, Windows will keep sending it forever!
if (nPaintsReceived > 10)
{
switch (msg.message)
{
#if !defined(__WXWINCE__)
- case WM_NCMOUSEMOVE:
+ case WM_NCMOUSEMOVE:
- case WM_NCLBUTTONDOWN:
+ case WM_NCLBUTTONDOWN:
case WM_NCLBUTTONUP:
case WM_NCLBUTTONDBLCLK:
case WM_NCRBUTTONDOWN:
virtual void StrokePath( const wxGraphicsPath& p );
virtual void FillPath( const wxGraphicsPath& p , wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
- // stroke lines connecting each of the points
+ // stroke lines connecting each of the points
virtual void StrokeLines( size_t n, const wxPoint2DDouble *points);
// draws a polygon
virtual void BeginLayer(wxDouble opacity);
virtual void EndLayer();
-
+
virtual void Translate( wxDouble dx , wxDouble dy );
virtual void Scale( wxDouble xScale , wxDouble yScale );
virtual void Rotate( wxDouble angle );
if (m_composition == wxCOMPOSITION_DEST)
return;
- if ( !m_pen.IsNull() )
- {
- wxGDIPlusOffsetHelper helper( m_context , ShouldOffset() );
- Point *cpoints = new Point[n];
- for (size_t i = 0; i < n; i++)
- {
- cpoints[i].X = (int)(points[i].m_x );
- cpoints[i].Y = (int)(points[i].m_y );
-
- } // for (size_t i = 0; i < n; i++)
- m_context->DrawLines( ((wxGDIPlusPenData*)m_pen.GetGraphicsData())->GetGDIPlusPen() , cpoints , n ) ;
- delete[] cpoints;
- }
+ if ( !m_pen.IsNull() )
+ {
+ wxGDIPlusOffsetHelper helper( m_context , ShouldOffset() );
+ Point *cpoints = new Point[n];
+ for (size_t i = 0; i < n; i++)
+ {
+ cpoints[i].X = (int)(points[i].m_x );
+ cpoints[i].Y = (int)(points[i].m_y );
+
+ } // for (size_t i = 0; i < n; i++)
+ m_context->DrawLines( ((wxGDIPlusPenData*)m_pen.GetGraphicsData())->GetGDIPlusPen() , cpoints , n ) ;
+ delete[] cpoints;
+ }
}
void wxGDIPlusContext::DrawLines( size_t n, const wxPoint2DDouble *points, wxPolygonFillMode WXUNUSED(fillStyle) )
return;
wxGDIPlusOffsetHelper helper( m_context , ShouldOffset() );
- Point *cpoints = new Point[n];
- for (size_t i = 0; i < n; i++)
- {
- cpoints[i].X = (int)(points[i].m_x );
- cpoints[i].Y = (int)(points[i].m_y );
+ Point *cpoints = new Point[n];
+ for (size_t i = 0; i < n; i++)
+ {
+ cpoints[i].X = (int)(points[i].m_x );
+ cpoints[i].Y = (int)(points[i].m_y );
- } // for (int i = 0; i < n; i++)
- if ( !m_brush.IsNull() )
- m_context->FillPolygon( ((wxGDIPlusBrushData*)m_brush.GetRefData())->GetGDIPlusBrush() , cpoints , n ) ;
- if ( !m_pen.IsNull() )
- m_context->DrawLines( ((wxGDIPlusPenData*)m_pen.GetGraphicsData())->GetGDIPlusPen() , cpoints , n ) ;
- delete[] cpoints;
+ } // for (int i = 0; i < n; i++)
+ if ( !m_brush.IsNull() )
+ m_context->FillPolygon( ((wxGDIPlusBrushData*)m_brush.GetRefData())->GetGDIPlusBrush() , cpoints , n ) ;
+ if ( !m_pen.IsNull() )
+ m_context->DrawLines( ((wxGDIPlusPenData*)m_pen.GetGraphicsData())->GetGDIPlusPen() , cpoints , n ) ;
+ delete[] cpoints;
}
void wxGDIPlusContext::StrokePath( const wxGraphicsPath& path )
{
if (m_antialias == antialias)
return true;
-
+
m_antialias = antialias;
-
+
SmoothingMode antialiasMode;
switch (antialias)
{
{
if ( m_composition == op )
return true;
-
+
m_composition = op;
-
+
if (m_composition == wxCOMPOSITION_DEST)
return true;
void wxGDIPlusContext::EndLayer()
{
// TODO
-}
+}
void wxGDIPlusContext::Rotate( wxDouble angle )
{
wxMSWDCImpl *msw_impl = wxDynamicCast( impl, wxMSWDCImpl );
if (!msw_impl)
return false;
-
+
HDC hDC = GetHdcOf(*msw_impl);
wxCHECK_MSG( hDC, false, wxT("invalid wxDC in wxImageList::Draw") );
void wxListBox::OnInternalIdle()
{
wxWindow::OnInternalIdle();
-
+
if (m_updateHorizontalExtent)
{
SetHorizontalExtent(wxEmptyString);
// Params : [in] DWORD flags kbd & mouse flags as passed to
// IDropTarget methods
// [in] wxDragResult defaultAction the default action of the drop target
-// [in] DWORD pdwEffect the supported actions of the drop
+// [in] DWORD pdwEffect the supported actions of the drop
// source passed to IDropTarget methods
// Notes : We do "move" normally and "copy" if <Ctrl> is pressed,
// which is the standard behaviour (currently there is no
// for use in OnEnter and OnDrag calls
m_pTarget->MSWSetDataSource(pIDataSource);
-
+
// get hold of the data object
m_pIDataObject = pIDataSource;
m_pIDataObject->AddRef();
colSys = ::GetSysColor(index);
#endif
}
-
+
wxColour ret = wxRGBToColour(colSys);
wxASSERT(ret.IsOk());
return ret;
gs_fontDefault = new wxFont(wxCreateFontFromStockObject(SYSTEM_FONT));
}
- wxASSERT(gs_fontDefault->IsOk() &&
+ wxASSERT(gs_fontDefault->IsOk() &&
wxFontEnumerator::IsValidFacename(gs_fontDefault->GetFaceName()));
return *gs_fontDefault;
#else // !__WXWINCE__
if (!wxToggleButtonBase::Create( parent, id, pos, size, style, validator, name ))
return false;
-
+
m_bitmap = label;
-
+
if (size.x == -1 || size.y == -1)
{
wxSize new_size = GetBestSize();
new_size.y = size.y;
SetSize( new_size );
}
-
+
return true;
}
if (m_capturing) return;
if (state == m_depressed) return;
-
+
m_depressed = state;
Refresh();
}
{
m_bitmap = label;
m_disabledBitmap = wxBitmap();
-
+
Refresh();
}
if (!wxToggleButtonBase::Enable( enable ))
return false;
-
+
Refresh();
-
+
return true;
}
void wxBitmapToggleButton::OnPaint(wxPaintEvent &WXUNUSED(event))
{
wxSize size = GetSize();
-
+
wxBitmap bitmap = m_bitmap;
-
+
wxPaintDC dc(this);
wxRendererNative &renderer = wxRendererNative::Get();
int flags = 0;
flags |= wxCONTROL_PRESSED;
wxRect rect(0,0,size.x,size.y);
renderer.DrawPushButton( this, dc, rect, flags );
-
+
if (bitmap.IsOk())
{
if (!IsEnabled())
wxImage image = m_bitmap.ConvertToImage();
m_disabledBitmap = wxBitmap( image.ConvertToGreyscale() );
}
-
+
bitmap = m_disabledBitmap;
}
-
+
wxSize bsize = bitmap.GetSize();
int offset = 0;
if (m_depressed) offset = 1;
dc.DrawBitmap( bitmap, (size.x-bsize.x) / 2 + offset, (size.y-bsize.y) / 2 + offset, true );
}
-
+
}
void wxBitmapToggleButton::OnMouse(wxMouseEvent &event)
{
if (!IsEnabled())
return;
-
+
wxSize size = GetSize();
- bool mouse_in = ((event.GetX() > 0) && (event.GetX() < size.x) &&
+ bool mouse_in = ((event.GetX() > 0) && (event.GetX() < size.x) &&
(event.GetY() > 0) && (event.GetY() < size.y));
-
+
if (m_capturing)
{
bool old_depressed = m_depressed;
m_depressed = !m_oldValue;
else
m_depressed = m_oldValue;
-
+
if (event.LeftUp())
{
ReleaseCapture();
ProcessCommand(event);
}
}
-
+
if (old_depressed != m_depressed)
Refresh();
}
{
m_depressed = !m_depressed;
Refresh();
-
+
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());
event.SetEventObject(this);
{
if (!m_bitmap.IsOk())
return wxSize(16,16);
-
+
wxSize ret = m_bitmap.GetSize();
ret.x += 8;
ret.y += 8;
{
// this tooltip must be shown only if the mouse hovers a specific rect
// of the hwnd parameter!
- rect.left = rc.GetLeft();
- rect.right = rc.GetRight();
- rect.top = rc.GetTop();
- rect.bottom = rc.GetBottom();
+ rect.left = rc.GetLeft();
+ rect.right = rc.GetRight();
+ rect.top = rc.GetTop();
+ rect.bottom = rc.GetBottom();
// note that not setting TTF_IDISHWND from the uFlags member means that the
// ti.uId field should not contain the HWND but rather as MSDN says an
bool wxDoLaunchDefaultBrowser(const wxString& url, const wxString& scheme, int flags)
{
wxUnusedVar(flags);
-
+
#if wxUSE_IPC
if ( flags & wxBROWSER_NEW_WINDOW )
{
// Skip over the menus
if (GetMenuBar())
pos += GetMenuBar()->GetMenuCount();
-
+
// the main difficulty we have here is with the controls in the toolbars:
// as we (sometimes) use several separators to cover up the space used by
// them, the indices are not the same for us and the toolbar
// May already be selected into a PS
//
pDC = GetSelectedInto();
- const wxPMDCImpl *impl;
+ const wxPMDCImpl *impl;
if (pDC != NULL &&
(impl = wxDynamicCast( pDC->GetImpl(), wxPMDCImpl )) != NULL)
{
//
if (!m_hPS)
{
- (void)wxMessageBox( wxT("wxWidgets core library")
- ,"Using uninitialized DC for measuring text!\n"
- ,wxICON_INFORMATION
- );
+ (void)wxMessageBox( wxT("wxWidgets core library")
+ ,"Using uninitialized DC for measuring text!\n"
+ ,wxICON_INFORMATION
+ );
}
bRc = ::GpiQueryTextBox( m_hPS
// Memory DC
/////////////////////////////////////////////////////////////////////////////
-wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
: wxPMDCImpl( owner )
{
- CreateCompatible(NULL);
- Init();
+ CreateCompatible(NULL);
+ Init();
}
-wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap )
- : wxPMDCImpl( owner )
-{
- CreateCompatible(NULL);
- Init();
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap )
+ : wxPMDCImpl( owner )
+{
+ CreateCompatible(NULL);
+ Init();
DoSelect(bitmap);
}
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *pOldDC)
- : wxPMDCImpl( owner )
+ : wxPMDCImpl( owner )
{
wxCHECK_RET( pOldDC, wxT("NULL dc in wxMemoryDC ctor") );
if (wxTheApp)
{
wxTheApp->ProcessPendingEvents();
- wxTheApp->HandleSockets();
+ wxTheApp->HandleSockets();
}
//
{
wxOwnerDrawn* pNewItem = CreateItem(n); // dummy argument
wxScreenDC vDc; // FIXME: is it really needed here?
-
+
pNewItem->SetName(items[i]);
m_aItems.Insert(pNewItem, n);
pNewItem->SetFont(GetFont());
// Make sure that this item is at least as
// tall as the user's system settings specify
//
- const size_t heightStd = 6; // FIXME: get value from the system
+ const size_t heightStd = 6; // FIXME: get value from the system
if ( *pHeight < heightStd )
*pHeight = heightStd;
m_nHeight = *pHeight; // remember height for use in OnDrawItem
const wxChar* zDefaultHost = wxT("noname");
if ((zSysname = wxGetenv(wxT("SYSTEM_NAME"))) == NULL &&
- (zSysname = wxGetenv(wxT("HOSTNAME"))) == NULL)
+ (zSysname = wxGetenv(wxT("HOSTNAME"))) == NULL)
{
::PrfQueryProfileString( HINI_PROFILE
,(PSZ)WX_SECTION
static bool wxDoSetEnv(const wxString& variable, const char *value)
{
#if defined(HAVE_SETENV)
- if ( !value )
- {
-#ifdef HAVE_UNSETENV
- return unsetenv(variable.mb_str()) == 0;
-#else
- value = wxT(""); // mustn't pass NULL to setenv()
-#endif
- }
+ if ( !value )
+ {
+#ifdef HAVE_UNSETENV
+ return unsetenv(variable.mb_str()) == 0;
+#else
+ value = wxT(""); // mustn't pass NULL to setenv()
+#endif
+ }
return setenv(variable.mb_str(), value, 1 /* overwrite */) == 0;
#elif defined(HAVE_PUTENV)
wxString s = variable;
{
// to try to avoid 32-bit overflow, let's not multiply right away
// (num of alloc units)
- *pTotal = fsaBuf.cUnit;
+ *pTotal = fsaBuf.cUnit;
// * (num of sectors per alloc unit) * (num of bytes per sector)
(*pTotal) *= fsaBuf.cSectorUnit * fsaBuf.cbSector;
}
return true;
}
}
-
+
wxString wxPMErrorToStr(ERRORID vError)
{
wxString sError;
,pMeasureStruct->rclItem.yTop - pMeasureStruct->rclItem.yBottom
);
- wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl();
+ wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl();
impl->SetHDC( hDC, false );
impl->SetHPS( pMeasureStruct->hps );
//
if ((event.m_keyCode == entry->GetKeyCode()) &&
(((entry->GetFlags() & wxACCEL_CTRL) != 0) == event.ControlDown()) &&
(((entry->GetFlags() & wxACCEL_SHIFT) != 0) == event.ShiftDown()) &&
- (((entry->GetFlags() & wxACCEL_ALT) != 0) == event.AltDown()) &&
+ (((entry->GetFlags() & wxACCEL_ALT) != 0) == event.AltDown()) &&
(((entry->GetFlags() & wxACCEL_CMD) != 0) == event.CmdDown()))
{
return entry->GetCommand();
ART_MSGBOX(wxART_NORMAL_FILE, wxICON_NORMAL_FILE, deffile)
ART_MSGBOX(wxART_EXECUTABLE_FILE, wxICON_EXECUTABLE_FILE, exefile)
- ART_MSGBOX(wxART_CDROM, wxICON_CDROM, cdrom)
- ART_MSGBOX(wxART_FLOPPY, wxICON_FLOPPY, floppy)
- ART_MSGBOX(wxART_HARDDISK, wxICON_HARDDISK, harddisk)
- ART_MSGBOX(wxART_REMOVABLE, wxICON_REMOVABLE, removable)
-
- ART_MSGBOX(wxART_DELETE, wxICON_DELETE, delete)
-
- ART_MSGBOX(wxART_GO_BACK, wxICON_GO_BACK, back)
- ART_MSGBOX(wxART_GO_FORWARD, wxICON_GO_FORWARD, forward)
- ART_MSGBOX(wxART_GO_HOME, wxICON_GO_HOME, home)
-
- ART_MSGBOX(wxART_HELP_SETTINGS, wxICON_HELP_SETTINGS, htmoptns)
- ART_MSGBOX(wxART_HELP_PAGE, wxICON_HELP_PAGE, htmpage)
-
+ ART_MSGBOX(wxART_CDROM, wxICON_CDROM, cdrom)
+ ART_MSGBOX(wxART_FLOPPY, wxICON_FLOPPY, floppy)
+ ART_MSGBOX(wxART_HARDDISK, wxICON_HARDDISK, harddisk)
+ ART_MSGBOX(wxART_REMOVABLE, wxICON_REMOVABLE, removable)
+
+ ART_MSGBOX(wxART_DELETE, wxICON_DELETE, delete)
+
+ ART_MSGBOX(wxART_GO_BACK, wxICON_GO_BACK, back)
+ ART_MSGBOX(wxART_GO_FORWARD, wxICON_GO_FORWARD, forward)
+ ART_MSGBOX(wxART_GO_HOME, wxICON_GO_HOME, home)
+
+ ART_MSGBOX(wxART_HELP_SETTINGS, wxICON_HELP_SETTINGS, htmoptns)
+ ART_MSGBOX(wxART_HELP_PAGE, wxICON_HELP_PAGE, htmpage)
+
return wxNullIconBundle;
}
event_posted_context.perform = macPostedEventCallback;
m_macEventPosted = CFRunLoopSourceCreate(NULL,0,&event_posted_context);
CFRunLoopAddSource(CFRunLoopGetCurrent(), m_macEventPosted, kCFRunLoopCommonModes);
- // run loop takes ownership
- CFRelease(m_macEventPosted);
+ // run loop takes ownership
+ CFRelease(m_macEventPosted);
*/
return true;
}
#endif
if (m_macEventPosted)
- {
- CFRunLoopRemoveSource(CFRunLoopGetCurrent(), m_macEventPosted, kCFRunLoopCommonModes);
- m_macEventPosted = NULL;
- }
+ {
+ CFRunLoopRemoveSource(CFRunLoopGetCurrent(), m_macEventPosted, kCFRunLoopCommonModes);
+ m_macEventPosted = NULL;
+ }
DoCleanUp();
// control interferes with some built-in keys like pgdown, return etc. therefore we remove the controlKey modifier
// and look at the character after
#ifdef __LP64__
- // TODO new implementation using TextInputSources
+ // TODO new implementation using TextInputSources
#else
UInt32 state = 0;
UInt32 keyInfo = KeyTranslate((Ptr)GetScriptManagerVariable(smKCHRCache), ( modifiers & (~(controlKey | shiftKey | optionKey))) | keycode, &state);
OSStatus err = m_peer->GetData<ControlFontStyleRec>( kControlEntireControl, kControlFontStyleTag, &controlFont );
verify_noerr( err );
- // GetThemeTextDimensions will cache strings and the documentation
- // says not to use the NoCopy string creation calls.
- // This also means that we can't use CFSTR without
- // -fno-constant-cfstrings if the library might be unloaded,
- // as GetThemeTextDimensions may cache a pointer to our
- // unloaded segment.
- wxCFStringRef str( !m_label.empty() ? m_label : wxString(" "),
+ // GetThemeTextDimensions will cache strings and the documentation
+ // says not to use the NoCopy string creation calls.
+ // This also means that we can't use CFSTR without
+ // -fno-constant-cfstrings if the library might be unloaded,
+ // as GetThemeTextDimensions may cache a pointer to our
+ // unloaded segment.
+ wxCFStringRef str( !m_label.empty() ? m_label : wxString(" "),
GetFont().GetEncoding() );
#if wxOSX_USE_ATSU_TEXT
#include "wx/checkbox.h"
#include "wx/osx/uma.h"
-wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(label),
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
- long WXUNUSED(extraStyle))
+ long style,
+ long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size ) ;
wxMacControl* peer = new wxMacControl(wxpeer) ;
wxMacChoiceCarbonControl( wxWindowMac* peer ) : wxMacControl( peer )
{
}
-
+
void SetValue(wxInt32 v)
{
wxMacControl::SetValue( v + 1 );
}
-
+
wxInt32 GetValue() const
{
return wxMacControl::GetValue() - 1;
}
};
-wxWidgetImplType* wxWidgetImpl::CreateChoice( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateChoice( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
wxMenu* menu,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size );
int wxColourDialog::ShowModal()
{
RGBColor currentColor ;
-
+
m_colourData.m_dataColour.GetRGBColor( ¤tColor );
NColorPickerInfo info;
OSStatus err ;
memset(&info, 0, sizeof(info)) ;
// TODO : use parent to determine better position and then kAtSpecifiedOrigin
- info.placeWhere = kCenterOnMainScreen ;
+ info.placeWhere = kCenterOnMainScreen ;
info.flags = kColorPickerDialogIsMoveable | kColorPickerDialogIsModal ;
info.theColor.color.rgb.red = currentColor.red ;
info.theColor.color.rgb.green = currentColor.green ;
event.Skip();
}
-
+
private:
wxComboBox *m_cb;
m_text->SetSize(TEXTFOCUSBORDER, TEXTFOCUSBORDER, wText, -1);
wxSize tSize = m_text->GetSize();
wxSize cSize = m_choice->GetSize();
-
+
int yOffset = ( tSize.y + 2 * TEXTFOCUSBORDER - cSize.y ) / 2;
// put it at an inset of 1 to have outer area shadows drawn as well
}
void wxComboBox::EnableTextChangedEvents(bool enable)
-{
+{
if ( m_text )
m_text->ForwardEnableTextChangedEvents(enable);
}
case wxCURSOR_CLOSED_HAND:
M_CURSORDATA->m_themeCursor = kThemeClosedHandCursor;
break;
-
+
case wxCURSOR_CHAR:
case wxCURSOR_ARROW:
case wxCURSOR_LEFT_BUTTON:
m_format = 0;
}
m_format = (NativeFormat) CFStringCreateCopy(NULL, (CFStringRef)format);
- if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("public.utf16-plain-text") ) )
+ if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("public.utf16-plain-text") ) )
{
m_type = wxDF_UNICODETEXT;
- }
+ }
else if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("public.plain-text") ) )
{
m_type = wxDF_TEXT;
}
- else if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("public.tiff") ) )
+ else if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("public.tiff") ) )
{
m_type = wxDF_BITMAP;
}
- else if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("com.adobe.pdf") ) )
+ else if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("com.adobe.pdf") ) )
{
m_type = wxDF_METAFILE;
}
- else if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("public.file-url") ) )
+ else if ( UTTypeConformsTo( (CFStringRef)format, CFSTR("public.file-url") ) )
{
m_type = wxDF_FILENAME;
}
- else
+ else
{
m_type = wxDF_PRIVATE;
m_id = wxCFStringRef( (CFStringRef) CFRetain((CFStringRef) format )).AsString();
for (size_t i = 0; i < GetFormatCount(); i++)
{
wxDataFormat thisFormat = array[ i ];
-
- // add four bytes at the end for data objs like text that
+
+ // add four bytes at the end for data objs like text that
// have a datasize = strlen but still need a buffer for the
// string including trailing zero
-
+
size_t datasize = GetDataSize( thisFormat );
size_t sz = datasize + 4;
void* buf = malloc( sz );
counter++;
fname = strtok (NULL,"\n");
}
-
+
}
else
{
PasteboardItemID itemID;
CFArrayRef flavorTypeArray;
CFIndex flavorCount;
-
+
err = PasteboardGetItemIdentifier( pasteboard, itemIndex, &itemID );
if ( err != noErr )
continue;
-
+
err = PasteboardCopyItemFlavors( pasteboard, itemID, &flavorTypeArray );
if ( err != noErr )
continue;
-
+
flavorCount = CFArrayGetCount( flavorTypeArray );
-
+
for( CFIndex flavorIndex = 0; flavorIndex < flavorCount && hasData == false ; flavorIndex++ )
{
CFStringRef flavorType;
-
+
flavorType = (CFStringRef)CFArrayGetValueAtIndex( flavorTypeArray,
flavorIndex );
-
+
wxDataFormat flavorFormat( (wxDataFormat::NativeFormat) flavorType );
if ( dataFormat == flavorFormat )
hasData = true;
err = PasteboardCopyItemFlavors( pasteboard, itemID, &flavorTypeArray );
if ( err != noErr )
continue;
-
+
flavorCount = CFArrayGetCount( flavorTypeArray );
for( CFIndex flavorIndex = 0; !transferred && flavorIndex < flavorCount ; flavorIndex++ )
CFStringRef flavorType;
CFDataRef flavorData;
CFIndex flavorDataSize;
-
+
flavorType = (CFStringRef)CFArrayGetValueAtIndex( flavorTypeArray,
flavorIndex );
flavorType = CFSTR("public.utf16-plain-text");
}
wxDataFormat flavorFormat( (wxDataFormat::NativeFormat) flavorType );
-
+
if ( dataFormat == flavorFormat )
{
err = PasteboardCopyItemFlavorData( pasteboard, itemID, flavorType , &flavorData );
{
memset( buf, 0, flavorDataSize + 4 );
memcpy( buf, CFDataGetBytePtr( flavorData ), flavorDataSize );
-
+
if (dataFormat.GetType() == wxDF_TEXT)
wxMacConvertNewlines10To13( (char*) buf );
SetData( flavorFormat, flavorDataSize, buf );
err = PasteboardCopyItemFlavors( pasteboard, itemID, &flavorTypeArray );
if ( err != noErr )
continue;
-
+
flavorCount = CFArrayGetCount( flavorTypeArray );
for( CFIndex flavorIndex = 0; !hasData && flavorIndex < flavorCount ; flavorIndex++ )
{
CFStringRef flavorType;
-
+
flavorType = (CFStringRef)CFArrayGetValueAtIndex( flavorTypeArray,
flavorIndex );
wxDataFormat flavorFormat( (wxDataFormat::NativeFormat) flavorType );
-
- if ( dataFormat == flavorFormat ||
+
+ if ( dataFormat == flavorFormat ||
dataFormat.GetType() == wxDF_UNICODETEXT && flavorFormat.GetType() == wxDF_TEXT )
{
hasData = true;
if (m_bitmap.Ok())
{
- SetBitmap( rBitmap );
+ SetBitmap( rBitmap );
}
}
callbacks.u.v1.itemDataCallback = gDataBrowserTableViewItemDataUPP;
callbacks.u.v1.itemCompareCallback = gDataBrowserTableViewItemCompareUPP;
callbacks.u.v1.itemNotificationCallback = gDataBrowserTableViewItemNotificationUPP;
- callbacks.u.v1.acceptDragCallback = gDataBrowserTableViewAcceptDragUPP;
- callbacks.u.v1.addDragItemCallback = gDataBrowserTableViewAddDragItemUPP;
- callbacks.u.v1.receiveDragCallback = gDataBrowserTableViewReceiveDragUPP;
+ callbacks.u.v1.acceptDragCallback = gDataBrowserTableViewAcceptDragUPP;
+ callbacks.u.v1.addDragItemCallback = gDataBrowserTableViewAddDragItemUPP;
+ callbacks.u.v1.receiveDragCallback = gDataBrowserTableViewReceiveDragUPP;
this->SetCallbacks(&callbacks);
// setup callbacks for customized items:
: wxGCDCImpl( owner )
{
m_window = window;
-
+
m_ok = true ;
m_window->GetSize( &m_width , &m_height);
ControlRef handle = (ControlRef) m_window->GetHandle();
if ( !handle )
return wxNullBitmap;
-
+
HIRect rect;
CGImageRef image;
CGContextRef context;
int height = subrect != NULL ? subrect->height : (int)rect.size.height ;
wxBitmap bmp = wxBitmap(width, height, 32);
-
+
context = (CGContextRef)bmp.GetHBITMAP();
-
+
CGContextSaveGState(context);
-
+
CGContextTranslateCTM( context, 0, height );
CGContextScaleCTM( context, 1, -1 );
m_width = (wxCoord)cgbounds.size.width;
m_height = (wxCoord)cgbounds.size.height;
#else
- wxDisplaySize( &m_width, &m_height );
+ wxDisplaySize( &m_width, &m_height );
#endif
#if wxOSX_USE_COCOA_OR_IPHONE
SetGraphicsContext( wxGraphicsContext::Create() );
CGRect srcRect = CGRectMake(rect.x, rect.y, rect.width, rect.height);
CGContextRef context = (CGContextRef)bmp.GetHBITMAP();
-
+
CGContextSaveGState(context);
-
+
CGContextTranslateCTM( context, 0, m_height );
CGContextScaleCTM( context, 1, -1 );
-
+
if ( subrect )
srcRect = CGRectOffset( srcRect, -subrect->x, -subrect->y ) ;
-
+
CGImageRef image = grabViaOpenGL(kCGNullDirectDisplay, srcRect);
-
+
wxASSERT_MSG(image, wxT("wxScreenDC::GetAsBitmap - unable to get screenshot."));
-
+
CGContextDrawImage(context, srcRect, image);
-
+
CGContextRestoreGState(context);
#endif
return bmp;
if ( err != noErr && err != userCanceledErr )
m_path = wxEmptyString ;
- if ( dialog )
- ::NavDialogDispose(dialog);
+ if ( dialog )
+ ::NavDialogDispose(dialog);
return (err == noErr) ? wxID_OK : wxID_CANCEL ;
}
ItemCount fetched = 0;
err = FSGetCatalogInfoBulk( m_iterator, 1, &fetched, NULL, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo , &catalogInfo , &fileRef, NULL, &uniname );
-
- // expected error codes
-
+
+ // expected error codes
+
if ( errFSNoMoreItems == err )
return false ;
if ( afpAccessDenied == err )
wxDataFormat wxDropTarget::GetMatchingPair()
{
- wxFAIL_MSG("wxDropTarget::GetMatchingPair() not implemented in src/osx/carbon/dnd.cpp");
+ wxFAIL_MSG("wxDropTarget::GetMatchingPair() not implemented in src/osx/carbon/dnd.cpp");
return wxDF_INVALID;
}
break;
GetDragMouse( theDrag, &mouse, 0L );
- {
- int x = mouse.h ;
- int y = mouse.v ;
- toplevel->GetNonOwnedPeer()->ScreenToWindow( &x, &y );
- localMouse.h = x;
- localMouse.v = y;
-
- {
- wxWindow *win = NULL;
- ControlPartCode controlPart;
- ControlRef control = FindControlUnderMouse( localMouse, theWindow, &controlPart );
- if ( control )
- win = wxFindWindowFromWXWidget( (WXWidget) control );
- else
- win = toplevel;
-
- int localx, localy;
- localx = localMouse.h;
- localy = localMouse.v;
-
- if ( win )
- win->MacRootWindowToWindow( &localx, &localy );
- if ( win != trackingGlobals->m_currentTargetWindow )
- {
- if ( trackingGlobals->m_currentTargetWindow )
- {
- // this window is left
- if ( trackingGlobals->m_currentTarget )
- {
- #ifndef __LP64__
- HideDragHilite( theDrag );
- #endif
- trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard );
- trackingGlobals->m_currentTarget->OnLeave();
- trackingGlobals->m_currentTarget = NULL;
- trackingGlobals->m_currentTargetWindow = NULL;
- }
- }
-
- if ( win )
- {
- // this window is entered
- trackingGlobals->m_currentTargetWindow = win;
- trackingGlobals->m_currentTarget = win->GetDropTarget();
- {
- if ( trackingGlobals->m_currentTarget )
- {
- trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard );
- result = trackingGlobals->m_currentTarget->OnEnter( localx, localy, result );
- }
-
- if ( result != wxDragNone )
- {
- int x, y;
-
- x = y = 0;
- win->MacWindowToRootWindow( &x, &y );
- RgnHandle hiliteRgn = NewRgn();
- Rect r = { y, x, y + win->GetSize().y, x + win->GetSize().x };
- RectRgn( hiliteRgn, &r );
- #ifndef __LP64__
- ShowDragHilite( theDrag, hiliteRgn, true );
- #endif
- DisposeRgn( hiliteRgn );
- }
- }
- }
- }
- else
- {
- if ( trackingGlobals->m_currentTarget )
- {
- trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard );
- result = trackingGlobals->m_currentTarget->OnDragOver( localx, localy, result );
- }
- }
-
- // set cursor for OnEnter and OnDragOver
- if ( trackingGlobals->m_currentSource && !trackingGlobals->m_currentSource->GiveFeedback( result ) )
- {
- if ( !trackingGlobals->m_currentSource->MacInstallDefaultCursor( result ) )
- {
- wxStockCursor cursorID = wxCURSOR_NONE;
-
- switch (result)
- {
- case wxDragCopy:
- cursorID = wxCURSOR_COPY_ARROW;
- break;
-
- case wxDragMove:
- cursorID = wxCURSOR_ARROW;
- break;
-
- case wxDragNone:
- cursorID = wxCURSOR_NO_ENTRY;
- break;
-
- case wxDragError:
- case wxDragLink:
- case wxDragCancel:
- default:
- // put these here to make gcc happy
- ;
- }
-
- if (cursorID != wxCURSOR_NONE)
- {
- wxCursor cursor( cursorID );
- cursor.MacInstall();
- }
- }
- }
- }
- }
+ {
+ int x = mouse.h ;
+ int y = mouse.v ;
+ toplevel->GetNonOwnedPeer()->ScreenToWindow( &x, &y );
+ localMouse.h = x;
+ localMouse.v = y;
+
+ {
+ wxWindow *win = NULL;
+ ControlPartCode controlPart;
+ ControlRef control = FindControlUnderMouse( localMouse, theWindow, &controlPart );
+ if ( control )
+ win = wxFindWindowFromWXWidget( (WXWidget) control );
+ else
+ win = toplevel;
+
+ int localx, localy;
+ localx = localMouse.h;
+ localy = localMouse.v;
+
+ if ( win )
+ win->MacRootWindowToWindow( &localx, &localy );
+ if ( win != trackingGlobals->m_currentTargetWindow )
+ {
+ if ( trackingGlobals->m_currentTargetWindow )
+ {
+ // this window is left
+ if ( trackingGlobals->m_currentTarget )
+ {
+#ifndef __LP64__
+ HideDragHilite( theDrag );
+#endif
+ trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard );
+ trackingGlobals->m_currentTarget->OnLeave();
+ trackingGlobals->m_currentTarget = NULL;
+ trackingGlobals->m_currentTargetWindow = NULL;
+ }
+ }
+
+ if ( win )
+ {
+ // this window is entered
+ trackingGlobals->m_currentTargetWindow = win;
+ trackingGlobals->m_currentTarget = win->GetDropTarget();
+ {
+ if ( trackingGlobals->m_currentTarget )
+ {
+ trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard );
+ result = trackingGlobals->m_currentTarget->OnEnter( localx, localy, result );
+ }
+
+ if ( result != wxDragNone )
+ {
+ int x, y;
+
+ x = y = 0;
+ win->MacWindowToRootWindow( &x, &y );
+ RgnHandle hiliteRgn = NewRgn();
+ Rect r = { y, x, y + win->GetSize().y, x + win->GetSize().x };
+ RectRgn( hiliteRgn, &r );
+#ifndef __LP64__
+ ShowDragHilite( theDrag, hiliteRgn, true );
+#endif
+ DisposeRgn( hiliteRgn );
+ }
+ }
+ }
+ }
+ else
+ {
+ if ( trackingGlobals->m_currentTarget )
+ {
+ trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard );
+ result = trackingGlobals->m_currentTarget->OnDragOver( localx, localy, result );
+ }
+ }
+
+ // set cursor for OnEnter and OnDragOver
+ if ( trackingGlobals->m_currentSource && !trackingGlobals->m_currentSource->GiveFeedback( result ) )
+ {
+ if ( !trackingGlobals->m_currentSource->MacInstallDefaultCursor( result ) )
+ {
+ wxStockCursor cursorID = wxCURSOR_NONE;
+
+ switch (result)
+ {
+ case wxDragCopy:
+ cursorID = wxCURSOR_COPY_ARROW;
+ break;
+
+ case wxDragMove:
+ cursorID = wxCURSOR_ARROW;
+ break;
+
+ case wxDragNone:
+ cursorID = wxCURSOR_NO_ENTRY;
+ break;
+
+ case wxDragError:
+ case wxDragLink:
+ case wxDragCancel:
+ default:
+ // put these here to make gcc happy
+ ;
+ }
+
+ if (cursorID != wxCURSOR_NONE)
+ {
+ wxCursor cursor( cursorID );
+ cursor.MacInstall();
+ }
+ }
+ }
+ }
+ }
break;
case kDragTrackingLeaveWindow:
{
const OSStatus status = ::SetDrawerPreferredEdge((WindowRef)GetWXWindow(),
DirectionToWindowEdge(edge));
- return (noErr == status);
+ return (noErr == status);
}
}
wxFontRefData(const wxFontRefData& data);
-
+
wxFontRefData( const wxNativeFontInfo& info ) : m_info(info)
{
Init();
}
wxFontRefData(wxOSXSystemFont font, int size);
-
+
#if wxOSX_USE_CORE_TEXT
wxFontRefData( wxUint32 coreTextFontType );
wxFontRefData( CTFontRef font );
#endif
#if wxOSX_USE_CORE_TEXT
m_ctFont = data.m_ctFont;
-#endif
+#endif
m_cgFont = data.m_cgFont;
#if wxOSX_USE_ATSU_TEXT
if ( data.m_macATSUStyle != NULL )
#if wxOSX_USE_IPHONE
m_uiFont = (UIFont*) wxMacCocoaRetain(data.m_uiFont);
#endif
-
+
}
// ============================================================================
{
wxASSERT( font != wxOSX_SYSTEM_FONT_NONE );
Init();
-
+
#if wxOSX_USE_CORE_TEXT
if ( UMAGetSystemVersion() >= 0x1050 )
{
m_macThemeFontID = kThemeViewsFont;
break;
default:
- break;
+ break;
}
if ( m_info.m_faceName.empty() )
{
Style style ;
FMFontSize fontSize;
Str255 qdFontName ;
-
+
GetThemeFont( m_macThemeFontID, GetApplicationScript(), qdFontName, &fontSize, &style );
if ( size != 0 )
fontSize = size;
wxFontStyle fontstyle = wxFONTSTYLE_NORMAL;
wxFontWeight fontweight = wxFONTWEIGHT_NORMAL;
bool underlined = false;
-
+
if ( style & bold )
fontweight = wxFONTWEIGHT_BOLD ;
else
fontstyle = wxFONTSTYLE_ITALIC ;
if ( style & underline )
underlined = true ;
-
+
m_info.Init(fontSize,wxFONTFAMILY_DEFAULT,fontstyle,fontweight,underlined,
wxMacMakeStringFromPascal( qdFontName ), wxFONTENCODING_DEFAULT);
}
{
if ( m_fontValid )
return;
-
+
m_info.EnsureValid();
-
+
#if wxOSX_USE_CORE_TEXT
if ( UMAGetSystemVersion() >= 0x1050 )
{
bool wxFont::Create(const wxNativeFontInfo& info)
{
UnRef();
-
+
m_refData = new wxFontRefData( info );
RealizeResource();
-
+
return true;
}
wxFontEncoding encoding)
{
UnRef();
-
+
wxString faceName = faceNameParam;
if ( faceName.empty() )
case wxFONTFAMILY_DEFAULT :
faceName = wxT("Lucida Grande");
break;
-
+
case wxFONTFAMILY_SCRIPT :
case wxFONTFAMILY_ROMAN :
case wxFONTFAMILY_DECORATIVE :
break ;
}
}
-
+
wxNativeFontInfo info;
-
+
info.Init(pointSize, family, style, weight,
underlined, faceName, encoding);
bool wxFont::CreateSystemFont(wxOSXSystemFont font)
{
UnRef();
-
+
m_refData = new wxFontRefData( font, 0 );
-
+
return true;
}
void wxFont::DoSetNativeFontInfo(const wxNativeFontInfo& info)
{
UnRef();
-
+
m_refData = new wxFontRefData( info);
}
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
-
+
return M_FONTDATA->m_info.m_qdFontFamily;
}
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
-
+
return M_FONTDATA->m_info.m_qdFontStyle;
}
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
-
+
return M_FONTDATA->m_macATSUStyle;
}
#if WXWIN_COMPATIBILITY_2_8
-wxUint32 wxFont::MacGetATSUFontID() const
+wxUint32 wxFont::MacGetATSUFontID() const
{
wxCHECK_MSG( M_FONTDATA != NULL, 0, wxT("invalid font") );
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
-
+
return M_FONTDATA->m_info.m_atsuFontID;
}
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
-
+
return M_FONTDATA->m_info.m_atsuAdditionalQDStyles;
}
#endif
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
-
+
return (CTFontRef)(M_FONTDATA->m_ctFont);
}
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
-
+
return (M_FONTDATA->m_cgFont);
}
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
-
+
return (M_FONTDATA->m_nsFont);
}
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
-
+
// M_FONTDATA->m_info.InitFromFont(*this);
return &(M_FONTDATA->m_info);
{
Init();
m_ctFontDescriptor = wxCFRetain(descr);
-
+
wxCFRef< CFNumberRef > sizevalue( (CFNumberRef) CTFontDescriptorCopyAttribute( m_ctFontDescriptor, kCTFontSizeAttribute ) );
float fsize;
if ( CFNumberGetValue( sizevalue , kCFNumberFloatType , &fsize ) )
}
wxCFStringRef familyName( (CFStringRef) CTFontDescriptorCopyAttribute(m_ctFontDescriptor, kCTFontFamilyNameAttribute));
- m_faceName = familyName.AsString();
+ m_faceName = familyName.AsString();
}
#endif
{
if ( m_descriptorValid )
return;
-
+
#if wxOSX_USE_CORE_TEXT
if ( m_ctFontDescriptor == NULL && UMAGetSystemVersion() >= 0x1050 )
{
NSModalSession session = [NSApp beginModalSessionForWindow:fontPanel];
- for (;;)
+ for (;;)
{
if ([NSApp runModalSession:session] != NSRunContinuesResponse)
break;
}
-
+
[NSApp endModalSession:session];
// if we don't reenable it, FPShowHideFontPanel does not work
wxMacGaugeCarbonControl( wxWindowMac* peer ) : wxMacControl( peer )
{
}
-
+
void SetMaximum(wxInt32 v)
{
// switch back to determinate mode if not there already
wxMacControl::SetMaximum( v ) ;
}
-
+
void SetValue(wxInt32 v)
{
// switch back to determinate mode if not there already
SetNeedsDisplay(NULL) ;
}
}
-
+
void PulseGauge()
{
if ( GetData<Boolean>( kControlNoPart, kControlProgressBarIndeterminateTag ) != true )
};
-wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
wxInt32 value,
wxInt32 minimum,
wxInt32 maximum,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size );
GLint bufnummer = win.GetAglBufferName();
aglSetInteger(m_glContext, AGL_BUFFER_NAME, &bufnummer);
//win.SetLastContext(m_glContext);
-
+
const_cast<wxGLCanvas&>(win).SetViewport();
if ( !aglSetDrawable(m_glContext, drawable) )
/*
-sharing contexts under AGL is not straightforward, to quote from
+sharing contexts under AGL is not straightforward, to quote from
http://lists.apple.com/archives/mac-opengl/2003/Jan/msg00402.html :
-In Carbon OpenGL (AGL) you would use call aglSetInteger to setup a
-buffer name and attached each context to that same name. From AGL
+In Carbon OpenGL (AGL) you would use call aglSetInteger to setup a
+buffer name and attached each context to that same name. From AGL
you can do:
GLint id = 1;
ctx1 = aglCreateContext...
aglSetInteger(ctx1, AGL_BUFFER_NAME, &id); // create name
-aglAttachDrawable (ctx1,...); // create surface with associated with
+aglAttachDrawable (ctx1,...); // create surface with associated with
name (first time)
ctx2 = aglCreateContext...
aglSetInteger(ctx2, AGL_BUFFER_NAME, &id); // uses previously created name
*/
/*
-so what I'm doing is to have a dummy aglContext attached to a wxGLCanvas,
+so what I'm doing is to have a dummy aglContext attached to a wxGLCanvas,
assign it a buffer number
*/
static GLint gCurrentBufferName = 1;
m_bufferName = gCurrentBufferName++;
- aglSetInteger (m_dummyContext, AGL_BUFFER_NAME, &m_bufferName);
-
+ aglSetInteger (m_dummyContext, AGL_BUFFER_NAME, &m_bufferName);
+
AGLDrawable drawable = (AGLDrawable)GetWindowPort(MAC_WXHWND(MacGetTopLevelWindowRef()));
aglSetDrawable(m_dummyContext, drawable);
{
if ( m_glFormat )
WXGLDestroyPixelFormat(m_glFormat);
-
+
if ( m_dummyContext )
WXGLDestroyContext(m_dummyContext);
}
kCGCompositeOperationDestinationAtop = 9,
kCGCompositeOperationXOR = 10,
kCGCompositeOperationPlusDarker = 11,
-// NS only, unsupported by CG : Highlight
+// NS only, unsupported by CG : Highlight
kCGCompositeOperationPlusLighter = 12
} CGCompositeOperation ;
virtual void BeginLayer(wxDouble opacity);
virtual void EndLayer();
-
+
//
// transformation
//
{
if (m_invisible)
return false;
-
+
#if wxOSX_USE_COCOA
if ( wxOSXLockFocus(m_view) )
{
}
#endif
CGContextSaveGState( m_cgContext );
-
+
#if 0 // turn on for debugging of clientdc
static float color = 0.5 ;
static int channel = 0 ;
if (m_antialias == antialias)
return true;
-
+
m_antialias = antialias;
-
+
bool antialiasMode;
switch (antialias)
{
if ( m_composition == op )
return true;
-
+
m_composition = op;
-
+
if (m_composition == wxCOMPOSITION_DEST)
return true;
-
+
#if wxOSX_USE_COCOA_OR_CARBON
if ( UMAGetSystemVersion() < 0x1060 )
{
switch( op )
{
case wxCOMPOSITION_CLEAR:
- cop = kCGCompositeOperationClear;
+ cop = kCGCompositeOperationClear;
break;
case wxCOMPOSITION_SOURCE:
- cop = kCGCompositeOperationCopy;
+ cop = kCGCompositeOperationCopy;
break;
case wxCOMPOSITION_OVER:
- mode = kCGBlendModeNormal;
+ mode = kCGBlendModeNormal;
break;
case wxCOMPOSITION_IN:
- cop = kCGCompositeOperationSourceIn;
+ cop = kCGCompositeOperationSourceIn;
break;
case wxCOMPOSITION_OUT:
- cop = kCGCompositeOperationSourceOut;
+ cop = kCGCompositeOperationSourceOut;
break;
case wxCOMPOSITION_ATOP:
- cop = kCGCompositeOperationSourceAtop;
+ cop = kCGCompositeOperationSourceAtop;
break;
case wxCOMPOSITION_DEST_OVER:
- cop = kCGCompositeOperationDestinationOver;
+ cop = kCGCompositeOperationDestinationOver;
break;
case wxCOMPOSITION_DEST_IN:
- cop = kCGCompositeOperationDestinationIn;
+ cop = kCGCompositeOperationDestinationIn;
break;
case wxCOMPOSITION_DEST_OUT:
- cop = kCGCompositeOperationDestinationOut;
+ cop = kCGCompositeOperationDestinationOut;
break;
case wxCOMPOSITION_DEST_ATOP:
- cop = kCGCompositeOperationDestinationAtop;
+ cop = kCGCompositeOperationDestinationAtop;
break;
case wxCOMPOSITION_XOR:
- cop = kCGCompositeOperationXOR;
+ cop = kCGCompositeOperationXOR;
break;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
case wxCOMPOSITION_ADD:
switch( op )
{
case wxCOMPOSITION_CLEAR:
- mode = kCGBlendModeClear;
+ mode = kCGBlendModeClear;
break;
case wxCOMPOSITION_SOURCE:
- mode = kCGBlendModeCopy;
+ mode = kCGBlendModeCopy;
break;
case wxCOMPOSITION_OVER:
- mode = kCGBlendModeNormal;
+ mode = kCGBlendModeNormal;
break;
case wxCOMPOSITION_IN:
- mode = kCGBlendModeSourceIn;
+ mode = kCGBlendModeSourceIn;
break;
case wxCOMPOSITION_OUT:
- mode = kCGBlendModeSourceOut;
+ mode = kCGBlendModeSourceOut;
break;
case wxCOMPOSITION_ATOP:
- mode = kCGBlendModeSourceAtop;
+ mode = kCGBlendModeSourceAtop;
break;
case wxCOMPOSITION_DEST_OVER:
- mode = kCGBlendModeDestinationOver;
+ mode = kCGBlendModeDestinationOver;
break;
case wxCOMPOSITION_DEST_IN:
- mode = kCGBlendModeDestinationIn;
+ mode = kCGBlendModeDestinationIn;
break;
case wxCOMPOSITION_DEST_OUT:
- mode = kCGBlendModeDestinationOut;
+ mode = kCGBlendModeDestinationOut;
break;
case wxCOMPOSITION_DEST_ATOP:
- mode = kCGBlendModeDestinationAtop;
+ mode = kCGBlendModeDestinationAtop;
break;
case wxCOMPOSITION_XOR:
- mode = kCGBlendModeXOR;
+ mode = kCGBlendModeXOR;
break;
-
+
case wxCOMPOSITION_ADD:
mode = kCGBlendModePlusLighter ;
break;
if (EnsureIsValid()==false)
return;
-
+
if (m_composition == wxCOMPOSITION_DEST)
return;
{
if (EnsureIsValid()==false)
return;
-
+
if (m_composition == wxCOMPOSITION_DEST)
return;
if (EnsureIsValid()==false)
return;
-
+
if (m_composition == wxCOMPOSITION_DEST)
return;
CGContextRestoreGState( m_cgContext );
if ( m_contextSynthesized )
{
- // TODO: in case of performance problems, try issuing this not too
+ // TODO: in case of performance problems, try issuing this not too
// frequently (half of refresh rate)
CGContextFlush(m_cgContext);
#if wxOSX_USE_CARBON
if (m_composition == wxCOMPOSITION_DEST)
return;
-
+
#ifdef __WXMAC__
wxMacCoreGraphicsBitmapData* refdata =static_cast<wxMacCoreGraphicsBitmapData*>(bmp.GetRefData());
CGImageRef image = refdata->GetBitmap();
{
if (EnsureIsValid()==false)
return;
-
+
if (m_composition == wxCOMPOSITION_DEST)
return;
{
if (EnsureIsValid()==false)
return;
-
+
CGContextSaveGState( m_cgContext );
}
{
if (EnsureIsValid()==false)
return;
-
+
CGContextRestoreGState( m_cgContext );
}
if (EnsureIsValid()==false)
return;
-
+
if (m_composition == wxCOMPOSITION_DEST)
return;
if (EnsureIsValid()==false)
return;
-
+
if (m_composition == wxCOMPOSITION_DEST)
return;
// list box control implementation
// ============================================================================
-wxWidgetImplType* wxWidgetImpl::CreateListBox( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
- const wxPoint& pos,
+wxWidgetImplType* wxWidgetImpl::CreateListBox( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
wxMacDataBrowserListControl* control = new wxMacDataBrowserListControl( wxpeer, pos, size, style );
wxListBox *list = wxDynamicCast( owner->GetWXPeer() , wxListBox );
wxMacDataBrowserCellValue valueholder(itemData);
list->GetValueCallback( n , col, valueholder );
-
+
err = noErr;
}
else
}
}
-
+
}
else
{
{
err = wxMacDataItem::GetSetData(owner, property, itemData, changeValue);
}
-
+
return err;
}
: wxMacDataItemBrowserControl( peer, pos, size, style )
{
m_nextColumnId = 0 ;
-
+
OSStatus err = noErr;
m_clientDataItemsType = wxClientData_None;
if ( style & wxLB_SORT )
{
wxListBox *list = wxDynamicCast( GetWXPeer() , wxListBox );
wxCHECK_RET( list != NULL , wxT("Listbox expected"));
-
+
if (list->HasMultipleSelection() && (message == kDataBrowserSelectionSetChanged) && (!list->MacGetBlockEvents()))
{
list->CalcAndSendEvent();
if ((message == kDataBrowserSelectionSetChanged) && (!list->MacGetBlockEvents()))
{
wxCommandEvent event( wxEVT_COMMAND_LISTBOX_SELECTED, list->GetId() );
-
+
int sel = list->GetSelection();
if ((sel < 0) || (sel > (int) list->GetCount())) // OS X can select an item below the last item (why?)
return;
list->HandleLineEvent( sel, false );
return;
}
-
+
// call super for item level(wxMacDataItem->Notification) callback processing
wxMacDataItemBrowserControl::ItemNotification( itemID, message, itemData);
}
// List Methods
//
-wxMacDataBrowserColumn* wxMacDataBrowserListControl::DoInsertColumn( unsigned int pos, DataBrowserPropertyID property,
+wxMacDataBrowserColumn* wxMacDataBrowserListControl::DoInsertColumn( unsigned int pos, DataBrowserPropertyID property,
const wxString& title, bool editable,
DataBrowserPropertyType colType, SInt16 just, int width )
{
columnDesc.propertyDesc.propertyFlags = kDataBrowserListViewSortableColumn;
columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn;
columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewNoGapForIconInHeaderButton;
-
+
if ( editable )
columnDesc.propertyDesc.propertyFlags |= kDataBrowserPropertyIsMutable;
}
wxMacDataBrowserColumn *col = new wxMacDataBrowserColumn( property, colType, editable );
-
+
m_columns.Insert( col, pos );
-
+
return col;
}
-wxListWidgetColumn* wxMacDataBrowserListControl::InsertTextColumn( unsigned pos, const wxString& title, bool editable,
- wxAlignment just, int defaultWidth)
+wxListWidgetColumn* wxMacDataBrowserListControl::InsertTextColumn( unsigned pos, const wxString& title, bool editable,
+ wxAlignment just, int defaultWidth)
{
DataBrowserPropertyID property = kMinColumnId + m_nextColumnId++;
-
+
SInt16 j = teFlushLeft;
if ( just & wxALIGN_RIGHT )
j = teFlushRight;
else if ( just & wxALIGN_CENTER_HORIZONTAL )
j = teCenter;
-
- return DoInsertColumn( pos, property, title, editable, kDataBrowserTextType, just, defaultWidth );
+
+ return DoInsertColumn( pos, property, title, editable, kDataBrowserTextType, just, defaultWidth );
}
-wxListWidgetColumn* wxMacDataBrowserListControl::InsertCheckColumn( unsigned pos , const wxString& title, bool editable,
- wxAlignment just, int defaultWidth )
+wxListWidgetColumn* wxMacDataBrowserListControl::InsertCheckColumn( unsigned pos , const wxString& title, bool editable,
+ wxAlignment just, int defaultWidth )
{
DataBrowserPropertyID property = kMinColumnId + m_nextColumnId++;
-
+
SInt16 j = teFlushLeft;
if ( just & wxALIGN_RIGHT )
j = teFlushRight;
else if ( just & wxALIGN_CENTER_HORIZONTAL )
j = teCenter;
-
- return DoInsertColumn( pos, property, title, editable, kDataBrowserCheckboxType, just, defaultWidth );
+
+ return DoInsertColumn( pos, property, title, editable, kDataBrowserCheckboxType, just, defaultWidth );
}
wxMacDataBrowserColumn* wxMacDataBrowserListControl::GetColumnFromProperty( DataBrowserPropertyID property)
for ( unsigned int i = 0; i < m_columns.size() ; ++ i )
if ( m_columns[i]->GetProperty() == property )
return m_columns[i];
-
+
return NULL;
}
RevealItem( item , kDataBrowserRevealWithoutSelecting );
}
-
-void wxMacDataBrowserListControl::UpdateLine( unsigned int n, wxListWidgetColumn* col )
+
+void wxMacDataBrowserListControl::UpdateLine( unsigned int n, wxListWidgetColumn* col )
{
wxMacDataBrowserColumn* dbcol = dynamic_cast<wxMacDataBrowserColumn*> (col);
wxMacDataItem * item = (wxMacDataItem*) GetItemFromLine( n );
UpdateItem(wxMacDataBrowserRootContainer, item, dbcol ? dbcol->GetProperty() : kDataBrowserNoItem );
}
-void wxMacDataBrowserListControl::UpdateLineToEnd( unsigned int n)
+void wxMacDataBrowserListControl::UpdateLineToEnd( unsigned int n)
{
// with databrowser inserting does not need updating the entire model, it's done by databrowser itself
wxMacDataItem * item = (wxMacDataItem*) GetItemFromLine( n );
SetDataBrowserItemDataText( m_data, (CFStringRef) cf);
}
-void wxMacDataBrowserCellValue::Set( int value )
-{
+void wxMacDataBrowserCellValue::Set( int value )
+{
SetDataBrowserItemDataValue( m_data, value );
}
{
SetDataBrowserItemDataButtonValue( m_data, check ? kThemeButtonOn : kThemeButtonOff);
}
-
-int wxMacDataBrowserCellValue::GetIntValue() const
+
+int wxMacDataBrowserCellValue::GetIntValue() const
{
SInt32 value;
GetDataBrowserItemDataValue( m_data, &value );
return value;
}
-wxString wxMacDataBrowserCellValue::GetStringValue() const
+wxString wxMacDataBrowserCellValue::GetStringValue() const
{
CFStringRef value;
GetDataBrowserItemDataText ( m_data, &value );
if (result == kControlButtonPart){
DataBrowserPropertyID col;
GetDataBrowserSortProperty(controlRef, &col);
-
+
DataBrowserTableViewColumnIndex column = 0;
verify_noerr( GetDataBrowserTableViewColumnPosition( controlRef, col, &column ) );
-
+
le.m_col = column;
// FIXME: we can't use the sort property for virtual listctrls
// so we need to find a better way to determine which column was clicked...
{
int id = event.GetId();
wxObject* obj = event.GetEventObject();
-
+
// even though we use a generic list ctrl underneath, make sure
// we present ourselves as wxListCtrl.
event.SetEventObject( m_list );
void wxListCtrl::OnChar(wxKeyEvent& event)
{
-
+
if (m_dbImpl)
{
wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetId() );
le.SetEventObject(this);
le.m_code = event.GetKeyCode();
le.m_itemIndex = -1;
-
+
if (m_current == -1)
{
// if m_current isn't set, check if there's been a selection
// made before continuing
m_current = GetNextItem(-1, wxLIST_NEXT_BELOW, wxLIST_STATE_SELECTED);
}
-
+
// We need to determine m_current ourselves when navigation keys
// are used. Note that PAGEUP and PAGEDOWN do not alter the current
// item on native Mac ListCtrl, so we only handle up and down keys.
m_current -= 1;
else
m_current = 0;
-
+
break;
case WXK_DOWN:
m_current += 1;
else
m_current = GetItemCount() - 1;
-
+
break;
}
delete m_imageListState;
delete m_renameTimer;
-
+
WX_CLEAR_LIST(wxColumnList, m_colsInfo);
}
if (m_dbImpl)
{
wxASSERT_MSG( col < (int)m_colsInfo.GetCount(), wxT("invalid column index in wxMacListCtrlItem") );
-
+
long mask = item.GetMask();
{
wxListItem listItem;
if (m_genericImpl)
return m_genericImpl->GetSubItemRect(item, subItem, rect, code);
- // TODO: implement for DataBrowser implementation
+ // TODO: implement for DataBrowser implementation
return false;
}
DataBrowserTableViewColumnID col = 0;
verify_noerr( m_dbImpl->GetColumnIDFromIndex( 0, &col ) );
-
+
Rect bounds;
DataBrowserPropertyPart part = kDataBrowserPropertyEnclosingPart;
if ( code == wxLIST_RECT_LABEL )
if ( !IsVirtual() )
id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(line);
- if ( (state & wxLIST_STATE_FOCUSED) && (m_current == line))
+ if ( (state & wxLIST_STATE_FOCUSED) && (m_current == line))
return line;
if ( (state == wxLIST_STATE_DONTCARE ) )
if ( !IsVirtual() )
id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(line);
- if ( (state & wxLIST_STATE_FOCUSED) && (m_current == line))
+ if ( (state & wxLIST_STATE_FOCUSED) && (m_current == line))
return line;
if ( (state == wxLIST_STATE_DONTCARE ) )
just = teFlushRight;
}
m_dbImpl->InsertColumn(col, type, item.GetText(), just, width);
-
+
wxListItem* listItem = new wxListItem(item);
m_colsInfo.Insert( col, listItem );
SetColumn(col, item);
wxString text;
wxFont font = wxNullFont;
int imgIndex = -1;
-
+
DataBrowserTableViewColumnIndex listColumn = 0;
GetColumnPosition( property, &listColumn );
-
+
wxListCtrl* list = wxDynamicCast( GetWXPeer() , wxListCtrl );
wxMacListCtrlItem* lcItem;
wxColour color = *wxBLACK;
{
item = (wxMacListCtrlItem *) itemID;
}
-
+
// we want to depend on as little as possible to make sure tear-down of controls is safe
if ( message == kDataBrowserItemRemoved )
{
}
}
}
-
+
void wxMacDataBrowserListCtrlControl::MacInsertItem( unsigned int n, wxListItem* item )
{
-
+
wxMacDataItemBrowserControl::MacInsert(n, new wxMacListCtrlItem() );
MacSetColumnInfo(n, 0, item);
}
// Dispose of the movie controller
::DisposeMovieController(m_mc);
m_mc = NULL;
-
+
// Dispose of offscreen GWorld
::DisposeGWorld(m_movieWorld);
}
NULL); // wasChanged
// Do not use ::GetMoviesStickyError() here because it returns -2009
- // a.k.a. invalid track on valid mpegs
+ // a.k.a. invalid track on valid mpegs
if (err == noErr && ::GetMoviesError() == noErr)
{
::CloseMovieFile(movieResFile);
// under carbon there's no such thing as a MenuItemRef, everything is done
// on the 'parent' menu via index APIs (first line having index 1 !)
-// so to make things still work, we store the wxMenuItemImpl instance as a
+// so to make things still work, we store the wxMenuItemImpl instance as a
// RefCon at the respective menu line
-class wxMenuItemCarbonImpl : public wxMenuItemImpl
+class wxMenuItemCarbonImpl : public wxMenuItemImpl
{
public :
wxMenuItemCarbonImpl( wxMenuItem* peer ) : wxMenuItemImpl(peer)
// the parent menu ref is only set, once the item has been attached
m_parentMenuRef = NULL;
}
-
+
~wxMenuItemCarbonImpl();
-
+
void SetBitmap( const wxBitmap& bitmap )
{
MenuItemIndex i = FindMenuItemIndex() ;
#endif
}
}
- }
-
- void Enable( bool enable )
+ }
+
+ void Enable( bool enable )
{
MenuItemIndex i = FindMenuItemIndex() ;
if ( i > 0 )
{
-
+
if ( GetWXPeer()->GetId() == wxApp::s_macPreferencesMenuItemId)
{
if ( enable )
EnableMenuCommand( NULL , kHICommandPreferences ) ;
else
DisableMenuCommand( NULL , kHICommandPreferences ) ;
- }
+ }
else if ( GetWXPeer()->GetId() == wxApp::s_macExitMenuItemId)
{
if ( enable )
else
DisableMenuCommand( NULL , kHICommandQuit ) ;
}
-
+
if ( enable )
EnableMenuItem(m_parentMenuRef , i);
else
DisableMenuItem(m_parentMenuRef , i);
-
+
if ( GetWXPeer()->IsSubMenu() )
{
UMAEnableMenuItem( GetWXPeer()->GetSubMenu()->GetHMenu() , 0 , enable ) ;
}
}
- }
-
- void Check( bool check )
+ }
+
+ void Check( bool check )
{
MenuItemIndex i = FindMenuItemIndex() ;
if ( i > 0 )
else
::SetItemMark( m_parentMenuRef, i, 0 ) ; // no mark
}
- }
+ }
- void Hide( bool hide )
+ void Hide( bool hide )
{
MenuItemIndex i = FindMenuItemIndex() ;
if ( i > 0 )
else
ChangeMenuItemAttributes( m_parentMenuRef, i, 0 , kMenuItemAttrHidden );
}
- }
-
- void SetLabel( const wxString& text, wxAcceleratorEntry *entry )
+ }
+
+ void SetLabel( const wxString& text, wxAcceleratorEntry *entry )
{
MenuItemIndex i = FindMenuItemIndex() ;
if ( i > 0 )
UMASetMenuItemShortcut( m_parentMenuRef, i , entry ) ;
}
}
-
+
void * GetHMenuItem() { return NULL; }
-
+
// Carbon Only
-
- void AttachToParent( MenuRef parentMenuRef, MenuItemIndex index )
+
+ void AttachToParent( MenuRef parentMenuRef, MenuItemIndex index )
{
m_parentMenuRef = parentMenuRef;
if ( m_parentMenuRef && index > 0 )
// wxMenuImpl
//
-class wxMenuCarbonImpl : public wxMenuImpl
+class wxMenuCarbonImpl : public wxMenuImpl
{
public :
wxMenuCarbonImpl( wxMenu* peer , MenuRef menu) : wxMenuImpl(peer), m_osxMenu(menu)
}
virtual ~wxMenuCarbonImpl();
-
- virtual void InsertOrAppend(wxMenuItem *pItem, size_t pos)
+
+ virtual void InsertOrAppend(wxMenuItem *pItem, size_t pos)
{
// MacOS counts menu items from 1 and inserts after, therefore having the
// same effect as wx 0 based and inserting before, we must correct pos
MenuItemIndex index = pos;
if ( pos == (size_t) -1 )
index = CountMenuItems(m_osxMenu);
-
+
if ( pItem->IsSeparator() )
{
InsertMenuItemTextWithCFString( m_osxMenu, CFSTR(""), index, kMenuItemAttrSeparator, 0);
// now switch to the Carbon 1 based counting
index += 1 ;
}
- else
+ else
{
InsertMenuItemTextWithCFString( m_osxMenu, CFSTR("placeholder"), index, 0, 0 );
SetMenuItemCommandID( m_osxMenu, index , wxIdToMacCommand(pItem->GetId()) ) ;
}
}
-
+
wxMenuItemCarbonImpl* impl = (wxMenuItemCarbonImpl*) pItem->GetPeer();
impl->AttachToParent( m_osxMenu, index );
// only now can all settings be updated correctly
pItem->UpdateItemStatus();
pItem->UpdateItemBitmap();
}
-
- virtual void Remove( wxMenuItem *pItem )
+
+ virtual void Remove( wxMenuItem *pItem )
{
wxMenuItemCarbonImpl* impl = (wxMenuItemCarbonImpl*) pItem->GetPeer();
if ( impl )
}
}
}
-
+
virtual void MakeRoot()
{
SetRootMenu( m_osxMenu );
}
-wxMenuItemImpl* wxMenuItemImpl::Create( wxMenuItem* peer,
+wxMenuItemImpl* wxMenuItemImpl::Create( wxMenuItem* peer,
wxMenu * WXUNUSED(pParentMenu),
int WXUNUSED(id),
const wxString& WXUNUSED(text),
#include "wx/osx/private.h"
-// because on mac carbon everything is done through MenuRef APIs both implementation
+// because on mac carbon everything is done through MenuRef APIs both implementation
// classes are in menu.cpp
}
bool wxNonOwnedWindowCarbonImpl::SetBackgroundStyle(wxBackgroundStyle style)
-{
+{
if ( style == wxBG_STYLE_TRANSPARENT )
{
OSStatus err = HIWindowChangeFeatures( m_macWindow, 0, kWindowIsOpaque );
// for wx.
// TODO: Determine if we need this on Leopard as well. (should be harmless either way,
// though)
- // since when creating the peering is not yet completely set-up we call both setters
+ // since when creating the peering is not yet completely set-up we call both setters
// explicitely
m_wxPeer->SetBackgroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW) ) ;
SetBackgroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW) ) ;
::HiliteMenu(0);
result = noErr ;
}
- }
+ }
else if ( window && windowPart == inProxyIcon )
{
// special case proxy icon bar, as we are having a low-level runloop we must do it ourselves
wxWindow* cursorTarget = currentMouseWindow ;
wxPoint cursorPoint( wxevent.m_x , wxevent.m_y ) ;
-
+
extern wxCursor gGlobalCursor;
if (!gGlobalCursor.IsOk())
wxSTANDARD_CURSOR->MacInstall() ;
}
}
-
+
// don't mess with controls we don't know about
// for some reason returning eventNotHandledErr does not lead to the correct behaviour
// so we try sending them the correct control directly
newRect.bottom - newRect.top + deltaheight ) ;
toplevelWindow->HandleResizing( cEvent.GetTicks(), &adjustR );
-
- const Rect adjustedRect = { adjustR.y + top , adjustR.x + left , adjustR.y + top + adjustR.height - deltaheight ,
+
+ const Rect adjustedRect = { adjustR.y + top , adjustR.x + left , adjustR.y + top + adjustR.height - deltaheight ,
adjustR.x + left + adjustR.width - deltawidth } ;
if ( !EqualRect( &newRect , &adjustedRect ) )
cEvent.SetParameter<Rect>( kEventParamCurrentBounds , &adjustedRect ) ;
}
void wxNonOwnedWindowCarbonImpl::Destroy()
-{
+{
if ( m_macEventHandler )
{
::RemoveEventHandler((EventHandlerRef) m_macEventHandler);
wxWindow* parent,
const wxPoint& pos,
const wxSize& size,
- long style, long extraStyle,
+ long style, long extraStyle,
const wxString& WXUNUSED(name) )
{
return true;
}
-void wxNonOwnedWindowCarbonImpl::SetTitle( const wxString& title, wxFontEncoding encoding )
+void wxNonOwnedWindowCarbonImpl::SetTitle( const wxString& title, wxFontEncoding encoding )
{
SetWindowTitleWithCFString( m_macWindow , wxCFStringRef( title , encoding ) ) ;
}
-
+
bool wxNonOwnedWindowCarbonImpl::IsMaximized() const
{
return IsWindowInStandardState( m_macWindow , NULL , NULL ) ;
}
-
+
bool wxNonOwnedWindowCarbonImpl::IsIconized() const
{
return IsWindowCollapsed((WindowRef)GetWXWindow() ) ;
}
-
+
void wxNonOwnedWindowCarbonImpl::Iconize( bool iconize )
{
if ( IsWindowCollapsable( m_macWindow ) )
CollapseWindow( m_macWindow , iconize ) ;
}
-
+
void wxNonOwnedWindowCarbonImpl::Maximize(bool maximize)
{
Point idealSize = { 0 , 0 } ;
}
ZoomWindowIdeal( (WindowRef)GetWXWindow() , maximize ? inZoomOut : inZoomIn , &idealSize ) ;
}
-
+
bool wxNonOwnedWindowCarbonImpl::IsFullScreen() const
{
return m_macFullScreenData != NULL ;
}
-
+
bool wxNonOwnedWindowCarbonImpl::ShowFullScreen(bool show, long style)
{
if ( show )
y -= top ;
h += top ;
// avoid adding the caption twice to the height
- outerheight -= top;
+ outerheight -= top;
}
if ( style & wxFULLSCREEN_NOBORDER )
// check that the page index is valid
#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount())
-wxWidgetImplType* wxWidgetImpl::CreateTabView( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
- const wxPoint& pos,
+wxWidgetImplType* wxWidgetImpl::CreateTabView( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size );
// Purpose: implements wxPopupWindow for wxMac
// Author: Stefan Csomor
// Modified by:
-// Created:
+// Created:
// RCS-ID: $Id$
// Copyright: (c) 2006 Stefan Csomor
// License: wxWindows licence
#include "wx/popupwin.h"
#include "wx/tooltip.h"
-#include "wx/osx/private.h"
+#include "wx/osx/private.h"
// ============================================================================
// implementation
((wxOSXPrintData*)m_printDialogData.GetPrintData().GetNativeData())->TransferFrom( &m_printDialogData );
int result = wxID_CANCEL;
-
+
OSErr err = noErr;
Boolean accepted;
wxOSXPrintData* nativeData = (wxOSXPrintData*)m_printDialogData.GetPrintData().GetNativeData();
#include "wx/radiobut.h"
#include "wx/osx/private.h"
-wxWidgetImplType* wxWidgetImpl::CreateRadioButton( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateRadioButton( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(label),
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
- long WXUNUSED(extraStyle))
+ long WXUNUSED(style),
+ long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size ) ;
wxMacControl* peer = new wxMacControl(wxpeer) ;
wxUnusedVar(n);
wxUnusedVar(points);
-#if 0
+#if 0
// no non-QD APIs available
// TODO : remove ?
// OS X somehow does not collect the region invisibly as before, so sometimes things
RgnHandle tempRgn = NewRgn();
CloseRgn( tempRgn ) ;
-
+
::SetGWorld( oldWorld, oldGDHandle );
wxCFRef<HIShapeRef> tempShape( HIShapeCreateWithQDRgn(tempRgn ) );
m_refData = new wxRegionRefData(tempShape);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if ( HIShapeEnumerate != NULL )
{
- OSStatus err = HIShapeEnumerate (OTHER_M_REGION(region), kHIShapeParseFromTopLeft, wxOSXRegionToRectsCounterCallback,
+ OSStatus err = HIShapeEnumerate (OTHER_M_REGION(region), kHIShapeParseFromTopLeft, wxOSXRegionToRectsCounterCallback,
(void*)&m_numRects);
if (err == noErr)
{
RegionToRectsCallbackData data ;
data.m_rects = m_rects ;
data.m_current = 0 ;
- HIShapeEnumerate( OTHER_M_REGION(region), kHIShapeParseFromTopLeft, wxOSXRegionToRectsSetterCallback,
+ HIShapeEnumerate( OTHER_M_REGION(region), kHIShapeParseFromTopLeft, wxOSXRegionToRectsSetterCallback,
(void*)&data );
}
else
RegionToRectsCallbackData data ;
data.m_rects = m_rects ;
data.m_current = 0 ;
- QDRegionToRects( rgn , kQDParseRegionFromTopLeft, wxMacRegionToRectsSetterCallback,
+ QDRegionToRects( rgn , kQDParseRegionFromTopLeft, wxMacRegionToRectsSetterCallback,
(void*)&data );
}
else
wxOSXScrollBarCarbonImpl( wxWindowMac* peer) : wxMacControl( peer )
{
}
-
- void SetScrollThumb( wxInt32 value, wxInt32 thumbSize )
+
+ void SetScrollThumb( wxInt32 value, wxInt32 thumbSize )
{
SetValue( value );
SetControlViewSize(m_controlRef , thumbSize );
protected:
};
-wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
- const wxPoint& pos,
+wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size );
wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
{
wxFont font;
-
+
switch (index)
{
case wxSYS_ANSI_VAR_FONT :
#if wxOSX_USE_CARBON
return (int)(GetDblTime() * 1000. / 60.);
#else
- // default on mac is 30 ticks, we shouldn't really use wxSYS_DCLICK_MSEC anyway
+ // default on mac is 30 ticks, we shouldn't really use wxSYS_DCLICK_MSEC anyway
// but rather rely on the 'click-count' by the system delivered in a mouse event
return 500;
#endif
#include "wx/slider.h"
#include "wx/osx/private.h"
-wxWidgetImplType* wxWidgetImpl::CreateSlider( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateSlider( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
wxInt32 value,
wxInt32 minimum,
wxInt32 maximum,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size );
#include "wx/osx/private.h"
-wxWidgetImplType* wxWidgetImpl::CreateSpinButton( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateSpinButton( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
wxInt32 value,
wxInt32 minimum,
wxInt32 maximum,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size );
wxMacControl* peer = new wxMacControl( wxpeer );
OSStatus err = CreateLittleArrowsControl(
- MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds, value,
+ MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds, value,
minimum, maximum, 1, peer->GetControlRefAddr() );
verify_noerr( err );
const wxString& str,
const wxPoint& pos,
const wxSize& size, long style ) ;
-
+
// search field options
virtual void ShowSearchButton( bool show );
virtual bool IsSearchButtonVisible() const;
virtual void SetSearchMenu( wxMenu* menu );
virtual void SetDescriptiveText(const wxString& text);
-
+
virtual bool SetFocus();
private:
return true;
}
-wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxString& str,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
wxMacControl* peer = new wxMacSearchFieldControl( wxpeer , str , pos , size , style );
#include "wx/statbox.h"
#include "wx/osx/private.h"
-wxWidgetImplType* wxWidgetImpl::CreateGroupBox( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateGroupBox( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(label),
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size );
// implementation
// ============================================================================
-wxWidgetImplType* wxWidgetImpl::CreateStaticLine( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
- const wxPoint& pos,
+wxWidgetImplType* wxWidgetImpl::CreateStaticLine( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
- long WXUNUSED(extraStyle))
+ long WXUNUSED(style),
+ long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size ) ;
wxMacControl* peer = new wxMacControl(wxpeer) ;
SInt16 baseline;
if ( m_font.MacGetThemeFontID() != kThemeCurrentPortFont )
{
- // GetThemeTextDimensions will cache strings and the documentation
- // says not to use the NoCopy string creation calls.
- // This also means that we can't use CFSTR without
- // -fno-constant-cfstrings if the library might be unloaded,
- // as GetThemeTextDimensions may cache a pointer to our
- // unloaded segment.
- wxCFStringRef str( !m_label.empty() ? m_label : wxString(" "),
+ // GetThemeTextDimensions will cache strings and the documentation
+ // says not to use the NoCopy string creation calls.
+ // This also means that we can't use CFSTR without
+ // -fno-constant-cfstrings if the library might be unloaded,
+ // as GetThemeTextDimensions may cache a pointer to our
+ // unloaded segment.
+ wxCFStringRef str( !m_label.empty() ? m_label : wxString(" "),
GetFont().GetEncoding() );
-
+
err = GetThemeTextDimensions(
(CFStringRef)str,
m_font.MacGetThemeFontID(), kThemeStateActive, false, &bounds, &baseline );
wxDockTaskBarIcon* pTB = (wxDockTaskBarIcon*) pData;
const UInt32 eventClass = GetEventClass(inEvent);
const UInt32 eventKind = GetEventKind(inEvent);
-
+
OSStatus err = eventNotHandledErr;
// Handle wxTaskBar menu events (note that this is a global event handler
public :
wxMacMLTEControl( wxTextCtrl *peer ) ;
~wxMacMLTEControl() {}
-
+
virtual bool CanFocus() const
{ return true; }
return true;
}
- virtual void Move(int x, int y, int width, int height);
+ virtual void Move(int x, int y, int width, int height);
protected :
OSStatus DoCreate();
SInt32 m_lastVerticalValue ;
};
-wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxString& str,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
bool forceMLTE = false ;
}
}
-void wxMacMLTEClassicControl::Move(int x, int y, int width, int height)
+void wxMacMLTEClassicControl::Move(int x, int y, int width, int height)
{
wxMacControl::Move(x,y,width,height) ;
MacUpdatePosition() ;
#include "wx/osx/private.h"
// Button
-wxWidgetImplType* wxWidgetImpl::CreateToggleButton( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateToggleButton( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(label),
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size ) ;
-
+
wxMacControl* peer = new wxMacControl(wxpeer) ;
- verify_noerr ( CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") ,
+ verify_noerr ( CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") ,
kControlBevelButtonNormalBevel , kControlBehaviorToggles , NULL , 0 , 0 , 0 , peer->GetControlRefAddr() ) );
return peer;
}
-
-wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer,
- wxWindowMac* parent,
- wxWindowID WXUNUSED(id),
+
+wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID WXUNUSED(id),
const wxBitmap& label,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
-{
+{
Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size ) ;
wxMacControl* peer = new wxMacControl(wxpeer) ;
-
+
ControlButtonContentInfo info;
wxMacCreateBitmapButton( &info, label );
- verify_noerr ( CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") ,
+ verify_noerr ( CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") ,
kControlBevelButtonNormalBevel , kControlBehaviorOffsetContents | kControlBehaviorToggles , &info , 0 , 0 , 0 , peer->GetControlRefAddr() ) );
wxMacReleaseBitmapButton( &info ) ;
bool wxThreadModule::OnInit()
{
- bool hasThreadManager =
-#ifdef __LP64__
+ bool hasThreadManager =
+#ifdef __LP64__
true ; // TODO VERIFY IN NEXT BUILD
#else
MPLibraryIsLoaded();
}
// --- mac specific
-#if wxUSE_TIMER
+#if wxUSE_TIMER
wxMacToolTipTimer::wxMacToolTipTimer( wxMacToolTip *tip , int msec )
{
m_tip = tip;
{
m_window = NULL ;
m_backpict = NULL ;
-#if wxUSE_TIMER
+#if wxUSE_TIMER
m_timer = NULL ;
#endif
m_mark = 0 ;
m_window =win;
s_ToolTipWindowRef = m_window ;
m_backpict = NULL ;
-#if wxUSE_TIMER
+#if wxUSE_TIMER
delete m_timer ;
m_timer = new wxMacToolTipTimer( this , s_ToolTipDelay ) ;
wxMacToolTip::~wxMacToolTip()
{
-#if wxUSE_TIMER
+#if wxUSE_TIMER
if ( m_timer )
{
delete m_timer ;
void wxMacToolTip::Clear()
{
m_mark++ ;
-#if wxUSE_TIMER
+#if wxUSE_TIMER
if ( m_timer )
{
delete m_timer ;
bool allowHelpMenuCreation)
{
static bool s_createdHelpMenu = false ;
-
+
if ( !s_createdHelpMenu && !allowHelpMenuCreation )
{
return paramErr ;
}
-
+
OSStatus status = HMGetHelpMenu( outHelpMenu , outFirstCustomItemIndex ) ;
s_createdHelpMenu = ( status == noErr ) ;
return status ;
{
if ( m_sortOrder == SortOrder_None )
{
-
+
// increase the order of the lines to be shifted
unsigned int lines = MacGetCount();
for ( unsigned int i = n; i < lines; ++i)
wxMacDataItem* iter = (wxMacDataItem*) GetItemFromLine(i);
iter->SetOrder( iter->GetOrder() + 1 );
}
-
+
#if 0
// I don't understand what this code is supposed to do, RR.
SInt32 frontLineOrder = 0;
wxMacDataItem* iter = (wxMacDataItem*) GetItemFromLine(n-1);
frontLineOrder = iter->GetOrder()+1;
}
-#else
+#else
item->SetOrder( n );
#endif
}
return context;
}
-bool wxOSXLockFocus( WXWidget view)
+bool wxOSXLockFocus( WXWidget view)
{
return [view lockFocusIfCanDraw];
}
-void wxOSXUnlockFocus( WXWidget view)
+void wxOSXUnlockFocus( WXWidget view)
{
[view unlockFocus];
}
wxFontStyle fontstyle = wxFONTSTYLE_NORMAL;
wxFontWeight fontweight = wxFONTWEIGHT_NORMAL;
bool underlined = false;
-
+
int size = (int) ([desc pointSize]+0.5);
NSFontSymbolicTraits traits = [desc symbolicTraits];
-
+
if ( traits & NSFontBoldTrait )
fontweight = wxFONTWEIGHT_BOLD ;
else
fontweight = wxFONTWEIGHT_NORMAL ;
if ( traits & NSFontItalicTrait )
fontstyle = wxFONTSTYLE_ITALIC ;
-
+
wxCFStringRef fontname( [desc postscriptName] );
info->Init(size,wxFONTFAMILY_DEFAULT,fontstyle,fontweight,underlined,
fontname.AsString(), wxFONTENCODING_DEFAULT);
-
+
}
info->m_nsFontDescriptor = desc;
return nsfont;
{
NSFontDescriptor* desc = nil;
NSFontSymbolicTraits traits = 0;
- float weight = 0;
+ float weight = 0;
if (m_weight == wxFONTWEIGHT_BOLD)
{
}
else if (m_weight == wxFONTWEIGHT_LIGHT)
weight = -1;
-
+
if (m_style == wxFONTSTYLE_ITALIC || m_style == wxFONTSTYLE_SLANT)
traits |= NSFontItalicTrait;
desc = [NSFontDescriptor fontDescriptorWithFontAttributes:
[[NSDictionary alloc] initWithObjectsAndKeys:
- wxCFStringRef(m_faceName).AsNSString(), NSFontFamilyAttribute,
- [NSNumber numberWithFloat:m_pointSize], NSFontSizeAttribute,
- [NSNumber numberWithUnsignedInt:traits], NSFontSymbolicTrait,
+ wxCFStringRef(m_faceName).AsNSString(), NSFontFamilyAttribute,
+ [NSNumber numberWithFloat:m_pointSize], NSFontSizeAttribute,
+ [NSNumber numberWithUnsignedInt:traits], NSFontSymbolicTrait,
[NSNumber numberWithFloat:weight],NSFontWeightTrait,
nil]];
wxFontStyle fontstyle = wxFONTSTYLE_NORMAL;
wxFontWeight fontweight = wxFONTWEIGHT_NORMAL;
bool underlined = false;
-
+
int size = (int) ([uifont pointSize]+0.5);
/*
NSFontSymbolicTraits traits = [desc symbolicTraits];
-
+
if ( traits & NSFontBoldTrait )
fontweight = wxFONTWEIGHT_BOLD ;
else
wxCFStringRef fontname( wxCFRetain([uifont familyName]) );
info->Init(size,wxFONTFAMILY_DEFAULT,fontstyle,fontweight,underlined,
fontname.AsString(), wxFONTENCODING_DEFAULT);
-
+
}
return uifont;
}
WX_UIImage wxOSXCreateUIImageFromCGImage( CGImageRef image )
{
- UIImage *newImage = [UIImage imageWithCGImage:image];
+ UIImage *newImage = [UIImage imageWithCGImage:image];
[newImage autorelease];
return( newImage );
}
WX_NSImage wxOSXCreateNSImageFromCGImage( CGImageRef image )
{
NSRect imageRect = NSMakeRect(0.0, 0.0, 0.0, 0.0);
-
+
// Get the image dimensions.
imageRect.size.height = CGImageGetHeight(image);
imageRect.size.width = CGImageGetWidth(image);
-
+
// Create a new image to receive the Quartz image data.
- NSImage *newImage = [[NSImage alloc] initWithSize:imageRect.size];
+ NSImage *newImage = [[NSImage alloc] initWithSize:imageRect.size];
[newImage lockFocus];
-
+
// Get the Quartz context and draw.
CGContextRef imageContext = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
CGContextDrawImage( imageContext, *(CGRect*)&imageRect, image );
[newImage unlockFocus];
-
+
/*
// Create a bitmap rep from the image...
NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];
case wxCURSOR_HAND:
cursor = [[NSCursor pointingHandCursor] retain];
break;
-
+
case wxCURSOR_BULLSEYE:
cursor = wxGetStockCursor(kwxCursorBullseye);
break;
WX_NSCursor wxMacCocoaCreateCursorFromCGImage( CGImageRef cgImageRef, float hotSpotX, float hotSpotY )
{
static BOOL firstTime = YES;
-
+
if ( firstTime )
{
// Must first call [[[NSWindow alloc] init] release] to get the NSWindow machinery set up so that NSCursor can use a window to cache the cursor image
[[[NSWindow alloc] init] release];
firstTime = NO;
}
-
+
NSImage *nsImage = wxOSXCreateNSImageFromCGImage( cgImageRef );
NSCursor *cursor = [[NSCursor alloc] initWithImage:nsImage hotSpot:NSMakePoint( hotSpotX, hotSpotY )];
-
+
[nsImage release];
-
+
return cursor;
}
m_peer->SetValue( val ) ;
}
-bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) )
+bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) )
{
bool sendEvent = true;
wxCheckBoxState newState = Get3StateValue();
-
+
if ( !m_peer->ButtonClickDidStateChange() )
{
wxCheckBoxState origState ;
BEGIN_EVENT_TABLE(wxCheckListBox, wxListBox)
END_EVENT_TABLE()
-
+
void wxCheckListBox::Init()
{
}
if ( col == m_checkColumn )
{
Check( n, value.IsChecked() );
-
+
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId() );
event.SetInt( n );
event.SetString( GetString( n ) );
if ( !wxChoiceBase::Create( parent, id, pos, size, style, validator, name ) )
return false;
-
+
m_popUpMenu = new wxMenu();
m_popUpMenu->SetNoEventsMode(true);
-
+
m_peer = wxWidgetImpl::CreateChoice( this, parent, id, m_popUpMenu, pos, size, style, GetExtraStyle() );
MacPostControlCreate( pos, size );
if ( HasClientObjectData() )
delete GetClientObject( n );
-
+
m_popUpMenu->Delete( m_popUpMenu->FindItemByPosition( n ) );
m_strings.RemoveAt( n ) ;
event.SetInt( n );
event.SetString( GetStringSelection() );
event.SetEventObject( this );
-
+
if ( HasClientObjectData() )
event.SetClientObject( GetClientObject( n ) );
else if ( HasClientUntypedData() )
#include "wx/osx/private.h"
-wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxBitmap& bitmap,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
- long WXUNUSED(extraStyle))
+ long style,
+ long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
else
[v setBezelStyle:NSRegularSquareBezelStyle];
}
-
+
if (bitmap.Ok())
[v setImage:bitmap.GetNSImage() ];
-
+
[v setButtonType:NSMomentaryPushInButton];
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
return c;
#include "wx/checkbox.h"
#include "wx/osx/private.h"
-wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(label),
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
- long WXUNUSED(extraStyle))
+ long style,
+ long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
- [v setButtonType:NSSwitchButton];
+ [v setButtonType:NSSwitchButton];
if (style & wxCHK_3STATE)
[v setAllowsMixedState:YES];
-
+
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
return c;
}
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
@end
-wxWidgetImplType* wxWidgetImpl::CreateChoice( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateChoice( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
wxMenu* menu,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
}
*/
NSWindow* theWindow = GetWXWindow();
-
+
NSModalSession session = [NSApp beginModalSessionForWindow:theWindow];
- while (IsModal())
+ while (IsModal())
{
wxMacAutoreleasePool autoreleasepool;
// we cannot break based on the return value, because nested
// unsafe
[NSApp runModalSession:session];
- // do some idle processing
- if (wxTheApp)
- wxTheApp->ProcessIdle();
+ // do some idle processing
+ if (wxTheApp)
+ wxTheApp->ProcessIdle();
}
[NSApp endModalSession:session];
/////////////////////////////////////////////////////////////////////////////
// Name: src/osx/cocoa/dirdlg.mm
-// Purpose: wxDirDialog
+// Purpose: wxDirDialog
// Author: Stefan Csomor
-// Modified by:
+// Modified by:
// Created: 2008-08-30
// RCS-ID: $Id: dirdlg.mm 40007 2006-07-05 13:10:46Z SC $
// Copyright: (c) Stefan Csomor
int wxDirDialog::ShowModal()
{
int result = wxID_CANCEL;
-
+
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
[oPanel setCanChooseDirectories:YES];
[oPanel setResolvesAliases:YES];
[oPanel setCanChooseFiles:NO];
-
+
wxCFStringRef cf( m_message );
[oPanel setMessage:cf.AsNSString()];
-
- if ( HasFlag(wxDD_NEW_DIR_BUTTON) )
+
+ if ( HasFlag(wxDD_NEW_DIR_BUTTON) )
[oPanel setCanCreateDirectories:YES];
wxCFStringRef dir( m_path );
-
+
m_path = wxEmptyString;
wxNonOwnedWindow* parentWindow = NULL;
int returnCode = -1;
-
- if (GetParent())
+
+ if (GetParent())
{
parentWindow = dynamic_cast<wxNonOwnedWindow*>(wxGetTopLevelParent(GetParent()));
}
fprintf(stderr, "No parent!\n");
}
-/*
+/*
if (parentWindow)
{
NSWindow* nativeParent = parentWindow->GetWXWindow();
- ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
- [oPanel beginSheetForDirectory:dir.AsNSString() file:nil types: nil
- modalForWindow: nativeParent modalDelegate: sheetDelegate
- didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
+ ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
+ [oPanel beginSheetForDirectory:dir.AsNSString() file:nil types: nil
+ modalForWindow: nativeParent modalDelegate: sheetDelegate
+ didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo: nil];
[sheetDelegate waitForSheetToFinish];
returnCode = [sheetDelegate code];
m_path = wxEmptyString;
m_fileNames.Clear();
-
+
wxNonOwnedWindow* parentWindow = NULL;
int returnCode = -1;
-
- if (GetParent())
+
+ if (GetParent())
{
parentWindow = dynamic_cast<wxNonOwnedWindow*>(wxGetTopLevelParent(GetParent()));
}
if (parentWindow)
{
NSWindow* nativeParent = parentWindow->GetWXWindow();
- ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
- [sPanel beginSheetForDirectory:dir.AsNSString() file:file.AsNSString()
- modalForWindow: nativeParent modalDelegate: sheetDelegate
- didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
+ ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
+ [sPanel beginSheetForDirectory:dir.AsNSString() file:file.AsNSString()
+ modalForWindow: nativeParent modalDelegate: sheetDelegate
+ didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo: nil];
[sheetDelegate waitForSheetToFinish];
returnCode = [sheetDelegate code];
{
returnCode = [sPanel runModalForDirectory:dir.AsNSString() file:file.AsNSString() ];
}
-
+
if (returnCode == NSOKButton )
{
panel = sPanel;
if (parentWindow)
{
NSWindow* nativeParent = parentWindow->GetWXWindow();
- ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
- [oPanel beginSheetForDirectory:dir.AsNSString() file:file.AsNSString()
- types: types modalForWindow: nativeParent
- modalDelegate: sheetDelegate
- didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
+ ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
+ [oPanel beginSheetForDirectory:dir.AsNSString() file:file.AsNSString()
+ types: types modalForWindow: nativeParent
+ modalDelegate: sheetDelegate
+ didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo: nil];
[sheetDelegate waitForSheetToFinish];
returnCode = [sheetDelegate code];
else
*/
{
- returnCode = [oPanel runModalForDirectory:dir.AsNSString()
+ returnCode = [oPanel runModalForDirectory:dir.AsNSString()
file:file.AsNSString() types:types];
}
if (returnCode == NSOKButton )
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
wxOSXGaugeCocoaImpl( wxWindowMac* peer, WXWidget w) : wxWidgetCocoaImpl( peer, w )
{
}
-
+
void SetMaximum(wxInt32 v)
{
SetDeterminateMode();
wxWidgetCocoaImpl::SetMaximum( v ) ;
}
-
+
void SetValue(wxInt32 v)
{
SetDeterminateMode();
wxWidgetCocoaImpl::SetValue( v ) ;
}
-
+
void PulseGauge()
{
if ( ![(wxNSProgressIndicator*)m_osxView isIndeterminate] )
};
-wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
wxInt32 value,
wxInt32 minimum,
wxInt32 maximum,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
{
if ( !m_glContext )
- return false;
+ return false;
[m_glContext setView: win.GetHandle() ];
[m_glContext update];
-
+
[m_glContext makeCurrentContext];
-
+
return true;
}
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
wxListWidgetCocoaImpl* impl;
}
-- (id)tableView:(NSTableView *)aTableView
- objectValueForTableColumn:(NSTableColumn *)aTableColumn
+- (id)tableView:(NSTableView *)aTableView
+ objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(NSInteger)rowIndex;
-- (void)tableView:(NSTableView *)aTableView
- setObjectValue:(id)value forTableColumn:(NSTableColumn *)aTableColumn
+- (void)tableView:(NSTableView *)aTableView
+ setObjectValue:(id)value forTableColumn:(NSTableColumn *)aTableColumn
row:(NSInteger)rowIndex;
-
+
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView;
- (void)setImplementation: (wxListWidgetCocoaImpl *) theImplementation;
class WXDLLIMPEXP_CORE wxCocoaTableColumn : public wxListWidgetColumn
{
public :
- wxCocoaTableColumn( wxNSTableColumn* column, bool editable )
+ wxCocoaTableColumn( wxNSTableColumn* column, bool editable )
: m_column( column ), m_editable(editable)
{
}
-
+
~wxCocoaTableColumn()
{
}
-
+
wxNSTableColumn* GetNSTableColumn() const { return m_column ; }
-
+
bool IsEditable() const { return m_editable; }
-
+
protected :
wxNSTableColumn* m_column;
bool m_editable;
{
public :
wxListWidgetCocoaImpl( wxWindowMac* peer, NSScrollView* view, wxNSTableView* tableview, wxNSTableDataSource* data );
-
+
~wxListWidgetCocoaImpl();
-
- virtual wxListWidgetColumn* InsertTextColumn( unsigned pos, const wxString& title, bool editable = false,
+
+ virtual wxListWidgetColumn* InsertTextColumn( unsigned pos, const wxString& title, bool editable = false,
wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) ;
- virtual wxListWidgetColumn* InsertCheckColumn( unsigned pos , const wxString& title, bool editable = false,
+ virtual wxListWidgetColumn* InsertCheckColumn( unsigned pos , const wxString& title, bool editable = false,
wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) ;
-
+
// add and remove
-
- virtual void ListDelete( unsigned int n ) ;
+
+ virtual void ListDelete( unsigned int n ) ;
virtual void ListInsert( unsigned int n ) ;
virtual void ListClear() ;
// selecting
virtual void ListDeselectAll();
-
+
virtual void ListSetSelection( unsigned int n, bool select, bool multi ) ;
virtual int ListGetSelection() const ;
-
+
virtual int ListGetSelections( wxArrayInt& aSelections ) const ;
-
+
virtual bool ListIsSelected( unsigned int n ) const ;
-
+
// display
virtual void ListScrollTo( unsigned int n ) ;
// accessing content
virtual unsigned int ListGetCount() const ;
-
+
int ListGetColumnType( int col )
{
return col;
virtual void controlDoubleAction(WXWidget slf, void* _cmd, void *sender);
protected :
wxNSTableView* m_tableView ;
-
+
wxNSTableDataSource* m_dataSource;
} ;
wxNSTableViewCellValue( id &v ) : value(v)
{
}
-
+
virtual ~wxNSTableViewCellValue() {}
virtual void Set( CFStringRef v )
{
value = [[(NSString*)v retain] autorelease];
}
- virtual void Set( const wxString& value )
+ virtual void Set( const wxString& value )
{
Set( (CFStringRef) wxCFStringRef( value ) );
}
- virtual void Set( int v )
+ virtual void Set( int v )
{
value = [NSNumber numberWithInt:v];
}
-
- virtual int GetIntValue() const
+
+ virtual int GetIntValue() const
{
if ( [value isKindOfClass:[NSNumber class]] )
return [ (NSNumber*) value intValue ];
-
+
return 0;
}
-
- virtual wxString GetStringValue() const
+
+ virtual wxString GetStringValue() const
{
if ( [value isKindOfClass:[NSString class]] )
return wxCFStringRef::AsString( (NSString*) value );
-
+
return wxEmptyString;
}
-
+
protected:
id& value;
} ;
return 0;
}
-- (id)tableView:(NSTableView *)aTableView
- objectValueForTableColumn:(NSTableColumn *)aTableColumn
+- (id)tableView:(NSTableView *)aTableView
+ objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(NSInteger)rowIndex
{
wxUnusedVar(aTableView);
return value;
}
-- (void)tableView:(NSTableView *)aTableView
- setObjectValue:(id)value forTableColumn:(NSTableColumn *)aTableColumn
+- (void)tableView:(NSTableView *)aTableView
+ setObjectValue:(id)value forTableColumn:(NSTableColumn *)aTableColumn
row:(NSInteger)rowIndex
{
wxUnusedVar(aTableView);
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
[m_dataSource release];
}
-unsigned int wxListWidgetCocoaImpl::ListGetCount() const
+unsigned int wxListWidgetCocoaImpl::ListGetCount() const
{
wxListBox* lb = dynamic_cast<wxListBox*> ( GetWXPeer() );
return lb->GetCount();
// columns
//
-wxListWidgetColumn* wxListWidgetCocoaImpl::InsertTextColumn( unsigned pos, const wxString& WXUNUSED(title), bool editable,
- wxAlignment WXUNUSED(just), int defaultWidth)
+wxListWidgetColumn* wxListWidgetCocoaImpl::InsertTextColumn( unsigned pos, const wxString& WXUNUSED(title), bool editable,
+ wxAlignment WXUNUSED(just), int defaultWidth)
{
wxNSTableColumn* col1 = [[wxNSTableColumn alloc] init];
[col1 setEditable:editable];
-
+
unsigned formerColCount = [m_tableView numberOfColumns];
-
+
// there's apparently no way to insert at a specific position
[m_tableView addTableColumn:col1 ];
if ( pos < formerColCount )
[m_tableView moveColumn:formerColCount toColumn:pos];
-
+
if ( defaultWidth >= 0 )
{
[col1 setMaxWidth:defaultWidth];
}
else
{
- [col1 setMaxWidth:1000];
+ [col1 setMaxWidth:1000];
[col1 setMinWidth:10];
// temporary hack, because I cannot get the automatic column resizing
// to work properly
return wxcol;
}
-wxListWidgetColumn* wxListWidgetCocoaImpl::InsertCheckColumn( unsigned pos , const wxString& WXUNUSED(title), bool editable,
- wxAlignment WXUNUSED(just), int defaultWidth )
+wxListWidgetColumn* wxListWidgetCocoaImpl::InsertCheckColumn( unsigned pos , const wxString& WXUNUSED(title), bool editable,
+ wxAlignment WXUNUSED(just), int defaultWidth )
{
wxNSTableColumn* col1 = [[wxNSTableColumn alloc] init];
[col1 setEditable:editable];
-
+
// set your custom cell & set it up
NSButtonCell* checkbox = [[NSButtonCell alloc] init];
[checkbox setTitle:@""];
[checkbox setButtonType:NSSwitchButton];
[col1 setDataCell:checkbox] ;
[checkbox release];
-
+
unsigned formerColCount = [m_tableView numberOfColumns];
-
+
// there's apparently no way to insert at a specific position
[m_tableView addTableColumn:col1 ];
if ( pos < formerColCount )
[m_tableView moveColumn:formerColCount toColumn:pos];
-
+
if ( defaultWidth >= 0 )
{
[col1 setMaxWidth:defaultWidth];
[col1 setMinWidth:defaultWidth];
[col1 setWidth:defaultWidth];
}
-
+
[col1 setResizingMask: NSTableColumnNoResizing];
wxCocoaTableColumn* wxcol = new wxCocoaTableColumn( col1, editable );
[col1 setColumn:wxcol];
// inserting / removing lines
//
-void wxListWidgetCocoaImpl::ListInsert( unsigned int WXUNUSED(n) )
+void wxListWidgetCocoaImpl::ListInsert( unsigned int WXUNUSED(n) )
{
[m_tableView reloadData];
}
-void wxListWidgetCocoaImpl::ListDelete( unsigned int WXUNUSED(n) )
+void wxListWidgetCocoaImpl::ListDelete( unsigned int WXUNUSED(n) )
{
[m_tableView reloadData];
}
-void wxListWidgetCocoaImpl::ListClear()
+void wxListWidgetCocoaImpl::ListClear()
{
[m_tableView reloadData];
}
[m_tableView deselectAll:nil];
}
-void wxListWidgetCocoaImpl::ListSetSelection( unsigned int n, bool select, bool multi )
+void wxListWidgetCocoaImpl::ListSetSelection( unsigned int n, bool select, bool multi )
{
// TODO
if ( select )
}
-int wxListWidgetCocoaImpl::ListGetSelection() const
+int wxListWidgetCocoaImpl::ListGetSelection() const
{
return [m_tableView selectedRow];
}
-int wxListWidgetCocoaImpl::ListGetSelections( wxArrayInt& aSelections ) const
+int wxListWidgetCocoaImpl::ListGetSelections( wxArrayInt& aSelections ) const
{
aSelections.Empty();
return aSelections.Count();
}
-bool wxListWidgetCocoaImpl::ListIsSelected( unsigned int n ) const
+bool wxListWidgetCocoaImpl::ListIsSelected( unsigned int n ) const
{
return [m_tableView isRowSelected:n];
}
// display
-void wxListWidgetCocoaImpl::ListScrollTo( unsigned int n )
+void wxListWidgetCocoaImpl::ListScrollTo( unsigned int n )
{
[m_tableView scrollRowToVisible:n];
}
-
-void wxListWidgetCocoaImpl::UpdateLine( unsigned int WXUNUSED(n), wxListWidgetColumn* WXUNUSED(col) )
+
+void wxListWidgetCocoaImpl::UpdateLine( unsigned int WXUNUSED(n), wxListWidgetColumn* WXUNUSED(col) )
{
// TODO optimize
[m_tableView reloadData];
}
-void wxListWidgetCocoaImpl::UpdateLineToEnd( unsigned int WXUNUSED(n))
+void wxListWidgetCocoaImpl::UpdateLineToEnd( unsigned int WXUNUSED(n))
{
// TODO optimize
[m_tableView reloadData];
int sel = [m_tableView clickedRow];
if ((sel < 0) || (sel > (int) list->GetCount())) // OS X can select an item below the last item (why?)
return;
-
+
list->HandleLineEvent( sel, false );
}
// accessing content
-wxWidgetImplType* wxWidgetImpl::CreateListBox( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
- const wxPoint& pos,
+wxWidgetImplType* wxWidgetImpl::CreateListBox( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
NSScrollView* scrollview = [[NSScrollView alloc] initWithFrame:r];
-
+
// use same scroll flags logic as msw
-
+
[scrollview setHasVerticalScroller:YES];
-
+
if ( style & wxLB_HSCROLL )
[scrollview setHasHorizontalScroller:YES];
-
+
[scrollview setAutohidesScrollers: ((style & wxLB_ALWAYS_SB) ? NO : YES)];
// setting up the true table
-
+
wxNSTableView* tableview = [[wxNSTableView alloc] init];
// only one multi-select mode available
if ( (style & wxLB_EXTENDED) || (style & wxLB_MULTIPLE) )
[tableview setAllowsMultipleSelection:YES];
-
+
// simple listboxes have no header row
[tableview setHeaderView:nil];
-
+
if ( style & wxLB_HSCROLL )
[tableview setColumnAutoresizingStyle:NSTableViewNoColumnAutoresizing];
else
[tableview setColumnAutoresizingStyle:NSTableViewLastColumnOnlyAutoresizingStyle];
-
+
wxNSTableDataSource* ds = [[ wxNSTableDataSource alloc] init];
[tableview setDataSource:ds];
[scrollview setDocumentView:tableview];
@end
-@interface NSApplication(MissingAppleMenuCall)
-- (void)setAppleMenu:(NSMenu *)menu;
-@end
+@interface NSApplication(MissingAppleMenuCall)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
-class wxMenuCocoaImpl : public wxMenuImpl
+class wxMenuCocoaImpl : public wxMenuImpl
{
public :
wxMenuCocoaImpl( wxMenu* peer , wxNSMenu* menu) : wxMenuImpl(peer), m_osxMenu(menu)
CFRetain(m_osxMenu);
[m_osxMenu release];
}
-
+
virtual ~wxMenuCocoaImpl();
-
- virtual void InsertOrAppend(wxMenuItem *pItem, size_t pos)
+
+ virtual void InsertOrAppend(wxMenuItem *pItem, size_t pos)
{
if ( pos == (size_t) -1 )
[m_osxMenu addItem:(NSMenuItem*) pItem->GetPeer()->GetHMenuItem() ];
else
[m_osxMenu insertItem:(NSMenuItem*) pItem->GetPeer()->GetHMenuItem() atIndex:pos];
}
-
- virtual void Remove( wxMenuItem *pItem )
+
+ virtual void Remove( wxMenuItem *pItem )
{
[m_osxMenu removeItem:(NSMenuItem*) pItem->GetPeer()->GetHMenuItem()];
}
-
+
virtual void MakeRoot()
{
[NSApp setMainMenu:m_osxMenu];
virtual void Enable( bool WXUNUSED(enable) )
{
}
-
+
virtual void SetTitle( const wxString& text )
{
wxCFStringRef cfText(text);
}
}
-class wxMenuItemCocoaImpl : public wxMenuItemImpl
+class wxMenuItemCocoaImpl : public wxMenuItemImpl
{
public :
wxMenuItemCocoaImpl( wxMenuItem* peer, NSMenuItem* item ) : wxMenuItemImpl(peer), m_osxMenuItem(item)
if ( ![m_osxMenuItem isSeparatorItem] )
[(wxNSMenuItem*)m_osxMenuItem setImplementation:this];
}
-
+
~wxMenuItemCocoaImpl();
-
- void SetBitmap( const wxBitmap& bitmap )
+
+ void SetBitmap( const wxBitmap& bitmap )
{
[m_osxMenuItem setImage:bitmap.GetNSImage()];
}
-
- void Enable( bool enable )
+
+ void Enable( bool enable )
{
[m_osxMenuItem setEnabled:enable];
}
-
- void Check( bool check )
+
+ void Check( bool check )
{
[m_osxMenuItem setState:( check ? NSOnState : NSOffState) ];
}
-
+
void Hide( bool hide )
{
// NB: setHidden is new as of 10.5 so we should not call it below there
else
wxLogDebug("wxMenuItemCocoaImpl::Hide not yet supported under OS X < 10.5");
}
-
- void SetLabel( const wxString& text, wxAcceleratorEntry *entry )
+
+ void SetLabel( const wxString& text, wxAcceleratorEntry *entry )
{
wxCFStringRef cfText(text);
[m_osxMenuItem setTitle:cfText.AsNSString()];
-
+
if ( entry )
wxMacCocoaMenuItemSetAccelerator( m_osxMenuItem, entry );
}
-
+
void * GetHMenuItem() { return m_osxMenuItem; }
protected :
{
wxMenuItemImpl* c = NULL;
NSMenuItem* item = nil;
-
+
if ( kind == wxITEM_SEPARATOR )
{
item = [[NSMenuItem separatorItem] retain];
else
{
NSAlert* alert = [[NSAlert alloc] init];
-
+
wxCFStringRef cfNoString( GetNoLabel(), GetFont().GetEncoding() );
wxCFStringRef cfYesString( GetYesLabel(), GetFont().GetEncoding() );
wxCFStringRef cfOKString( GetOKLabel(), GetFont().GetEncoding() );
[alert setMessageText:cfTitle.AsNSString()];
[alert setInformativeText:cfText.AsNSString()];
-
+
int buttonId[3] = { 0, 0, 0 };
int buttonCount = 0;
wxNonOwnedWindow* parentWindow = NULL;
int button = -1;
-
- if (GetParent())
+
+ if (GetParent())
{
parentWindow = dynamic_cast<wxNonOwnedWindow*>(wxGetTopLevelParent(GetParent()));
}
-
+
/*
if (parentWindow)
{
NSWindow* nativeParent = parentWindow->GetWXWindow();
- ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
- [alert beginSheetModalForWindow: nativeParent modalDelegate: sheetDelegate
- didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
+ ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
+ [alert beginSheetModalForWindow: nativeParent modalDelegate: sheetDelegate
+ didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo: nil];
[sheetDelegate waitForSheetToFinish];
button = [sheetDelegate code];
button = [alert runModal];
}
[alert release];
-
+
if ( button < NSAlertFirstButtonReturn )
resultbutton = wxID_CANCEL;
else
bool shouldHandleSelector(SEL selector)
{
- if (selector == @selector(noop:)
+ if (selector == @selector(noop:)
|| selector == @selector(complete:)
|| selector == @selector(deleteBackward:)
|| selector == @selector(deleteForward:)
|| selector == @selector(scrollToBeginningOfDocument:)
|| selector == @selector(scrollToEndOfDocument:))
return false;
-
+
return true;
}
- (void)doCommandBySelector:(SEL)selector
{
- if (shouldHandleSelector(selector) &&
+ if (shouldHandleSelector(selector) &&
!(selector == @selector(cancel:) || selector == @selector(cancelOperation:)) )
[super doCommandBySelector:selector];
}
- (void)noResponderFor: (SEL) selector;
@end
-@implementation wxNSPanel
+@implementation wxNSPanel
- (void)setImplementation: (wxNonOwnedWindowCocoaImpl *) theImplementation
{
if ( wxpeer )
{
wxpeer->HandleActivated(0, false);
- // Needed for popup window since the firstResponder
- // (focus in wx) doesn't change when this
+ // Needed for popup window since the firstResponder
+ // (focus in wx) doesn't change when this
// TLW becomes inactive.
wxFocusEvent event( wxEVT_KILL_FOCUS, wxpeer->GetId());
event.SetEventObject(wxpeer);
IMPLEMENT_DYNAMIC_CLASS( wxNonOwnedWindowCocoaImpl , wxNonOwnedWindowImpl )
-wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl( wxNonOwnedWindow* nonownedwnd) :
+wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl( wxNonOwnedWindow* nonownedwnd) :
wxNonOwnedWindowImpl(nonownedwnd)
{
m_macWindow = NULL;
m_macFullScreenData = NULL;
}
-
-wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl()
+
+wxNonOwnedWindowCocoaImpl::wxNonOwnedWindowCocoaImpl()
{
m_macWindow = NULL;
m_macFullScreenData = NULL;
}
-
+
wxNonOwnedWindowCocoaImpl::~wxNonOwnedWindowCocoaImpl()
{
[m_macWindow setImplementation:nil];
long style, long extraStyle, const wxString& WXUNUSED(name) )
{
static wxNonOwnedWindowController* controller = NULL;
-
+
if ( !controller )
controller =[[wxNonOwnedWindowController alloc] init];
int windowstyle = NSBorderlessWindowMask;
-
- if ( style & wxFRAME_TOOL_WINDOW || ( style & wxPOPUP_WINDOW ) ||
+
+ if ( style & wxFRAME_TOOL_WINDOW || ( style & wxPOPUP_WINDOW ) ||
GetWXPeer()->GetExtraStyle() & wxTOPLEVEL_EX_DIALOG )
{
m_macWindow = [wxNSPanel alloc];
}
else
m_macWindow = [wxNSWindow alloc];
-
+
CGWindowLevel level = kCGNormalWindowLevel;
-
+
if ( style & wxFRAME_TOOL_WINDOW )
{
windowstyle |= NSUtilityWindowMask;
if ( ( style & wxSTAY_ON_TOP ) )
level = kCGUtilityWindowLevel;
-
+
NSRect r = wxToNSRect( NULL, wxRect( pos, size) );
-
+
[m_macWindow setImplementation:this];
-
+
[m_macWindow initWithContentRect:r
styleMask:windowstyle
backing:NSBackingStoreBuffered
- defer:NO
+ defer:NO
];
-
+
[m_macWindow setLevel:level];
[m_macWindow setDelegate:controller];
-
+
[m_macWindow setAcceptsMouseMovedEvents: YES];
}
{
[m_macWindow orderWindow:NSWindowAbove relativeTo:0];
}
-
+
void wxNonOwnedWindowCocoaImpl::Lower()
{
[m_macWindow orderWindow:NSWindowBelow relativeTo:0];
[m_macWindow makeKeyAndOrderFront:nil];
[[m_macWindow contentView] setNeedsDisplay:YES];
}
- else
+ else
[m_macWindow orderOut:nil];
return true;
}
-
+
bool wxNonOwnedWindowCocoaImpl::ShowWithEffect(bool show, wxShowEffect WXUNUSED(effect), unsigned WXUNUSED(timeout))
{
return Show(show);
else if ( !metal && (windowStyle & NSTexturedBackgroundWindowMask ) )
{
wxFAIL_MSG( wxT("Metal Style cannot be changed after creation") );
- }
+ }
}
}
-
+
bool wxNonOwnedWindowCocoaImpl::SetBackgroundStyle(wxBackgroundStyle WXUNUSED(style))
{
return true;
}
-
+
bool wxNonOwnedWindowCocoaImpl::CanSetTransparent()
{
return true;
width = (int)rect.size.width;
height = (int)rect.size.height;
}
-
+
bool wxNonOwnedWindowCocoaImpl::SetShape(const wxRegion& WXUNUSED(region))
{
return false;
}
-void wxNonOwnedWindowCocoaImpl::SetTitle( const wxString& title, wxFontEncoding encoding )
+void wxNonOwnedWindowCocoaImpl::SetTitle( const wxString& title, wxFontEncoding encoding )
{
[m_macWindow setTitle:wxCFStringRef( title , encoding ).AsNSString()];
}
-
+
bool wxNonOwnedWindowCocoaImpl::IsMaximized() const
{
return [m_macWindow isZoomed];
}
-
+
bool wxNonOwnedWindowCocoaImpl::IsIconized() const
{
return [m_macWindow isMiniaturized];
}
-
+
void wxNonOwnedWindowCocoaImpl::Iconize( bool iconize )
{
if ( iconize )
else
[m_macWindow deminiaturize:nil];
}
-
+
void wxNonOwnedWindowCocoaImpl::Maximize(bool WXUNUSED(maximize))
{
[m_macWindow zoom:nil];
}
-
+
// http://cocoadevcentral.com/articles/000028.php
{
return m_macFullScreenData != NULL ;
}
-
+
bool wxNonOwnedWindowCocoaImpl::ShowFullScreen(bool show, long WXUNUSED(style))
{
if ( show )
delete data ;
m_macFullScreenData = NULL ;
}
-
+
return true;
}
nspt = [[m_macWindow contentView] convertPoint:nspt fromView:nil];
p = wxFromNSPoint([m_macWindow contentView], nspt);
if ( x )
- *x = p.x;
+ *x = p.x;
if ( y )
*y = p.y;
}
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
wxCocoaTabView( wxWindowMac* peer , WXWidget w ) : wxWidgetCocoaImpl(peer, w)
{
}
-
- void GetContentArea( int &left , int &top , int &width , int &height ) const
+
+ void GetContentArea( int &left , int &top , int &width , int &height ) const
{
wxNSTabView* slf = (wxNSTabView*) m_osxView;
NSRect r = [slf contentRect];
width = (int)r.size.width;
height = (int)r.size.height;
}
-
- void SetValue( wxInt32 value )
+
+ void SetValue( wxInt32 value )
{
wxNSTabView* slf = (wxNSTabView*) m_osxView;
// avoid 'changed' events when setting the tab programmatically
[slf selectTabViewItemAtIndex:(value-1)];
[slf setDelegate:controller];
}
-
+
wxInt32 GetValue() const
{
wxNSTabView* slf = (wxNSTabView*) m_osxView;
else
return [slf indexOfTabViewItem:selectedItem]+1;
}
-
+
void SetMaximum( wxInt32 maximum )
{
wxNSTabView* slf = (wxNSTabView*) m_osxView;
// avoid 'changed' events when setting the tab programmatically
wxTabViewController* controller = [slf delegate];
[slf setDelegate:nil];
-
+
if ( maximum > cocoacount )
{
for ( int i = cocoacount ; i < maximum ; ++i )
void SetupTabs( const wxNotebook& notebook)
{
int pcount = notebook.GetPageCount();
-
+
SetMaximum( pcount );
-
+
for ( int i = 0 ; i < pcount ; ++i )
{
wxNotebookPage* page = notebook.GetPage(i);
verify_noerr( err );
#endif
*/
-wxWidgetImplType* wxWidgetImpl::CreateTabView( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
- const wxPoint& pos,
+wxWidgetImplType* wxWidgetImpl::CreateTabView( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
static wxTabViewController* controller = NULL;
controller =[[wxTabViewController alloc] init];
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
-
+
NSTabViewType tabstyle = NSTopTabsBezelBorder;
if ( style & wxBK_LEFT )
tabstyle = NSLeftTabsBezelBorder;
tabstyle = NSRightTabsBezelBorder;
else if ( style & wxBK_BOTTOM )
tabstyle = NSBottomTabsBezelBorder;
-
+
wxNSTabView* v = [[wxNSTabView alloc] initWithFrame:r];
[v setTabViewType:tabstyle];
wxWidgetCocoaImpl* c = new wxCocoaTabView( wxpeer, v );
m_printDialogData.GetPrintData().ConvertToNative();
int result = wxID_CANCEL;
-
+
NSPrintPanel* panel = [NSPrintPanel printPanel];
NSPrintInfo* printInfo = ((wxOSXCocoaPrintData*)m_printDialogData.GetPrintData().GetNativeData())->GetNSPrintInfo();
if ( (NSInteger)[panel runModalWithPrintInfo:printInfo] == NSOKButton )
m_pageSetupData.GetPrintData().ConvertFromNative();
m_pageSetupData.SetPaperSize( m_pageSetupData.GetPrintData().GetPaperSize() );
}
-
+
return result;
}
// Name: src/osx/cocoa/radiobut.mm
// Purpose: wxRadioButton
// Author: Stefan Csomor
-// Modified by:
+// Modified by:
// Created: ??/??/98
// RCS-ID: $Id: radiobut.cpp 54129 2008-06-11 19:30:52Z SC $
// Copyright: (c) AUTHOR
#include "wx/radiobut.h"
#include "wx/osx/private.h"
-wxWidgetImplType* wxWidgetImpl::CreateRadioButton( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateRadioButton( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(label),
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
- long WXUNUSED(extraStyle))
+ long WXUNUSED(style),
+ long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
- [v setButtonType:NSRadioButton];
-
+ [v setButtonType:NSRadioButton];
+
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
return c;
}
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods(self);
{
m_maximum = 1;
}
-
+
void SetMaximum(wxInt32 v)
{
m_maximum = (v == 0) ? 1 : v;
}
-
- void SetScrollThumb( wxInt32 value, wxInt32 thumbSize )
+
+ void SetScrollThumb( wxInt32 value, wxInt32 thumbSize )
{
double v = ((double) value)/m_maximum;
double t = ((double) thumbSize)/(m_maximum+thumbSize);
[(wxNSScroller*) m_osxView setKnobProportion:t];
#endif
}
-
+
virtual wxInt32 GetValue() const
{
return wxRound([(wxNSScroller*) m_osxView floatValue] * m_maximum);
}
-
+
virtual wxInt32 GetMaximum() const
{
return m_maximum;
wxInt32 m_maximum;
};
-// we will have a mouseDown, then in the native
+// we will have a mouseDown, then in the native
// implementation of mouseDown the tracking code
// is calling clickedAction, therefore we wire this
-// to thumbtrack and only after super mouseDown
+// to thumbtrack and only after super mouseDown
// returns we will call the thumbrelease
void wxOSXScrollBarCocoaImpl::controlAction( WXWidget WXUNUSED(slf), void *WXUNUSED(_cmd), void *WXUNUSED(sender))
{
wxEventType scrollEvent = wxEVT_NULL;
- switch ([(NSScroller*)m_osxView hitPart])
+ switch ([(NSScroller*)m_osxView hitPart])
{
case NSScrollerIncrementLine:
scrollEvent = wxEVT_SCROLL_LINEDOWN;
void wxOSXScrollBarCocoaImpl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd)
{
wxWidgetCocoaImpl::mouseEvent(event, slf, _cmd);
-
+
// send a release event in case we've been tracking the thumb
if ( strcmp( sel_getName((SEL) _cmd) , "mouseDown:") == 0 )
{
}
}
-wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
- const wxPoint& pos,
+wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
- // the creation rect defines the orientation
+ // the creation rect defines the orientation
NSRect createRect = ( style & wxSB_HORIZONTAL ) ? NSMakeRect(r.origin.x, r.origin.y , 17, 16) :
NSMakeRect(r.origin.x, r.origin.y , 16, 17);
wxNSScroller* v = [[wxNSScroller alloc] initWithFrame:createRect];
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods(self);
wxWidgetCocoaImpl(peer, w)
{
}
-
+
~wxSliderCocoaImpl()
{
}
virtual void mouseEvent(WX_NSEvent event, WXWidget slf, void* _cmd);
};
-// we will have a mouseDown, then in the native
+// we will have a mouseDown, then in the native
// implementation of mouseDown the tracking code
// is calling clickedAction, therefore we wire this
-// to thumbtrack and only after super mouseDown
+// to thumbtrack and only after super mouseDown
// returns we will call the thumbrelease
void wxSliderCocoaImpl::controlAction( WXWidget WXUNUSED(slf), void *WXUNUSED(_cmd), void *WXUNUSED(sender))
void wxSliderCocoaImpl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd)
{
wxWidgetCocoaImpl::mouseEvent(event, slf, _cmd);
-
+
if ( strcmp( sel_getName((SEL) _cmd) , "mouseDown:") == 0 )
{
wxWindow* wxpeer = (wxWindow*) GetWXPeer();
-wxWidgetImplType* wxWidgetImpl::CreateSlider( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateSlider( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
wxInt32 value,
wxInt32 minimum,
wxInt32 maximum,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
// it to a UInt16
while (tickMarks > 20)
tickMarks /= 5;
-
+
[v setNumberOfTickMarks:tickMarks];
[v setTickMarkPosition:NSTickMarkBelow];
}
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods(self);
{
m_formerValue = 0;
}
-
+
~wxSpinButtonCocoaImpl()
{
}
void wxSpinButtonCocoaImpl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd)
{
-
+
// send a release event in case we've been tracking the thumb
if ( strcmp( sel_getName((SEL) _cmd) , "mouseDown:") == 0 )
{
wxWindow* wxpeer = (wxWindow*) GetWXPeer();
if ( wxpeer )
{
- // because wx expects to be able to veto
+ // because wx expects to be able to veto
// a change we must revert the value change
// and expose it
int currentValue = [(NSStepper*)m_osxView intValue];
[(NSStepper*)m_osxView setIntValue:m_formerValue];
int inc = currentValue-m_formerValue;
-
+
// adjust for wrap arounds
if ( inc > 1 )
inc = -1;
else if (inc < -1 )
inc = 1;
-
+
if ( inc == 1 )
wxpeer->TriggerScrollEvent(wxEVT_SCROLL_LINEUP);
else if ( inc == -1 )
}
}
-wxWidgetImplType* wxWidgetImpl::CreateSpinButton( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateSpinButton( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
wxInt32 value,
wxInt32 minimum,
wxInt32 maximum,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
[v setMinValue: minimum];
[v setMaxValue: maximum];
[v setIntValue: value];
-
+
if ( style & wxSP_WRAP )
[v setValueWraps:YES];
-
+
wxWidgetCocoaImpl* c = new wxSpinButtonCocoaImpl( wxpeer, v );
return c;
}
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
[m_searchFieldCell setSearchButtonCell:nil];
[m_searchField setNeedsDisplay:YES];
}
-
+
virtual bool IsSearchButtonVisible() const
{
return [m_searchFieldCell searchButtonCell] != nil;
[m_searchFieldCell setCancelButtonCell:nil];
[m_searchField setNeedsDisplay:YES];
}
-
+
virtual bool IsCancelButtonVisible() const
{
return [m_searchFieldCell cancelButtonCell] != nil;
[m_searchFieldCell setPlaceholderString:
wxCFStringRef( text , m_wxPeer->GetFont().GetEncoding() ).AsNSString()];
}
-
+
virtual bool SetFocus()
{
return wxNSTextFieldControl::SetFocus();
{
}
-wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxString& str,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
@end
-namespace
+namespace
{
class wxStaticBoxCocoaImpl : public wxWidgetCocoaImpl
{
: wxWidgetCocoaImpl(wxpeer, v)
{
}
-
+
virtual void SetLabel( const wxString& title, wxFontEncoding encoding )
{
if (title.empty())
[GetNSBox() setTitlePosition:NSNoTitle];
else
[GetNSBox() setTitlePosition:NSAtTop];
-
+
wxWidgetCocoaImpl::SetLabel(title, encoding);
}
-
+
private:
NSBox *GetNSBox() const
{
wxASSERT( [m_osxView isKindOfClass:[NSBox class]] );
-
+
return static_cast<NSBox*>(m_osxView);
}
};
} // anonymous namespace
-wxWidgetImplType* wxWidgetImpl::CreateGroupBox( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateGroupBox( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(label),
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
#include "wx/osx/private.h"
-wxWidgetImplType* wxWidgetImpl::CreateStaticLine( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
- const wxPoint& pos,
+wxWidgetImplType* wxWidgetImpl::CreateStaticLine( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
- long WXUNUSED(extraStyle))
+ long WXUNUSED(style),
+ long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSBox* v = [[wxNSBox alloc] initWithFrame:r];
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
- {
+ if (!initialized)
+ {
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
}
{
m_lineBreak = lineBreak;
}
-
- virtual void SetLabel(const wxString& title, wxFontEncoding encoding)
- {
+
+ virtual void SetLabel(const wxString& title, wxFontEncoding encoding)
+ {
wxNSStaticTextView* v = (wxNSStaticTextView*)GetWXWidget();
wxWindow* wxpeer = GetWXPeer();
NSCell* cell = [v cell];
[paragraphStyle setAlignment: NSCenterTextAlignment];
else if (style & wxALIGN_RIGHT)
[paragraphStyle setAlignment: NSRightTextAlignment];
-
+
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:paragraphStyle, NSParagraphStyleAttributeName, nil];
NSAttributedString *attrstring = [[NSAttributedString alloc] initWithString:text.AsNSString() attributes:dict];
[cell setAttributedStringValue:attrstring];
[v setSelectable: NO];
[v setBezeled:NO];
[v setBordered:NO];
-
+
NSLineBreakMode linebreak = NSLineBreakByWordWrapping;
if ( ((wxStaticText*)wxpeer)->IsEllipsized() )
{
else if (style & wxST_ELLIPSIZE_START )
linebreak = NSLineBreakByTruncatingHead;
}
- else
+ else
{
[[v cell] setWraps:YES];
}
-
+
wxWidgetCocoaImpl* c = new wxStaticTextCocoaImpl( wxpeer, v, linebreak );
return c;
}
inline wxTaskBarIcon* GetTaskBarIcon() { return m_taskBarIcon; }
wxMenu * CreatePopupMenu()
{ return m_taskBarIcon->CreatePopupMenu(); }
-
+
wxDECLARE_NO_COPY_CLASS(wxTaskBarIconImpl);
-
+
protected:
wxTaskBarIcon *m_taskBarIcon;
wxTaskBarIconWindow *m_iconWindow;
// Operations
bool wxTaskBarIcon::IsIconInstalled() const
-{
+{
return false;
}
#include "wx/osx/private.h"
#include "wx/osx/cocoa/private/textimpl.h"
-@interface NSView(EditableView)
+@interface NSView(EditableView)
- (BOOL)isEditable;
- (void)setEditable:(BOOL)flag;
@end
NSView* m_textView;
} ;
-@implementation wxNSSecureTextField
+@implementation wxNSSecureTextField
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
- {
+ if (!initialized)
+ {
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
}
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
if ( impl )
{
wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
- if ( wxpeer && wxpeer->GetWindowStyle() & wxTE_PROCESS_ENTER )
+ if ( wxpeer && wxpeer->GetWindowStyle() & wxTE_PROCESS_ENTER )
{
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, wxpeer->GetId());
event.SetEventObject( wxpeer );
}
}
}
-
+
return NO;
}
{
wxNSTextScrollView* sv = (wxNSTextScrollView*) w;
m_scrollView = sv;
-
+
[m_scrollView setHasVerticalScroller:YES];
[m_scrollView setHasHorizontalScroller:NO];
[m_scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
NSSize contentSize = [m_scrollView contentSize];
-
+
wxNSTextView* tv = [[wxNSTextView alloc] initWithFrame: NSMakeRect(0, 0,
contentSize.width, contentSize.height)];
m_textView = tv;
[tv setVerticallyResizable:YES];
[tv setHorizontallyResizable:NO];
[tv setAutoresizingMask:NSViewWidthSizable];
-
+
[m_scrollView setDocumentView: tv];
[tv setDelegate: w];
-
- InstallEventHandler(tv);
+
+ InstallEventHandler(tv);
}
wxNSTextViewControl::~wxNSTextViewControl()
[m_textView setDelegate: nil];
}
-wxString wxNSTextViewControl::GetStringValue() const
+wxString wxNSTextViewControl::GetStringValue() const
{
- if (m_textView)
+ if (m_textView)
{
wxString result = wxCFStringRef::AsString([m_textView string], m_wxPeer->GetFont().GetEncoding());
wxMacConvertNewlines13To10( &result ) ;
}
return wxEmptyString;
}
-void wxNSTextViewControl::SetStringValue( const wxString &str)
+void wxNSTextViewControl::SetStringValue( const wxString &str)
{
wxString st = str;
wxMacConvertNewlines10To13( &st );
[m_textView setString: wxCFStringRef( st , m_wxPeer->GetFont().GetEncoding() ).AsNSString()];
}
-void wxNSTextViewControl::Copy()
+void wxNSTextViewControl::Copy()
{
if (m_textView)
[m_textView copy:nil];
}
-void wxNSTextViewControl::Cut()
+void wxNSTextViewControl::Cut()
{
if (m_textView)
[m_textView cut:nil];
}
-void wxNSTextViewControl::Paste()
+void wxNSTextViewControl::Paste()
{
if (m_textView)
[m_textView paste:nil];
}
-bool wxNSTextViewControl::CanPaste() const
-{
+bool wxNSTextViewControl::CanPaste() const
+{
return true;
}
-void wxNSTextViewControl::SetEditable(bool editable)
+void wxNSTextViewControl::SetEditable(bool editable)
{
if (m_textView)
[m_textView setEditable: editable];
}
-void wxNSTextViewControl::GetSelection( long* from, long* to) const
+void wxNSTextViewControl::GetSelection( long* from, long* to) const
{
if (m_textView)
{
[m_textView scrollRangeToVisible:selrange];
}
-void wxNSTextViewControl::WriteText(const wxString& str)
+void wxNSTextViewControl::WriteText(const wxString& str)
{
wxString st = str;
wxMacConvertNewlines10To13( &st );
wxMacEditHelper helper(m_textView);
-
+
[m_textView insertText:wxCFStringRef( st , m_wxPeer->GetFont().GetEncoding() ).AsNSString()];
}
[m_textField setDelegate: nil];
}
-wxString wxNSTextFieldControl::GetStringValue() const
+wxString wxNSTextFieldControl::GetStringValue() const
{
return wxCFStringRef::AsString([m_textField stringValue], m_wxPeer->GetFont().GetEncoding());
}
-void wxNSTextFieldControl::SetStringValue( const wxString &str)
+void wxNSTextFieldControl::SetStringValue( const wxString &str)
{
wxMacEditHelper helper(m_textField);
[m_textField setStringValue: wxCFStringRef( str , m_wxPeer->GetFont().GetEncoding() ).AsNSString()];
}
-void wxNSTextFieldControl::Copy()
+void wxNSTextFieldControl::Copy()
{
NSText* editor = [m_textField currentEditor];
if ( editor )
}
}
-void wxNSTextFieldControl::Cut()
+void wxNSTextFieldControl::Cut()
{
NSText* editor = [m_textField currentEditor];
if ( editor )
}
}
-void wxNSTextFieldControl::Paste()
+void wxNSTextFieldControl::Paste()
{
NSText* editor = [m_textField currentEditor];
if ( editor )
}
}
-bool wxNSTextFieldControl::CanPaste() const
-{
+bool wxNSTextFieldControl::CanPaste() const
+{
return true;
}
-void wxNSTextFieldControl::SetEditable(bool editable)
+void wxNSTextFieldControl::SetEditable(bool editable)
{
[m_textField setEditable:editable];
}
-void wxNSTextFieldControl::GetSelection( long* from, long* to) const
+void wxNSTextFieldControl::GetSelection( long* from, long* to) const
{
NSText* editor = [m_textField currentEditor];
if ( editor )
}
}
-void wxNSTextFieldControl::WriteText(const wxString& str)
+void wxNSTextFieldControl::WriteText(const wxString& str)
{
NSText* editor = [m_textField currentEditor];
if ( editor )
}
}
-void wxNSTextFieldControl::controlAction(WXWidget WXUNUSED(slf),
+void wxNSTextFieldControl::controlAction(WXWidget WXUNUSED(slf),
void* WXUNUSED(_cmd), void *WXUNUSED(sender))
{
wxWindow* wxpeer = (wxWindow*) GetWXPeer();
- if ( wxpeer && (wxpeer->GetWindowStyle() & wxTE_PROCESS_ENTER) )
+ if ( wxpeer && (wxpeer->GetWindowStyle() & wxTE_PROCESS_ENTER) )
{
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, wxpeer->GetId());
event.SetEventObject( wxpeer );
//
//
-wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxString& str,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxWidgetCocoaImpl* c = NULL;
-
+
if ( style & wxTE_MULTILINE || style & wxTE_RICH || style & wxTE_RICH2 )
{
wxNSTextScrollView* v = nil;
c = new wxNSTextViewControl( wxpeer, v );
static_cast<wxNSTextViewControl*>(c)->SetStringValue(str);
}
- else
+ else
{
NSTextField* v = nil;
if ( style & wxTE_PASSWORD )
v = [[wxNSSecureTextField alloc] initWithFrame:r];
else
v = [[wxNSTextField alloc] initWithFrame:r];
-
+
if ( style & wxNO_BORDER )
{
// FIXME: How can we remove the native control's border?
// setBordered is separate from the text ctrl's border.
}
-
+
[v setBezeled:NO];
[v setBordered:NO];
-
+
c = new wxNSTextFieldControl( wxpeer, v );
static_cast<wxNSTextFieldControl*>(c)->SetStringValue(str);
}
-
+
return c;
}
#include "wx/tglbtn.h"
#include "wx/osx/private.h"
-wxWidgetImplType* wxWidgetImpl::CreateToggleButton( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateToggleButton( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(label),
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
-
- [v setBezelStyle:NSSmallSquareBezelStyle];
+
+ [v setBezelStyle:NSSmallSquareBezelStyle];
[v setButtonType:NSOnOffButton];
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
return c;
}
-wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxBitmap& WXUNUSED(label),
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
+ long WXUNUSED(style),
long WXUNUSED(extraStyle))
-{
+{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
-
+
[v setBezelStyle:NSRegularSquareBezelStyle];
[v setButtonType:NSOnOffButton];
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
bool DoEnable( bool enable );
void UpdateImages();
-
+
void UpdateToggleImage( bool toggle );
-
+
void UpdateLabel()
{
#if wxOSX_USE_NATIVE_TOOLBAR
wxCFStringRef l(labelStr, GetToolBarFontEncoding());
[m_toolbarItem setLabel:l.AsNSString()];
-
+
wxCFStringRef sh( GetShortHelp(), GetToolBarFontEncoding() );
[m_toolbarItem setToolTip:sh.AsNSString()];
}
tbar->OnLeftClick( GetId(), IsToggled() );
}
-
+
#if wxOSX_USE_NATIVE_TOOLBAR
void SetToolbarItemRef( NSToolbarItem* ref )
{
}
- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag;
-
+
- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar;
- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar;
frame.origin.y = mac_y;
[m_controlHandle setFrame:frame];
}
- }
+ }
}
void wxToolBarTool::UpdateImages()
dc.DrawRectangle( 0, 0, w, h );
dc.DrawBitmap( m_bmpNormal, 0, 0, true );
dc.SelectObject( wxNullBitmap );
-
+
[(NSButton*) m_controlHandle setAlternateImage:m_alternateBitmap.GetNSImage()];
}
UpdateToggleImage( CanBeToggled() && IsToggled() );
if (parent->IsKindOf(CLASSINFO(wxFrame)) && wxSystemOptions::GetOptionInt(wxT("mac.toolbar.no-native")) != 1)
{
static wxNSToolbarDelegate* controller = nil;
-
+
if ( controller == nil )
controller = [[wxNSToolbarDelegate alloc] init];
wxString identifier = wxString::Format( wxT("%p"), this );
wxCFStringRef cfidentifier(identifier);
NSToolbar* tb = [[NSToolbar alloc] initWithIdentifier:cfidentifier.AsNSString()];
-
+
m_macToolbar = tb ;
-
+
if (m_macToolbar != NULL)
{
[tb setDelegate:controller];
-
+
NSToolbarDisplayMode mode = NSToolbarDisplayModeDefault;
NSToolbarSizeMode displaySize = NSToolbarSizeModeSmall;
WXWindow tlw = MacGetTopLevelWindowRef();
float toolbarHeight = 0.0;
NSRect windowFrame = NSMakeRect(0, 0, 0, 0);
-
+
if(m_macToolbar && [(NSToolbar*)m_macToolbar isVisible])
{
windowFrame = [NSWindow contentRectForFrameRect:[tlw frame]
toolbarHeight = NSHeight(windowFrame)
- NSHeight([[tlw contentView] frame]);
}
-
+
if ( width != NULL )
*width = (int)windowFrame.size.width;
if ( height != NULL )
bResult = true;
[tlw setToolbar:(NSToolbar*) m_macToolbar];
[(NSToolbar*) m_macToolbar setVisible:YES];
-
+
m_peer->Move(0,0,0,0 );
SetSize( wxSIZE_AUTO_WIDTH, 0 );
m_peer->SetVisibility( false );
[v setBordered:NO];
[v setButtonType: ( tool->CanBeToggled() ? NSOnOffButton : NSMomentaryPushInButton )];
[v setImplementation:tool];
-
+
controlHandle = v;
-
+
#if wxOSX_USE_NATIVE_TOOLBAR
if (m_macToolbar != NULL)
{
void wxMacWakeUp()
{
- NSEvent* wakeupEvent = [NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint
+ NSEvent* wakeupEvent = [NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint
modifierFlags:NSAnyEventMask timestamp:0 windowNumber:0 context:nil subtype:0 data1:0 data2:0];
[NSApp postEvent:wakeupEvent atStart:NO];
}
}
@end
-/*
+/*
allows ShowModal to work when using sheets.
- see include/wx/osx/cocoa/private.h for more info
+ see include/wx/osx/cocoa/private.h for more info
*/
@implementation ModalDialogDelegate
- (id)init
return self;
}
-- (BOOL)finished
+- (BOOL)finished
{
return sheetFinished;
}
// called from OnPaint, even with the window's paint dc as source (see wxHTMLWindow)
NSBitmapImageRep *rep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect: [view bounds]] retain];
[view unlockFocus];
-
+
wxBitmap bitmap(width, height);
if ( [rep respondsToSelector:@selector(CGImage)] )
{
NSTrackingRectTag rectTag;
}
-// the tracking tag is needed to track mouse enter / exit events
+// the tracking tag is needed to track mouse enter / exit events
- (void) setTrackingTag: (NSTrackingRectTag)tag;
- (NSTrackingRectTag) trackingTag;
@end // wxNSView
-@interface NSView(PossibleMethods)
+@interface NSView(PossibleMethods)
- (void)setTitle:(NSString *)aString;
- (void)setStringValue:(NSString *)aString;
- (void)setIntValue:(int)anInt;
- (void)setTarget:(id)anObject;
- (void)setAction:(SEL)aSelector;
- (void)setDoubleAction:(SEL)aSelector;
-@end
+@end
long wxOSXTranslateCocoaKey( NSEvent* event )
{
long retval = 0;
if ([event type] != NSFlagsChanged)
- {
+ {
NSString* s = [event charactersIgnoringModifiers];
// backspace char reports as delete w/modifiers for some reason
if ([s length] == 1)
{
// backspace key
case 0x7F :
- case 8 :
+ case 8 :
retval = WXK_BACK;
break;
case NSUpArrowFunctionKey :
}
}
}
-
+
// Some keys don't seem to have constants. The code mimics the approach
// taken by WebKit. See:
// http://trac.webkit.org/browser/trunk/WebCore/platform/mac/KeyEventMac.mm
retval = WXK_CONTROL;
break;
// clear key
- case 71:
+ case 71:
retval = WXK_CLEAR;
break;
// tab key
- case 48:
+ case 48:
retval = WXK_TAB;
break;
case 75: // /
retval = WXK_NUMPAD_DIVIDE;
- break;
+ break;
case 67: // *
retval = WXK_NUMPAD_MULTIPLY;
break;
wxevent.m_controlDown = modifiers & NSControlKeyMask;
wxevent.m_altDown = modifiers & NSAlternateKeyMask;
wxevent.m_metaDown = modifiers & NSCommandKeyMask;
-
+
wxevent.m_rawCode = [nsEvent keyCode];
wxevent.m_rawFlags = modifiers;
-
+
wxevent.SetTimestamp( (int)([nsEvent timestamp] * 1000) ) ;
wxString chars;
chars = wxCFStringRef::AsString(nschars);
}
}
-
+
int aunichar = chars.Length() > 0 ? chars[0] : 0;
long keyval = 0;
-
+
if (wxevent.GetEventType() != wxEVT_CHAR)
{
keyval = wxOSXTranslateCocoaKey(nsEvent) ;
else
keyval = aunichar;
}
-
+
#if wxUSE_UNICODE
wxevent.m_uniChar = aunichar;
#endif
wxevent.m_metaDown = modifiers & NSCommandKeyMask;
wxevent.SetTimestamp( (int)([nsEvent timestamp] * 1000) ) ;
- UInt32 mouseChord = 0;
+ UInt32 mouseChord = 0;
switch (eventType)
{
default :
break ;
}
-
+
wxevent.m_clickCount = clickCount;
-
+
}
@implementation wxNSView
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return NSDragOperationNone;
-
+
return impl->draggingEntered(sender, self, _cmd);
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return ;
-
+
return impl->draggingExited(sender, self, _cmd);
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return NSDragOperationNone;
-
+
return impl->draggingUpdated(sender, self, _cmd);
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return NSDragOperationNone;
-
+
return impl->performDragOperation(sender, self, _cmd) ? YES:NO ;
}
#endif
-void wxOSX_mouseEvent(NSView* self, SEL _cmd, NSEvent *event)
+void wxOSX_mouseEvent(NSView* self, SEL _cmd, NSEvent *event)
{
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return;
-
+
impl->mouseEvent(event, self, _cmd);
}
-void wxOSX_keyEvent(NSView* self, SEL _cmd, NSEvent *event)
+void wxOSX_keyEvent(NSView* self, SEL _cmd, NSEvent *event)
{
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return;
-
+
impl->keyEvent(event, self, _cmd);
}
-void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text)
+void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text)
{
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return;
-
+
impl->insertText(text, self, _cmd);
}
-BOOL wxOSX_performKeyEquivalent(NSView* self, SEL _cmd, NSEvent *event)
+BOOL wxOSX_performKeyEquivalent(NSView* self, SEL _cmd, NSEvent *event)
{
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return NO;
-
+
return impl->performKeyEquivalent(event, self, _cmd);
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return NO;
-
+
return impl->acceptsFirstResponder(self, _cmd);
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return NO;
-
+
return impl->becomeFirstResponder(self, _cmd);
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return NO;
-
+
return impl->resignFirstResponder(self, _cmd);
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return;
-
+
impl->resetCursorRects(self, _cmd);
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return NO;
-
+
return impl->isFlipped(self, _cmd) ? YES:NO;
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return;
-
+
return impl->drawRect(&rect, self, _cmd);
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return;
-
+
impl->controlAction(self, _cmd, sender);
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return;
-
+
impl->controlDoubleAction(self, _cmd, sender);
}
id <NSDraggingInfo>sender = (id <NSDraggingInfo>) s;
NSPasteboard *pboard = [sender draggingPasteboard];
NSDragOperation sourceDragMask = [sender draggingSourceOperationMask];
-
+
wxWindow* wxpeer = GetWXPeer();
if ( wxpeer == NULL )
return NSDragOperationNone;
-
+
wxDropTarget* target = wxpeer->GetDropTarget();
if ( target == NULL )
return NSDragOperationNone;
else if ( sourceDragMask & NSDragOperationMove )
result = wxDragMove;
- PasteboardRef pboardRef;
+ PasteboardRef pboardRef;
PasteboardCreate((CFStringRef)[pboard name], &pboardRef);
target->SetCurrentDragPasteboard(pboardRef);
result = target->OnEnter(pt.x, pt.y, result);
CFRelease(pboardRef);
-
+
NSDragOperation nsresult = NSDragOperationNone;
switch (result )
{
{
id <NSDraggingInfo>sender = (id <NSDraggingInfo>) s;
NSPasteboard *pboard = [sender draggingPasteboard];
-
+
wxWindow* wxpeer = GetWXPeer();
if ( wxpeer == NULL )
return;
-
+
wxDropTarget* target = wxpeer->GetDropTarget();
if ( target == NULL )
return;
-
- PasteboardRef pboardRef;
+
+ PasteboardRef pboardRef;
PasteboardCreate((CFStringRef)[pboard name], &pboardRef);
target->SetCurrentDragPasteboard(pboardRef);
target->OnLeave();
id <NSDraggingInfo>sender = (id <NSDraggingInfo>) s;
NSPasteboard *pboard = [sender draggingPasteboard];
NSDragOperation sourceDragMask = [sender draggingSourceOperationMask];
-
+
wxWindow* wxpeer = GetWXPeer();
if ( wxpeer == NULL )
return NSDragOperationNone;
-
+
wxDropTarget* target = wxpeer->GetDropTarget();
if ( target == NULL )
return NSDragOperationNone;
else if ( sourceDragMask & NSDragOperationMove )
result = wxDragMove;
- PasteboardRef pboardRef;
+ PasteboardRef pboardRef;
PasteboardCreate((CFStringRef)[pboard name], &pboardRef);
target->SetCurrentDragPasteboard(pboardRef);
result = target->OnDragOver(pt.x, pt.y, result);
CFRelease(pboardRef);
-
+
NSDragOperation nsresult = NSDragOperationNone;
switch (result )
{
NSPasteboard *pboard = [sender draggingPasteboard];
NSDragOperation sourceDragMask = [sender draggingSourceOperationMask];
-
+
wxWindow* wxpeer = GetWXPeer();
wxDropTarget* target = wxpeer->GetDropTarget();
wxDragResult result = wxDragNone;
else if ( sourceDragMask & NSDragOperationMove )
result = wxDragMove;
- PasteboardRef pboardRef;
+ PasteboardRef pboardRef;
PasteboardCreate((CFStringRef)[pboard name], &pboardRef);
target->SetCurrentDragPasteboard(pboardRef);
result = target->OnData(pt.x, pt.y, result);
CFRelease(pboardRef);
-
+
return result != wxDragNone;
}
{
wxOSX_FocusHandlerPtr superimpl = (wxOSX_FocusHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
// get the current focus before running becomeFirstResponder
- NSView* otherView = FindFocus();
+ NSView* otherView = FindFocus();
wxWidgetImpl* otherWindow = FindFromWXWidget(otherView);
BOOL r = superimpl(slf, (SEL)_cmd);
// get the current focus after running resignFirstResponder
// note that this value isn't reliable, it might return the same view that
// is resigning
- NSView* otherView = FindFocus();
+ NSView* otherView = FindFocus();
wxWidgetImpl* otherWindow = FindFromWXWidget(otherView);
// NSTextViews have an editor as true responder, therefore the might get the
// resign notification if their editor takes over, don't trigger any event then
}
}
}
-
+
bool wxWidgetCocoaImpl::isFlipped(WXWidget WXUNUSED(slf), void *WXUNUSED(_cmd))
{
return m_isFlipped;
{
CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
CGContextSaveGState( context );
-
+
#if OSX_DEBUG_DRAWING
CGContextBeginPath( context );
CGContextMoveToPoint(context, 0, 0);
CGContextTranslateCTM( context, 0, [m_osxView bounds].size.height );
CGContextScaleCTM( context, 1, -1 );
}
-
+
wxRegion updateRgn;
const NSRect *rects;
NSInteger count;
wxWindow* wxpeer = GetWXPeer();
wxpeer->GetUpdateRegion() = updateRgn;
wxpeer->MacSetCGContextRef( context );
-
+
bool handled = wxpeer->MacDoRedraw( 0 );
-
+
CGContextRestoreGState( context );
CGContextSaveGState( context );
{
}
-//
+//
#if OBJC_API_VERSION >= 2
wxOSX_CLASS_ADD_METHOD(c, @selector(scrollWheel:), (IMP) wxOSX_mouseEvent, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(mouseEntered:), (IMP) wxOSX_mouseEvent, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(mouseExited:), (IMP) wxOSX_mouseEvent, "v@:@" )
-
+
wxOSX_CLASS_ADD_METHOD(c, @selector(keyDown:), (IMP) wxOSX_keyEvent, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(keyUp:), (IMP) wxOSX_keyEvent, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(flagsChanged:), (IMP) wxOSX_keyEvent, "v@:@" )
-
+
wxOSX_CLASS_ADD_METHOD(c, @selector(insertText:), (IMP) wxOSX_insertText, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(performKeyEquivalent:), (IMP) wxOSX_performKeyEquivalent, "c@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(draggingUpdated:), (IMP) wxOSX_draggingUpdated, "I@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(draggingExited:), (IMP) wxOSX_draggingExited, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(performDragOperation:), (IMP) wxOSX_performDragOperation, "c@:@" )
-#endif
-
+#endif
+
#if OBJC_API_VERSION < 2
} ;
static int method_count = WXSIZEOF( wxmethods );
[m_osxView release];
}
-wxWidgetCocoaImpl::wxWidgetCocoaImpl()
+wxWidgetCocoaImpl::wxWidgetCocoaImpl()
{
Init();
}
if ( m_osxView )
CFRelease(m_osxView);
}
-
-bool wxWidgetCocoaImpl::IsVisible() const
+
+bool wxWidgetCocoaImpl::IsVisible() const
{
return [m_osxView isHiddenOrHasHiddenAncestor] == NO;
}
{
// Not implemented
}
-
+
void wxWidgetCocoaImpl::Lower()
{
// Not implemented
void wxWidgetCocoaImpl::Move(int x, int y, int width, int height)
{
wxWindowMac* parent = GetWXPeer()->GetParent();
- // under Cocoa we might have a contentView in the wxParent to which we have to
+ // under Cocoa we might have a contentView in the wxParent to which we have to
// adjust the coordinates
if (parent && [m_osxView superview] != parent->GetHandle() )
{
[[m_osxView superview] setNeedsDisplayInRect:[m_osxView frame]];
NSRect r = wxToNSRect( [m_osxView superview], wxRect(x,y,width, height) );
[m_osxView setFrame:r];
- [[m_osxView superview] setNeedsDisplayInRect:r];
-
+ [[m_osxView superview] setNeedsDisplayInRect:r];
+
if ([m_osxView respondsToSelector:@selector(trackingTag)] )
{
if ( [(wxNSView*)m_osxView trackingTag] )
[m_osxView removeTrackingRect: [(wxNSView*)m_osxView trackingTag]];
-
+
[(wxNSView*)m_osxView setTrackingTag: [m_osxView addTrackingRect: [m_osxView bounds] owner: m_osxView userData: nil assumeInside: NO]];
}
}
if ( [m_osxView respondsToSelector:@selector(contentView) ] )
{
NSView* cv = [m_osxView contentView];
-
+
NSRect bounds = [m_osxView bounds];
NSRect rect = [cv frame];
-
+
int y = (int)rect.origin.y;
int x = (int)rect.origin.x;
if ( ![ m_osxView isFlipped ] )
return ( FindFocus() == m_osxView );
}
-bool wxWidgetCocoaImpl::SetFocus()
+bool wxWidgetCocoaImpl::SetFocus()
{
if ( [m_osxView canBecomeKeyView] == NO )
return false;
-
+
[[m_osxView window] makeFirstResponder: m_osxView] ;
[[m_osxView window] makeKeyAndOrderFront:nil] ;
return true;
[m_osxView setStringValue:cf.AsNSString()];
}
}
-
+
void wxWidgetImpl::Convert( wxPoint *pt , wxWidgetImpl *from , wxWidgetImpl *to )
{
NSPoint p = wxToNSPoint( from->GetWXWidget(), *pt );
- p = [from->GetWXWidget() convertPoint:p toView:to->GetWXWidget() ];
+ p = [from->GetWXWidget() convertPoint:p toView:to->GetWXWidget() ];
*pt = wxFromNSPoint( to->GetWXWidget(), p );
}
-wxInt32 wxWidgetCocoaImpl::GetValue() const
+wxInt32 wxWidgetCocoaImpl::GetValue() const
{
return [(NSControl*)m_osxView intValue];
}
-void wxWidgetCocoaImpl::SetValue( wxInt32 v )
+void wxWidgetCocoaImpl::SetValue( wxInt32 v )
{
if ( [m_osxView respondsToSelector:@selector(setIntValue:)] )
{
}
}
-void wxWidgetCocoaImpl::SetMinimum( wxInt32 v )
+void wxWidgetCocoaImpl::SetMinimum( wxInt32 v )
{
if ( [m_osxView respondsToSelector:@selector(setMinValue:)] )
{
}
}
-void wxWidgetCocoaImpl::SetMaximum( wxInt32 v )
+void wxWidgetCocoaImpl::SetMaximum( wxInt32 v )
{
if ( [m_osxView respondsToSelector:@selector(setMaxValue:)] )
{
}
}
-wxInt32 wxWidgetCocoaImpl::GetMinimum() const
+wxInt32 wxWidgetCocoaImpl::GetMinimum() const
{
if ( [m_osxView respondsToSelector:@selector(getMinValue:)] )
{
return 0;
}
-wxInt32 wxWidgetCocoaImpl::GetMaximum() const
+wxInt32 wxWidgetCocoaImpl::GetMaximum() const
{
if ( [m_osxView respondsToSelector:@selector(getMaxValue:)] )
{
{
}
-void wxWidgetCocoaImpl::SetControlSize( wxWindowVariant variant )
+void wxWidgetCocoaImpl::SetControlSize( wxWindowVariant variant )
{
NSControlSize size = NSRegularControlSize;
-
+
switch ( variant )
{
case wxWINDOW_VARIANT_NORMAL :
}
if ( [m_osxView respondsToSelector:@selector(setControlSize:)] )
[m_osxView setControlSize:size];
- else if ([m_osxView respondsToSelector:@selector(cell)])
- {
- id cell = [(id)m_osxView cell];
- if ([cell respondsToSelector:@selector(setControlSize:)])
- [cell setControlSize:size];
- }
+ else if ([m_osxView respondsToSelector:@selector(cell)])
+ {
+ id cell = [(id)m_osxView cell];
+ if ([cell respondsToSelector:@selector(setControlSize:)])
+ [cell setControlSize:size];
+ }
}
void wxWidgetCocoaImpl::SetFont(wxFont const& font, wxColour const&, long, bool)
{
[c setDoubleAction: @selector(controlDoubleAction:)];
}
-
+
}
}
{
wxKeyEvent wxevent(wxEVT_CHAR);
SetupKeyEvent( wxevent, event, text );
- wxevent.SetEventObject(GetWXPeer());
+ wxevent.SetEventObject(GetWXPeer());
return GetWXPeer()->OSXHandleKeyEvent(wxevent);
}
{
wxKeyEvent wxevent(wxEVT_KEY_DOWN);
SetupKeyEvent( wxevent, event );
- wxevent.SetEventObject(GetWXPeer());
+ wxevent.SetEventObject(GetWXPeer());
bool result = GetWXPeer()->OSXHandleKeyEvent(wxevent);
// this will fire higher level events, like insertText, to help
bool wxWidgetCocoaImpl::DoHandleMouseEvent(NSEvent *event)
{
- NSPoint clickLocation;
- clickLocation = [m_osxView convertPoint:[event locationInWindow] fromView:nil];
+ NSPoint clickLocation;
+ clickLocation = [m_osxView convertPoint:[event locationInWindow] fromView:nil];
wxPoint pt = wxFromNSPoint( m_osxView, clickLocation );
wxMouseEvent wxevent(wxEVT_LEFT_DOWN);
SetupMouseEvent( wxevent , event ) ;
#endif
wxLogTrace(wxT("Focus"), wxT("focus lost(%p)"), static_cast<void*>(thisWindow));
-
+
wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId());
event.SetEventObject(thisWindow);
if (otherWindow)
// Factory methods
//
-wxWidgetImpl* wxWidgetImpl::CreateUserPane( wxWindowMac* wxpeer, wxWindowMac* WXUNUSED(parent),
+wxWidgetImpl* wxWidgetImpl::CreateUserPane( wxWindowMac* wxpeer, wxWindowMac* WXUNUSED(parent),
wxWindowID WXUNUSED(id), const wxPoint& pos, const wxSize& size,
long WXUNUSED(style), long WXUNUSED(extraStyle))
{
// temporary hook for dnd
[v registerForDraggedTypes:[NSArray arrayWithObjects:
NSStringPboardType, NSFilenamesPboardType, NSTIFFPboardType, NSPICTPboardType, NSPDFPboardType, nil]];
-
+
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
return c;
}
-wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
+wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
{
NSWindow* tlw = now->GetWXWindow();
wxNSView* v = [[wxNSView alloc] initWithFrame:[[tlw contentView] frame]];
int height = image.GetHeight();
wxBitmapRefData* bitmapRefData;
-
+
m_refData = bitmapRefData = new wxBitmapRefData( width , height , depth ) ;
if ( bitmapRefData->IsOk())
// Standard Handlers
// ----------------------------------------------------------------------------
-#if !defined( __LP64__ ) && !defined(__WXOSX_IPHONE__)
+#if !defined( __LP64__ ) && !defined(__WXOSX_IPHONE__)
class WXDLLEXPORT wxPICTResourceHandler: public wxBitmapHandler
{
char* buf = NULL ;
CFStringEncoding cfencoding = 0;
- wxString result;
+ wxString result;
#if wxUSE_UNICODE
#if wxUSE_UNICODE_WCHAR
cfencoding = kCFStringEncodingUTF32Native;
buf = new char[ cStrLen ] ;
CFStringGetBytes( ref , CFRangeMake(0, cflen) , cfencoding,
'?' , false , (unsigned char*) buf , cStrLen , &cStrLen) ;
-
+
#if wxUSE_UNICODE
#if wxUSE_UNICODE_WCHAR
result = wxString( (const wchar_t*) buf , cStrLen/4);
#else
result = wxString(buf, cStrLen) ;
#endif
-
+
delete[] buf ;
wxMacConvertNewlines10To13( &result);
return result ;
}
#if wxOSX_USE_COCOA_OR_IPHONE
-wxString wxCFStringRef::AsString( NSString* ref, wxFontEncoding encoding )
+wxString wxCFStringRef::AsString( NSString* ref, wxFontEncoding encoding )
{
return AsString( (CFStringRef) ref, encoding );
}
free( m_ubuf ) ;
}
-UniCharPtr wxMacUniCharBuffer::GetBuffer()
+UniCharPtr wxMacUniCharBuffer::GetBuffer()
{
return m_ubuf ;
}
-
+
UniCharCount wxMacUniCharBuffer::GetChars()
{
return m_chars ;
else
#endif
{
- CGFloat components[4] = { (CGFloat)(r / 255.0), (CGFloat) (g / 255.0), (CGFloat) (b / 255.0), (CGFloat) (a / 255.0) } ;
+ CGFloat components[4] = { (CGFloat)(r / 255.0), (CGFloat) (g / 255.0), (CGFloat) (b / 255.0), (CGFloat) (a / 255.0) } ;
col = CGColorCreate( wxMacGetGenericRGBColorSpace() , components ) ;
}
m_cgColour.reset( col );
CGColorRef cfcol;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if ( CGColorCreateGenericRGB != NULL )
- cfcol = CGColorCreateGenericRGB((CGFloat)(col.red / 65535.0), (CGFloat)(col.green / 65535.0),
+ cfcol = CGColorCreateGenericRGB((CGFloat)(col.red / 65535.0), (CGFloat)(col.green / 65535.0),
(CGFloat)(col.blue / 65535.0), (CGFloat) 1.0 );
else
#endif
{
- CGFloat components[4] = { (CGFloat)(col.red / 65535.0), (CGFloat)(col.green / 65535.0),
- (CGFloat)(col.blue / 65535.0), (CGFloat) 1.0 } ;
+ CGFloat components[4] = { (CGFloat)(col.red / 65535.0), (CGFloat)(col.green / 65535.0),
+ (CGFloat)(col.blue / 65535.0), (CGFloat) 1.0 } ;
cfcol = CGColorCreate( wxMacGetGenericRGBColorSpace() , components ) ;
}
m_cgColour.reset( cfcol );
if ( m_selected.GetDepth() != 1 )
m_selected.UseAlpha() ;
m_selected.BeginRawAccess() ;
- m_width = bitmap.GetWidth();
- m_height = bitmap.GetHeight();
+ m_width = bitmap.GetWidth();
+ m_height = bitmap.GetHeight();
CGColorSpaceRef genericColorSpace = wxMacGetGenericRGBColorSpace();
CGContextRef bmCtx = (CGContextRef) m_selected.GetHBITMAP();
{
CGContextSetFillColorSpace( bmCtx, genericColorSpace );
CGContextSetStrokeColorSpace( bmCtx, genericColorSpace );
- SetGraphicsContext( wxGraphicsContext::CreateFromNative( bmCtx ) );
+ SetGraphicsContext( wxGraphicsContext::CreateFromNative( bmCtx ) );
}
m_ok = (m_graphicContext != NULL) ;
}
consideration of your agreement to the following terms, and your use, installation or modification
of this Apple software constitutes acceptance of these terms. If you do not agree with these terms,
please do not use, install or modify this Apple software.
-
+
In consideration of your agreement to abide by the following terms, and subject to these
terms, Apple grants you a personal, non-exclusive license, under Apple\xd5s copyrights in
this original Apple software (the "Apple Software"), to use and modify the Apple Software,
licenses, express or implied, are granted by Apple herein, including but not limited
to any patent rights that may be infringed by your derivative works or by other works
in which the Apple Software may be incorporated.
-
+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS
USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
-
+
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE,
void * topP;
void * bottomP;
void * base;
-
-
+
+
top = 0;
bottom = height - 1;
base = data;
buffer = malloc(rowBytes);
-
-
+
+
while ( top < bottom )
{
topP = (void *)((top * rowBytes) + (intptr_t)base);
bottomP = (void *)((bottom * rowBytes) + (intptr_t)base);
-
-
+
+
/*
* Save and swap scanlines.
*
bcopy( topP, buffer, rowBytes );
bcopy( bottomP, topP, rowBytes );
bcopy( buffer, bottomP, rowBytes );
-
+
++top;
--bottom;
}
* using CFRelease().
* Returns NULL on an error.
*/
-
+
CGImageRef grabViaOpenGL(CGDirectDisplayID display, CGRect srcRect)
{
CGContextRef bitmap;
long bytewidth;
GLint width, height;
long bytes;
-
+
CGLContextObj glContextObj;
CGLPixelFormatObj pixelFormatObj ;
GLint numPixelFormats ;
(CGLPixelFormatAttribute) 0, /* Display mask bit goes here */
(CGLPixelFormatAttribute) 0
} ;
-
-
+
+
if ( display == kCGNullDirectDisplay )
display = CGMainDisplayID();
attribs[2] = (CGLPixelFormatAttribute) CGDisplayIDToOpenGLDisplayMask(display);
-
-
+
+
/* Build a full-screen GL context */
CGLChoosePixelFormat( attribs, &pixelFormatObj, &numPixelFormats );
if ( pixelFormatObj == NULL ) // No full screen context support
CGLDestroyPixelFormat( pixelFormatObj ) ;
if ( glContextObj == NULL )
return NULL;
-
-
+
+
CGLSetCurrentContext( glContextObj ) ;
CGLSetFullScreen( glContextObj ) ;
-
-
+
+
glReadBuffer(GL_FRONT);
-
-
+
+
width = (GLint)srcRect.size.width;
height = (GLint)srcRect.size.height;
-
-
+
+
bytewidth = width * 4; // Assume 4 bytes/pixel for now
bytewidth = (bytewidth + 3) & ~3; // Align to 4 bytes
bytes = bytewidth * height; // width * height
-
+
/* Build bitmap context */
data = malloc(height * bytewidth);
if ( data == NULL )
}
bitmap = CGBitmapContextCreate(data, width, height, 8, bytewidth,
wxMacGetGenericRGBColorSpace(), kCGImageAlphaNoneSkipFirst /* XRGB */);
-
-
+
+
/* Read framebuffer into our bitmap */
glFinish(); /* Finish all OpenGL commands */
glPixelStorei(GL_PACK_ALIGNMENT, 4); /* Force 4-byte alignment */
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
glPixelStorei(GL_PACK_SKIP_ROWS, 0);
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
-
+
/*
* Fetch the data in XRGB format, matching the bitmap context.
*/
* invert it. Pixel reformatting can also be done here.
*/
swizzleBitmap(data, bytewidth, height);
-
-
+
+
/* Make an image out of our bitmap; does a cheap vm_copy of the bitmap */
image = CGBitmapContextCreateImage(bitmap);
-
+
/* Get rid of bitmap */
CFRelease(bitmap);
free(data);
-
-
+
+
/* Get rid of GL context */
CGLSetCurrentContext( NULL );
CGLClearDrawable( glContextObj ); // disassociate from full screen
CGLDestroyContext( glContextObj ); // and destroy the context
-
+
/* Returned image has a reference count of 1 */
return image;
}
{
for(size_t i = 0; i < sm_keyboards.GetCount(); ++i)
delete (wxHIDKeyboard*) sm_keyboards[i];
- sm_keyboards.Clear();
+ sm_keyboards.Clear();
}
};
}
}
-#endif // wxUSE_JOYSTICK
+#endif // wxUSE_JOYSTICK
{
papersize = data.GetPaperSize();
}
-
+
if ( papersize != wxDefaultSize )
{
papersize.x = (wxInt32) (papersize.x * mm2pt);
papersize.y = (wxInt32) (papersize.y * mm2pt);
-
+
double height, width;
PMPaperGetHeight(m_macPaper, &height);
PMPaperGetWidth(m_macPaper, &width);
-
- if ( fabs( width - papersize.x ) >= 5 ||
+
+ if ( fabs( width - papersize.x ) >= 5 ||
fabs( height - papersize.y ) >= 5 )
{
// we have to change the current paper
PMPaper paper = (PMPaper) CFArrayGetValueAtIndex( paperlist, i );
PMPaperGetHeight(paper, &height);
PMPaperGetWidth(paper, &width);
- if ( fabs( width - papersize.x ) < 5 &&
+ if ( fabs( width - papersize.x ) < 5 &&
fabs( height - papersize.y ) < 5 )
{
// TODO test for duplicate hits and use additional
if ( bestPaper == kPMNoData )
{
const PMPaperMargins margins = { 0.0, 0.0, 0.0, 0.0 };
- wxString id, name(wxT("Custom paper"));
+ wxString id, name(wxT("Custom paper"));
id.Printf(wxT("wxPaperCustom%dx%d"), papersize.x, papersize.y);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
papersize.x, papersize.y, &margins, &paper);
}
#endif
-#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
if ( paper == kPMNoData )
{
- PMPaperCreate(printer, wxCFStringRef( id, wxFont::GetDefaultEncoding() ), wxCFStringRef( name, wxFont::GetDefaultEncoding() ),
+ PMPaperCreate(printer, wxCFStringRef( id, wxFont::GetDefaultEncoding() ), wxCFStringRef( name, wxFont::GetDefaultEncoding() ),
papersize.x, papersize.y, &margins, &paper);
}
#endif
CFArrayRef printerList;
CFIndex index, count;
CFStringRef name;
-
+
if (PMServerCreatePrinterList(kPMServerLocal, &printerList) == noErr)
{
count = CFArrayGetCount(printerList);
PMSessionSetCurrentPMPrinter(m_macPrintSession, printer);
CFRelease(printerList);
}
-
+
PMSetCopies( m_macPrintSettings , data.GetNoCopies() , false ) ;
PMSetCollate(m_macPrintSettings, data.GetCollate());
if ( data.IsOrientationReversed() )
else
PMSetOrientation( m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMLandscape : kPMPortrait , false ) ;
-
+
PMDuplexMode mode = 0 ;
switch( data.GetDuplex() )
{
PMSetDuplex( m_macPrintSettings, mode ) ;
// PMQualityMode not yet accessible via API
-
-
+
+
if ( data.IsOrientationReversed() )
PMSetOrientation( m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMReverseLandscape : kPMReversePortrait , false ) ;
else
PMSetOrientation( m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMLandscape : kPMPortrait , false ) ;
-
+
#ifndef __LP64__
// PMQualityMode not accessible via API
// TODO: use our quality property to determine optimal resolution
PMSetResolution( m_macPageFormat, &res);
#endif
- // after setting the new resolution the format has to be updated, otherwise the page rect remains
+ // after setting the new resolution the format has to be updated, otherwise the page rect remains
// at the 'old' scaling
-
+
PMSessionValidatePageFormat(m_macPrintSession,
m_macPageFormat, kPMDontWantBoolean);
PMSessionValidatePrintSettings(m_macPrintSession,
Boolean collate;
if (PMGetCollate(m_macPrintSettings, &collate) == noErr)
data.SetCollate(collate);
-
+
CFStringRef name;
PMPrinter printer ;
PMSessionGetCurrentPrinter( m_macPrintSession, &printer );
CFRetain(name);
data.SetPrinterName(wxCFStringRef(name).AsString());
}
-
+
PMDuplexMode mode = 0 ;
PMGetDuplex( m_macPrintSettings, &mode ) ;
switch( mode )
break ;
}
// PMQualityMode not yet accessible via API
-
+
double height, width;
PMPaperGetHeight(m_macPaper, &height);
PMPaperGetWidth(m_macPaper, &width);
wxSize ppiScreen( 72 , 72 ) ;
wxSize ppiPrinter( 72 , 72 ) ;
-
+
// Note that with Leopard, screen dpi=72 is no longer a given
m_previewPrintout->SetPPIScreen( ppiScreen.x , ppiScreen.y ) ;
-
+
wxCoord w , h ;
wxCoord ww, hh;
wxRect paperRect;
}
m_pageWidth = w;
m_pageHeight = h;
-
+
m_previewPrintout->SetPageSizePixels(w , h) ;
m_previewPrintout->SetPageSizeMM(ww, hh);
m_previewPrintout->SetPaperRectPixels(paperRect);
m_macPageFormat);
PMGetPageFormatPaper(m_macPageFormat, &m_macPaper);
}
-
+
if ( PMCreatePrintSettings(&m_macPrintSettings) == noErr )
{
PMSessionDefaultPrintSettings(m_macPrintSession,
#else
FSSpec fsSpec;
#endif
-
+
procno.highLongOfPSN = 0 ;
procno.lowLongOfPSN = kCurrentProcess ;
processinfo.processInfoLength = sizeof(ProcessInfoRec);
#else
processinfo.processAppSpec = &fsSpec;
#endif
-
+
GetProcessInformation( &procno , &processinfo ) ;
#ifdef __LP64__
return wxMacFSRefToPath(&fsRef);
return wxMacFSSpec2MacFilename(&fsSpec);
#endif
#endif
-
+
#else
return wxStandardPathsBase::GetExecutablePath();
#endif
else
{
// NOTE: Includes NULL iff source did
- /* NOTE: This is an approximation. The eventual UTF-32 will
+ /* NOTE: This is an approximation. The eventual UTF-32 will
* possibly have less elements but certainly not more.
*/
size_t returnSize = CFStringGetLength(theString);
-
+
if (dstSize == 0 || dst == NULL)
{
return returnSize;
// for an undersized UTF-32 destination buffer.
CFRange fullStringRange = CFRangeMake(0, CFStringGetLength(theString));
UniChar *szUniCharBuffer = new UniChar[fullStringRange.length];
-
+
CFStringGetCharacters(theString, fullStringRange, szUniCharBuffer);
-
+
wxMBConvUTF16 converter;
returnSize = converter.ToWChar( dst, dstSize, (const char*)szUniCharBuffer, fullStringRange.length );
delete [] szUniCharBuffer;
-
+
return returnSize;
}
// NOTREACHED
CFIndex usedBufLen;
CFIndex charsConverted = CFStringGetBytes(
- theString,
+ theString,
CFRangeMake(0, CFStringGetLength(theString)),
m_encoding,
0, // FAIL on unconvertible characters
wxCHECK_MSG( m_milli > 0, false, wxT("invalid value for timer timeout") );
wxCHECK_MSG( m_info->m_timerRef == NULL, false, wxT("attempting to restart a timer") );
-
+
CFGregorianUnits gumilli ;
memset(&gumilli,0,sizeof(gumilli) );
gumilli.seconds = m_milli / 1000.0;
m_info->m_timer = this;
m_info->m_timerRef = CFRunLoopTimerCreate(
- kCFAllocatorDefault,
+ kCFAllocatorDefault,
CFAbsoluteTimeAddGregorianUnits( CFAbsoluteTimeGetCurrent() , NULL, gumilli ),
IsOneShot() ? 0 : CFTimeInterval( m_milli / 1000.0 ) ,
0, 0, wxProcessTimer, &ctx);
-
+
wxASSERT_MSG( m_info->m_timerRef != NULL, wxT("unable to create timer"));
-
+
CFRunLoopRef runLoop = 0;
#if wxOSX_USE_IPHONE
runLoop = CFRunLoopGetMain();
// have a fast version for mac code that returns the version as a return value
-long UMAGetSystemVersion()
-{
+long UMAGetSystemVersion()
+{
static SInt32 sUMASystemVersion = 0 ;
if ( sUMASystemVersion == 0 )
{
verify_noerr(Gestalt(gestaltSystemVersion, &sUMASystemVersion));
}
- return sUMASystemVersion ;
+ return sUMASystemVersion ;
}
// our OS version is the same in non GUI and GUI cases
wxSize sz = GetDefaultSize() ;
wxRect r ;
-
+
m_peer->GetBestRect(&r);
if ( r.GetWidth() == 0 && r.GetHeight() == 0 )
sz.y = r.GetHeight();
int wBtn = 72;
-
+
if ((wBtn > sz.x) || ( GetWindowStyle() & wxBU_EXACTFIT))
sz.x = wBtn;
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXIPhoneClassAddWXMethods( self );
@end
-wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID id,
+wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID id,
const wxString& WXUNUSED(label),
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
- long WXUNUSED(extraStyle))
+ long WXUNUSED(style),
+ long WXUNUSED(extraStyle))
{
CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
UIButtonType buttonType = UIButtonTypeRoundedRect;
{
// Button height is static in Mac, can't be changed, so we need to force it here
int maxHeight;
- switch (wxpeer->GetWindowVariant() )
+ switch (wxpeer->GetWindowVariant() )
{
case wxWINDOW_VARIANT_NORMAL:
case wxWINDOW_VARIANT_LARGE:
}
void wxWidgetIPhoneImpl::SetDefaultButton( bool isDefault )
-{
+{
}
-void wxWidgetIPhoneImpl::PerformClick()
+void wxWidgetIPhoneImpl::PerformClick()
{
}
-wxWidgetImplType* wxWidgetImpl::CreateDisclosureTriangle( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateDisclosureTriangle( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxString& label,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long WXUNUSED(style),
- long WXUNUSED(extraStyle))
+ long WXUNUSED(style),
+ long WXUNUSED(extraStyle))
{
CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxUIButton* v = [[wxUIButton alloc] initWithFrame:r];
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXIPhoneClassAddWXMethods( self );
@end
-wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(label),
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
- long WXUNUSED(extraStyle))
+ long style,
+ long WXUNUSED(extraStyle))
{
CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxUISwitch* v = [[wxUISwitch alloc] initWithFrame:r];
// if (style & wxCHK_3STATE)
// [v setAllowsMixedState:YES];
-
+
wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v );
return c;
}
msgtitle = m_message;
msgtext = m_extendedMessage;
}
-
+
wxCFStringRef cfNoString( GetNoLabel(), GetFont().GetEncoding() );
wxCFStringRef cfYesString( GetYesLabel(), GetFont().GetEncoding() );
wxCFStringRef cfOKString( GetOKLabel(), GetFont().GetEncoding() );
wxCFStringRef cfText( msgtext, GetFont().GetEncoding() );
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:cfTitle.AsNSString() message:cfText.AsNSString() delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
-
+
int buttonId[3] = { 0, 0, 0 };
int buttonCount = 0;
wxNonOwnedWindow* parentWindow = NULL;
int button = -1;
-
- if (GetParent())
+
+ if (GetParent())
{
parentWindow = dynamic_cast<wxNonOwnedWindow*>(wxGetTopLevelParent(GetParent()));
}
if (parentWindow)
{
NSWindow* nativeParent = parentWindow->GetWXWindow();
- ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
- [alert beginSheetModalForWindow: nativeParent modalDelegate: sheetDelegate
- didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
+ ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
+ [alert beginSheetModalForWindow: nativeParent modalDelegate: sheetDelegate
+ didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo: nil];
[sheetDelegate waitForSheetToFinish];
button = [sheetDelegate code];
[alert show];
}
// [alert release];
-
+
return wxID_CANCEL;
}
IMPLEMENT_DYNAMIC_CLASS( wxNonOwnedWindowIPhoneImpl , wxNonOwnedWindowImpl )
-wxNonOwnedWindowIPhoneImpl::wxNonOwnedWindowIPhoneImpl( wxNonOwnedWindow* nonownedwnd) :
+wxNonOwnedWindowIPhoneImpl::wxNonOwnedWindowIPhoneImpl( wxNonOwnedWindow* nonownedwnd) :
wxNonOwnedWindowImpl(nonownedwnd)
{
m_macWindow = NULL;
m_macFullScreenData = NULL;
}
-
-wxNonOwnedWindowIPhoneImpl::wxNonOwnedWindowIPhoneImpl()
+
+wxNonOwnedWindowIPhoneImpl::wxNonOwnedWindowIPhoneImpl()
{
m_macWindow = NULL;
m_macFullScreenData = NULL;
}
-
+
wxNonOwnedWindowIPhoneImpl::~wxNonOwnedWindowIPhoneImpl()
{
[m_macWindow release];
long style, long extraStyle, const wxString& name )
{
m_macWindow = [UIWindow alloc];
-
+
UIWindowLevel level = UIWindowLevelNormal;
-
+
// most styles are not supported on the iphone
-
+
if ( style & wxFRAME_TOOL_WINDOW )
{
level = UIWindowLevelAlert; ;
}
if ( ( style & wxSTAY_ON_TOP ) )
- level = UIWindowLevelAlert;
+ level = UIWindowLevelAlert;
CGRect r = CGRectMake( 0, 0, size.x, size.y) ;
-
+
[m_macWindow initWithFrame:r ];
-
+
[m_macWindow setWindowLevel:level];
// [m_macWindow makeKeyAndOrderFront:nil];
}
void wxNonOwnedWindowIPhoneImpl::Raise()
{
}
-
+
void wxNonOwnedWindowIPhoneImpl::Lower()
{
}
}
return true;
}
-
+
bool wxNonOwnedWindowIPhoneImpl::ShowWithEffect(bool show, wxShowEffect effect, unsigned timeout)
{
return Show(show);
{
// no special styles supported
}
-
+
bool wxNonOwnedWindowIPhoneImpl::SetBackgroundStyle(wxBackgroundStyle style)
{
return true;
}
-
+
bool wxNonOwnedWindowIPhoneImpl::CanSetTransparent()
{
return true;
left = rect.origin.x;
top = rect.origin.y;
}
-
+
bool wxNonOwnedWindowIPhoneImpl::SetShape(const wxRegion& region)
{
return false;
}
-void wxNonOwnedWindowIPhoneImpl::SetTitle( const wxString& title, wxFontEncoding encoding )
+void wxNonOwnedWindowIPhoneImpl::SetTitle( const wxString& title, wxFontEncoding encoding )
{
// TODO change title of app ?
}
-
+
bool wxNonOwnedWindowIPhoneImpl::IsMaximized() const
{
return false;
}
-
+
bool wxNonOwnedWindowIPhoneImpl::IsIconized() const
{
return false;
}
-
+
void wxNonOwnedWindowIPhoneImpl::Iconize( bool iconize )
{
}
-
+
void wxNonOwnedWindowIPhoneImpl::Maximize(bool maximize)
{
}
{
return m_macFullScreenData != NULL ;
}
-
+
bool wxNonOwnedWindowIPhoneImpl::ShowFullScreen(bool show, long style)
-{
+{
return true;
}
*width = r.size.width;
if ( height )
*height = r.size.height;
-
+
}
void wxGetMousePosition( int* x, int* y )
void wxDisplaySize(int *width, int *height)
{
CGRect bounds = [[UIScreen mainScreen] bounds];
-
+
if ( width )
*width = (int)bounds.size.width ;
if ( height )
// call this method when a Blit is performed with it as a source.
if (!m_window)
return wxNullBitmap;
-
+
wxSize sz = m_window->GetSize();
-
+
int left = subrect != NULL ? subrect->x : 0 ;
int top = subrect != NULL ? subrect->y : 0 ;
int width = subrect != NULL ? subrect->width : sz.x;
int height = subrect != NULL ? subrect->height : sz.y ;
-
+
wxBitmap bmp = wxBitmap(width, height, 32);
-
+
CGContextRef context = (CGContextRef)bmp.GetHBITMAP();
-
+
CGContextSaveGState(context);
-
-
+
+
CGContextTranslateCTM( context, 0, height );
CGContextScaleCTM( context, 1, -1 );
{
/*
NSResponder* responder = [keyWindow firstResponder];
- if ( [responder isKindOfClass:[NSTextView class]] &&
+ if ( [responder isKindOfClass:[NSTextView class]] &&
[keyWindow fieldEditor:NO forObject:nil] != nil )
{
focusedView = [(NSTextView*)responder delegate];
UITouch *touch = [touches anyObject];
// these parameters are not given for all events
- UInt32 button = 0; // no secondary button
+ UInt32 button = 0; // no secondary button
UInt32 clickCount = [touch tapCount];
UInt32 mouseChord = 0; // TODO does this exist for cocoa
+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
+ if (!initialized)
{
initialized = YES;
wxOSXIPhoneClassAddWXMethods( self );
CGContextRef context = (CGContextRef) UIGraphicsGetCurrentContext();
CGContextSaveGState( context );
// draw background
-
+
CGContextSetFillColorWithColor( context, impl->GetWXPeer()->GetBackgroundColour().GetCGColor());
CGContextFillRect(context, rect );
impl->GetWXPeer()->MacSetCGContextRef( context );
- impl->GetWXPeer()->GetUpdateRegion() =
+ impl->GetWXPeer()->GetUpdateRegion() =
wxRegion(rect.origin.x,rect.origin.y,rect.size.width,rect.size.height) ;
wxPaintEvent event;
}
-- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self handleTouchEvent:touches withEvent:event];
}
-- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
[self handleTouchEvent:touches withEvent:event];
}
-- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
[self handleTouchEvent:touches withEvent:event];
}
--(void)handleTouchEvent:(NSSet *)touches withEvent:(UIEvent *)event
-{
+-(void)handleTouchEvent:(NSSet *)touches withEvent:(UIEvent *)event
+{
wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( self );
- CGPoint clickLocation;
+ CGPoint clickLocation;
UITouch *touch = [touches anyObject];
clickLocation = [touch locationInView:self];
*/
-void wxOSX_touchEvent(UIView* self, SEL _cmd, NSSet* touches, UIEvent *event )
+void wxOSX_touchEvent(UIView* self, SEL _cmd, NSSet* touches, UIEvent *event )
{
wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return;
-
+
impl->touchEvent(touches, event, self, _cmd);
}
wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return NO;
-
+
return impl->becomeFirstResponder(self, _cmd);
}
wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return NO;
-
+
return impl->resignFirstResponder(self, _cmd);
}
wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if (impl == NULL)
return;
-
+
return impl->drawRect(&rect, self, _cmd);
}
{
}
-wxWidgetIPhoneImpl::wxWidgetIPhoneImpl()
+wxWidgetIPhoneImpl::wxWidgetIPhoneImpl()
{
}
}
[m_osxView release];
}
-
-bool wxWidgetIPhoneImpl::IsVisible() const
+
+bool wxWidgetIPhoneImpl::IsVisible() const
{
// TODO reflect Superviews state
return [m_osxView isHidden] == NO;
{
[[m_osxView superview] bringSubviewToFront:m_osxView];
}
-
+
void wxWidgetIPhoneImpl::Lower()
{
[[m_osxView superview] sendSubviewToBack:m_osxView];
return [m_osxView isFirstResponder] == YES;
}
-bool wxWidgetIPhoneImpl::SetFocus()
+bool wxWidgetIPhoneImpl::SetFocus()
{
// [m_osxView makeKeyWindow] ;
// TODO
void wxWidgetImpl::Convert( wxPoint *pt , wxWidgetImpl *from , wxWidgetImpl *to )
{
CGPoint p = CGPointMake( pt->x , pt->y );
- p = [from->GetWXWidget() convertPoint:p toView:to->GetWXWidget() ];
+ p = [from->GetWXWidget() convertPoint:p toView:to->GetWXWidget() ];
pt->x = (int)p.x;
pt->y = (int)p.y;
}
{
}
-void wxWidgetIPhoneImpl::SetControlSize( wxWindowVariant variant )
+void wxWidgetIPhoneImpl::SetControlSize( wxWindowVariant variant )
{
}
#endif
wxLogTrace(wxT("Focus"), wxT("focus lost(%p)"), static_cast<void*>(thisWindow));
-
+
wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId());
event.SetEventObject(thisWindow);
if (otherWindow)
{
wxOSX_FocusHandlerPtr superimpl = (wxOSX_FocusHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
// get the current focus before running becomeFirstResponder
- UIView* otherView = FindFocus();
+ UIView* otherView = FindFocus();
wxWidgetImpl* otherWindow = FindFromWXWidget(otherView);
BOOL r = superimpl(slf, (SEL)_cmd);
if ( r )
wxOSX_FocusHandlerPtr superimpl = (wxOSX_FocusHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
BOOL r = superimpl(slf, (SEL)_cmd);
// get the current focus after running resignFirstResponder
- UIView* otherView = FindFocus();
+ UIView* otherView = FindFocus();
wxWidgetImpl* otherWindow = FindFromWXWidget(otherView);
// NSTextViews have an editor as true responder, therefore the might get the
// resign notification if their editor takes over, don't trigger any event hen
CGContextRef context = (CGContextRef) UIGraphicsGetCurrentContext();
CGContextSaveGState( context );
// draw background
-
+
CGContextSetFillColorWithColor( context, GetWXPeer()->GetBackgroundColour().GetCGColor());
CGContextFillRect(context, *rect );
GetWXPeer()->MacSetCGContextRef( context );
- GetWXPeer()->GetUpdateRegion() =
+ GetWXPeer()->GetUpdateRegion() =
wxRegion(rect->origin.x,rect->origin.y,rect->size.width,rect->size.height) ;
wxRegion updateRgn( wxFromNSRect( slf, *rect ) );
wxWindow* wxpeer = GetWXPeer();
wxpeer->GetUpdateRegion() = updateRgn;
wxpeer->MacSetCGContextRef( context );
-
+
bool handled = wxpeer->MacDoRedraw( 0 );
-
+
CGContextRestoreGState( context );
CGContextSaveGState( context );
void wxWidgetIPhoneImpl::touchEvent(NSSet* touches, UIEvent *event, WXWidget slf, void *WXUNUSED(_cmd))
{
- CGPoint clickLocation;
+ CGPoint clickLocation;
UITouch *touch = [touches anyObject];
clickLocation = [touch locationInView:slf];
wxPoint pt = wxFromNSPoint( m_osxView, clickLocation );
// Factory methods
//
-wxWidgetImpl* wxWidgetImpl::CreateUserPane( wxWindowMac* wxpeer, wxWindowMac* WXUNUSED(parent),
+wxWidgetImpl* wxWidgetImpl::CreateUserPane( wxWindowMac* wxpeer, wxWindowMac* WXUNUSED(parent),
wxWindowID WXUNUSED(id), const wxPoint& pos, const wxSize& size,
long WXUNUSED(style), long WXUNUSED(extraStyle))
{
UIView* sv = (wxpeer->GetParent()->GetHandle() );
-
+
CGRect r = CGRectMake( pos.x, pos.y, size.x, size.y) ;
// Rect bounds = wxMacGetBoundsForControl( wxpeer, pos , size ) ;
wxUIView* v = [[wxUIView alloc] initWithFrame:r];
return c;
}
-wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
+wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now )
{
UIWindow* toplevelwindow = now->GetWXWindow();
/*
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
// left orientation not yet implemented !
- if (orientation == UIInterfaceOrientationLandscapeRight )
+ if (orientation == UIInterfaceOrientationLandscapeRight )
{
CGAffineTransform transform = v.transform;
-
+
// Use the status bar frame to determine the center point of the window's content area.
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
CGRect bounds = CGRectMake(0, 0, statusBarFrame.size.height, statusBarFrame.origin.x);
CGPoint center = CGPointMake(bounds.size.height / 2.0, bounds.size.width / 2.0);
-
+
// Set the center point of the view to the center point of the window's content area.
v.center = center;
-
+
// Rotate the view 90 degrees around its new center point.
transform = CGAffineTransformRotate(transform, ( M_PI / 2.0));
v.transform = transform;
m_strings.unsorted = new wxArrayString;
m_peer = wxWidgetImpl::CreateListBox( this, parent, id, pos, size, style, GetExtraStyle() );
-
+
MacPostControlCreate( pos, size );
m_textColumn = GetListPeer()->InsertTextColumn(0,wxEmptyString);
GetListPeer()->ListDelete( n );
m_blockEvents = false;
-
+
UpdateOldSelections();
}
m_blockEvents = true;
FreeData();
m_blockEvents = false;
-
+
UpdateOldSelections();
}
wxT("invalid index in wxListBox::SetSelection") );
m_blockEvents = true;
-
+
if ( n == wxNOT_FOUND )
GetListPeer()->ListDeselectAll();
else
GetListPeer()->ListSetSelection( n, select, HasMultipleSelection() );
-
+
m_blockEvents = false;
-
+
UpdateOldSelections();
}
void wxListBox::HandleLineEvent( unsigned int n, bool doubleClick )
{
- wxCommandEvent event( doubleClick ? wxEVT_COMMAND_LISTBOX_DOUBLECLICKED :
+ wxCommandEvent event( doubleClick ? wxEVT_COMMAND_LISTBOX_DOUBLECLICKED :
wxEVT_COMMAND_LISTBOX_SELECTED, GetId() );
event.SetEventObject( this );
if ( HasClientObjectData() )
//
// common list cell value operations
-//
+//
void wxListWidgetCellValue::Check( bool check )
{
{
return GetIntValue() != 0;
}
-
+
#endif // wxUSE_LISTBOX
m_startRadioGroup = -1;
m_allowRearrange = true;
m_noEventsMode = false;
-
+
m_peer = wxMenuImpl::Create( this, wxStripMenuCodes(m_title) );
pSubMenu->DoRearrange();
}
else
- {
+ {
if ( pItem->GetId() == idMenuTitle )
pItem->GetMenu()->Enable( idMenuTitle, false );
}
{
if ( !AllowRearrange() )
return;
-
+
wxMenuItem* previousItem = NULL ;
size_t pos ;
wxMenuItemList::compatibility_iterator node;
{
if ( s_macInstalledMenuBar == this )
return ;
-
+
m_rootMenu->GetPeer()->MakeRoot();
// DisableMenuCommand( NULL , kHICommandPreferences ) ;
#if 0
void wxMenuBar::EnableTop(size_t pos, bool enable)
{
wxCHECK_RET( IsAttached(), wxT("doesn't work with unattached menubars") );
-
+
m_rootMenu->FindItemByPosition( pos )->Enable(enable);
Refresh();
return false;
m_titles.Insert(title, pos);
-
+
m_rootMenu->Insert( pos+firstMenuPos, wxMenuItem::New( m_rootMenu, wxID_ANY, title, "", wxITEM_NORMAL, menu ) );
if (m_invokingWindow)
{
m_invokingWindow = frame;
wxMenubarSetInvokingWindow(m_appleMenu, frame);
-
+
wxMenu *menu;
wxMenuList::compatibility_iterator node = m_menus.GetFirst();
m_radioGroup.start = -1;
m_isRadioGroupStart = false;
-
+
wxString text = wxStripMenuCodes(m_text);
if (text.IsEmpty() && !IsSeparator())
{
wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?"));
text = wxGetStockLabel(GetId(), wxSTOCK_WITH_ACCELERATOR|wxSTOCK_WITH_MNEMONIC);
}
-
+
wxAcceleratorEntry *entry = wxAcceleratorEntry::Create( m_text ) ;
// use accessors for ID and Kind because they might have been changed in the base constructor
m_peer = wxMenuItemImpl::Create( this, pParentMenu, GetId(), text, entry, strHelp, GetKind(), pSubMenu );
// eg. BeginAppModalStateForWindow() will disable menus and ignore this change
// which in turn causes m_isEnabled to become out of sync with real menuitem state
#if wxOSX_USE_CARBON
- && !(m_parentMenu && !IsMenuItemEnabled(MAC_WXHMENU(m_parentMenu->GetHMenu()), 0))
+ && !(m_parentMenu && !IsMenuItemEnabled(MAC_WXHMENU(m_parentMenu->GetHMenu()), 0))
#endif
)
// always update builtin menuitems
{
if ( !m_parentMenu )
return;
-
+
if ( m_bitmap.Ok() )
{
m_peer->SetBitmap( m_bitmap );
if ( IsSeparator() )
return ;
-
+
if ( IsCheckable() && IsChecked() )
m_peer->Check( true );
else
m_peer->Check( false );
-
+
m_peer->Enable( IsEnabled() );
}
wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?"));
text = wxGetStockLabel(GetId(), wxSTOCK_WITH_ACCELERATOR|wxSTOCK_WITH_MNEMONIC);
}
-
+
wxAcceleratorEntry *entry = wxAcceleratorEntry::Create( m_text ) ;
m_peer->SetLabel( text, entry );
delete entry ;
wxNonOwnedWindow::~wxNonOwnedWindow()
{
SendDestroyEvent();
-
+
wxRemoveWXWindowAssociation( this ) ;
-
+
DestroyChildren();
-
+
delete m_nowpeer;
// avoid dangling refs
bool wxNonOwnedWindow::ShowWithEffect(wxShowEffect effect,
unsigned timeout )
-{
+{
if ( !wxWindow::Show(true) )
return false;
HandleWindowEvent(event);
- return m_nowpeer->ShowWithEffect(true, effect, timeout);
+ return m_nowpeer->ShowWithEffect(true, effect, timeout);
}
bool wxNonOwnedWindow::HideWithEffect(wxShowEffect effect,
unsigned timeout )
-{
+{
if ( !wxWindow::Show(false) )
return false;
- return m_nowpeer->ShowWithEffect(false, effect, timeout);
+ return m_nowpeer->ShowWithEffect(false, effect, timeout);
}
wxPoint wxNonOwnedWindow::GetClientAreaOrigin() const
}
bool wxNonOwnedWindow::SetBackgroundColour(const wxColour& c )
-{
+{
if ( !wxWindow::SetBackgroundColour(c) && m_hasBgCol )
return false ;
-
+
if ( GetBackgroundStyle() != wxBG_STYLE_CUSTOM )
{
if ( m_nowpeer )
return m_nowpeer->SetBackgroundColour(c);
}
return true;
-}
+}
// Raise the window to the top of the Z order
void wxNonOwnedWindow::Raise()
if ( m_nowpeer )
m_nowpeer->Show(show);
-
+
if ( show )
{
// because apps expect a size event to occur at this moment
event.SetEventObject(this);
HandleWindowEvent(event);
}
-
+
return true ;
}
{
if ( !wxWindow::SetBackgroundStyle(style) )
return false ;
-
+
return m_nowpeer ? m_nowpeer->SetBackgroundStyle(style) : true;
}
{
if ( m_nowpeer == NULL )
return;
-
+
int w,h;
-
+
m_nowpeer->GetSize(w, h);
if (width)
return false;
m_peer = wxWidgetImpl::CreateTabView(this,parent, id, pos, size, style, GetExtraStyle() );
-
+
MacPostControlCreate( pos, size );
return true ;
m_LeftMargin->SetFocus();
return true;
}
-
+
bool wxMacPageMarginsDialog::TransferDataFromWindow()
{
wxPoint topLeft, bottomRight;
m_pageSetupDialogData->SetMarginBottomRight(bottomRight);
return true;
}
-
+
bool wxMacPageMarginsDialog::CheckValue(wxTextCtrl* textCtrl, int *value, int minValue, const wxString& name)
{
long lvalue;
wxSize bestSizeRadio ;
if ( m_radioButtonCycle )
bestSizeRadio = m_radioButtonCycle->GetBestSize();
-
+
for (unsigned int i = 0 ; i < m_noItems; i++)
{
GetTextExtent(GetString(i), &eachWidth[i], &eachHeight[i] );
}
// according to HIG (official space - 3 Pixels Diff between Frame and Layout size)
- int space = 3;
+ int space = 3;
if ( GetWindowVariant() == wxWINDOW_VARIANT_MINI )
space = 2;
-
+
totHeight = GetRowCount() * maxHeight + (GetRowCount() - 1) * space;
totWidth = GetColumnCount() * (maxWidth + charWidth);
current = current->NextInCycle();
if (m_windowStyle & wxRA_SPECIFY_ROWS)
- y_offset += maxHeight + space;
+ y_offset += maxHeight + space;
else
x_offset += maxWidth + charWidth;
}
}
// according to HIG (official space - 3 Pixels Diff between Frame and Layout size)
- int space = 3;
+ int space = 3;
if ( GetWindowVariant() == wxWINDOW_VARIANT_MINI )
space = 2;
-
+
totHeight = GetRowCount() * maxHeight + (GetRowCount() - 1) * space;
totWidth = GetColumnCount() * (maxWidth + charWidth);
bool retval = wxWindowBase::SetFont( font );
// dont' update the native control, it has its own small font
-
+
// should we iterate over the children ?
return retval;
}
void wxRadioButton::RemoveFromCycle()
-{
+{
if ((m_cycle == NULL) || (m_cycle == this))
return;
if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) )
return false;
-
+
m_peer = wxWidgetImpl::CreateScrollBar( this, parent, id, pos, size, style, GetExtraStyle() );
MacPostControlCreate( pos, size );
m_objectSize = range;
int range1 = wxMax( (m_objectSize - m_viewSize), 0 );
-
+
m_peer->SetMaximum( range1 );
m_peer->SetScrollThumb( position, m_viewSize );
}
m_macMaximumStatic->SetLabel( value );
}
- // If the range is out of bounds, set it to a
+ // If the range is out of bounds, set it to a
// value that is within bounds
- // RN: Testing reveals OSX does its own
+ // RN: Testing reveals OSX does its own
// bounding, perhaps this isn't needed?
int currentValue = GetValue();
bool wxSlider::OSXHandleClicked( double WXUNUSED(timestampsec) )
{
TriggerScrollEvent(wxEVT_SCROLL_THUMBRELEASE);
-
+
return true;
}
if (!parent)
return false;
-
+
m_peer = wxWidgetImpl::CreateSpinButton( this , parent, id, 0, m_min, m_max, pos, size,
style, GetExtraStyle() );
-
+
MacPostControlCreate( pos, size );
return true;
m_max = maxVal;
m_peer->SetMaximum( maxVal );
m_peer->SetMinimum( minVal );
-}
-
-void wxSpinButton::SendThumbTrackEvent()
+}
+
+void wxSpinButton::SendThumbTrackEvent()
{
wxSpinEvent event( wxEVT_SCROLL_THUMBTRACK, GetId() );
event.SetPosition( GetValue() );
{
int inc = 0;
- if ( scrollEvent == wxEVT_SCROLL_LINEUP )
+ if ( scrollEvent == wxEVT_SCROLL_LINEUP )
{
inc = 1;
}
{
inc = -1;
}
-
+
// trigger scroll events
-
+
int oldValue = GetValue() ;
int newValue = oldValue + inc;
{
return dynamic_cast<wxSearchWidgetImpl*> (m_peer);
}
-
+
wxSearchCtrl::~wxSearchCtrl()
{
delete m_menu;
return false;
m_labelOrig = m_label = label;
-
+
m_peer = wxWidgetImpl::CreateGroupBox( this, parent, id, label, pos, size, style, GetExtraStyle() );
MacPostControlCreate( pos, size );
m_labelOrig = label;
// middle/end ellipsization is handled by the OS:
- if ( HasFlag(wxST_ELLIPSIZE_END) || HasFlag(wxST_ELLIPSIZE_MIDDLE)
+ if ( HasFlag(wxST_ELLIPSIZE_END) || HasFlag(wxST_ELLIPSIZE_MIDDLE)
#if wxOSX_USE_COCOA // Cocoa has all three modes
- || HasFlag(wxST_ELLIPSIZE_START)
+ || HasFlag(wxST_ELLIPSIZE_START)
#endif
)
{
wxTextWidgetImpl* wxTextCtrl::GetTextPeer() const
{
- return dynamic_cast<wxTextWidgetImpl*> (m_peer);
+ return dynamic_cast<wxTextWidgetImpl*> (m_peer);
}
void wxTextCtrl::MacSuperChangedPosition()
// allow navigation and deletion
GetSelection( &from, &to );
if ( !IsMultiLine() && m_maxLength && GetValue().length() >= m_maxLength &&
- key != WXK_LEFT && key != WXK_RIGHT && key != WXK_TAB && key != WXK_UP && key != WXK_DOWN &&
+ key != WXK_LEFT && key != WXK_RIGHT && key != WXK_TAB && key != WXK_UP && key != WXK_DOWN &&
key != WXK_BACK && key != WXK_DELETE && !( key == WXK_RETURN && (m_windowStyle & wxTE_PROCESS_ENTER) ) &&
from == to )
{
#include "wx/tglbtn.h"
#include "wx/osx/private.h"
-#include "wx/bmpbuttn.h" // for wxDEFAULT_BUTTON_MARGIN
+#include "wx/bmpbuttn.h" // for wxDEFAULT_BUTTON_MARGIN
// ----------------------------------------------------------------------------
// macros
const wxString& name)
{
m_macIsUserPane = FALSE ;
-
+
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false;
-
+
m_labelOrig = m_label = label ;
m_peer = wxWidgetImpl::CreateToggleButton( this, parent, id, label, pos, size, style, GetExtraStyle() ) ;
MacPostControlCreate(pos,size) ;
-
+
return TRUE;
}
wxSize wxToggleButton::DoGetBestSize() const
{
- int wBtn = 70 ;
+ int wBtn = 70 ;
int hBtn = 20 ;
int lBtn = m_label.Length() * 8 + 12 ;
- if (lBtn > wBtn)
+ if (lBtn > wBtn)
wBtn = lBtn;
return wxSize ( wBtn , hBtn ) ;
ProcessCommand(event);
}
-bool wxToggleButton::OSXHandleClicked( double WXUNUSED(timestampsec) )
+bool wxToggleButton::OSXHandleClicked( double WXUNUSED(timestampsec) )
{
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());
const wxString& name)
{
m_macIsUserPane = FALSE ;
-
+
m_bitmap = label;
-
+
m_marginX =
m_marginY = wxDEFAULT_BUTTON_MARGIN;
-
+
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false;
-
+
m_peer = wxWidgetImpl::CreateBitmapToggleButton( this, parent, id, label, pos, size, style, GetExtraStyle() ) ;
MacPostControlCreate(pos,size) ;
-
+
return TRUE;
}
ProcessCommand(event);
}
-bool wxBitmapToggleButton::OSXHandleClicked( double WXUNUSED(timestampsec) )
+bool wxBitmapToggleButton::OSXHandleClicked( double WXUNUSED(timestampsec) )
{
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());
#ifndef __WXUNIVERSAL__
// Don't give scrollbars to wxControls unless they ask for them
- if ( (! IsKindOf(CLASSINFO(wxControl))
+ if ( (! IsKindOf(CLASSINFO(wxControl))
#if wxUSE_STATUSBAR
&& ! IsKindOf(CLASSINFO(wxStatusBar))
#endif
r.width =
r.height = 16 ;
- if ( 0 )
+ if ( 0 )
{
}
#if wxUSE_SCROLLBAR
IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl, wxPalmDCImpl)
-wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
: wxPalmDCImpl( owner )
{
- CreateCompatible(NULL);
- Init();
+ CreateCompatible(NULL);
+ Init();
}
-wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap )
- : wxPalmDCImpl( owner )
-{
- CreateCompatible(NULL);
- Init();
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap )
+ : wxPalmDCImpl( owner )
+{
+ CreateCompatible(NULL);
+ Init();
DoSelect(bitmap);
}
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc )
- : wxPalmDCImpl( owner )
+ : wxPalmDCImpl( owner )
{
wxCHECK_RET( dc, wxT("NULL dc in wxMemoryDC ctor") );
}
else if ( event.GetEventType() == wxEVT_COMMAND_COMBOBOX_SELECTED )
{
- // Must override index detection since at this point GetIndex()
- // will return old value.
- wxOwnerDrawnComboBox* cb =
- static_cast<wxOwnerDrawnComboBox*>(propgrid->GetEditorControl());
-
- if ( cb )
- {
- int index = cb->GetSelection();
-
- if ( index == GetCustomColourIndex() &&
- !(m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR) )
- askColour = true;
- }
+ // Must override index detection since at this point GetIndex()
+ // will return old value.
+ wxOwnerDrawnComboBox* cb =
+ static_cast<wxOwnerDrawnComboBox*>(propgrid->GetEditorControl());
+
+ if ( cb )
+ {
+ int index = cb->GetSelection();
+
+ if ( index == GetCustomColourIndex() &&
+ !(m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR) )
+ askColour = true;
+ }
}
if ( askColour && !propgrid->WasValueChangedInEvent() )
#define wxPG_TEXTCTRL_AND_BUTTON_SPACING 4
#else
#define wxPG_TEXTCTRL_AND_BUTTON_SPACING 2
-#endif
+#endif
#define wxPG_BUTTON_SIZEDEC 0
// for odcombo
#ifdef __WXMAC__
#define wxPG_CHOICEXADJUST -3 // required because wxComboCtrl reserves 3pixels for wxTextCtrl's focus ring
-#define wxPG_CHOICEYADJUST -3
+#define wxPG_CHOICEYADJUST -3
#else
#define wxPG_CHOICEXADJUST 0
#define wxPG_CHOICEYADJUST 0
return false;
}
}
- return wxPGChoiceEditor_SetCustomPaintWidth( propGrid, cb, cmnValIndex );
+ return wxPGChoiceEditor_SetCustomPaintWidth( propGrid, cb, cmnValIndex );
}
return false;
}
cb->m_state |= wxSCB_STATE_CHECKED;
// Makes sure wxPG_EVT_CHANGING etc. is sent for this initial
- // click
+ // click
propGrid->ChangePropertyValue(property,
wxPGVariant_Bool(cb->m_state));
}
if ( m_selColumn == -1 )
return;
- if ( GetSelection() && (m_wndEditor || m_wndEditor2) )
+ if ( GetSelection() && (m_wndEditor || m_wndEditor2) )
{
wxRect r = GetEditorWidgetRect(GetSelection(), m_selColumn);
#endif
SetupTextCtrlValue(value);
tc->Create(ctrlParent,id,value, p, s,tcFlags);
-
+
// Center the control vertically
if ( !hasSpecialSize )
FixPosForTextCtrl(tc);
p.x = pos.x + sz.x - but->GetSize().x - 2;
but->Move(p);
-#else
+#else
wxSize s(sz.y-(wxPG_BUTTON_SIZEDEC*2)+(wxPG_NAT_BUTTON_BORDER_Y*2),
sz.y-(wxPG_BUTTON_SIZEDEC*2)+(wxPG_NAT_BUTTON_BORDER_Y*2));
size_t wxPropertyGridManager::GetPageCount() const
{
- if ( !(m_iFlags & wxPG_MAN_FL_PAGE_INSERTED) )
- return 0;
+ if ( !(m_iFlags & wxPG_MAN_FL_PAGE_INSERTED) )
+ return 0;
- return m_arrPages.size();
+ return m_arrPages.size();
}
// -----------------------------------------------------------------------
if ( editor )
{
- wxRect rect2(rect);
+ wxRect rect2(rect);
rect2.x += xOffset;
rect2.y += yOffset;
rect2.height -= yOffset;
/*
wxString wxPGProperty::GetColumnText( unsigned int col, int choiceIndex ) const
{
-
+
if ( col != 1 || choiceIndex == wxNOT_FOUND )
{
const wxPGCell& cell = GetCell(col);
argFlags|wxPG_COMPOSITE_FRAGMENT);
}
}
-
+
if ( childResults && curChild->GetChildCount() )
(*childResults)[curChild->GetName()] = s;
if ( m_textExtent > 0 )
return m_textExtent;
int x = 0, y = 0;
- ((wxWindow*)wnd)->GetTextExtent( m_label, &x, &y, 0, 0, &font );
+ ((wxWindow*)wnd)->GetTextExtent( m_label, &x, &y, 0, 0, &font );
return x;
}
void wxPropertyCategory::CalculateTextExtent( wxWindow* wnd, const wxFont& font )
{
int x = 0, y = 0;
- wnd->GetTextExtent( m_label, &x, &y, 0, 0, &font );
+ wnd->GetTextExtent( m_label, &x, &y, 0, 0, &font );
m_textExtent = x;
}
void wxPropertyGrid::RefreshEditor()
{
wxPGProperty* p = GetSelection();
- if ( !p )
+ if ( !p )
return;
wxWindow* wnd = GetEditorControl();
wxPGProperty* wxPropertyGridInterface::Append( wxPGProperty* property )
{
wxPGProperty* retp = m_pState->DoAppend(property);
-
+
wxPropertyGrid* grid = m_pState->GetGrid();
if ( grid )
grid->RefreshGrid();
if ( includedStates & ExpandedState )
{
wxArrayPGProperty ptrs;
- wxPropertyGridConstIterator it =
+ wxPropertyGridConstIterator it =
wxPropertyGridConstIterator( pageState,
wxPG_ITERATE_ALL_PARENTS_RECURSIVELY|wxPG_ITERATE_HIDDEN,
wxNullProperty );
{
if ( restoreStates & ExpandedState )
{
- wxPropertyGridIterator it =
+ wxPropertyGridIterator it =
wxPropertyGridIterator( pageState,
wxPG_ITERATE_ALL,
wxNullProperty );
wxASSERT( item->GetParentState() == this );
- wxPropertyGrid* pg = GetGrid();
+ wxPropertyGrid* pg = GetGrid();
if ( DoIsPropertySelected(item) )
{
}
}
- if ( item->GetBaseName().length() &&
+ if ( item->GetBaseName().length() &&
(parent->IsCategory() || parent->IsRoot()) )
m_dictName.erase(item->GetBaseName());
- // We need to clear parent grid's m_propHover, if it matches item
- if ( pg && pg->m_propHover == item )
- pg->m_propHover = NULL;
+ // We need to clear parent grid's m_propHover, if it matches item
+ if ( pg && pg->m_propHover == item )
+ pg->m_propHover = NULL;
// We can actually delete it now
if ( doDelete )
}
else if ( value.GetType() == wxPG_VARIANT_TYPE_LONGLONG )
{
- wxLongLong ll = value.GetLongLong();
- return ll.ToString();
+ wxLongLong ll = value.GetLongLong();
+ return ll.ToString();
}
return wxEmptyString;
dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
}
- wxCoord x_orig = x;
+ wxCoord x_orig = x;
while (hasTabs)
{
// the string has a tab
wxRichTextBuffer::GetRenderer()->EnumerateStandardBulletNames(standardBulletNames);
if (sel < (int) standardBulletNames.GetCount() && m_bulletNameCtrl->GetValue() == selName)
attr->SetBulletName(standardBulletNames[sel]);
- else
+ else
attr->SetBulletName(m_bulletNameCtrl->GetValue());
}
else
str << wxString::Format(wxT("<p align=\"%s\""), align.c_str());
if (thisStyle.HasParagraphSpacingAfter() && thisStyle.GetParagraphSpacingAfter() == 0)
- str << wxT(" style=\"line-height: 0px\"");
+ str << wxT(" style=\"line-height: 0px\"");
str << wxT(">");
m_pageBreaksStart.Clear();
m_pageBreaksEnd.Clear();
-
+
int lastStartPos = 0;
-
+
wxRect rect, headerRect, footerRect;
/// Sets the DC scaling and returns important page rectangles
GetRichTextBuffer()->Invalidate(wxRICHTEXT_ALL);
GetRichTextBuffer()->Layout(*GetDC(), rect, wxRICHTEXT_FIXED_WIDTH|wxRICHTEXT_VARIABLE_HEIGHT);
-
+
// Now calculate the page breaks
-
+
int yOffset = 0;
-
+
wxRichTextLine* lastLine = NULL;
-
+
wxRichTextObjectList::compatibility_iterator node = GetRichTextBuffer()->GetChildren().GetFirst();
while (node)
{
// child is a paragraph
wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph);
wxASSERT (child != NULL);
-
+
wxRichTextLineList::compatibility_iterator node2 = child->GetLines().GetFirst();
while (node2)
{
line->SetPosition(wxPoint(line->GetPosition().x, line->GetPosition().y - yOffset));
int lineY = child->GetPosition().y + line->GetPosition().y;
-
+
// Break the page if either we're going off the bottom, or this paragraph specifies
// an explicit page break
-
+
if (((lineY + line->GetSize().y) > rect.GetBottom()) ||
((node2 == child->GetLines().GetFirst()) && child->GetAttributes().HasPageBreak()))
{
// New page starting at this line
int newY = rect.y;
-
+
// We increase the offset by the difference between new and old positions
-
+
int increaseOffsetBy = lineY - newY;
yOffset += increaseOffsetBy;
-
+
line->SetPosition(wxPoint(line->GetPosition().x, newY - child->GetPosition().y));
if (!lastLine)
lastLine = line;
-
+
m_pageBreaksStart.Add(lastStartPos);
m_pageBreaksEnd.Add(lastLine->GetAbsoluteRange().GetEnd());
-
+
lastStartPos = line->GetAbsoluteRange().GetStart();
-
+
m_numPages ++;
}
-
+
lastLine = line;
node2 = node2->GetNext();
return;
wxBusyCursor wait;
-
+
wxRect textRect, headerRect, footerRect;
/// Sets the DC scaling and returns important page rectangles
dc->SetTextForeground(*wxBLACK);
dc->SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
- // Draw header, if any
+ // Draw header, if any
wxRichTextOddEvenPage oddEven = ((page % 2) == 1) ? wxRICHTEXT_PAGE_ODD : wxRICHTEXT_PAGE_EVEN;
wxString headerTextCentre = m_headerFooterData.GetHeaderText(oddEven, wxRICHTEXT_PAGE_CENTRE);
//int tx, ty;
//dc->GetTextExtent(headerTextLeft, & tx, & ty);
-
+
int x = headerRect.GetLeft();
int y = headerRect.GetX();
dc->DrawText(headerTextLeft, x, y);
dc->DrawText(headerTextRight, x, y);
}
- // Draw footer, if any
+ // Draw footer, if any
wxString footerTextCentre = m_headerFooterData.GetFooterText(oddEven, wxRICHTEXT_PAGE_CENTRE);
wxString footerTextLeft = m_headerFooterData.GetFooterText(oddEven, wxRICHTEXT_PAGE_LEFT);
wxString footerTextRight = m_headerFooterData.GetFooterText(oddEven, wxRICHTEXT_PAGE_RIGHT);
int y = footerRect.GetBottom() - ty;
dc->DrawText(footerTextRight, x, y);
}
- }
+ }
wxRichTextRange rangeToDraw(m_pageBreaksStart[page-1], m_pageBreaksEnd[page-1]);
int w, h;
dc->GetSize(&w, &h);
GetPageSizePixels(&pageWidth, &pageHeight);
-
+
// If printer pageWidth == current DC width, then this doesn't
// change. But w might be the preview bitmap width, so scale down.
float previewScale = (float)(w/(float)pageWidth);
// during printing to be correct when scaling is applied.
if (!IsPreview())
m_richTextBuffer->SetScale(scale);
-
+
// Calculate margins
int marginLeft = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_marginLeft);
int marginTop = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_marginTop);
int marginRight = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_marginRight);
int marginBottom = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_marginBottom);
-
+
// Header and footer margins
int headerMargin = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_headerFooterData.GetHeaderMargin());
int footerMargin = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_headerFooterData.GetFooterMargin());
-
+
dc->SetUserScale(overallScale, overallScale);
wxRect rect((int) (marginLeft/scale), (int) (marginTop/scale),
(int) ((pageWidth - marginLeft - marginRight)/scale), (int)((pageHeight - marginTop - marginBottom)/scale));
-
+
headerRect = wxRect(0, 0, 0, 0);
if (!m_headerFooterData.GetHeaderText(wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT).IsEmpty() ||
dc->SetFont(m_headerFooterData.GetFont());
else
dc->SetFont(*wxNORMAL_FONT);
-
+
int charHeight = dc->GetCharHeight();
-
+
int headerHeight = (int) (charHeight + headerMargin/scale);
headerRect = wxRect(rect.x, rect.y, rect.width, headerHeight);
rect.y += headerHeight;
- rect.height -= headerHeight;
+ rect.height -= headerHeight;
}
footerRect = wxRect(0, 0, 0, 0);
dc->SetFont(m_headerFooterData.GetFont());
else
dc->SetFont(*wxNORMAL_FONT);
-
+
int charHeight = dc->GetCharHeight();
-
+
int footerHeight = (int) (charHeight + footerMargin/scale);
footerRect = wxRect(rect.x, rect.y + rect.height, rect.width, footerHeight);
- rect.height -= footerHeight;
+ rect.height -= footerHeight;
}
textRect = rect;
m_parentWindow = parentWindow;
m_title = name;
m_printData = NULL;
-
+
m_previewRect = wxRect(wxPoint(100, 100), wxSize(800, 800));
m_pageSetupData = new wxPageSetupDialogData;
}
else
SetRichTextBufferPrinting(new wxRichTextBuffer(*m_richTextBufferPreview));
-
+
wxRichTextPrintout *p1 = CreatePrintout();
p1->SetRichTextBuffer(m_richTextBufferPreview);
wxRichTextPrintout *p1 = CreatePrintout();
p1->SetRichTextBuffer(m_richTextBufferPreview);
-
+
wxRichTextPrintout *p2 = CreatePrintout();
p2->SetRichTextBuffer(m_richTextBufferPrinting);
int size = 3;
#endif
- // Guess a standard font size
+ // Guess a standard font size
int stdFontSize = 0;
// First see if we have a default/normal style to base the size on
size_t i;
for (i = 0; i < m_styleNames.GetCount(); i++)
{
- wxString name = m_styleNames[i].Lower();
- if (name.Find(wxT("normal")) != wxNOT_FOUND || name.Find(normalTranslated) != wxNOT_FOUND ||
- name.Find(wxT("default")) != wxNOT_FOUND || name.Find(defaultTranslated) != wxNOT_FOUND)
- {
- wxRichTextStyleDefinition* d = GetStyleSheet()->FindStyle(m_styleNames[i]);
- if (d)
- {
- wxRichTextAttr attr2(d->GetStyleMergedWithBase(GetStyleSheet()));
- if (attr2.HasFontSize())
- {
- stdFontSize = attr2.GetFontSize();
- break;
- }
- }
- }
- }
+ wxString name = m_styleNames[i].Lower();
+ if (name.Find(wxT("normal")) != wxNOT_FOUND || name.Find(normalTranslated) != wxNOT_FOUND ||
+ name.Find(wxT("default")) != wxNOT_FOUND || name.Find(defaultTranslated) != wxNOT_FOUND)
+ {
+ wxRichTextStyleDefinition* d = GetStyleSheet()->FindStyle(m_styleNames[i]);
+ if (d)
+ {
+ wxRichTextAttr attr2(d->GetStyleMergedWithBase(GetStyleSheet()));
+ if (attr2.HasFontSize())
+ {
+ stdFontSize = attr2.GetFontSize();
+ break;
+ }
+ }
+ }
+ }
if (stdFontSize == 0)
{
{
if (sizes[i] > mostCommonSize)
mostCommonSize = i;
- }
+ }
if (mostCommonSize > 0)
stdFontSize = mostCommonSize;
}
if (stdFontSize == 0)
- stdFontSize = 12;
+ stdFontSize = 12;
int thisFontSize = ((attr.GetFlags() & wxTEXT_ATTR_FONT_SIZE) != 0) ? attr.GetFontSize() : stdFontSize;
g_free(families);
- // Some gtk+ systems might query for a non-existing font from
+ // Some gtk+ systems might query for a non-existing font from
// wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) on initialization,
// don't assert until wxSystemSettings::GetFont is checked for this - MR
// wxASSERT_MSG( family, "No appropriate PangoFontFamily found for ::description" );
int i, round; // counters
- // first round: search for equal, then for smaller and for larger size
+ // first round: search for equal, then for smaller and for larger size
// with the given weight and style
int testweight = weight;
int teststyle = style;
wxGStreamerMediaBackend* be)
{
gdk_flush();
-
+
GdkWindow *window = widget->window;
wxASSERT(window);
else
{
gdk_flush();
-
+
GdkWindow *window = m_ctrl->m_wxwindow->window;
wxASSERT(window);
#endif
ext.Remove( 0, 2 );
wxArrayString exts;
exts.Add( ext );
-
+
AddToMimeData(mime, wxEmptyString, NULL, exts, wxEmptyString, true );
}
}
// found
wxFileType *fileType = new wxFileType;
fileType->m_impl->Init(this, n);
-
+
return fileType;
}
}
/// Hang up the currently active dial up connection.
virtual bool HangUp();
-
+
// returns TRUE if the computer is connected to the network: under Windows,
// this just means that a RAS connection exists, under Unix we check that
// the "well-known host" (as specified by SetWellKnownHost) is reachable
private:
/// -1: don´t know, 0 = no, 1 = yes
int m_IsOnline;
-
+
/// Can we use ifconfig to list active devices?
int m_CanUseIfconfig;
/// The path to ifconfig
3. check /proc/net/dev on linux??
This method should be preferred, if possible. Need to do more
testing.
-
+
*/
void
if(m_CanUseIfconfig != 0) // unknown or yes
{
wxASSERT(m_IfconfigPath.length());
-
+
wxString tmpfile = wxFileName::CreateTempFileName("_wxdialuptest");
wxString cmd = "/bin/sh -c \'";
cmd << m_IfconfigPath << " >" << tmpfile << '\'';
/* I tried to add an option to wxExecute() to not close stdout,
so we could let ifconfig write directly to the tmpfile, but
- this does not work. That should be faster, as it doesn´t call
+ this does not work. That should be faster, as it doesn´t call
the shell first. I have no idea why. :-( (KB) */
#if 0
// temporarily redirect stdout/stderr:
// This can be used under Win 9x, too!
struct hostent *hp;
struct sockaddr_in serv_addr;
- int sockfd;
+ int sockfd;
m_IsOnline = 0; // assume false
if((hp = gethostbyname(m_BeaconHost)) == NULL)
return; // no DNS no net
-
- serv_addr.sin_family = hp->h_addrtype;
+
+ serv_addr.sin_family = hp->h_addrtype;
memcpy(&serv_addr.sin_addr,hp->h_addr, hp->h_length);
- serv_addr.sin_port = htons(m_BeaconPort);
- if( ( sockfd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0)
- {
+ serv_addr.sin_port = htons(m_BeaconPort);
+ if( ( sockfd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0)
+ {
// sys_error("cannot create socket for gw");
return;
}
if( connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0)
- {
+ {
//sys_error("cannot connect to server");
return;
}
const wxString desc = wxGetCommandOutput(wxT("lsb_release --description"));
const wxString rel = wxGetCommandOutput(wxT("lsb_release --release"));
const wxString codename = wxGetCommandOutput(wxT("lsb_release --codename"));
-
+
wxLinuxDistributionInfo ret;
-
+
id.StartsWith("Distributor ID:\t", &ret.Id);
desc.StartsWith("Description:\t", &ret.Description);
rel.StartsWith("Release:\t", &ret.Release);
#else // !wxUSE_NANOX
Window xroot = RootWindow(m_display, xscreen);
- *(depth == 1 ? &m_bitmap : &m_pixmap) =
+ *(depth == 1 ? &m_bitmap : &m_pixmap) =
XCreatePixmap(m_display, xroot, width, height, depth);
#endif // wxUSE_NANOX/!wxUSE_NANOX
// wxUSE_NANOX/!wxUSE_NANOX
bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
- wxDC *source, wxCoord xsrc, wxCoord ysrc,
+ wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode logical_func, bool useMask,
wxCoord xsrcMask, wxCoord ysrcMask )
{
wxMemoryDCImpl::wxMemoryDCImpl( wxDC *owner )
: wxWindowDCImpl( owner )
-{
+{
Init();
}
wxMemoryDCImpl::wxMemoryDCImpl( wxDC *owner, wxBitmap& bitmap )
: wxWindowDCImpl( owner )
-{
- Init();
+{
+ Init();
DoSelect(bitmap);
}
}
switch ( wxToupper( m_nativeFontInfo.
- GetXFontComponent(wxXLFD_SLANT)[0u]).GetValue() )
+ GetXFontComponent(wxXLFD_SLANT)[0u]).GetValue() )
{
case wxT('I'): // italique
m_style = wxFONTSTYLE_ITALIC;
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
/**
- * This file gets included from dcclient.cpp and implements
- * the X11 interface to Pango.
+ * This file gets included from dcclient.cpp and implements
+ * the X11 interface to Pango.
* Copyright (C) Owen Taylor and Robert Roebling.
* Licence: The wxWindows licence
*/
int y,
PangoGlyphString *glyphs,
wxColour &colour );
-
-void
+
+void
x11_draw_layout_line_with_colors( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayoutLine *line,
wxColour &colour );
-
-void
+
+void
x11_draw_layout_with_colors( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayout *layout,
wxColour &colour );
-
-void
+
+void
x11_draw_layout( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayout *layout,
wxColour &colour);
-
+
void
x11_pango_get_item_properties( PangoItem *item,
PangoUnderline *uline,
color.color.blue = colour.Blue() << 8;
color.color.alpha = 65000;
pango_xft_render( draw, &color, font, glyphs, x, y );
-
+
XftDrawDestroy( draw );
}
else
}
}
-void
+void
x11_draw_layout_line_with_colors( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayoutLine *line,
wxColour &colour )
gint rise = 0;
context = pango_layout_get_context (line->layout);
-
+
pango_layout_line_get_extents (line,NULL, &overall_rect);
-
+
GSList *tmp_list = line->runs;
while (tmp_list)
{
PangoColor fg_color, bg_color;
gboolean strike, fg_set, bg_set, shape_set;
gint risen_y;
-
+
tmp_list = tmp_list->next;
-
- x11_pango_get_item_properties (run->item, &uline,
- &strike, &rise, &fg_color, &fg_set, &bg_color, &bg_set,
+
+ x11_pango_get_item_properties (run->item, &uline,
+ &strike, &rise, &fg_color, &fg_set, &bg_color, &bg_set,
&shape_set, &ink_rect, &logical_rect);
/* we subtract the rise because X coordinates are upside down */
risen_y = y - rise / PANGO_SCALE;
-
+
if (!shape_set)
{
if (uline == PANGO_UNDERLINE_NONE)
{
int gx = x + x_off / PANGO_SCALE;
int gy = risen_y;
-
+
x11_draw_glyphs( drawable, gc, run->item->analysis.font, gx, gy, run->glyphs, colour );
}
-
+
if (uline == PANGO_UNDERLINE_SINGLE)
- {
+ {
XDrawLine( wxGlobalDisplay(), drawable, gc,
x + (x_off + ink_rect.x) / PANGO_SCALE - 1,
risen_y + 1,
}
}
-void
+void
x11_draw_layout_with_colors( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayout *layout,
wxColour &colour )
{
PangoLayoutIter *iter = pango_layout_get_iter (layout);
-
+
do
{
PangoLayoutLine *line = pango_layout_iter_get_line (iter);
-
+
PangoRectangle logical_rect;
pango_layout_iter_get_line_extents (iter, NULL, &logical_rect);
-
+
int baseline = pango_layout_iter_get_baseline (iter);
-
+
x11_draw_layout_line_with_colors( drawable, gc,
x + logical_rect.x / PANGO_SCALE,
y + baseline / PANGO_SCALE,
line,
colour );
-
+
} while (pango_layout_iter_next_line (iter));
pango_layout_iter_free (iter);
}
-void
+void
x11_draw_layout( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayout *layout,
wxColour &colour)
if (strikethrough)
*strikethrough = FALSE;
-
+
if (fg_set)
*fg_set = FALSE;
-
+
if (bg_set)
*bg_set = FALSE;
if (strikethrough)
*strikethrough = ((PangoAttrInt *)attr)->value;
break;
-
+
case PANGO_ATTR_FOREGROUND:
if (fg_color)
*fg_color = ((PangoAttrColor *)attr)->color;
if (fg_set)
*fg_set = TRUE;
-
+
break;
-
+
case PANGO_ATTR_BACKGROUND:
if (bg_color)
*bg_color = ((PangoAttrColor *)attr)->color;
if (bg_set)
*bg_set = TRUE;
-
+
break;
case PANGO_ATTR_SHAPE:
if (rise)
*rise = ((PangoAttrInt *)attr)->value;
break;
-
+
default:
break;
}
/**
- * This file gets included from dcclient.cpp and implements
- * the X11 interface to Pango.
+ * This file gets included from dcclient.cpp and implements
+ * the X11 interface to Pango.
* Copyright (C) Owen Taylor and Robert Roebling.
* Licence: The wxWindows licence
*/
int x,
int y,
PangoGlyphString *glyphs);
-
-void
+
+void
x11_draw_layout_line_with_colors( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayoutLine *line,
XColor *foreground,
XColor *background);
-
-void
+
+void
x11_draw_layout_with_colors( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayout *layout,
XColor *foreground,
XColor *background);
-
-void
+
+void
x11_draw_layout( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayout *layout);
-
+
void
x11_pango_get_item_properties( PangoItem *item,
PangoUnderline *uline,
}
}
-void
+void
x11_draw_layout_line_with_colors( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayoutLine *line,
XColor *foreground,
gint rise = 0;
context = pango_layout_get_context (line->layout);
-
+
pango_layout_line_get_extents (line,NULL, &overall_rect);
-
+
GSList *tmp_list = line->runs;
while (tmp_list)
{
PangoColor fg_color, bg_color;
gboolean strike, fg_set, bg_set, shape_set;
gint risen_y;
-
+
tmp_list = tmp_list->next;
-
- x11_pango_get_item_properties (run->item, &uline,
- &strike, &rise, &fg_color, &fg_set, &bg_color, &bg_set,
+
+ x11_pango_get_item_properties (run->item, &uline,
+ &strike, &rise, &fg_color, &fg_set, &bg_color, &bg_set,
&shape_set, &ink_rect, &logical_rect);
/* we subtract the rise because X coordinates are upside down */
risen_y = y - rise / PANGO_SCALE;
-
+
if (!shape_set)
{
if (uline == PANGO_UNDERLINE_NONE)
{
int gx = x + x_off / PANGO_SCALE;
int gy = risen_y;
-
+
x11_draw_glyphs( drawable, gc, run->item->analysis.font, gx, gy, run->glyphs);
}
-
+
if (uline == PANGO_UNDERLINE_SINGLE)
- {
+ {
XDrawLine( wxGlobalDisplay(), drawable, gc,
x + (x_off + ink_rect.x) / PANGO_SCALE - 1,
risen_y + 1,
}
}
-void
+void
x11_draw_layout_with_colors( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayout *layout,
XColor *foreground,
XColor *background)
{
PangoLayoutIter *iter = pango_layout_get_iter (layout);
-
+
do
{
PangoLayoutLine *line = pango_layout_iter_get_line (iter);
-
+
PangoRectangle logical_rect;
pango_layout_iter_get_line_extents (iter, NULL, &logical_rect);
-
+
int baseline = pango_layout_iter_get_baseline (iter);
-
+
x11_draw_layout_line_with_colors( drawable, gc,
x + logical_rect.x / PANGO_SCALE,
y + baseline / PANGO_SCALE,
line,
foreground,
background);
-
+
} while (pango_layout_iter_next_line (iter));
pango_layout_iter_free (iter);
}
-void
+void
x11_draw_layout( Drawable drawable,
GC gc,
- int x,
+ int x,
int y,
PangoLayout *layout)
{
if (strikethrough)
*strikethrough = FALSE;
-
+
if (fg_set)
*fg_set = FALSE;
-
+
if (bg_set)
*bg_set = FALSE;
if (strikethrough)
*strikethrough = ((PangoAttrInt *)attr)->value;
break;
-
+
case PANGO_ATTR_FOREGROUND:
if (fg_color)
*fg_color = ((PangoAttrColor *)attr)->color;
if (fg_set)
*fg_set = TRUE;
-
+
break;
-
+
case PANGO_ATTR_BACKGROUND:
if (bg_color)
*bg_color = ((PangoAttrColor *)attr)->color;
if (bg_set)
*bg_set = TRUE;
-
+
break;
case PANGO_ATTR_SHAPE:
if (rise)
*rise = ((PangoAttrInt *)attr)->value;
break;
-
+
default:
break;
}
IMPLEMENT_DYNAMIC_CLASS(wxCollapsiblePaneXmlHandler, wxXmlResourceHandler)
-wxCollapsiblePaneXmlHandler::wxCollapsiblePaneXmlHandler()
+wxCollapsiblePaneXmlHandler::wxCollapsiblePaneXmlHandler()
: wxXmlResourceHandler(), m_isInside(false)
{
XRC_ADD_STYLE(wxCP_NO_TLW_RESIZE);