renaming
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54117 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
5
include/wx/osx/accel.h
Normal file
5
include/wx/osx/accel.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
#include "wx/mac/classic/accel.h"
|
||||||
|
#else
|
||||||
|
#include "wx/mac/carbon/accel.h"
|
||||||
|
#endif
|
5
include/wx/osx/app.h
Normal file
5
include/wx/osx/app.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
#include "wx/mac/classic/app.h"
|
||||||
|
#else
|
||||||
|
#include "wx/mac/carbon/app.h"
|
||||||
|
#endif
|
5
include/wx/osx/bitmap.h
Normal file
5
include/wx/osx/bitmap.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
#include "wx/mac/classic/bitmap.h"
|
||||||
|
#else
|
||||||
|
#include "wx/mac/carbon/bitmap.h"
|
||||||
|
#endif
|
5
include/wx/osx/bmpbuttn.h
Normal file
5
include/wx/osx/bmpbuttn.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
#include "wx/mac/classic/bmpbuttn.h"
|
||||||
|
#else
|
||||||
|
#include "wx/mac/carbon/bmpbuttn.h"
|
||||||
|
#endif
|
5
include/wx/osx/brush.h
Normal file
5
include/wx/osx/brush.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
#include "wx/mac/classic/brush.h"
|
||||||
|
#else
|
||||||
|
#include "wx/mac/carbon/brush.h"
|
||||||
|
#endif
|
5
include/wx/osx/button.h
Normal file
5
include/wx/osx/button.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
#include "wx/mac/classic/button.h"
|
||||||
|
#else
|
||||||
|
#include "wx/mac/carbon/button.h"
|
||||||
|
#endif
|
36
include/wx/osx/carbon/accel.h
Normal file
36
include/wx/osx/carbon/accel.h
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: accel.h
|
||||||
|
// Purpose: wxAcceleratorTable class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_ACCEL_H_
|
||||||
|
#define _WX_ACCEL_H_
|
||||||
|
|
||||||
|
#include "wx/string.h"
|
||||||
|
#include "wx/event.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxAcceleratorTable: public wxObject
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
|
||||||
|
public:
|
||||||
|
wxAcceleratorTable();
|
||||||
|
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array
|
||||||
|
|
||||||
|
virtual ~wxAcceleratorTable();
|
||||||
|
|
||||||
|
bool Ok() const { return IsOk(); }
|
||||||
|
bool IsOk() const;
|
||||||
|
|
||||||
|
int GetCommand( wxKeyEvent &event );
|
||||||
|
};
|
||||||
|
|
||||||
|
// WXDLLIMPEXP_DATA_CORE(extern wxAcceleratorTable) wxNullAcceleratorTable;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_ACCEL_H_
|
135
include/wx/osx/carbon/app.h
Normal file
135
include/wx/osx/carbon/app.h
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: app.h
|
||||||
|
// Purpose: wxApp class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_APP_H_
|
||||||
|
#define _WX_APP_H_
|
||||||
|
|
||||||
|
#include "wx/defs.h"
|
||||||
|
#include "wx/object.h"
|
||||||
|
#include "wx/gdicmn.h"
|
||||||
|
#include "wx/event.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxFrame;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxWindowMac;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxApp ;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
|
||||||
|
class WXDLLIMPEXP_FWD_BASE wxLog;
|
||||||
|
|
||||||
|
// Force an exit from main loop
|
||||||
|
void WXDLLIMPEXP_CORE wxExit();
|
||||||
|
|
||||||
|
// Yield to other apps/messages
|
||||||
|
bool WXDLLIMPEXP_CORE wxYield();
|
||||||
|
|
||||||
|
// Represents the application. Derive OnInit and declare
|
||||||
|
// a new App object to start application
|
||||||
|
class WXDLLIMPEXP_CORE wxApp: public wxAppBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||||
|
|
||||||
|
wxApp();
|
||||||
|
virtual ~wxApp() {}
|
||||||
|
|
||||||
|
virtual bool Yield(bool onlyIfNeeded = FALSE);
|
||||||
|
virtual void WakeUpIdle();
|
||||||
|
|
||||||
|
virtual void SetPrintMode(int mode) { m_printMode = mode; }
|
||||||
|
virtual int GetPrintMode() const { return m_printMode; }
|
||||||
|
|
||||||
|
#if wxUSE_GUI
|
||||||
|
// setting up all MacOS Specific Event-Handlers etc
|
||||||
|
virtual bool OnInitGui();
|
||||||
|
#endif // wxUSE_GUI
|
||||||
|
// implementation only
|
||||||
|
void OnIdle(wxIdleEvent& event);
|
||||||
|
void OnEndSession(wxCloseEvent& event);
|
||||||
|
void OnQueryEndSession(wxCloseEvent& event);
|
||||||
|
|
||||||
|
void MacDoOneEvent() ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
static bool sm_isEmbedded;
|
||||||
|
// Implementation
|
||||||
|
virtual bool Initialize(int& argc, wxChar **argv);
|
||||||
|
virtual void CleanUp();
|
||||||
|
|
||||||
|
// the installed application event handler
|
||||||
|
WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; }
|
||||||
|
WXEVENTHANDLERREF MacGetCurrentEventHandlerCallRef() { return m_macCurrentEventHandlerCallRef ; }
|
||||||
|
void MacSetCurrentEvent( WXEVENTREF event , WXEVENTHANDLERCALLREF handler )
|
||||||
|
{ m_macCurrentEvent = event ; m_macCurrentEventHandlerCallRef = handler ; }
|
||||||
|
|
||||||
|
// adding a CFType object to be released only at the end of the current event cycle (increases the
|
||||||
|
// refcount of the object passed), needed in case we are in the middle of an event concering an object
|
||||||
|
// we want to delete and cannot do it immediately
|
||||||
|
// TODO change semantics to be in line with cocoa (make autrelease NOT increase the count)
|
||||||
|
void MacAddToAutorelease( void* cfrefobj );
|
||||||
|
public:
|
||||||
|
static wxWindow* s_captureWindow ;
|
||||||
|
static long s_lastModifiers ;
|
||||||
|
|
||||||
|
int m_nCmdShow;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// mac specifics
|
||||||
|
|
||||||
|
WXEVENTHANDLERREF m_macEventHandler ;
|
||||||
|
WXEVENTHANDLERCALLREF m_macCurrentEventHandlerCallRef ;
|
||||||
|
WXEVENTREF m_macCurrentEvent ;
|
||||||
|
CFRunLoopSourceRef m_macEventPosted ;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static long s_macAboutMenuItemId ;
|
||||||
|
static long s_macPreferencesMenuItemId ;
|
||||||
|
static long s_macExitMenuItemId ;
|
||||||
|
static wxString s_macHelpMenuTitleName ;
|
||||||
|
|
||||||
|
WXEVENTREF MacGetCurrentEvent() { return m_macCurrentEvent ; }
|
||||||
|
void MacHandleOneEvent( WXEVENTREF ev ) ;
|
||||||
|
|
||||||
|
// For embedded use. By default does nothing.
|
||||||
|
virtual void MacHandleUnhandledEvent( WXEVENTREF ev );
|
||||||
|
|
||||||
|
bool MacSendKeyDownEvent( wxWindow* focus , long keyval , long modifiers , long when , short wherex , short wherey , wxChar uniChar ) ;
|
||||||
|
bool MacSendKeyUpEvent( wxWindow* focus , long keyval , long modifiers , long when , short wherex , short wherey , wxChar uniChar ) ;
|
||||||
|
bool MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey , wxChar uniChar ) ;
|
||||||
|
void MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey , wxChar uniChar ) ;
|
||||||
|
virtual short MacHandleAEODoc(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
|
||||||
|
virtual short MacHandleAEGURL(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
|
||||||
|
virtual short MacHandleAEPDoc(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
|
||||||
|
virtual short MacHandleAEOApp(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
|
||||||
|
virtual short MacHandleAEQuit(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
|
||||||
|
virtual short MacHandleAERApp(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
|
||||||
|
|
||||||
|
// in response of an open-document apple event
|
||||||
|
virtual void MacOpenFile(const wxString &fileName) ;
|
||||||
|
// in response of a get-url apple event
|
||||||
|
virtual void MacOpenURL(const wxString &url) ;
|
||||||
|
// in response of a print-document apple event
|
||||||
|
virtual void MacPrintFile(const wxString &fileName) ;
|
||||||
|
// in response of a open-application apple event
|
||||||
|
virtual void MacNewFile() ;
|
||||||
|
// in response of a reopen-application apple event
|
||||||
|
virtual void MacReopenApp() ;
|
||||||
|
|
||||||
|
// Hide the application windows the same as the system hide command would do it.
|
||||||
|
void MacHideApp();
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_APP_H_
|
||||||
|
|
181
include/wx/osx/carbon/bitmap.h
Normal file
181
include/wx/osx/carbon/bitmap.h
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: bitmap.h
|
||||||
|
// Purpose: wxBitmap class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_BITMAP_H_
|
||||||
|
#define _WX_BITMAP_H_
|
||||||
|
|
||||||
|
#include "wx/palette.h"
|
||||||
|
|
||||||
|
// Bitmap
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||||
|
class wxBitmapRefData ;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxBitmapHandler;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxControl;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxCursor;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxDC;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxIcon;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxImage;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxPixelDataBase;
|
||||||
|
|
||||||
|
// A mask is a bitmap used for drawing bitmaps
|
||||||
|
// Internally it is stored as a 8 bit deep memory chunk, 0 = black means the source will be drawn
|
||||||
|
// 255 = white means the source will not be drawn, no other values will be present
|
||||||
|
// 8 bit is chosen only for performance reasons, note also that this is the inverse value range
|
||||||
|
// from alpha, where 0 = invisible , 255 = fully drawn
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMask: public wxObject
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMask)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxMask();
|
||||||
|
|
||||||
|
// Copy constructor
|
||||||
|
wxMask(const wxMask& mask);
|
||||||
|
|
||||||
|
// Construct a mask from a bitmap and a colour indicating
|
||||||
|
// the transparent area
|
||||||
|
wxMask(const wxBitmap& bitmap, const wxColour& colour);
|
||||||
|
|
||||||
|
// Construct a mask from a mono bitmap (black meaning show pixels, white meaning transparent)
|
||||||
|
wxMask(const wxBitmap& bitmap);
|
||||||
|
|
||||||
|
// implementation helper only : construct a mask from a 32 bit memory buffer
|
||||||
|
wxMask(const wxMemoryBuffer& buf, int width , int height , int bytesPerRow ) ;
|
||||||
|
|
||||||
|
virtual ~wxMask();
|
||||||
|
|
||||||
|
bool Create(const wxBitmap& bitmap, const wxColour& colour);
|
||||||
|
bool Create(const wxBitmap& bitmap);
|
||||||
|
bool Create(const wxMemoryBuffer& buf, int width , int height , int bytesPerRow ) ;
|
||||||
|
|
||||||
|
// Implementation below
|
||||||
|
|
||||||
|
void Init() ;
|
||||||
|
|
||||||
|
// a 8 bit depth mask
|
||||||
|
void* GetRawAccess() const;
|
||||||
|
int GetBytesPerRow() const { return m_bytesPerRow ; }
|
||||||
|
// renders/updates native representation when necessary
|
||||||
|
void RealizeNative() ;
|
||||||
|
|
||||||
|
WXHBITMAP GetHBITMAP() const ;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxMemoryBuffer m_memBuf ;
|
||||||
|
int m_bytesPerRow ;
|
||||||
|
int m_width ;
|
||||||
|
int m_height ;
|
||||||
|
|
||||||
|
WXHBITMAP m_maskBitmap ;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||||
|
|
||||||
|
friend class WXDLLIMPEXP_FWD_CORE wxBitmapHandler;
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxBitmap(); // Platform-specific
|
||||||
|
|
||||||
|
// Initialize with raw data.
|
||||||
|
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
||||||
|
|
||||||
|
// Initialize with XPM data
|
||||||
|
wxBitmap(const char* const* bits);
|
||||||
|
|
||||||
|
// Load a file or resource
|
||||||
|
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_PICT_RESOURCE);
|
||||||
|
|
||||||
|
// Constructor for generalised creation from data
|
||||||
|
wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
||||||
|
|
||||||
|
// If depth is omitted, will create a bitmap compatible with the display
|
||||||
|
wxBitmap(int width, int height, int depth = -1);
|
||||||
|
|
||||||
|
// Convert from wxImage:
|
||||||
|
wxBitmap(const wxImage& image, int depth = -1);
|
||||||
|
|
||||||
|
// Convert from wxIcon
|
||||||
|
wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); }
|
||||||
|
|
||||||
|
virtual ~wxBitmap();
|
||||||
|
|
||||||
|
wxImage ConvertToImage() const;
|
||||||
|
|
||||||
|
// get the given part of bitmap
|
||||||
|
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
||||||
|
|
||||||
|
virtual bool Create(int width, int height, int depth = -1);
|
||||||
|
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
|
||||||
|
// virtual bool Create( WXHICON icon) ;
|
||||||
|
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
|
||||||
|
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
|
||||||
|
|
||||||
|
wxBitmapRefData *GetBitmapData() const
|
||||||
|
{ return (wxBitmapRefData *)m_refData; }
|
||||||
|
|
||||||
|
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||||
|
virtual bool CopyFromIcon(const wxIcon& icon);
|
||||||
|
|
||||||
|
int GetWidth() const;
|
||||||
|
int GetHeight() const;
|
||||||
|
int GetDepth() const;
|
||||||
|
void SetWidth(int w);
|
||||||
|
void SetHeight(int h);
|
||||||
|
void SetDepth(int d);
|
||||||
|
void SetOk(bool isOk);
|
||||||
|
|
||||||
|
#if wxUSE_PALETTE
|
||||||
|
wxPalette* GetPalette() const;
|
||||||
|
void SetPalette(const wxPalette& palette);
|
||||||
|
#endif // wxUSE_PALETTE
|
||||||
|
|
||||||
|
wxMask *GetMask() const;
|
||||||
|
void SetMask(wxMask *mask) ;
|
||||||
|
|
||||||
|
static void InitStandardHandlers();
|
||||||
|
|
||||||
|
// raw bitmap access support functions, for internal use only
|
||||||
|
void *GetRawData(wxPixelDataBase& data, int bpp);
|
||||||
|
void UngetRawData(wxPixelDataBase& data);
|
||||||
|
|
||||||
|
// these functions are internal and shouldn't be used, they risk to
|
||||||
|
// disappear in the future
|
||||||
|
bool HasAlpha() const;
|
||||||
|
void UseAlpha();
|
||||||
|
|
||||||
|
// returns the 'native' implementation, a GWorldPtr for the content and one for the mask
|
||||||
|
WXHBITMAP GetHBITMAP( WXHBITMAP * mask = NULL ) const;
|
||||||
|
|
||||||
|
// returns a CGImageRef which must released after usage with CGImageRelease
|
||||||
|
CGImageRef CreateCGImage() const ;
|
||||||
|
|
||||||
|
// returns a IconRef which must be retained before and released after usage
|
||||||
|
IconRef GetIconRef() const;
|
||||||
|
// returns a IconRef which must be released after usage
|
||||||
|
IconRef CreateIconRef() const;
|
||||||
|
// get read only access to the underlying buffer
|
||||||
|
void *GetRawAccess() const ;
|
||||||
|
// brackets to the underlying OS structure for read/write access
|
||||||
|
// makes sure that no cached images will be constructed until terminated
|
||||||
|
void *BeginRawAccess() ;
|
||||||
|
void EndRawAccess() ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_BITMAP_H_
|
53
include/wx/osx/carbon/bmpbuttn.h
Normal file
53
include/wx/osx/carbon/bmpbuttn.h
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: bmpbuttn.h
|
||||||
|
// Purpose: wxBitmapButton class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_BMPBUTTN_H_
|
||||||
|
#define _WX_BMPBUTTN_H_
|
||||||
|
|
||||||
|
#include "wx/button.h"
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxButtonNameStr[];
|
||||||
|
|
||||||
|
#define wxDEFAULT_BUTTON_MARGIN 4
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxBitmapButton: public wxBitmapButtonBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxBitmapButton()
|
||||||
|
{
|
||||||
|
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 wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxButtonNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, bitmap, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxButtonNameStr);
|
||||||
|
|
||||||
|
virtual void SetBitmapLabel(const wxBitmap& bitmap);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_BMPBUTTN_H_
|
53
include/wx/osx/carbon/brush.h
Normal file
53
include/wx/osx/carbon/brush.h
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/brush.h
|
||||||
|
// Purpose: wxBrush class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_BRUSH_H_
|
||||||
|
#define _WX_BRUSH_H_
|
||||||
|
|
||||||
|
#include "wx/gdicmn.h"
|
||||||
|
#include "wx/gdiobj.h"
|
||||||
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxBrush;
|
||||||
|
|
||||||
|
// Brush
|
||||||
|
class WXDLLIMPEXP_CORE wxBrush: public wxBrushBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxBrush();
|
||||||
|
wxBrush(const wxColour& col, wxBrushStyle style = wxBRUSHSTYLE_SOLID);
|
||||||
|
#if FUTURE_WXWIN_COMPATIBILITY_3_0
|
||||||
|
wxDEPRECATED_FUTURE( wxBrush(const wxColour& col, int style) );
|
||||||
|
#endif
|
||||||
|
wxBrush(const wxBitmap& stipple);
|
||||||
|
virtual ~wxBrush();
|
||||||
|
|
||||||
|
virtual void SetColour(const wxColour& col) ;
|
||||||
|
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
||||||
|
virtual void SetStyle(wxBrushStyle style) ;
|
||||||
|
virtual void SetStipple(const wxBitmap& stipple) ;
|
||||||
|
|
||||||
|
bool operator==(const wxBrush& brush) const;
|
||||||
|
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
|
||||||
|
|
||||||
|
wxColour GetColour() const;
|
||||||
|
wxBrushStyle GetStyle() const ;
|
||||||
|
wxBitmap *GetStipple() const ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_BRUSH_H_
|
93
include/wx/osx/carbon/button.h
Normal file
93
include/wx/osx/carbon/button.h
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: button.h
|
||||||
|
// Purpose: wxButton class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_BUTTON_H_
|
||||||
|
#define _WX_BUTTON_H_
|
||||||
|
|
||||||
|
#include "wx/control.h"
|
||||||
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxButtonNameStr[];
|
||||||
|
|
||||||
|
// Pushbutton
|
||||||
|
class WXDLLIMPEXP_CORE wxButton: public wxButtonBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxButton() {}
|
||||||
|
wxButton(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& label = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxButtonNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& label = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxButtonNameStr);
|
||||||
|
|
||||||
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
static wxSize GetDefaultSize();
|
||||||
|
|
||||||
|
virtual wxWindow *SetDefault();
|
||||||
|
virtual void Command(wxCommandEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize() const ;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxButton)
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxDisclosureTriangle: public wxControl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxDisclosureTriangle(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& label = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxButtonNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& label = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxButtonNameStr);
|
||||||
|
|
||||||
|
void SetOpen( bool open );
|
||||||
|
bool IsOpen() const;
|
||||||
|
|
||||||
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize() const ;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_BUTTON_H_
|
81
include/wx/osx/carbon/checkbox.h
Normal file
81
include/wx/osx/carbon/checkbox.h
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: checkbox.h
|
||||||
|
// Purpose: wxCheckBox class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_CHECKBOX_H_
|
||||||
|
#define _WX_CHECKBOX_H_
|
||||||
|
|
||||||
|
// Checkbox item (single checkbox)
|
||||||
|
class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxCheckBox() { }
|
||||||
|
wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxCheckBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxCheckBoxNameStr);
|
||||||
|
virtual void SetValue(bool);
|
||||||
|
virtual bool GetValue() const;
|
||||||
|
|
||||||
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
virtual void Command(wxCommandEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void DoSet3StateValue(wxCheckBoxState val);
|
||||||
|
virtual wxCheckBoxState DoGet3StateValue() const;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxCheckBox)
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||||
|
class WXDLLIMPEXP_CORE wxBitmapCheckBox: public wxCheckBox
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
int checkWidth;
|
||||||
|
int checkHeight;
|
||||||
|
|
||||||
|
wxBitmapCheckBox()
|
||||||
|
: checkWidth(-1), checkHeight(-1)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxCheckBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxCheckBoxNameStr);
|
||||||
|
virtual void SetValue(bool);
|
||||||
|
virtual bool GetValue() const;
|
||||||
|
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
virtual void SetLabel(const wxBitmap *bitmap);
|
||||||
|
virtual void SetLabel( const wxString & WXUNUSED(name) ) {}
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
// _WX_CHECKBOX_H_
|
90
include/wx/osx/carbon/checklst.h
Normal file
90
include/wx/osx/carbon/checklst.h
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/checklst.h
|
||||||
|
// Purpose: wxCheckListBox class - a listbox with checkable items
|
||||||
|
// Note: this is an optional class.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_CHECKLST_H_
|
||||||
|
#define _WX_MAC_CHECKLST_H_
|
||||||
|
|
||||||
|
class wxMacCheckListControl
|
||||||
|
{
|
||||||
|
public :
|
||||||
|
virtual bool MacIsChecked(unsigned int n) const = 0;
|
||||||
|
virtual void MacCheck(unsigned int n, bool bCheck = true) = 0;
|
||||||
|
|
||||||
|
virtual ~wxMacCheckListControl() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctors
|
||||||
|
wxCheckListBox() { Init(); }
|
||||||
|
wxCheckListBox(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
int nStrings = 0,
|
||||||
|
const wxString *choices = NULL,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxListBoxNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
|
||||||
|
Create(parent, id, pos, size, nStrings, choices, style, validator, name);
|
||||||
|
}
|
||||||
|
wxCheckListBox(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
const wxArrayString& choices,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxListBoxNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
|
||||||
|
Create(parent, id, pos, size, choices, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
int nStrings = 0,
|
||||||
|
const wxString *choices = NULL,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxListBoxNameStr);
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
const wxArrayString& choices,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxListBoxNameStr);
|
||||||
|
|
||||||
|
// items may be checked
|
||||||
|
bool IsChecked(unsigned int uiIndex) const;
|
||||||
|
void Check(unsigned int uiIndex, bool bCheck = true);
|
||||||
|
|
||||||
|
wxMacCheckListControl* GetPeer() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxCheckListBox)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MAC_CHECKLST_H_
|
150
include/wx/osx/carbon/chkconf.h
Normal file
150
include/wx/osx/carbon/chkconf.h
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
/*
|
||||||
|
* Name: wx/mac/chkconf.h
|
||||||
|
* Purpose: Compiler-specific configuration checking
|
||||||
|
* Author: Julian Smart
|
||||||
|
* Modified by:
|
||||||
|
* Created: 01/02/97
|
||||||
|
* RCS-ID: $Id$
|
||||||
|
* Copyright: (c) Julian Smart
|
||||||
|
* Licence: wxWindows licence
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_CHKCONF_H_
|
||||||
|
#define _WX_MAC_CHKCONF_H_
|
||||||
|
|
||||||
|
/*
|
||||||
|
* disable the settings which don't work for some compilers
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(__MWERKS__)
|
||||||
|
#undef wxUSE_DEBUG_NEW_ALWAYS
|
||||||
|
#define wxUSE_DEBUG_NEW_ALWAYS 0
|
||||||
|
|
||||||
|
/* DS: Fixes compilation when wxUSE_ON_FATAL_EXCEPTION is 1 */
|
||||||
|
#ifndef wxTYPE_SA_HANDLER
|
||||||
|
#define wxTYPE_SA_HANDLER int
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* use OS X CoreGraphics (1) or QuickDraw (0) for rendering
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef wxMAC_USE_CORE_GRAPHICS
|
||||||
|
#define wxMAC_USE_CORE_GRAPHICS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wxMAC_USE_CORE_GRAPHICS is now implemented in terms of wxUSE_GRAPHICS_CONTEXT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
|
#undef wxUSE_GRAPHICS_CONTEXT
|
||||||
|
#define wxUSE_GRAPHICS_CONTEXT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check graphics context option
|
||||||
|
*/
|
||||||
|
#if wxUSE_GRAPHICS_CONTEXT && !wxMAC_USE_CORE_GRAPHICS
|
||||||
|
# error "wxUSE_GRAPHICS_CONTEXT on wxMac requires wxMAC_USE_CORE_GRAPHICS"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* native (1) or emulated (0) toolbar
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef wxMAC_USE_NATIVE_TOOLBAR
|
||||||
|
#define wxMAC_USE_NATIVE_TOOLBAR 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* using mixins of cocoa functionality
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef wxMAC_USE_COCOA
|
||||||
|
#define wxMAC_USE_COCOA 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* setting flags according to the platform
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __LP64__
|
||||||
|
#if wxMAC_USE_COCOA == 0
|
||||||
|
#undef wxMAC_USE_COCOA
|
||||||
|
#define wxMAC_USE_COCOA 1
|
||||||
|
#endif
|
||||||
|
#define wxMAC_USE_QUICKDRAW 0
|
||||||
|
#define wxMAC_USE_CARBON 0
|
||||||
|
#else
|
||||||
|
#ifdef __WXOSX_IPHONE__
|
||||||
|
#define wxMAC_USE_QUICKDRAW 0
|
||||||
|
#define wxMAC_USE_CARBON 0
|
||||||
|
#else
|
||||||
|
#define wxMAC_USE_QUICKDRAW 1
|
||||||
|
#define wxMAC_USE_CARBON 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* text rendering system
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* we have different options and we turn on all that make sense
|
||||||
|
* under a certain platform
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||||
|
|
||||||
|
#ifdef __WXOSX_IPHONE__
|
||||||
|
#define wxMAC_USE_CG_TEXT 1
|
||||||
|
#define wxMAC_USE_CORE_TEXT 0
|
||||||
|
#define wxMAC_USE_ATSU_TEXT 0
|
||||||
|
#else
|
||||||
|
#define wxMAC_USE_CORE_TEXT 1
|
||||||
|
#define wxMAC_USE_ATSU_TEXT 0
|
||||||
|
#define wxMAC_USE_CG_TEXT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else // platform < 10.5
|
||||||
|
|
||||||
|
#define wxMAC_USE_CG_TEXT 0
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
||||||
|
#define wxMAC_USE_CORE_TEXT 1
|
||||||
|
#else
|
||||||
|
#define wxMAC_USE_CORE_TEXT 0
|
||||||
|
#endif
|
||||||
|
#define wxMAC_USE_ATSU_TEXT 1
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* turning off capabilities that don't work under 64 bit yet
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __LP64__
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
|
#undef wxUSE_DRAG_AND_DROP
|
||||||
|
#define wxUSE_DRAG_AND_DROP 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_TASKBARICON
|
||||||
|
#undef wxUSE_TASKBARICON
|
||||||
|
#define wxUSE_TASKBARICON 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_TOOLTIPS
|
||||||
|
#undef wxUSE_TOOLTIPS
|
||||||
|
#define wxUSE_TOOLTIPS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
/* _WX_MAC_CHKCONF_H_ */
|
||||||
|
|
99
include/wx/osx/carbon/choice.h
Normal file
99
include/wx/osx/carbon/choice.h
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/choice.h
|
||||||
|
// Purpose: wxChoice class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_CHOICE_H_
|
||||||
|
#define _WX_CHOICE_H_
|
||||||
|
|
||||||
|
#include "wx/control.h"
|
||||||
|
|
||||||
|
#include "wx/dynarray.h"
|
||||||
|
#include "wx/arrstr.h"
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxChoiceNameStr[];
|
||||||
|
|
||||||
|
WX_DEFINE_ARRAY( char * , wxChoiceDataArray ) ;
|
||||||
|
|
||||||
|
// Choice item
|
||||||
|
class WXDLLIMPEXP_CORE wxChoice: public wxChoiceBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxChoice)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxChoice()
|
||||||
|
: m_strings(), m_datas(), m_macPopUpMenuHandle(NULL)
|
||||||
|
{}
|
||||||
|
|
||||||
|
virtual ~wxChoice() ;
|
||||||
|
|
||||||
|
wxChoice(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0, const wxString choices[] = NULL,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxChoiceNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, pos, size, n, choices, style, validator, name);
|
||||||
|
}
|
||||||
|
wxChoice(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
const wxArrayString& choices,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxChoiceNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, pos, size, choices, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0, const wxString choices[] = NULL,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxChoiceNameStr);
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
const wxArrayString& choices,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxChoiceNameStr);
|
||||||
|
|
||||||
|
virtual unsigned int GetCount() const ;
|
||||||
|
virtual int GetSelection() const ;
|
||||||
|
virtual void SetSelection(int n);
|
||||||
|
|
||||||
|
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||||
|
virtual wxString GetString(unsigned int n) const ;
|
||||||
|
virtual void SetString(unsigned int pos, const wxString& s);
|
||||||
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DoDeleteOneItem(unsigned int n);
|
||||||
|
virtual void DoClear();
|
||||||
|
|
||||||
|
virtual wxSize DoGetBestSize() const ;
|
||||||
|
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
|
||||||
|
unsigned int pos,
|
||||||
|
void **clientData, wxClientDataType type);
|
||||||
|
|
||||||
|
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||||
|
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||||
|
|
||||||
|
wxArrayString m_strings;
|
||||||
|
wxChoiceDataArray m_datas ;
|
||||||
|
WXHMENU m_macPopUpMenuHandle ;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_CHOICE_H_
|
76
include/wx/osx/carbon/clipbrd.h
Normal file
76
include/wx/osx/carbon/clipbrd.h
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: clipbrd.h
|
||||||
|
// Purpose: Clipboard functionality.
|
||||||
|
// Note: this functionality is under review, and
|
||||||
|
// is derived from wxWidgets 1.xx code. Please contact
|
||||||
|
// the wxWidgets developers for further information.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_CLIPBRD_H_
|
||||||
|
#define _WX_CLIPBRD_H_
|
||||||
|
|
||||||
|
#if wxUSE_CLIPBOARD
|
||||||
|
|
||||||
|
#include "wx/list.h"
|
||||||
|
#include "wx/module.h"
|
||||||
|
#include "wx/dataobj.h" // for wxDataFormat
|
||||||
|
|
||||||
|
#include "wx/mac/corefoundation/cfref.h"
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxClipboard
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxDataObject;
|
||||||
|
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxClipboard();
|
||||||
|
virtual ~wxClipboard();
|
||||||
|
|
||||||
|
// open the clipboard before SetData() and GetData()
|
||||||
|
virtual bool Open();
|
||||||
|
|
||||||
|
// close the clipboard after SetData() and GetData()
|
||||||
|
virtual void Close();
|
||||||
|
|
||||||
|
// query whether the clipboard is opened
|
||||||
|
virtual bool IsOpened() const;
|
||||||
|
|
||||||
|
// set the clipboard data. all other formats will be deleted.
|
||||||
|
virtual bool SetData( wxDataObject *data );
|
||||||
|
|
||||||
|
// add to the clipboard data.
|
||||||
|
virtual bool AddData( wxDataObject *data );
|
||||||
|
|
||||||
|
// ask if data in correct format is available
|
||||||
|
virtual bool IsSupported( const wxDataFormat& format );
|
||||||
|
|
||||||
|
// fill data with data on the clipboard (if available)
|
||||||
|
virtual bool GetData( wxDataObject& data );
|
||||||
|
|
||||||
|
// clears wxTheClipboard and the system's clipboard if possible
|
||||||
|
virtual void Clear();
|
||||||
|
|
||||||
|
// flushes the clipboard: this means that the data which is currently on
|
||||||
|
// clipboard will stay available even after the application exits (possibly
|
||||||
|
// eating memory), otherwise the clipboard will be emptied on exit
|
||||||
|
virtual bool Flush();
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxDataObject *m_data;
|
||||||
|
bool m_open;
|
||||||
|
wxCFRef<PasteboardRef> m_pasteboard;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // wxUSE_CLIPBOARD
|
||||||
|
|
||||||
|
#endif // _WX_CLIPBRD_H_
|
42
include/wx/osx/carbon/colordlg.h
Normal file
42
include/wx/osx/carbon/colordlg.h
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/colordlg.h
|
||||||
|
// Purpose: wxColourDialog class. Use generic version if no
|
||||||
|
// platform-specific implementation.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_COLORDLG_H_
|
||||||
|
#define _WX_COLORDLG_H_
|
||||||
|
|
||||||
|
#include "wx/defs.h"
|
||||||
|
#include "wx/dialog.h"
|
||||||
|
#include "wx/cmndata.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Platform-specific colour dialog implementation
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxColourDialog: public wxDialog
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxColourDialog)
|
||||||
|
public:
|
||||||
|
wxColourDialog();
|
||||||
|
wxColourDialog(wxWindow *parent, wxColourData *data = NULL);
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||||
|
|
||||||
|
int ShowModal();
|
||||||
|
wxColourData& GetColourData() { return m_colourData; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxColourData m_colourData;
|
||||||
|
wxWindow* m_dialogParent;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_COLORDLG_H_
|
83
include/wx/osx/carbon/colour.h
Normal file
83
include/wx/osx/carbon/colour.h
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/colour.h
|
||||||
|
// Purpose: wxColour class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_COLOUR_H_
|
||||||
|
#define _WX_COLOUR_H_
|
||||||
|
|
||||||
|
#include "wx/object.h"
|
||||||
|
#include "wx/string.h"
|
||||||
|
|
||||||
|
#include "wx/mac/corefoundation/cfref.h"
|
||||||
|
|
||||||
|
struct RGBColor;
|
||||||
|
|
||||||
|
// Colour
|
||||||
|
class WXDLLIMPEXP_CORE wxColour: public wxColourBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// constructors
|
||||||
|
// ------------
|
||||||
|
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
||||||
|
|
||||||
|
// default copy ctor and dtor are ok
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
virtual bool IsOk() const { return m_cgColour; }
|
||||||
|
|
||||||
|
ChannelType Red() const { return m_red; }
|
||||||
|
ChannelType Green() const { return m_green; }
|
||||||
|
ChannelType Blue() const { return m_blue; }
|
||||||
|
ChannelType Alpha() const { return m_alpha; }
|
||||||
|
|
||||||
|
// comparison
|
||||||
|
bool operator == (const wxColour& colour) const;
|
||||||
|
|
||||||
|
bool operator != (const wxColour& colour) const { return !(*this == colour); }
|
||||||
|
|
||||||
|
CGColorRef GetPixel() const { return m_cgColour; };
|
||||||
|
|
||||||
|
CGColorRef GetCGColor() const { return m_cgColour; };
|
||||||
|
CGColorRef CreateCGColor() const { return wxCFRetain( (CGColorRef)m_cgColour ); };
|
||||||
|
|
||||||
|
#if wxMAC_USE_QUICKDRAW
|
||||||
|
void GetRGBColor( RGBColor *col ) const;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Mac-specific ctor and assignment operator from the native colour
|
||||||
|
// assumes ownership of CGColorRef
|
||||||
|
wxColour( CGColorRef col );
|
||||||
|
#if wxMAC_USE_QUICKDRAW
|
||||||
|
wxColour(const RGBColor& col);
|
||||||
|
wxColour& operator=(const RGBColor& col);
|
||||||
|
#endif
|
||||||
|
wxColour& operator=(CGColorRef col);
|
||||||
|
wxColour& operator=(const wxColour& col);
|
||||||
|
|
||||||
|
protected :
|
||||||
|
virtual void
|
||||||
|
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a);
|
||||||
|
#if wxMAC_USE_QUICKDRAW
|
||||||
|
void InitRGBColor( const RGBColor& col );
|
||||||
|
#endif
|
||||||
|
void InitCGColorRef( CGColorRef col );
|
||||||
|
private:
|
||||||
|
wxCFRef<CGColorRef> m_cgColour;
|
||||||
|
|
||||||
|
ChannelType m_red;
|
||||||
|
ChannelType m_blue;
|
||||||
|
ChannelType m_green;
|
||||||
|
ChannelType m_alpha;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxColour)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_COLOUR_H_
|
162
include/wx/osx/carbon/combobox.h
Normal file
162
include/wx/osx/carbon/combobox.h
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/combobox.h
|
||||||
|
// Purpose: wxComboBox class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_COMBOBOX_H_
|
||||||
|
#define _WX_COMBOBOX_H_
|
||||||
|
|
||||||
|
#include "wx/containr.h"
|
||||||
|
#include "wx/choice.h"
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxComboBoxNameStr[];
|
||||||
|
|
||||||
|
// forward declaration of private implementation classes
|
||||||
|
|
||||||
|
class wxComboBoxText;
|
||||||
|
class wxComboBoxChoice;
|
||||||
|
|
||||||
|
// Combobox item
|
||||||
|
class WXDLLIMPEXP_CORE wxComboBox : public wxControl, public wxComboBoxBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxComboBox)
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual ~wxComboBox();
|
||||||
|
|
||||||
|
// forward these functions to all subcontrols
|
||||||
|
virtual bool Enable(bool enable = true);
|
||||||
|
virtual bool Show(bool show = true);
|
||||||
|
|
||||||
|
// callback functions
|
||||||
|
virtual void DelegateTextChanged( const wxString& value );
|
||||||
|
virtual void DelegateChoice( const wxString& value );
|
||||||
|
|
||||||
|
wxComboBox() { Init(); }
|
||||||
|
|
||||||
|
wxComboBox(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0, const wxString choices[] = NULL,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxComboBoxNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxComboBox(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& value,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
const wxArrayString& choices,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxComboBoxNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
Create(parent, id, value, pos, size, choices, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0, const wxString choices[] = NULL,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxComboBoxNameStr);
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& value,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
const wxArrayString& choices,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxComboBoxNameStr);
|
||||||
|
|
||||||
|
virtual int GetSelection() const;
|
||||||
|
virtual void SetSelection(int n);
|
||||||
|
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||||
|
virtual wxString GetString(unsigned int n) const;
|
||||||
|
virtual wxString GetStringSelection() const;
|
||||||
|
virtual void SetString(unsigned int n, const wxString& s);
|
||||||
|
|
||||||
|
// Text field functions
|
||||||
|
virtual void SetValue(const wxString& value);
|
||||||
|
virtual wxString GetValue() const;
|
||||||
|
virtual void WriteText(const wxString& text);
|
||||||
|
virtual void GetSelection(long *from, long *to) const;
|
||||||
|
|
||||||
|
// Clipboard operations
|
||||||
|
virtual void Copy();
|
||||||
|
virtual void Cut();
|
||||||
|
virtual void Paste();
|
||||||
|
virtual void SetInsertionPoint(long pos);
|
||||||
|
virtual void SetInsertionPointEnd();
|
||||||
|
virtual long GetInsertionPoint() const;
|
||||||
|
virtual wxTextPos GetLastPosition() const;
|
||||||
|
virtual void Replace(long from, long to, const wxString& value);
|
||||||
|
virtual void Remove(long from, long to);
|
||||||
|
virtual void SetSelection(long from, long to);
|
||||||
|
virtual void SetEditable(bool editable);
|
||||||
|
virtual bool IsEditable() const;
|
||||||
|
|
||||||
|
virtual unsigned int GetCount() const;
|
||||||
|
|
||||||
|
virtual void Undo();
|
||||||
|
virtual void Redo();
|
||||||
|
virtual void SelectAll();
|
||||||
|
|
||||||
|
virtual bool CanCopy() const;
|
||||||
|
virtual bool CanCut() const;
|
||||||
|
virtual bool CanPaste() const;
|
||||||
|
virtual bool CanUndo() const;
|
||||||
|
virtual bool CanRedo() const;
|
||||||
|
|
||||||
|
virtual wxClientDataType GetClientDataType() const;
|
||||||
|
|
||||||
|
wxInt32 MacControlHit( WXEVENTHANDLERREF handler, WXEVENTREF event );
|
||||||
|
|
||||||
|
wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
|
||||||
|
|
||||||
|
WX_DECLARE_CONTROL_CONTAINER();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
// List functions
|
||||||
|
virtual void DoDeleteOneItem(unsigned int n);
|
||||||
|
virtual void DoClear();
|
||||||
|
|
||||||
|
// override the base class virtuals involved in geometry calculations
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
|
|
||||||
|
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
|
||||||
|
unsigned int pos,
|
||||||
|
void **clientData, wxClientDataType type);
|
||||||
|
|
||||||
|
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||||
|
virtual void * DoGetItemClientData(unsigned int n) const;
|
||||||
|
|
||||||
|
virtual void SetClientDataType(wxClientDataType clientDataItemsType);
|
||||||
|
|
||||||
|
// the subcontrols
|
||||||
|
wxComboBoxText* m_text;
|
||||||
|
wxComboBoxChoice* m_choice;
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_COMBOBOX_H_
|
53
include/wx/osx/carbon/control.h
Normal file
53
include/wx/osx/carbon/control.h
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: control.h
|
||||||
|
// Purpose: wxControl class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_CONTROL_H_
|
||||||
|
#define _WX_CONTROL_H_
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxControlNameStr[];
|
||||||
|
|
||||||
|
// General item class
|
||||||
|
class WXDLLIMPEXP_CORE wxControl : public wxControlBase
|
||||||
|
{
|
||||||
|
DECLARE_ABSTRACT_CLASS(wxControl)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxControl();
|
||||||
|
wxControl(wxWindow *parent, wxWindowID winid,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxControlNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, winid, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID winid,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxControlNameStr);
|
||||||
|
virtual ~wxControl();
|
||||||
|
|
||||||
|
// Simulates an event
|
||||||
|
virtual void Command(wxCommandEvent& event) { ProcessCommand(event); }
|
||||||
|
|
||||||
|
// implementation from now on
|
||||||
|
// --------------------------
|
||||||
|
|
||||||
|
// Calls the callback and appropriate event handlers
|
||||||
|
bool ProcessCommand(wxCommandEvent& event);
|
||||||
|
|
||||||
|
void OnKeyDown( wxKeyEvent &event ) ;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_CONTROL_H_
|
54
include/wx/osx/carbon/cursor.h
Normal file
54
include/wx/osx/carbon/cursor.h
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/cursor.h
|
||||||
|
// Purpose: wxCursor class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_CURSOR_H_
|
||||||
|
#define _WX_CURSOR_H_
|
||||||
|
|
||||||
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
|
// Cursor
|
||||||
|
class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxCursor();
|
||||||
|
|
||||||
|
wxCursor(const char bits[], int width, int height,
|
||||||
|
int hotSpotX = -1, int hotSpotY = -1,
|
||||||
|
const char maskBits[] = NULL);
|
||||||
|
|
||||||
|
wxCursor(const wxImage & image) ;
|
||||||
|
wxCursor(const char* const* bits);
|
||||||
|
wxCursor(const wxString& name,
|
||||||
|
wxBitmapType flags = wxBITMAP_TYPE_MACCURSOR_RESOURCE,
|
||||||
|
int hotSpotX = 0, int hotSpotY = 0);
|
||||||
|
|
||||||
|
wxCursor(int cursor_type);
|
||||||
|
virtual ~wxCursor();
|
||||||
|
|
||||||
|
bool CreateFromXpm(const char* const* bits);
|
||||||
|
|
||||||
|
void MacInstall() const ;
|
||||||
|
|
||||||
|
void SetHCURSOR(WXHCURSOR cursor);
|
||||||
|
WXHCURSOR GetHCURSOR() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
void CreateFromImage(const wxImage & image) ;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||||
|
};
|
||||||
|
|
||||||
|
extern WXDLLIMPEXP_CORE void wxSetCursor(const wxCursor& cursor);
|
||||||
|
|
||||||
|
#endif // _WX_CURSOR_H_
|
285
include/wx/osx/carbon/databrow.h
Normal file
285
include/wx/osx/carbon/databrow.h
Normal file
@@ -0,0 +1,285 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: include/mac/carbon/databrow.h
|
||||||
|
// Purpose: Classes and functions for the Carbon data browser
|
||||||
|
// Author:
|
||||||
|
// Modified by:
|
||||||
|
// Created: 2007-05-18
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c)
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DATABROW_H_
|
||||||
|
#define _WX_DATABROW_H_
|
||||||
|
|
||||||
|
#include "wx/defs.h"
|
||||||
|
|
||||||
|
#if wxUSE_GUI
|
||||||
|
|
||||||
|
#include "wx/mac/private.h"
|
||||||
|
|
||||||
|
WX_DEFINE_ARRAY_SIZE_T(size_t,wxArrayDataBrowserItemID);
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// wxMacDataBrowserTableViewControl
|
||||||
|
// ============================================================================
|
||||||
|
//
|
||||||
|
// this is a wrapper class for the Mac OS X data browser environment,
|
||||||
|
// it covers all general data brower functionality,
|
||||||
|
//
|
||||||
|
|
||||||
|
// data browser's property IDs have a reserved ID range from 0 - 1023
|
||||||
|
// therefore, the first usable property ID is 'kMinPropertyID'
|
||||||
|
DataBrowserPropertyID const kMinPropertyID = 1024;
|
||||||
|
|
||||||
|
class wxMacDataBrowserTableViewControl : public wxMacControl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// constructors / destructor
|
||||||
|
//
|
||||||
|
wxMacDataBrowserTableViewControl(wxWindow* peer, const wxPoint& pos, const wxSize& size, long style);
|
||||||
|
wxMacDataBrowserTableViewControl(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// callback handling
|
||||||
|
//
|
||||||
|
OSStatus SetCallbacks (DataBrowserCallbacks const* callbacks);
|
||||||
|
OSStatus SetCustomCallbacks(DataBrowserCustomCallbacks const* customCallbacks);
|
||||||
|
|
||||||
|
//
|
||||||
|
// header handling
|
||||||
|
//
|
||||||
|
OSStatus GetHeaderDesc(DataBrowserPropertyID property, DataBrowserListViewHeaderDesc* desc) const;
|
||||||
|
|
||||||
|
OSStatus SetHeaderDesc(DataBrowserPropertyID property, DataBrowserListViewHeaderDesc* desc);
|
||||||
|
|
||||||
|
//
|
||||||
|
// layout handling
|
||||||
|
//
|
||||||
|
OSStatus AutoSizeColumns();
|
||||||
|
|
||||||
|
OSStatus EnableCellSizeModification(bool enableHeight=true, bool enableWidth=true); // enables or disables the column width and row height modification (default: false)
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
||||||
|
OSStatus GetAttributes (OptionBits* attributes);
|
||||||
|
#endif
|
||||||
|
OSStatus GetColumnWidth (DataBrowserPropertyID column, UInt16 *width ) const; // returns the column width in pixels
|
||||||
|
OSStatus GetDefaultColumnWidth(UInt16 *width ) const; // returns the default column width in pixels
|
||||||
|
OSStatus GetDefaultRowHeight (UInt16 * height ) const;
|
||||||
|
OSStatus GetHeaderButtonHeight(UInt16 *height );
|
||||||
|
OSStatus GetPartBounds (DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserPropertyPart part, Rect* bounds);
|
||||||
|
OSStatus GetRowHeight (DataBrowserItemID item , UInt16 *height) const;
|
||||||
|
OSStatus GetScrollPosition (UInt32* top, UInt32 *left) const;
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
||||||
|
OSStatus SetAttributes (OptionBits attributes);
|
||||||
|
#endif
|
||||||
|
OSStatus SetColumnWidth(DataBrowserPropertyID column, UInt16 width); // sets the column width in pixels
|
||||||
|
OSStatus SetDefaultColumnWidth( UInt16 width );
|
||||||
|
OSStatus SetDefaultRowHeight( UInt16 height );
|
||||||
|
OSStatus SetHasScrollBars( bool horiz, bool vert );
|
||||||
|
OSStatus SetHeaderButtonHeight( UInt16 height );
|
||||||
|
OSStatus SetHiliteStyle( DataBrowserTableViewHiliteStyle hiliteStyle );
|
||||||
|
OSStatus SetIndent(float Indent);
|
||||||
|
OSStatus SetRowHeight( DataBrowserItemID item , UInt16 height);
|
||||||
|
OSStatus SetScrollPosition( UInt32 top , UInt32 left );
|
||||||
|
|
||||||
|
//
|
||||||
|
// column handling
|
||||||
|
//
|
||||||
|
OSStatus GetColumnCount (UInt32* numColumns) const;
|
||||||
|
OSStatus GetColumnIndex (DataBrowserPropertyID propertyID, DataBrowserTableViewColumnIndex* index) const; // returns for the passed property the corresponding column index
|
||||||
|
OSStatus GetFreePropertyID(DataBrowserPropertyID* propertyID) const; // this method returns a property id that is valid and currently not used; if it cannot be found 'errDataBrowerPropertyNotSupported' is returned
|
||||||
|
OSStatus GetPropertyFlags (DataBrowserPropertyID propertyID, DataBrowserPropertyFlags *flags ) const;
|
||||||
|
OSStatus GetPropertyID (DataBrowserItemDataRef itemData, DataBrowserPropertyID* propertyID); // returns for the passed item data reference the corresponding property ID
|
||||||
|
OSStatus GetPropertyID (DataBrowserTableViewColumnIndex index, DataBrowserPropertyID* propertyID); // 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);
|
||||||
|
OSStatus RemoveColumnByIndex (DataBrowserTableViewColumnIndex index);
|
||||||
|
|
||||||
|
OSStatus SetColumnIndex (DataBrowserPropertyID propertyID, DataBrowserTableViewColumnIndex index);
|
||||||
|
OSStatus SetDisclosureColumn(DataBrowserPropertyID propertyID, Boolean expandableRows=false);
|
||||||
|
OSStatus SetPropertyFlags (DataBrowserPropertyID propertyID, DataBrowserPropertyFlags flags);
|
||||||
|
|
||||||
|
//
|
||||||
|
// item handling
|
||||||
|
//
|
||||||
|
OSStatus AddItem(DataBrowserItemID container, DataBrowserItemID const* itemID) // adds a single item
|
||||||
|
{
|
||||||
|
return this->AddItems(container,1,itemID,kDataBrowserItemNoProperty);
|
||||||
|
}
|
||||||
|
OSStatus AddItems(DataBrowserItemID container, UInt32 numItems, DataBrowserItemID const* items, DataBrowserPropertyID preSortProperty); // adds items to the data browser
|
||||||
|
|
||||||
|
OSStatus GetFreeItemID(DataBrowserItemID* id) const; // this method returns an item id that is valid and currently not used; if it cannot be found 'errDataBrowserItemNotAdded' is returned
|
||||||
|
OSStatus GetItemCount (ItemCount* numItems) const
|
||||||
|
{
|
||||||
|
return this->GetItemCount(kDataBrowserNoItem,true,kDataBrowserItemAnyState,numItems);
|
||||||
|
}
|
||||||
|
OSStatus GetItemCount (DataBrowserItemID container, Boolean recurse, DataBrowserItemState state, ItemCount* numItems) const;
|
||||||
|
OSStatus GetItemID (DataBrowserTableViewRowIndex row, DataBrowserItemID* item) const;
|
||||||
|
OSStatus GetItems (DataBrowserItemID container, Boolean recurse, DataBrowserItemState state, Handle items) const;
|
||||||
|
OSStatus GetItemRow (DataBrowserItemID item, DataBrowserTableViewRowIndex* row) const;
|
||||||
|
|
||||||
|
OSStatus IsUsedItemID(DataBrowserItemID itemID) const; // checks if the passed id is in use
|
||||||
|
|
||||||
|
OSStatus RevealItem(DataBrowserItemID item, DataBrowserPropertyID propertyID, DataBrowserRevealOptions options) const;
|
||||||
|
|
||||||
|
OSStatus RemoveItem(DataBrowserItemID container, DataBrowserItemID const* itemID) // removes a single item
|
||||||
|
{
|
||||||
|
return this->RemoveItems(container,1,itemID,kDataBrowserItemNoProperty);
|
||||||
|
}
|
||||||
|
OSStatus RemoveItems(void) // removes all items
|
||||||
|
{
|
||||||
|
return this->RemoveItems(kDataBrowserNoItem,0,NULL,kDataBrowserItemNoProperty);
|
||||||
|
}
|
||||||
|
OSStatus RemoveItems(DataBrowserItemID container, UInt32 numItems, DataBrowserItemID const* items, DataBrowserPropertyID preSortProperty);
|
||||||
|
|
||||||
|
OSStatus UpdateItems(void) // updates all items
|
||||||
|
{
|
||||||
|
return this->UpdateItems(kDataBrowserNoItem,0,NULL,kDataBrowserItemNoProperty,kDataBrowserItemNoProperty);
|
||||||
|
}
|
||||||
|
OSStatus UpdateItems(DataBrowserItemID const* item) // updates all columns of item
|
||||||
|
{
|
||||||
|
return this->UpdateItems(kDataBrowserNoItem,1,item,kDataBrowserItemNoProperty,kDataBrowserItemNoProperty);
|
||||||
|
}
|
||||||
|
OSStatus UpdateItems(DataBrowserItemID container, UInt32 numItems, DataBrowserItemID const* items, DataBrowserPropertyID preSortProperty, DataBrowserPropertyID propertyID) const;
|
||||||
|
|
||||||
|
//
|
||||||
|
// item selection
|
||||||
|
//
|
||||||
|
size_t GetSelectedItemIDs(wxArrayDataBrowserItemID& itemIDs) const; // returns the number of selected item and the item IDs in the array
|
||||||
|
OSStatus GetSelectionAnchor(DataBrowserItemID *first, DataBrowserItemID *last) const;
|
||||||
|
OSStatus GetSelectionFlags (DataBrowserSelectionFlags* flags) const;
|
||||||
|
|
||||||
|
bool IsItemSelected(DataBrowserItemID item) const;
|
||||||
|
|
||||||
|
OSStatus SetSelectionFlags(DataBrowserSelectionFlags flags);
|
||||||
|
OSStatus SetSelectedItems (UInt32 numItems, DataBrowserItemID const* itemIDs, DataBrowserSetOption operation);
|
||||||
|
|
||||||
|
//
|
||||||
|
// item sorting
|
||||||
|
//
|
||||||
|
OSStatus GetSortOrder (DataBrowserSortOrder* order) const;
|
||||||
|
OSStatus GetSortProperty(DataBrowserPropertyID* propertyID) const;
|
||||||
|
|
||||||
|
OSStatus Resort(DataBrowserItemID container=kDataBrowserNoItem, Boolean sortChildren=true);
|
||||||
|
|
||||||
|
OSStatus SetSortOrder (DataBrowserSortOrder order);
|
||||||
|
OSStatus SetSortProperty(DataBrowserPropertyID propertyID);
|
||||||
|
|
||||||
|
//
|
||||||
|
// container handling
|
||||||
|
//
|
||||||
|
OSStatus CloseContainer(DataBrowserItemID containerID);
|
||||||
|
|
||||||
|
OSStatus OpenContainer(DataBrowserItemID containerID);
|
||||||
|
|
||||||
|
protected :
|
||||||
|
//
|
||||||
|
// standard callback functions
|
||||||
|
//
|
||||||
|
static pascal Boolean DataBrowserCompareProc (ControlRef browser, DataBrowserItemID itemOneID, DataBrowserItemID itemTwoID, DataBrowserPropertyID sortProperty);
|
||||||
|
static pascal void DataBrowserGetContextualMenuProc(ControlRef browser, MenuRef* menu, UInt32* helpType, CFStringRef* helpItemString, AEDesc* selection);
|
||||||
|
static pascal OSStatus DataBrowserGetSetItemDataProc (ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean getValue);
|
||||||
|
static pascal void DataBrowserItemNotificationProc (ControlRef browser, DataBrowserItemID itemID, DataBrowserItemNotification message, DataBrowserItemDataRef itemData);
|
||||||
|
|
||||||
|
virtual Boolean DataBrowserCompareProc (DataBrowserItemID itemOneID, DataBrowserItemID itemTwoID, DataBrowserPropertyID sortProperty) = 0;
|
||||||
|
virtual void DataBrowserGetContextualMenuProc(MenuRef* menu, UInt32* helpType, CFStringRef* helpItemString, AEDesc* selection) = 0;
|
||||||
|
virtual OSStatus DataBrowserGetSetItemDataProc (DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean getValue) = 0;
|
||||||
|
virtual void DataBrowserItemNotificationProc (DataBrowserItemID itemID, DataBrowserItemNotification message, DataBrowserItemDataRef itemData) = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// callback functions for customized types
|
||||||
|
//
|
||||||
|
static pascal void DataBrowserDrawItemProc(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID propertyID, DataBrowserItemState state, Rect const* rectangle, SInt16 bitDepth, Boolean colorDevice);
|
||||||
|
static pascal Boolean DataBrowserEditItemProc(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID propertyID, CFStringRef theString, Rect* maxEditTextRect, Boolean* shrinkToFit);
|
||||||
|
static pascal Boolean DataBrowserHitTestProc (ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Rect const* mouseRect);
|
||||||
|
static pascal DataBrowserTrackingResult DataBrowserTrackingProc(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Point startPt, EventModifiers modifiers);
|
||||||
|
|
||||||
|
virtual void DataBrowserDrawItemProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, DataBrowserItemState state, Rect const* rectangle, SInt16 bitDepth, Boolean colorDevice) = 0;
|
||||||
|
virtual Boolean DataBrowserEditItemProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, CFStringRef theString, Rect* maxEditTextRect, Boolean* shrinkToFit) = 0;
|
||||||
|
virtual Boolean DataBrowserHitTestProc (DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Rect const* mouseRect) = 0;
|
||||||
|
virtual DataBrowserTrackingResult DataBrowserTrackingProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Point startPt, EventModifiers modifiers) = 0;
|
||||||
|
|
||||||
|
private:
|
||||||
|
//
|
||||||
|
// wxWidget internal stuff
|
||||||
|
//
|
||||||
|
DECLARE_ABSTRACT_CLASS(wxMacDataBrowserTableViewControl)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// wxMacDataBrowserListViewControl
|
||||||
|
// ============================================================================
|
||||||
|
//
|
||||||
|
// this class is a wrapper for a list view which incorporates all general
|
||||||
|
// data browser functionality of the inherited table view control class;
|
||||||
|
// the term list view is in this case Mac OS X specific and is not related
|
||||||
|
// to any wxWidget naming conventions
|
||||||
|
//
|
||||||
|
class wxMacDataBrowserListViewControl : public wxMacDataBrowserTableViewControl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// constructors / destructor
|
||||||
|
//
|
||||||
|
wxMacDataBrowserListViewControl(wxWindow* peer, wxPoint const& pos, wxSize const& size, long style) : wxMacDataBrowserTableViewControl(peer,pos,size,style)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// column handling
|
||||||
|
//
|
||||||
|
OSStatus AddColumn(DataBrowserListViewColumnDesc *columnDesc, DataBrowserTableViewColumnIndex position);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// wxMacDataViewDataBrowserListViewControl
|
||||||
|
// ============================================================================
|
||||||
|
//
|
||||||
|
// internal interface class between wxDataViewCtrl (wxWidget) and the data
|
||||||
|
// browser (Mac OS X)
|
||||||
|
//
|
||||||
|
class wxMacDataViewDataBrowserListViewControl : public wxMacDataBrowserListViewControl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// constructors / destructor
|
||||||
|
//
|
||||||
|
wxMacDataViewDataBrowserListViewControl(wxWindow* peer, wxPoint const& pos, wxSize const& size, long style);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
//
|
||||||
|
// standard callback functions (inherited from wxMacDataBrowserTableViewControl)
|
||||||
|
//
|
||||||
|
virtual Boolean DataBrowserCompareProc (DataBrowserItemID itemOneID, DataBrowserItemID itemTwoID, DataBrowserPropertyID sortProperty);
|
||||||
|
virtual void DataBrowserItemNotificationProc (DataBrowserItemID itemID, DataBrowserItemNotification message, DataBrowserItemDataRef itemData);
|
||||||
|
virtual void DataBrowserGetContextualMenuProc(MenuRef* menu, UInt32* helpType, CFStringRef* helpItemString, AEDesc* selection);
|
||||||
|
virtual OSStatus DataBrowserGetSetItemDataProc (DataBrowserItemID itemID, DataBrowserPropertyID propertyID, DataBrowserItemDataRef itemData, Boolean getValue);
|
||||||
|
|
||||||
|
//
|
||||||
|
// callback functions for customized types (inherited from wxMacDataBrowserTableViewControl)
|
||||||
|
//
|
||||||
|
virtual void DataBrowserDrawItemProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, DataBrowserItemState state, Rect const* rectangle, SInt16 bitDepth, Boolean colorDevice);
|
||||||
|
virtual Boolean DataBrowserEditItemProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, CFStringRef theString, Rect* maxEditTextRect, Boolean* shrinkToFit);
|
||||||
|
virtual Boolean DataBrowserHitTestProc (DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Rect const* mouseRect);
|
||||||
|
virtual DataBrowserTrackingResult DataBrowserTrackingProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Point startPt, EventModifiers modifiers);
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef wxMacDataViewDataBrowserListViewControl* wxMacDataViewDataBrowserListViewControlPointer;
|
||||||
|
|
||||||
|
|
||||||
|
#endif // WX_GUI
|
||||||
|
|
||||||
|
#endif // _WX_DATABROW_H_
|
69
include/wx/osx/carbon/dataform.h
Normal file
69
include/wx/osx/carbon/dataform.h
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: mac/dataform.h
|
||||||
|
// Purpose: declaration of the wxDataFormat class
|
||||||
|
// Author: Stefan Csomor (lifted from dnd.h)
|
||||||
|
// Modified by:
|
||||||
|
// Created: 10/21/99
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1999 Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_DATAFORM_H
|
||||||
|
#define _WX_MAC_DATAFORM_H
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxDataFormat
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef unsigned long NativeFormat;
|
||||||
|
|
||||||
|
wxDataFormat();
|
||||||
|
wxDataFormat(wxDataFormatId vType);
|
||||||
|
wxDataFormat(const wxDataFormat& rFormat);
|
||||||
|
wxDataFormat(const wxString& rId);
|
||||||
|
wxDataFormat(const wxChar* pId);
|
||||||
|
wxDataFormat(NativeFormat vFormat);
|
||||||
|
~wxDataFormat();
|
||||||
|
|
||||||
|
wxDataFormat& operator=(NativeFormat vFormat)
|
||||||
|
{ SetId(vFormat); return *this; }
|
||||||
|
|
||||||
|
// comparison (must have both versions)
|
||||||
|
bool operator==(const wxDataFormat& format) const ;
|
||||||
|
bool operator!=(const wxDataFormat& format) const
|
||||||
|
{ return ! ( *this == format ); }
|
||||||
|
bool operator==(wxDataFormatId format) const
|
||||||
|
{ return m_type == (wxDataFormatId)format; }
|
||||||
|
bool operator!=(wxDataFormatId format) const
|
||||||
|
{ return m_type != (wxDataFormatId)format; }
|
||||||
|
|
||||||
|
wxDataFormat& operator=(const wxDataFormat& 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& pId);
|
||||||
|
|
||||||
|
// implementation
|
||||||
|
wxDataFormatId GetType() const { return m_type; }
|
||||||
|
void SetType( wxDataFormatId type );
|
||||||
|
|
||||||
|
// returns true if the format is one of those defined in wxDataFormatId
|
||||||
|
bool IsStandard() const { return m_type > 0 && m_type < wxDF_PRIVATE; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxDataFormatId m_type;
|
||||||
|
NativeFormat m_format;
|
||||||
|
// indicates the type in case of wxDF_PRIVATE :
|
||||||
|
wxString m_id ;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MAC_DATAFORM_H
|
37
include/wx/osx/carbon/dataobj.h
Normal file
37
include/wx/osx/carbon/dataobj.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: mac/dataobj.h
|
||||||
|
// Purpose: declaration of the wxDataObject
|
||||||
|
// Author: Stefan Csomor (adapted from Robert Roebling's gtk port)
|
||||||
|
// Modified by:
|
||||||
|
// Created: 10/21/99
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_DATAOBJ_H_
|
||||||
|
#define _WX_MAC_DATAOBJ_H_
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxDataObject is the same as wxDataObjectBase under wxGTK
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxDataObject : public wxDataObjectBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxDataObject();
|
||||||
|
#ifdef __DARWIN__
|
||||||
|
virtual ~wxDataObject() { }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const;
|
||||||
|
void AddToPasteboard( void * pasteboardRef , int itemID );
|
||||||
|
// returns true if the passed in format is present in the pasteboard
|
||||||
|
static bool IsFormatInPasteboard( void * pasteboardRef, const wxDataFormat &dataFormat );
|
||||||
|
// returns true if any of the accepted formats of this dataobj is in the pasteboard
|
||||||
|
bool HasDataInPasteboard( void * pasteboardRef );
|
||||||
|
bool GetFromPasteboard( void * pasteboardRef );
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MAC_DATAOBJ_H_
|
||||||
|
|
94
include/wx/osx/carbon/dataobj2.h
Normal file
94
include/wx/osx/carbon/dataobj2.h
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: mac/dataobj2.h
|
||||||
|
// Purpose: declaration of standard wxDataObjectSimple-derived classes
|
||||||
|
// Author: David Webster (adapted from Robert Roebling's gtk port
|
||||||
|
// Modified by:
|
||||||
|
// Created: 10/21/99
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_DATAOBJ2_H_
|
||||||
|
#define _WX_MAC_DATAOBJ2_H_
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxBitmapDataObject is a specialization of wxDataObject for bitmaps
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctors
|
||||||
|
wxBitmapDataObject();
|
||||||
|
wxBitmapDataObject(const wxBitmap& bitmap);
|
||||||
|
|
||||||
|
// destr
|
||||||
|
virtual ~wxBitmapDataObject();
|
||||||
|
|
||||||
|
// override base class virtual to update PNG data too
|
||||||
|
virtual void SetBitmap(const wxBitmap& bitmap);
|
||||||
|
|
||||||
|
// implement base class pure virtuals
|
||||||
|
// ----------------------------------
|
||||||
|
|
||||||
|
virtual size_t GetDataSize() const ;
|
||||||
|
virtual bool GetDataHere(void *buf) const ;
|
||||||
|
virtual bool SetData(size_t len, const void *buf);
|
||||||
|
// Must provide overloads to avoid hiding them (and warnings about it)
|
||||||
|
virtual size_t GetDataSize(const wxDataFormat&) const
|
||||||
|
{
|
||||||
|
return GetDataSize();
|
||||||
|
}
|
||||||
|
virtual bool GetDataHere(const wxDataFormat&, void *buf) const
|
||||||
|
{
|
||||||
|
return GetDataHere(buf);
|
||||||
|
}
|
||||||
|
virtual bool SetData(const wxDataFormat&, size_t len, const void *buf)
|
||||||
|
{
|
||||||
|
return SetData(len, buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected :
|
||||||
|
void Init() ;
|
||||||
|
void Clear() ;
|
||||||
|
|
||||||
|
void* m_pictHandle ;
|
||||||
|
bool m_pictCreated ;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxFileDataObject is a specialization of wxDataObject for file names
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// implement base class pure virtuals
|
||||||
|
// ----------------------------------
|
||||||
|
|
||||||
|
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);
|
||||||
|
// Must provide overloads to avoid hiding them (and warnings about it)
|
||||||
|
virtual size_t GetDataSize(const wxDataFormat&) const
|
||||||
|
{
|
||||||
|
return GetDataSize();
|
||||||
|
}
|
||||||
|
virtual bool GetDataHere(const wxDataFormat&, void *buf) const
|
||||||
|
{
|
||||||
|
return GetDataHere(buf);
|
||||||
|
}
|
||||||
|
virtual bool SetData(const wxDataFormat&, size_t len, const void *buf)
|
||||||
|
{
|
||||||
|
return SetData(len, buf);
|
||||||
|
}
|
||||||
|
protected:
|
||||||
|
// translates the filenames stored into a utf8 encoded char stream
|
||||||
|
void GetFileNames(wxCharBuffer &buf) const ;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MAC_DATAOBJ2_H_
|
||||||
|
|
630
include/wx/osx/carbon/dataview.h
Normal file
630
include/wx/osx/carbon/dataview.h
Normal file
@@ -0,0 +1,630 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/dataview.h
|
||||||
|
// Purpose: wxDataViewCtrl native implementation header
|
||||||
|
// Author:
|
||||||
|
// Id: $Id$
|
||||||
|
// Copyright: (c) 2007
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MACCARBONDATAVIEWCTRL_H_
|
||||||
|
#define _WX_MACCARBONDATAVIEWCTRL_H_
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// Type definitions to mask native types
|
||||||
|
// --------------------------------------------------------
|
||||||
|
|
||||||
|
typedef void* WXDataBrowserItemDataRef;
|
||||||
|
typedef unsigned long WXDataBrowserPropertyType;
|
||||||
|
typedef wxUint32 WXDataBrowserPropertyID;
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// wxDataViewRenderer
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxDataViewRenderer : public wxDataViewRendererBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// constructors / destructor
|
||||||
|
//
|
||||||
|
wxDataViewRenderer(wxString const& varianttype, wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
||||||
|
|
||||||
|
//
|
||||||
|
// inherited methods from wxDataViewRendererBase
|
||||||
|
//
|
||||||
|
virtual int GetAlignment() const
|
||||||
|
{
|
||||||
|
return this->m_alignment;
|
||||||
|
}
|
||||||
|
virtual wxDataViewCellMode GetMode() const
|
||||||
|
{
|
||||||
|
return this->m_mode;
|
||||||
|
}
|
||||||
|
virtual bool GetValue(wxVariant& value) const
|
||||||
|
{
|
||||||
|
value = this->m_value;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void SetAlignment(int WXUNUSED(align)) // is always identical to the header alignment
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual void SetMode(wxDataViewCellMode mode);
|
||||||
|
virtual bool SetValue(wxVariant const& newValue)
|
||||||
|
{
|
||||||
|
this->m_value = newValue;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// implementation
|
||||||
|
//
|
||||||
|
WXDataBrowserItemDataRef GetDataReference() const
|
||||||
|
{
|
||||||
|
return this->m_dataReference;
|
||||||
|
}
|
||||||
|
wxVariant const& GetValue() const
|
||||||
|
{
|
||||||
|
return this->m_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual WXDataBrowserPropertyType GetPropertyType() const = 0;
|
||||||
|
|
||||||
|
virtual bool Render() = 0; // a call to the appropriate data browser function filling the data reference with the stored datum;
|
||||||
|
// returns 'true' if the data value could be rendered, 'false' otherwise
|
||||||
|
|
||||||
|
void SetDataReference(WXDataBrowserItemDataRef const& newDataReference)
|
||||||
|
{
|
||||||
|
this->m_dataReference = newDataReference;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
//
|
||||||
|
// variables
|
||||||
|
//
|
||||||
|
WXDataBrowserItemDataRef m_dataReference; // data reference of the data browser; the data will be assigned to this reference during rendering
|
||||||
|
|
||||||
|
int m_alignment; // contains the alignment flags
|
||||||
|
|
||||||
|
wxDataViewCellMode m_mode; // storing the mode that determines how the cell is going to be shown
|
||||||
|
|
||||||
|
wxVariant m_value; // value that is going to be rendered
|
||||||
|
|
||||||
|
//
|
||||||
|
// wxWidget internal stuff
|
||||||
|
//
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// wxDataViewCustomRenderer
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxDataViewCustomRenderer: public wxDataViewRenderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// constructors / destructor
|
||||||
|
//
|
||||||
|
wxDataViewCustomRenderer(wxString const& varianttype=wxT("string"), wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
||||||
|
|
||||||
|
virtual ~wxDataViewCustomRenderer();
|
||||||
|
|
||||||
|
void RenderText( const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state );
|
||||||
|
|
||||||
|
//
|
||||||
|
// methods handling render space
|
||||||
|
//
|
||||||
|
virtual wxSize GetSize() const = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// methods handling user actions
|
||||||
|
//
|
||||||
|
virtual bool Render(wxRect cell, wxDC* dc, int state) = 0;
|
||||||
|
|
||||||
|
virtual bool Activate( wxRect WXUNUSED(cell),
|
||||||
|
wxDataViewModel *WXUNUSED(model),
|
||||||
|
const wxDataViewItem & WXUNUSED(item),
|
||||||
|
unsigned int WXUNUSED(col) )
|
||||||
|
{ return false; }
|
||||||
|
|
||||||
|
virtual bool LeftClick( wxPoint WXUNUSED(cursor),
|
||||||
|
wxRect WXUNUSED(cell),
|
||||||
|
wxDataViewModel *WXUNUSED(model),
|
||||||
|
const wxDataViewItem & WXUNUSED(item),
|
||||||
|
unsigned int WXUNUSED(col) )
|
||||||
|
{ return false; }
|
||||||
|
|
||||||
|
virtual bool StartDrag( wxPoint WXUNUSED(cursor),
|
||||||
|
wxRect WXUNUSED(cell),
|
||||||
|
wxDataViewModel *WXUNUSED(model),
|
||||||
|
const wxDataViewItem & WXUNUSED(item),
|
||||||
|
unsigned int WXUNUSED(col) )
|
||||||
|
{ return false; }
|
||||||
|
|
||||||
|
//
|
||||||
|
// device context handling
|
||||||
|
//
|
||||||
|
virtual wxDC* GetDC(); // creates a device context and keeps it
|
||||||
|
|
||||||
|
//
|
||||||
|
// implementation
|
||||||
|
//
|
||||||
|
virtual bool Render(); // declared in wxDataViewRenderer but will not be used here, therefore calling this function will
|
||||||
|
// return 'true' without having done anything
|
||||||
|
|
||||||
|
virtual WXDataBrowserPropertyType GetPropertyType() const;
|
||||||
|
|
||||||
|
void SetDC(wxDC* newDCPtr); // this method takes ownership of the pointer
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
//
|
||||||
|
// variables
|
||||||
|
//
|
||||||
|
wxControl* m_editorCtrlPtr; // pointer to an in-place editor control
|
||||||
|
|
||||||
|
wxDC* m_DCPtr;
|
||||||
|
|
||||||
|
//
|
||||||
|
// wxWidget internal stuff
|
||||||
|
//
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// wxDataViewTextRenderer
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewRenderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// constructors / destructor
|
||||||
|
//
|
||||||
|
wxDataViewTextRenderer(wxString const& varianttype=wxT("string"), wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
||||||
|
|
||||||
|
//
|
||||||
|
// inherited functions from wxDataViewRenderer
|
||||||
|
//
|
||||||
|
virtual bool Render();
|
||||||
|
|
||||||
|
//
|
||||||
|
// implementation
|
||||||
|
//
|
||||||
|
virtual WXDataBrowserPropertyType GetPropertyType() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// wxDataViewTextRendererAttr
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxDataViewTextRendererAttr: public wxDataViewTextRenderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// constructors / destructor
|
||||||
|
//
|
||||||
|
wxDataViewTextRendererAttr(wxString const& varianttype=wxT("string"), wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRendererAttr)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// wxDataViewBitmapRenderer
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewRenderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// constructors / destructor
|
||||||
|
//
|
||||||
|
wxDataViewBitmapRenderer(wxString const& varianttype=wxT("wxBitmap"), wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
||||||
|
|
||||||
|
//
|
||||||
|
// inherited functions from wxDataViewRenderer
|
||||||
|
//
|
||||||
|
virtual bool Render();
|
||||||
|
|
||||||
|
//
|
||||||
|
// implementation
|
||||||
|
//
|
||||||
|
virtual WXDataBrowserPropertyType GetPropertyType() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// wxDataViewToggleRenderer
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxDataViewIconTextRenderer: public wxDataViewRenderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxDataViewIconTextRenderer(wxString const& varianttype = wxT("wxDataViewIconText"), wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
||||||
|
|
||||||
|
//
|
||||||
|
// inherited functions from wxDataViewRenderer
|
||||||
|
//
|
||||||
|
virtual bool Render();
|
||||||
|
|
||||||
|
//
|
||||||
|
// implementation
|
||||||
|
//
|
||||||
|
virtual WXDataBrowserPropertyType GetPropertyType() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// wxDataViewToggleRenderer
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewRenderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxDataViewToggleRenderer(wxString const& varianttype = wxT("bool"), wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
||||||
|
|
||||||
|
//
|
||||||
|
// inherited functions from wxDataViewRenderer
|
||||||
|
//
|
||||||
|
virtual bool Render();
|
||||||
|
|
||||||
|
//
|
||||||
|
// implementation
|
||||||
|
//
|
||||||
|
virtual WXDataBrowserPropertyType GetPropertyType() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// wxDataViewProgressRenderer
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxDataViewProgressRenderer: public wxDataViewRenderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxDataViewProgressRenderer(wxString const& label = wxEmptyString, wxString const& varianttype=wxT("long"),
|
||||||
|
wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
||||||
|
|
||||||
|
//
|
||||||
|
// inherited functions from wxDataViewRenderer
|
||||||
|
//
|
||||||
|
virtual bool Render();
|
||||||
|
|
||||||
|
//
|
||||||
|
// implementation
|
||||||
|
//
|
||||||
|
virtual WXDataBrowserPropertyType GetPropertyType() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// wxDataViewDateRenderer
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewRenderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxDataViewDateRenderer(wxString const& varianttype=wxT("datetime"), wxDataViewCellMode mode=wxDATAVIEW_CELL_ACTIVATABLE, int align=wxDVR_DEFAULT_ALIGNMENT);
|
||||||
|
|
||||||
|
//
|
||||||
|
// inherited functions from wxDataViewRenderer
|
||||||
|
//
|
||||||
|
virtual bool Render();
|
||||||
|
|
||||||
|
//
|
||||||
|
// implementation
|
||||||
|
//
|
||||||
|
virtual WXDataBrowserPropertyType GetPropertyType() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// wxDataViewColumn
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxDataViewColumn: public wxDataViewColumnBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// constructors / destructor
|
||||||
|
//
|
||||||
|
wxDataViewColumn(wxString const& title, wxDataViewRenderer* renderer, unsigned int model_column, int width=80, wxAlignment align=wxALIGN_CENTER,
|
||||||
|
int flags=wxDATAVIEW_COL_RESIZABLE);
|
||||||
|
wxDataViewColumn(wxBitmap const& bitmap, wxDataViewRenderer* renderer, unsigned int model_column, int width=80, wxAlignment align=wxALIGN_CENTER,
|
||||||
|
int flags=wxDATAVIEW_COL_RESIZABLE);
|
||||||
|
|
||||||
|
//
|
||||||
|
// inherited methods from wxDataViewColumnBase
|
||||||
|
//
|
||||||
|
virtual wxAlignment GetAlignment() const
|
||||||
|
{
|
||||||
|
return this->m_alignment;
|
||||||
|
}
|
||||||
|
virtual int GetFlags() const
|
||||||
|
{
|
||||||
|
return this->m_flags;
|
||||||
|
}
|
||||||
|
virtual int GetMaxWidth() const
|
||||||
|
{
|
||||||
|
return this->m_maxWidth;
|
||||||
|
}
|
||||||
|
virtual int GetMinWidth() const
|
||||||
|
{
|
||||||
|
return this->m_minWidth;
|
||||||
|
}
|
||||||
|
virtual wxString GetTitle() const
|
||||||
|
{
|
||||||
|
return this->m_title;
|
||||||
|
}
|
||||||
|
virtual int GetWidth() const
|
||||||
|
{
|
||||||
|
return this->m_width;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool IsHidden() const
|
||||||
|
{
|
||||||
|
return false; // not implemented
|
||||||
|
}
|
||||||
|
virtual bool IsReorderable() const
|
||||||
|
{
|
||||||
|
return ((this->m_flags & wxDATAVIEW_COL_REORDERABLE) != 0);
|
||||||
|
}
|
||||||
|
virtual bool IsResizeable() const
|
||||||
|
{
|
||||||
|
return ((this->m_flags & wxDATAVIEW_COL_RESIZABLE) != 0);
|
||||||
|
}
|
||||||
|
virtual bool IsSortable() const
|
||||||
|
{
|
||||||
|
return ((this->m_flags & wxDATAVIEW_COL_SORTABLE) != 0);
|
||||||
|
}
|
||||||
|
virtual bool IsSortOrderAscending() const
|
||||||
|
{
|
||||||
|
return this->m_ascending;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void SetAlignment(wxAlignment align);
|
||||||
|
virtual void SetBitmap (wxBitmap const& bitmap);
|
||||||
|
virtual void SetFlags (int flags);
|
||||||
|
virtual void SetHidden(bool WXUNUSED(hidden))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual void SetMaxWidth (int maxWidth);
|
||||||
|
virtual void SetMinWidth (int minWidth);
|
||||||
|
virtual void SetReorderable(bool reorderable);
|
||||||
|
virtual void SetResizeable (bool resizeable);
|
||||||
|
virtual void SetSortable (bool sortable);
|
||||||
|
virtual void SetSortOrder (bool ascending);
|
||||||
|
virtual void SetTitle (wxString const& title);
|
||||||
|
virtual void SetWidth (int width);
|
||||||
|
|
||||||
|
//
|
||||||
|
// implementation
|
||||||
|
//
|
||||||
|
WXDataBrowserPropertyID GetPropertyID() const
|
||||||
|
{
|
||||||
|
return this->m_propertyID;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetPropertyID(WXDataBrowserPropertyID newID)
|
||||||
|
{
|
||||||
|
this->m_propertyID = newID;
|
||||||
|
}
|
||||||
|
void SetWidthVariable(int NewWidth)
|
||||||
|
{
|
||||||
|
this->m_width = NewWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
//
|
||||||
|
// variables
|
||||||
|
//
|
||||||
|
bool m_ascending; // sorting order
|
||||||
|
|
||||||
|
WXDataBrowserPropertyID m_propertyID; // each column is identified by its unique property ID (NOT by the column index)
|
||||||
|
|
||||||
|
int m_flags; // flags for the column
|
||||||
|
int m_maxWidth; // maximum width for the column
|
||||||
|
int m_minWidth; // minimum width for the column
|
||||||
|
int m_width; // column width
|
||||||
|
|
||||||
|
wxAlignment m_alignment; // column header alignment
|
||||||
|
|
||||||
|
wxString m_title; // column title
|
||||||
|
|
||||||
|
// wxWidget internal stuff:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumn)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// wxDataViewCtrl
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
class WXDLLIMPEXP_ADV wxDataViewCtrl: public wxDataViewCtrlBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// Constructors / destructor:
|
||||||
|
wxDataViewCtrl()
|
||||||
|
{
|
||||||
|
this->Init();
|
||||||
|
}
|
||||||
|
wxDataViewCtrl(wxWindow *parent, wxWindowID id, wxPoint const& pos = wxDefaultPosition, wxSize const& size = wxDefaultSize, long style = 0,
|
||||||
|
wxValidator const& validator = wxDefaultValidator)
|
||||||
|
{
|
||||||
|
this->Init();
|
||||||
|
this->Create(parent, id, pos, size, style, validator );
|
||||||
|
}
|
||||||
|
|
||||||
|
~wxDataViewCtrl();
|
||||||
|
|
||||||
|
// explicit control creation
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id, wxPoint const& pos=wxDefaultPosition, wxSize const& size=wxDefaultSize, long style=0,
|
||||||
|
wxValidator const& validator=wxDefaultValidator);
|
||||||
|
|
||||||
|
virtual wxControl* GetMainWindow() // should disappear as it is not of any use for the native implementation
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// inherited methods from 'wxDataViewCtrlBase':
|
||||||
|
virtual bool AssociateModel(wxDataViewModel* model);
|
||||||
|
|
||||||
|
virtual bool AppendColumn(wxDataViewColumn* columnPtr);
|
||||||
|
virtual bool PrependColumn(wxDataViewColumn* columnPtr);
|
||||||
|
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
|
||||||
|
|
||||||
|
virtual bool ClearColumns();
|
||||||
|
virtual bool DeleteColumn(wxDataViewColumn* columnPtr);
|
||||||
|
virtual wxDataViewColumn* GetColumn(unsigned int pos) const;
|
||||||
|
virtual unsigned int GetColumnCount() const;
|
||||||
|
virtual int GetColumnPosition(wxDataViewColumn const* columnPtr) const;
|
||||||
|
|
||||||
|
virtual void Collapse(wxDataViewItem const& item);
|
||||||
|
virtual void EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr=NULL);
|
||||||
|
virtual void Expand(wxDataViewItem const& item);
|
||||||
|
|
||||||
|
virtual wxDataViewColumn* GetSortingColumn() const;
|
||||||
|
|
||||||
|
virtual unsigned int GetCount() const;
|
||||||
|
virtual wxRect GetItemRect(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) const;
|
||||||
|
virtual wxDataViewItem GetSelection() const;
|
||||||
|
virtual int GetSelections(wxDataViewItemArray& sel) const;
|
||||||
|
|
||||||
|
virtual void HitTest(wxPoint const& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const;
|
||||||
|
|
||||||
|
virtual bool IsSelected(wxDataViewItem const& item) const;
|
||||||
|
|
||||||
|
virtual void SelectAll();
|
||||||
|
virtual void Select(wxDataViewItem const& item);
|
||||||
|
virtual void SetSelections(wxDataViewItemArray const& sel);
|
||||||
|
|
||||||
|
virtual void Unselect(wxDataViewItem const& item);
|
||||||
|
virtual void UnselectAll();
|
||||||
|
|
||||||
|
//
|
||||||
|
// implementation
|
||||||
|
//
|
||||||
|
|
||||||
|
// adds all children of the passed parent to the control; if 'parentItem' is invalid the root(s) is/are added:
|
||||||
|
void AddChildrenLevel(wxDataViewItem const& parentItem);
|
||||||
|
|
||||||
|
// finishes editing of custom items; if no custom item is currently edited the method does nothing
|
||||||
|
void FinishCustomItemEditing();
|
||||||
|
|
||||||
|
// returns a pointer to a column;
|
||||||
|
// in case the pointer cannot be found NULL is returned:
|
||||||
|
wxDataViewColumn* GetColumnPtr(WXDataBrowserPropertyID propertyID) const;
|
||||||
|
// returns the current being rendered item of the customized renderer (this item is only valid during editing)
|
||||||
|
wxDataViewItem const& GetCustomRendererItem() const
|
||||||
|
{
|
||||||
|
return this->m_CustomRendererItem;
|
||||||
|
}
|
||||||
|
// returns a pointer to a customized renderer (this pointer is only valid during editing)
|
||||||
|
wxDataViewCustomRenderer* GetCustomRendererPtr() const
|
||||||
|
{
|
||||||
|
return this->m_CustomRendererPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// checks if currently a delete process is running:
|
||||||
|
bool IsDeleting() const
|
||||||
|
{
|
||||||
|
return this->m_Deleting;
|
||||||
|
}
|
||||||
|
|
||||||
|
// with CG, we need to get the context from an kEventControlDraw event
|
||||||
|
// unfortunately, the DataBrowser callbacks don't provide the context
|
||||||
|
// and we need it, so we need to set/remove it before and after draw
|
||||||
|
// events so we can access it in the callbacks.
|
||||||
|
void MacSetDrawingContext(void* context)
|
||||||
|
{
|
||||||
|
this->m_cgContext = context;
|
||||||
|
}
|
||||||
|
void* MacGetDrawingContext() const
|
||||||
|
{
|
||||||
|
return this->m_cgContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
// sets the currently being edited item of the custom renderer
|
||||||
|
void SetCustomRendererItem(wxDataViewItem const& NewItem)
|
||||||
|
{
|
||||||
|
this->m_CustomRendererItem = NewItem;
|
||||||
|
}
|
||||||
|
// sets the custom renderer
|
||||||
|
void SetCustomRendererPtr(wxDataViewCustomRenderer* NewCustomRendererPtr)
|
||||||
|
{
|
||||||
|
this->m_CustomRendererPtr = NewCustomRendererPtr;
|
||||||
|
}
|
||||||
|
// sets the flag indicating a deletion process:
|
||||||
|
void SetDeleting(bool deleting)
|
||||||
|
{
|
||||||
|
this->m_Deleting = deleting;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual wxVisualAttributes GetDefaultAttributes() const
|
||||||
|
{
|
||||||
|
return GetClassDefaultAttributes(GetWindowVariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
static wxVisualAttributes
|
||||||
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// inherited methods from wxDataViewCtrlBase:
|
||||||
|
virtual void DoSetExpanderColumn();
|
||||||
|
virtual void DoSetIndent();
|
||||||
|
|
||||||
|
// event handling:
|
||||||
|
void OnSize(wxSizeEvent &event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
// type definitions:
|
||||||
|
WX_DECLARE_HASH_MAP(WXDataBrowserPropertyID,wxDataViewColumn*,wxIntegerHash,wxIntegerEqual,ColumnPointerHashMapType);
|
||||||
|
|
||||||
|
// initializing of local variables:
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
///
|
||||||
|
// variables
|
||||||
|
//
|
||||||
|
|
||||||
|
bool m_Deleting; // flag indicating if a delete process is running; this flag is necessary because the notifier indicating an item deletion in the model may be called
|
||||||
|
// after the actual deletion of the item; then, the callback function "wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc" may
|
||||||
|
// try to update data into variables that are already deleted; this flag will ignore all variable update requests during item deletion
|
||||||
|
|
||||||
|
void* m_cgContext; // pointer to core graphics context
|
||||||
|
|
||||||
|
wxDataViewCustomRenderer* m_CustomRendererPtr; // pointer to a valid custom renderer while editing; this class does NOT own the pointer
|
||||||
|
|
||||||
|
wxDataViewItem m_CustomRendererItem; // currently edited item by the customerenderer; it is invalid while not editing
|
||||||
|
|
||||||
|
ColumnPointerHashMapType m_ColumnPointers; // all column pointers are stored in a hash map with the property ID as a key
|
||||||
|
|
||||||
|
// wxWidget internal stuff:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxDataViewCtrl)
|
||||||
|
DECLARE_NO_COPY_CLASS(wxDataViewCtrl)
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _WX_MACCARBONDATAVIEWCTRL_H_
|
15
include/wx/osx/carbon/dc.h
Normal file
15
include/wx/osx/carbon/dc.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: dc.h
|
||||||
|
// Purpose: wxDC class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DC_H_
|
||||||
|
#define _WX_DC_H_
|
||||||
|
|
||||||
|
#endif // _WX_DC_H_
|
72
include/wx/osx/carbon/dcclient.h
Normal file
72
include/wx/osx/carbon/dcclient.h
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: dcclient.h
|
||||||
|
// Purpose: wxClientDC, wxPaintDC and wxWindowDC classes
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DCCLIENT_H_
|
||||||
|
#define _WX_DCCLIENT_H_
|
||||||
|
|
||||||
|
#include "wx/dc.h"
|
||||||
|
#include "wx/dcgraph.h"
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// classes
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxPaintDC;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxWindowDCImpl: public wxGCDCImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxWindowDCImpl( wxDC *owner );
|
||||||
|
wxWindowDCImpl( wxDC *owner, wxWindow *window );
|
||||||
|
virtual ~wxWindowDCImpl();
|
||||||
|
|
||||||
|
virtual void DoGetSize( int *width, int *height ) const;
|
||||||
|
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool m_release;
|
||||||
|
int m_width;
|
||||||
|
int m_height;
|
||||||
|
|
||||||
|
DECLARE_CLASS(wxWindowDCImpl)
|
||||||
|
DECLARE_NO_COPY_CLASS(wxWindowDCImpl)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxClientDCImpl: public wxWindowDCImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxClientDCImpl( wxDC *owner );
|
||||||
|
wxClientDCImpl( wxDC *owner, wxWindow *window );
|
||||||
|
virtual ~wxClientDCImpl();
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_CLASS(wxClientDCImpl)
|
||||||
|
DECLARE_NO_COPY_CLASS(wxClientDCImpl)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxPaintDCImpl: public wxWindowDCImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxPaintDCImpl( wxDC *owner );
|
||||||
|
wxPaintDCImpl( wxDC *owner, wxWindow *win );
|
||||||
|
virtual ~wxPaintDCImpl();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
DECLARE_CLASS(wxPaintDCImpl)
|
||||||
|
DECLARE_NO_COPY_CLASS(wxPaintDCImpl)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_DCCLIENT_H_
|
46
include/wx/osx/carbon/dcmemory.h
Normal file
46
include/wx/osx/carbon/dcmemory.h
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: dcmemory.h
|
||||||
|
// Purpose: wxMemoryDC class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DCMEMORY_H_
|
||||||
|
#define _WX_DCMEMORY_H_
|
||||||
|
|
||||||
|
#include "wx/mac/carbon/dcclient.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMemoryDCImpl: public wxPaintDCImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxMemoryDCImpl( wxMemoryDC *owner );
|
||||||
|
wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap );
|
||||||
|
wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc );
|
||||||
|
|
||||||
|
virtual ~wxMemoryDCImpl();
|
||||||
|
|
||||||
|
virtual void DoGetSize( int *width, int *height ) const;
|
||||||
|
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
|
||||||
|
{ return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect); }
|
||||||
|
virtual void DoSelect(const wxBitmap& bitmap);
|
||||||
|
|
||||||
|
virtual const wxBitmap& GetSelectedBitmap() const
|
||||||
|
{ return m_selected; }
|
||||||
|
virtual wxBitmap& GetSelectedBitmap()
|
||||||
|
{ return m_selected; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
wxBitmap m_selected;
|
||||||
|
|
||||||
|
DECLARE_CLASS(wxMemoryDCImpl)
|
||||||
|
DECLARE_NO_COPY_CLASS(wxMemoryDCImpl)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_DCMEMORY_H_
|
52
include/wx/osx/carbon/dcprint.h
Normal file
52
include/wx/osx/carbon/dcprint.h
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/dcprint.h
|
||||||
|
// Purpose: wxPrinterDC class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DCPRINT_H_
|
||||||
|
#define _WX_DCPRINT_H_
|
||||||
|
|
||||||
|
#include "wx/dc.h"
|
||||||
|
#include "wx/dcgraph.h"
|
||||||
|
#include "wx/cmndata.h"
|
||||||
|
|
||||||
|
class wxNativePrinterDC ;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxPrinterDCImpl: public wxGCDCImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
|
wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& printdata );
|
||||||
|
virtual ~wxPrinterDCImpl();
|
||||||
|
|
||||||
|
virtual bool StartDoc( const wxString& WXUNUSED(message) ) ;
|
||||||
|
virtual void EndDoc(void) ;
|
||||||
|
virtual void StartPage(void) ;
|
||||||
|
virtual void EndPage(void) ;
|
||||||
|
|
||||||
|
wxRect GetPaperRect();
|
||||||
|
|
||||||
|
wxPrintData& GetPrintData() { return m_printData; }
|
||||||
|
virtual wxSize GetPPI() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DoGetSize( int *width, int *height ) const;
|
||||||
|
|
||||||
|
wxPrintData m_printData ;
|
||||||
|
wxNativePrinterDC* m_nativePrinterDC ;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_CLASS(wxPrinterDC)
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_DCPRINT_H_
|
||||||
|
|
34
include/wx/osx/carbon/dcscreen.h
Normal file
34
include/wx/osx/carbon/dcscreen.h
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: dcscreen.h
|
||||||
|
// Purpose: wxScreenDC class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DCSCREEN_H_
|
||||||
|
#define _WX_DCSCREEN_H_
|
||||||
|
|
||||||
|
#include "wx/dcclient.h"
|
||||||
|
#include "wx/mac/carbon/dcclient.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxScreenDCImpl: public wxWindowDCImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxScreenDCImpl( wxDC *owner );
|
||||||
|
virtual ~wxScreenDCImpl();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void* m_overlayWindow;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_CLASS(wxScreenDCImpl)
|
||||||
|
DECLARE_NO_COPY_CLASS(wxScreenDCImpl)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_DCSCREEN_H_
|
||||||
|
|
79
include/wx/osx/carbon/dialog.h
Normal file
79
include/wx/osx/carbon/dialog.h
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: dialog.h
|
||||||
|
// Purpose: wxDialog class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DIALOG_H_
|
||||||
|
#define _WX_DIALOG_H_
|
||||||
|
|
||||||
|
#include "wx/panel.h"
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxDialogNameStr[];
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxMacToolTip ;
|
||||||
|
|
||||||
|
// Dialog boxes
|
||||||
|
class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxDialog)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxDialog() { Init(); }
|
||||||
|
|
||||||
|
// Constructor with no modal flag - the new convention.
|
||||||
|
wxDialog(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_DIALOG_STYLE,
|
||||||
|
const wxString& name = wxDialogNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
Create(parent, id, title, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_DIALOG_STYLE,
|
||||||
|
const wxString& name = wxDialogNameStr);
|
||||||
|
|
||||||
|
virtual ~wxDialog();
|
||||||
|
|
||||||
|
// virtual bool Destroy();
|
||||||
|
virtual bool Show(bool show = true);
|
||||||
|
|
||||||
|
void SetModal(bool flag);
|
||||||
|
virtual bool IsModal() const;
|
||||||
|
|
||||||
|
// For now, same as Show(TRUE) but returns return code
|
||||||
|
virtual int ShowModal();
|
||||||
|
|
||||||
|
// may be called to terminate the dialog with the given return code
|
||||||
|
virtual void EndModal(int retCode);
|
||||||
|
|
||||||
|
// implementation
|
||||||
|
// --------------
|
||||||
|
|
||||||
|
// show modal dialog and enter modal loop
|
||||||
|
void DoShowModal();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// mac also takes command-period as cancel
|
||||||
|
virtual bool IsEscapeKey(const wxKeyEvent& event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
bool m_isModalStyle;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_DIALOG_H_
|
35
include/wx/osx/carbon/dirdlg.h
Normal file
35
include/wx/osx/carbon/dirdlg.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: dirdlg.h
|
||||||
|
// Purpose: wxDirDialog class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DIRDLG_H_
|
||||||
|
#define _WX_DIRDLG_H_
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxDirDialog : public wxDirDialogBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxDirDialog(wxWindow *parent,
|
||||||
|
const wxString& message = wxDirSelectorPromptStr,
|
||||||
|
const wxString& defaultPath = _T(""),
|
||||||
|
long style = wxDD_DEFAULT_STYLE,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
const wxString& name = wxDirDialogNameStr);
|
||||||
|
|
||||||
|
virtual int ShowModal();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxWindow * m_parent;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxDirDialog)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_DIRDLG_H_
|
108
include/wx/osx/carbon/dnd.h
Normal file
108
include/wx/osx/carbon/dnd.h
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/dnd.h
|
||||||
|
// Purpose: Declaration of the wxDropTarget, wxDropSource class etc.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DND_H_
|
||||||
|
#define _WX_DND_H_
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
|
#include "wx/defs.h"
|
||||||
|
#include "wx/object.h"
|
||||||
|
#include "wx/string.h"
|
||||||
|
#include "wx/string.h"
|
||||||
|
#include "wx/dataobj.h"
|
||||||
|
#include "wx/cursor.h"
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
// classes
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxDropTarget;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxTextDropTarget;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxFileDropTarget;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxDropSource;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// macros
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// this macro may be used instead for wxDropSource ctor arguments: it will use
|
||||||
|
// the icon 'name' from an XPM file under GTK, but will expand to something
|
||||||
|
// else under MSW. If you don't use it, you will have to use #ifdef in the
|
||||||
|
// application code.
|
||||||
|
#define wxDROP_ICON(X) wxCursor(X##_xpm)
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
// wxDropTarget
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxDropTarget: public wxDropTargetBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
wxDropTarget(wxDataObject *dataObject = (wxDataObject*) NULL );
|
||||||
|
|
||||||
|
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
|
virtual bool OnDrop(wxCoord x, wxCoord y);
|
||||||
|
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
|
virtual bool GetData();
|
||||||
|
|
||||||
|
bool CurrentDragHasSupportedFormat() ;
|
||||||
|
void SetCurrentDrag( void* drag ) { m_currentDrag = drag ; }
|
||||||
|
void* GetCurrentDrag() { return m_currentDrag ; }
|
||||||
|
protected :
|
||||||
|
void* m_currentDrag ;
|
||||||
|
};
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
// wxDropSource
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctors: if you use default ctor you must call SetData() later!
|
||||||
|
//
|
||||||
|
// NB: the "wxWindow *win" parameter is unused and is here only for wxGTK
|
||||||
|
// compatibility, as well as both icon parameters
|
||||||
|
wxDropSource( wxWindow *win = (wxWindow *)NULL,
|
||||||
|
const wxCursor &cursorCopy = wxNullCursor,
|
||||||
|
const wxCursor &cursorMove = wxNullCursor,
|
||||||
|
const wxCursor &cursorStop = wxNullCursor);
|
||||||
|
|
||||||
|
/* constructor for setting one data object */
|
||||||
|
wxDropSource( wxDataObject& data,
|
||||||
|
wxWindow *win,
|
||||||
|
const wxCursor &cursorCopy = wxNullCursor,
|
||||||
|
const wxCursor &cursorMove = wxNullCursor,
|
||||||
|
const wxCursor &cursorStop = wxNullCursor);
|
||||||
|
|
||||||
|
virtual ~wxDropSource();
|
||||||
|
|
||||||
|
// do it (call this in response to a mouse button press, for example)
|
||||||
|
// params: if bAllowMove is false, data can be only copied
|
||||||
|
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
|
||||||
|
|
||||||
|
wxWindow* GetWindow() { return m_window ; }
|
||||||
|
void SetCurrentDrag( void* drag ) { m_currentDrag = drag ; }
|
||||||
|
void* GetCurrentDrag() { return m_currentDrag ; }
|
||||||
|
bool MacInstallDefaultCursor(wxDragResult effect) ;
|
||||||
|
protected :
|
||||||
|
|
||||||
|
wxWindow *m_window;
|
||||||
|
void* m_currentDrag ;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
|
#endif
|
||||||
|
//_WX_DND_H_
|
71
include/wx/osx/carbon/drawer.h
Normal file
71
include/wx/osx/carbon/drawer.h
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/drawer.h
|
||||||
|
// Purpose: Drawer child window class.
|
||||||
|
// Drawer windows appear under their parent window and
|
||||||
|
// behave like a drawer, opening and closing to reveal
|
||||||
|
// content that does not need to be visible at all times.
|
||||||
|
// Author: Jason Bagley
|
||||||
|
// Modified by:
|
||||||
|
// Created: 2004-30-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Jason Bagley; Art & Logic, Inc.
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DRAWERWINDOW_H_
|
||||||
|
#define _WX_DRAWERWINDOW_H_
|
||||||
|
|
||||||
|
#include "wx/toplevel.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// NB: This is currently a private undocumented class -
|
||||||
|
// it is stable, but the API is not and will change in the
|
||||||
|
// near future
|
||||||
|
//
|
||||||
|
|
||||||
|
#if ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 )
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxDrawerWindow : public wxTopLevelWindow
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxDrawerWindow)
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
wxDrawerWindow();
|
||||||
|
|
||||||
|
wxDrawerWindow(wxWindow* parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
wxSize size = wxDefaultSize,
|
||||||
|
wxDirection edge = wxLEFT,
|
||||||
|
const wxString& name = wxT("drawerwindow"))
|
||||||
|
{
|
||||||
|
this->Create(parent, id, title, size, edge, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~wxDrawerWindow();
|
||||||
|
|
||||||
|
// Create a drawer window.
|
||||||
|
// If parent is NULL, create as a tool window.
|
||||||
|
// If parent is not NULL, then wxTopLevelWindow::Attach this window to parent.
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
wxSize size = wxDefaultSize,
|
||||||
|
wxDirection edge = wxLEFT,
|
||||||
|
const wxString& name = wxFrameNameStr);
|
||||||
|
|
||||||
|
bool Open(bool show = true); // open or close the drawer, possibility for async param, i.e. animate
|
||||||
|
bool Close() { return this->Open(false); }
|
||||||
|
bool IsOpen() const;
|
||||||
|
|
||||||
|
// Set the edge of the parent where the drawer attaches.
|
||||||
|
bool SetPreferredEdge(wxDirection edge);
|
||||||
|
wxDirection GetPreferredEdge() const;
|
||||||
|
wxDirection GetCurrentEdge() const; // not necessarily the preferred, due to screen constraints
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // defined( __WXMAC__ ) && TARGET_API_MAC_OSX && ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 )
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_DRAWERWINDOW_H_
|
64
include/wx/osx/carbon/evtloop.h
Normal file
64
include/wx/osx/carbon/evtloop.h
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/evtloop.h
|
||||||
|
// Purpose: declaration of wxEventLoop for wxMac
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 2006-01-12
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_CARBON_EVTLOOP_H_
|
||||||
|
#define _WX_MAC_CARBON_EVTLOOP_H_
|
||||||
|
|
||||||
|
// set wxMAC_USE_RUN_APP_EVENT_LOOP to 1 if the standard
|
||||||
|
// RunApplicationEventLoop function should be used, otherwise
|
||||||
|
// the lower level CarbonEventLoop will be used
|
||||||
|
//
|
||||||
|
// in the long run we should make this 1 by default but we will have to clean
|
||||||
|
// up event handling to make sure we don't miss handling of things like pending
|
||||||
|
// events etc and perhaps we will also have to pipe events through an
|
||||||
|
// ueber-event-handler to make sure we have one place to do all these
|
||||||
|
// house-keeping functions
|
||||||
|
#define wxMAC_USE_RUN_APP_EVENT_LOOP 0
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxEventLoop
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if wxMAC_USE_RUN_APP_EVENT_LOOP
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxEventLoopBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxGUIEventLoop() { m_exitcode = 0; }
|
||||||
|
|
||||||
|
// implement base class pure virtuals
|
||||||
|
virtual int Run();
|
||||||
|
virtual void Exit(int rc = 0);
|
||||||
|
virtual bool Pending() const;
|
||||||
|
virtual bool Dispatch();
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_exitcode;
|
||||||
|
};
|
||||||
|
|
||||||
|
#else // manual event loop
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxEventLoopManual
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxGUIEventLoop() { }
|
||||||
|
|
||||||
|
virtual bool Pending() const;
|
||||||
|
virtual bool Dispatch();
|
||||||
|
|
||||||
|
// implement base class pure virtual
|
||||||
|
virtual void WakeUp();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // auto/manual event loop
|
||||||
|
|
||||||
|
#endif // _WX_MAC_CARBON_EVTLOOP_H_
|
||||||
|
|
49
include/wx/osx/carbon/filedlg.h
Normal file
49
include/wx/osx/carbon/filedlg.h
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: filedlg.h
|
||||||
|
// Purpose: wxFileDialog class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_FILEDLG_H_
|
||||||
|
#define _WX_FILEDLG_H_
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
// wxFileDialog
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxFileDialog: public wxFileDialogBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
||||||
|
protected:
|
||||||
|
wxArrayString m_fileNames;
|
||||||
|
wxArrayString m_paths;
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxFileDialog(wxWindow *parent,
|
||||||
|
const wxString& message = wxFileSelectorPromptStr,
|
||||||
|
const wxString& defaultDir = wxEmptyString,
|
||||||
|
const wxString& defaultFile = wxEmptyString,
|
||||||
|
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||||
|
long style = wxFD_DEFAULT_STYLE,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& sz = wxDefaultSize,
|
||||||
|
const wxString& name = wxFileDialogNameStr);
|
||||||
|
|
||||||
|
virtual void GetPaths(wxArrayString& paths) const { paths = m_paths; }
|
||||||
|
virtual void GetFilenames(wxArrayString& files) const { files = m_fileNames ; }
|
||||||
|
|
||||||
|
virtual int ShowModal();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// not supported for file dialog, RR
|
||||||
|
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
|
||||||
|
int WXUNUSED(width), int WXUNUSED(height),
|
||||||
|
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_FILEDLG_H_
|
123
include/wx/osx/carbon/font.h
Normal file
123
include/wx/osx/carbon/font.h
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: font.h
|
||||||
|
// Purpose: wxFont class
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 01/02/97
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_FONT_H_
|
||||||
|
#define _WX_FONT_H_
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxFont
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxFont : public wxFontBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctors and such
|
||||||
|
wxFont() { }
|
||||||
|
|
||||||
|
wxFont(int size,
|
||||||
|
int family,
|
||||||
|
int style,
|
||||||
|
int weight,
|
||||||
|
bool underlined = FALSE,
|
||||||
|
const wxString& face = wxEmptyString,
|
||||||
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||||
|
{
|
||||||
|
(void)Create(size, family, style, weight, underlined, face, encoding);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxFont(const wxNativeFontInfo& info)
|
||||||
|
{
|
||||||
|
(void)Create(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxFont(const wxString& fontDesc);
|
||||||
|
|
||||||
|
bool Create(int size,
|
||||||
|
int family,
|
||||||
|
int style,
|
||||||
|
int weight,
|
||||||
|
bool underlined = FALSE,
|
||||||
|
const wxString& face = wxEmptyString,
|
||||||
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||||
|
|
||||||
|
bool Create(const wxNativeFontInfo& info);
|
||||||
|
|
||||||
|
bool MacCreateFromThemeFont( wxUint16 themeFontID ) ;
|
||||||
|
#if wxMAC_USE_CORE_TEXT
|
||||||
|
bool MacCreateFromUIFont( wxUint32 coreTextFontType );
|
||||||
|
bool MacCreateFromCTFontDescriptor( const void * ctFontDescriptor, int pointSize = 0 );
|
||||||
|
bool MacCreateFromCTFont( const void * ctFont );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
virtual ~wxFont();
|
||||||
|
|
||||||
|
// implement base class pure virtuals
|
||||||
|
virtual int GetPointSize() const;
|
||||||
|
virtual wxSize GetPixelSize() const;
|
||||||
|
virtual int GetFamily() const;
|
||||||
|
virtual int GetStyle() const;
|
||||||
|
virtual int GetWeight() const;
|
||||||
|
virtual bool GetUnderlined() const;
|
||||||
|
virtual wxString GetFaceName() const;
|
||||||
|
virtual wxFontEncoding GetEncoding() const;
|
||||||
|
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
|
||||||
|
|
||||||
|
virtual void SetPointSize(int pointSize);
|
||||||
|
virtual void SetFamily(int family);
|
||||||
|
virtual void SetStyle(int style);
|
||||||
|
virtual void SetWeight(int weight);
|
||||||
|
virtual bool SetFaceName(const wxString& faceName);
|
||||||
|
virtual void SetUnderlined(bool underlined);
|
||||||
|
virtual void SetEncoding(wxFontEncoding encoding);
|
||||||
|
|
||||||
|
// implementation only from now on
|
||||||
|
// -------------------------------
|
||||||
|
|
||||||
|
virtual bool RealizeResource();
|
||||||
|
|
||||||
|
// Unofficial API, don't use
|
||||||
|
virtual void SetNoAntiAliasing( bool noAA = TRUE ) ;
|
||||||
|
virtual bool GetNoAntiAliasing() const ;
|
||||||
|
|
||||||
|
// Mac-specific, risks to change, don't use in portable code
|
||||||
|
|
||||||
|
#if wxMAC_USE_ATSU_TEXT
|
||||||
|
// 'old' Quickdraw accessors
|
||||||
|
short MacGetFontNum() const;
|
||||||
|
short MacGetFontSize() const;
|
||||||
|
wxByte MacGetFontStyle() const;
|
||||||
|
|
||||||
|
// 'new' ATSUI accessors
|
||||||
|
wxUint32 MacGetATSUFontID() const;
|
||||||
|
wxUint32 MacGetATSUAdditionalQDStyles() const;
|
||||||
|
wxUint16 MacGetThemeFontID() const ;
|
||||||
|
|
||||||
|
// Returns an ATSUStyle not ATSUStyle*
|
||||||
|
#endif
|
||||||
|
#if wxMAC_USE_CORE_TEXT
|
||||||
|
const void * MacGetCTFont() const;
|
||||||
|
const void * MacGetCTFontDescriptor() const;
|
||||||
|
#endif
|
||||||
|
#if wxMAC_USE_CORE_TEXT || wxMAC_USE_ATSU_TEXT
|
||||||
|
void* MacGetATSUStyle() const ;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Unshare();
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_FONT_H_
|
166
include/wx/osx/carbon/fontdlg.h
Normal file
166
include/wx/osx/carbon/fontdlg.h
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/fontdlg.h
|
||||||
|
// Purpose: wxFontDialog class using fonts window services (10.2+).
|
||||||
|
// Author: Ryan Norton
|
||||||
|
// Modified by:
|
||||||
|
// Created: 2004-09-25
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Ryan Norton
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_FONTDLG_H_
|
||||||
|
#define _WX_FONTDLG_H_
|
||||||
|
|
||||||
|
#include "wx/dialog.h"
|
||||||
|
#include "wx/cmndata.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Font dialog
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef wxMAC_USE_EXPERIMENTAL_FONTDIALOG
|
||||||
|
#define wxMAC_USE_EXPERIMENTAL_FONTDIALOG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if wxMAC_USE_EXPERIMENTAL_FONTDIALOG
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxFontDialog : public wxDialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxFontDialog();
|
||||||
|
wxFontDialog(wxWindow *parent, const wxFontData& data);
|
||||||
|
virtual ~wxFontDialog();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, const wxFontData& data);
|
||||||
|
|
||||||
|
int ShowModal();
|
||||||
|
wxFontData& GetFontData() { return m_fontData; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxFontData m_fontData;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxFontDialog)
|
||||||
|
};
|
||||||
|
|
||||||
|
extern "C" int RunMixedFontDialog(wxFontDialog* dialog) ;
|
||||||
|
|
||||||
|
#else // wxMAC_USE_EXPERIMENTAL_FONTDIALOG
|
||||||
|
|
||||||
|
#if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Forward declarations
|
||||||
|
*/
|
||||||
|
|
||||||
|
class wxFontColourSwatchCtrl;
|
||||||
|
class wxFontPreviewCtrl;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxSpinCtrl;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxSpinEvent;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxListBox;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxChoice;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxButton;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxStaticText;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Control identifiers
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define wxID_FONTDIALOG_FACENAME 20001
|
||||||
|
#define wxID_FONTDIALOG_FONTSIZE 20002
|
||||||
|
#define wxID_FONTDIALOG_BOLD 20003
|
||||||
|
#define wxID_FONTDIALOG_ITALIC 20004
|
||||||
|
#define wxID_FONTDIALOG_UNDERLINED 20005
|
||||||
|
#define wxID_FONTDIALOG_COLOUR 20006
|
||||||
|
#define wxID_FONTDIALOG_PREVIEW 20007
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxFontDialog: public wxDialog
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxFontDialog)
|
||||||
|
|
||||||
|
#if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxFontDialog();
|
||||||
|
wxFontDialog(wxWindow *parent, const wxFontData& data);
|
||||||
|
virtual ~wxFontDialog();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, const wxFontData& data);
|
||||||
|
|
||||||
|
int ShowModal();
|
||||||
|
wxFontData& GetFontData() { return m_fontData; }
|
||||||
|
bool IsShown() const;
|
||||||
|
void OnPanelClose();
|
||||||
|
void SetData(const wxFontData& data);
|
||||||
|
|
||||||
|
#if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
|
||||||
|
|
||||||
|
/// Creates the controls and sizers
|
||||||
|
void CreateControls();
|
||||||
|
|
||||||
|
/// Initialize font
|
||||||
|
void InitializeFont();
|
||||||
|
|
||||||
|
/// Set controls according to current font
|
||||||
|
void InitializeControls();
|
||||||
|
|
||||||
|
/// Respond to font change
|
||||||
|
void ChangeFont();
|
||||||
|
|
||||||
|
/// Respond to colour change
|
||||||
|
void OnColourChanged(wxCommandEvent& event);
|
||||||
|
|
||||||
|
/// wxEVT_COMMAND_LISTBOX_SELECTED event handler for wxID_FONTDIALOG_FACENAME
|
||||||
|
void OnFontdialogFacenameSelected( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for wxID_FONTDIALOG_FONTSIZE
|
||||||
|
void OnFontdialogFontsizeUpdated( wxSpinEvent& event );
|
||||||
|
|
||||||
|
/// wxEVT_COMMAND_TEXT_UPDATED event handler for wxID_FONTDIALOG_FONTSIZE
|
||||||
|
void OnFontdialogFontsizeTextUpdated( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for wxID_FONTDIALOG_BOLD
|
||||||
|
void OnFontdialogBoldClick( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for wxID_FONTDIALOG_ITALIC
|
||||||
|
void OnFontdialogItalicClick( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for wxID_FONTDIALOG_UNDERLINED
|
||||||
|
void OnFontdialogUnderlinedClick( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
|
||||||
|
void OnOkClick( wxCommandEvent& event );
|
||||||
|
|
||||||
|
/// Should we show tooltips?
|
||||||
|
static bool ShowToolTips();
|
||||||
|
|
||||||
|
wxListBox* m_facenameCtrl;
|
||||||
|
wxSpinCtrl* m_sizeCtrl;
|
||||||
|
wxCheckBox* m_boldCtrl;
|
||||||
|
wxCheckBox* m_italicCtrl;
|
||||||
|
wxCheckBox* m_underlinedCtrl;
|
||||||
|
wxFontColourSwatchCtrl* m_colourCtrl;
|
||||||
|
wxFontPreviewCtrl* m_previewCtrl;
|
||||||
|
|
||||||
|
wxFont m_dialogFont;
|
||||||
|
bool m_suppressUpdates;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxWindow* m_dialogParent;
|
||||||
|
wxFontData m_fontData;
|
||||||
|
void* m_pEventHandlerRef;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_FONTDLG_H_
|
121
include/wx/osx/carbon/frame.h
Normal file
121
include/wx/osx/carbon/frame.h
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: frame.h
|
||||||
|
// Purpose: wxFrame class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_FRAME_H_
|
||||||
|
#define _WX_FRAME_H_
|
||||||
|
|
||||||
|
#include "wx/window.h"
|
||||||
|
#include "wx/toolbar.h"
|
||||||
|
#include "wx/accel.h"
|
||||||
|
#include "wx/icon.h"
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxToolBarNameStr[];
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxMenuBar;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxStatusBar;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxMacToolTip ;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxFrame: public wxFrameBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// construction
|
||||||
|
wxFrame() { Init(); }
|
||||||
|
wxFrame(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE,
|
||||||
|
const wxString& name = wxFrameNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
|
||||||
|
Create(parent, id, title, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE,
|
||||||
|
const wxString& name = wxFrameNameStr);
|
||||||
|
|
||||||
|
virtual ~wxFrame();
|
||||||
|
|
||||||
|
// implementation only from now on
|
||||||
|
// -------------------------------
|
||||||
|
|
||||||
|
// get the origin of the client area (which may be different from (0, 0)
|
||||||
|
// if the frame has a toolbar) in client coordinates
|
||||||
|
virtual wxPoint GetClientAreaOrigin() const;
|
||||||
|
|
||||||
|
// override some more virtuals
|
||||||
|
virtual bool Enable(bool enable = TRUE) ;
|
||||||
|
|
||||||
|
// event handlers
|
||||||
|
void OnActivate(wxActivateEvent& event);
|
||||||
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||||
|
|
||||||
|
// Toolbar
|
||||||
|
#if wxUSE_TOOLBAR
|
||||||
|
virtual wxToolBar* CreateToolBar(long style = -1,
|
||||||
|
wxWindowID id = -1,
|
||||||
|
const wxString& name = wxToolBarNameStr);
|
||||||
|
|
||||||
|
virtual void SetToolBar(wxToolBar *toolbar);
|
||||||
|
#endif // wxUSE_TOOLBAR
|
||||||
|
|
||||||
|
// Status bar
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
virtual wxStatusBar* OnCreateStatusBar(int number = 1,
|
||||||
|
long style = wxST_SIZEGRIP,
|
||||||
|
wxWindowID id = 0,
|
||||||
|
const wxString& name = wxStatusLineNameStr);
|
||||||
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
|
// called by wxWindow whenever it gets focus
|
||||||
|
void SetLastFocus(wxWindow *win) { m_winLastFocused = win; }
|
||||||
|
wxWindow *GetLastFocus() const { return m_winLastFocused; }
|
||||||
|
|
||||||
|
void PositionBars();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
#if wxUSE_TOOLBAR
|
||||||
|
virtual void PositionToolBar();
|
||||||
|
#endif
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
virtual void PositionStatusBar();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// override base class virtuals
|
||||||
|
virtual void DoGetClientSize(int *width, int *height) const;
|
||||||
|
virtual void DoSetClientSize(int width, int height);
|
||||||
|
|
||||||
|
virtual void DetachMenuBar();
|
||||||
|
virtual void AttachMenuBar(wxMenuBar *menubar);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// the last focused child: we restore focus to it on activation
|
||||||
|
wxWindow *m_winLastFocused;
|
||||||
|
|
||||||
|
virtual bool MacIsChildOfClientArea( const wxWindow* child ) const ;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxFrame)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_FRAME_H_
|
56
include/wx/osx/carbon/gauge.h
Normal file
56
include/wx/osx/carbon/gauge.h
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: gauge.h
|
||||||
|
// Purpose: wxGauge class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_GAUGE_H_
|
||||||
|
#define _WX_GAUGE_H_
|
||||||
|
|
||||||
|
#include "wx/control.h"
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxGaugeNameStr[];
|
||||||
|
|
||||||
|
// Group box
|
||||||
|
class WXDLLIMPEXP_CORE wxGauge: public wxGaugeBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline wxGauge() { }
|
||||||
|
|
||||||
|
inline wxGauge(wxWindow *parent, wxWindowID id,
|
||||||
|
int range,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxGA_HORIZONTAL,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxGaugeNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, range, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
int range,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxGA_HORIZONTAL,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxGaugeNameStr);
|
||||||
|
|
||||||
|
// set gauge range/value
|
||||||
|
virtual void SetRange(int range);
|
||||||
|
virtual void SetValue(int pos);
|
||||||
|
virtual int GetValue() const ;
|
||||||
|
|
||||||
|
void Pulse();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGauge)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_GAUGE_H_
|
142
include/wx/osx/carbon/glcanvas.h
Normal file
142
include/wx/osx/carbon/glcanvas.h
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/glcanvas.h
|
||||||
|
// Purpose: wxGLCanvas, for using OpenGL with wxWidgets under Macintosh
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_GLCANVAS_H_
|
||||||
|
#define _WX_GLCANVAS_H_
|
||||||
|
|
||||||
|
#ifdef __DARWIN__
|
||||||
|
# include <OpenGL/gl.h>
|
||||||
|
# include <AGL/agl.h>
|
||||||
|
#else
|
||||||
|
# include <gl.h>
|
||||||
|
# include <agl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_GL wxGLContext : public wxGLContextBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxGLContext(wxGLCanvas *win, const wxGLContext *other = NULL);
|
||||||
|
virtual ~wxGLContext();
|
||||||
|
|
||||||
|
virtual bool SetCurrent(const wxGLCanvas& win) const;
|
||||||
|
|
||||||
|
// Mac-specific
|
||||||
|
AGLContext GetAGLContext() const { return m_aglContext; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
AGLContext m_aglContext;
|
||||||
|
|
||||||
|
DECLARE_NO_COPY_CLASS(wxGLContext)
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxGLCanvas(wxWindow *parent,
|
||||||
|
wxWindowID id = wxID_ANY,
|
||||||
|
const int *attribList = NULL,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxGLCanvasName,
|
||||||
|
const wxPalette& palette = wxNullPalette);
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxGLCanvasName,
|
||||||
|
const int *attribList = NULL,
|
||||||
|
const wxPalette& palette = wxNullPalette);
|
||||||
|
|
||||||
|
virtual ~wxGLCanvas();
|
||||||
|
|
||||||
|
// implement wxGLCanvasBase methods
|
||||||
|
virtual bool SwapBuffers();
|
||||||
|
|
||||||
|
|
||||||
|
// Mac-specific functions
|
||||||
|
// ----------------------
|
||||||
|
|
||||||
|
// return true if multisample extension is supported
|
||||||
|
static bool IsAGLMultiSampleAvailable();
|
||||||
|
|
||||||
|
// return the pixel format used by this window
|
||||||
|
AGLPixelFormat GetAGLPixelFormat() const { return m_aglFormat; }
|
||||||
|
|
||||||
|
// update the view port of the current context to match this window
|
||||||
|
void SetViewport();
|
||||||
|
|
||||||
|
|
||||||
|
// deprecated methods
|
||||||
|
// ------------------
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY_2_8
|
||||||
|
wxDEPRECATED(
|
||||||
|
wxGLCanvas(wxWindow *parent,
|
||||||
|
wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxGLCanvasName,
|
||||||
|
const int *attribList = NULL,
|
||||||
|
const wxPalette& palette = wxNullPalette)
|
||||||
|
);
|
||||||
|
|
||||||
|
wxDEPRECATED(
|
||||||
|
wxGLCanvas(wxWindow *parent,
|
||||||
|
const wxGLContext *shared,
|
||||||
|
wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxGLCanvasName,
|
||||||
|
const int *attribList = NULL,
|
||||||
|
const wxPalette& palette = wxNullPalette)
|
||||||
|
);
|
||||||
|
|
||||||
|
wxDEPRECATED(
|
||||||
|
wxGLCanvas(wxWindow *parent,
|
||||||
|
const wxGLCanvas *shared,
|
||||||
|
wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxGLCanvasName,
|
||||||
|
const int *attribList = NULL,
|
||||||
|
const wxPalette& palette = wxNullPalette)
|
||||||
|
);
|
||||||
|
#endif // WXWIN_COMPATIBILITY_2_8
|
||||||
|
|
||||||
|
// implementation-only from now on
|
||||||
|
|
||||||
|
// Unlike some other platforms, this must get called if you override it,
|
||||||
|
// i.e. don't forget "event.Skip()" in your EVT_SIZE handler
|
||||||
|
void OnSize(wxSizeEvent& event);
|
||||||
|
|
||||||
|
virtual void MacSuperChangedPosition();
|
||||||
|
virtual void MacTopLevelWindowChangedPosition();
|
||||||
|
virtual void MacVisibilityChanged();
|
||||||
|
|
||||||
|
void MacUpdateView();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
AGLPixelFormat m_aglFormat;
|
||||||
|
|
||||||
|
bool m_macCanvasIsShown,
|
||||||
|
m_needsUpdate;
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
DECLARE_CLASS(wxGLCanvas)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_GLCANVAS_H_
|
49
include/wx/osx/carbon/helpxxxx.h
Normal file
49
include/wx/osx/carbon/helpxxxx.h
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: helpxxxx.h
|
||||||
|
// Purpose: Help system: native implementation for your system. Replace
|
||||||
|
// XXXX with suitable name.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_HELPXXXX_H_
|
||||||
|
#define _WX_HELPXXXX_H_
|
||||||
|
|
||||||
|
#include "wx/wx.h"
|
||||||
|
|
||||||
|
#include "wx/helpbase.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxXXXXHelpController: public wxHelpControllerBase
|
||||||
|
{
|
||||||
|
DECLARE_CLASS(wxXXXXHelpController)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxXXXXHelpController();
|
||||||
|
virtual ~wxXXXXHelpController();
|
||||||
|
|
||||||
|
// Must call this to set the filename and server name
|
||||||
|
virtual bool Initialize(const wxString& file);
|
||||||
|
|
||||||
|
// If file is "", reloads file given in Initialize
|
||||||
|
virtual bool LoadFile(const wxString& file = "");
|
||||||
|
virtual bool DisplayContents();
|
||||||
|
virtual bool DisplaySection(int sectionNo);
|
||||||
|
virtual bool DisplayBlock(long blockNo);
|
||||||
|
virtual bool KeywordSearch(const wxString& k,
|
||||||
|
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
|
||||||
|
|
||||||
|
virtual bool Quit();
|
||||||
|
virtual void OnQuit();
|
||||||
|
|
||||||
|
inline wxString GetHelpFile() const { return m_helpFile; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxString m_helpFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_HELPXXXX_H_
|
99
include/wx/osx/carbon/icon.h
Normal file
99
include/wx/osx/carbon/icon.h
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: icon.h
|
||||||
|
// Purpose: wxIcon class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_ICON_H_
|
||||||
|
#define _WX_ICON_H_
|
||||||
|
|
||||||
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
|
// Icon
|
||||||
|
class WXDLLIMPEXP_CORE wxIcon : public wxGDIObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxIcon();
|
||||||
|
|
||||||
|
wxIcon(const char* const* data);
|
||||||
|
wxIcon(const char bits[], int width , int height );
|
||||||
|
wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE,
|
||||||
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
wxIcon(const wxIconLocation& loc)
|
||||||
|
{
|
||||||
|
LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ICON);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxIcon(WXHICON icon, const wxSize& size);
|
||||||
|
|
||||||
|
virtual ~wxIcon();
|
||||||
|
|
||||||
|
bool LoadFile(const wxString& name, wxBitmapType flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ ,
|
||||||
|
int desiredWidth /* = -1 */ , int desiredHeight = -1);
|
||||||
|
bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
|
||||||
|
{ return LoadFile( name , flags , -1 , -1 ) ; }
|
||||||
|
|
||||||
|
|
||||||
|
// create from bitmap (which should have a mask unless it's monochrome):
|
||||||
|
// there shouldn't be any implicit bitmap -> icon conversion (i.e. no
|
||||||
|
// ctors, assignment operators...), but it's ok to have such function
|
||||||
|
void CopyFromBitmap(const wxBitmap& bmp);
|
||||||
|
|
||||||
|
int GetWidth() const;
|
||||||
|
int GetHeight() const;
|
||||||
|
int GetDepth() const;
|
||||||
|
void SetWidth(int w);
|
||||||
|
void SetHeight(int h);
|
||||||
|
void SetDepth(int d);
|
||||||
|
void SetOk(bool isOk);
|
||||||
|
|
||||||
|
WXHICON GetHICON() const ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxIcon)
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
class WXDLLIMPEXP_CORE wxICONFileHandler: public wxBitmapHandler
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxICONFileHandler)
|
||||||
|
public:
|
||||||
|
inline wxICONFileHandler()
|
||||||
|
{
|
||||||
|
m_name = "ICO icon file";
|
||||||
|
m_extension = "ico";
|
||||||
|
m_type = wxBITMAP_TYPE_ICO;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||||
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxICONResourceHandler: public wxBitmapHandler
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxICONResourceHandler)
|
||||||
|
public:
|
||||||
|
inline wxICONResourceHandler()
|
||||||
|
{
|
||||||
|
SetName(wxT("ICON resource"));
|
||||||
|
SetExtension(wxEmptyString);
|
||||||
|
SetType(wxBITMAP_TYPE_ICON_RESOURCE);
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||||
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_ICON_H_
|
60
include/wx/osx/carbon/imaglist.h
Normal file
60
include/wx/osx/carbon/imaglist.h
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: imaglist.h
|
||||||
|
// Purpose:
|
||||||
|
// Author: Robert Roebling, Stefan Csomor
|
||||||
|
// Created: 01/02/97
|
||||||
|
// Id:
|
||||||
|
// Copyright: (c) 1998 Robert Roebling and Julian Smart
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_IMAGLIST_H_
|
||||||
|
#define _WX_IMAGLIST_H_
|
||||||
|
|
||||||
|
#include "wx/defs.h"
|
||||||
|
#include "wx/list.h"
|
||||||
|
#include "wx/icon.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxDC;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxColour;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxImageList: public wxObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxImageList() { m_width = m_height = 0; }
|
||||||
|
wxImageList( int width, int height, bool mask = true, int initialCount = 1 );
|
||||||
|
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 );
|
||||||
|
int Add( const wxBitmap& bitmap, const wxColour& maskColour );
|
||||||
|
wxBitmap GetBitmap(int index) const;
|
||||||
|
wxIcon GetIcon(int index) const;
|
||||||
|
bool Replace( int index, const wxIcon &bitmap );
|
||||||
|
bool Replace( int index, const wxBitmap &bitmap );
|
||||||
|
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)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_IMAGLIST_H_
|
||||||
|
|
91
include/wx/osx/carbon/joystick.h
Normal file
91
include/wx/osx/carbon/joystick.h
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: joystick.h
|
||||||
|
// Purpose: wxJoystick class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_JOYSTICK_H_
|
||||||
|
#define _WX_JOYSTICK_H_
|
||||||
|
|
||||||
|
#include "wx/event.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxJoystick: public wxObject
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxJoystick)
|
||||||
|
public:
|
||||||
|
/*
|
||||||
|
* Public interface
|
||||||
|
*/
|
||||||
|
|
||||||
|
wxJoystick(int joystick = wxJOYSTICK1) { m_joystick = joystick; };
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
wxPoint GetPosition() const;
|
||||||
|
int GetPosition(unsigned axis) const;
|
||||||
|
bool GetButtonState(unsigned button) const;
|
||||||
|
int GetZPosition() const;
|
||||||
|
int GetButtonState() const;
|
||||||
|
int GetPOVPosition() const;
|
||||||
|
int GetPOVCTSPosition() const;
|
||||||
|
int GetRudderPosition() const;
|
||||||
|
int GetUPosition() const;
|
||||||
|
int GetVPosition() const;
|
||||||
|
int GetMovementThreshold() const;
|
||||||
|
void SetMovementThreshold(int threshold) ;
|
||||||
|
|
||||||
|
// Capabilities
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool IsOk() const; // Checks that the joystick is functioning
|
||||||
|
static int GetNumberJoysticks() ;
|
||||||
|
int GetManufacturerId() const ;
|
||||||
|
int GetProductId() const ;
|
||||||
|
wxString GetProductName() const ;
|
||||||
|
int GetXMin() const;
|
||||||
|
int GetYMin() const;
|
||||||
|
int GetZMin() const;
|
||||||
|
int GetXMax() const;
|
||||||
|
int GetYMax() const;
|
||||||
|
int GetZMax() const;
|
||||||
|
int GetNumberButtons() const;
|
||||||
|
int GetNumberAxes() const;
|
||||||
|
int GetMaxButtons() const;
|
||||||
|
int GetMaxAxes() const;
|
||||||
|
int GetPollingMin() const;
|
||||||
|
int GetPollingMax() const;
|
||||||
|
int GetRudderMin() const;
|
||||||
|
int GetRudderMax() const;
|
||||||
|
int GetUMin() const;
|
||||||
|
int GetUMax() const;
|
||||||
|
int GetVMin() const;
|
||||||
|
int GetVMax() const;
|
||||||
|
|
||||||
|
bool HasRudder() const;
|
||||||
|
bool HasZ() const;
|
||||||
|
bool HasU() const;
|
||||||
|
bool HasV() const;
|
||||||
|
bool HasPOV() const;
|
||||||
|
bool HasPOV4Dir() const;
|
||||||
|
bool HasPOVCTS() const;
|
||||||
|
|
||||||
|
// Operations
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// pollingFreq = 0 means that movement events are sent when above the threshold.
|
||||||
|
// If pollingFreq > 0, events are received every this many milliseconds.
|
||||||
|
bool SetCapture(wxWindow* win, int pollingFreq = 0);
|
||||||
|
bool ReleaseCapture();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int m_joystick;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_JOYSTICK_H_
|
147
include/wx/osx/carbon/listbox.h
Normal file
147
include/wx/osx/carbon/listbox.h
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/listbox.h
|
||||||
|
// Purpose: wxListBox class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_LISTBOX_H_
|
||||||
|
#define _WX_LISTBOX_H_
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// simple types
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
#include "wx/dynarray.h"
|
||||||
|
#include "wx/arrstr.h"
|
||||||
|
|
||||||
|
// forward decl for GetSelections()
|
||||||
|
class wxArrayInt;
|
||||||
|
|
||||||
|
// forward decl for wxMacListControl data type.
|
||||||
|
class wxMacListControl;
|
||||||
|
|
||||||
|
// List box item
|
||||||
|
|
||||||
|
WX_DEFINE_ARRAY( char* , wxListDataArray );
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// List box control
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctors and such
|
||||||
|
wxListBox();
|
||||||
|
|
||||||
|
wxListBox(
|
||||||
|
wxWindow *parent,
|
||||||
|
wxWindowID winid,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0, const wxString choices[] = NULL,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxListBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, winid, pos, size, n, choices, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxListBox(
|
||||||
|
wxWindow *parent,
|
||||||
|
wxWindowID winid,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
const wxArrayString& choices,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxListBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, winid, pos, size, choices, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(
|
||||||
|
wxWindow *parent,
|
||||||
|
wxWindowID winid,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0,
|
||||||
|
const wxString choices[] = NULL,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxListBoxNameStr);
|
||||||
|
|
||||||
|
bool Create(
|
||||||
|
wxWindow *parent,
|
||||||
|
wxWindowID winid,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
const wxArrayString& choices,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxListBoxNameStr);
|
||||||
|
|
||||||
|
virtual ~wxListBox();
|
||||||
|
|
||||||
|
// implement base class pure virtuals
|
||||||
|
virtual void Refresh(bool eraseBack = true, const wxRect *rect = NULL);
|
||||||
|
|
||||||
|
virtual unsigned int GetCount() const;
|
||||||
|
virtual wxString GetString(unsigned int n) const;
|
||||||
|
virtual void SetString(unsigned int n, const wxString& s);
|
||||||
|
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||||
|
|
||||||
|
virtual bool IsSelected(int n) const;
|
||||||
|
virtual int GetSelection() const;
|
||||||
|
virtual int GetSelections(wxArrayInt& aSelections) const;
|
||||||
|
|
||||||
|
virtual void EnsureVisible(int n);
|
||||||
|
|
||||||
|
virtual wxVisualAttributes GetDefaultAttributes() const
|
||||||
|
{
|
||||||
|
return GetClassDefaultAttributes(GetWindowVariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
// wxCheckListBox support
|
||||||
|
static wxVisualAttributes
|
||||||
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||||
|
|
||||||
|
wxMacListControl* GetPeer() const;
|
||||||
|
|
||||||
|
bool MacGetBlockEvents() const { return m_blockEvents; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DoClear();
|
||||||
|
virtual void DoDeleteOneItem(unsigned int n);
|
||||||
|
|
||||||
|
// from wxItemContainer
|
||||||
|
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
|
||||||
|
unsigned int pos,
|
||||||
|
void **clientData, wxClientDataType type);
|
||||||
|
|
||||||
|
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||||
|
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||||
|
|
||||||
|
// from wxListBoxBase
|
||||||
|
virtual void DoSetSelection(int n, bool select);
|
||||||
|
virtual void DoSetFirstItem(int n);
|
||||||
|
virtual int DoListHitTest(const wxPoint& point) const;
|
||||||
|
|
||||||
|
// free memory (common part of Clear() and dtor)
|
||||||
|
// prevent collision with some BSD definitions of macro Free()
|
||||||
|
void FreeData();
|
||||||
|
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
bool m_blockEvents;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxListBox)
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_LISTBOX_H_
|
423
include/wx/osx/carbon/listctrl.h
Normal file
423
include/wx/osx/carbon/listctrl.h
Normal file
@@ -0,0 +1,423 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: listctrl.h
|
||||||
|
// Purpose: wxListCtrl class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_LISTCTRL_H_
|
||||||
|
#define _WX_LISTCTRL_H_
|
||||||
|
|
||||||
|
#include "wx/defs.h"
|
||||||
|
#include "wx/generic/listctrl.h"
|
||||||
|
|
||||||
|
#define wxMAC_ALWAYS_USE_GENERIC_LISTCTRL wxT("mac.listctrl.always_use_generic")
|
||||||
|
|
||||||
|
class wxMacDataBrowserListCtrlControl;
|
||||||
|
class wxMacListControl;
|
||||||
|
class wxListCtrlTextCtrlWrapper;
|
||||||
|
class wxListCtrlRenameTimer;
|
||||||
|
|
||||||
|
WX_DECLARE_EXPORTED_LIST(wxListItem, wxColumnList);
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxListCtrl: public wxControl
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxListCtrl)
|
||||||
|
public:
|
||||||
|
/*
|
||||||
|
* Public interface
|
||||||
|
*/
|
||||||
|
|
||||||
|
wxListCtrl() { Init(); }
|
||||||
|
|
||||||
|
wxListCtrl(wxWindow *parent,
|
||||||
|
wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxLC_ICON,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxListCtrlNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
|
||||||
|
Create(parent, id, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~wxListCtrl();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxLC_ICON,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxListCtrlNameStr);
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Gets information about this column
|
||||||
|
bool GetColumn(int col, wxListItem& item) const;
|
||||||
|
|
||||||
|
// Sets information about this column
|
||||||
|
// TODO: NOT const to be compatible with wxGenericListCtrl API
|
||||||
|
bool SetColumn(int col, wxListItem& item) ;
|
||||||
|
|
||||||
|
// Gets the column width
|
||||||
|
int GetColumnWidth(int col) const;
|
||||||
|
|
||||||
|
// Sets the column width
|
||||||
|
bool SetColumnWidth(int col, int width) ;
|
||||||
|
|
||||||
|
// Gets the number of items that can fit vertically in the
|
||||||
|
// visible area of the list control (list or report view)
|
||||||
|
// or the total number of items in the list control (icon
|
||||||
|
// or small icon view)
|
||||||
|
int GetCountPerPage() const;
|
||||||
|
|
||||||
|
// Gets the edit control for editing labels.
|
||||||
|
wxTextCtrl* GetEditControl() const;
|
||||||
|
|
||||||
|
// Gets information about the item
|
||||||
|
bool GetItem(wxListItem& info) const ;
|
||||||
|
|
||||||
|
// Sets information about the item
|
||||||
|
bool SetItem(wxListItem& info) ;
|
||||||
|
|
||||||
|
// Sets a string field at a particular column
|
||||||
|
long SetItem(long index, int col, const wxString& label, int imageId = -1);
|
||||||
|
|
||||||
|
// Gets the item state
|
||||||
|
int GetItemState(long item, long stateMask) const ;
|
||||||
|
|
||||||
|
// Sets the item state
|
||||||
|
bool SetItemState(long item, long state, long stateMask) ;
|
||||||
|
|
||||||
|
void AssignImageList(wxImageList *imageList, int which);
|
||||||
|
|
||||||
|
// Sets the item image
|
||||||
|
bool SetItemImage(long item, int image, int selImage = -1) ;
|
||||||
|
bool SetItemColumnImage(long item, long column, int image);
|
||||||
|
|
||||||
|
// Gets the item text
|
||||||
|
wxString GetItemText(long item) const ;
|
||||||
|
|
||||||
|
// Sets the item text
|
||||||
|
void SetItemText(long item, const wxString& str) ;
|
||||||
|
|
||||||
|
void SetItemTextColour(long item, const wxColour& colour) ;
|
||||||
|
wxColour GetItemTextColour(long item) const;
|
||||||
|
|
||||||
|
void SetItemBackgroundColour(long item, const wxColour& colour) ;
|
||||||
|
wxColour GetItemBackgroundColour(long item) const;
|
||||||
|
|
||||||
|
void SetItemFont( long item, const wxFont &f);
|
||||||
|
wxFont GetItemFont( long item ) const;
|
||||||
|
|
||||||
|
// Gets the item data
|
||||||
|
long GetItemData(long item) const ;
|
||||||
|
|
||||||
|
// Sets the item data
|
||||||
|
bool SetItemPtrData(long item, wxUIntPtr data);
|
||||||
|
bool SetItemData(long item, long data) { return SetItemPtrData(item, data); }
|
||||||
|
|
||||||
|
// Gets the item rectangle
|
||||||
|
bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
|
||||||
|
|
||||||
|
// Gets the item position
|
||||||
|
bool GetItemPosition(long item, wxPoint& pos) const ;
|
||||||
|
|
||||||
|
// Sets the item position
|
||||||
|
bool SetItemPosition(long item, const wxPoint& pos) ;
|
||||||
|
|
||||||
|
// Gets the number of items in the list control
|
||||||
|
int GetItemCount() const;
|
||||||
|
|
||||||
|
// Gets the number of columns in the list control
|
||||||
|
int GetColumnCount() const;
|
||||||
|
|
||||||
|
void SetItemSpacing( int spacing, bool isSmall = false );
|
||||||
|
wxSize GetItemSpacing() const;
|
||||||
|
|
||||||
|
// Gets the number of selected items in the list control
|
||||||
|
int GetSelectedItemCount() const;
|
||||||
|
|
||||||
|
wxRect GetViewRect() const;
|
||||||
|
|
||||||
|
// Gets the text colour of the listview
|
||||||
|
wxColour GetTextColour() const;
|
||||||
|
|
||||||
|
// Sets the text colour of the listview
|
||||||
|
void SetTextColour(const wxColour& col);
|
||||||
|
|
||||||
|
// Gets the index of the topmost visible item when in
|
||||||
|
// list or report view
|
||||||
|
long GetTopItem() const ;
|
||||||
|
|
||||||
|
// are we in report mode?
|
||||||
|
bool InReportView() const { return HasFlag(wxLC_REPORT); }
|
||||||
|
|
||||||
|
bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); }
|
||||||
|
|
||||||
|
// Add or remove a single window style
|
||||||
|
void SetSingleStyle(long style, bool add = true) ;
|
||||||
|
|
||||||
|
// Set the whole window style
|
||||||
|
void SetWindowStyleFlag(long style) ;
|
||||||
|
|
||||||
|
// Searches for an item, starting from 'item'.
|
||||||
|
// item can be -1 to find the first item that matches the
|
||||||
|
// specified flags.
|
||||||
|
// Returns the item or -1 if unsuccessful.
|
||||||
|
long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ;
|
||||||
|
|
||||||
|
// Implementation: converts wxWidgets style to MSW style.
|
||||||
|
// Can be a single style flag or a bit list.
|
||||||
|
// oldStyle is 'normalised' so that it doesn't contain
|
||||||
|
// conflicting styles.
|
||||||
|
long ConvertToMSWStyle(long& oldStyle, long style) const;
|
||||||
|
|
||||||
|
// Gets one of the three image lists
|
||||||
|
wxImageList *GetImageList(int which) const ;
|
||||||
|
|
||||||
|
// Sets the image list
|
||||||
|
// N.B. There's a quirk in the Win95 list view implementation.
|
||||||
|
// If in wxLC_LIST mode, it'll *still* display images by the labels if
|
||||||
|
// there's a small-icon image list set for the control - even though you
|
||||||
|
// haven't specified wxLIST_MASK_IMAGE when inserting.
|
||||||
|
// So you have to set a NULL small-icon image list to be sure that
|
||||||
|
// the wxLC_LIST mode works without icons. Of course, you may want icons...
|
||||||
|
void SetImageList(wxImageList *imageList, int which) ;
|
||||||
|
|
||||||
|
// Operations
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Arranges the items
|
||||||
|
bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
|
||||||
|
|
||||||
|
// Deletes an item
|
||||||
|
bool DeleteItem(long item);
|
||||||
|
|
||||||
|
// Deletes all items
|
||||||
|
bool DeleteAllItems() ;
|
||||||
|
|
||||||
|
// Deletes a column
|
||||||
|
bool DeleteColumn(int col);
|
||||||
|
|
||||||
|
// Deletes all columns
|
||||||
|
bool DeleteAllColumns();
|
||||||
|
|
||||||
|
// Clears items, and columns if there are any.
|
||||||
|
void ClearAll();
|
||||||
|
|
||||||
|
// Edit the label
|
||||||
|
wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl));
|
||||||
|
|
||||||
|
// End label editing, optionally cancelling the edit
|
||||||
|
bool EndEditLabel(bool cancel);
|
||||||
|
|
||||||
|
// Ensures this item is visible
|
||||||
|
bool EnsureVisible(long item) ;
|
||||||
|
|
||||||
|
// Find an item whose label matches this string, starting from the item after 'start'
|
||||||
|
// or the beginning if 'start' is -1.
|
||||||
|
long FindItem(long start, const wxString& str, bool partial = false);
|
||||||
|
|
||||||
|
// Find an item whose data matches this data, starting from the item after 'start'
|
||||||
|
// or the beginning if 'start' is -1.
|
||||||
|
long FindItem(long start, long data);
|
||||||
|
|
||||||
|
// Find an item nearest this position in the specified direction, starting from
|
||||||
|
// the item after 'start' or the beginning if 'start' is -1.
|
||||||
|
long FindItem(long start, const wxPoint& pt, int direction);
|
||||||
|
|
||||||
|
// Determines which item (if any) is at the specified point,
|
||||||
|
// giving details in 'flags' (see wxLIST_HITTEST_... flags above)
|
||||||
|
// Request the subitem number as well at the given coordinate.
|
||||||
|
long HitTest(const wxPoint& point, int& flags, long* ptrSubItem = NULL) const;
|
||||||
|
|
||||||
|
// Inserts an item, returning the index of the new item if successful,
|
||||||
|
// -1 otherwise.
|
||||||
|
// TOD: Should also have some further convenience functions
|
||||||
|
// which don't require setting a wxListItem object
|
||||||
|
long InsertItem(wxListItem& info);
|
||||||
|
|
||||||
|
// Insert a string item
|
||||||
|
long InsertItem(long index, const wxString& label);
|
||||||
|
|
||||||
|
// Insert an image item
|
||||||
|
long InsertItem(long index, int imageIndex);
|
||||||
|
|
||||||
|
// Insert an image/string item
|
||||||
|
long InsertItem(long index, const wxString& label, int imageIndex);
|
||||||
|
|
||||||
|
// For list view mode (only), inserts a column.
|
||||||
|
long InsertColumn(long col, wxListItem& info);
|
||||||
|
|
||||||
|
long InsertColumn(long col, const wxString& heading, int format = wxLIST_FORMAT_LEFT,
|
||||||
|
int width = -1);
|
||||||
|
|
||||||
|
// Scrolls the list control. If in icon, small icon or report view mode,
|
||||||
|
// x specifies the number of pixels to scroll. If in list view mode, x
|
||||||
|
// specifies the number of columns to scroll.
|
||||||
|
// If in icon, small icon or list view mode, y specifies the number of pixels
|
||||||
|
// to scroll. If in report view mode, y specifies the number of lines to scroll.
|
||||||
|
bool ScrollList(int dx, int dy);
|
||||||
|
|
||||||
|
// Sort items.
|
||||||
|
|
||||||
|
// fn is a function which takes 3 long arguments: item1, item2, data.
|
||||||
|
// item1 is the long data associated with a first item (NOT the index).
|
||||||
|
// item2 is the long data associated with a second item (NOT the index).
|
||||||
|
// data is the same value as passed to SortItems.
|
||||||
|
// The return value is a negative number if the first item should precede the second
|
||||||
|
// item, a positive number of the second item should precede the first,
|
||||||
|
// or zero if the two items are equivalent.
|
||||||
|
|
||||||
|
// data is arbitrary data to be passed to the sort function.
|
||||||
|
bool SortItems(wxListCtrlCompare fn, long data);
|
||||||
|
|
||||||
|
wxMacListControl* GetPeer() const;
|
||||||
|
|
||||||
|
// these functions are only used for virtual list view controls, i.e. the
|
||||||
|
// ones with wxLC_VIRTUAL style
|
||||||
|
|
||||||
|
void SetItemCount(long count);
|
||||||
|
void RefreshItem(long item);
|
||||||
|
void RefreshItems(long itemFrom, long itemTo);
|
||||||
|
|
||||||
|
// return the text for the given column of the given item
|
||||||
|
virtual wxString OnGetItemText(long item, long column) const;
|
||||||
|
|
||||||
|
// return the icon for the given item. In report view, OnGetItemImage will
|
||||||
|
// only be called for the first column. See OnGetItemColumnImage for
|
||||||
|
// details.
|
||||||
|
virtual int OnGetItemImage(long item) const;
|
||||||
|
|
||||||
|
// return the icon for the given item and column.
|
||||||
|
virtual int OnGetItemColumnImage(long item, long column) const;
|
||||||
|
|
||||||
|
// return the attribute for the item (may return NULL if none)
|
||||||
|
virtual wxListItemAttr *OnGetItemAttr(long item) const;
|
||||||
|
|
||||||
|
/* Why should we need this function? Leave for now.
|
||||||
|
* We might need it because item data may have changed,
|
||||||
|
* but the display needs refreshing (in string callback mode)
|
||||||
|
// Updates an item. If the list control has the wxLI_AUTO_ARRANGE style,
|
||||||
|
// the items will be rearranged.
|
||||||
|
bool Update(long item);
|
||||||
|
*/
|
||||||
|
|
||||||
|
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||||
|
|
||||||
|
wxListCtrlCompare GetCompareFunc() { return m_compareFunc; };
|
||||||
|
long GetCompareFuncData() { return m_compareFuncData; };
|
||||||
|
|
||||||
|
|
||||||
|
// public overrides needed for pimpl approach
|
||||||
|
virtual bool SetFont(const wxFont& font);
|
||||||
|
virtual bool SetForegroundColour(const wxColour& colour);
|
||||||
|
virtual bool SetBackgroundColour(const wxColour& colour);
|
||||||
|
virtual wxColour GetBackgroundColour();
|
||||||
|
|
||||||
|
// functions for editing/timer
|
||||||
|
void OnRenameTimer();
|
||||||
|
bool OnRenameAccept(long itemEdit, const wxString& value);
|
||||||
|
void OnRenameCancelled(long itemEdit);
|
||||||
|
|
||||||
|
void ChangeCurrent(long current);
|
||||||
|
void ResetCurrent() { ChangeCurrent((long)-1); }
|
||||||
|
bool HasCurrent() const { return m_current != (long)-1; }
|
||||||
|
|
||||||
|
void OnLeftDown(wxMouseEvent& event);
|
||||||
|
void OnDblClick(wxMouseEvent& event);
|
||||||
|
|
||||||
|
void FinishEditing(wxTextCtrl *text)
|
||||||
|
{
|
||||||
|
delete text;
|
||||||
|
m_textctrlWrapper = NULL;
|
||||||
|
SetFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual int GetScrollPos(int orient) const;
|
||||||
|
|
||||||
|
void OnRightDown(wxMouseEvent& event);
|
||||||
|
void OnMiddleDown(wxMouseEvent& event);
|
||||||
|
void OnChar(wxKeyEvent& event);
|
||||||
|
virtual void SetFocus();
|
||||||
|
void FireMouseEvent(wxEventType eventType, wxPoint position);
|
||||||
|
|
||||||
|
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
||||||
|
virtual wxDropTarget* GetDropTarget() const;
|
||||||
|
|
||||||
|
// with CG, we need to get the context from an kEventControlDraw event
|
||||||
|
// unfortunately, the DataBrowser callbacks don't provide the context
|
||||||
|
// and we need it, so we need to set/remove it before and after draw
|
||||||
|
// events so we can access it in the callbacks.
|
||||||
|
void MacSetDrawingContext(void* context) { m_cgContext = context; }
|
||||||
|
void* MacGetDrawingContext() { return m_cgContext; }
|
||||||
|
|
||||||
|
virtual wxVisualAttributes GetDefaultAttributes() const
|
||||||
|
{
|
||||||
|
return GetClassDefaultAttributes(GetWindowVariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
static wxVisualAttributes
|
||||||
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// protected overrides needed for pimpl approach
|
||||||
|
virtual void DoSetSize(int x, int y,
|
||||||
|
int width, int height,
|
||||||
|
int sizeFlags = wxSIZE_AUTO);
|
||||||
|
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
long m_current;
|
||||||
|
wxListCtrlTextCtrlWrapper *m_textctrlWrapper;
|
||||||
|
wxListCtrlRenameTimer *m_renameTimer;
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
wxGenericListCtrl* m_genericImpl; // allow use of the generic impl.
|
||||||
|
wxMacDataBrowserListCtrlControl* m_dbImpl;
|
||||||
|
void* m_macListCtrlEventHandler;
|
||||||
|
void* m_cgContext;
|
||||||
|
wxListCtrlCompare m_compareFunc;
|
||||||
|
long m_compareFuncData;
|
||||||
|
|
||||||
|
wxTextCtrl* m_textCtrl; // The control used for editing a label
|
||||||
|
wxImageList * m_imageListNormal; // The image list for normal icons
|
||||||
|
wxImageList * m_imageListSmall; // The image list for small icons
|
||||||
|
wxImageList * m_imageListState; // The image list state icons (not implemented yet)
|
||||||
|
|
||||||
|
wxColumnList m_colsInfo; // for storing info about each column
|
||||||
|
wxColour m_textColor;
|
||||||
|
wxColour m_bgColor;
|
||||||
|
|
||||||
|
// keep track of whether or not we should delete the image list ourselves.
|
||||||
|
bool m_ownsImageListNormal,
|
||||||
|
m_ownsImageListSmall,
|
||||||
|
m_ownsImageListState;
|
||||||
|
|
||||||
|
long m_baseStyle; // Basic Windows style flags, for recreation purposes
|
||||||
|
wxStringList m_stringPool; // Pool of 3 strings to satisfy Windows callback
|
||||||
|
// requirements
|
||||||
|
int m_colCount; // Windows doesn't have GetColumnCount so must
|
||||||
|
// keep track of inserted/deleted columns
|
||||||
|
|
||||||
|
int m_count; // for virtual lists, store item count
|
||||||
|
|
||||||
|
private:
|
||||||
|
int CalcColumnAutoWidth(int col) const;
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_LISTCTRL_H_
|
194
include/wx/osx/carbon/mdi.h
Normal file
194
include/wx/osx/carbon/mdi.h
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: mdi.h
|
||||||
|
// Purpose: MDI (Multiple Document Interface) classes.
|
||||||
|
// This doesn't have to be implemented just like Windows,
|
||||||
|
// it could be a tabbed design as in wxGTK.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MDI_H_
|
||||||
|
#define _WX_MDI_H_
|
||||||
|
|
||||||
|
#include "wx/frame.h"
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxStatusLineNameStr[];
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxFrame
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
wxMDIParentFrame() { Init(); }
|
||||||
|
wxMDIParentFrame(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, // Scrolling refers to client window
|
||||||
|
const wxString& name = wxFrameNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
Create(parent, id, title, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~wxMDIParentFrame();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||||
|
const wxString& name = wxFrameNameStr);
|
||||||
|
|
||||||
|
// Mac OS activate event
|
||||||
|
virtual void MacActivate(long timestamp, bool activating);
|
||||||
|
|
||||||
|
// wxWidgets activate event
|
||||||
|
void OnActivate(wxActivateEvent& event);
|
||||||
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||||
|
|
||||||
|
void SetMenuBar(wxMenuBar *menu_bar);
|
||||||
|
|
||||||
|
// Get the active MDI child window (Windows only)
|
||||||
|
wxMDIChildFrame *GetActiveChild() const ;
|
||||||
|
|
||||||
|
// Get the client window
|
||||||
|
inline wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; };
|
||||||
|
// Get rect to be used to center top-level children
|
||||||
|
virtual void GetRectForTopLevelChildren(int *x, int *y, int *w, int *h);
|
||||||
|
|
||||||
|
// Create the client window class (don't Create the window,
|
||||||
|
// just return a new class)
|
||||||
|
virtual wxMDIClientWindow *OnCreateClient() ;
|
||||||
|
|
||||||
|
// MDI operations
|
||||||
|
virtual void Cascade();
|
||||||
|
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL);
|
||||||
|
virtual void ArrangeIcons();
|
||||||
|
virtual void ActivateNext();
|
||||||
|
virtual void ActivatePrevious();
|
||||||
|
|
||||||
|
virtual bool Show( bool show = true );
|
||||||
|
|
||||||
|
// overridden base clas virtuals
|
||||||
|
virtual void AddChild(wxWindowBase *child);
|
||||||
|
virtual void RemoveChild(wxWindowBase *child);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
// returns true if this frame has some contents and so should be visible,
|
||||||
|
// false if it's used solely as container for its children
|
||||||
|
bool ShouldBeVisible() const;
|
||||||
|
|
||||||
|
|
||||||
|
// TODO maybe have this member
|
||||||
|
wxMDIClientWindow *m_clientWindow;
|
||||||
|
wxMDIChildFrame *m_currentChild;
|
||||||
|
wxMenu *m_windowMenu;
|
||||||
|
|
||||||
|
// true if MDI Frame is intercepting commands, not child
|
||||||
|
bool m_parentFrameActive;
|
||||||
|
|
||||||
|
// true if the frame should be shown but is not because it is empty and
|
||||||
|
// useless otherwise than a container for its children
|
||||||
|
bool m_shouldBeShown;
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMDIChildFrame: public wxFrame
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
||||||
|
public:
|
||||||
|
|
||||||
|
wxMDIChildFrame();
|
||||||
|
inline wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE,
|
||||||
|
const wxString& name = wxFrameNameStr)
|
||||||
|
{
|
||||||
|
Init() ;
|
||||||
|
Create(parent, id, title, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~wxMDIChildFrame();
|
||||||
|
|
||||||
|
bool Create(wxMDIParentFrame *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE,
|
||||||
|
const wxString& name = wxFrameNameStr);
|
||||||
|
|
||||||
|
// Mac OS activate event
|
||||||
|
virtual void MacActivate(long timestamp, bool activating);
|
||||||
|
|
||||||
|
// Set menu bar
|
||||||
|
void SetMenuBar(wxMenuBar *menu_bar);
|
||||||
|
|
||||||
|
// MDI operations
|
||||||
|
virtual void Maximize();
|
||||||
|
virtual void Maximize( bool ){ Maximize() ; } // this one is inherited from wxFrame
|
||||||
|
virtual void Restore();
|
||||||
|
virtual void Activate();
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
};
|
||||||
|
|
||||||
|
/* The client window is a child of the parent MDI frame, and itself
|
||||||
|
* contains the child MDI frames.
|
||||||
|
* However, you create the MDI children as children of the MDI parent:
|
||||||
|
* only in the implementation does the client window become the parent
|
||||||
|
* of the children. Phew! So the children are sort of 'adopted'...
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMDIClientWindow: public wxWindow
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||||
|
public:
|
||||||
|
|
||||||
|
wxMDIClientWindow() ;
|
||||||
|
inline wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0)
|
||||||
|
{
|
||||||
|
CreateClient(parent, style);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~wxMDIClientWindow();
|
||||||
|
|
||||||
|
// Note: this is virtual, to allow overridden behaviour.
|
||||||
|
virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL);
|
||||||
|
|
||||||
|
// Explicitly call default scroll behaviour
|
||||||
|
void OnScroll(wxScrollEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Gets the size available for subwindows after menu size, toolbar size
|
||||||
|
// and status bar size have been subtracted. If you want to manage your own
|
||||||
|
// toolbar(s), don't call SetToolBar.
|
||||||
|
void DoGetClientSize(int *width, int *height) const;
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_MDI_H_
|
182
include/wx/osx/carbon/menu.h
Normal file
182
include/wx/osx/carbon/menu.h
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: menu.h
|
||||||
|
// Purpose: wxMenu, wxMenuBar classes
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MENU_H_
|
||||||
|
#define _WX_MENU_H_
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxFrame;
|
||||||
|
|
||||||
|
#include "wx/arrstr.h"
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Menu
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMenu : public wxMenuBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctors & dtor
|
||||||
|
wxMenu(const wxString& title, long style = 0)
|
||||||
|
: wxMenuBase(title, style) { Init(); }
|
||||||
|
|
||||||
|
wxMenu(long style = 0) : wxMenuBase(style) { Init(); }
|
||||||
|
|
||||||
|
virtual ~wxMenu();
|
||||||
|
|
||||||
|
virtual void Attach(wxMenuBarBase *menubar) ;
|
||||||
|
|
||||||
|
virtual void Break();
|
||||||
|
|
||||||
|
virtual void SetTitle(const wxString& title);
|
||||||
|
|
||||||
|
// MSW-specific
|
||||||
|
bool ProcessCommand(wxCommandEvent& event);
|
||||||
|
|
||||||
|
// implementation only from now on
|
||||||
|
// -------------------------------
|
||||||
|
|
||||||
|
int MacGetIndexFromId( int id ) ;
|
||||||
|
int MacGetIndexFromItem( wxMenuItem *pItem ) ;
|
||||||
|
void MacEnableMenu( bool bDoEnable ) ;
|
||||||
|
// MacOS needs to know about submenus somewhere within this menu
|
||||||
|
// before it can be displayed , also hide special menu items like preferences
|
||||||
|
// that are handled by the OS
|
||||||
|
void MacBeforeDisplay( bool isSubMenu ) ;
|
||||||
|
// undo all changes from the MacBeforeDisplay call
|
||||||
|
void MacAfterDisplay( bool isSubMenu ) ;
|
||||||
|
|
||||||
|
// semi-private accessors
|
||||||
|
// get the window which contains this menu
|
||||||
|
wxWindow *GetWindow() const;
|
||||||
|
// get the menu handle
|
||||||
|
WXHMENU GetHMenu() const { return m_hMenu; }
|
||||||
|
|
||||||
|
short MacGetMenuId() { return m_macMenuId ; }
|
||||||
|
|
||||||
|
wxInt32 MacHandleCommandProcess( wxMenuItem* item, int id, wxWindow* targetWindow = NULL );
|
||||||
|
wxInt32 MacHandleCommandUpdateStatus( wxMenuItem* item, int id, wxWindow* targetWindow = NULL);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxMenuItem* DoAppend(wxMenuItem *item);
|
||||||
|
virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item);
|
||||||
|
virtual wxMenuItem* DoRemove(wxMenuItem *item);
|
||||||
|
|
||||||
|
private:
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
// common part of Append/Insert (behaves as Append is pos == (size_t)-1)
|
||||||
|
bool DoInsertOrAppend(wxMenuItem *item, size_t pos = (size_t)-1);
|
||||||
|
|
||||||
|
// terminate the current radio group, if any
|
||||||
|
void EndRadioGroup();
|
||||||
|
|
||||||
|
// if TRUE, insert a breal before appending the next item
|
||||||
|
bool m_doBreak;
|
||||||
|
|
||||||
|
// the position of the first item in the current radio group or -1
|
||||||
|
int m_startRadioGroup;
|
||||||
|
|
||||||
|
// the menu handle of this menu
|
||||||
|
WXHMENU m_hMenu;
|
||||||
|
|
||||||
|
short m_macMenuId;
|
||||||
|
|
||||||
|
static short s_macNextMenuId ;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMenu)
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Menu Bar (a la Windows)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMenuBar : public wxMenuBarBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctors & dtor
|
||||||
|
// default constructor
|
||||||
|
wxMenuBar();
|
||||||
|
// unused under MSW
|
||||||
|
wxMenuBar(long style);
|
||||||
|
// menubar takes ownership of the menus arrays but copies the titles
|
||||||
|
wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0);
|
||||||
|
virtual ~wxMenuBar();
|
||||||
|
|
||||||
|
// menubar construction
|
||||||
|
virtual bool Append( wxMenu *menu, const wxString &title );
|
||||||
|
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
|
||||||
|
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
|
||||||
|
virtual wxMenu *Remove(size_t pos);
|
||||||
|
|
||||||
|
virtual int FindMenuItem(const wxString& menuString,
|
||||||
|
const wxString& itemString) const;
|
||||||
|
virtual wxMenuItem* FindItem( int id, wxMenu **menu = NULL ) const;
|
||||||
|
|
||||||
|
virtual void EnableTop( size_t pos, bool flag );
|
||||||
|
virtual void SetMenuLabel( size_t pos, const wxString& label );
|
||||||
|
virtual wxString GetMenuLabel( size_t pos ) const;
|
||||||
|
virtual bool Enable( bool enable = TRUE );
|
||||||
|
// for virtual function hiding
|
||||||
|
virtual void Enable( int itemid, bool enable )
|
||||||
|
{
|
||||||
|
wxMenuBarBase::Enable( itemid, enable );
|
||||||
|
}
|
||||||
|
|
||||||
|
// implementation from now on
|
||||||
|
WXHMENU Create();
|
||||||
|
int FindMenu(const wxString& title);
|
||||||
|
void Detach();
|
||||||
|
|
||||||
|
// returns TRUE if we're attached to a frame
|
||||||
|
bool IsAttached() const { return m_menuBarFrame != NULL; }
|
||||||
|
// get the frame we live in
|
||||||
|
wxFrame *GetFrame() const { return m_menuBarFrame; }
|
||||||
|
// attach to a frame
|
||||||
|
void Attach(wxFrame *frame);
|
||||||
|
|
||||||
|
// clear the invoking window for all menus and submenus
|
||||||
|
void UnsetInvokingWindow() ;
|
||||||
|
|
||||||
|
// set the invoking window for all menus and submenus
|
||||||
|
void SetInvokingWindow( wxFrame* frame ) ;
|
||||||
|
|
||||||
|
// if the menubar is modified, the display is not updated automatically,
|
||||||
|
// call this function to update it (m_menuBarFrame should be !NULL)
|
||||||
|
void Refresh(bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL);
|
||||||
|
|
||||||
|
static void SetAutoWindowMenu( bool enable ) { s_macAutoWindowMenu = enable ; }
|
||||||
|
static bool GetAutoWindowMenu() { return s_macAutoWindowMenu ; }
|
||||||
|
|
||||||
|
void MacInstallMenuBar() ;
|
||||||
|
static wxMenuBar* MacGetInstalledMenuBar() { return s_macInstalledMenuBar ; }
|
||||||
|
static void MacSetCommonMenuBar(wxMenuBar* menubar) { s_macCommonMenuBar=menubar; }
|
||||||
|
static wxMenuBar* MacGetCommonMenuBar() { return s_macCommonMenuBar; }
|
||||||
|
|
||||||
|
|
||||||
|
static WXHMENU MacGetWindowMenuHMenu() { return s_macWindowMenuHandle ; }
|
||||||
|
protected:
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
wxWindow *m_invokingWindow;
|
||||||
|
|
||||||
|
wxArrayString m_titles;
|
||||||
|
static bool s_macAutoWindowMenu ;
|
||||||
|
static WXHMENU s_macWindowMenuHandle ;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static wxMenuBar* s_macInstalledMenuBar ;
|
||||||
|
static wxMenuBar* s_macCommonMenuBar ;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMenuBar)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MENU_H_
|
80
include/wx/osx/carbon/menuitem.h
Normal file
80
include/wx/osx/carbon/menuitem.h
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/menuitem.h
|
||||||
|
// Purpose: wxMenuItem class
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 11.11.97
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _MENUITEM_H
|
||||||
|
#define _MENUITEM_H
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#include "wx/defs.h"
|
||||||
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
class WXDLLIMPEXP_CORE wxMenuItem: public wxMenuItemBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctor & dtor
|
||||||
|
wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL,
|
||||||
|
int id = wxID_SEPARATOR,
|
||||||
|
const wxString& name = wxEmptyString,
|
||||||
|
const wxString& help = wxEmptyString,
|
||||||
|
wxItemKind kind = wxITEM_NORMAL,
|
||||||
|
wxMenu *subMenu = (wxMenu *)NULL);
|
||||||
|
virtual ~wxMenuItem();
|
||||||
|
|
||||||
|
// override base class virtuals
|
||||||
|
virtual void SetItemLabel(const wxString& strName);
|
||||||
|
|
||||||
|
virtual void Enable(bool bDoEnable = true);
|
||||||
|
virtual void Check(bool bDoCheck = true);
|
||||||
|
|
||||||
|
virtual void SetBitmap(const wxBitmap& bitmap) ;
|
||||||
|
virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
|
||||||
|
|
||||||
|
// update the os specific representation
|
||||||
|
void UpdateItemBitmap() ;
|
||||||
|
void UpdateItemText() ;
|
||||||
|
void UpdateItemStatus() ;
|
||||||
|
|
||||||
|
// mark item as belonging to the given radio group
|
||||||
|
void SetAsRadioGroupStart();
|
||||||
|
void SetRadioGroupStart(int start);
|
||||||
|
void SetRadioGroupEnd(int end);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void DoUpdateItemBitmap( WXHMENU menu, wxUint16 index) ;
|
||||||
|
|
||||||
|
void UncheckRadio() ;
|
||||||
|
|
||||||
|
// the positions of the first and last items of the radio group this item
|
||||||
|
// belongs to or -1: start is the radio group start and is valid for all
|
||||||
|
// but first radio group items (m_isRadioGroupStart == FALSE), end is valid
|
||||||
|
// only for the first one
|
||||||
|
union
|
||||||
|
{
|
||||||
|
int start;
|
||||||
|
int end;
|
||||||
|
} m_radioGroup;
|
||||||
|
|
||||||
|
// does this item start a radio group?
|
||||||
|
bool m_isRadioGroupStart;
|
||||||
|
|
||||||
|
wxBitmap m_bitmap; // Bitmap for menuitem, if any
|
||||||
|
void* m_menu ; // the appropriate menu , may also be a system menu
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMenuItem)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //_MENUITEM_H
|
178
include/wx/osx/carbon/metafile.h
Normal file
178
include/wx/osx/carbon/metafile.h
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: metafile.h
|
||||||
|
// Purpose: wxMetaFile, wxMetaFileDC classes.
|
||||||
|
// This probably should be restricted to Windows platforms,
|
||||||
|
// but if there is an equivalent on your platform, great.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _WX_METAFIILE_H_
|
||||||
|
#define _WX_METAFIILE_H_
|
||||||
|
|
||||||
|
#include "wx/dc.h"
|
||||||
|
#include "wx/gdiobj.h"
|
||||||
|
|
||||||
|
#if wxUSE_DATAOBJ
|
||||||
|
#include "wx/dataobj.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/mac/carbon/dcclient.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Metafile and metafile device context classes
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define wxMetaFile wxMetafile
|
||||||
|
#define wxMetaFileDC wxMetafileDC
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxMetafile;
|
||||||
|
class wxMetafileRefData ;
|
||||||
|
|
||||||
|
#define M_METAFILEDATA ((wxMetafileRefData *)m_refData)
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMetafile : public wxGDIObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxMetafile(const wxString& file = wxEmptyString);
|
||||||
|
virtual ~wxMetafile(void);
|
||||||
|
|
||||||
|
// After this is called, the metafile cannot be used for anything
|
||||||
|
// since it is now owned by the clipboard.
|
||||||
|
virtual bool SetClipboard(int width = 0, int height = 0);
|
||||||
|
|
||||||
|
virtual bool Play(wxDC *dc);
|
||||||
|
|
||||||
|
wxSize GetSize() const;
|
||||||
|
int GetWidth() const { return GetSize().x; }
|
||||||
|
int GetHeight() const { return GetSize().y; }
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
WXHMETAFILE GetHMETAFILE() const ;
|
||||||
|
void SetHMETAFILE(WXHMETAFILE mf) ;
|
||||||
|
#ifndef __LP64__
|
||||||
|
// Since the native metafile format is PDF for Quartz
|
||||||
|
// we need a call that allows setting PICT content for
|
||||||
|
// backwards compatibility
|
||||||
|
void SetPICT(void* pictHandle) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMetafile)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMetafileDCImpl: public wxGCDCImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxMetafileDCImpl( wxDC *owner,
|
||||||
|
const wxString& filename,
|
||||||
|
int width, int height,
|
||||||
|
const wxString& description );
|
||||||
|
|
||||||
|
virtual ~wxMetafileDCImpl();
|
||||||
|
|
||||||
|
// Should be called at end of drawing
|
||||||
|
virtual wxMetafile *Close();
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
wxMetafile *GetMetaFile(void) const { return m_metaFile; }
|
||||||
|
void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
|
|
||||||
|
wxMetafile* m_metaFile;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_CLASS(wxMetafileDCImpl)
|
||||||
|
DECLARE_NO_COPY_CLASS(wxMetafileDCImpl)
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMetafileDC: public wxDC
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// the ctor parameters specify the filename (empty for memory metafiles),
|
||||||
|
// the metafile picture size and the optional description/comment
|
||||||
|
wxMetafileDC( const wxString& filename = wxEmptyString,
|
||||||
|
int width = 0, int height = 0,
|
||||||
|
const wxString& description = wxEmptyString ) :
|
||||||
|
wxDC( new wxMetafileDCImpl( this, filename, width, height, description) )
|
||||||
|
{ }
|
||||||
|
|
||||||
|
wxMetafile *GetMetafile() const
|
||||||
|
{ return ((wxMetafileDCImpl*)m_pimpl)->GetMetaFile(); }
|
||||||
|
|
||||||
|
wxMetafile *Close()
|
||||||
|
{ return ((wxMetafileDCImpl*)m_pimpl)->Close(); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_CLASS(wxMetafileDC)
|
||||||
|
DECLARE_NO_COPY_CLASS(wxMetafileDC)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Pass filename of existing non-placeable metafile, and bounding box.
|
||||||
|
* Adds a placeable metafile header, sets the mapping mode to anisotropic,
|
||||||
|
* and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// No origin or extent
|
||||||
|
#define wxMakeMetaFilePlaceable wxMakeMetafilePlaceable
|
||||||
|
bool WXDLLIMPEXP_CORE wxMakeMetafilePlaceable(const wxString& filename, float scale = 1.0);
|
||||||
|
|
||||||
|
// Optional origin and extent
|
||||||
|
bool WXDLLIMPEXP_CORE wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE);
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxMetafileDataObject is a specialization of wxDataObject for metafile data
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if wxUSE_DATAOBJ
|
||||||
|
class WXDLLIMPEXP_CORE wxMetafileDataObject : public wxDataObjectSimple
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctors
|
||||||
|
wxMetafileDataObject()
|
||||||
|
: wxDataObjectSimple(wxDF_METAFILE) { };
|
||||||
|
wxMetafileDataObject(const wxMetafile& metafile)
|
||||||
|
: wxDataObjectSimple(wxDF_METAFILE), m_metafile(metafile) { }
|
||||||
|
|
||||||
|
// virtual functions which you may override if you want to provide data on
|
||||||
|
// demand only - otherwise, the trivial default versions will be used
|
||||||
|
virtual void SetMetafile(const wxMetafile& metafile)
|
||||||
|
{ m_metafile = metafile; }
|
||||||
|
virtual wxMetafile GetMetafile() const
|
||||||
|
{ return m_metafile; }
|
||||||
|
|
||||||
|
// implement base class pure virtuals
|
||||||
|
virtual size_t GetDataSize() const;
|
||||||
|
virtual bool GetDataHere(void *buf) const;
|
||||||
|
virtual bool SetData(size_t len, const void *buf);
|
||||||
|
|
||||||
|
virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const
|
||||||
|
{ return GetDataSize(); }
|
||||||
|
virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format),
|
||||||
|
void *buf) const
|
||||||
|
{ return GetDataHere(buf); }
|
||||||
|
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
|
||||||
|
size_t len, const void *buf)
|
||||||
|
{ return SetData(len, buf); }
|
||||||
|
protected:
|
||||||
|
wxMetafile m_metafile;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_METAFIILE_H_
|
122
include/wx/osx/carbon/mimetype.h
Normal file
122
include/wx/osx/carbon/mimetype.h
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/mimetype.h
|
||||||
|
// Purpose: Mac Carbon implementation for wx mime-related classes
|
||||||
|
// Author: Ryan Norton
|
||||||
|
// Modified by:
|
||||||
|
// Created: 04/16/2005
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2005 Ryan Norton (<wxprojects@comcast.net>)
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _MIMETYPE_IMPL_H
|
||||||
|
#define _MIMETYPE_IMPL_H
|
||||||
|
|
||||||
|
#include "wx/defs.h"
|
||||||
|
#include "wx/mimetype.h"
|
||||||
|
|
||||||
|
|
||||||
|
class wxMimeTypesManagerImpl
|
||||||
|
{
|
||||||
|
public :
|
||||||
|
//kinda kooky but in wxMimeTypesManager::EnsureImpl it doesn't call
|
||||||
|
//intialize, so we do it ourselves
|
||||||
|
wxMimeTypesManagerImpl() : m_hIC(NULL) { Initialize(); }
|
||||||
|
~wxMimeTypesManagerImpl() { ClearData(); }
|
||||||
|
|
||||||
|
// load all data into memory - done when it is needed for the first time
|
||||||
|
void Initialize(int mailcapStyles = wxMAILCAP_STANDARD,
|
||||||
|
const wxString& extraDir = wxEmptyString);
|
||||||
|
|
||||||
|
// and delete the data here
|
||||||
|
void ClearData();
|
||||||
|
|
||||||
|
// implement containing class functions
|
||||||
|
wxFileType *GetFileTypeFromExtension(const wxString& ext);
|
||||||
|
wxFileType *GetOrAllocateFileTypeFromExtension(const wxString& ext) ;
|
||||||
|
wxFileType *GetFileTypeFromMimeType(const wxString& mimeType);
|
||||||
|
|
||||||
|
size_t EnumAllFileTypes(wxArrayString& mimetypes);
|
||||||
|
|
||||||
|
// this are NOPs under MacOS
|
||||||
|
bool ReadMailcap(const wxString& WXUNUSED(filename), bool WXUNUSED(fallback) = TRUE) { return TRUE; }
|
||||||
|
bool ReadMimeTypes(const wxString& WXUNUSED(filename)) { return TRUE; }
|
||||||
|
|
||||||
|
void AddFallback(const wxFileTypeInfo& ft) { m_fallbacks.Add(ft); }
|
||||||
|
|
||||||
|
// create a new filetype association
|
||||||
|
wxFileType *Associate(const wxFileTypeInfo& ftInfo);
|
||||||
|
// remove association
|
||||||
|
bool Unassociate(wxFileType *ft);
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxArrayFileTypeInfo m_fallbacks;
|
||||||
|
void* m_hIC;
|
||||||
|
void** m_hDatabase;
|
||||||
|
long m_lCount;
|
||||||
|
|
||||||
|
void* pReserved1;
|
||||||
|
void* pReserved2;
|
||||||
|
void* pReserved3;
|
||||||
|
void* pReserved4;
|
||||||
|
void* pReserved5;
|
||||||
|
void* pReserved6;
|
||||||
|
|
||||||
|
friend class wxFileTypeImpl;
|
||||||
|
};
|
||||||
|
|
||||||
|
class wxFileTypeImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//kind of nutty, but mimecmn.cpp creates one with an empty new
|
||||||
|
wxFileTypeImpl() : m_manager(NULL) {}
|
||||||
|
~wxFileTypeImpl() {} //for those broken compilers
|
||||||
|
|
||||||
|
// implement accessor functions
|
||||||
|
bool GetExtensions(wxArrayString& extensions);
|
||||||
|
bool GetMimeType(wxString *mimeType) const;
|
||||||
|
bool GetMimeTypes(wxArrayString& mimeTypes) const;
|
||||||
|
bool GetIcon(wxIconLocation *iconLoc) const;
|
||||||
|
bool GetDescription(wxString *desc) const;
|
||||||
|
bool GetOpenCommand(wxString *openCmd,
|
||||||
|
const wxFileType::MessageParameters&) const;
|
||||||
|
bool GetPrintCommand(wxString *printCmd,
|
||||||
|
const wxFileType::MessageParameters&) const;
|
||||||
|
|
||||||
|
size_t GetAllCommands(wxArrayString * verbs, wxArrayString * commands,
|
||||||
|
const wxFileType::MessageParameters& params) const;
|
||||||
|
|
||||||
|
// remove the record for this file type
|
||||||
|
// probably a mistake to come here, use wxMimeTypesManager.Unassociate (ft) instead
|
||||||
|
bool Unassociate(wxFileType *ft)
|
||||||
|
{
|
||||||
|
return m_manager->Unassociate(ft);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set an arbitrary command, ask confirmation if it already exists and
|
||||||
|
// overwriteprompt is TRUE
|
||||||
|
bool SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt = TRUE);
|
||||||
|
bool SetDefaultIcon(const wxString& strIcon = wxEmptyString, int index = 0);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init(wxMimeTypesManagerImpl *manager, long lIndex)
|
||||||
|
{ m_manager=(manager); m_lIndex=(lIndex); }
|
||||||
|
|
||||||
|
// helper function
|
||||||
|
wxString GetCommand(const wxString& verb) const;
|
||||||
|
|
||||||
|
wxMimeTypesManagerImpl *m_manager;
|
||||||
|
long m_lIndex;
|
||||||
|
|
||||||
|
void* pReserved1;
|
||||||
|
void* pReserved2;
|
||||||
|
void* pReserved3;
|
||||||
|
void* pReserved4;
|
||||||
|
void* pReserved5;
|
||||||
|
void* pReserved6;
|
||||||
|
|
||||||
|
friend class wxMimeTypesManagerImpl;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
//_MIMETYPE_H
|
42
include/wx/osx/carbon/minifram.h
Normal file
42
include/wx/osx/carbon/minifram.h
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: minifram.h
|
||||||
|
// Purpose: wxMiniFrame class. A small frame for e.g. floating toolbars.
|
||||||
|
// If there is no equivalent on your platform, just make it a
|
||||||
|
// normal frame.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MINIFRAM_H_
|
||||||
|
#define _WX_MINIFRAM_H_
|
||||||
|
|
||||||
|
#include "wx/frame.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMiniFrame: public wxFrame {
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMiniFrame)
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline wxMiniFrame() {}
|
||||||
|
inline wxMiniFrame(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxCAPTION | wxRESIZE_BORDER | wxTINY_CAPTION_HORIZ,
|
||||||
|
const wxString& name = wxFrameNameStr)
|
||||||
|
{
|
||||||
|
// Use wxFrame constructor in absence of more specific code.
|
||||||
|
Create(parent, id, title, pos, size, style | wxFRAME_TOOL_WINDOW | wxFRAME_FLOAT_ON_PARENT , name);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~wxMiniFrame() {}
|
||||||
|
protected:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_MINIFRAM_H_
|
48
include/wx/osx/carbon/msgdlg.h
Normal file
48
include/wx/osx/carbon/msgdlg.h
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/msgdlg.h
|
||||||
|
// Purpose: wxMessageDialog class. Use generic version if no
|
||||||
|
// platform-specific implementation.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MSGBOXDLG_H_
|
||||||
|
#define _WX_MSGBOXDLG_H_
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMessageDialog : public wxMessageDialogBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxMessageDialog(wxWindow *parent,
|
||||||
|
const wxString& message,
|
||||||
|
const wxString& caption = wxMessageBoxCaptionStr,
|
||||||
|
long style = wxOK|wxCENTRE,
|
||||||
|
const wxPoint& pos = wxDefaultPosition);
|
||||||
|
|
||||||
|
virtual int ShowModal();
|
||||||
|
|
||||||
|
// customization of the message box
|
||||||
|
virtual bool SetYesNoLabels(const wxString& yes,const wxString& no);
|
||||||
|
virtual bool SetYesNoCancelLabels(const wxString& yes, const wxString& no, const wxString& cancel);
|
||||||
|
virtual bool SetOKLabel(const wxString& ok);
|
||||||
|
virtual bool SetOKCancelLabels(const wxString& ok, const wxString& cancel);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// not supported for message dialog
|
||||||
|
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
|
||||||
|
int WXUNUSED(width), int WXUNUSED(height),
|
||||||
|
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
|
||||||
|
|
||||||
|
// labels for the buttons
|
||||||
|
wxString m_yes,
|
||||||
|
m_no,
|
||||||
|
m_ok,
|
||||||
|
m_cancel;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMessageDialog)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MSGBOXDLG_H_
|
147
include/wx/osx/carbon/nonownedwnd.h
Normal file
147
include/wx/osx/carbon/nonownedwnd.h
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/nonownedwnd.h
|
||||||
|
// Purpose: declares wxNonOwnedWindow class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 2008-03-24
|
||||||
|
// RCS-ID: $Id: nonownedwnd.h 46993 2007-06-28 08:46:04Z VS $
|
||||||
|
// Copyright: (c) 2008 Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_NONOWNEDWND_H_
|
||||||
|
#define _WX_MAC_NONOWNEDWND_H_
|
||||||
|
|
||||||
|
#include "wx/window.h"
|
||||||
|
|
||||||
|
#if wxUSE_SYSTEM_OPTIONS
|
||||||
|
#define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxNonOwnedWindow
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// This class represents "non-owned" window. A window is owned by another
|
||||||
|
// window if it has a parent and is positioned within the parent. For example,
|
||||||
|
// wxFrame is non-owned, because even though it can have a parent, it's
|
||||||
|
// location is independent of it. This class is for internal use only, it's
|
||||||
|
// the base class for wxTopLevelWindow and wxPopupWindow.
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxWindow
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// constructors and such
|
||||||
|
wxNonOwnedWindow() { Init(); }
|
||||||
|
|
||||||
|
wxNonOwnedWindow(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxPanelNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
|
||||||
|
(void)Create(parent, id, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxPanelNameStr);
|
||||||
|
|
||||||
|
virtual ~wxNonOwnedWindow();
|
||||||
|
|
||||||
|
virtual wxPoint GetClientAreaOrigin() const;
|
||||||
|
|
||||||
|
// implement base class pure virtuals
|
||||||
|
|
||||||
|
virtual bool SetShape(const wxRegion& region);
|
||||||
|
|
||||||
|
virtual bool SetTransparent(wxByte alpha);
|
||||||
|
virtual bool CanSetTransparent();
|
||||||
|
|
||||||
|
virtual bool SetBackgroundStyle(wxBackgroundStyle style);
|
||||||
|
|
||||||
|
// implementation from now on
|
||||||
|
// --------------------------
|
||||||
|
|
||||||
|
static void MacDelayedDeactivation(long timestamp);
|
||||||
|
virtual void MacCreateRealWindow( const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name ) ;
|
||||||
|
|
||||||
|
WXWindow MacGetWindowRef() { return m_macWindow ; }
|
||||||
|
virtual void MacActivate( long timestamp , bool inIsActivating ) ;
|
||||||
|
virtual void MacPerformUpdates() ;
|
||||||
|
|
||||||
|
virtual void Raise();
|
||||||
|
virtual void Lower();
|
||||||
|
virtual bool Show( bool show = true );
|
||||||
|
|
||||||
|
virtual bool ShowWithEffect(wxShowEffect effect,
|
||||||
|
unsigned timeout = 0)
|
||||||
|
{ return MacShowWithEffect(true, effect, timeout); }
|
||||||
|
|
||||||
|
virtual bool HideWithEffect(wxShowEffect effect,
|
||||||
|
unsigned timeout = 0)
|
||||||
|
{ return MacShowWithEffect(false, effect, timeout); }
|
||||||
|
|
||||||
|
virtual void SetExtraStyle(long exStyle) ;
|
||||||
|
|
||||||
|
virtual bool SetBackgroundColour( const wxColour &colour );
|
||||||
|
|
||||||
|
virtual void MacInstallTopLevelWindowEventHandler() ;
|
||||||
|
|
||||||
|
bool MacGetMetalAppearance() const ;
|
||||||
|
bool MacGetUnifiedAppearance() const ;
|
||||||
|
|
||||||
|
void MacChangeWindowAttributes( wxUint32 attributesToSet , wxUint32 attributesToClear ) ;
|
||||||
|
wxUint32 MacGetWindowAttributes() const ;
|
||||||
|
|
||||||
|
WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; }
|
||||||
|
|
||||||
|
virtual void MacGetContentAreaInset( int &left , int &top , int &right , int &bottom ) ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
bool MacShowWithEffect(bool show, wxShowEffect effect, unsigned timeout);
|
||||||
|
|
||||||
|
virtual void DoGetPosition( int *x, int *y ) const;
|
||||||
|
virtual void DoGetSize( int *width, int *height ) const;
|
||||||
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
|
virtual void DoGetClientSize(int *width, int *height) const;
|
||||||
|
|
||||||
|
WXWindow m_macWindow ;
|
||||||
|
|
||||||
|
wxWindowMac* m_macFocus ;
|
||||||
|
|
||||||
|
static wxNonOwnedWindow *s_macDeactivateWindow;
|
||||||
|
private :
|
||||||
|
// KH: We cannot let this be called directly since the metal appearance is now managed by an
|
||||||
|
// extra style. Calling this function directly can result in blank white window backgrounds.
|
||||||
|
// This is because the ExtraStyle flags get out of sync with the metal appearance and the metal
|
||||||
|
// logic & checks cease to work as expected. To set the metal appearance, use SetExtraStyle.
|
||||||
|
void MacSetMetalAppearance( bool on ) ;
|
||||||
|
void MacSetUnifiedAppearance( bool on ) ;
|
||||||
|
// binary compatible workaround TODO REPLACE
|
||||||
|
void DoMacCreateRealWindow( wxWindow *parent,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name );
|
||||||
|
|
||||||
|
WXEVENTHANDLERREF m_macEventHandler ;
|
||||||
|
};
|
||||||
|
|
||||||
|
// list of all frames and modeless dialogs
|
||||||
|
extern WXDLLIMPEXP_DATA_CORE(wxWindowList) wxModelessWindows;
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _WX_MAC_NONOWNEDWND_H_
|
143
include/wx/osx/carbon/notebook.h
Normal file
143
include/wx/osx/carbon/notebook.h
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: notebook.h
|
||||||
|
// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_NOTEBOOK_H_
|
||||||
|
#define _WX_NOTEBOOK_H_
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
#include "wx/event.h"
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// types
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// fwd declarations
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxImageList;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxNotebook
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxNotebook : public wxNotebookBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctors
|
||||||
|
// -----
|
||||||
|
// default for dynamic class
|
||||||
|
wxNotebook();
|
||||||
|
// the same arguments as for wxControl (@@@ any special styles?)
|
||||||
|
wxNotebook(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxNotebookNameStr);
|
||||||
|
// Create() function
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxNotebookNameStr);
|
||||||
|
// dtor
|
||||||
|
virtual ~wxNotebook();
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
// ---------
|
||||||
|
// set the currently selected page, return the index of the previously
|
||||||
|
// selected one (or -1 on error)
|
||||||
|
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||||
|
int SetSelection(size_t nPage) { return DoSetSelection(nPage, SetSelection_SendEvent); }
|
||||||
|
// get the currently selected page
|
||||||
|
int GetSelection() const { return m_nSelection; }
|
||||||
|
|
||||||
|
// changes selected page without sending events
|
||||||
|
int ChangeSelection(size_t nPage) { return DoSetSelection(nPage); }
|
||||||
|
|
||||||
|
// set/get the title of a page
|
||||||
|
bool SetPageText(size_t nPage, const wxString& strText);
|
||||||
|
wxString GetPageText(size_t nPage) const;
|
||||||
|
|
||||||
|
// sets/returns item's image index in the current image list
|
||||||
|
int GetPageImage(size_t nPage) const;
|
||||||
|
bool SetPageImage(size_t nPage, int nImage);
|
||||||
|
|
||||||
|
// control the appearance of the notebook pages
|
||||||
|
// set the size (the same for all pages)
|
||||||
|
virtual void SetPageSize(const wxSize& size);
|
||||||
|
// set the padding between tabs (in pixels)
|
||||||
|
virtual void SetPadding(const wxSize& padding);
|
||||||
|
// sets the size of the tabs (assumes all tabs are the same size)
|
||||||
|
virtual void SetTabSize(const wxSize& sz);
|
||||||
|
|
||||||
|
// 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 ;
|
||||||
|
|
||||||
|
// operations
|
||||||
|
// ----------
|
||||||
|
// remove all pages
|
||||||
|
bool DeleteAllPages();
|
||||||
|
// the same as AddPage(), but adds it at the specified position
|
||||||
|
bool InsertPage(size_t nPage,
|
||||||
|
wxNotebookPage *pPage,
|
||||||
|
const wxString& strText,
|
||||||
|
bool bSelect = false,
|
||||||
|
int imageId = -1);
|
||||||
|
|
||||||
|
// callbacks
|
||||||
|
// ---------
|
||||||
|
void OnSize(wxSizeEvent& event);
|
||||||
|
void OnSelChange(wxNotebookEvent& event);
|
||||||
|
void OnSetFocus(wxFocusEvent& event);
|
||||||
|
void OnNavigationKey(wxNavigationKeyEvent& event);
|
||||||
|
|
||||||
|
// implementation
|
||||||
|
// --------------
|
||||||
|
|
||||||
|
#if wxUSE_CONSTRAINTS
|
||||||
|
virtual void SetConstraintSizes(bool recurse = true);
|
||||||
|
virtual bool DoPhase(int nPhase);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// base class virtuals
|
||||||
|
// -------------------
|
||||||
|
virtual void Command(wxCommandEvent& event);
|
||||||
|
virtual wxInt32 MacControlHit(WXEVENTHANDLERREF handler, WXEVENTREF event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxNotebookPage *DoRemovePage(size_t page) ;
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
// helper functions
|
||||||
|
void ChangePage(int nOldSel, int nSel); // change pages
|
||||||
|
void MacSetupTabs();
|
||||||
|
|
||||||
|
int DoSetSelection(size_t nPage, int flags = 0);
|
||||||
|
|
||||||
|
// the icon indices
|
||||||
|
wxArrayInt m_images;
|
||||||
|
|
||||||
|
int m_nSelection; // the current selection (-1 if none)
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxNotebook)
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _WX_NOTEBOOK_H_
|
41
include/wx/osx/carbon/palette.h
Normal file
41
include/wx/osx/carbon/palette.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/palette.h
|
||||||
|
// Purpose: wxPalette class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_PALETTE_H_
|
||||||
|
#define _WX_PALETTE_H_
|
||||||
|
|
||||||
|
#include "wx/gdiobj.h"
|
||||||
|
|
||||||
|
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxPalette : public wxPaletteBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxPalette();
|
||||||
|
|
||||||
|
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||||
|
virtual ~wxPalette();
|
||||||
|
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||||
|
|
||||||
|
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
||||||
|
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
||||||
|
|
||||||
|
virtual int GetColoursCount() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_PALETTE_H_
|
71
include/wx/osx/carbon/pen.h
Normal file
71
include/wx/osx/carbon/pen.h
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/pen.h
|
||||||
|
// Purpose: wxPen class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_PEN_H_
|
||||||
|
#define _WX_PEN_H_
|
||||||
|
|
||||||
|
#include "wx/gdiobj.h"
|
||||||
|
#include "wx/colour.h"
|
||||||
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
|
// Pen
|
||||||
|
class WXDLLIMPEXP_CORE wxPen : public wxPenBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxPen();
|
||||||
|
wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
|
||||||
|
#if FUTURE_WXWIN_COMPATIBILITY_3_0
|
||||||
|
wxDEPRECATED_FUTURE( wxPen(const wxColour& col, int width, int style) );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
wxPen(const wxBitmap& stipple, int width);
|
||||||
|
virtual ~wxPen();
|
||||||
|
|
||||||
|
bool operator==(const wxPen& pen) const;
|
||||||
|
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
||||||
|
|
||||||
|
// Override in order to recreate the pen
|
||||||
|
void SetColour(const wxColour& col) ;
|
||||||
|
void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
||||||
|
|
||||||
|
void SetWidth(int width) ;
|
||||||
|
void SetStyle(wxPenStyle style) ;
|
||||||
|
void SetStipple(const wxBitmap& stipple) ;
|
||||||
|
void SetDashes(int nb_dashes, const wxDash *dash) ;
|
||||||
|
void SetJoin(wxPenJoin join) ;
|
||||||
|
void SetCap(wxPenCap cap) ;
|
||||||
|
|
||||||
|
wxColour GetColour() const ;
|
||||||
|
int GetWidth() const;
|
||||||
|
wxPenStyle GetStyle() const;
|
||||||
|
wxPenJoin GetJoin() const;
|
||||||
|
wxPenCap GetCap() const;
|
||||||
|
int GetDashes(wxDash **ptr) const;
|
||||||
|
|
||||||
|
wxBitmap *GetStipple() const ;
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
|
||||||
|
// Useful helper: create the brush resource
|
||||||
|
bool RealizeResource();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Unshare();
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_PEN_H_
|
39
include/wx/osx/carbon/pnghand.h
Normal file
39
include/wx/osx/carbon/pnghand.h
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: pnghand.h
|
||||||
|
// Purpose: PNG bitmap handler
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 04/01/98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_PNGHAND_H_
|
||||||
|
#define _WX_PNGHAND_H_
|
||||||
|
|
||||||
|
#include "wx/defs.h"
|
||||||
|
|
||||||
|
#if wxUSE_LIBPNG
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxPNGFileHandler: public wxBitmapHandler
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPNGFileHandler)
|
||||||
|
public:
|
||||||
|
inline wxPNGFileHandler(void)
|
||||||
|
{
|
||||||
|
SetName(wxT("PNG bitmap file"));
|
||||||
|
SetExtension(wxT("bmp"));
|
||||||
|
SetType(wxBITMAP_TYPE_PNG);
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||||
|
int desiredWidth, int desiredHeight);
|
||||||
|
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //wxUSE_LIBPNG
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_PNGHAND_H_
|
||||||
|
|
287
include/wx/osx/carbon/pngread.h
Normal file
287
include/wx/osx/carbon/pngread.h
Normal file
@@ -0,0 +1,287 @@
|
|||||||
|
/*
|
||||||
|
* File: pngread.h
|
||||||
|
* Purpose: PNG file reader
|
||||||
|
* Author: Alejandro Aguilar Sierra/Julian Smart
|
||||||
|
* Created: 1995
|
||||||
|
* Copyright: (c) 1995, Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _WX_PNGREAD__
|
||||||
|
#define _WX_PNGREAD__
|
||||||
|
|
||||||
|
#ifndef byte
|
||||||
|
typedef unsigned char byte;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define WXIMA_COLORS DIB_PAL_COLORS
|
||||||
|
|
||||||
|
typedef byte * ImagePointerType;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
byte red;
|
||||||
|
byte green;
|
||||||
|
byte blue;
|
||||||
|
} rgb_color_struct;
|
||||||
|
|
||||||
|
|
||||||
|
#define COLORTYPE_PALETTE 1
|
||||||
|
#define COLORTYPE_COLOR 2
|
||||||
|
#define COLORTYPE_ALPHA 4
|
||||||
|
|
||||||
|
class wxPNGReader
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
int filetype;
|
||||||
|
char filename[255];
|
||||||
|
ImagePointerType RawImage; // Image data
|
||||||
|
|
||||||
|
int Width, Height; // Dimensions
|
||||||
|
int Depth; // (bits x pixel)
|
||||||
|
int ColorType; // Bit 1 = Palette used
|
||||||
|
// Bit 2 = Color used
|
||||||
|
// Bit 3 = Alpha used
|
||||||
|
|
||||||
|
long EfeWidth; // Efective Width
|
||||||
|
|
||||||
|
void *lpbi;
|
||||||
|
int bgindex;
|
||||||
|
wxPalette* m_palette;
|
||||||
|
bool imageOK;
|
||||||
|
friend class wxPNGReaderIter;
|
||||||
|
public:
|
||||||
|
wxPNGReader(void);
|
||||||
|
wxPNGReader (char* ImageFileName); // Read an image file
|
||||||
|
virtual ~wxPNGReader ();
|
||||||
|
|
||||||
|
void Create(int width, int height, int deep, int colortype=-1);
|
||||||
|
|
||||||
|
bool ReadFile( char* ImageFileName=0 );
|
||||||
|
bool SaveFile( char* ImageFileName=0 );
|
||||||
|
bool SaveXPM(char *filename, char *name = 0);
|
||||||
|
int GetWidth( void ) const { return Width; };
|
||||||
|
int GetHeight( void ) const { return Height; };
|
||||||
|
int GetDepth( void ) const { return Depth; };
|
||||||
|
int GetColorType( void ) const { return ColorType; };
|
||||||
|
|
||||||
|
int GetIndex(int x, int y);
|
||||||
|
bool GetRGB(int x, int y, byte* r, byte* g, byte* b);
|
||||||
|
|
||||||
|
bool SetIndex(int x, int y, int index);
|
||||||
|
bool SetRGB(int x, int y, byte r, byte g, byte b);
|
||||||
|
|
||||||
|
// ColorMap settings
|
||||||
|
bool SetPalette(wxPalette* colourmap);
|
||||||
|
bool SetPalette(int n, rgb_color_struct *rgb_struct);
|
||||||
|
bool SetPalette(int n, byte *r, byte *g=0, byte *b=0);
|
||||||
|
wxPalette* GetPalette() const { return m_palette; }
|
||||||
|
|
||||||
|
void NullData();
|
||||||
|
inline int GetBGIndex(void) { return bgindex; }
|
||||||
|
|
||||||
|
inline bool Inside(int x, int y)
|
||||||
|
{ return (0<=y && y<Height && 0<=x && x<Width); }
|
||||||
|
|
||||||
|
virtual wxBitmap *GetBitmap(void);
|
||||||
|
virtual bool InstantiateBitmap(wxBitmap *bitmap);
|
||||||
|
wxMask *CreateMask(void);
|
||||||
|
|
||||||
|
inline bool Ok() const { return IsOk(); }
|
||||||
|
inline bool IsOk(void) { return imageOK; }
|
||||||
|
};
|
||||||
|
|
||||||
|
class wxPNGReaderIter
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
int Itx, Ity; // Counters
|
||||||
|
int Stepx, Stepy;
|
||||||
|
ImagePointerType IterImage; // Image pointer
|
||||||
|
wxPNGReader *ima;
|
||||||
|
public:
|
||||||
|
// Constructors
|
||||||
|
wxPNGReaderIter ( void );
|
||||||
|
wxPNGReaderIter ( wxPNGReader *imax );
|
||||||
|
operator wxPNGReader* ();
|
||||||
|
|
||||||
|
// Iterators
|
||||||
|
bool ItOK ();
|
||||||
|
void reset ();
|
||||||
|
void upset ();
|
||||||
|
void SetRow(byte *buf, int n);
|
||||||
|
void GetRow(byte *buf, int n);
|
||||||
|
byte GetByte( ) { return IterImage[Itx]; }
|
||||||
|
void SetByte(byte b) { IterImage[Itx] = b; }
|
||||||
|
ImagePointerType GetRow(void);
|
||||||
|
bool NextRow();
|
||||||
|
bool PrevRow();
|
||||||
|
bool NextByte();
|
||||||
|
bool PrevByte();
|
||||||
|
|
||||||
|
void SetSteps(int x, int y=0) { Stepx = x; Stepy = y; }
|
||||||
|
void GetSteps(int *x, int *y) { *x = Stepx; *y = Stepy; }
|
||||||
|
bool NextStep();
|
||||||
|
bool PrevStep();
|
||||||
|
|
||||||
|
////////////////////////// AD - for interlace ///////////////////////////////
|
||||||
|
void SetY(int y);
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline
|
||||||
|
wxPNGReaderIter::wxPNGReaderIter(void)
|
||||||
|
{
|
||||||
|
ima = 0;
|
||||||
|
IterImage = 0;
|
||||||
|
Itx = Ity = 0;
|
||||||
|
Stepx = Stepy = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
wxPNGReaderIter::wxPNGReaderIter(wxPNGReader *imax): ima(imax)
|
||||||
|
{
|
||||||
|
if (ima)
|
||||||
|
IterImage = ima->RawImage;
|
||||||
|
Itx = Ity = 0;
|
||||||
|
Stepx = Stepy = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
wxPNGReaderIter::operator wxPNGReader* ()
|
||||||
|
{
|
||||||
|
return ima;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
bool wxPNGReaderIter::ItOK ()
|
||||||
|
{
|
||||||
|
if (ima)
|
||||||
|
return ima->Inside(Itx, Ity);
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline void wxPNGReaderIter::reset()
|
||||||
|
{
|
||||||
|
IterImage = ima->RawImage;
|
||||||
|
Itx = Ity = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void wxPNGReaderIter::upset()
|
||||||
|
{
|
||||||
|
Itx = 0;
|
||||||
|
Ity = ima->Height-1;
|
||||||
|
IterImage = ima->RawImage + ima->EfeWidth*(ima->Height-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool wxPNGReaderIter::NextRow()
|
||||||
|
{
|
||||||
|
if (++Ity >= ima->Height) return 0;
|
||||||
|
IterImage += ima->EfeWidth;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool wxPNGReaderIter::PrevRow()
|
||||||
|
{
|
||||||
|
if (--Ity < 0) return 0;
|
||||||
|
IterImage -= ima->EfeWidth;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////// AD - for interlace ///////////////////////////////
|
||||||
|
inline void wxPNGReaderIter::SetY(int y)
|
||||||
|
{
|
||||||
|
if ((y < 0) || (y > ima->Height)) return;
|
||||||
|
Ity = y;
|
||||||
|
IterImage = ima->RawImage + ima->EfeWidth*y;
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
inline void wxPNGReaderIter::SetRow(byte *buf, int n)
|
||||||
|
{
|
||||||
|
// Here should be bcopy or memcpy
|
||||||
|
//_fmemcpy(IterImage, (void far *)buf, n);
|
||||||
|
if (n<0)
|
||||||
|
n = ima->GetWidth();
|
||||||
|
|
||||||
|
for (int i=0; i<n; i++) IterImage[i] = buf[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void wxPNGReaderIter::GetRow(byte *buf, int n)
|
||||||
|
{
|
||||||
|
for (int i=0; i<n; i++) buf[i] = IterImage[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
inline ImagePointerType wxPNGReaderIter::GetRow()
|
||||||
|
{
|
||||||
|
return IterImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool wxPNGReaderIter::NextByte()
|
||||||
|
{
|
||||||
|
if (++Itx < ima->EfeWidth)
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
if (++Ity < ima->Height)
|
||||||
|
{
|
||||||
|
IterImage += ima->EfeWidth;
|
||||||
|
Itx = 0;
|
||||||
|
return 1;
|
||||||
|
} else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool wxPNGReaderIter::PrevByte()
|
||||||
|
{
|
||||||
|
if (--Itx >= 0)
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
if (--Ity >= 0)
|
||||||
|
{
|
||||||
|
IterImage -= ima->EfeWidth;
|
||||||
|
Itx = 0;
|
||||||
|
return 1;
|
||||||
|
} else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool wxPNGReaderIter::NextStep()
|
||||||
|
{
|
||||||
|
Itx += Stepx;
|
||||||
|
if (Itx < ima->EfeWidth)
|
||||||
|
return 1;
|
||||||
|
else {
|
||||||
|
Ity += Stepy;
|
||||||
|
if (Ity < ima->Height)
|
||||||
|
{
|
||||||
|
IterImage += ima->EfeWidth;
|
||||||
|
Itx = 0;
|
||||||
|
return 1;
|
||||||
|
} else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool wxPNGReaderIter::PrevStep()
|
||||||
|
{
|
||||||
|
Itx -= Stepx;
|
||||||
|
if (Itx >= 0)
|
||||||
|
return 1;
|
||||||
|
else {
|
||||||
|
Ity -= Stepy;
|
||||||
|
if (Ity >= 0 && Ity < ima->Height)
|
||||||
|
{
|
||||||
|
IterImage -= ima->EfeWidth;
|
||||||
|
Itx = 0;
|
||||||
|
return 1;
|
||||||
|
} else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
35
include/wx/osx/carbon/popupwin.h
Normal file
35
include/wx/osx/carbon/popupwin.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/popupwin.h
|
||||||
|
// Purpose: wxPopupWindow class for wxMac
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created:
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2006 Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_POPUPWIN_H_
|
||||||
|
#define _WX_MAC_POPUPWIN_H_
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxPopupWindow
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxPopupWindow : public wxPopupWindowBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxPopupWindow() { }
|
||||||
|
~wxPopupWindow();
|
||||||
|
|
||||||
|
wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE)
|
||||||
|
{ (void)Create(parent, flags); }
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MAC_POPUPWIN_H_
|
||||||
|
|
112
include/wx/osx/carbon/printdlg.h
Normal file
112
include/wx/osx/carbon/printdlg.h
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/printdlg.h
|
||||||
|
// Purpose: wxPrintDialog, wxPageSetupDialog classes.
|
||||||
|
// Use generic, PostScript version if no
|
||||||
|
// platform-specific implementation.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_PRINTDLG_H_
|
||||||
|
#define _WX_PRINTDLG_H_
|
||||||
|
|
||||||
|
#include "wx/dialog.h"
|
||||||
|
#include "wx/cmndata.h"
|
||||||
|
#include "wx/printdlg.h"
|
||||||
|
#include "wx/prntbase.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wxMacPrintDialog
|
||||||
|
* The Mac dialog for printing
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxDC;
|
||||||
|
class WXDLLIMPEXP_CORE wxMacPrintDialog: public wxPrintDialogBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxMacPrintDialog();
|
||||||
|
wxMacPrintDialog(wxWindow *parent, wxPrintDialogData* data = NULL);
|
||||||
|
wxMacPrintDialog(wxWindow *parent, wxPrintData* data );
|
||||||
|
virtual ~wxMacPrintDialog();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxPrintDialogData* data = NULL);
|
||||||
|
virtual int ShowModal();
|
||||||
|
|
||||||
|
virtual wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
|
||||||
|
virtual wxPrintData& GetPrintData() { return m_printDialogData.GetPrintData(); }
|
||||||
|
virtual wxDC *GetPrintDC();
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxPrintDialogData m_printDialogData;
|
||||||
|
wxDC* m_printerDC;
|
||||||
|
bool m_destroyDC;
|
||||||
|
wxWindow* m_dialogParent;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPrintDialog)
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wxMacPageSetupDialog
|
||||||
|
* The Mac page setup dialog
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMacPageSetupDialog: public wxPageSetupDialogBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxMacPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL);
|
||||||
|
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)
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wxMacPageMarginsDialog
|
||||||
|
* A Mac dialog for setting the page margins separately from page setup since
|
||||||
|
* (native) wxMacPageSetupDialog doesn't let you set margins.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMacPageMarginsDialog : public wxDialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxMacPageMarginsDialog(wxFrame* parent, wxPageSetupData* data);
|
||||||
|
bool TransferToWindow();
|
||||||
|
bool TransferDataFromWindow();
|
||||||
|
|
||||||
|
virtual wxPageSetupData& GetPageSetupDialogData() { return *m_pageSetupDialogData; }
|
||||||
|
|
||||||
|
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)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _WX_PRINTDLG_H_
|
60
include/wx/osx/carbon/printmac.h
Normal file
60
include/wx/osx/carbon/printmac.h
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: printwin.h
|
||||||
|
// Purpose: wxWindowsPrinter, wxWindowsPrintPreview classes
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 01/02/97
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_PRINTWIN_H_
|
||||||
|
#define _WX_PRINTWIN_H_
|
||||||
|
|
||||||
|
#include "wx/prntbase.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Represents the printer: manages printing a wxPrintout object
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMacPrinter: public wxPrinterBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMacPrinter)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxMacPrinter(wxPrintDialogData *data = NULL);
|
||||||
|
virtual ~wxMacPrinter();
|
||||||
|
|
||||||
|
virtual bool Print(wxWindow *parent,
|
||||||
|
wxPrintout *printout,
|
||||||
|
bool prompt = TRUE);
|
||||||
|
virtual wxDC* PrintDialog(wxWindow *parent);
|
||||||
|
virtual bool Setup(wxWindow *parent);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wxPrintPreview
|
||||||
|
* Programmer creates an object of this class to preview a wxPrintout.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMacPrintPreview: public wxPrintPreviewBase
|
||||||
|
{
|
||||||
|
DECLARE_CLASS(wxMacPrintPreview)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxMacPrintPreview(wxPrintout *printout,
|
||||||
|
wxPrintout *printoutForPrinting = NULL,
|
||||||
|
wxPrintDialogData *data = NULL);
|
||||||
|
wxMacPrintPreview(wxPrintout *printout,
|
||||||
|
wxPrintout *printoutForPrinting,
|
||||||
|
wxPrintData *data);
|
||||||
|
virtual ~wxMacPrintPreview();
|
||||||
|
|
||||||
|
virtual bool Print(bool interactive);
|
||||||
|
virtual void DetermineScaling();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_PRINTWIN_H_
|
1072
include/wx/osx/carbon/private.h
Normal file
1072
include/wx/osx/carbon/private.h
Normal file
File diff suppressed because it is too large
Load Diff
97
include/wx/osx/carbon/private/mactext.h
Normal file
97
include/wx/osx/carbon/private/mactext.h
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: mactext.h
|
||||||
|
// Purpose: private wxMacTextControl base class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 03/02/99
|
||||||
|
// RCS-ID: $Id:
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_PRIVATE_MACTEXT_H_
|
||||||
|
#define _WX_MAC_PRIVATE_MACTEXT_H_
|
||||||
|
|
||||||
|
#include "wx/mac/private.h"
|
||||||
|
|
||||||
|
// common interface for all implementations
|
||||||
|
class wxMacTextControl : public wxMacControl
|
||||||
|
{
|
||||||
|
public :
|
||||||
|
wxMacTextControl( wxTextCtrl *peer ) ;
|
||||||
|
virtual ~wxMacTextControl() ;
|
||||||
|
|
||||||
|
virtual wxString GetStringValue() const = 0 ;
|
||||||
|
virtual void SetStringValue( const wxString &val ) = 0 ;
|
||||||
|
virtual void SetSelection( long from, long to ) = 0 ;
|
||||||
|
virtual void GetSelection( long* from, long* to ) const = 0 ;
|
||||||
|
virtual void WriteText( const wxString& str ) = 0 ;
|
||||||
|
|
||||||
|
virtual void SetStyle( long start, long end, const wxTextAttr& style ) ;
|
||||||
|
virtual void Copy() ;
|
||||||
|
virtual void Cut() ;
|
||||||
|
virtual void Paste() ;
|
||||||
|
virtual bool CanPaste() const ;
|
||||||
|
virtual void SetEditable( bool editable ) ;
|
||||||
|
virtual wxTextPos GetLastPosition() const ;
|
||||||
|
virtual void Replace( long from, long to, const wxString &str ) ;
|
||||||
|
virtual void Remove( long from, long to ) ;
|
||||||
|
|
||||||
|
|
||||||
|
virtual bool HasOwnContextMenu() const
|
||||||
|
{ return false ; }
|
||||||
|
|
||||||
|
virtual bool SetupCursor( const wxPoint& WXUNUSED(pt) )
|
||||||
|
{ return false ; }
|
||||||
|
|
||||||
|
virtual void Clear() ;
|
||||||
|
virtual bool CanUndo() const;
|
||||||
|
virtual void Undo() ;
|
||||||
|
virtual bool CanRedo() const;
|
||||||
|
virtual void Redo() ;
|
||||||
|
virtual int GetNumberOfLines() const ;
|
||||||
|
virtual long XYToPosition(long x, long y) const;
|
||||||
|
virtual bool PositionToXY(long pos, long *x, long *y) const ;
|
||||||
|
virtual void ShowPosition(long WXUNUSED(pos)) ;
|
||||||
|
virtual int GetLineLength(long lineNo) const ;
|
||||||
|
virtual wxString GetLineText(long lineNo) const ;
|
||||||
|
virtual void CheckSpelling(bool WXUNUSED(check)) { }
|
||||||
|
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle );
|
||||||
|
} ;
|
||||||
|
|
||||||
|
class wxMacUnicodeTextControl : public wxMacTextControl
|
||||||
|
{
|
||||||
|
public :
|
||||||
|
wxMacUnicodeTextControl( wxTextCtrl *wxPeer ) ;
|
||||||
|
wxMacUnicodeTextControl( wxTextCtrl *wxPeer,
|
||||||
|
const wxString& str,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size, long style ) ;
|
||||||
|
virtual ~wxMacUnicodeTextControl();
|
||||||
|
|
||||||
|
virtual bool Create( wxTextCtrl *wxPeer,
|
||||||
|
const wxString& str,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size, long style ) ;
|
||||||
|
virtual void VisibilityChanged(bool shown);
|
||||||
|
virtual wxString GetStringValue() const ;
|
||||||
|
virtual void SetStringValue( const wxString &str) ;
|
||||||
|
virtual void Copy();
|
||||||
|
virtual void Cut();
|
||||||
|
virtual void Paste();
|
||||||
|
virtual bool CanPaste() const;
|
||||||
|
virtual void SetEditable(bool editable) ;
|
||||||
|
virtual void GetSelection( long* from, long* to) const ;
|
||||||
|
virtual void SetSelection( long from , long to ) ;
|
||||||
|
virtual void WriteText(const wxString& str) ;
|
||||||
|
|
||||||
|
protected :
|
||||||
|
virtual void CreateControl( wxTextCtrl* peer, const Rect* bounds, CFStringRef cfr );
|
||||||
|
|
||||||
|
// contains the tag for the content (is different for password and non-password controls)
|
||||||
|
OSType m_valueTag ;
|
||||||
|
public :
|
||||||
|
ControlEditTextSelectionRec m_selection ;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MAC_PRIVATE_MACTEXT_H_
|
58
include/wx/osx/carbon/private/overlay.h
Normal file
58
include/wx/osx/carbon/private/overlay.h
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/private/overlay.h
|
||||||
|
// Purpose: wxOverlayImpl declaration
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 2006-10-20
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) wxWidgets team
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_CARBON_PRIVATE_OVERLAY_H_
|
||||||
|
#define _WX_MAC_CARBON_PRIVATE_OVERLAY_H_
|
||||||
|
|
||||||
|
#include "wx/mac/private.h"
|
||||||
|
#include "wx/toplevel.h"
|
||||||
|
#include "wx/graphics.h"
|
||||||
|
|
||||||
|
class wxOverlayImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxOverlayImpl() ;
|
||||||
|
~wxOverlayImpl() ;
|
||||||
|
|
||||||
|
|
||||||
|
// clears the overlay without restoring the former state
|
||||||
|
// to be done eg when the window content has been changed and repainted
|
||||||
|
void Reset();
|
||||||
|
|
||||||
|
// returns true if it has been setup
|
||||||
|
bool IsOk();
|
||||||
|
|
||||||
|
void Init( wxDC* dc, int x , int y , int width , int height );
|
||||||
|
|
||||||
|
void BeginDrawing( wxDC* dc);
|
||||||
|
|
||||||
|
void EndDrawing( wxDC* dc);
|
||||||
|
|
||||||
|
void Clear( wxDC* dc);
|
||||||
|
|
||||||
|
private:
|
||||||
|
OSStatus CreateOverlayWindow();
|
||||||
|
|
||||||
|
void MacGetBounds( Rect *bounds );
|
||||||
|
|
||||||
|
WindowRef m_overlayWindow;
|
||||||
|
WindowRef m_overlayParentWindow;
|
||||||
|
CGContextRef m_overlayContext ;
|
||||||
|
// we store the window in case we would have to issue a Refresh()
|
||||||
|
wxWindow* m_window ;
|
||||||
|
|
||||||
|
int m_x ;
|
||||||
|
int m_y ;
|
||||||
|
int m_width ;
|
||||||
|
int m_height ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
#endif // _WX_MAC_CARBON_PRIVATE_OVERLAY_H_
|
45
include/wx/osx/carbon/private/print.h
Normal file
45
include/wx/osx/carbon/private/print.h
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/private/print.h
|
||||||
|
// Purpose: private implementation for printing on MacOS
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 03/02/99
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_PRIVATE_PRINT_H_
|
||||||
|
#define _WX_MAC_PRIVATE_PRINT_H_
|
||||||
|
|
||||||
|
#include "wx/cmndata.h"
|
||||||
|
#include "wx/print.h"
|
||||||
|
#include "ApplicationServices/ApplicationServices.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxMacCarbonPrintData : public wxPrintNativeDataBase
|
||||||
|
{
|
||||||
|
public :
|
||||||
|
wxMacCarbonPrintData() ;
|
||||||
|
virtual ~wxMacCarbonPrintData() ;
|
||||||
|
|
||||||
|
virtual bool TransferTo( wxPrintData &data );
|
||||||
|
virtual bool TransferFrom( const wxPrintData &data );
|
||||||
|
|
||||||
|
virtual bool IsOk() const ;
|
||||||
|
|
||||||
|
virtual void TransferFrom( wxPageSetupDialogData * ) ;
|
||||||
|
virtual void TransferTo( wxPageSetupDialogData * ) ;
|
||||||
|
|
||||||
|
virtual void TransferFrom( wxPrintDialogData * ) ;
|
||||||
|
virtual void TransferTo( wxPrintDialogData * ) ;
|
||||||
|
private :
|
||||||
|
virtual void ValidateOrCreate() ;
|
||||||
|
public :
|
||||||
|
PMPrintSession m_macPrintSession ;
|
||||||
|
PMPageFormat m_macPageFormat ;
|
||||||
|
PMPrintSettings m_macPrintSettings ;
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMacCarbonPrintData)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
#endif // _WX_MAC_PRIVATE_PRINT_H_
|
33
include/wx/osx/carbon/private/timer.h
Normal file
33
include/wx/osx/carbon/private/timer.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/private/timer.h
|
||||||
|
// Purpose: wxTimer class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_PRIVATE_TIMER_H_
|
||||||
|
#define _WX_MAC_PRIVATE_TIMER_H_
|
||||||
|
|
||||||
|
#include "wx/private/timer.h"
|
||||||
|
|
||||||
|
struct MacTimerInfo;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxCarbonTimerImpl : public wxTimerImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxCarbonTimerImpl(wxTimer *timer);
|
||||||
|
virtual ~wxCarbonTimerImpl();
|
||||||
|
|
||||||
|
virtual bool Start(int milliseconds = -1, bool one_shot = false);
|
||||||
|
virtual void Stop();
|
||||||
|
|
||||||
|
virtual bool IsRunning() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
MacTimerInfo *m_info;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MAC_PRIVATE_TIMER_H_
|
105
include/wx/osx/carbon/radiobox.h
Normal file
105
include/wx/osx/carbon/radiobox.h
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/radiobox.h
|
||||||
|
// Purpose: wxRadioBox class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_RADIOBOX_H_
|
||||||
|
#define _WX_RADIOBOX_H_
|
||||||
|
|
||||||
|
// List box item
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxBitmap ;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxRadioButton ;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxRadioBox: public wxControl, public wxRadioBoxBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||||
|
public:
|
||||||
|
// Constructors & destructor
|
||||||
|
wxRadioBox();
|
||||||
|
inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0, const wxString choices[] = NULL,
|
||||||
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||||
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
||||||
|
}
|
||||||
|
inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||||
|
const wxPoint& pos, const wxSize& size,
|
||||||
|
const wxArrayString& choices,
|
||||||
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||||
|
const wxValidator& val = wxDefaultValidator,
|
||||||
|
const wxString& name = wxRadioBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, title, pos, size, choices,
|
||||||
|
majorDim, style, val, name);
|
||||||
|
}
|
||||||
|
virtual ~wxRadioBox();
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0, const wxString choices[] = NULL,
|
||||||
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||||
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||||
|
const wxPoint& pos, const wxSize& size,
|
||||||
|
const wxArrayString& choices,
|
||||||
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||||
|
const wxValidator& val = wxDefaultValidator,
|
||||||
|
const wxString& name = wxRadioBoxNameStr);
|
||||||
|
|
||||||
|
// Enabling
|
||||||
|
virtual bool Enable(bool enable = true);
|
||||||
|
virtual bool Enable(unsigned int item, bool enable = true);
|
||||||
|
virtual bool IsItemEnabled(unsigned int item) const;
|
||||||
|
|
||||||
|
// Showing
|
||||||
|
virtual bool Show(bool show = true);
|
||||||
|
virtual bool Show(unsigned int item, bool show = true);
|
||||||
|
virtual bool IsItemShown(unsigned int item) const;
|
||||||
|
|
||||||
|
// Specific functions (in wxWidgets2 reference)
|
||||||
|
virtual void SetSelection(int item);
|
||||||
|
virtual int GetSelection() const;
|
||||||
|
|
||||||
|
virtual unsigned int GetCount() const { return m_noItems; }
|
||||||
|
|
||||||
|
virtual wxString GetString(unsigned int item) const;
|
||||||
|
virtual void SetString(unsigned int item, const wxString& label);
|
||||||
|
|
||||||
|
virtual wxString GetLabel() const;
|
||||||
|
virtual void SetLabel(const wxString& label) ;
|
||||||
|
|
||||||
|
// Other external functions
|
||||||
|
void Command(wxCommandEvent& event);
|
||||||
|
void SetFocus();
|
||||||
|
|
||||||
|
// Other variable access functions
|
||||||
|
inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
||||||
|
inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
||||||
|
|
||||||
|
void OnRadioButton( wxCommandEvent& event ) ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxRadioButton *m_radioButtonCycle;
|
||||||
|
|
||||||
|
unsigned int m_noItems;
|
||||||
|
int m_noRowsOrCols;
|
||||||
|
|
||||||
|
// Internal functions
|
||||||
|
virtual wxSize DoGetBestSize() const ;
|
||||||
|
virtual void DoSetSize(int x, int y,
|
||||||
|
int width, int height,
|
||||||
|
int sizeFlags = wxSIZE_AUTO);
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_RADIOBOX_H_
|
92
include/wx/osx/carbon/radiobut.h
Normal file
92
include/wx/osx/carbon/radiobut.h
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: radiobut.h
|
||||||
|
// Purpose: wxRadioButton class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 01/02/97
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_RADIOBUT_H_
|
||||||
|
#define _WX_RADIOBUT_H_
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxRadioButton: public wxControl
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
||||||
|
protected:
|
||||||
|
public:
|
||||||
|
inline wxRadioButton() {}
|
||||||
|
inline wxRadioButton(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxRadioButtonNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
virtual ~wxRadioButton();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxRadioButtonNameStr);
|
||||||
|
|
||||||
|
virtual void SetValue(bool val);
|
||||||
|
virtual bool GetValue() const ;
|
||||||
|
|
||||||
|
// implementation
|
||||||
|
|
||||||
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
void Command(wxCommandEvent& event);
|
||||||
|
wxRadioButton *AddInCycle(wxRadioButton *cycle);
|
||||||
|
void RemoveFromCycle();
|
||||||
|
inline wxRadioButton *NextInCycle() {return m_cycle;}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
wxRadioButton *m_cycle;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Not implemented
|
||||||
|
#if 0
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxBitmap ;
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const wxChar) wxBitmapRadioButtonNameStr[];
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxBitmapRadioButton: public wxRadioButton
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxBitmapRadioButton)
|
||||||
|
protected:
|
||||||
|
wxBitmap *theButtonBitmap;
|
||||||
|
public:
|
||||||
|
inline wxBitmapRadioButton() { theButtonBitmap = NULL; }
|
||||||
|
inline wxBitmapRadioButton(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxBitmap *label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxBitmapRadioButtonNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxBitmap *label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxBitmapRadioButtonNameStr);
|
||||||
|
|
||||||
|
virtual void SetLabel(const wxBitmap *label);
|
||||||
|
virtual void SetValue(bool val) ;
|
||||||
|
virtual bool GetValue() const ;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_RADIOBUT_H_
|
100
include/wx/osx/carbon/region.h
Normal file
100
include/wx/osx/carbon/region.h
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: region.h
|
||||||
|
// Purpose: wxRegion class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_CARBON_REGION_H_
|
||||||
|
#define _WX_MAC_CARBON_REGION_H_
|
||||||
|
|
||||||
|
#include "wx/list.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxRegion : public wxRegionWithCombine
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxRegion(long x, long y, long w, long h);
|
||||||
|
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
|
||||||
|
wxRegion(const wxRect& rect);
|
||||||
|
wxRegion( WXHRGN hRegion );
|
||||||
|
wxRegion(size_t n, const wxPoint *points, int fillStyle = wxODDEVEN_RULE );
|
||||||
|
wxRegion();
|
||||||
|
wxRegion(const wxBitmap& bmp)
|
||||||
|
{
|
||||||
|
Union(bmp);
|
||||||
|
}
|
||||||
|
wxRegion(const wxBitmap& bmp,
|
||||||
|
const wxColour& transColour, int tolerance = 0)
|
||||||
|
{
|
||||||
|
Union(bmp, transColour, tolerance);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~wxRegion();
|
||||||
|
|
||||||
|
// wxRegionBase methods
|
||||||
|
virtual void Clear();
|
||||||
|
virtual bool IsEmpty() const;
|
||||||
|
|
||||||
|
// Internal
|
||||||
|
const WXHRGN GetWXHRGN() const ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||||
|
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
||||||
|
virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const;
|
||||||
|
virtual wxRegionContain DoContainsRect(const wxRect& rect) const;
|
||||||
|
|
||||||
|
virtual bool DoOffset(wxCoord x, wxCoord y);
|
||||||
|
virtual bool DoCombine(const wxRegion& region, wxRegionOp op);
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxRegion)
|
||||||
|
friend class WXDLLIMPEXP_FWD_CORE wxRegionIterator;
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxRegionIterator : public wxObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxRegionIterator();
|
||||||
|
wxRegionIterator(const wxRegion& region);
|
||||||
|
wxRegionIterator(const wxRegionIterator& iterator);
|
||||||
|
virtual ~wxRegionIterator();
|
||||||
|
|
||||||
|
wxRegionIterator& operator=(const wxRegionIterator& iterator);
|
||||||
|
|
||||||
|
void Reset() { m_current = 0; }
|
||||||
|
void Reset(const wxRegion& region);
|
||||||
|
|
||||||
|
operator bool () const { return m_current < m_numRects; }
|
||||||
|
bool HaveRects() const { return m_current < m_numRects; }
|
||||||
|
|
||||||
|
wxRegionIterator& operator++();
|
||||||
|
wxRegionIterator operator++(int);
|
||||||
|
|
||||||
|
long GetX() const;
|
||||||
|
long GetY() const;
|
||||||
|
long GetW() const;
|
||||||
|
long GetWidth() const { return GetW(); }
|
||||||
|
long GetH() const;
|
||||||
|
long GetHeight() const { return GetH(); }
|
||||||
|
wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
void SetRects(long numRects, wxRect *rects);
|
||||||
|
|
||||||
|
long m_current;
|
||||||
|
long m_numRects;
|
||||||
|
wxRegion m_region;
|
||||||
|
wxRect* m_rects;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxRegionIterator)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MAC_CARBON_REGION_H_
|
68
include/wx/osx/carbon/scrolbar.h
Normal file
68
include/wx/osx/carbon/scrolbar.h
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: scrollbar.h
|
||||||
|
// Purpose: wxScrollBar class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_SCROLBAR_H_
|
||||||
|
#define _WX_SCROLBAR_H_
|
||||||
|
|
||||||
|
// Scrollbar item
|
||||||
|
class WXDLLIMPEXP_CORE wxScrollBar : public wxScrollBarBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; }
|
||||||
|
virtual ~wxScrollBar();
|
||||||
|
|
||||||
|
wxScrollBar(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxSB_HORIZONTAL,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxScrollBarNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxSB_HORIZONTAL,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxScrollBarNameStr);
|
||||||
|
|
||||||
|
virtual int GetThumbPosition() const ;
|
||||||
|
virtual int GetThumbSize() const { return m_viewSize; }
|
||||||
|
virtual int GetPageSize() const { return m_pageSize; }
|
||||||
|
virtual int GetRange() const { return m_objectSize; }
|
||||||
|
|
||||||
|
virtual void SetThumbPosition(int viewStart);
|
||||||
|
virtual void SetScrollbar(int position, int thumbSize, int range,
|
||||||
|
int pageSize, bool refresh = true);
|
||||||
|
|
||||||
|
// implementation only from now on
|
||||||
|
void Command(wxCommandEvent& event);
|
||||||
|
virtual void MacHandleControlClick( WXWidget control ,
|
||||||
|
wxInt16 controlpart ,
|
||||||
|
bool mouseStillDown ) ;
|
||||||
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler ,
|
||||||
|
WXEVENTREF mevent ) ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
int m_pageSize;
|
||||||
|
int m_viewSize;
|
||||||
|
int m_objectSize;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxScrollBar)
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_SCROLBAR_H_
|
108
include/wx/osx/carbon/slider.h
Normal file
108
include/wx/osx/carbon/slider.h
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: slider.h
|
||||||
|
// Purpose: wxSlider class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_SLIDER_H_
|
||||||
|
#define _WX_SLIDER_H_
|
||||||
|
|
||||||
|
#include "wx/control.h"
|
||||||
|
#include "wx/slider.h"
|
||||||
|
#include "wx/stattext.h"
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxSliderNameStr[];
|
||||||
|
|
||||||
|
// Slider
|
||||||
|
class WXDLLIMPEXP_CORE wxSlider: public wxSliderBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxSlider)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxSlider();
|
||||||
|
|
||||||
|
inline wxSlider(wxWindow *parent, wxWindowID id,
|
||||||
|
int value, int minValue, int maxValue,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxSL_HORIZONTAL,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxSliderNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~wxSlider();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
int value, int minValue, int maxValue,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxSL_HORIZONTAL,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxSliderNameStr);
|
||||||
|
|
||||||
|
virtual int GetValue() const ;
|
||||||
|
virtual void SetValue(int);
|
||||||
|
|
||||||
|
void SetRange(int minValue, int maxValue);
|
||||||
|
|
||||||
|
inline int GetMin() const { return m_rangeMin; }
|
||||||
|
inline int GetMax() const { return m_rangeMax; }
|
||||||
|
|
||||||
|
void SetMin(int minValue) { SetRange(minValue, m_rangeMax); }
|
||||||
|
void SetMax(int maxValue) { SetRange(m_rangeMin, maxValue); }
|
||||||
|
|
||||||
|
// For trackbars only
|
||||||
|
void SetTickFreq(int n, int pos);
|
||||||
|
inline int GetTickFreq() const { return m_tickFreq; }
|
||||||
|
void SetPageSize(int pageSize);
|
||||||
|
int GetPageSize() const ;
|
||||||
|
void ClearSel() ;
|
||||||
|
void ClearTicks() ;
|
||||||
|
void SetLineSize(int lineSize);
|
||||||
|
int GetLineSize() const ;
|
||||||
|
int GetSelEnd() const ;
|
||||||
|
int GetSelStart() const ;
|
||||||
|
void SetSelection(int minPos, int maxPos);
|
||||||
|
void SetThumbLength(int len) ;
|
||||||
|
int GetThumbLength() const ;
|
||||||
|
void SetTick(int tickPos) ;
|
||||||
|
|
||||||
|
void Command(wxCommandEvent& event);
|
||||||
|
virtual wxInt32 MacControlHit(WXEVENTHANDLERREF handler, WXEVENTREF event);
|
||||||
|
void MacHandleControlClick(WXWidget control, wxInt16 controlpart, bool mouseStillDown);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
virtual void DoSetSize(int x, int y, int w, int h, int sizeFlags);
|
||||||
|
virtual void DoMoveWindow(int x, int y, int w, int h);
|
||||||
|
|
||||||
|
// set min/max size of the slider
|
||||||
|
virtual void DoSetSizeHints( int minW, int minH,
|
||||||
|
int maxW, int maxH,
|
||||||
|
int incW, int incH);
|
||||||
|
|
||||||
|
// Common processing to invert slider values based on wxSL_INVERSE
|
||||||
|
virtual int ValueInvertOrNot(int value) const;
|
||||||
|
|
||||||
|
wxStaticText* m_macMinimumStatic ;
|
||||||
|
wxStaticText* m_macMaximumStatic ;
|
||||||
|
wxStaticText* m_macValueStatic ;
|
||||||
|
|
||||||
|
int m_rangeMin;
|
||||||
|
int m_rangeMax;
|
||||||
|
int m_pageSize;
|
||||||
|
int m_lineSize;
|
||||||
|
int m_tickFreq;
|
||||||
|
private :
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_SLIDER_H_
|
55
include/wx/osx/carbon/sound.h
Normal file
55
include/wx/osx/carbon/sound.h
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: sound.h
|
||||||
|
// Purpose: wxSound class (loads and plays short Windows .wav files).
|
||||||
|
// Optional on non-Windows platforms.
|
||||||
|
// Author: Ryan Norton, Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Ryan Norton, Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_SOUND_H_
|
||||||
|
#define _WX_SOUND_H_
|
||||||
|
|
||||||
|
#if wxUSE_SOUND
|
||||||
|
|
||||||
|
#include "wx/object.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxSound : public wxSoundBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxSound();
|
||||||
|
wxSound(const wxString& fileName, bool isResource = FALSE);
|
||||||
|
wxSound(int size, const wxByte* data);
|
||||||
|
virtual ~wxSound();
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool Create(const wxString& fileName, bool isResource = FALSE);
|
||||||
|
bool IsOk() const { return !m_sndname.IsEmpty(); }
|
||||||
|
static void Stop();
|
||||||
|
static bool IsPlaying();
|
||||||
|
|
||||||
|
void* GetHandle();
|
||||||
|
protected:
|
||||||
|
bool DoPlay(unsigned flags) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxString m_sndname; //file path
|
||||||
|
char* m_hSnd; //pointer to resource or memory location
|
||||||
|
int m_waveLength; //size of file in memory mode
|
||||||
|
void* m_pTimer; //timer
|
||||||
|
|
||||||
|
enum wxSoundType
|
||||||
|
{
|
||||||
|
wxSound_MEMORY,
|
||||||
|
wxSound_FILE,
|
||||||
|
wxSound_RESOURCE,
|
||||||
|
wxSound_NONE
|
||||||
|
} m_type; //mode
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
// _WX_SOUND_H_
|
76
include/wx/osx/carbon/spinbutt.h
Normal file
76
include/wx/osx/carbon/spinbutt.h
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: spinbutt.h
|
||||||
|
// Purpose: wxSpinButton class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_SPINBUTT_H_
|
||||||
|
#define _WX_SPINBUTT_H_
|
||||||
|
|
||||||
|
#include "wx/control.h"
|
||||||
|
#include "wx/event.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
The wxSpinButton is like a small scrollbar than is often placed next
|
||||||
|
to a text control.
|
||||||
|
|
||||||
|
wxSP_HORIZONTAL: horizontal spin button
|
||||||
|
wxSP_VERTICAL: vertical spin button (the default)
|
||||||
|
wxSP_ARROW_KEYS: arrow keys increment/decrement value
|
||||||
|
wxSP_WRAP: value wraps at either end
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxSpinButton : public wxSpinButtonBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// construction
|
||||||
|
wxSpinButton();
|
||||||
|
|
||||||
|
wxSpinButton(wxWindow *parent,
|
||||||
|
wxWindowID id = -1,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
|
||||||
|
const wxString& name = wxT("wxSpinButton"))
|
||||||
|
{
|
||||||
|
Create(parent, id, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~wxSpinButton();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id = -1,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
|
||||||
|
const wxString& name = wxT("wxSpinButton"));
|
||||||
|
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
virtual int GetMin() const;
|
||||||
|
virtual int GetMax() const;
|
||||||
|
virtual int GetValue() const;
|
||||||
|
virtual void SetValue(int val);
|
||||||
|
virtual void SetRange(int minVal, int maxVal);
|
||||||
|
|
||||||
|
// implementation
|
||||||
|
|
||||||
|
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ;
|
||||||
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void MacHandleValueChanged( int inc ) ;
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
int m_value ;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_SPINBUTT_H_
|
195
include/wx/osx/carbon/spinctrl.h
Normal file
195
include/wx/osx/carbon/spinctrl.h
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/generic/spinctlg.h
|
||||||
|
// Purpose: generic wxSpinCtrl class
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 28.10.99
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Vadim Zeitlin
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_SPINCTRL_H_
|
||||||
|
#define _WX_MAC_SPINCTRL_H_
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxSpinCtrl is a combination of wxSpinButton and wxTextCtrl, so if
|
||||||
|
// wxSpinButton is available, this is what we do - but if it isn't, we still
|
||||||
|
// define wxSpinCtrl class which then has the same appearance as wxTextCtrl but
|
||||||
|
// the different interface. This allows to write programs using wxSpinCtrl
|
||||||
|
// without tons of #ifdefs.
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if wxUSE_SPINBTN
|
||||||
|
|
||||||
|
#include "wx/containr.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxSpinButton;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxSpinCtrlText;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxSpinCtrlButton;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxSpinCtrl is a combination of wxTextCtrl and wxSpinButton
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxSpinCtrl : public wxControl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxSpinCtrl() { Init(); }
|
||||||
|
|
||||||
|
wxSpinCtrl(wxWindow *parent,
|
||||||
|
wxWindowID id = -1,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxSP_ARROW_KEYS,
|
||||||
|
int min = 0, int max = 100, int initial = 0,
|
||||||
|
const wxString& name = _T("wxSpinCtrl"))
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
Create(parent, id, value, pos, size, style, min, max, initial, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id = -1,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxSP_ARROW_KEYS,
|
||||||
|
int min = 0, int max = 100, int initial = 0,
|
||||||
|
const wxString& name = _T("wxSpinCtrl"));
|
||||||
|
|
||||||
|
// wxTextCtrl-like method
|
||||||
|
void SetSelection(long from, long to);
|
||||||
|
|
||||||
|
virtual ~wxSpinCtrl();
|
||||||
|
|
||||||
|
// operations
|
||||||
|
void SetValue(int val);
|
||||||
|
void SetValue(const wxString& text);
|
||||||
|
void SetRange(int min, int max);
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
int GetValue() const;
|
||||||
|
int GetMin() const;
|
||||||
|
int GetMax() const;
|
||||||
|
|
||||||
|
// implementation from now on
|
||||||
|
|
||||||
|
// forward these functions to all subcontrols
|
||||||
|
virtual bool Enable(bool enable = TRUE);
|
||||||
|
virtual bool Show(bool show = TRUE);
|
||||||
|
|
||||||
|
// get the subcontrols
|
||||||
|
wxTextCtrl *GetText() const { return m_text; }
|
||||||
|
wxSpinButton *GetSpinButton() const { return m_btn; }
|
||||||
|
|
||||||
|
// set the value of the text (only)
|
||||||
|
void SetTextValue(int val);
|
||||||
|
|
||||||
|
// put the numeric value of the string in the text ctrl into val and return
|
||||||
|
// TRUE or return FALSE if the text ctrl doesn't contain a number or if the
|
||||||
|
// number is out of range
|
||||||
|
bool GetTextValue(int *val) const;
|
||||||
|
|
||||||
|
WX_DECLARE_CONTROL_CONTAINER();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// override the base class virtuals involved into geometry calculations
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
|
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
private:
|
||||||
|
// the subcontrols
|
||||||
|
wxTextCtrl *m_text;
|
||||||
|
wxSpinButton *m_btn;
|
||||||
|
|
||||||
|
friend class wxSpinCtrlText;
|
||||||
|
friend class wxSpinCtrlButton;
|
||||||
|
|
||||||
|
int m_oldValue;
|
||||||
|
private:
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
||||||
|
};
|
||||||
|
|
||||||
|
#else // !wxUSE_SPINBTN
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxSpinCtrl is just a text control
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#include "wx/textctrl.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxSpinCtrl : public wxTextCtrl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxSpinCtrl() { Init(); }
|
||||||
|
|
||||||
|
wxSpinCtrl(wxWindow *parent,
|
||||||
|
wxWindowID id = -1,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxSP_ARROW_KEYS,
|
||||||
|
int min = 0, int max = 100, int initial = 0,
|
||||||
|
const wxString& name = _T("wxSpinCtrl"))
|
||||||
|
{
|
||||||
|
Create(parent, id, value, pos, size, style, min, max, initial, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id = -1,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxSP_ARROW_KEYS,
|
||||||
|
int min = 0, int max = 100, int initial = 0,
|
||||||
|
const wxString& name = _T("wxSpinCtrl"))
|
||||||
|
{
|
||||||
|
SetRange(min, max);
|
||||||
|
|
||||||
|
bool ok = wxTextCtrl::Create(parent, id, value, pos, size, style,
|
||||||
|
wxDefaultValidator, name);
|
||||||
|
SetValue(initial);
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
int GetValue(int WXUNUSED(dummy) = 1) const
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
if ( (wxSscanf(wxTextCtrl::GetValue(), wxT("%d"), &n) != 1) )
|
||||||
|
n = INT_MIN;
|
||||||
|
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetMin() const { return m_min; }
|
||||||
|
int GetMax() const { return m_max; }
|
||||||
|
|
||||||
|
// operations
|
||||||
|
void SetValue(const wxString& value) { wxTextCtrl::SetValue(value); }
|
||||||
|
void SetValue(int val) { wxString s; s << val; wxTextCtrl::SetValue(s); }
|
||||||
|
void SetRange(int min, int max) { m_min = min; m_max = max; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// initialize m_min/max with the default values
|
||||||
|
void Init() { SetRange(0, 100); }
|
||||||
|
|
||||||
|
int m_min;
|
||||||
|
int m_max;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // wxUSE_SPINBTN/!wxUSE_SPINBTN
|
||||||
|
|
||||||
|
#endif // _WX_MAC_SPINCTRL_H_
|
||||||
|
|
90
include/wx/osx/carbon/srchctrl.h
Normal file
90
include/wx/osx/carbon/srchctrl.h
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/srchctrl.h
|
||||||
|
// Purpose: mac carbon wxSearchCtrl class
|
||||||
|
// Author: Vince Harron
|
||||||
|
// Created: 2006-02-19
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: Vince Harron
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_SEARCHCTRL_H_
|
||||||
|
#define _WX_SEARCHCTRL_H_
|
||||||
|
|
||||||
|
#if wxUSE_SEARCHCTRL
|
||||||
|
|
||||||
|
class wxMacSearchFieldControl;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxSearchCtrl : public wxSearchCtrlBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// creation
|
||||||
|
// --------
|
||||||
|
|
||||||
|
wxSearchCtrl();
|
||||||
|
wxSearchCtrl(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxSearchCtrlNameStr);
|
||||||
|
|
||||||
|
virtual ~wxSearchCtrl();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxSearchCtrlNameStr);
|
||||||
|
|
||||||
|
// get/set search button menu
|
||||||
|
// --------------------------
|
||||||
|
virtual void SetMenu( wxMenu* menu );
|
||||||
|
virtual wxMenu* GetMenu();
|
||||||
|
|
||||||
|
// get/set search options
|
||||||
|
// ----------------------
|
||||||
|
virtual void ShowSearchButton( bool show );
|
||||||
|
virtual bool IsSearchButtonVisible() const;
|
||||||
|
|
||||||
|
virtual void ShowCancelButton( bool show );
|
||||||
|
virtual bool IsCancelButtonVisible() const;
|
||||||
|
|
||||||
|
// TODO: In 2.9 these should probably be virtual, and declared in the base class...
|
||||||
|
void SetDescriptiveText(const wxString& text);
|
||||||
|
wxString GetDescriptiveText() const;
|
||||||
|
|
||||||
|
virtual wxInt32 MacSearchFieldSearchHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
virtual wxInt32 MacSearchFieldCancelHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
|
||||||
|
wxMacSearchFieldControl * GetPeer() const
|
||||||
|
{ return (wxMacSearchFieldControl*) m_peer; }
|
||||||
|
|
||||||
|
virtual void SetFocus();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
virtual void CreatePeer(
|
||||||
|
const wxString& str,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size, long style );
|
||||||
|
|
||||||
|
wxMenu *m_menu;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxSearchCtrl)
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // wxUSE_SEARCHCTRL
|
||||||
|
|
||||||
|
#endif // _WX_SEARCHCTRL_H_
|
||||||
|
|
65
include/wx/osx/carbon/statbmp.h
Normal file
65
include/wx/osx/carbon/statbmp.h
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: statbmp.h
|
||||||
|
// Purpose: wxStaticBitmap class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_STATBMP_H_
|
||||||
|
#define _WX_STATBMP_H_
|
||||||
|
|
||||||
|
#include "wx/icon.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxStaticBitmap: public wxStaticBitmapBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||||
|
public:
|
||||||
|
wxStaticBitmap() { }
|
||||||
|
|
||||||
|
wxStaticBitmap(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxBitmap& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxStaticBitmapNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxBitmap& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxStaticBitmapNameStr);
|
||||||
|
|
||||||
|
virtual void SetBitmap(const wxBitmap& bitmap);
|
||||||
|
|
||||||
|
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
|
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
|
void OnPaint( wxPaintEvent &event ) ;
|
||||||
|
|
||||||
|
wxBitmap GetBitmap() const { return m_bitmap; }
|
||||||
|
wxIcon GetIcon() const
|
||||||
|
{
|
||||||
|
// icons and bitmaps are really the same thing in wxMac
|
||||||
|
return (const wxIcon &)m_bitmap;
|
||||||
|
}
|
||||||
|
void SetIcon(const wxIcon& icon) { SetBitmap( (const wxBitmap &)icon ) ; }
|
||||||
|
|
||||||
|
// overriden base class virtuals
|
||||||
|
virtual bool AcceptsFocus() const { return FALSE; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
wxBitmap m_bitmap;
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_STATBMP_H_
|
52
include/wx/osx/carbon/statbox.h
Normal file
52
include/wx/osx/carbon/statbox.h
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: statbox.h
|
||||||
|
// Purpose: wxStaticBox class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_STATBOX_H_
|
||||||
|
#define _WX_STATBOX_H_
|
||||||
|
|
||||||
|
#include "wx/control.h"
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxStaticBoxNameStr[];
|
||||||
|
|
||||||
|
// Group box
|
||||||
|
class WXDLLIMPEXP_CORE wxStaticBox: public wxControl
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline wxStaticBox() {}
|
||||||
|
inline wxStaticBox(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxStaticBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxStaticBoxNameStr);
|
||||||
|
|
||||||
|
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
|
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
|
|
||||||
|
virtual void GetBordersForSizer(int *borderTop, int *borderOther) const;
|
||||||
|
|
||||||
|
virtual bool AcceptsFocus() const { return false; }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_STATBOX_H_
|
57
include/wx/osx/carbon/statline.h
Normal file
57
include/wx/osx/carbon/statline.h
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: mac/statline.h
|
||||||
|
// Purpose: a generic wxStaticLine class used for mac before adaptation
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Created: 28.06.99
|
||||||
|
// Version: $Id$
|
||||||
|
// Copyright: (c) 1998 Vadim Zeitlin
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_GENERIC_STATLINE_H_
|
||||||
|
#define _WX_GENERIC_STATLINE_H_
|
||||||
|
|
||||||
|
class wxStaticBox;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxStaticLine
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxStaticLine : public wxStaticLineBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// constructors and pseudo-constructors
|
||||||
|
wxStaticLine() : m_statbox(NULL) { }
|
||||||
|
|
||||||
|
wxStaticLine( wxWindow *parent,
|
||||||
|
wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
|
const wxSize &size = wxDefaultSize,
|
||||||
|
long style = wxLI_HORIZONTAL,
|
||||||
|
const wxString &name = wxStaticLineNameStr )
|
||||||
|
: m_statbox(NULL)
|
||||||
|
{
|
||||||
|
Create(parent, id, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create( wxWindow *parent,
|
||||||
|
wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
|
const wxSize &size = wxDefaultSize,
|
||||||
|
long style = wxLI_HORIZONTAL,
|
||||||
|
const wxString &name = wxStaticLineNameStr );
|
||||||
|
|
||||||
|
// it's necessary to override this wxWindow function because we
|
||||||
|
// will want to return the main widget for m_statbox
|
||||||
|
//
|
||||||
|
WXWidget GetMainWidget() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// we implement the static line using a static box
|
||||||
|
wxStaticBox *m_statbox;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxStaticLine)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_GENERIC_STATLINE_H_
|
||||||
|
|
54
include/wx/osx/carbon/stattext.h
Normal file
54
include/wx/osx/carbon/stattext.h
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: stattext.h
|
||||||
|
// Purpose: wxStaticText class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_STATTEXT_H_
|
||||||
|
#define _WX_STATTEXT_H_
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxStaticText: public wxStaticTextBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxStaticText() { }
|
||||||
|
|
||||||
|
wxStaticText(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxStaticTextNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxStaticTextNameStr);
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
void SetLabel( const wxString &str ) ;
|
||||||
|
bool SetFont( const wxFont &font );
|
||||||
|
|
||||||
|
virtual bool AcceptsFocus() const { return FALSE; }
|
||||||
|
|
||||||
|
protected :
|
||||||
|
|
||||||
|
virtual wxString DoGetLabel() const;
|
||||||
|
virtual void DoSetLabel(const wxString& str);
|
||||||
|
|
||||||
|
virtual wxSize DoGetBestSize() const ;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticText)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_STATTEXT_H_
|
43
include/wx/osx/carbon/statusbr.h
Normal file
43
include/wx/osx/carbon/statusbr.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/statusbr.h
|
||||||
|
// Purpose: native implementation of wxStatusBar.
|
||||||
|
// Optional: can use generic version instead.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_STATBAR_H_
|
||||||
|
#define _WX_STATBAR_H_
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxStatusBarMac : public wxStatusBarGeneric
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxStatusBarMac)
|
||||||
|
|
||||||
|
wxStatusBarMac();
|
||||||
|
wxStatusBarMac(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||||
|
long style = wxST_SIZEGRIP,
|
||||||
|
const wxString& name = wxStatusBarNameStr);
|
||||||
|
|
||||||
|
virtual ~wxStatusBarMac();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||||
|
long style = wxST_SIZEGRIP,
|
||||||
|
const wxString& name = wxStatusBarNameStr);
|
||||||
|
|
||||||
|
virtual void DrawFieldText(wxDC& dc, int i);
|
||||||
|
virtual void DrawField(wxDC& dc, int i);
|
||||||
|
virtual void SetStatusText(const wxString& text, int number = 0);
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
virtual void MacHiliteChanged();
|
||||||
|
void OnPaint(wxPaintEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_STATBAR_H_
|
154
include/wx/osx/carbon/tabctrl.h
Normal file
154
include/wx/osx/carbon/tabctrl.h
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: tabctrl.h
|
||||||
|
// Purpose: wxTabCtrl class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_TABCTRL_H_
|
||||||
|
#define _WX_TABCTRL_H_
|
||||||
|
|
||||||
|
#include "wx/control.h"
|
||||||
|
|
||||||
|
class wxImageList;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Flags returned by HitTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define wxTAB_HITTEST_NOWHERE 1
|
||||||
|
#define wxTAB_HITTEST_ONICON 2
|
||||||
|
#define wxTAB_HITTEST_ONLABEL 4
|
||||||
|
#define wxTAB_HITTEST_ONITEM 6
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxTabCtrl: public wxControl
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxTabCtrl)
|
||||||
|
public:
|
||||||
|
/*
|
||||||
|
* Public interface
|
||||||
|
*/
|
||||||
|
|
||||||
|
wxTabCtrl();
|
||||||
|
|
||||||
|
inline wxTabCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0, const wxString& name = wxT("tabCtrl"))
|
||||||
|
{
|
||||||
|
Create(parent, id, pos, size, style, name);
|
||||||
|
}
|
||||||
|
virtual ~wxTabCtrl();
|
||||||
|
|
||||||
|
// Accessors
|
||||||
|
|
||||||
|
// Get the selection
|
||||||
|
int GetSelection() const;
|
||||||
|
|
||||||
|
// Get the tab with the current keyboard focus
|
||||||
|
int GetCurFocus() const;
|
||||||
|
|
||||||
|
// Get the associated image list
|
||||||
|
wxImageList* GetImageList() const;
|
||||||
|
|
||||||
|
// Get the number of items
|
||||||
|
int GetItemCount() const;
|
||||||
|
|
||||||
|
// Get the rect corresponding to the tab
|
||||||
|
bool GetItemRect(int item, wxRect& rect) const;
|
||||||
|
|
||||||
|
// Get the number of rows
|
||||||
|
int GetRowCount() const;
|
||||||
|
|
||||||
|
// Get the item text
|
||||||
|
wxString GetItemText(int item) const ;
|
||||||
|
|
||||||
|
// Get the item image
|
||||||
|
int GetItemImage(int item) const;
|
||||||
|
|
||||||
|
// Get the item data
|
||||||
|
void* GetItemData(int item) const;
|
||||||
|
|
||||||
|
// Set the selection
|
||||||
|
int SetSelection(int item);
|
||||||
|
|
||||||
|
// Set the image list
|
||||||
|
void SetImageList(wxImageList* imageList);
|
||||||
|
|
||||||
|
// Set the text for an item
|
||||||
|
bool SetItemText(int item, const wxString& text);
|
||||||
|
|
||||||
|
// Set the image for an item
|
||||||
|
bool SetItemImage(int item, int image);
|
||||||
|
|
||||||
|
// Set the data for an item
|
||||||
|
bool SetItemData(int item, void* data);
|
||||||
|
|
||||||
|
// Set the size for a fixed-width tab control
|
||||||
|
void SetItemSize(const wxSize& size);
|
||||||
|
|
||||||
|
// Set the padding between tabs
|
||||||
|
void SetPadding(const wxSize& padding);
|
||||||
|
|
||||||
|
// Operations
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0, const wxString& name = wxT("tabCtrl"));
|
||||||
|
|
||||||
|
// Delete all items
|
||||||
|
bool DeleteAllItems();
|
||||||
|
|
||||||
|
// Delete an item
|
||||||
|
bool DeleteItem(int item);
|
||||||
|
|
||||||
|
// Hit test
|
||||||
|
int HitTest(const wxPoint& pt, long& flags);
|
||||||
|
|
||||||
|
// Insert an item
|
||||||
|
bool InsertItem(int item, const wxString& text, int imageId = -1, void* data = NULL);
|
||||||
|
|
||||||
|
void Command(wxCommandEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxImageList* m_imageList;
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxTabEvent : public wxNotifyEvent
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
||||||
|
int nSel = -1, int nOldSel = -1)
|
||||||
|
: wxNotifyEvent(commandType, id)
|
||||||
|
{
|
||||||
|
m_nSel = nSel;
|
||||||
|
m_nOldSel = nOldSel;
|
||||||
|
}
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
// the currently selected page (-1 if none)
|
||||||
|
int GetSelection() const { return m_nSel; }
|
||||||
|
void SetSelection(int nSel) { m_nSel = nSel; }
|
||||||
|
// the page that was selected before the change (-1 if none)
|
||||||
|
int GetOldSelection() const { return m_nOldSel; }
|
||||||
|
void SetOldSelection(int nOldSel) { m_nOldSel = nOldSel; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_nSel, // currently selected page
|
||||||
|
m_nOldSel; // previously selected page
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxTabEvent)
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&);
|
||||||
|
|
||||||
|
#define EVT_TAB_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGED, \
|
||||||
|
id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL),
|
||||||
|
#define EVT_TAB_SEL_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGING, \
|
||||||
|
id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL),
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_TABCTRL_H_
|
47
include/wx/osx/carbon/taskbarosx.h
Normal file
47
include/wx/osx/carbon/taskbarosx.h
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
// File: wx/mac/taskbarosx.h
|
||||||
|
// Purpose: Defines wxTaskBarIcon class for OSX
|
||||||
|
// Author: Ryan Norton
|
||||||
|
// Modified by:
|
||||||
|
// Created: 04/04/2003
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Ryan Norton, 2003
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _TASKBAR_H_
|
||||||
|
#define _TASKBAR_H_
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxIcon;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxMenu;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_ADV wxTaskBarIcon : public wxTaskBarIconBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxTaskBarIcon)
|
||||||
|
public:
|
||||||
|
// type of taskbar item to create (currently only DOCK is implemented)
|
||||||
|
enum wxTaskBarIconType
|
||||||
|
{
|
||||||
|
DOCK
|
||||||
|
// , CUSTOM_STATUSITEM
|
||||||
|
// , STATUSITEM
|
||||||
|
// , MENUEXTRA
|
||||||
|
, DEFAULT_TYPE = DOCK
|
||||||
|
};
|
||||||
|
|
||||||
|
wxTaskBarIcon(wxTaskBarIconType iconType = DEFAULT_TYPE);
|
||||||
|
virtual ~wxTaskBarIcon();
|
||||||
|
|
||||||
|
bool IsOk() const { return true; }
|
||||||
|
|
||||||
|
bool IsIconInstalled() const;
|
||||||
|
bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString);
|
||||||
|
bool RemoveIcon();
|
||||||
|
bool PopupMenu(wxMenu *menu);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
class wxTaskBarIconImpl* m_impl;
|
||||||
|
friend class wxTaskBarIconImpl;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
// _TASKBAR_H_
|
215
include/wx/osx/carbon/textctrl.h
Normal file
215
include/wx/osx/carbon/textctrl.h
Normal file
@@ -0,0 +1,215 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/textctrl.h
|
||||||
|
// Purpose: wxTextCtrl class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_TEXTCTRL_H_
|
||||||
|
#define _WX_TEXTCTRL_H_
|
||||||
|
|
||||||
|
#if wxUSE_SYSTEM_OPTIONS
|
||||||
|
// set this to 'true' if you want to use the 'classic' MLTE-based implementation
|
||||||
|
// instead of the HIView-based implementation in 10.3 and upwards, the former
|
||||||
|
// has more features (backgrounds etc.), but may show redraw artefacts and other
|
||||||
|
// problems depending on your usage; hence, the default is 'false'.
|
||||||
|
#define wxMAC_TEXTCONTROL_USE_MLTE wxT("mac.textcontrol-use-mlte")
|
||||||
|
// set this to 'true' if you want editable text controls to have spell checking turned
|
||||||
|
// on by default, you can change this setting individually on a control using MacCheckSpelling
|
||||||
|
#define wxMAC_TEXTCONTROL_USE_SPELL_CHECKER wxT("mac.textcontrol-use-spell-checker")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/control.h"
|
||||||
|
#include "wx/textctrl.h"
|
||||||
|
|
||||||
|
class wxMacTextControl;
|
||||||
|
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxTextCtrl: public wxTextCtrlBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxTextCtrl)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxTextCtrl()
|
||||||
|
{ Init(); }
|
||||||
|
|
||||||
|
wxTextCtrl(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxTextCtrlNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
Create(parent, id, value, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~wxTextCtrl();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxTextCtrlNameStr);
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
// ---------
|
||||||
|
virtual wxString GetValue() const;
|
||||||
|
|
||||||
|
virtual int GetLineLength(long lineNo) const;
|
||||||
|
virtual wxString GetLineText(long lineNo) const;
|
||||||
|
virtual int GetNumberOfLines() const;
|
||||||
|
|
||||||
|
virtual bool IsModified() const;
|
||||||
|
virtual bool IsEditable() const;
|
||||||
|
|
||||||
|
// If the return values from and to are the same, there is no selection.
|
||||||
|
virtual void GetSelection(long* from, long* to) const;
|
||||||
|
|
||||||
|
// operations
|
||||||
|
// ----------
|
||||||
|
|
||||||
|
// editing
|
||||||
|
virtual void Clear();
|
||||||
|
virtual void Replace(long from, long to, const wxString& value);
|
||||||
|
virtual void Remove(long from, long to);
|
||||||
|
|
||||||
|
// sets/clears the dirty flag
|
||||||
|
virtual void MarkDirty();
|
||||||
|
virtual void DiscardEdits();
|
||||||
|
|
||||||
|
// set the max number of characters which may be entered
|
||||||
|
// in a single line text control
|
||||||
|
virtual void SetMaxLength(unsigned long len);
|
||||||
|
|
||||||
|
// text control under some platforms supports the text styles: these
|
||||||
|
// methods apply the given text style to the given selection or to
|
||||||
|
// set/get the style which will be used for all appended text
|
||||||
|
virtual bool SetFont( const wxFont &font );
|
||||||
|
virtual bool SetStyle(long start, long end, const wxTextAttr& style);
|
||||||
|
virtual bool SetDefaultStyle(const wxTextAttr& style);
|
||||||
|
|
||||||
|
// writing text inserts it at the current position;
|
||||||
|
// appending always inserts it at the end
|
||||||
|
virtual void WriteText(const wxString& text);
|
||||||
|
virtual void AppendText(const wxString& text);
|
||||||
|
|
||||||
|
// translate between the position (which is just an index into the textctrl
|
||||||
|
// considering all its contents as a single strings) and (x, y) coordinates
|
||||||
|
// which represent column and line.
|
||||||
|
virtual long XYToPosition(long x, long y) const;
|
||||||
|
virtual bool PositionToXY(long pos, long *x, long *y) const;
|
||||||
|
|
||||||
|
virtual void ShowPosition(long pos);
|
||||||
|
|
||||||
|
// Clipboard operations
|
||||||
|
virtual void Copy();
|
||||||
|
virtual void Cut();
|
||||||
|
virtual void Paste();
|
||||||
|
|
||||||
|
virtual bool CanCopy() const;
|
||||||
|
virtual bool CanCut() const;
|
||||||
|
virtual bool CanPaste() const;
|
||||||
|
|
||||||
|
// Undo/redo
|
||||||
|
virtual void Undo();
|
||||||
|
virtual void Redo();
|
||||||
|
|
||||||
|
virtual bool CanUndo() const;
|
||||||
|
virtual bool CanRedo() const;
|
||||||
|
|
||||||
|
// Insertion point
|
||||||
|
virtual void SetInsertionPoint(long pos);
|
||||||
|
virtual void SetInsertionPointEnd();
|
||||||
|
virtual long GetInsertionPoint() const;
|
||||||
|
virtual wxTextPos GetLastPosition() const;
|
||||||
|
|
||||||
|
virtual void SetSelection(long from, long to);
|
||||||
|
virtual void SetEditable(bool editable);
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
// --------------
|
||||||
|
virtual void Command(wxCommandEvent& event);
|
||||||
|
|
||||||
|
virtual bool AcceptsFocus() const;
|
||||||
|
|
||||||
|
// callbacks
|
||||||
|
void OnDropFiles(wxDropFilesEvent& event);
|
||||||
|
void OnChar(wxKeyEvent& event); // Process 'enter' if required
|
||||||
|
|
||||||
|
void OnCut(wxCommandEvent& event);
|
||||||
|
void OnCopy(wxCommandEvent& event);
|
||||||
|
void OnPaste(wxCommandEvent& event);
|
||||||
|
void OnUndo(wxCommandEvent& event);
|
||||||
|
void OnRedo(wxCommandEvent& event);
|
||||||
|
void OnDelete(wxCommandEvent& event);
|
||||||
|
void OnSelectAll(wxCommandEvent& event);
|
||||||
|
|
||||||
|
void OnUpdateCut(wxUpdateUIEvent& event);
|
||||||
|
void OnUpdateCopy(wxUpdateUIEvent& event);
|
||||||
|
void OnUpdatePaste(wxUpdateUIEvent& event);
|
||||||
|
void OnUpdateUndo(wxUpdateUIEvent& event);
|
||||||
|
void OnUpdateRedo(wxUpdateUIEvent& event);
|
||||||
|
void OnUpdateDelete(wxUpdateUIEvent& event);
|
||||||
|
void OnUpdateSelectAll(wxUpdateUIEvent& event);
|
||||||
|
|
||||||
|
void OnContextMenu(wxContextMenuEvent& event);
|
||||||
|
|
||||||
|
virtual bool MacCanFocus() const
|
||||||
|
{ return true; }
|
||||||
|
|
||||||
|
virtual bool MacSetupCursor( const wxPoint& pt );
|
||||||
|
|
||||||
|
virtual void MacVisibilityChanged();
|
||||||
|
virtual void MacSuperChangedPosition();
|
||||||
|
virtual void MacCheckSpelling(bool check);
|
||||||
|
|
||||||
|
wxMacTextControl * GetPeer() const
|
||||||
|
{ return (wxMacTextControl*) m_peer; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
virtual void CreatePeer(const wxString& str, const wxPoint& pos, const wxSize& size, long style );
|
||||||
|
|
||||||
|
virtual void DoSetValue(const wxString& value, int flags = 0);
|
||||||
|
|
||||||
|
bool m_editable;
|
||||||
|
|
||||||
|
// flag is set to true when the user edits the controls contents
|
||||||
|
bool m_dirty;
|
||||||
|
|
||||||
|
// need to make this public because of the current implementation via callbacks
|
||||||
|
unsigned long m_maxLength;
|
||||||
|
|
||||||
|
bool GetTriggerOnSetValue() const
|
||||||
|
{
|
||||||
|
return m_triggerOnSetValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetTriggerOnSetValue(bool trigger)
|
||||||
|
{
|
||||||
|
m_triggerOnSetValue = trigger;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool m_triggerOnSetValue ;
|
||||||
|
|
||||||
|
private :
|
||||||
|
wxMenu *m_privateContextMenu;
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_TEXTCTRL_H_
|
104
include/wx/osx/carbon/tglbtn.h
Normal file
104
include/wx/osx/carbon/tglbtn.h
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/tglbtn.h
|
||||||
|
// Purpose: Declaration of the wxToggleButton class, which implements a
|
||||||
|
// toggle button under wxMac.
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 08.02.01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2004 Stefan Csomor
|
||||||
|
// License: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_TOGGLEBUTTON_H_
|
||||||
|
#define _WX_TOGGLEBUTTON_H_
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxCheckBoxNameStr[];
|
||||||
|
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxBitmapToggleButton : public wxToggleButtonBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxBitmapToggleButton() {}
|
||||||
|
wxBitmapToggleButton(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxBitmap& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxCheckBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxBitmap& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxCheckBoxNameStr);
|
||||||
|
|
||||||
|
virtual void SetValue(bool value);
|
||||||
|
virtual bool GetValue() const ;
|
||||||
|
|
||||||
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
|
||||||
|
virtual void Command(wxCommandEvent& event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxBitmap m_bitmap;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapToggleButton)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxToggleButton : public wxToggleButtonBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxToggleButton() {}
|
||||||
|
wxToggleButton(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxCheckBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxCheckBoxNameStr);
|
||||||
|
|
||||||
|
virtual void SetValue(bool value);
|
||||||
|
virtual bool GetValue() const ;
|
||||||
|
|
||||||
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
|
||||||
|
virtual void Command(wxCommandEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_TOGGLEBUTTON_H_
|
||||||
|
|
109
include/wx/osx/carbon/toolbar.h
Normal file
109
include/wx/osx/carbon/toolbar.h
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/toolbar.h
|
||||||
|
// Purpose: wxToolBar class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_TOOLBAR_H_
|
||||||
|
#define _WX_TOOLBAR_H_
|
||||||
|
|
||||||
|
#if wxUSE_TOOLBAR
|
||||||
|
|
||||||
|
#include "wx/tbarbase.h"
|
||||||
|
#include "wx/dynarray.h"
|
||||||
|
|
||||||
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxToolBarNameStr[];
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxToolBar: public wxToolBarBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxToolBar)
|
||||||
|
public:
|
||||||
|
/*
|
||||||
|
* Public interface
|
||||||
|
*/
|
||||||
|
|
||||||
|
wxToolBar() { Init(); }
|
||||||
|
|
||||||
|
inline wxToolBar(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxNO_BORDER|wxTB_HORIZONTAL,
|
||||||
|
const wxString& name = wxToolBarNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
Create(parent, id, pos, size, style, name);
|
||||||
|
}
|
||||||
|
virtual ~wxToolBar();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxNO_BORDER|wxTB_HORIZONTAL,
|
||||||
|
const wxString& name = wxToolBarNameStr);
|
||||||
|
|
||||||
|
virtual void SetWindowStyleFlag(long style);
|
||||||
|
|
||||||
|
// override/implement base class virtuals
|
||||||
|
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
|
||||||
|
|
||||||
|
virtual bool Show(bool show = true);
|
||||||
|
virtual bool IsShown() const;
|
||||||
|
virtual bool Realize();
|
||||||
|
|
||||||
|
virtual void SetToolBitmapSize(const wxSize& size);
|
||||||
|
virtual wxSize GetToolSize() const;
|
||||||
|
|
||||||
|
virtual void SetRows(int nRows);
|
||||||
|
|
||||||
|
virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap);
|
||||||
|
virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap);
|
||||||
|
|
||||||
|
// Add all the buttons
|
||||||
|
|
||||||
|
virtual wxString MacGetToolTipString( wxPoint &where ) ;
|
||||||
|
void OnPaint(wxPaintEvent& event) ;
|
||||||
|
void OnMouse(wxMouseEvent& event) ;
|
||||||
|
virtual void MacSuperChangedPosition() ;
|
||||||
|
|
||||||
|
#if wxMAC_USE_NATIVE_TOOLBAR
|
||||||
|
bool MacInstallNativeToolbar(bool usesNative);
|
||||||
|
bool MacWantsNativeToolbar();
|
||||||
|
bool MacTopLevelHasNativeToolbar(bool *ownToolbarInstalled) const;
|
||||||
|
#endif
|
||||||
|
protected:
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
|
||||||
|
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
|
||||||
|
|
||||||
|
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
|
||||||
|
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
|
||||||
|
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
|
||||||
|
|
||||||
|
virtual wxToolBarToolBase *CreateTool(int id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxBitmap& bmpNormal,
|
||||||
|
const wxBitmap& bmpDisabled,
|
||||||
|
wxItemKind kind,
|
||||||
|
wxObject *clientData,
|
||||||
|
const wxString& shortHelp,
|
||||||
|
const wxString& longHelp);
|
||||||
|
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
||||||
|
const wxString& label);
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
#if wxMAC_USE_NATIVE_TOOLBAR
|
||||||
|
bool m_macUsesNativeToolbar ;
|
||||||
|
void* m_macHIToolbarRef ;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // wxUSE_TOOLBAR
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_TOOLBAR_H_
|
58
include/wx/osx/carbon/tooltip.h
Normal file
58
include/wx/osx/carbon/tooltip.h
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/tooltip.h
|
||||||
|
// Purpose: wxToolTip class - tooltip control
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 31.01.99
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1999 Robert Roebling, Vadim Zeitlin, Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MAC_TOOLTIP_H_
|
||||||
|
#define _WX_MAC_TOOLTIP_H_
|
||||||
|
|
||||||
|
#include "wx/string.h"
|
||||||
|
#include "wx/event.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxToolTip : public wxObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctor & dtor
|
||||||
|
wxToolTip(const wxString &tip);
|
||||||
|
virtual ~wxToolTip();
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
// tip text
|
||||||
|
void SetTip(const wxString& tip);
|
||||||
|
const wxString& GetTip() const { return m_text; }
|
||||||
|
|
||||||
|
// the window we're associated with
|
||||||
|
void SetWindow(wxWindow *win);
|
||||||
|
wxWindow *GetWindow() const { return m_window; }
|
||||||
|
|
||||||
|
// controlling tooltip behaviour: globally change tooltip parameters
|
||||||
|
// enable or disable the tooltips globally
|
||||||
|
static void Enable(bool flag);
|
||||||
|
// set the delay after which the tooltip appears
|
||||||
|
static void SetDelay(long milliseconds);
|
||||||
|
// set the delay after which the tooltip disappears or how long the tooltip remains visible
|
||||||
|
static void SetAutoPop(long milliseconds);
|
||||||
|
// set the delay between subsequent tooltips to appear
|
||||||
|
static void SetReshow(long milliseconds);
|
||||||
|
static void NotifyWindowDelete( WXHWND win ) ;
|
||||||
|
|
||||||
|
// implementation only from now on
|
||||||
|
// -------------------------------
|
||||||
|
|
||||||
|
// should be called in response to mouse events
|
||||||
|
static void RelayEvent(wxWindow *win , wxMouseEvent &event);
|
||||||
|
static void RemoveToolTips();
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxString m_text; // tooltip text
|
||||||
|
wxWindow *m_window; // window we're associated with
|
||||||
|
DECLARE_ABSTRACT_CLASS(wxToolTip)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MAC_TOOLTIP_H_
|
86
include/wx/osx/carbon/toplevel.h
Normal file
86
include/wx/osx/carbon/toplevel.h
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/toplevel.h
|
||||||
|
// Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 20.09.01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2001 Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MSW_TOPLEVEL_H_
|
||||||
|
#define _WX_MSW_TOPLEVEL_H_
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxTopLevelWindowMac
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxTopLevelWindowMac : public wxTopLevelWindowBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// constructors and such
|
||||||
|
wxTopLevelWindowMac() { Init(); }
|
||||||
|
|
||||||
|
wxTopLevelWindowMac(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE,
|
||||||
|
const wxString& name = wxFrameNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
|
||||||
|
(void)Create(parent, id, title, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE,
|
||||||
|
const wxString& name = wxFrameNameStr);
|
||||||
|
|
||||||
|
virtual ~wxTopLevelWindowMac();
|
||||||
|
|
||||||
|
virtual wxPoint GetClientAreaOrigin() const;
|
||||||
|
|
||||||
|
// Attracts the users attention to this window if the application is
|
||||||
|
// inactive (should be called when a background event occurs)
|
||||||
|
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
||||||
|
|
||||||
|
// implement base class pure virtuals
|
||||||
|
virtual void Maximize(bool maximize = true);
|
||||||
|
virtual bool IsMaximized() const;
|
||||||
|
virtual void Iconize(bool iconize = true);
|
||||||
|
virtual bool IsIconized() const;
|
||||||
|
virtual void Restore();
|
||||||
|
|
||||||
|
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) ;
|
||||||
|
virtual bool IsFullScreen() const ;
|
||||||
|
|
||||||
|
// implementation from now on
|
||||||
|
// --------------------------
|
||||||
|
|
||||||
|
virtual void SetTitle( const wxString& title);
|
||||||
|
virtual wxString GetTitle() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
// is the frame currently iconized?
|
||||||
|
bool m_iconized;
|
||||||
|
|
||||||
|
// should the frame be maximized when it will be shown? set by Maximize()
|
||||||
|
// when it is called while the frame is hidden
|
||||||
|
bool m_maximizeOnShow;
|
||||||
|
|
||||||
|
void *m_macFullScreenData ;
|
||||||
|
private :
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MSW_TOPLEVEL_H_
|
291
include/wx/osx/carbon/treectrl.h
Normal file
291
include/wx/osx/carbon/treectrl.h
Normal file
@@ -0,0 +1,291 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/treectrl.h
|
||||||
|
// Purpose: wxTreeCtrl class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_TREECTRL_H_
|
||||||
|
#define _WX_TREECTRL_H_
|
||||||
|
|
||||||
|
#include "wx/control.h"
|
||||||
|
#include "wx/event.h"
|
||||||
|
#include "wx/imaglist.h"
|
||||||
|
|
||||||
|
#define wxTREE_MASK_HANDLE 0x0001
|
||||||
|
#define wxTREE_MASK_STATE 0x0002
|
||||||
|
#define wxTREE_MASK_TEXT 0x0004
|
||||||
|
#define wxTREE_MASK_IMAGE 0x0008
|
||||||
|
#define wxTREE_MASK_SELECTED_IMAGE 0x0010
|
||||||
|
#define wxTREE_MASK_CHILDREN 0x0020
|
||||||
|
#define wxTREE_MASK_DATA 0x0040
|
||||||
|
|
||||||
|
#define wxTREE_STATE_BOLD 0x0001
|
||||||
|
#define wxTREE_STATE_DROPHILITED 0x0002
|
||||||
|
#define wxTREE_STATE_EXPANDED 0x0004
|
||||||
|
#define wxTREE_STATE_EXPANDEDONCE 0x0008
|
||||||
|
#define wxTREE_STATE_FOCUSED 0x0010
|
||||||
|
#define wxTREE_STATE_SELECTED 0x0020
|
||||||
|
#define wxTREE_STATE_CUT 0x0040
|
||||||
|
|
||||||
|
#define wxTREE_HITTEST_ABOVE 0x0001 // Above the client area.
|
||||||
|
#define wxTREE_HITTEST_BELOW 0x0002 // Below the client area.
|
||||||
|
#define wxTREE_HITTEST_NOWHERE 0x0004 // In the client area but below the last item.
|
||||||
|
#define wxTREE_HITTEST_ONITEMBUTTON 0x0010 // On the button associated with an item.
|
||||||
|
#define wxTREE_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item.
|
||||||
|
#define wxTREE_HITTEST_ONITEMINDENT 0x0040 // In the indentation associated with an item.
|
||||||
|
#define wxTREE_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item.
|
||||||
|
#define wxTREE_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item.
|
||||||
|
#define wxTREE_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state.
|
||||||
|
#define wxTREE_HITTEST_TOLEFT 0x0400 // To the right of the client area.
|
||||||
|
#define wxTREE_HITTEST_TORIGHT 0x0800 // To the left of the client area.
|
||||||
|
|
||||||
|
#define wxTREE_HITTEST_ONITEM (wxTREE_HITTEST_ONITEMICON | wxTREE_HITTEST_ONITEMLABEL | wxTREE_HITTEST_ONITEMSTATEICON)
|
||||||
|
|
||||||
|
// Flags for GetNextItem
|
||||||
|
enum {
|
||||||
|
wxTREE_NEXT_CARET, // Retrieves the currently selected item.
|
||||||
|
wxTREE_NEXT_CHILD, // Retrieves the first child item. The hItem parameter must be NULL.
|
||||||
|
wxTREE_NEXT_DROPHILITE, // Retrieves the item that is the target of a drag-and-drop operation.
|
||||||
|
wxTREE_NEXT_FIRSTVISIBLE, // Retrieves the first visible item.
|
||||||
|
wxTREE_NEXT_NEXT, // Retrieves the next sibling item.
|
||||||
|
wxTREE_NEXT_NEXTVISIBLE, // Retrieves the next visible item that follows the specified item.
|
||||||
|
wxTREE_NEXT_PARENT, // Retrieves the parent of the specified item.
|
||||||
|
wxTREE_NEXT_PREVIOUS, // Retrieves the previous sibling item.
|
||||||
|
wxTREE_NEXT_PREVIOUSVISIBLE, // Retrieves the first visible item that precedes the specified item.
|
||||||
|
wxTREE_NEXT_ROOT // Retrieves the first child item of the root item of which the specified item is a part.
|
||||||
|
};
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
|
// Flags for InsertItem
|
||||||
|
enum {
|
||||||
|
wxTREE_INSERT_LAST = -1,
|
||||||
|
wxTREE_INSERT_FIRST = -2,
|
||||||
|
wxTREE_INSERT_SORT = -3
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxTreeItem: public wxObject
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxTreeItem)
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
long m_mask;
|
||||||
|
long m_itemId;
|
||||||
|
long m_state;
|
||||||
|
long m_stateMask;
|
||||||
|
wxString m_text;
|
||||||
|
int m_image;
|
||||||
|
int m_selectedImage;
|
||||||
|
int m_children;
|
||||||
|
long m_data;
|
||||||
|
|
||||||
|
wxTreeItem();
|
||||||
|
|
||||||
|
// Accessors
|
||||||
|
inline long GetMask() const { return m_mask; }
|
||||||
|
inline long GetItemId() const { return m_itemId; }
|
||||||
|
inline long GetState() const { return m_state; }
|
||||||
|
inline long GetStateMask() const { return m_stateMask; }
|
||||||
|
inline wxString GetText() const { return m_text; }
|
||||||
|
inline int GetImage() const { return m_image; }
|
||||||
|
inline int GetSelectedImage() const { return m_selectedImage; }
|
||||||
|
inline int GetChildren() const { return m_children; }
|
||||||
|
inline long GetData() const { return m_data; }
|
||||||
|
|
||||||
|
inline void SetMask(long mask) { m_mask = mask; }
|
||||||
|
inline void SetItemId(long id) { m_itemId = m_itemId = id; }
|
||||||
|
inline void SetState(long state) { m_state = state; }
|
||||||
|
inline void SetStateMask(long stateMask) { m_stateMask = stateMask; }
|
||||||
|
inline void GetText(const wxString& text) { m_text = text; }
|
||||||
|
inline void SetImage(int image) { m_image = image; }
|
||||||
|
inline void GetSelectedImage(int selImage) { m_selectedImage = selImage; }
|
||||||
|
inline void SetChildren(int children) { m_children = children; }
|
||||||
|
inline void SetData(long data) { m_data = data; }
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxTreeCtrl: public wxControl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*
|
||||||
|
* Public interface
|
||||||
|
*/
|
||||||
|
|
||||||
|
// creation
|
||||||
|
// --------
|
||||||
|
wxTreeCtrl();
|
||||||
|
|
||||||
|
inline wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = "wxTreeCtrl")
|
||||||
|
{
|
||||||
|
Create(parent, id, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
virtual ~wxTreeCtrl();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = "wxTreeCtrl");
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
// ---------
|
||||||
|
//
|
||||||
|
virtual unsigned int GetCount() const;
|
||||||
|
|
||||||
|
// indent
|
||||||
|
int GetIndent() const;
|
||||||
|
void SetIndent(int indent);
|
||||||
|
// image list
|
||||||
|
wxImageList *GetImageList(int which = wxIMAGE_LIST_NORMAL) const;
|
||||||
|
|
||||||
|
// navigation inside the tree
|
||||||
|
long GetNextItem(long item, int code) const;
|
||||||
|
bool ItemHasChildren(long item) const;
|
||||||
|
long GetChild(long item) const;
|
||||||
|
long GetItemParent(long item) const;
|
||||||
|
long GetFirstVisibleItem() const;
|
||||||
|
long GetNextVisibleItem(long item) const;
|
||||||
|
long GetSelection() const;
|
||||||
|
long GetRootItem() const;
|
||||||
|
|
||||||
|
// generic function for (g|s)etting item attributes
|
||||||
|
bool GetItem(wxTreeItem& info) const;
|
||||||
|
bool SetItem(wxTreeItem& info);
|
||||||
|
// item state
|
||||||
|
int GetItemState(long item, long stateMask) const;
|
||||||
|
bool SetItemState(long item, long state, long stateMask);
|
||||||
|
// item image
|
||||||
|
bool SetItemImage(long item, int image, int selImage);
|
||||||
|
// item text
|
||||||
|
wxString GetItemText(long item) const;
|
||||||
|
void SetItemText(long item, const wxString& str);
|
||||||
|
// custom data associated with the item
|
||||||
|
long GetItemData(long item) const;
|
||||||
|
bool SetItemData(long item, long data);
|
||||||
|
// convenience function
|
||||||
|
bool IsItemExpanded(long item)
|
||||||
|
{
|
||||||
|
return (GetItemState(item, wxTREE_STATE_EXPANDED) &
|
||||||
|
wxTREE_STATE_EXPANDED) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// bounding rect
|
||||||
|
bool GetItemRect(long item, wxRect& rect, bool textOnly = false) const;
|
||||||
|
//
|
||||||
|
wxTextCtrl* GetEditControl() const;
|
||||||
|
|
||||||
|
// operations
|
||||||
|
// ----------
|
||||||
|
// adding/deleting items
|
||||||
|
bool DeleteItem(long item);
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
|
wxDEPRECATED( long InsertItem(long parent, wxTreeItem& info,
|
||||||
|
long insertAfter = wxTREE_INSERT_LAST) );
|
||||||
|
// If image > -1 and selImage == -1, the same image is used for
|
||||||
|
// both selected and unselected items.
|
||||||
|
wxDEPRECATED( long InsertItem(long parent, const wxString& label,
|
||||||
|
int image = -1, int selImage = -1,
|
||||||
|
long insertAfter = wxTREE_INSERT_LAST) );
|
||||||
|
|
||||||
|
// use Expand, Collapse, CollapseAndReset or Toggle
|
||||||
|
wxDEPRECATED( bool ExpandItem(long item, int action) );
|
||||||
|
wxDEPRECATED( void SetImageList(wxImageList *imageList, int which = wxIMAGE_LIST_NORMAL) );
|
||||||
|
#endif // WXWIN_COMPATIBILITY_2_6
|
||||||
|
|
||||||
|
// changing item state
|
||||||
|
bool ExpandItem(long item) { return ExpandItem(item, wxTREE_EXPAND_EXPAND); }
|
||||||
|
bool CollapseItem(long item) { return ExpandItem(item, wxTREE_EXPAND_COLLAPSE); }
|
||||||
|
bool ToggleItem(long item) { return ExpandItem(item, wxTREE_EXPAND_TOGGLE); }
|
||||||
|
|
||||||
|
//
|
||||||
|
bool SelectItem(long item);
|
||||||
|
bool ScrollTo(long item);
|
||||||
|
bool DeleteAllItems();
|
||||||
|
|
||||||
|
// Edit the label (tree must have the focus)
|
||||||
|
wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl));
|
||||||
|
|
||||||
|
// End label editing, optionally cancelling the edit
|
||||||
|
bool EndEditLabel(bool cancel);
|
||||||
|
|
||||||
|
long HitTest(const wxPoint& point, int& flags);
|
||||||
|
// wxImageList *CreateDragImage(long item);
|
||||||
|
bool SortChildren(long item);
|
||||||
|
bool EnsureVisible(long item);
|
||||||
|
|
||||||
|
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxTextCtrl* m_textCtrl;
|
||||||
|
wxImageList* m_imageListNormal;
|
||||||
|
wxImageList* m_imageListState;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
wxEVT_COMMAND_TREE_BEGIN_DRAG,
|
||||||
|
wxEVT_COMMAND_TREE_BEGIN_RDRAG,
|
||||||
|
wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT,
|
||||||
|
wxEVT_COMMAND_TREE_END_LABEL_EDIT,
|
||||||
|
wxEVT_COMMAND_TREE_DELETE_ITEM,
|
||||||
|
wxEVT_COMMAND_TREE_GET_INFO,
|
||||||
|
wxEVT_COMMAND_TREE_SET_INFO,
|
||||||
|
wxEVT_COMMAND_TREE_ITEM_EXPANDED,
|
||||||
|
wxEVT_COMMAND_TREE_ITEM_EXPANDING,
|
||||||
|
wxEVT_COMMAND_TREE_ITEM_COLLAPSED,
|
||||||
|
wxEVT_COMMAND_TREE_ITEM_COLLAPSING,
|
||||||
|
wxEVT_COMMAND_TREE_SEL_CHANGED,
|
||||||
|
wxEVT_COMMAND_TREE_SEL_CHANGING,
|
||||||
|
wxEVT_COMMAND_TREE_KEY_DOWN
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxTreeEvent: public wxCommandEvent
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxTreeEvent)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
||||||
|
|
||||||
|
int m_code;
|
||||||
|
wxTreeItem m_item;
|
||||||
|
long m_oldItem;
|
||||||
|
wxPoint m_pointDrag;
|
||||||
|
|
||||||
|
inline long GetOldItem() const { return m_oldItem; }
|
||||||
|
inline wxTreeItem& GetItem() const { return (wxTreeItem&) m_item; }
|
||||||
|
inline wxPoint GetPoint() const { return m_pointDrag; }
|
||||||
|
inline int GetCode() const { return m_code; }
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
|
||||||
|
|
||||||
|
#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_ITEM_COLLAPSED(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_ITEM_COLLAPSING(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_TREECTRL_H_
|
49
include/wx/osx/carbon/uma.h
Normal file
49
include/wx/osx/carbon/uma.h
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mac/carbon/uma.h
|
||||||
|
// Purpose: Universal MacOS API
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 03/02/99
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef H_UMA
|
||||||
|
#define H_UMA
|
||||||
|
|
||||||
|
#include "wx/mac/private.h"
|
||||||
|
|
||||||
|
void UMAInitToolbox( UInt16 inMoreMastersCalls, bool isEmbedded) ;
|
||||||
|
long UMAGetSystemVersion() ;
|
||||||
|
|
||||||
|
#if wxUSE_GUI
|
||||||
|
|
||||||
|
// menu manager
|
||||||
|
|
||||||
|
MenuRef UMANewMenu( SInt16 id , const wxString& title , wxFontEncoding encoding) ;
|
||||||
|
void UMASetMenuTitle( MenuRef menu , const wxString& title , wxFontEncoding encoding) ;
|
||||||
|
void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item , bool enable ) ;
|
||||||
|
|
||||||
|
void UMAAppendSubMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , SInt16 submenuid ) ;
|
||||||
|
void UMAInsertSubMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , MenuItemIndex item , SInt16 submenuid ) ;
|
||||||
|
void UMAAppendMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , wxAcceleratorEntry *entry = NULL ) ;
|
||||||
|
void UMAInsertMenuItem( MenuRef menu , const wxString& title , wxFontEncoding encoding , MenuItemIndex item , wxAcceleratorEntry *entry = NULL ) ;
|
||||||
|
void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEntry *entry ) ;
|
||||||
|
|
||||||
|
void UMASetMenuItemText( MenuRef menu, MenuItemIndex item, const wxString& title , wxFontEncoding encoding ) ;
|
||||||
|
|
||||||
|
// Retrieves the Help menu handle. Warning: As a side-effect this functions also
|
||||||
|
// creates the Help menu if it didn't exist yet.
|
||||||
|
OSStatus UMAGetHelpMenu(
|
||||||
|
MenuRef * outHelpMenu,
|
||||||
|
MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */
|
||||||
|
|
||||||
|
// Same as UMAGetHelpMenu, but doesn't create the Help menu if UMAGetHelpMenu hasn't been called yet.
|
||||||
|
OSStatus UMAGetHelpMenuDontCreate(
|
||||||
|
MenuRef * outHelpMenu,
|
||||||
|
MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */
|
||||||
|
|
||||||
|
#endif // wxUSE_GUI
|
||||||
|
|
||||||
|
#endif
|
350
include/wx/osx/carbon/window.h
Normal file
350
include/wx/osx/carbon/window.h
Normal file
@@ -0,0 +1,350 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: include/wx/mac/carbon/window.h
|
||||||
|
// Purpose: wxWindowMac class
|
||||||
|
// Author: Stefan Csomor
|
||||||
|
// Modified by:
|
||||||
|
// Created: 1998-01-01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Stefan Csomor
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_WINDOW_H_
|
||||||
|
#define _WX_WINDOW_H_
|
||||||
|
|
||||||
|
#include "wx/brush.h"
|
||||||
|
#include "wx/dc.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxButton;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxNonOwnedWindow;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxMacControl ;
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxWindowMac: public wxWindowBase
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxWindowMac)
|
||||||
|
|
||||||
|
friend class wxDC;
|
||||||
|
friend class wxPaintDC;
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxWindowMac();
|
||||||
|
|
||||||
|
wxWindowMac( wxWindowMac *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxPanelNameStr );
|
||||||
|
|
||||||
|
virtual ~wxWindowMac();
|
||||||
|
|
||||||
|
bool Create( wxWindowMac *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxPanelNameStr );
|
||||||
|
|
||||||
|
// implement base class pure virtuals
|
||||||
|
virtual void SetLabel( const wxString& label );
|
||||||
|
virtual wxString GetLabel() const;
|
||||||
|
|
||||||
|
virtual void Raise();
|
||||||
|
virtual void Lower();
|
||||||
|
|
||||||
|
virtual bool Show( bool show = true );
|
||||||
|
|
||||||
|
virtual bool IsShownOnScreen() const;
|
||||||
|
|
||||||
|
virtual void SetFocus();
|
||||||
|
|
||||||
|
virtual void WarpPointer( int x, int y );
|
||||||
|
|
||||||
|
virtual void Refresh( bool eraseBackground = true,
|
||||||
|
const wxRect *rect = NULL );
|
||||||
|
|
||||||
|
virtual void Update() ;
|
||||||
|
virtual void ClearBackground();
|
||||||
|
|
||||||
|
virtual bool SetCursor( const wxCursor &cursor );
|
||||||
|
virtual bool SetFont( const wxFont &font );
|
||||||
|
virtual bool SetBackgroundColour( const wxColour &colour );
|
||||||
|
virtual bool SetForegroundColour( const wxColour &colour );
|
||||||
|
|
||||||
|
virtual int GetCharHeight() const;
|
||||||
|
virtual int GetCharWidth() const;
|
||||||
|
virtual void GetTextExtent( const wxString& string,
|
||||||
|
int *x, int *y,
|
||||||
|
int *descent = NULL,
|
||||||
|
int *externalLeading = NULL,
|
||||||
|
const wxFont *theFont = NULL )
|
||||||
|
const;
|
||||||
|
protected:
|
||||||
|
virtual void DoEnable( bool enable );
|
||||||
|
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||||
|
|
||||||
|
virtual void DoFreeze();
|
||||||
|
virtual void DoThaw();
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||||
|
int range, bool refresh = true );
|
||||||
|
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
|
||||||
|
virtual int GetScrollPos( int orient ) const;
|
||||||
|
virtual int GetScrollThumb( int orient ) const;
|
||||||
|
virtual int GetScrollRange( int orient ) const;
|
||||||
|
virtual void ScrollWindow( int dx, int dy,
|
||||||
|
const wxRect* rect = (wxRect *) NULL );
|
||||||
|
virtual void AlwaysShowScrollbars(bool horz = true, bool vert = true);
|
||||||
|
virtual bool IsScrollbarAlwaysShown(int orient) const
|
||||||
|
{
|
||||||
|
return orient == wxHORIZONTAL ? m_hScrollBarAlwaysShown
|
||||||
|
: m_vScrollBarAlwaysShown;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool Reparent( wxWindowBase *newParent );
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
|
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Accept files for dragging
|
||||||
|
virtual void DragAcceptFiles( bool accept );
|
||||||
|
|
||||||
|
// implementation from now on
|
||||||
|
// --------------------------
|
||||||
|
|
||||||
|
void MacClientToRootWindow( int *x , int *y ) const;
|
||||||
|
void MacRootWindowToClient( int *x , int *y ) const;
|
||||||
|
|
||||||
|
void MacWindowToRootWindow( int *x , int *y ) const;
|
||||||
|
void MacWindowToRootWindow( short *x , short *y ) const;
|
||||||
|
|
||||||
|
void MacRootWindowToWindow( int *x , int *y ) const;
|
||||||
|
void MacRootWindowToWindow( short *x , short *y ) const;
|
||||||
|
|
||||||
|
virtual wxString MacGetToolTipString( wxPoint &where );
|
||||||
|
|
||||||
|
// simple accessors
|
||||||
|
// ----------------
|
||||||
|
|
||||||
|
virtual WXWidget GetHandle() const;
|
||||||
|
|
||||||
|
virtual bool SetTransparent(wxByte alpha);
|
||||||
|
virtual bool CanSetTransparent();
|
||||||
|
virtual wxByte GetTransparent() const ;
|
||||||
|
|
||||||
|
// event handlers
|
||||||
|
// --------------
|
||||||
|
void OnPaint( wxPaintEvent& event );
|
||||||
|
void OnNcPaint( wxNcPaintEvent& event );
|
||||||
|
void OnEraseBackground(wxEraseEvent& event );
|
||||||
|
void OnMouseEvent( wxMouseEvent &event );
|
||||||
|
|
||||||
|
void MacOnScroll( wxScrollEvent&event );
|
||||||
|
|
||||||
|
virtual bool AcceptsFocus() const;
|
||||||
|
|
||||||
|
virtual bool IsDoubleBuffered() const { return true; }
|
||||||
|
|
||||||
|
public:
|
||||||
|
static long MacRemoveBordersFromStyle( long style ) ;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void OnInternalIdle();
|
||||||
|
|
||||||
|
// For implementation purposes:
|
||||||
|
// sometimes decorations make the client area smaller
|
||||||
|
virtual wxPoint GetClientAreaOrigin() const;
|
||||||
|
|
||||||
|
wxWindowMac *FindItem(long id) const;
|
||||||
|
wxWindowMac *FindItemByHWND(WXHWND hWnd, bool controlOnly = false) const;
|
||||||
|
|
||||||
|
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ;
|
||||||
|
virtual bool MacDoRedraw( void* updatergn , long time ) ;
|
||||||
|
virtual bool MacCanFocus() const ;
|
||||||
|
|
||||||
|
// this should not be overriden in classes above wxWindowMac
|
||||||
|
// because it is called from its destructor via DeleteChildren
|
||||||
|
virtual void RemoveChild( wxWindowBase *child );
|
||||||
|
virtual void MacPaintBorders( int left , int top ) ;
|
||||||
|
void MacPaintGrowBox();
|
||||||
|
|
||||||
|
// invalidates the borders and focus area around the control;
|
||||||
|
// must not be virtual as it will be called during destruction
|
||||||
|
void MacInvalidateBorders() ;
|
||||||
|
|
||||||
|
WXWindow MacGetTopLevelWindowRef() const ;
|
||||||
|
wxNonOwnedWindow* MacGetTopLevelWindow() const ;
|
||||||
|
|
||||||
|
virtual long MacGetLeftBorderSize() const ;
|
||||||
|
virtual long MacGetRightBorderSize() const ;
|
||||||
|
virtual long MacGetTopBorderSize() const ;
|
||||||
|
virtual long MacGetBottomBorderSize() const ;
|
||||||
|
|
||||||
|
virtual void MacSuperChangedPosition() ;
|
||||||
|
|
||||||
|
// absolute coordinates of this window's root have changed
|
||||||
|
virtual void MacTopLevelWindowChangedPosition() ;
|
||||||
|
|
||||||
|
virtual void MacChildAdded() ;
|
||||||
|
virtual void MacVisibilityChanged() ;
|
||||||
|
virtual void MacEnabledStateChanged() ;
|
||||||
|
virtual void MacHiliteChanged() ;
|
||||||
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
|
||||||
|
bool MacIsReallyEnabled() ;
|
||||||
|
bool MacIsReallyHilited() ;
|
||||||
|
|
||||||
|
bool MacIsUserPane() { return m_macIsUserPane; }
|
||||||
|
|
||||||
|
virtual bool MacSetupCursor( const wxPoint& pt ) ;
|
||||||
|
|
||||||
|
// return the rectangle that would be visible of this control,
|
||||||
|
// regardless whether controls are hidden
|
||||||
|
// only taking into account clipping by parent windows
|
||||||
|
const wxRect& MacGetClippedClientRect() const ;
|
||||||
|
const wxRect& MacGetClippedRect() const ;
|
||||||
|
const wxRect& MacGetClippedRectWithOuterStructure() const ;
|
||||||
|
|
||||||
|
// returns the visible region of this control in window ie non-client coordinates
|
||||||
|
const wxRegion& MacGetVisibleRegion( bool includeOuterStructures = false ) ;
|
||||||
|
|
||||||
|
// returns true if children have to clipped to the content area
|
||||||
|
// (e.g., scrolled windows)
|
||||||
|
bool MacClipChildren() const { return m_clipChildren ; }
|
||||||
|
void MacSetClipChildren( bool clip ) { m_clipChildren = clip ; }
|
||||||
|
|
||||||
|
// returns true if the grandchildren need to be clipped to the children's content area
|
||||||
|
// (e.g., splitter windows)
|
||||||
|
virtual bool MacClipGrandChildren() const { return false ; }
|
||||||
|
bool MacIsWindowScrollbar( const wxWindow* sb ) const
|
||||||
|
{ return ((wxWindow*)m_hScrollBar == sb || (wxWindow*)m_vScrollBar == sb) ; }
|
||||||
|
virtual bool IsClientAreaChild(const wxWindow *child) const
|
||||||
|
{
|
||||||
|
return !MacIsWindowScrollbar(child) &&
|
||||||
|
wxWindowBase::IsClientAreaChild(child);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void MacInstallEventHandler(WXWidget native) ;
|
||||||
|
void MacPostControlCreate(const wxPoint& pos, const wxSize& size) ;
|
||||||
|
wxList& GetSubcontrols() { return m_subControls; }
|
||||||
|
WXEVENTHANDLERREF MacGetControlEventHandler() { return m_macControlEventHandler ; }
|
||||||
|
|
||||||
|
// translate wxWidgets coords into ones suitable
|
||||||
|
// to be passed to CreateControl calls
|
||||||
|
//
|
||||||
|
// returns true if non-default coords are returned, false otherwise
|
||||||
|
bool MacGetBoundsForControl(const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
int& x, int& y,
|
||||||
|
int& w, int& h , bool adjustForOrigin ) const ;
|
||||||
|
|
||||||
|
// calculates the real window position and size from the native control
|
||||||
|
void MacGetPositionAndSizeFromControl(int& x, int& y,
|
||||||
|
int& w, int& h) const ;
|
||||||
|
|
||||||
|
// gets the inset from every part
|
||||||
|
virtual void MacGetContentAreaInset( int &left , int &top , int &right , int &bottom ) ;
|
||||||
|
|
||||||
|
// visibly flash the current invalid area:
|
||||||
|
// useful for debugging in OSX composited (double-buffered) situation
|
||||||
|
void MacFlashInvalidAreas() ;
|
||||||
|
|
||||||
|
// the 'true' OS level control for this wxWindow
|
||||||
|
wxMacControl* GetPeer() const { return m_peer ; }
|
||||||
|
|
||||||
|
void * MacGetCGContextRef() { return m_cgContextRef ; }
|
||||||
|
void MacSetCGContextRef(void * cg) { m_cgContextRef = cg ; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// For controls like radio buttons which are genuinely composite
|
||||||
|
wxList m_subControls;
|
||||||
|
|
||||||
|
// the peer object, allowing for cleaner API support
|
||||||
|
wxMacControl * m_peer ;
|
||||||
|
|
||||||
|
void * m_cgContextRef ;
|
||||||
|
|
||||||
|
// cache the clipped rectangles within the window hierarchy
|
||||||
|
void MacUpdateClippedRects() const ;
|
||||||
|
|
||||||
|
mutable bool m_cachedClippedRectValid ;
|
||||||
|
mutable wxRect m_cachedClippedRectWithOuterStructure ;
|
||||||
|
mutable wxRect m_cachedClippedRect ;
|
||||||
|
mutable wxRect m_cachedClippedClientRect ;
|
||||||
|
mutable wxRegion m_cachedClippedRegionWithOuterStructure ;
|
||||||
|
mutable wxRegion m_cachedClippedRegion ;
|
||||||
|
mutable wxRegion m_cachedClippedClientRegion ;
|
||||||
|
|
||||||
|
// true if is is not a native control but a wxWindow control
|
||||||
|
bool m_macIsUserPane ;
|
||||||
|
|
||||||
|
// insets of the mac control from the wx top left corner
|
||||||
|
wxPoint m_macTopLeftInset ;
|
||||||
|
wxPoint m_macBottomRightInset ;
|
||||||
|
wxByte m_macAlpha ;
|
||||||
|
|
||||||
|
wxScrollBar* m_hScrollBar ;
|
||||||
|
wxScrollBar* m_vScrollBar ;
|
||||||
|
bool m_hScrollBarAlwaysShown;
|
||||||
|
bool m_vScrollBarAlwaysShown;
|
||||||
|
wxString m_label ;
|
||||||
|
|
||||||
|
// set to true if we do a sharp clip at the content area of this window
|
||||||
|
// must be dynamic as eg a panel normally is not clipping precisely, but if
|
||||||
|
// it becomes the target window of a scrolled window it has to...
|
||||||
|
bool m_clipChildren ;
|
||||||
|
|
||||||
|
virtual bool MacIsChildOfClientArea( const wxWindow* child ) const ;
|
||||||
|
|
||||||
|
bool MacHasScrollBarCorner() const;
|
||||||
|
void MacCreateScrollBars( long style ) ;
|
||||||
|
void MacRepositionScrollBars() ;
|
||||||
|
void MacUpdateControlFont() ;
|
||||||
|
|
||||||
|
// implement the base class pure virtuals
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
virtual wxSize DoGetSizeFromClientSize( const wxSize & size ) const;
|
||||||
|
virtual void DoClientToScreen( int *x, int *y ) const;
|
||||||
|
virtual void DoScreenToClient( int *x, int *y ) const;
|
||||||
|
virtual void DoGetPosition( int *x, int *y ) const;
|
||||||
|
virtual void DoGetSize( int *width, int *height ) const;
|
||||||
|
virtual void DoGetClientSize( int *width, int *height ) const;
|
||||||
|
virtual void DoSetSize(int x, int y,
|
||||||
|
int width, int height,
|
||||||
|
int sizeFlags = wxSIZE_AUTO);
|
||||||
|
virtual void DoSetClientSize(int width, int height);
|
||||||
|
|
||||||
|
virtual void DoCaptureMouse();
|
||||||
|
virtual void DoReleaseMouse();
|
||||||
|
|
||||||
|
// move the window to the specified location and resize it: this is called
|
||||||
|
// from both DoSetSize() and DoSetClientSize() and would usually just call
|
||||||
|
// ::MoveWindow() except for composite controls which will want to arrange
|
||||||
|
// themselves inside the given rectangle
|
||||||
|
virtual void DoMoveWindow( int x, int y, int width, int height );
|
||||||
|
virtual void DoSetWindowVariant( wxWindowVariant variant );
|
||||||
|
|
||||||
|
#if wxUSE_TOOLTIPS
|
||||||
|
virtual void DoSetToolTip( wxToolTip *tip );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
// show/hide scrollbars as needed, common part of SetScrollbar() and
|
||||||
|
// AlwaysShowScrollbars()
|
||||||
|
void DoUpdateScrollbarVisibility();
|
||||||
|
|
||||||
|
|
||||||
|
WXEVENTHANDLERREF m_macControlEventHandler ;
|
||||||
|
|
||||||
|
DECLARE_NO_COPY_CLASS(wxWindowMac)
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_WINDOW_H_
|
5
include/wx/osx/checkbox.h
Normal file
5
include/wx/osx/checkbox.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
#include "wx/mac/classic/checkbox.h"
|
||||||
|
#else
|
||||||
|
#include "wx/mac/carbon/checkbox.h"
|
||||||
|
#endif
|
5
include/wx/osx/checklst.h
Normal file
5
include/wx/osx/checklst.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
#include "wx/mac/classic/checklst.h"
|
||||||
|
#else
|
||||||
|
#include "wx/mac/carbon/checklst.h"
|
||||||
|
#endif
|
34
include/wx/osx/chkconf.h
Normal file
34
include/wx/osx/chkconf.h
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Name: wx/mac/chkconf.h
|
||||||
|
* Purpose: Mac-specific config settings checks
|
||||||
|
* Author: Vadim Zeitlin
|
||||||
|
* Modified by:
|
||||||
|
* Created: 2005-04-05 (extracted from wx/chkconf.h)
|
||||||
|
* RCS-ID: $Id$
|
||||||
|
* Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||||
|
* Licence: wxWindows licence
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
|
||||||
|
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
# if !TARGET_CARBON
|
||||||
|
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||||
|
# error "wxUSE_UNICODE is only supported for Carbon Targets."
|
||||||
|
# else
|
||||||
|
# define wxUSE_UNICODE 0
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_STACKWALKER
|
||||||
|
/* not supported under Mac */
|
||||||
|
# undef wxUSE_STACKWALKER
|
||||||
|
# define wxUSE_STACKWALKER 0
|
||||||
|
#endif /* wxUSE_STACKWALKER */
|
||||||
|
|
||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
# include "wx/mac/classic/chkconf.h"
|
||||||
|
#else
|
||||||
|
# include "wx/mac/carbon/chkconf.h"
|
||||||
|
#endif
|
5
include/wx/osx/choice.h
Normal file
5
include/wx/osx/choice.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
#include "wx/mac/classic/choice.h"
|
||||||
|
#else
|
||||||
|
#include "wx/mac/carbon/choice.h"
|
||||||
|
#endif
|
5
include/wx/osx/clipbrd.h
Normal file
5
include/wx/osx/clipbrd.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
#include "wx/mac/classic/clipbrd.h"
|
||||||
|
#else
|
||||||
|
#include "wx/mac/carbon/clipbrd.h"
|
||||||
|
#endif
|
6
include/wx/osx/colordlg.h
Normal file
6
include/wx/osx/colordlg.h
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#ifdef __WXMAC_CLASSIC__
|
||||||
|
#include "wx/mac/classic/colordlg.h"
|
||||||
|
#else
|
||||||
|
#include "wx/mac/carbon/colordlg.h"
|
||||||
|
#endif
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user