first pass of wxUniv merge - nothing works, most parts don't even compile
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,21 +1,117 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/accel.h
|
||||
// Purpose: wxAcceleratorEntry and wxAcceleratorTable classes
|
||||
// Author: Julian Smart, Robert Roebling, Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 31.05.01 (extracted from other files)
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_ACCEL_H_BASE_
|
||||
#define _WX_ACCEL_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/accel.h"
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorTable;
|
||||
class WXDLLEXPORT wxMenuItem;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// wxAcceleratorEntry flags
|
||||
enum
|
||||
{
|
||||
wxACCEL_NORMAL = 0x0000, // no modifiers
|
||||
wxACCEL_ALT = 0x0001, // hold Alt key down
|
||||
wxACCEL_CTRL = 0x0002, // hold Ctrl key down
|
||||
wxACCEL_SHIFT = 0x0004 // hold Shift key down
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// an entry in wxAcceleratorTable corresponds to one accelerator
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorEntry
|
||||
{
|
||||
public:
|
||||
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0,
|
||||
wxMenuItem *item = NULL)
|
||||
{
|
||||
Set(flags, keyCode, cmd, item);
|
||||
}
|
||||
|
||||
void Set(int flags, int keyCode, int cmd, wxMenuItem *item = NULL)
|
||||
{
|
||||
m_flags = flags;
|
||||
m_keyCode = keyCode;
|
||||
m_command = cmd;
|
||||
m_item = item;
|
||||
}
|
||||
|
||||
void SetMenuItem(wxMenuItem *item) { m_item = item; }
|
||||
|
||||
int GetFlags() const { return m_flags; }
|
||||
int GetKeyCode() const { return m_keyCode; }
|
||||
int GetCommand() const { return m_command; }
|
||||
|
||||
wxMenuItem *GetMenuItem() const { return m_item; }
|
||||
|
||||
bool operator==(const wxAcceleratorEntry& entry) const
|
||||
{
|
||||
return m_flags == entry.m_flags &&
|
||||
m_keyCode == entry.m_keyCode &&
|
||||
m_command == entry.m_command &&
|
||||
m_item == entry.m_item;
|
||||
}
|
||||
|
||||
bool operator!=(const wxAcceleratorEntry& entry) const
|
||||
{ return !(*this == entry); }
|
||||
|
||||
private:
|
||||
int m_flags; // combination of wxACCEL_XXX constants
|
||||
int m_keyCode; // ASCII or virtual keycode
|
||||
int m_command; // Command id to generate
|
||||
|
||||
// the menu item this entry corresponds to, may be NULL
|
||||
wxMenuItem *m_item;
|
||||
|
||||
// for compatibility with old code, use accessors now!
|
||||
friend class WXDLLEXPORT wxMenu;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include wxAcceleratorTable class declaration, it is only used by the library
|
||||
// and so doesn't have any published user visible interface
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/generic/accel.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/accel.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/accel.h"
|
||||
#include "wx/motif/accel.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/accel.h"
|
||||
#include "wx/gtk/accel.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/accel.h"
|
||||
#include "wx/qt/accel.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/accel.h"
|
||||
#include "wx/mac/accel.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/accel.h"
|
||||
#include "wx/os2/accel.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/accel.h"
|
||||
#include "wx/stubs/accel.h"
|
||||
#endif
|
||||
|
||||
WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable;
|
||||
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
#endif
|
||||
// _WX_ACCEL_H_BASE_
|
||||
|
@@ -59,6 +59,8 @@ static const int wxPRINT_POSTSCRIPT = 2;
|
||||
class WXDLLEXPORT wxAppBase : public wxEvtHandler
|
||||
{
|
||||
public:
|
||||
wxAppBase();
|
||||
|
||||
// the virtual functions which may/must be overridden in the derived class
|
||||
// -----------------------------------------------------------------------
|
||||
#ifdef __WXMAC_X__
|
||||
@@ -80,7 +82,7 @@ public:
|
||||
// depend on the toolkit. default version does nothing.
|
||||
//
|
||||
// Override: rarely.
|
||||
virtual bool OnInitGui() { return TRUE; }
|
||||
virtual bool OnInitGui();
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
// called to start program execution - the default version just enters
|
||||
@@ -165,6 +167,9 @@ public:
|
||||
// top level window functions
|
||||
// --------------------------
|
||||
|
||||
// return TRUE if our app has focus
|
||||
virtual bool IsActive() const { return m_isActive; }
|
||||
|
||||
// set the "main" top level window
|
||||
void SetTopWindow(wxWindow *win) { m_topWindow = win; }
|
||||
|
||||
@@ -200,11 +205,11 @@ public:
|
||||
// object) - this log object is used by default by all wxLogXXX()
|
||||
// functions.
|
||||
virtual wxLog *CreateLogTarget()
|
||||
#if wxUSE_GUI
|
||||
{ return new wxLogGui; }
|
||||
#else // !GUI
|
||||
{ return new wxLogStderr; }
|
||||
#endif // wxUSE_GUI
|
||||
#if wxUSE_GUI && wxUSE_LOGGUI
|
||||
{ return new wxLogGui; }
|
||||
#else // !GUI
|
||||
{ return new wxLogStderr; }
|
||||
#endif // wxUSE_GUI
|
||||
#endif // wxUSE_LOG
|
||||
|
||||
#if wxUSE_GUI
|
||||
@@ -227,6 +232,11 @@ public:
|
||||
// printing.
|
||||
virtual void SetPrintMode(int WXUNUSED(mode)) { }
|
||||
int GetPrintMode() const { return wxPRINT_POSTSCRIPT; }
|
||||
|
||||
// called by toolkit-specific code to set the app status: active (we have
|
||||
// focus) or not and also the last window which had focus before we were
|
||||
// deactivated
|
||||
virtual void SetActive(bool isActive, wxWindow *lastFocus);
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
// implementation only from now on
|
||||
@@ -245,7 +255,6 @@ public:
|
||||
int argc;
|
||||
wxChar **argv;
|
||||
|
||||
//private:
|
||||
protected:
|
||||
// function used for dynamic wxApp creation
|
||||
static wxAppInitializerFunction m_appInitFn;
|
||||
@@ -255,19 +264,22 @@ protected:
|
||||
m_appName, // app name
|
||||
m_className; // class name
|
||||
|
||||
// if TRUE, exit the main loop when the last top level window is deleted
|
||||
bool m_exitOnFrameDelete;
|
||||
|
||||
// TRUE if the application wants to get debug output
|
||||
bool m_wantDebugOutput;
|
||||
|
||||
#if wxUSE_GUI
|
||||
// the main top level window - may be NULL
|
||||
wxWindow *m_topWindow;
|
||||
|
||||
// if TRUE, exit the main loop when the last top level window is deleted
|
||||
bool m_exitOnFrameDelete;
|
||||
|
||||
// TRUE if the apps whats to use the best visual on systems where
|
||||
// more than one are available (Sun, SGI, XFree86 4.0 ?)
|
||||
bool m_useBestVisual;
|
||||
|
||||
#if wxUSE_GUI
|
||||
// the main top level window - may be NULL
|
||||
wxWindow *m_topWindow;
|
||||
// does any of our windows has focus?
|
||||
bool m_isActive;
|
||||
#endif // wxUSE_GUI
|
||||
};
|
||||
|
||||
@@ -280,6 +292,8 @@ protected:
|
||||
#include "wx/msw/app.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/app.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/app.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/app.h"
|
||||
#elif defined(__WXGTK__)
|
||||
|
@@ -1,12 +1,164 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/bitmap.h
|
||||
// Purpose: wxBitmap class interface
|
||||
// Author: Vaclav Slavik
|
||||
// Modified by:
|
||||
// Created: 22.04.01
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BITMAP_H_BASE_
|
||||
#define _WX_BITMAP_H_BASE_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "bitmapbase.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/palette.h"
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
class WXDLLEXPORT wxImage;
|
||||
class WXDLLEXPORT wxMask;
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
class WXDLLEXPORT wxBitmapHandler;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapHandler: class which knows how to create/load/save bitmaps in
|
||||
// different formats
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxBitmapHandlerBase : public wxObject
|
||||
{
|
||||
public:
|
||||
wxBitmapHandlerBase()
|
||||
{
|
||||
m_type = wxBITMAP_TYPE_INVALID;
|
||||
}
|
||||
|
||||
virtual ~wxBitmapHandlerBase() { }
|
||||
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags,
|
||||
int width, int height, int depth = 1) = 0;
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||
int desiredWidth, int desiredHeight) = 0;
|
||||
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
|
||||
int type, const wxPalette *palette = NULL) = 0;
|
||||
|
||||
void SetName(const wxString& name) { m_name = name; }
|
||||
void SetExtension(const wxString& ext) { m_extension = ext; }
|
||||
void SetType(wxBitmapType type) { m_type = type; }
|
||||
wxString GetName() const { return m_name; }
|
||||
wxString GetExtension() const { return m_extension; }
|
||||
wxBitmapType GetType() const { return m_type; }
|
||||
|
||||
protected:
|
||||
wxString m_name;
|
||||
wxString m_extension;
|
||||
wxBitmapType m_type;
|
||||
|
||||
DECLARE_ABSTRACT_CLASS(wxBitmapHandlerBase)
|
||||
};
|
||||
|
||||
|
||||
|
||||
class WXDLLEXPORT wxBitmapBase : public wxGDIObject
|
||||
{
|
||||
public:
|
||||
wxBitmapBase() : wxGDIObject() {}
|
||||
virtual ~wxBitmapBase() {}
|
||||
|
||||
/*
|
||||
Derived class must implement these:
|
||||
|
||||
wxBitmap();
|
||||
wxBitmap(int width, int height, int depth = -1);
|
||||
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
||||
wxBitmap(const char **bits);
|
||||
wxBitmap(char **bits);
|
||||
wxBitmap(const wxBitmap& bmp);
|
||||
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
|
||||
wxBitmap(const wxImage& image, int depth = -1);
|
||||
wxBitmap& operator = (const wxBitmap& bmp);
|
||||
bool operator == (const wxBitmap& bmp) const;
|
||||
bool operator != (const wxBitmap& bmp) const;
|
||||
|
||||
bool Create(int width, int height, int depth = -1);
|
||||
|
||||
static void InitStandardHandlers();
|
||||
*/
|
||||
|
||||
virtual bool Ok() const = 0;
|
||||
|
||||
virtual int GetHeight() const = 0;
|
||||
virtual int GetWidth() const = 0;
|
||||
virtual int GetDepth() const = 0;
|
||||
|
||||
virtual wxImage ConvertToImage() const = 0;
|
||||
|
||||
virtual wxMask *GetMask() const = 0;
|
||||
virtual void SetMask(wxMask *mask) = 0;
|
||||
|
||||
virtual wxBitmap GetSubBitmap(const wxRect& rect) const = 0;
|
||||
|
||||
virtual bool SaveFile(const wxString &name, wxBitmapType type,
|
||||
const wxPalette *palette = (wxPalette *)NULL) const = 0;
|
||||
virtual bool LoadFile(const wxString &name, wxBitmapType type) = 0;
|
||||
|
||||
virtual wxPalette *GetPalette() const = 0;
|
||||
virtual void SetPalette(const wxPalette& palette) = 0;
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxPalette *GetColourMap() const { return GetPalette(); }
|
||||
void SetColourMap(wxPalette *cmap) { SetPalette(*cmap); };
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
virtual bool CopyFromIcon(const wxIcon& icon) = 0;
|
||||
|
||||
// implementation:
|
||||
virtual void SetHeight(int height) = 0;
|
||||
virtual void SetWidth(int width) = 0;
|
||||
virtual void SetDepth(int depth) = 0;
|
||||
|
||||
// Format handling
|
||||
static inline wxList& GetHandlers() { return sm_handlers; }
|
||||
static void AddHandler(wxBitmapHandlerBase *handler);
|
||||
static void InsertHandler(wxBitmapHandlerBase *handler);
|
||||
static bool RemoveHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& extension, wxBitmapType bitmapType);
|
||||
static wxBitmapHandler *FindHandler(wxBitmapType bitmapType);
|
||||
|
||||
//static void InitStandardHandlers();
|
||||
// (wxBitmap must implement this one)
|
||||
|
||||
static void CleanUpHandlers();
|
||||
|
||||
protected:
|
||||
static wxList sm_handlers;
|
||||
|
||||
DECLARE_ABSTRACT_CLASS(wxBitmapBase)
|
||||
};
|
||||
|
||||
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/bitmap.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/bitmap.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/bitmap.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/bitmap.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/bitmap.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@@ -1,20 +1,94 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/bmpbutton.h
|
||||
// Purpose: wxBitmapButton class interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 25.08.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BMPBUTTON_H_BASE_
|
||||
#define _WX_BMPBUTTON_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/bmpbuttn.h"
|
||||
#if wxUSE_BMPBUTTON
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/button.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapButton: a button which shows bitmaps instead of the usual string.
|
||||
// It has different bitmaps for different states (focused/disabled/pressed)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxBitmapButtonBase : public wxButton
|
||||
{
|
||||
public:
|
||||
wxBitmapButtonBase() { m_marginX = m_marginY = 0; }
|
||||
|
||||
// set the bitmaps
|
||||
void SetBitmapLabel(const wxBitmap& bitmap)
|
||||
{ m_bmpNormal = bitmap; OnSetBitmap(); }
|
||||
void SetBitmapSelected(const wxBitmap& sel)
|
||||
{ m_bmpSelected = sel; OnSetBitmap(); };
|
||||
void SetBitmapFocus(const wxBitmap& focus)
|
||||
{ m_bmpFocus = focus; OnSetBitmap(); };
|
||||
void SetBitmapDisabled(const wxBitmap& disabled)
|
||||
{ m_bmpDisabled = disabled; OnSetBitmap(); };
|
||||
void SetLabel(const wxBitmap& bitmap)
|
||||
{ SetBitmapLabel(bitmap); }
|
||||
|
||||
// retrieve the bitmaps
|
||||
const wxBitmap& GetBitmapLabel() const { return m_bmpNormal; }
|
||||
const wxBitmap& GetBitmapSelected() const { return m_bmpSelected; }
|
||||
const wxBitmap& GetBitmapFocus() const { return m_bmpFocus; }
|
||||
const wxBitmap& GetBitmapDisabled() const { return m_bmpDisabled; }
|
||||
wxBitmap& GetBitmapLabel() { return m_bmpNormal; }
|
||||
wxBitmap& GetBitmapSelected() { return m_bmpSelected; }
|
||||
wxBitmap& GetBitmapFocus() { return m_bmpFocus; }
|
||||
wxBitmap& GetBitmapDisabled() { return m_bmpDisabled; }
|
||||
|
||||
// set/get the margins around the button
|
||||
virtual void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
|
||||
int GetMarginX() const { return m_marginX; }
|
||||
int GetMarginY() const { return m_marginY; }
|
||||
|
||||
protected:
|
||||
// function called when any of the bitmaps changes
|
||||
virtual void OnSetBitmap() { }
|
||||
|
||||
// the bitmaps for various states
|
||||
wxBitmap m_bmpNormal,
|
||||
m_bmpSelected,
|
||||
m_bmpFocus,
|
||||
m_bmpDisabled;
|
||||
|
||||
// the margins around the bitmap
|
||||
int m_marginX,
|
||||
m_marginY;
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/bmpbuttn.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/bmpbuttn.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/bmpbuttn.h"
|
||||
#include "wx/motif/bmpbuttn.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/bmpbuttn.h"
|
||||
#include "wx/gtk/bmpbuttn.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/bmpbuttn.h"
|
||||
#include "wx/qt/bmpbuttn.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/bmpbuttn.h"
|
||||
#include "wx/mac/bmpbuttn.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/bmpbuttn.h"
|
||||
#include "wx/os2/bmpbuttn.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/bmpbuttn.h"
|
||||
#include "wx/stubs/bmpbuttn.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // wxUSE_BMPBUTTON
|
||||
|
||||
#endif // _WX_BMPBUTTON_H_BASE_
|
||||
|
@@ -7,6 +7,8 @@
|
||||
#include "wx/motif/brush.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/brush.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/brush.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/brush.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@@ -1,21 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/button.h
|
||||
// Purpose: wxButtonBase class
|
||||
// Author: Vadim Zetlin
|
||||
// Modified by:
|
||||
// Created: 15.08.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Vadim Zetlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BUTTON_H_BASE_
|
||||
#define _WX_BUTTON_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/button.h"
|
||||
#if wxUSE_BUTTON
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxButton: a push button
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxButtonBase : public wxControl
|
||||
{
|
||||
public:
|
||||
// show the image in the button in addition to the label
|
||||
virtual void SetImageLabel(const wxBitmap& bitmap) { }
|
||||
|
||||
// set the margins around the image
|
||||
virtual void SetImageMargins(wxCoord x, wxCoord y) { }
|
||||
|
||||
// this wxButton method is called when the button becomes the default one
|
||||
// on its panel
|
||||
virtual void SetDefault() { }
|
||||
|
||||
// returns the default button size for this platform
|
||||
static wxSize GetDefaultSize();
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/button.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/button.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/button.h"
|
||||
#include "wx/motif/button.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/button.h"
|
||||
#include "wx/gtk/button.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/button.h"
|
||||
#include "wx/qt/button.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/button.h"
|
||||
#include "wx/mac/button.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/button.h"
|
||||
#include "wx/os2/button.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/button.h"
|
||||
#include "wx/stubs/button.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_BUTTON
|
||||
|
||||
#endif
|
||||
// _WX_BUTTON_H_BASE_
|
||||
|
@@ -16,8 +16,12 @@
|
||||
2. background bitmap for the calendar?
|
||||
*/
|
||||
|
||||
#ifndef _WX_CALCTRL_H
|
||||
#define _WX_CALCTRL_H
|
||||
#ifndef _WX_CALCTRL_H_
|
||||
#define _WX_CALCTRL_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_CALENDARCTRL
|
||||
|
||||
#include "wx/datetime.h"
|
||||
|
||||
@@ -172,4 +176,7 @@ typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&);
|
||||
#define EVT_CALENDAR_YEAR(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_YEAR_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxCalendarEventFunction) & fn, (wxObject *) NULL),
|
||||
#define EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_WEEKDAY_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxCalendarEventFunction) & fn, (wxObject *) NULL),
|
||||
|
||||
#endif // _WX_CALCTRL_H
|
||||
#endif // wxUSE_CALENDARCTRL
|
||||
|
||||
#endif // _WX_CALCTRL_H_
|
||||
|
||||
|
@@ -12,6 +12,10 @@
|
||||
#ifndef _WX_CARET_H_BASE_
|
||||
#define _WX_CARET_H_BASE_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_CARET
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "caret.h"
|
||||
#endif
|
||||
@@ -222,5 +226,7 @@ private:
|
||||
wxCaret *m_caret;
|
||||
};
|
||||
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
#endif // _WX_CARET_H_BASE_
|
||||
|
||||
|
@@ -1,21 +1,56 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/checkbox.h
|
||||
// Purpose: wxCheckBox class interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 07.09.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CHECKBOX_H_BASE_
|
||||
#define _WX_CHECKBOX_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/checkbox.h"
|
||||
#if wxUSE_CHECKBOX
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxCheckBoxNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCheckBox: a control which shows a label and a box which may be checked
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxCheckBoxBase : public wxControl
|
||||
{
|
||||
public:
|
||||
// set/get the checked status of the listbox
|
||||
virtual void SetValue(bool value) = 0;
|
||||
virtual bool GetValue() const = 0;
|
||||
|
||||
bool IsChecked() const { return GetValue(); }
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/checkbox.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/checkbox.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/checkbox.h"
|
||||
#include "wx/motif/checkbox.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/checkbox.h"
|
||||
#include "wx/gtk/checkbox.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/checkbox.h"
|
||||
#include "wx/qt/checkbox.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/checkbox.h"
|
||||
#include "wx/mac/checkbox.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/checkbox.h"
|
||||
#include "wx/os2/checkbox.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/checkbox.h"
|
||||
#include "wx/stubs/checkbox.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_CHECKBOX
|
||||
|
||||
#endif
|
||||
// _WX_CHECKBOX_H_BASE_
|
||||
|
@@ -1,21 +1,52 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/checklst.h
|
||||
// Purpose: wxCheckListBox class interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 12.09.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CHECKLST_H_BASE_
|
||||
#define _WX_CHECKLST_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/checklst.h"
|
||||
#if wxUSE_CHECKLISTBOX
|
||||
|
||||
#include "wx/listbox.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCheckListBox: a listbox whose items may be checked
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxCheckListBoxBase : public wxListBox
|
||||
{
|
||||
public:
|
||||
// check list box specific methods
|
||||
virtual bool IsChecked(size_t item) const = 0;
|
||||
virtual void Check(size_t item, bool check = TRUE) = 0;
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/checklst.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/checklst.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/checklst.h"
|
||||
#include "wx/motif/checklst.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/checklst.h"
|
||||
#include "wx/gtk/checklst.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/checklst.h"
|
||||
#include "wx/qt/checklst.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/checklst.h"
|
||||
#include "wx/mac/checklst.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/checklst.h"
|
||||
#include "wx/os2/checklst.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/checklst.h"
|
||||
#include "wx/stubs/checklst.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_CHECKLISTBOX
|
||||
|
||||
#endif
|
||||
// _WX_CHECKLST_H_BASE_
|
||||
|
604
include/wx/chkconf.h
Normal file
604
include/wx/chkconf.h
Normal file
@@ -0,0 +1,604 @@
|
||||
/*
|
||||
* Name: wx/chkconf.h
|
||||
* Purpose: check the config settings for consistency
|
||||
* Author: Vadim Zeitlin
|
||||
* Modified by:
|
||||
* Created: 09.08.00
|
||||
* RCS-ID: $Id$
|
||||
* Copyright: (c) 2000 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
* Licence: wxWindows license
|
||||
*/
|
||||
|
||||
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
|
||||
|
||||
/*
|
||||
this global setting determintes what should we do if the setting FOO
|
||||
requires BAR and BAR is not set: we can either silently define BAR
|
||||
(default, recommended) or give an error and abort (mainly useful for
|
||||
developpers only)
|
||||
*/
|
||||
#define wxABORT_ON_CONFIG_ERROR
|
||||
|
||||
/*
|
||||
all these tests are for GUI onlu
|
||||
*/
|
||||
#if wxUSE_GUI
|
||||
|
||||
/*
|
||||
all of the settings tested below must be defined or we'd get an error from
|
||||
preprocessor about invalid integer expression
|
||||
*/
|
||||
|
||||
#ifndef wxUSE_ACCEL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_ACCEL must be defined."
|
||||
# else
|
||||
# define wxUSE_ACCEL 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_ACCEL) */
|
||||
|
||||
#ifndef wxUSE_BMPBUTTON
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_BMPBUTTON must be defined."
|
||||
# else
|
||||
# define wxUSE_BMPBUTTON 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_BMPBUTTON) */
|
||||
|
||||
#ifndef wxUSE_BUTTON
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_BUTTON must be defined."
|
||||
# else
|
||||
# define wxUSE_BUTTON 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_BUTTON) */
|
||||
|
||||
#ifndef wxUSE_CALENDARCTRL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_CALENDARCTRL must be defined."
|
||||
# else
|
||||
# define wxUSE_CALENDARCTRL 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_CALENDARCTRL) */
|
||||
|
||||
#ifndef wxUSE_CARET
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_CARET must be defined."
|
||||
# else
|
||||
# define wxUSE_CARET 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_CARET) */
|
||||
|
||||
#ifndef wxUSE_CHECKBOX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_CHECKBOX must be defined."
|
||||
# else
|
||||
# define wxUSE_CHECKBOX 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_CHECKBOX) */
|
||||
|
||||
#ifndef wxUSE_CHECKLISTBOX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_CHECKLISTBOX must be defined."
|
||||
# else
|
||||
# define wxUSE_CHECKLISTBOX 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_CHECKLISTBOX) */
|
||||
|
||||
#ifndef wxUSE_CHOICE
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_CHOICE must be defined."
|
||||
# else
|
||||
# define wxUSE_CHOICE 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_CHOICE) */
|
||||
|
||||
#ifndef wxUSE_CLIPBOARD
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_CLIPBOARD must be defined."
|
||||
# else
|
||||
# define wxUSE_CLIPBOARD 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_CLIPBOARD) */
|
||||
|
||||
#ifndef wxUSE_COMBOBOX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_COMBOBOX must be defined."
|
||||
# else
|
||||
# define wxUSE_COMBOBOX 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_COMBOBOX) */
|
||||
|
||||
#ifndef wxUSE_DATAOBJ
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_DATAOBJ must be defined."
|
||||
# else
|
||||
# define wxUSE_DATAOBJ 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_DATAOBJ) */
|
||||
|
||||
#ifndef wxUSE_FILEDLG
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_FILEDLG must be defined."
|
||||
# else
|
||||
# define wxUSE_FILEDLG 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_FILEDLG) */
|
||||
|
||||
#ifndef wxUSE_FONTDLG
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_FONTDLG must be defined."
|
||||
# else
|
||||
# define wxUSE_FONTDLG 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_FONTDLG) */
|
||||
|
||||
#ifndef wxUSE_FONTMAP
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_FONTMAP must be defined."
|
||||
# else
|
||||
# define wxUSE_FONTMAP 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_FONTMAP) */
|
||||
|
||||
#ifndef wxUSE_GAUGE
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_GAUGE must be defined."
|
||||
# else
|
||||
# define wxUSE_GAUGE 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_GAUGE) */
|
||||
|
||||
#ifndef wxUSE_GRID
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_GRID must be defined."
|
||||
# else
|
||||
# define wxUSE_GRID 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_GRID) */
|
||||
|
||||
#ifndef wxUSE_IMAGLIST
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_IMAGLIST must be defined."
|
||||
# else
|
||||
# define wxUSE_IMAGLIST 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_IMAGLIST) */
|
||||
|
||||
#ifndef wxUSE_LISTBOX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_LISTBOX must be defined."
|
||||
# else
|
||||
# define wxUSE_LISTBOX 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_LISTBOX) */
|
||||
|
||||
#ifndef wxUSE_LISTCTRL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_LISTCTRL must be defined."
|
||||
# else
|
||||
# define wxUSE_LISTCTRL 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_LISTCTRL) */
|
||||
|
||||
#ifndef wxUSE_MDI_ARCHITECTURE
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_MDI_ARCHITECTURE must be defined."
|
||||
# else
|
||||
# define wxUSE_MDI_ARCHITECTURE 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_MDI_ARCHITECTURE) */
|
||||
|
||||
#ifndef wxUSE_MENUS
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_MENUS must be defined."
|
||||
# else
|
||||
# define wxUSE_MENUS 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_MENUS) */
|
||||
|
||||
#ifndef wxUSE_MIMETYPE
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_MIMETYPE must be defined."
|
||||
# else
|
||||
# define wxUSE_MIMETYPE 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_MIMETYPE) */
|
||||
|
||||
#ifndef wxUSE_NEW_GRID
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_NEW_GRID must be defined."
|
||||
# else
|
||||
# define wxUSE_NEW_GRID 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_NEW_GRID) */
|
||||
|
||||
#ifndef wxUSE_NOTEBOOK
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_NOTEBOOK must be defined."
|
||||
# else
|
||||
# define wxUSE_NOTEBOOK 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_NOTEBOOK) */
|
||||
|
||||
#ifndef wxUSE_POPUPWIN
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_POPUPWIN must be defined."
|
||||
# else
|
||||
# define wxUSE_POPUPWIN 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_POPUPWIN) */
|
||||
|
||||
#ifndef wxUSE_RADIOBOX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_RADIOBOX must be defined."
|
||||
# else
|
||||
# define wxUSE_RADIOBOX 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_RADIOBOX) */
|
||||
|
||||
#ifndef wxUSE_RADIOBTN
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_RADIOBTN must be defined."
|
||||
# else
|
||||
# define wxUSE_RADIOBTN 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_RADIOBTN) */
|
||||
|
||||
#ifndef wxUSE_SASH
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_SASH must be defined."
|
||||
# else
|
||||
# define wxUSE_SASH 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_SASH) */
|
||||
|
||||
#ifndef wxUSE_SCROLLBAR
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_SCROLLBAR must be defined."
|
||||
# else
|
||||
# define wxUSE_SCROLLBAR 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_SCROLLBAR) */
|
||||
|
||||
#ifndef wxUSE_SLIDER
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_SLIDER must be defined."
|
||||
# else
|
||||
# define wxUSE_SLIDER 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_SLIDER) */
|
||||
|
||||
#ifndef wxUSE_SPINBTN
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_SPINBTN must be defined."
|
||||
# else
|
||||
# define wxUSE_SPINBTN 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_SPINBTN) */
|
||||
|
||||
#ifndef wxUSE_SPINCTRL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_SPINCTRL must be defined."
|
||||
# else
|
||||
# define wxUSE_SPINCTRL 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_SPINCTRL) */
|
||||
|
||||
#ifndef wxUSE_SPLITTER
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_SPLITTER must be defined."
|
||||
# else
|
||||
# define wxUSE_SPLITTER 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_SPLITTER) */
|
||||
|
||||
#ifndef wxUSE_STATBMP
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_STATBMP must be defined."
|
||||
# else
|
||||
# define wxUSE_STATBMP 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_STATBMP) */
|
||||
|
||||
#ifndef wxUSE_STATBOX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_STATBOX must be defined."
|
||||
# else
|
||||
# define wxUSE_STATBOX 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_STATBOX) */
|
||||
|
||||
#ifndef wxUSE_STATLINE
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_STATLINE must be defined."
|
||||
# else
|
||||
# define wxUSE_STATLINE 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_STATLINE) */
|
||||
|
||||
#ifndef wxUSE_STATUSBAR
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_STATUSBAR must be defined."
|
||||
# else
|
||||
# define wxUSE_STATUSBAR 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_STATUSBAR) */
|
||||
|
||||
#ifndef wxUSE_STOPWATCH
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_STOPWATCH must be defined."
|
||||
# else
|
||||
# define wxUSE_STOPWATCH 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_STOPWATCH) */
|
||||
|
||||
#ifndef wxUSE_TAB_DIALOG
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_TAB_DIALOG must be defined."
|
||||
# else
|
||||
# define wxUSE_TAB_DIALOG 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_TAB_DIALOG) */
|
||||
|
||||
#ifndef wxUSE_TEXTCTRL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_TEXTCTRL must be defined."
|
||||
# else
|
||||
# define wxUSE_TEXTCTRL 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_TEXTCTRL) */
|
||||
|
||||
#ifndef wxUSE_TOOLBAR
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_TOOLBAR must be defined."
|
||||
# else
|
||||
# define wxUSE_TOOLBAR 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_TOOLBAR) */
|
||||
|
||||
#ifndef wxUSE_TOOLTIPS
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_TOOLTIPS must be defined."
|
||||
# else
|
||||
# define wxUSE_TOOLTIPS 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_TOOLTIPS) */
|
||||
|
||||
#ifndef wxUSE_TREECTRL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_TREECTRL must be defined."
|
||||
# else
|
||||
# define wxUSE_TREECTRL 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_TREECTRL) */
|
||||
|
||||
/*
|
||||
check consistency of the settings
|
||||
*/
|
||||
#if wxUSE_BUTTON || \
|
||||
wxUSE_CALENDARCTRL || \
|
||||
wxUSE_CARET || \
|
||||
wxUSE_COMBOBOX || \
|
||||
wxUSE_BMPBUTTON || \
|
||||
wxUSE_CHECKBOX || \
|
||||
wxUSE_CHECKLISTBOX || \
|
||||
wxUSE_CHOICE || \
|
||||
wxUSE_GAUGE || \
|
||||
wxUSE_GRID || \
|
||||
wxUSE_NEW_GRID || \
|
||||
wxUSE_LISTBOX || \
|
||||
wxUSE_LISTCTRL || \
|
||||
wxUSE_NOTEBOOK || \
|
||||
wxUSE_RADIOBOX || \
|
||||
wxUSE_RADIOBTN || \
|
||||
wxUSE_SCROLLBAR || \
|
||||
wxUSE_SLIDER || \
|
||||
wxUSE_SPINBTN || \
|
||||
wxUSE_SPINCTRL || \
|
||||
wxUSE_STATBMP || \
|
||||
wxUSE_STATBOX || \
|
||||
wxUSE_STATLINE || \
|
||||
wxUSE_STATUSBAR || \
|
||||
wxUSE_TEXTCTRL || \
|
||||
wxUSE_TOOLBAR || \
|
||||
wxUSE_TREECTRL
|
||||
# if !wxUSE_CONTROLS
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_CONTROLS unset but some controls used"
|
||||
# else
|
||||
# undef wxUSE_CONTROLS
|
||||
# define wxUSE_CONTROLS 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* controls */
|
||||
|
||||
#if wxUSE_CALENDARCTRL
|
||||
# if !(wxUSE_SPINBTN && wxUSE_COMBOBOX)
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxCalendarCtrl requires wxSpinButton and wxComboBox"
|
||||
# else
|
||||
# undef wxUSE_SPINBTN
|
||||
# undef wxUSE_COMBOBOX
|
||||
# define wxUSE_SPINBTN 1
|
||||
# define wxUSE_COMBOBOX 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* wxUSE_CALENDARCTRL */
|
||||
|
||||
#if wxUSE_CHECKLISTBOX
|
||||
# if !wxUSE_LISTBOX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxCheckListBox requires wxListBox"
|
||||
# else
|
||||
# undef wxUSE_LISTBOX
|
||||
# define wxUSE_LISTBOX 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* wxUSE_RADIOBTN */
|
||||
|
||||
#if wxUSE_COMBOBOX
|
||||
# if defined(__WXUNIVERSAL__) && !wxUSE_LISTBOX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxComboBox requires wxListBox in wxUniversal"
|
||||
# else
|
||||
# undef wxUSE_LISTBOX
|
||||
# define wxUSE_LISTBOX 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* wxUSE_COMBOBOX */
|
||||
|
||||
#if !wxUSE_FILEDLG
|
||||
# if defined(wxUSE_DOC_VIEW_ARCHITECTURE) || defined(wxUSE_HTML)
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxFileDialog must be compiled as well"
|
||||
# else
|
||||
# undef wxUSE_FILEDLG
|
||||
# define wxUSE_FILEDLG 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* !wxUSE_FILEDLG */
|
||||
|
||||
#if !wxUSE_FONTDLG
|
||||
# if defined(wxUSE_FONTMAP)
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxFontDialog must be compiled as well"
|
||||
# else
|
||||
# undef wxUSE_FONTDLG
|
||||
# define wxUSE_FONTDLG 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* !wxUSE_FONTDLG */
|
||||
|
||||
#if !wxUSE_IMAGLIST
|
||||
# if wxUSE_TREECTRL || wxUSE_NOTEBOOK || wxUSE_LISTCTRL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxImageList must be compiled as well"
|
||||
# else
|
||||
# undef wxUSE_IMAGLIST
|
||||
# define wxUSE_IMAGLIST 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* !wxUSE_IMAGLIST */
|
||||
|
||||
#if wxUSE_RADIOBTN
|
||||
# if defined(__WXUNIVERSAL__) && !wxUSE_CHECKBOX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_RADIOBTN requires wxUSE_CHECKBOX in wxUniversal"
|
||||
# else
|
||||
# undef wxUSE_CHECKBOX
|
||||
# define wxUSE_CHECKBOX 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* wxUSE_RADIOBTN */
|
||||
|
||||
#if wxUSE_RADIOBOX
|
||||
# if !wxUSE_RADIOBTN || !wxUSE_STATBOX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_RADIOBOX requires wxUSE_RADIOBTN and wxUSE_STATBOX"
|
||||
# else
|
||||
# undef wxUSE_RADIOBTN
|
||||
# undef wxUSE_STATBOX
|
||||
# define wxUSE_RADIOBTN 1
|
||||
# define wxUSE_STATBOX 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* wxUSE_RADIOBOX */
|
||||
|
||||
#if wxUSE_STOPWATCH
|
||||
# if !wxUSE_LONGLONG
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_STOPWATCH requires wxUSE_LONGLONG"
|
||||
# else
|
||||
# undef wxUSE_LONGLONG
|
||||
# define wxUSE_LONGLONG 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* wxUSE_STOPWATCH */
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
# ifdef __WXUNIVERSAL__
|
||||
# if !wxUSE_CARET
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxTextCtrl requires wxCaret in wxUniversal"
|
||||
# else
|
||||
# undef wxUSE_CARET
|
||||
# define wxUSE_CARET 1
|
||||
# endif
|
||||
# endif /* wxUSE_CARET */
|
||||
|
||||
# if !wxUSE_SCROLLBAR
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxTextCtrl requires wxScrollBar in wxUniversal"
|
||||
# else
|
||||
# undef wxUSE_SCROLLBAR
|
||||
# define wxUSE_SCROLLBAR 1
|
||||
# endif
|
||||
# endif /* wxUSE_SCROLLBAR */
|
||||
# endif /* __WXUNIVERSAL__ */
|
||||
#endif /* wxUSE_RADIOBTN */
|
||||
|
||||
/* I wonder if we shouldn't just remove all occurrences of
|
||||
wxUSE_DYNAMIC_CLASSES from the sources? */
|
||||
#if !defined(wxUSE_DYNAMIC_CLASSES) || !wxUSE_DYNAMIC_CLASSES
|
||||
# if wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_DYNAMIC_CLASSES must be defined as 1"
|
||||
# else
|
||||
# undef wxUSE_DYNAMIC_CLASSES
|
||||
# define wxUSE_DYNAMIC_CLASSES
|
||||
# endif
|
||||
#endif /* wxUSE_DYNAMIC_CLASSES */
|
||||
|
||||
#if wxUSE_MIMETYPE && !wxUSE_TEXTFILE
|
||||
# if wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_MIMETYPE requires wxUSE_TEXTFILE"
|
||||
# else
|
||||
# undef wxUSE_TEXTFILE
|
||||
# define wxUSE_TEXTFILE 1
|
||||
# endif
|
||||
#endif /* wxUSE_MIMETYPE */
|
||||
|
||||
#if wxUSE_TEXTFILE && !wxUSE_FILE
|
||||
# if wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_TEXTFILE requires wxUSE_FILE"
|
||||
# else
|
||||
# undef wxUSE_FILE
|
||||
# define wxUSE_FILE 1
|
||||
# endif
|
||||
#endif /* wxUSE_TEXTFILE */
|
||||
|
||||
#if wxUSE_CLIPBOARD && !wxUSE_DATAOBJ
|
||||
# if wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxClipboard requires wxDataObject"
|
||||
# else
|
||||
# undef wxUSE_DATAOBJ
|
||||
# define wxUSE_DATAOBJ 1
|
||||
# endif
|
||||
#endif /* wxUSE_CLIPBOARD */
|
||||
|
||||
/* wxUniv-specific dependencies */
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
# if (wxUSE_COMBOBOX || wxUSE_MENUS) && !wxUSE_POPUPWIN
|
||||
# if wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_POPUPWIN must be defined to use comboboxes/menus"
|
||||
# else
|
||||
# undef wxUSE_POPUPWIN
|
||||
# define wxUSE_POPUPWIN 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* wxUSE_POPUPWIN */
|
||||
|
||||
/* wxGTK-specific dependencies */
|
||||
#if defined(__WXGTK__) && !defined(__WXUNIVERSAL__)
|
||||
# if wxUSE_MDI_ARCHITECTURE && !wxUSE_MENUS
|
||||
# if wxABORT_ON_CONFIG_ERROR
|
||||
# error "MDI requires wxUSE_MENUS in wxGTK"
|
||||
# else
|
||||
# undef wxUSE_MENUS
|
||||
# define wxUSE_MENUS 1
|
||||
# endif
|
||||
# endif
|
||||
#endif /* wxGTK && !wxUniv */
|
||||
|
||||
#endif /* wxUSE_GUI */
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#pragma interface "choicebase.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_CHOICE
|
||||
|
||||
#include "wx/ctrlsub.h" // the base class
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -77,5 +79,7 @@ public:
|
||||
#include "wx/stubs/choice.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_CHOICE
|
||||
|
||||
#endif
|
||||
// _WX_CHOICE_H_BASE_
|
||||
|
@@ -88,6 +88,8 @@ public:
|
||||
#include "wx/motif/clipbrd.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/clipbrd.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/clipbrd.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/gtk/clipbrd.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
109
include/wx/cmdproc.h
Normal file
109
include/wx/cmdproc.h
Normal file
@@ -0,0 +1,109 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/cmdproc.h
|
||||
// Purpose: undo/redo capable command processing framework
|
||||
// Author: Julian Smart (extracted from docview.h by VZ)
|
||||
// Modified by:
|
||||
// Created: 05.11.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CMDPROC_H_
|
||||
#define _WX_CMDPROC_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "cmdproc.h"
|
||||
#endif
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCommand: a single command capable of performing itself
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxCommand : public wxObject
|
||||
{
|
||||
public:
|
||||
wxCommand(bool canUndoIt = FALSE, const wxString& name = "");
|
||||
~wxCommand();
|
||||
|
||||
// Override this to perform a command
|
||||
virtual bool Do() = 0;
|
||||
|
||||
// Override this to undo a command
|
||||
virtual bool Undo() = 0;
|
||||
|
||||
virtual bool CanUndo() const { return m_canUndo; }
|
||||
virtual wxString GetName() const { return m_commandName; }
|
||||
|
||||
protected:
|
||||
bool m_canUndo;
|
||||
wxString m_commandName;
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxCommand)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCommandProcessor: wxCommand manager
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxCommandProcessor : public wxObject
|
||||
{
|
||||
public:
|
||||
// if max number of commands is -1, it is unlimited
|
||||
wxCommandProcessor(int maxCommands = -1);
|
||||
virtual ~wxCommandProcessor();
|
||||
|
||||
// Pass a command to the processor. The processor calls Do(); if
|
||||
// successful, is appended to the command history unless storeIt is FALSE.
|
||||
virtual bool Submit(wxCommand *command, bool storeIt = TRUE);
|
||||
|
||||
// just store the command without executing it
|
||||
virtual void Store(wxCommand *command);
|
||||
|
||||
virtual bool Undo();
|
||||
virtual bool Redo();
|
||||
virtual bool CanUndo() const;
|
||||
virtual bool CanRedo() const;
|
||||
|
||||
virtual void Initialize();
|
||||
virtual void SetMenuStrings();
|
||||
|
||||
#if wxUSE_MENUS
|
||||
// Call this to manage an edit menu.
|
||||
void SetEditMenu(wxMenu *menu) { m_commandEditMenu = menu; }
|
||||
wxMenu *GetEditMenu() const { return m_commandEditMenu; }
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
// command list access
|
||||
wxList& GetCommands() const { return (wxList&) m_commands; }
|
||||
wxCommand *GetCurrentCommand() const
|
||||
{
|
||||
return (wxCommand *)(m_currentCommand ? m_currentCommand->Data() : NULL);
|
||||
}
|
||||
int GetMaxCommands() const { return m_maxNoCommands; }
|
||||
virtual void ClearCommands();
|
||||
|
||||
protected:
|
||||
// for further flexibility, command processor doesn't call wxCommand::Do()
|
||||
// and Undo() directly but uses these functions which can be overridden in
|
||||
// the derived class
|
||||
virtual bool DoCommand(wxCommand& cmd);
|
||||
virtual bool UndoCommand(wxCommand& cmd);
|
||||
|
||||
int m_maxNoCommands;
|
||||
wxList m_commands;
|
||||
wxNode* m_currentCommand;
|
||||
|
||||
#if wxUSE_MENUS
|
||||
wxMenu* m_commandEditMenu;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxCommandProcessor)
|
||||
};
|
||||
|
||||
#endif // _WX_CMDPROC_H_
|
@@ -7,6 +7,8 @@
|
||||
#include "wx/motif/colour.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/colour.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/colour.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/colour.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@@ -1,21 +1,75 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/combobox.h
|
||||
// Purpose: wxComboBox declaration
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 24.12.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1996-2000 wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_COMBOBOX_H_BASE_
|
||||
#define _WX_COMBOBOX_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/combobox.h"
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_COMBOBOX
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxComboBoxNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxComboBoxBase: this interface defines the methods wxComboBox must implement
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/ctrlsub.h"
|
||||
|
||||
class WXDLLEXPORT wxComboBoxBase : public wxItemContainer
|
||||
{
|
||||
public:
|
||||
// wxTextCtrl-like methods wxComboBox must implement
|
||||
virtual wxString GetValue() const = 0;
|
||||
virtual void SetValue(const wxString& value) = 0;
|
||||
|
||||
virtual void Copy() = 0;
|
||||
virtual void Cut() = 0;
|
||||
virtual void Paste() = 0;
|
||||
virtual void SetInsertionPoint(long pos) = 0;
|
||||
virtual long GetInsertionPoint() const = 0;
|
||||
virtual long GetLastPosition() const = 0;
|
||||
virtual void Replace(long from, long to, const wxString& value) = 0;
|
||||
virtual void SetSelection(long from, long to) = 0;
|
||||
virtual void SetEditable(bool editable) = 0;
|
||||
|
||||
virtual void SetInsertionPointEnd()
|
||||
{ SetInsertionPoint(GetLastPosition()); }
|
||||
virtual void Remove(long from, long to)
|
||||
{ Replace(from, to, wxEmptyString); }
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include the platform-dependent header defining the real class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/combobox.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/combobox.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/combobox.h"
|
||||
#include "wx/motif/combobox.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/combobox.h"
|
||||
#include "wx/gtk/combobox.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/combobox.h"
|
||||
#include "wx/qt/combobox.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/combobox.h"
|
||||
#include "wx/mac/combobox.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/combobox.h"
|
||||
#include "wx/os2/combobox.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/combobox.h"
|
||||
#include "wx/stubs/combobox.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_COMBOBOX
|
||||
|
||||
#endif
|
||||
// _WX_COMBOBOX_H_BASE_
|
||||
|
@@ -20,8 +20,12 @@
|
||||
#pragma interface "controlbase.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_CONTROLS
|
||||
|
||||
#include "wx/window.h" // base class
|
||||
|
||||
extern const wxChar* wxControlNameStr; // the default name
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxControl is the base class for all controls
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -29,13 +33,25 @@
|
||||
class WXDLLEXPORT wxControlBase : public wxWindow
|
||||
{
|
||||
public:
|
||||
#ifdef __WXMAC_X__
|
||||
virtual ~wxControlBase() {} // Added min for Mac X
|
||||
#endif
|
||||
// Create() function adds the validator parameter
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxControlNameStr);
|
||||
|
||||
// simulates the event of given type (i.e. wxButton::Command() is just as
|
||||
// if the button was clicked)
|
||||
virtual void Command(wxCommandEvent &event);
|
||||
|
||||
// get the control alignment (left/right/centre, top/bottom/centre)
|
||||
int GetAlignment() const { return m_windowStyle & wxALIGN_MASK; }
|
||||
|
||||
#ifdef __WXMAC_X__
|
||||
virtual ~wxControlBase() { } // Added min for Mac X
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// creates the control (calls wxWindowBase::CreateBase inside) and adds it
|
||||
// to the list of parents children
|
||||
@@ -58,7 +74,9 @@ protected:
|
||||
// include platform-dependent wxControl declarations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/control.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/control.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/control.h"
|
||||
@@ -74,5 +92,7 @@ protected:
|
||||
#include "wx/stubs/control.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_CONTROLS
|
||||
|
||||
#endif
|
||||
// _WX_CONTROL_H_BASE_
|
||||
|
@@ -16,32 +16,32 @@
|
||||
#pragma interface "controlwithitems.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_CONTROLS
|
||||
|
||||
#include "wx/control.h" // base class
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxControlWithItems defines an interface which is implemented by all controls
|
||||
// wxItemContainer defines an interface which is implemented by all controls
|
||||
// which have string subitems each of which may be selected.
|
||||
//
|
||||
// Examples: wxListBox, wxCheckListBox, wxChoice and wxComboBox
|
||||
// Examples: wxListBox, wxCheckListBox, wxChoice and wxComboBox (which
|
||||
// implements an extended interface deriving from this one)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxControlWithItems : public wxControl
|
||||
class WXDLLEXPORT wxItemContainer
|
||||
{
|
||||
public:
|
||||
wxControlWithItems() { m_clientDataItemsType = ClientData_None; }
|
||||
#ifdef __WXMAC_X__
|
||||
virtual ~wxControlWithItems() {} // Added min for Mac X
|
||||
#endif
|
||||
wxItemContainer() { m_clientDataItemsType = wxClientData_None; }
|
||||
|
||||
// adding items
|
||||
// ------------
|
||||
|
||||
void Append(const wxString& item)
|
||||
{ DoAppend(item); }
|
||||
void Append(const wxString& item, void *clientData)
|
||||
{ int n = DoAppend(item); SetClientData(n, clientData); }
|
||||
void Append(const wxString& item, wxClientData *clientData)
|
||||
{ int n = DoAppend(item); SetClientObject(n, clientData); }
|
||||
int Append(const wxString& item)
|
||||
{ return DoAppend(item); }
|
||||
int Append(const wxString& item, void *clientData)
|
||||
{ int n = DoAppend(item); SetClientData(n, clientData); return n; }
|
||||
int Append(const wxString& item, wxClientData *clientData)
|
||||
{ int n = DoAppend(item); SetClientObject(n, clientData); return n; }
|
||||
|
||||
// deleting items
|
||||
// --------------
|
||||
@@ -76,13 +76,19 @@ public:
|
||||
wxClientData* GetClientObject(int n) const;
|
||||
|
||||
bool HasClientObjectData() const
|
||||
{ return m_clientDataItemsType == ClientData_Object; }
|
||||
{ return m_clientDataItemsType == wxClientData_Object; }
|
||||
bool HasClientUntypedData() const
|
||||
{ return m_clientDataItemsType == ClientData_Void; }
|
||||
{ return m_clientDataItemsType == wxClientData_Void; }
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
// compatibility - these functions are deprecated, use the new ones
|
||||
// instead
|
||||
int Number() const { return GetCount(); }
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
#ifdef __WXMAC_X__
|
||||
virtual ~wxItemContainer() {} // Added min for Mac X
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual int DoAppend(const wxString& item) = 0;
|
||||
@@ -96,6 +102,57 @@ protected:
|
||||
wxClientDataType m_clientDataItemsType;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxControlWithItems : public wxControl, public wxItemContainer
|
||||
{
|
||||
public:
|
||||
// we have to redefine these functions here to avoid ambiguities in classes
|
||||
// deriving from us which would arise otherwise because both base classses
|
||||
// have the methods with the same names - hopefully, a smart compiler can
|
||||
// optimize away these simple inline wrappers so we don't suffer much from
|
||||
// this
|
||||
|
||||
void SetClientData(void *data)
|
||||
{
|
||||
wxControl::SetClientData(data);
|
||||
}
|
||||
|
||||
void *GetClientData() const
|
||||
{
|
||||
return wxControl::GetClientData();
|
||||
}
|
||||
|
||||
void SetClientObject(wxClientData *data)
|
||||
{
|
||||
wxControl::SetClientObject(data);
|
||||
}
|
||||
|
||||
wxClientData *GetClientObject() const
|
||||
{
|
||||
return wxControl::GetClientObject();
|
||||
}
|
||||
|
||||
void SetClientData(int n, void* clientData)
|
||||
{
|
||||
wxItemContainer::SetClientData(n, clientData);
|
||||
}
|
||||
|
||||
void* GetClientData(int n) const
|
||||
{
|
||||
return wxItemContainer::GetClientData(n);
|
||||
}
|
||||
|
||||
void SetClientObject(int n, wxClientData* clientData)
|
||||
{
|
||||
wxItemContainer::SetClientObject(n, clientData);
|
||||
}
|
||||
|
||||
wxClientData* GetClientObject(int n) const
|
||||
{
|
||||
return wxItemContainer::GetClientObject(n);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // wxUSE_CONTROLS
|
||||
|
||||
#endif // _WX_CTRLSUB_H_BASE_
|
||||
|
||||
|
||||
|
@@ -7,6 +7,8 @@
|
||||
#include "wx/motif/cursor.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/cursor.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/cursor.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/cursor.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@@ -256,6 +256,22 @@ public:
|
||||
void DrawRotatedText(const wxString& text, const wxPoint& pt, double angle)
|
||||
{ DoDrawRotatedText(text, pt.x, pt.y, angle); }
|
||||
|
||||
// this version puts both optional bitmap and the text into the given
|
||||
// rectangle and aligns is as specified by alignment parameter; it also
|
||||
// will emphasize the character with the given index if it is != -1 and
|
||||
// return the bounding rectangle if required
|
||||
virtual void DrawLabel(const wxString& text,
|
||||
const wxBitmap& image,
|
||||
const wxRect& rect,
|
||||
int alignment = wxALIGN_LEFT | wxALIGN_TOP,
|
||||
int indexAccel = -1,
|
||||
wxRect *rectBounding = NULL);
|
||||
|
||||
void DrawLabel(const wxString& text, const wxRect& rect,
|
||||
int alignment = wxALIGN_LEFT | wxALIGN_TOP,
|
||||
int indexAccel = -1)
|
||||
{ DrawLabel(text, wxNullBitmap, rect, alignment, indexAccel); }
|
||||
|
||||
bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||
int rop = wxCOPY, bool useMask = FALSE)
|
||||
@@ -332,6 +348,7 @@ public:
|
||||
virtual wxCoord GetCharHeight() const = 0;
|
||||
virtual wxCoord GetCharWidth() const = 0;
|
||||
|
||||
// only works for single line strings
|
||||
void GetTextExtent(const wxString& string,
|
||||
wxCoord *x, wxCoord *y,
|
||||
wxCoord *descent = NULL,
|
||||
@@ -339,6 +356,13 @@ public:
|
||||
wxFont *theFont = NULL) const
|
||||
{ DoGetTextExtent(string, x, y, descent, externalLeading, theFont); }
|
||||
|
||||
// works for single as well as multi-line strings
|
||||
virtual void GetMultiLineTextExtent(const wxString& text,
|
||||
wxCoord *width,
|
||||
wxCoord *height,
|
||||
wxCoord *heightLine = NULL,
|
||||
wxFont *font = NULL);
|
||||
|
||||
// size and resolution
|
||||
// -------------------
|
||||
|
||||
@@ -711,6 +735,8 @@ private:
|
||||
#include "wx/motif/dc.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dc.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dc.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dc.h"
|
||||
#elif defined(__WXMAC__)
|
||||
@@ -721,5 +747,34 @@ private:
|
||||
#include "wx/stubs/dc.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// helper class: you can use it to temporarily change the DC text colour and
|
||||
// restore it automatically when the object goes out of scope
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDCTextColourChanger
|
||||
{
|
||||
public:
|
||||
wxDCTextColourChanger(wxDC& dc) : m_dc(dc) { }
|
||||
|
||||
~wxDCTextColourChanger()
|
||||
{
|
||||
if ( m_colFgOld.Ok() )
|
||||
m_dc.SetTextForeground(m_colFgOld);
|
||||
}
|
||||
|
||||
void Set(const wxColour& col)
|
||||
{
|
||||
if ( !m_colFgOld.Ok() )
|
||||
m_colFgOld = m_dc.GetTextForeground();
|
||||
m_dc.SetTextForeground(col);
|
||||
}
|
||||
|
||||
private:
|
||||
wxDC& m_dc;
|
||||
|
||||
wxColour m_colFgOld;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DC_H_BASE_
|
||||
|
@@ -7,6 +7,8 @@
|
||||
#include "wx/motif/dcclient.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dcclient.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dcclient.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dcclient.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@@ -7,6 +7,8 @@
|
||||
#include "wx/motif/dcmemory.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dcmemory.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dcmemory.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dcmemory.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@@ -7,6 +7,8 @@
|
||||
#include "wx/motif/dcscreen.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dcscreen.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dcscreen.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dcscreen.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@@ -279,11 +279,11 @@
|
||||
#error "Target can't be both X and Windows"
|
||||
#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
|
||||
!defined(__WXPM__) && !defined(__WXMAC__) && !defined(__X__) && \
|
||||
!defined(__WXQT__) && !defined(__WXSTUBS__) && wxUSE_GUI
|
||||
!defined(__WXQT__) && !defined(__WXMGL__) && wxUSE_GUI
|
||||
#ifdef __UNIX__
|
||||
#error "No Target! You should wx-config program for compilation flags!"
|
||||
#error "No Target! You should use wx-config program for compilation flags!"
|
||||
#else // !Unix
|
||||
#error "No Target! You should supplied makefiles for compilation!"
|
||||
#error "No Target! You should use supplied makefiles for compilation!"
|
||||
#endif // Unix/!Unix
|
||||
#endif
|
||||
|
||||
@@ -862,7 +862,10 @@ enum wxAlignment
|
||||
wxALIGN_CENTRE_VERTICAL = wxALIGN_CENTER_VERTICAL,
|
||||
|
||||
wxALIGN_CENTER = (wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL),
|
||||
wxALIGN_CENTRE = wxALIGN_CENTER
|
||||
wxALIGN_CENTRE = wxALIGN_CENTER,
|
||||
|
||||
// a mask to extract alignment from the combination of flags
|
||||
wxALIGN_MASK = 0x0f00
|
||||
};
|
||||
|
||||
enum wxStretch
|
||||
@@ -872,7 +875,26 @@ enum wxStretch
|
||||
wxGROW = 0x2000,
|
||||
wxEXPAND = wxGROW,
|
||||
wxSHAPED = 0x4000,
|
||||
wxADJUST_MINSIZE = 0x8000
|
||||
wxADJUST_MINSIZE = 0x8000,
|
||||
wxTILE = 0xc000
|
||||
};
|
||||
|
||||
// border flags: the values are chosen for backwards compatibility
|
||||
enum wxBorder
|
||||
{
|
||||
// this is different from wxBORDER_NONE as by default the controls do have
|
||||
// border
|
||||
wxBORDER_DEFAULT = 0,
|
||||
|
||||
wxBORDER_NONE = 0x00200000,
|
||||
wxBORDER_STATIC = 0x01000000,
|
||||
wxBORDER_SIMPLE = 0x02000000,
|
||||
wxBORDER_RAISED = 0x04000000,
|
||||
wxBORDER_SUNKEN = 0x08000000,
|
||||
wxBORDER_DOUBLE = 0x10000000,
|
||||
|
||||
// a mask to extract border style from the combination of flags
|
||||
wxBORDER_MASK = 0x1f200000
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -899,31 +921,41 @@ enum wxStretch
|
||||
#define wxHSCROLL 0x40000000
|
||||
#define wxCAPTION 0x20000000
|
||||
|
||||
// New styles
|
||||
#define wxDOUBLE_BORDER 0x10000000
|
||||
#define wxSUNKEN_BORDER 0x08000000
|
||||
#define wxRAISED_BORDER 0x04000000
|
||||
#define wxBORDER 0x02000000
|
||||
#define wxSIMPLE_BORDER wxBORDER
|
||||
#define wxSTATIC_BORDER 0x01000000
|
||||
#define wxTRANSPARENT_WINDOW 0x00100000
|
||||
#define wxNO_BORDER 0x00200000
|
||||
// New styles (border styles are now in their own enum)
|
||||
#define wxDOUBLE_BORDER wxBORDER_DOUBLE
|
||||
#define wxSUNKEN_BORDER wxBORDER_SUNKEN
|
||||
#define wxRAISED_BORDER wxBORDER_RAISED
|
||||
#define wxBORDER wxBORDER_SIMPLE
|
||||
#define wxSIMPLE_BORDER wxBORDER_SIMPLE
|
||||
#define wxSTATIC_BORDER wxBORDER_STATIC
|
||||
#define wxNO_BORDER wxBORDER_NONE
|
||||
|
||||
// Override CTL3D etc. control colour processing to allow own background
|
||||
// colour.
|
||||
// OBSOLETE - use wxNO_3D instead
|
||||
#define wxUSER_COLOURS 0x00800000
|
||||
// Override CTL3D or native 3D styles for children
|
||||
#define wxNO_3D 0x00800000
|
||||
|
||||
// OBSOLETE - use wxNO_3D instead
|
||||
#define wxUSER_COLOURS wxNO_3D
|
||||
|
||||
// wxALWAYS_SHOW_SB: instead of hiding the scrollbar when it is not needed,
|
||||
// disable it - but still show (see also wxLB_ALWAYS_SB style)
|
||||
//
|
||||
// NB: as this style is only supported by wxUniversal so far as it doesn't use
|
||||
// wxUSER_COLOURS/wxNO_3D, we reuse the same style value
|
||||
#define wxALWAYS_SHOW_SB 0x00800000
|
||||
|
||||
// Clip children when painting, which reduces flicker in e.g. frames and
|
||||
// splitter windows, but can't be used in a panel where a static box must be
|
||||
// 'transparent' (panel paints the background for it)
|
||||
#define wxCLIP_CHILDREN 0x00400000
|
||||
|
||||
// Note we're reusing the wxCAPTION style because we won't need captions
|
||||
// for subwindows/controls
|
||||
#define wxCLIP_SIBLINGS 0x20000000
|
||||
|
||||
#define wxTRANSPARENT_WINDOW 0x00100000
|
||||
|
||||
// Add this style to a panel to get tab traversal working outside of dialogs
|
||||
// (on by default for wxPanel, wxDialog, wxScrolledWindow)
|
||||
#define wxTAB_TRAVERSAL 0x00080000
|
||||
@@ -932,10 +964,15 @@ enum wxStretch
|
||||
// Windows, it won't normally get the dialog navigation key events)
|
||||
#define wxWANTS_CHARS 0x00040000
|
||||
|
||||
// Make window retained (mostly Motif, I think)
|
||||
// Make window retained (mostly Motif, I think) -- obsolete (VZ)?
|
||||
#define wxRETAINED 0x00020000
|
||||
#define wxBACKINGSTORE wxRETAINED
|
||||
|
||||
// set this flag to create a special popup window: it will be always shown on
|
||||
// top of other windows, will capture the mouse and will be dismissed when the
|
||||
// mouse is clicked outside of it or if it loses focus in any other way
|
||||
#define wxPOPUP_WINDOW 0x00020000
|
||||
|
||||
// don't invalidate the whole window (resulting in a PAINT event) when the
|
||||
// window is resized (currently, makes sense for wxMSW only)
|
||||
#define wxNO_FULL_REPAINT_ON_RESIZE 0x00010000
|
||||
@@ -1062,7 +1099,8 @@ enum wxStretch
|
||||
#define wxLB_NEEDED_SB 0x0200
|
||||
#define wxLB_ALWAYS_SB 0x0400
|
||||
#define wxLB_HSCROLL wxHSCROLL
|
||||
|
||||
// always show an entire number of rows
|
||||
#define wxLB_INT_HEIGHT 0x0800
|
||||
/*
|
||||
* wxTextCtrl style flags
|
||||
*/
|
||||
@@ -1077,10 +1115,18 @@ enum wxStretch
|
||||
#define wxTE_RICH 0x0080
|
||||
#define wxTE_NO_VSCROLL 0x0100
|
||||
#define wxTE_AUTO_SCROLL 0x0200
|
||||
#define wxPROCESS_ENTER 0x0400
|
||||
#define wxPASSWORD 0x0800
|
||||
#define wxTE_PROCESS_ENTER wxPROCESS_ENTER
|
||||
#define wxTE_PASSWORD wxPASSWORD
|
||||
#define wxTE_PROCESS_ENTER 0x0400
|
||||
#define wxTE_PASSWORD 0x0800
|
||||
|
||||
// use wxHSCROLL to not wrap text at all, wxTE_LINEWRAP to wrap it at any
|
||||
// position and wxTE_WORDWRAP to wrap at words boundary
|
||||
#define wxTE_DONTWRAP wxHSCROLL
|
||||
#define wxTE_LINEWRAP 0x0800
|
||||
#define wxTE_WORDWRAP 0x0000 // it's just == !wxHSCROLL
|
||||
|
||||
// deprecated synonyms
|
||||
#define wxPROCESS_ENTER wxTE_PROCESS_ENTER
|
||||
#define wxPASSWORD wxTE_PASSWORD
|
||||
|
||||
/*
|
||||
* wxComboBox style flags
|
||||
@@ -1093,9 +1139,15 @@ enum wxStretch
|
||||
/*
|
||||
* wxRadioBox style flags
|
||||
*/
|
||||
// should we number the items from left to right or from top to bottom in a 2d
|
||||
// radiobox?
|
||||
#define wxRA_LEFTTORIGHT 0x0001
|
||||
#define wxRA_TOPTOBOTTOM 0x0002
|
||||
|
||||
// New, more intuitive names to specify majorDim argument
|
||||
#define wxRA_SPECIFY_COLS wxHORIZONTAL
|
||||
#define wxRA_SPECIFY_ROWS wxVERTICAL
|
||||
|
||||
// Old names for compatibility
|
||||
#define wxRA_HORIZONTAL wxHORIZONTAL
|
||||
#define wxRA_VERTICAL wxVERTICAL
|
||||
@@ -1121,8 +1173,8 @@ enum wxStretch
|
||||
#define wxSL_VERTICAL wxVERTICAL // 8
|
||||
// The next one is obsolete - use scroll events instead
|
||||
#define wxSL_NOTIFY_DRAG 0x0000
|
||||
#define wxSL_AUTOTICKS 0x0010
|
||||
// #define wxSL_MANUALTICKS 0x0010
|
||||
#define wxSL_TICKS 0x0010
|
||||
#define wxSL_AUTOTICKS wxSL_TICKS // we don't support manual ticks
|
||||
#define wxSL_LABELS 0x0020
|
||||
#define wxSL_LEFT 0x0040
|
||||
#define wxSL_TOP 0x0080
|
||||
@@ -1228,9 +1280,11 @@ enum wxStretch
|
||||
* wxNotebook flags
|
||||
*/
|
||||
#define wxNB_FIXEDWIDTH 0x0010
|
||||
#define wxNB_TOP 0x0000 // default
|
||||
#define wxNB_LEFT 0x0020
|
||||
#define wxNB_RIGHT 0x0040
|
||||
#define wxNB_BOTTOM 0x0080
|
||||
#define wxNB_MULTILINE 0x0100
|
||||
|
||||
/*
|
||||
* wxStatusBar95 flags
|
||||
@@ -1242,6 +1296,11 @@ enum wxStretch
|
||||
*/
|
||||
#define wxST_NO_AUTORESIZE 0x0001
|
||||
|
||||
/*
|
||||
* wxStaticBitmap flags
|
||||
*/
|
||||
#define wxBI_EXPAND wxEXPAND
|
||||
|
||||
/*
|
||||
* wxStaticLine flags
|
||||
*/
|
||||
@@ -1380,6 +1439,36 @@ enum wxStretch
|
||||
#define wxID_FILEDLGG 5900
|
||||
#define wxID_HIGHEST 5999
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// hit test results
|
||||
enum wxHitTest
|
||||
{
|
||||
wxHT_NOWHERE,
|
||||
|
||||
// scrollbar
|
||||
wxHT_SCROLLBAR_FIRST = wxHT_NOWHERE,
|
||||
wxHT_SCROLLBAR_ARROW_LINE_1, // left or upper arrow to scroll by line
|
||||
wxHT_SCROLLBAR_ARROW_LINE_2, // right or down
|
||||
wxHT_SCROLLBAR_ARROW_PAGE_1, // left or upper arrow to scroll by page
|
||||
wxHT_SCROLLBAR_ARROW_PAGE_2, // right or down
|
||||
wxHT_SCROLLBAR_THUMB, // on the thumb
|
||||
wxHT_SCROLLBAR_BAR_1, // bar to the left/above the thumb
|
||||
wxHT_SCROLLBAR_BAR_2, // bar to the right/below the thumb
|
||||
wxHT_SCROLLBAR_LAST,
|
||||
|
||||
// window
|
||||
wxHT_WINDOW_OUTSIDE, // not in this window at all
|
||||
wxHT_WINDOW_INSIDE, // in the client area
|
||||
wxHT_WINDOW_VERT_SCROLLBAR, // on the vertical scrollbar
|
||||
wxHT_WINDOW_HORZ_SCROLLBAR, // on the horizontal scrollbar
|
||||
wxHT_WINDOW_CORNER, // on the corner between 2 scrollbars
|
||||
|
||||
wxHT_MAX
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Possible SetSize flags
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -2029,6 +2118,10 @@ typedef struct _PangoFontDescription PangoFontDescription;
|
||||
#endif
|
||||
#endif // GTK
|
||||
|
||||
#ifdef __WXMGL__
|
||||
typedef void *WXWidget; // FIXME_MGL - type-safe
|
||||
#endif // MGL
|
||||
|
||||
// This is required because of clashing macros in windows.h, which may be
|
||||
// included before or after wxWindows classes, and therefore must be
|
||||
// disabled here before any significant wxWindows headers are included.
|
||||
@@ -2070,7 +2163,7 @@ typedef struct _PangoFontDescription PangoFontDescription;
|
||||
#define DECLARE_NO_COPY_CLASS(classname) \
|
||||
private: \
|
||||
classname(const classname&); \
|
||||
classname& operator=(const classname&)
|
||||
classname& operator=(const classname&);
|
||||
|
||||
#endif
|
||||
// _WX_DEFS_H_
|
||||
|
@@ -30,12 +30,16 @@ public:
|
||||
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
|
||||
int GetReturnCode() const { return m_returnCode; }
|
||||
|
||||
#if wxUSE_STATTEXT && wxUSE_TEXTCTRL
|
||||
// splits text up at newlines and places the
|
||||
// lines into a vertical wxBoxSizer
|
||||
wxSizer *CreateTextSizer( const wxString &message );
|
||||
#endif // wxUSE_STATTEXT && wxUSE_TEXTCTRL
|
||||
|
||||
#if wxUSE_BUTTON
|
||||
// places buttons into a horizontal wxBoxSizer
|
||||
wxSizer *CreateButtonSizer( long flags );
|
||||
#endif // wxUSE_BUTTON
|
||||
|
||||
protected:
|
||||
// the return code from modal dialog
|
||||
@@ -48,6 +52,9 @@ protected:
|
||||
#include "wx/motif/dialog.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dialog.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dialog.h"
|
||||
// FIXME_MGL -- belongs to wxUniv
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dialog.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#ifndef _WX_DIRDLG_H_BASE_
|
||||
#define _WX_DIRDLG_H_BASE_
|
||||
|
||||
#if wxUSE_DIRDLG
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -33,5 +35,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
|
||||
#include "wx/stubs/dirdlg.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_DIRDLG
|
||||
|
||||
#endif
|
||||
// _WX_DIRDLG_H_BASE_
|
||||
|
@@ -31,7 +31,6 @@ class WXDLLEXPORT wxView;
|
||||
class WXDLLEXPORT wxDocTemplate;
|
||||
class WXDLLEXPORT wxDocManager;
|
||||
class WXDLLEXPORT wxPrintInfo;
|
||||
class WXDLLEXPORT wxCommand;
|
||||
class WXDLLEXPORT wxCommandProcessor;
|
||||
class WXDLLEXPORT wxFileHistory;
|
||||
class WXDLLEXPORT wxConfigBase;
|
||||
@@ -515,74 +514,6 @@ protected:
|
||||
};
|
||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Command processing framework
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxCommand : public wxObject
|
||||
{
|
||||
DECLARE_CLASS(wxCommand)
|
||||
|
||||
public:
|
||||
wxCommand(bool canUndoIt = FALSE, const wxString& name = "");
|
||||
~wxCommand();
|
||||
|
||||
// Override this to perform a command
|
||||
virtual bool Do() = 0;
|
||||
|
||||
// Override this to undo a command
|
||||
virtual bool Undo() = 0;
|
||||
|
||||
virtual bool CanUndo() const { return m_canUndo; }
|
||||
virtual wxString GetName() const { return m_commandName; }
|
||||
|
||||
protected:
|
||||
bool m_canUndo;
|
||||
wxString m_commandName;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxCommandProcessor : public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCommandProcessor)
|
||||
|
||||
public:
|
||||
wxCommandProcessor(int maxCommands = 100);
|
||||
~wxCommandProcessor();
|
||||
|
||||
// Pass a command to the processor. The processor calls Do(); if
|
||||
// successful, is appended to the command history unless storeIt is FALSE.
|
||||
virtual bool Submit(wxCommand *command, bool storeIt = TRUE);
|
||||
virtual bool Undo();
|
||||
virtual bool Redo();
|
||||
virtual bool CanUndo() const;
|
||||
virtual bool CanRedo() const;
|
||||
|
||||
// Call this to manage an edit menu.
|
||||
void SetEditMenu(wxMenu *menu) { m_commandEditMenu = menu; }
|
||||
wxMenu *GetEditMenu() const { return m_commandEditMenu; }
|
||||
virtual void SetMenuStrings();
|
||||
virtual void Initialize();
|
||||
|
||||
wxList& GetCommands() const { return (wxList&) m_commands; }
|
||||
int GetMaxCommands() const { return m_maxNoCommands; }
|
||||
virtual void ClearCommands();
|
||||
|
||||
// By default, the accelerators are "\tCtrl+Z" and "\tCtrl+Y"
|
||||
const wxString& GetUndoAccelerator() const { return m_undoAccelerator; }
|
||||
const wxString& GetRedoAccelerator() const { return m_redoAccelerator; }
|
||||
|
||||
void SetUndoAccelerator(const wxString& accel) { m_undoAccelerator = accel; }
|
||||
void SetRedoAccelerator(const wxString& accel) { m_redoAccelerator = accel; }
|
||||
|
||||
protected:
|
||||
int m_maxNoCommands;
|
||||
wxList m_commands;
|
||||
wxNode* m_currentCommand;
|
||||
wxMenu* m_commandEditMenu;
|
||||
wxString m_undoAccelerator;
|
||||
wxString m_redoAccelerator;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// File history management
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#ifndef _WX_DRAGIMAG_H_BASE_
|
||||
#define _WX_DRAGIMAG_H_BASE_
|
||||
|
||||
#if wxUSE_DRAGIMAG
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#ifdef __WIN16__
|
||||
#include "wx/generic/dragimgg.h"
|
||||
@@ -42,5 +44,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_DRAGIMAG
|
||||
|
||||
#endif
|
||||
// _WX_DRAGIMAG_H_BASE_
|
||||
|
@@ -15,6 +15,9 @@
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_FONTMAP
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/fontenc.h"
|
||||
#include "wx/dynarray.h"
|
||||
@@ -147,5 +150,6 @@ class WXDLLEXPORT wxEncodingConverter : public wxObject
|
||||
|
||||
};
|
||||
|
||||
#endif // wxUSE_FONTMAP
|
||||
|
||||
#endif // _WX_ENCCONV_H_
|
||||
|
@@ -506,8 +506,6 @@ public:
|
||||
|
||||
class WXDLLEXPORT wxScrollWinEvent : public wxEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxScrollWinEvent)
|
||||
|
||||
public:
|
||||
wxScrollWinEvent(wxEventType commandType = wxEVT_NULL,
|
||||
int pos = 0, int orient = 0);
|
||||
@@ -523,9 +521,12 @@ public:
|
||||
void SetPosition(int pos) { m_commandInt = pos; }
|
||||
|
||||
void CopyObject(wxObject& object_dest) const;
|
||||
|
||||
public:
|
||||
int m_commandInt; // Additional information
|
||||
long m_extraLong;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxScrollWinEvent)
|
||||
};
|
||||
|
||||
// Mouse event class
|
||||
@@ -559,8 +560,6 @@ public:
|
||||
|
||||
class WXDLLEXPORT wxMouseEvent : public wxEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMouseEvent)
|
||||
|
||||
public:
|
||||
wxMouseEvent(wxEventType mouseType = wxEVT_NULL);
|
||||
|
||||
@@ -582,6 +581,9 @@ public:
|
||||
// Was the given button 1,2,3 or any in Down state?
|
||||
bool ButtonIsDown(int but) const;
|
||||
|
||||
// Get the button which is changing state (-1 if none)
|
||||
int GetButton() const;
|
||||
|
||||
// Find state of shift/control keys
|
||||
bool ControlDown() const { return m_controlDown; }
|
||||
bool MetaDown() const { return m_metaDown; }
|
||||
@@ -706,6 +708,9 @@ public:
|
||||
int m_wheelRotation;
|
||||
int m_wheelDelta;
|
||||
int m_linesPerAction;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMouseEvent)
|
||||
};
|
||||
|
||||
// Cursor set event
|
||||
@@ -886,6 +891,15 @@ public:
|
||||
#endif // debug
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxNcPaintEvent : public wxEvent
|
||||
{
|
||||
public:
|
||||
wxNcPaintEvent(int id = 0) : wxEvent(id) { SetEventType(wxEVT_NC_PAINT); }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxNcPaintEvent)
|
||||
};
|
||||
|
||||
// Erase background event class
|
||||
/*
|
||||
wxEVT_ERASE_BACKGROUND
|
||||
@@ -913,11 +927,22 @@ public:
|
||||
|
||||
class WXDLLEXPORT wxFocusEvent : public wxEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxFocusEvent)
|
||||
|
||||
public:
|
||||
wxFocusEvent(wxEventType type = wxEVT_NULL, int Id = 0)
|
||||
{ m_eventType = type; m_id = Id; }
|
||||
wxFocusEvent(wxEventType type = wxEVT_NULL, int id = 0)
|
||||
{ m_eventType = type; m_id = id; m_win = NULL; }
|
||||
|
||||
// the window associated with this event is the window which had focus
|
||||
// before for SET event and the window which will have focus for the KILL
|
||||
// one
|
||||
//
|
||||
// NB: it may be NULL in both cases!
|
||||
wxWindow *GetWindow() const { return m_win; }
|
||||
void SetWindow(wxWindow *win) { m_win = win; }
|
||||
|
||||
private:
|
||||
wxWindow *m_win;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxFocusEvent)
|
||||
};
|
||||
|
||||
// Activate event class
|
||||
@@ -1777,6 +1802,7 @@ typedef void (wxEvtHandler::*wxContextMenuEventFunction)(wxContextMenuEvent&);
|
||||
#define EVT_END_SESSION(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL ),
|
||||
#define EVT_QUERY_END_SESSION(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL ),
|
||||
#define EVT_PAINT(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PAINT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaintEventFunction) & func, (wxObject *) NULL ),
|
||||
#define EVT_NC_PAINT(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_NC_PAINT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaintEventFunction) & func, (wxObject *) NULL ),
|
||||
#define EVT_ERASE_BACKGROUND(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_ERASE_BACKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxEraseEventFunction) & func, (wxObject *) NULL ),
|
||||
#define EVT_CHAR(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_CHAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL ),
|
||||
#define EVT_KEY_DOWN(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_KEY_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL ),
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#pragma interface "ffile.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_FILE
|
||||
#if wxUSE_FFILE
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/string.h"
|
||||
@@ -109,7 +109,7 @@ private:
|
||||
wxString m_name; // the name of the file (for diagnostic messages)
|
||||
};
|
||||
|
||||
#endif // wxUSE_FILE
|
||||
#endif // wxUSE_FFILE
|
||||
|
||||
#endif // _WX_FFILE_H_
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#ifndef _WX_FILEDLG_H_BASE_
|
||||
#define _WX_FILEDLG_H_BASE_
|
||||
|
||||
#if wxUSE_FILEDLG
|
||||
|
||||
enum
|
||||
{
|
||||
wxOPEN = 0x0001,
|
||||
@@ -32,6 +34,7 @@ enum
|
||||
#include "wx/stubs/filedlg.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_FILEDLG
|
||||
|
||||
#endif
|
||||
// _WX_FILEDLG_H_BASE_
|
||||
|
@@ -161,6 +161,8 @@ private:
|
||||
#include "wx/motif/font.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/font.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/font.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/font.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#ifndef _WX_FONTDLG_H_BASE_
|
||||
#define _WX_FONTDLG_H_BASE_
|
||||
|
||||
#if wxUSE_FONTDLG
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/fontdlg.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
@@ -25,5 +27,7 @@
|
||||
# define sm_classwxFontDialog sm_classwxGenericFontDialog
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_FONTDLG
|
||||
|
||||
#endif
|
||||
// _WX_FONTDLG_H_BASE_
|
||||
|
@@ -105,6 +105,8 @@ struct WXDLLEXPORT wxNativeEncodingInfo
|
||||
#elif defined(_WX_X_FONTLIKE)
|
||||
wxString xregistry,
|
||||
xencoding;
|
||||
#elif defined(__WXMGL__)
|
||||
int mglEncoding;
|
||||
#else
|
||||
#error "Unsupported toolkit"
|
||||
#endif
|
||||
|
@@ -20,8 +20,14 @@
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_FONTMAP
|
||||
|
||||
#include "wx/fontenc.h" // for wxFontEncoding
|
||||
|
||||
#if wxUSE_GUI
|
||||
#include "wx/fontutil.h" // for wxNativeEncodingInfo
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#if wxUSE_CONFIG
|
||||
class WXDLLEXPORT wxConfigBase;
|
||||
#endif // wxUSE_CONFIG
|
||||
@@ -182,4 +188,6 @@ protected:
|
||||
// the default font mapper for wxWindows programs
|
||||
WXDLLEXPORT_DATA(extern wxFontMapper *) wxTheFontMapper;
|
||||
|
||||
#endif // wxUSE_FONTMAP
|
||||
|
||||
#endif // _WX_FONTMAPPER_H_
|
||||
|
@@ -88,4 +88,12 @@ extern bool wxTestFontEncoding(const wxNativeEncodingInfo& info);
|
||||
#include "wx/unix/fontutil.h"
|
||||
#endif // X || GDK
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// font-related functions (MGL)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __WXMGL__
|
||||
#include "wx/mgl/fontutil.h"
|
||||
#endif // __WXMGL__
|
||||
|
||||
#endif // _WX_FONTUTIL_H_
|
||||
|
@@ -27,8 +27,8 @@
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr;
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr;
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr;
|
||||
WXDLLEXPORT_DATA(extern wxWindow*) wxWndHook;
|
||||
|
||||
class WXDLLEXPORT wxFrame;
|
||||
class WXDLLEXPORT wxMenuBar;
|
||||
class WXDLLEXPORT wxStatusBar;
|
||||
class WXDLLEXPORT wxToolBar;
|
||||
@@ -104,8 +104,10 @@ public:
|
||||
// menu bar functions
|
||||
// ------------------
|
||||
|
||||
#if wxUSE_MENUS
|
||||
virtual void SetMenuBar(wxMenuBar *menubar) = 0;
|
||||
virtual wxMenuBar *GetMenuBar() const { return m_frameMenuBar; }
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
// call this to simulate a menu command
|
||||
bool Command(int id) { return ProcessCommand(id); }
|
||||
@@ -172,13 +174,16 @@ public:
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void OnMenuHighlight(wxMenuEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
// this should go away, but for now it's called from docview.cpp,
|
||||
// so should be there for all platforms
|
||||
void OnActivate(wxActivateEvent &WXUNUSED(event)) { }
|
||||
|
||||
#if wxUSE_MENUS
|
||||
// send wxUpdateUIEvents for all menu items (called from OnIdle())
|
||||
void DoMenuUpdates();
|
||||
void DoMenuUpdates(wxMenu* menu, wxWindow* focusWin);
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
protected:
|
||||
// the frame main menu/status/tool bars
|
||||
@@ -188,7 +193,15 @@ protected:
|
||||
// main menubar, statusbar and toolbar (if any)
|
||||
void DeleteAllBars();
|
||||
|
||||
// test whether this window makes part of the frame
|
||||
virtual bool IsOneOfBars(const wxWindow *win) const;
|
||||
|
||||
#if wxUSE_MENUS
|
||||
// override to update menu bar position when the frame size changes
|
||||
virtual void PositionMenuBar() { }
|
||||
|
||||
wxMenuBar *m_frameMenuBar;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// override to update status bar position (or anything else) when
|
||||
@@ -226,11 +239,21 @@ protected:
|
||||
|
||||
// include the real class declaration
|
||||
#if defined(__WXMSW__)
|
||||
#ifndef __WXUNIVERSAL__
|
||||
#define wxFrameMSW wxFrame
|
||||
#define sm_classwxFrameMSW sm_classwxFrame
|
||||
#endif
|
||||
#include "wx/msw/frame.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/frame.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#ifndef __WXUNIVERSAL__
|
||||
#define wxFrameGTK wxFrame
|
||||
#define sm_classwxFrameGTK sm_classwxFrame
|
||||
#endif
|
||||
#include "wx/gtk/frame.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/frame.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/frame.h"
|
||||
#elif defined(__WXMAC__)
|
||||
@@ -241,5 +264,9 @@ protected:
|
||||
#include "wx/stubs/frame.h"
|
||||
#endif
|
||||
|
||||
#ifdef __WXUNIVERSAL__
|
||||
#include "wx/univ/frame.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_FRAME_H_BASE_
|
||||
|
@@ -1,21 +1,99 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gauge.h
|
||||
// Purpose: wxGauge interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 20.02.01
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1996-2001 wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GAUGE_H_BASE_
|
||||
#define _WX_GAUGE_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/gauge.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/gauge.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/gauge.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/gauge.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/gauge.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/gauge.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/gauge.h"
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "gaugebase.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_GAUGE
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGauge: a progress bar
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxGaugeBase : public wxControl
|
||||
{
|
||||
public:
|
||||
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/get the control range
|
||||
virtual void SetRange(int range);
|
||||
virtual int GetRange() const;
|
||||
|
||||
// position
|
||||
virtual void SetValue(int pos);
|
||||
virtual int GetValue() const;
|
||||
|
||||
// appearance params (not implemented for most ports)
|
||||
|
||||
virtual void SetShadowWidth(int w);
|
||||
virtual int GetShadowWidth() const;
|
||||
|
||||
virtual void SetBezelFace(int w);
|
||||
virtual int GetBezelFace() const;
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
|
||||
protected:
|
||||
// the max position
|
||||
int m_rangeMax;
|
||||
|
||||
// the current position
|
||||
int m_gaugePos;
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/gauge.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#ifdef __WIN95__
|
||||
#include "wx/msw/gauge95.h"
|
||||
#define wxGauge wxGauge95
|
||||
#define sm_classwxGauge sm_classwxGauge95
|
||||
#else // !__WIN95__
|
||||
#include "wx/msw/gaugemsw.h"
|
||||
#define wxGauge wxGaugeMSW
|
||||
#define sm_classwxGauge sm_classwxGaugeMSW
|
||||
#endif
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/gauge.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/gauge.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/gauge.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/gauge.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/gauge.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/gauge.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_GAUGE
|
||||
|
||||
#endif
|
||||
// _WX_GAUGE_H_BASE_
|
||||
|
@@ -152,6 +152,9 @@ enum wxStockCursor
|
||||
#elif defined(__WXPM__)
|
||||
// Load from a resource
|
||||
#define wxICON(X) wxIcon("" #X "")
|
||||
#elif defined(__WXMGL__)
|
||||
// Load from a resource
|
||||
#define wxICON(X) wxIcon("" #X "")
|
||||
#elif defined(__WXGTK__)
|
||||
// Initialize from an included XPM
|
||||
#define wxICON(X) wxIcon( (const char**) X##_xpm )
|
||||
@@ -167,7 +170,7 @@ enum wxStockCursor
|
||||
under Unix bitmaps live in XPMs and under Windows they're in ressources.
|
||||
*/
|
||||
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMGL__)
|
||||
#define wxBITMAP(name) wxBitmap(#name, wxBITMAP_TYPE_RESOURCE)
|
||||
#elif defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__)
|
||||
// Initialize from an included XPM
|
||||
@@ -183,6 +186,7 @@ enum wxStockCursor
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxSize
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxSize
|
||||
{
|
||||
public:
|
||||
@@ -196,7 +200,9 @@ public:
|
||||
wxSize(int xx, int yy) { Set(xx, yy); }
|
||||
|
||||
// no copy ctor or assignment operator - the defaults are ok
|
||||
|
||||
bool operator==(const wxSize& sz) const { return x == sz.x && y == sz.y; }
|
||||
bool operator!=(const wxSize& sz) const { return x != sz.x || y != sz.y; }
|
||||
|
||||
// FIXME are these really useful? If they're, we should have += &c as well
|
||||
wxSize operator+(const wxSize& sz) { return wxSize(x + sz.x, y + sz.y); }
|
||||
@@ -301,23 +307,49 @@ public:
|
||||
void SetTop(int top) { y = top; }
|
||||
void SetBottom(int bottom) { height = bottom - y + 1; }
|
||||
|
||||
void Inflate(wxCoord dx, wxCoord dy)
|
||||
// operations with rect
|
||||
wxRect& Inflate(wxCoord dx, wxCoord dy);
|
||||
wxRect& Inflate(wxCoord d) { return Inflate(d, d); }
|
||||
wxRect Inflate(wxCoord dx, wxCoord dy) const
|
||||
{
|
||||
x -= dx;
|
||||
y -= dy;
|
||||
width += 2*dx;
|
||||
height += 2*dy;
|
||||
wxRect r = *this;
|
||||
r.Inflate(dx, dy);
|
||||
return r;
|
||||
}
|
||||
|
||||
void Inflate(wxCoord d) { Inflate(d, d); }
|
||||
wxRect& Deflate(wxCoord dx, wxCoord dy) { return Inflate(-dx, -dy); }
|
||||
wxRect& Deflate(wxCoord d) { return Inflate(-d); }
|
||||
wxRect Deflate(wxCoord dx, wxCoord dy) const
|
||||
{
|
||||
wxRect r = *this;
|
||||
r.Deflate(dx, dy);
|
||||
return r;
|
||||
}
|
||||
|
||||
void Offset(wxCoord dx, wxCoord dy) { x += dx; y += dy; }
|
||||
void Offset(const wxPoint& pt) { Offset(pt.x, pt.y); }
|
||||
|
||||
wxRect& Intersect(const wxRect& rect);
|
||||
wxRect Intersect(const wxRect& rect) const
|
||||
{
|
||||
wxRect r = *this;
|
||||
r.Intersect(rect);
|
||||
return r;
|
||||
}
|
||||
|
||||
wxRect operator+(const wxRect& rect) const;
|
||||
wxRect& operator+=(const wxRect& rect);
|
||||
|
||||
// compare rectangles
|
||||
bool operator==(const wxRect& rect) const;
|
||||
bool operator!=(const wxRect& rect) const { return !(*this == rect); }
|
||||
|
||||
bool Inside(int cx, int cy) const;
|
||||
// return TRUE if the point is (not strcitly) inside the rect
|
||||
bool Inside(int x, int y) const;
|
||||
bool Inside(const wxPoint& pt) const { return Inside(pt.x, pt.y); }
|
||||
wxRect operator+(const wxRect& rect) const;
|
||||
wxRect& operator+=(const wxRect& rect);
|
||||
|
||||
// return TRUE if the rectangles have a non empty intersection
|
||||
bool Intersects(const wxRect& rect) const;
|
||||
|
||||
public:
|
||||
int x, y, width, height;
|
||||
|
@@ -7,6 +7,8 @@
|
||||
#include "wx/motif/gdiobj.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/gdiobj.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/gdiobj.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/gdiobj.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// Created: 21/3/2000
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DIRCTRL_H_
|
||||
@@ -19,6 +19,8 @@
|
||||
#pragma interface "dirctrlg.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_DIRDLG
|
||||
|
||||
#include "wx/treectrl.h"
|
||||
#include "wx/dirdlg.h"
|
||||
#include "wx/choice.h"
|
||||
@@ -247,5 +249,7 @@ protected:
|
||||
|
||||
};
|
||||
|
||||
#endif // wxUSE_DIRDLG
|
||||
|
||||
#endif
|
||||
// _WX_DIRCTRLG_H_
|
||||
|
@@ -19,6 +19,9 @@
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_GRID
|
||||
|
||||
#include "wx/panel.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/scrolbar.h"
|
||||
@@ -420,5 +423,7 @@ typedef void (wxEvtHandler::*wxGridEventFunction)(wxGridEvent&);
|
||||
#define EVT_GRID_LABEL_LCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_LABEL_LCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL),
|
||||
#define EVT_GRID_LABEL_RCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_LABEL_RCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL),
|
||||
|
||||
#endif // wxUSE_GRID
|
||||
|
||||
#endif // __GRIDH_G__
|
||||
|
||||
|
@@ -198,8 +198,10 @@ class WXDLLEXPORT wxLayoutAlgorithm: public wxObject
|
||||
public:
|
||||
wxLayoutAlgorithm() {}
|
||||
|
||||
#if wxUSE_MDI_ARCHITECTURE
|
||||
// The MDI client window is sized to whatever's left over.
|
||||
bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = (wxRect*) NULL);
|
||||
#endif // wxUSE_MDI_ARCHITECTURE
|
||||
|
||||
// mainWindow is sized to whatever's left over. This function for backward
|
||||
// compatibility; use LayoutWindow.
|
||||
|
@@ -71,9 +71,11 @@ public:
|
||||
// to the dialog via validators.
|
||||
virtual void InitDialog();
|
||||
|
||||
#if wxUSE_BUTTON
|
||||
// a default button is activated when Enter is pressed
|
||||
wxButton *GetDefaultItem() const { return m_btnDefault; }
|
||||
void SetDefaultItem(wxButton *btn) { m_btnDefault = btn; }
|
||||
#endif // wxUSE_BUTTON
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
@@ -109,8 +111,10 @@ protected:
|
||||
// the child which had the focus last time this panel was activated
|
||||
wxWindow *m_winLastFocused;
|
||||
|
||||
#if wxUSE_BUTTON
|
||||
// a default button or NULL
|
||||
wxButton *m_btnDefault;
|
||||
#endif // wxUSE_BUTTON
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPanel)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/scrolwin.h
|
||||
// Purpose: wxScrolledWindow class
|
||||
// Purpose: wxGenericScrolledWindow class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
@@ -30,25 +30,32 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
|
||||
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
|
||||
#endif
|
||||
|
||||
// avoid triggering this stupid VC++ warning
|
||||
#ifdef __VISUALC__
|
||||
#pragma warning(disable:4355) // 'this' used in base member initializer list
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericScrolledWindow
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel
|
||||
class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel,
|
||||
public wxScrollHelper
|
||||
{
|
||||
public:
|
||||
wxGenericScrolledWindow();
|
||||
wxGenericScrolledWindow() : wxScrollHelper(this) { }
|
||||
wxGenericScrolledWindow(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxScrolledWindowStyle,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
: wxScrollHelper(this)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxGenericScrolledWindow();
|
||||
virtual ~wxGenericScrolledWindow();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
@@ -57,100 +64,15 @@ public:
|
||||
long style = wxScrolledWindowStyle,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
// Normally the wxGenericScrolledWindow will scroll itself, but in
|
||||
// some rare occasions you might want it to scroll another
|
||||
// window (e.g. a child of it in order to scroll only a portion
|
||||
// the area between the scrollbars (spreadsheet: only cell area
|
||||
// will move).
|
||||
virtual void SetTargetWindow( wxWindow *target );
|
||||
virtual wxWindow *GetTargetWindow();
|
||||
|
||||
// Number of pixels per user unit (0 or -1 for no scrollbar)
|
||||
// Length of virtual canvas in user units
|
||||
// Length of page in user units
|
||||
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
||||
int noUnitsX, int noUnitsY,
|
||||
int xPos = 0, int yPos = 0,
|
||||
bool noRefresh = FALSE );
|
||||
|
||||
// Physically scroll the window
|
||||
virtual void Scroll(int x_pos, int y_pos);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
virtual void GetScrollUnitsPerPage(int *x_page, int *y_page) const;
|
||||
virtual void CalcUnscrolledPosition(int x, int y, float *xx, float *yy) const;
|
||||
#endif
|
||||
|
||||
int GetScrollPageSize(int orient) const;
|
||||
void SetScrollPageSize(int orient, int pageSize);
|
||||
|
||||
virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const;
|
||||
|
||||
// Enable/disable Windows scrolling in either direction.
|
||||
// If TRUE, wxWindows scrolls the canvas and only a bit of
|
||||
// the canvas is invalidated; no Clear() is necessary.
|
||||
// If FALSE, the whole canvas is invalidated and a Clear() is
|
||||
// necessary. Disable for when the scroll increment is used
|
||||
// to actually scroll a non-constant distance
|
||||
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
|
||||
|
||||
// Get the view start
|
||||
virtual void GetViewStart(int *x, int *y) const;
|
||||
// Compatibility
|
||||
void ViewStart(int *x, int *y) const
|
||||
{ GetViewStart( x, y ); }
|
||||
|
||||
// Actual size in pixels when scrolling is taken into account
|
||||
virtual void GetVirtualSize(int *x, int *y) const;
|
||||
|
||||
// Set the scale factor, used in PrepareDC
|
||||
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
|
||||
double GetScaleX() const { return m_scaleX; }
|
||||
double GetScaleY() const { return m_scaleY; }
|
||||
|
||||
virtual void CalcScrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||
virtual void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||
|
||||
// Adjust the scrollbars
|
||||
virtual void AdjustScrollbars(void);
|
||||
|
||||
// Override this function to draw the graphic (or just process EVT_PAINT)
|
||||
virtual void OnDraw(wxDC& WXUNUSED(dc)) {};
|
||||
|
||||
// Override this function if you don't want to have wxGenericScrolledWindow
|
||||
// automatically change the origin according to the scroll position.
|
||||
virtual void PrepareDC(wxDC& dc);
|
||||
|
||||
// implementation from now on
|
||||
void OnScroll(wxScrollWinEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
void OnMouseWheel(wxMouseEvent& event);
|
||||
|
||||
// Calculate scroll increment
|
||||
virtual int CalcScrollInc(wxScrollWinEvent& event);
|
||||
|
||||
protected:
|
||||
wxWindow *m_targetWindow;
|
||||
int m_xScrollPixelsPerLine;
|
||||
int m_yScrollPixelsPerLine;
|
||||
bool m_xScrollingEnabled;
|
||||
bool m_yScrollingEnabled;
|
||||
int m_xScrollPosition;
|
||||
int m_yScrollPosition;
|
||||
int m_xScrollLines;
|
||||
int m_yScrollLines;
|
||||
int m_xScrollLinesPerPage;
|
||||
int m_yScrollLinesPerPage;
|
||||
double m_scaleX;
|
||||
double m_scaleY;
|
||||
int m_wheelRotation;
|
||||
virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_ABSTRACT_CLASS(wxGenericScrolledWindow)
|
||||
};
|
||||
|
||||
#ifdef __VISUALC__
|
||||
#pragma warning(default:4355)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_GENERIC_SCROLLWIN_H_
|
||||
|
@@ -12,16 +12,105 @@
|
||||
#ifndef _WX_GENERIC_SPINCTRL_H_
|
||||
#define _WX_GENERIC_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
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "spinctlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
class WXDLLEXPORT wxSpinButton;
|
||||
class WXDLLEXPORT wxTextCtrl;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// generic wxSpinCtrl is just a text control
|
||||
// wxSpinCtrl is a combination of wxTextCtrl and wxSpinButton
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT 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"))
|
||||
{
|
||||
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"));
|
||||
|
||||
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;
|
||||
|
||||
protected:
|
||||
// override the base class virtuals involved into geometry calculations
|
||||
virtual wxSize DoGetBestClientSize() 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;
|
||||
};
|
||||
|
||||
#else // !wxUSE_SPINBTN
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSpinCtrl is just a text control
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
|
||||
class WXDLLEXPORT wxSpinCtrl : public wxTextCtrl
|
||||
{
|
||||
public:
|
||||
@@ -86,5 +175,7 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
||||
};
|
||||
|
||||
#endif // wxUSE_SPINBTN/!wxUSE_SPINBTN
|
||||
|
||||
#endif // _WX_GENERIC_SPINCTRL_H_
|
||||
|
||||
|
@@ -16,6 +16,8 @@
|
||||
#pragma interface "treectlg.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_TREECTRL
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/object.h"
|
||||
@@ -450,5 +452,7 @@ public:
|
||||
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_TREECTRL
|
||||
|
||||
#endif // _GENERIC_TREECTRL_H_
|
||||
|
||||
|
@@ -1,110 +1,4 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: accel.h
|
||||
// Purpose: wxAcceleratorTable class
|
||||
// Author: Robert Roebling
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKACCELH__
|
||||
#define __GTKACCELH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "accel.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxAcceleratorEntry;
|
||||
class wxAcceleratorTable;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern wxAcceleratorTable wxNullAcceleratorTable;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Hold Ctrl key down
|
||||
#define wxACCEL_ALT 0x01
|
||||
|
||||
// Hold Ctrl key down
|
||||
#define wxACCEL_CTRL 0x02
|
||||
|
||||
// Hold Shift key down
|
||||
#define wxACCEL_SHIFT 0x04
|
||||
|
||||
// Hold no other key
|
||||
#define wxACCEL_NORMAL 0x00
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxAcceleratorEntry
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxAcceleratorEntry: public wxObject
|
||||
{
|
||||
public:
|
||||
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0)
|
||||
{ m_flags = flags; m_keyCode = keyCode; m_command = cmd; }
|
||||
|
||||
inline void Set(int flags, int keyCode, int cmd)
|
||||
{ m_flags = flags; m_keyCode = keyCode; m_command = cmd; }
|
||||
|
||||
inline int GetFlags() const { return m_flags; }
|
||||
inline int GetKeyCode() const { return m_keyCode; }
|
||||
inline int GetCommand() const { return m_command; }
|
||||
|
||||
int m_flags;
|
||||
int m_keyCode; // ASCII or virtual keycode
|
||||
int m_command; // Command id to generate
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxAcceleratorTable
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxAcceleratorTable: public wxObject
|
||||
{
|
||||
public:
|
||||
wxAcceleratorTable();
|
||||
wxAcceleratorTable(int n, wxAcceleratorEntry entries[] );
|
||||
~wxAcceleratorTable();
|
||||
|
||||
inline wxAcceleratorTable(const wxAcceleratorTable& accel) : wxObject()
|
||||
{ Ref(accel); }
|
||||
inline wxAcceleratorTable(const wxAcceleratorTable* accel)
|
||||
{ if (accel) Ref(*accel); }
|
||||
inline bool operator == (const wxAcceleratorTable& accel)
|
||||
{ return m_refData == accel.m_refData; }
|
||||
inline bool operator != (const wxAcceleratorTable& accel)
|
||||
{ return m_refData != accel.m_refData; }
|
||||
inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel)
|
||||
{ if (*this == accel) return (*this); Ref(accel); return *this; }
|
||||
|
||||
bool Ok() const;
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
int GetCommand( wxKeyEvent &event );
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// VZ: keeping the old file just in case we're going to have a native GTK+
|
||||
// wxAcceleratorTable implementation one day, but for now use the generic
|
||||
// version
|
||||
#include "wx/generic/accel.h"
|
||||
|
@@ -74,7 +74,7 @@ public:
|
||||
unsigned char *m_colorCube;
|
||||
|
||||
private:
|
||||
/// Set to TRUE while we are in wxYield().
|
||||
// Set to TRUE while we are in wxYield().
|
||||
bool m_suppressIdleEvents;
|
||||
|
||||
private:
|
||||
|
@@ -15,71 +15,41 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_BMPBUTTON
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/button.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxBitmapButton;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const wxChar *wxButtonNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapButton
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxBitmapButton: public wxButton
|
||||
class wxBitmapButton: public wxBitmapButtonBase
|
||||
{
|
||||
public:
|
||||
wxBitmapButton();
|
||||
inline 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 )
|
||||
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);
|
||||
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 SetDefault();
|
||||
virtual bool Enable(bool enable = TRUE);
|
||||
|
||||
void SetLabel( const wxString &label );
|
||||
wxString GetLabel() const;
|
||||
virtual void SetLabel( const wxBitmap& bitmap ) { SetBitmapLabel(bitmap); }
|
||||
|
||||
wxBitmap& GetBitmapDisabled() const { return (wxBitmap&) m_disabled; }
|
||||
wxBitmap& GetBitmapFocus() const { return (wxBitmap&) m_focus; }
|
||||
wxBitmap& GetBitmapLabel() const { return (wxBitmap&) m_bitmap; }
|
||||
wxBitmap& GetBitmapSelected() const { return (wxBitmap&) m_selected; }
|
||||
|
||||
void SetBitmapDisabled( const wxBitmap& bitmap );
|
||||
void SetBitmapFocus( const wxBitmap& bitmap );
|
||||
void SetBitmapLabel( const wxBitmap& bitmap );
|
||||
void SetBitmapSelected( const wxBitmap& bitmap );
|
||||
|
||||
void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
|
||||
int GetMarginX() const { return m_marginX; }
|
||||
int GetMarginY() const { return m_marginY; }
|
||||
|
||||
virtual bool Enable(bool enable);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
@@ -92,19 +62,12 @@ public:
|
||||
|
||||
bool m_hasFocus;
|
||||
bool m_isSelected;
|
||||
wxBitmap m_bitmap;
|
||||
wxBitmap m_disabled;
|
||||
wxBitmap m_focus;
|
||||
wxBitmap m_selected;
|
||||
|
||||
protected:
|
||||
int m_marginX;
|
||||
int m_marginY;
|
||||
virtual void OnSetBitmap();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __BMPBUTTONH__
|
||||
|
@@ -14,31 +14,11 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_CHECKBOX
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxCheckBox;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char *wxCheckBoxNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCheckBox
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxCheckBox: public wxControl
|
||||
class wxCheckBox : public wxCheckBoxBase
|
||||
{
|
||||
public:
|
||||
wxCheckBox();
|
||||
@@ -74,7 +54,7 @@ public:
|
||||
|
||||
GtkWidget *m_widgetCheckbox;
|
||||
GtkWidget *m_widgetLabel;
|
||||
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
@@ -82,6 +62,4 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckBox)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKCHECKBOXH__
|
||||
|
@@ -15,15 +15,6 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_CHECKLISTBOX
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/listbox.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -37,7 +28,7 @@
|
||||
#define wxCHECKLBOX_STRING _T("[ ] ")
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxCheckListBox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -63,6 +54,4 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckListBox)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif //__GTKCHECKLISTH__
|
||||
|
@@ -86,6 +86,7 @@ public:
|
||||
int GetSelection() const;
|
||||
wxString GetString( int n ) const;
|
||||
wxString GetStringSelection() const;
|
||||
int GetCount() const { return Number(); }
|
||||
int Number() const;
|
||||
void SetSelection( int n );
|
||||
void SetStringSelection( const wxString &string );
|
||||
|
@@ -29,8 +29,6 @@ class wxControl;
|
||||
// wxControl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const wxChar* wxControlNameStr;
|
||||
|
||||
class wxControl : public wxControlBase
|
||||
{
|
||||
public:
|
||||
|
@@ -140,7 +140,7 @@ private:
|
||||
class wxClientDC : public wxWindowDC
|
||||
{
|
||||
public:
|
||||
wxClientDC() { }
|
||||
wxClientDC();
|
||||
wxClientDC( wxWindow *win );
|
||||
|
||||
protected:
|
||||
|
@@ -26,24 +26,22 @@ class wxMenuBar;
|
||||
class wxToolBar;
|
||||
class wxStatusBar;
|
||||
|
||||
class wxFrame;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxFrame
|
||||
// wxFrameGTK
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxFrame : public wxFrameBase
|
||||
class wxFrameGTK : 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)
|
||||
wxFrameGTK() { Init(); }
|
||||
wxFrameGTK(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();
|
||||
|
||||
@@ -58,7 +56,7 @@ public:
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxFrame();
|
||||
virtual ~wxFrameGTK();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Maximize(bool maximize = TRUE);
|
||||
@@ -72,7 +70,9 @@ public:
|
||||
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
|
||||
virtual bool IsFullScreen() const { return m_fsIsShowing; };
|
||||
|
||||
#if wxUSE_MENUS
|
||||
virtual void SetMenuBar( wxMenuBar *menuBar );
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
virtual void PositionStatusBar();
|
||||
@@ -138,7 +138,7 @@ protected:
|
||||
bool m_isIconized;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxFrame)
|
||||
DECLARE_DYNAMIC_CLASS(wxFrameGTK)
|
||||
};
|
||||
|
||||
#endif // __GTKFRAMEH__
|
||||
|
@@ -15,23 +15,6 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_NOTEBOOK
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxImageList;
|
||||
class wxNotebook;
|
||||
|
||||
typedef wxWindow wxNotebookPage; // so far, any window can be a page
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// internal class
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -42,7 +25,7 @@ class wxGtkNotebookPage;
|
||||
// wxNotebook
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxNotebook : public wxControl
|
||||
class wxNotebook : public wxNotebookBase
|
||||
{
|
||||
public:
|
||||
// default for dynamic class
|
||||
@@ -66,15 +49,11 @@ public:
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
// get number of pages in the dialog
|
||||
int GetPageCount() const;
|
||||
|
||||
// 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(int nPage);
|
||||
// cycle thru the tabs
|
||||
void AdvanceSelection(bool bForward = TRUE);
|
||||
// get the currently selected page
|
||||
int GetSelection() const;
|
||||
|
||||
@@ -90,17 +69,11 @@ public:
|
||||
// associate image list with a control
|
||||
void SetImageList(wxImageList* imageList);
|
||||
void AssignImageList(wxImageList* imageList);
|
||||
// get pointer (may be NULL) to the associated image list
|
||||
wxImageList *GetImageList() const { return m_imageList; }
|
||||
|
||||
// sets/returns item's image index in the current image list
|
||||
int GetPageImage(int nPage) const;
|
||||
bool SetPageImage(int nPage, int nImage);
|
||||
|
||||
// currently it's always 1 because wxGTK doesn't support multi-row
|
||||
// tab controls
|
||||
int GetRowCount() const;
|
||||
|
||||
// control the appearance of the notebook pages
|
||||
// set the size (the same for all pages)
|
||||
void SetPageSize(const wxSize& size);
|
||||
@@ -111,13 +84,11 @@ public:
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
// remove one page from the notebook but do not destroy it
|
||||
bool RemovePage(int nPage);
|
||||
// remove one page from the notebook
|
||||
bool DeletePage(int nPage);
|
||||
// remove all pages
|
||||
bool DeleteAllPages();
|
||||
|
||||
|
||||
// adds a new page to the notebook (it will be deleted ny the notebook,
|
||||
// don't delete it yourself). If bSelect, this page becomes active.
|
||||
bool AddPage( wxNotebookPage *win,
|
||||
@@ -131,9 +102,6 @@ public:
|
||||
bool bSelect = FALSE,
|
||||
int imageId = -1 );
|
||||
|
||||
// get the panel which represents the given page
|
||||
wxNotebookPage *GetPage(int nPage) const;
|
||||
|
||||
// handler for tab navigation
|
||||
// --------------------------
|
||||
void OnNavigationKey(wxNavigationKeyEvent& event);
|
||||
@@ -148,7 +116,7 @@ public:
|
||||
|
||||
void ApplyWidgetStyle();
|
||||
|
||||
// report if window belongs to notebook
|
||||
// report if window belongs to notebook
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
|
||||
// common part of all ctors
|
||||
@@ -157,7 +125,6 @@ public:
|
||||
// helper function
|
||||
wxGtkNotebookPage* GetNotebookPage(int page) const;
|
||||
|
||||
wxImageList* m_imageList;
|
||||
bool m_ownsImageList;
|
||||
wxList m_pages;
|
||||
|
||||
@@ -165,12 +132,14 @@ public:
|
||||
// selection internally instead of querying the notebook for it
|
||||
int m_selection;
|
||||
|
||||
protected:
|
||||
// remove one page from the notebook but do not destroy it
|
||||
virtual wxNotebookPage *DoRemovePage(int nPage);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxNotebook)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __GTKNOTEBOOKH__
|
||||
|
@@ -15,27 +15,8 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_RADIOBOX
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxRadioBox;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char *wxRadioBoxNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxRadioBox
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -97,7 +78,8 @@ public:
|
||||
virtual wxString GetStringSelection() const;
|
||||
virtual bool SetStringSelection( const wxString& s );
|
||||
|
||||
virtual int Number() const;
|
||||
int Number() const;
|
||||
int GetCount() const { return Number(); }
|
||||
int GetNumberOfRowsOrCols() const;
|
||||
void SetNumberOfRowsOrCols( int n );
|
||||
|
||||
@@ -131,6 +113,4 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKRADIOBOXH__
|
||||
|
@@ -15,26 +15,6 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_RADIOBOX
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxRadioButton;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char* wxRadioButtonNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxRadioButton
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -77,6 +57,4 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKRADIOBUTTONH__
|
||||
|
@@ -30,13 +30,13 @@ class wxRegion;
|
||||
|
||||
enum wxRegionContain
|
||||
{
|
||||
wxOutRegion = 0,
|
||||
wxPartRegion = 1,
|
||||
wxOutRegion = 0,
|
||||
wxPartRegion = 1,
|
||||
wxInRegion = 2
|
||||
};
|
||||
|
||||
// So far, for internal use only
|
||||
enum wxRegionOp
|
||||
enum wxRegionOp
|
||||
{
|
||||
wxRGN_AND, // Creates the intersection of the two combined regions.
|
||||
wxRGN_COPY, // Creates a copy of the region identified by hrgnSrc1.
|
||||
@@ -45,9 +45,9 @@ enum wxRegionOp
|
||||
wxRGN_XOR // Creates the union of two combined regions except for any overlapping areas.
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegion
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxRegion : public wxGDIObject
|
||||
{
|
||||
@@ -56,12 +56,10 @@ public:
|
||||
wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight );
|
||||
wxRegion( const wxRect& rect );
|
||||
wxRegion();
|
||||
~wxRegion();
|
||||
virtual ~wxRegion();
|
||||
|
||||
inline wxRegion( const wxRegion& r ): wxGDIObject()
|
||||
{ Ref(r); }
|
||||
inline wxRegion& operator = ( const wxRegion& r )
|
||||
{ Ref(r); return (*this); }
|
||||
wxRegion( const wxRegion& r ) { Ref(r); }
|
||||
wxRegion& operator = ( const wxRegion& r ) { Ref(r); return *this; }
|
||||
|
||||
bool operator == ( const wxRegion& region );
|
||||
bool operator != ( const wxRegion& region );
|
||||
@@ -98,11 +96,22 @@ public:
|
||||
public:
|
||||
wxList *GetRectList() const;
|
||||
GdkRegion *GetRegion() const;
|
||||
|
||||
|
||||
protected:
|
||||
// helper of Intersect()
|
||||
bool IntersectRegionOnly(const wxRegion& reg);
|
||||
|
||||
// call this before modifying the region
|
||||
void Unshare();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxRegion);
|
||||
DECLARE_DYNAMIC_CLASS(wxRegion);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegionIterator: decomposes a region into rectangles
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxRegionIterator: public wxObject
|
||||
{
|
||||
public:
|
||||
@@ -124,7 +133,7 @@ public:
|
||||
wxCoord GetWidth() const { return GetW(); }
|
||||
wxCoord GetH() const;
|
||||
wxCoord GetHeight() const { return GetH(); }
|
||||
wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
|
||||
wxRect GetRect() const;
|
||||
|
||||
private:
|
||||
size_t m_current;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -17,31 +17,20 @@
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_SCROLLBAR
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxScrollBar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char *wxScrollBarNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxScrollBar
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxScrollBar: public wxControl
|
||||
class wxScrollBar: public wxScrollBarBase
|
||||
{
|
||||
public:
|
||||
wxScrollBar()
|
||||
wxScrollBar()
|
||||
{ m_adjust = (GtkAdjustment *) NULL; m_oldPos = 0.0; }
|
||||
inline wxScrollBar( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
@@ -69,7 +58,7 @@ public:
|
||||
|
||||
// Backward compatibility
|
||||
// ----------------------
|
||||
|
||||
|
||||
int GetValue(void) const;
|
||||
void SetValue( int viewStart );
|
||||
void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const;
|
||||
@@ -81,18 +70,16 @@ public:
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void ApplyWidgetStyle();
|
||||
|
||||
|
||||
GtkAdjustment *m_adjust;
|
||||
float m_oldPos;
|
||||
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxScrollBar)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __GTKSCROLLBARH__
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: slider.h
|
||||
// Name: wx/gtk/slider.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKSLIDERH__
|
||||
@@ -14,70 +14,51 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_SLIDER
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxSlider;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char *wxSliderNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSlider
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxSlider: public wxControl
|
||||
class wxSlider : public wxSliderBase
|
||||
{
|
||||
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 )
|
||||
wxSlider() { }
|
||||
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 );
|
||||
Create( parent, id, value, minValue, maxValue,
|
||||
pos, size, style, validator, name );
|
||||
}
|
||||
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 );
|
||||
|
||||
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);
|
||||
|
||||
// implement the base class pure virtuals
|
||||
virtual int GetValue() const;
|
||||
virtual void SetValue( int );
|
||||
void SetRange( int minValue, int maxValue );
|
||||
int GetMin() const;
|
||||
int GetMax() const;
|
||||
void SetTickFreq( int n, int pos );
|
||||
int GetTickFreq() const;
|
||||
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 );
|
||||
virtual void SetValue(int value);
|
||||
|
||||
virtual void SetRange(int minValue, int maxValue);
|
||||
virtual int GetMin() const;
|
||||
virtual int GetMax() const;
|
||||
|
||||
virtual void SetLineSize(int lineSize);
|
||||
virtual void SetPageSize(int pageSize);
|
||||
virtual int GetLineSize() const;
|
||||
virtual int GetPageSize() const;
|
||||
|
||||
virtual void SetThumbLength(int lenPixels);
|
||||
virtual int GetThumbLength() const;
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
@@ -92,6 +73,4 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSlider)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKSLIDERH__
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: spinbutt.h
|
||||
// Name: wx/gtk/spinbutt.h
|
||||
// Purpose: wxSpinButton class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
@@ -8,19 +8,13 @@
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKSPINBUTTH__
|
||||
#define __GTKSPINBUTTH__
|
||||
#ifndef _WX_GTK_SPINBUTT_H_
|
||||
#define _WX_GTK_SPINBUTT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_SPINBTN
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxSpinButton
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -29,16 +23,22 @@ class wxSpinButton : public wxSpinButtonBase
|
||||
{
|
||||
public:
|
||||
wxSpinButton() { }
|
||||
wxSpinButton( wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_VERTICAL, const wxString& name = "wxSpinButton")
|
||||
wxSpinButton(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_VERTICAL,
|
||||
const wxString& name = wxSPIN_BUTTON_NAME)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create( wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_VERTICAL, const wxString& name = "wxSpinButton" );
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_VERTICAL,
|
||||
const wxString& name = wxSPIN_BUTTON_NAME);
|
||||
|
||||
virtual int GetValue() const;
|
||||
virtual void SetValue( int value );
|
||||
@@ -64,7 +64,4 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
// wxUSE_SPINBTN
|
||||
|
||||
#endif
|
||||
// __GTKSPINBUTTH__
|
||||
// _WX_GTK_SPINBUTT_H_
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: statbmp.h
|
||||
// Name: wx/gtk/statbmp.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
@@ -15,35 +15,14 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_STATBMP
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/icon.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxStaticBitmap;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char* wxStaticBitmapNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticBitmap
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxStaticBitmap: public wxControl
|
||||
class wxStaticBitmap : public wxStaticBitmapBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||
|
||||
public:
|
||||
wxStaticBitmap();
|
||||
wxStaticBitmap( wxWindow *parent,
|
||||
@@ -61,35 +40,25 @@ public:
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr);
|
||||
|
||||
virtual void SetIcon(const wxIcon& icon) { SetBitmap( icon ); }
|
||||
virtual void SetBitmap( const wxBitmap& bitmap );
|
||||
|
||||
wxBitmap& GetBitmap() { return m_bitmap; }
|
||||
const wxBitmap& GetBitmap() const { return m_bitmap; }
|
||||
virtual wxBitmap GetBitmap() const { return m_bitmap; }
|
||||
|
||||
// for compatibility with wxMSW
|
||||
const wxIcon& GetIcon() const
|
||||
wxIcon GetIcon() const
|
||||
{
|
||||
// don't use wxDynamicCast, icons and bitmaps are really the same thing
|
||||
// in wxGTK
|
||||
return (const wxIcon &)m_bitmap;
|
||||
}
|
||||
|
||||
// for compatibility with wxMSW
|
||||
void SetIcon(const wxIcon& icon)
|
||||
{
|
||||
SetBitmap( icon );
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
// creates the new pixmap widget
|
||||
void CreatePixmapWidget();
|
||||
|
||||
wxBitmap m_bitmap;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKSTATICBITMAPH__
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: stabox.h
|
||||
// Name: wx/gtk/stabox.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -15,50 +15,37 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_STATBOX
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxStaticBox;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char *wxStaticBoxNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticBox
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxStaticBox: public wxControl
|
||||
class wxStaticBox : public wxStaticBoxBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
public:
|
||||
wxStaticBox();
|
||||
wxStaticBox( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = wxStaticBoxNameStr );
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = wxStaticBoxNameStr );
|
||||
|
||||
public:
|
||||
virtual void SetLabel( const wxString &label );
|
||||
|
||||
wxStaticBox(void);
|
||||
wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
||||
long style = 0, const wxString &name = wxStaticBoxNameStr );
|
||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
||||
long style = 0, const wxString &name = wxStaticBoxNameStr );
|
||||
void SetLabel( const wxString &label );
|
||||
// implementation
|
||||
|
||||
// implementation
|
||||
|
||||
void ApplyWidgetStyle();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKSTATICBOXH__
|
||||
|
@@ -30,8 +30,6 @@ class wxStaticText;
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const wxChar *wxStaticTextNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticText
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -96,10 +96,6 @@ public:
|
||||
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();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: window.h
|
||||
// Name: wx/gtk/window.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
@@ -19,33 +19,32 @@
|
||||
// callback definition for inserting a window (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
typedef void (*wxInsertChildFunction)( wxWindow*, wxWindow* );
|
||||
class wxWindowGTK;
|
||||
typedef void (*wxInsertChildFunction)( wxWindowGTK*, wxWindowGTK* );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWindow
|
||||
// wxWindowGTK
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxWindow : public wxWindowBase
|
||||
class wxWindowGTK : public wxWindowBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxWindow)
|
||||
|
||||
public:
|
||||
// creating the window
|
||||
// -------------------
|
||||
wxWindow();
|
||||
wxWindow(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
wxWindowGTK();
|
||||
wxWindowGTK(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
virtual ~wxWindow();
|
||||
virtual ~wxWindowGTK();
|
||||
|
||||
// implement base class (pure) virtual methods
|
||||
// -------------------------------------------
|
||||
@@ -86,7 +85,9 @@ public:
|
||||
const wxFont *theFont = (const wxFont *) NULL)
|
||||
const;
|
||||
|
||||
#if wxUSE_MENUS
|
||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||
int range, bool refresh = TRUE );
|
||||
@@ -120,13 +121,13 @@ public:
|
||||
virtual void OnParentEnable( bool WXUNUSED(enable) ) {};
|
||||
|
||||
/* used by all window classes in the widget creation process */
|
||||
bool PreCreation( wxWindow *parent, const wxPoint &pos, const wxSize &size );
|
||||
bool PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size );
|
||||
void PostCreation();
|
||||
|
||||
/* internal addition of child windows. differs from class
|
||||
to class not by using virtual functions but by using
|
||||
the m_insertCallback */
|
||||
void DoAddChild(wxWindow *child);
|
||||
void DoAddChild(wxWindowGTK *child);
|
||||
|
||||
/* the methods below are required because many native widgets
|
||||
are composed of several subwidgets and setting a style for
|
||||
@@ -231,7 +232,8 @@ public:
|
||||
void Init();
|
||||
|
||||
private:
|
||||
DECLARE_NO_COPY_CLASS(wxWindow);
|
||||
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
|
||||
DECLARE_NO_COPY_CLASS(wxWindowGTK);
|
||||
};
|
||||
|
||||
#endif // __GTKWINDOWH__
|
||||
|
@@ -1,110 +1,4 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: accel.h
|
||||
// Purpose: wxAcceleratorTable class
|
||||
// Author: Robert Roebling
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKACCELH__
|
||||
#define __GTKACCELH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "accel.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxAcceleratorEntry;
|
||||
class wxAcceleratorTable;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern wxAcceleratorTable wxNullAcceleratorTable;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Hold Ctrl key down
|
||||
#define wxACCEL_ALT 0x01
|
||||
|
||||
// Hold Ctrl key down
|
||||
#define wxACCEL_CTRL 0x02
|
||||
|
||||
// Hold Shift key down
|
||||
#define wxACCEL_SHIFT 0x04
|
||||
|
||||
// Hold no other key
|
||||
#define wxACCEL_NORMAL 0x00
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxAcceleratorEntry
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxAcceleratorEntry: public wxObject
|
||||
{
|
||||
public:
|
||||
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0)
|
||||
{ m_flags = flags; m_keyCode = keyCode; m_command = cmd; }
|
||||
|
||||
inline void Set(int flags, int keyCode, int cmd)
|
||||
{ m_flags = flags; m_keyCode = keyCode; m_command = cmd; }
|
||||
|
||||
inline int GetFlags() const { return m_flags; }
|
||||
inline int GetKeyCode() const { return m_keyCode; }
|
||||
inline int GetCommand() const { return m_command; }
|
||||
|
||||
int m_flags;
|
||||
int m_keyCode; // ASCII or virtual keycode
|
||||
int m_command; // Command id to generate
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxAcceleratorTable
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxAcceleratorTable: public wxObject
|
||||
{
|
||||
public:
|
||||
wxAcceleratorTable();
|
||||
wxAcceleratorTable(int n, wxAcceleratorEntry entries[] );
|
||||
~wxAcceleratorTable();
|
||||
|
||||
inline wxAcceleratorTable(const wxAcceleratorTable& accel) : wxObject()
|
||||
{ Ref(accel); }
|
||||
inline wxAcceleratorTable(const wxAcceleratorTable* accel)
|
||||
{ if (accel) Ref(*accel); }
|
||||
inline bool operator == (const wxAcceleratorTable& accel)
|
||||
{ return m_refData == accel.m_refData; }
|
||||
inline bool operator != (const wxAcceleratorTable& accel)
|
||||
{ return m_refData != accel.m_refData; }
|
||||
inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel)
|
||||
{ if (*this == accel) return (*this); Ref(accel); return *this; }
|
||||
|
||||
bool Ok() const;
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
int GetCommand( wxKeyEvent &event );
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// VZ: keeping the old file just in case we're going to have a native GTK+
|
||||
// wxAcceleratorTable implementation one day, but for now use the generic
|
||||
// version
|
||||
#include "wx/generic/accel.h"
|
||||
|
@@ -74,7 +74,7 @@ public:
|
||||
unsigned char *m_colorCube;
|
||||
|
||||
private:
|
||||
/// Set to TRUE while we are in wxYield().
|
||||
// Set to TRUE while we are in wxYield().
|
||||
bool m_suppressIdleEvents;
|
||||
|
||||
private:
|
||||
|
@@ -15,71 +15,41 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_BMPBUTTON
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/button.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxBitmapButton;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const wxChar *wxButtonNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapButton
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxBitmapButton: public wxButton
|
||||
class wxBitmapButton: public wxBitmapButtonBase
|
||||
{
|
||||
public:
|
||||
wxBitmapButton();
|
||||
inline 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 )
|
||||
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);
|
||||
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 SetDefault();
|
||||
virtual bool Enable(bool enable = TRUE);
|
||||
|
||||
void SetLabel( const wxString &label );
|
||||
wxString GetLabel() const;
|
||||
virtual void SetLabel( const wxBitmap& bitmap ) { SetBitmapLabel(bitmap); }
|
||||
|
||||
wxBitmap& GetBitmapDisabled() const { return (wxBitmap&) m_disabled; }
|
||||
wxBitmap& GetBitmapFocus() const { return (wxBitmap&) m_focus; }
|
||||
wxBitmap& GetBitmapLabel() const { return (wxBitmap&) m_bitmap; }
|
||||
wxBitmap& GetBitmapSelected() const { return (wxBitmap&) m_selected; }
|
||||
|
||||
void SetBitmapDisabled( const wxBitmap& bitmap );
|
||||
void SetBitmapFocus( const wxBitmap& bitmap );
|
||||
void SetBitmapLabel( const wxBitmap& bitmap );
|
||||
void SetBitmapSelected( const wxBitmap& bitmap );
|
||||
|
||||
void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
|
||||
int GetMarginX() const { return m_marginX; }
|
||||
int GetMarginY() const { return m_marginY; }
|
||||
|
||||
virtual bool Enable(bool enable);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
@@ -92,19 +62,12 @@ public:
|
||||
|
||||
bool m_hasFocus;
|
||||
bool m_isSelected;
|
||||
wxBitmap m_bitmap;
|
||||
wxBitmap m_disabled;
|
||||
wxBitmap m_focus;
|
||||
wxBitmap m_selected;
|
||||
|
||||
protected:
|
||||
int m_marginX;
|
||||
int m_marginY;
|
||||
virtual void OnSetBitmap();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __BMPBUTTONH__
|
||||
|
@@ -14,31 +14,11 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_CHECKBOX
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxCheckBox;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char *wxCheckBoxNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCheckBox
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxCheckBox: public wxControl
|
||||
class wxCheckBox : public wxCheckBoxBase
|
||||
{
|
||||
public:
|
||||
wxCheckBox();
|
||||
@@ -74,7 +54,7 @@ public:
|
||||
|
||||
GtkWidget *m_widgetCheckbox;
|
||||
GtkWidget *m_widgetLabel;
|
||||
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
@@ -82,6 +62,4 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckBox)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKCHECKBOXH__
|
||||
|
@@ -15,15 +15,6 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_CHECKLISTBOX
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/listbox.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -37,7 +28,7 @@
|
||||
#define wxCHECKLBOX_STRING _T("[ ] ")
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxCheckListBox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -63,6 +54,4 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckListBox)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif //__GTKCHECKLISTH__
|
||||
|
@@ -86,6 +86,7 @@ public:
|
||||
int GetSelection() const;
|
||||
wxString GetString( int n ) const;
|
||||
wxString GetStringSelection() const;
|
||||
int GetCount() const { return Number(); }
|
||||
int Number() const;
|
||||
void SetSelection( int n );
|
||||
void SetStringSelection( const wxString &string );
|
||||
|
@@ -29,8 +29,6 @@ class wxControl;
|
||||
// wxControl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const wxChar* wxControlNameStr;
|
||||
|
||||
class wxControl : public wxControlBase
|
||||
{
|
||||
public:
|
||||
|
@@ -140,7 +140,7 @@ private:
|
||||
class wxClientDC : public wxWindowDC
|
||||
{
|
||||
public:
|
||||
wxClientDC() { }
|
||||
wxClientDC();
|
||||
wxClientDC( wxWindow *win );
|
||||
|
||||
protected:
|
||||
|
@@ -26,24 +26,22 @@ class wxMenuBar;
|
||||
class wxToolBar;
|
||||
class wxStatusBar;
|
||||
|
||||
class wxFrame;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxFrame
|
||||
// wxFrameGTK
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxFrame : public wxFrameBase
|
||||
class wxFrameGTK : 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)
|
||||
wxFrameGTK() { Init(); }
|
||||
wxFrameGTK(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();
|
||||
|
||||
@@ -58,7 +56,7 @@ public:
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxFrame();
|
||||
virtual ~wxFrameGTK();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Maximize(bool maximize = TRUE);
|
||||
@@ -72,7 +70,9 @@ public:
|
||||
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
|
||||
virtual bool IsFullScreen() const { return m_fsIsShowing; };
|
||||
|
||||
#if wxUSE_MENUS
|
||||
virtual void SetMenuBar( wxMenuBar *menuBar );
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
virtual void PositionStatusBar();
|
||||
@@ -138,7 +138,7 @@ protected:
|
||||
bool m_isIconized;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxFrame)
|
||||
DECLARE_DYNAMIC_CLASS(wxFrameGTK)
|
||||
};
|
||||
|
||||
#endif // __GTKFRAMEH__
|
||||
|
@@ -15,23 +15,6 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_NOTEBOOK
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxImageList;
|
||||
class wxNotebook;
|
||||
|
||||
typedef wxWindow wxNotebookPage; // so far, any window can be a page
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// internal class
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -42,7 +25,7 @@ class wxGtkNotebookPage;
|
||||
// wxNotebook
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxNotebook : public wxControl
|
||||
class wxNotebook : public wxNotebookBase
|
||||
{
|
||||
public:
|
||||
// default for dynamic class
|
||||
@@ -66,15 +49,11 @@ public:
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
// get number of pages in the dialog
|
||||
int GetPageCount() const;
|
||||
|
||||
// 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(int nPage);
|
||||
// cycle thru the tabs
|
||||
void AdvanceSelection(bool bForward = TRUE);
|
||||
// get the currently selected page
|
||||
int GetSelection() const;
|
||||
|
||||
@@ -90,17 +69,11 @@ public:
|
||||
// associate image list with a control
|
||||
void SetImageList(wxImageList* imageList);
|
||||
void AssignImageList(wxImageList* imageList);
|
||||
// get pointer (may be NULL) to the associated image list
|
||||
wxImageList *GetImageList() const { return m_imageList; }
|
||||
|
||||
// sets/returns item's image index in the current image list
|
||||
int GetPageImage(int nPage) const;
|
||||
bool SetPageImage(int nPage, int nImage);
|
||||
|
||||
// currently it's always 1 because wxGTK doesn't support multi-row
|
||||
// tab controls
|
||||
int GetRowCount() const;
|
||||
|
||||
// control the appearance of the notebook pages
|
||||
// set the size (the same for all pages)
|
||||
void SetPageSize(const wxSize& size);
|
||||
@@ -111,13 +84,11 @@ public:
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
// remove one page from the notebook but do not destroy it
|
||||
bool RemovePage(int nPage);
|
||||
// remove one page from the notebook
|
||||
bool DeletePage(int nPage);
|
||||
// remove all pages
|
||||
bool DeleteAllPages();
|
||||
|
||||
|
||||
// adds a new page to the notebook (it will be deleted ny the notebook,
|
||||
// don't delete it yourself). If bSelect, this page becomes active.
|
||||
bool AddPage( wxNotebookPage *win,
|
||||
@@ -131,9 +102,6 @@ public:
|
||||
bool bSelect = FALSE,
|
||||
int imageId = -1 );
|
||||
|
||||
// get the panel which represents the given page
|
||||
wxNotebookPage *GetPage(int nPage) const;
|
||||
|
||||
// handler for tab navigation
|
||||
// --------------------------
|
||||
void OnNavigationKey(wxNavigationKeyEvent& event);
|
||||
@@ -148,7 +116,7 @@ public:
|
||||
|
||||
void ApplyWidgetStyle();
|
||||
|
||||
// report if window belongs to notebook
|
||||
// report if window belongs to notebook
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
|
||||
// common part of all ctors
|
||||
@@ -157,7 +125,6 @@ public:
|
||||
// helper function
|
||||
wxGtkNotebookPage* GetNotebookPage(int page) const;
|
||||
|
||||
wxImageList* m_imageList;
|
||||
bool m_ownsImageList;
|
||||
wxList m_pages;
|
||||
|
||||
@@ -165,12 +132,14 @@ public:
|
||||
// selection internally instead of querying the notebook for it
|
||||
int m_selection;
|
||||
|
||||
protected:
|
||||
// remove one page from the notebook but do not destroy it
|
||||
virtual wxNotebookPage *DoRemovePage(int nPage);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxNotebook)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __GTKNOTEBOOKH__
|
||||
|
@@ -15,27 +15,8 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_RADIOBOX
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxRadioBox;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char *wxRadioBoxNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxRadioBox
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -97,7 +78,8 @@ public:
|
||||
virtual wxString GetStringSelection() const;
|
||||
virtual bool SetStringSelection( const wxString& s );
|
||||
|
||||
virtual int Number() const;
|
||||
int Number() const;
|
||||
int GetCount() const { return Number(); }
|
||||
int GetNumberOfRowsOrCols() const;
|
||||
void SetNumberOfRowsOrCols( int n );
|
||||
|
||||
@@ -131,6 +113,4 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKRADIOBOXH__
|
||||
|
@@ -15,26 +15,6 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_RADIOBOX
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxRadioButton;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char* wxRadioButtonNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxRadioButton
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -77,6 +57,4 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKRADIOBUTTONH__
|
||||
|
@@ -30,13 +30,13 @@ class wxRegion;
|
||||
|
||||
enum wxRegionContain
|
||||
{
|
||||
wxOutRegion = 0,
|
||||
wxPartRegion = 1,
|
||||
wxOutRegion = 0,
|
||||
wxPartRegion = 1,
|
||||
wxInRegion = 2
|
||||
};
|
||||
|
||||
// So far, for internal use only
|
||||
enum wxRegionOp
|
||||
enum wxRegionOp
|
||||
{
|
||||
wxRGN_AND, // Creates the intersection of the two combined regions.
|
||||
wxRGN_COPY, // Creates a copy of the region identified by hrgnSrc1.
|
||||
@@ -45,9 +45,9 @@ enum wxRegionOp
|
||||
wxRGN_XOR // Creates the union of two combined regions except for any overlapping areas.
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegion
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxRegion : public wxGDIObject
|
||||
{
|
||||
@@ -56,12 +56,10 @@ public:
|
||||
wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight );
|
||||
wxRegion( const wxRect& rect );
|
||||
wxRegion();
|
||||
~wxRegion();
|
||||
virtual ~wxRegion();
|
||||
|
||||
inline wxRegion( const wxRegion& r ): wxGDIObject()
|
||||
{ Ref(r); }
|
||||
inline wxRegion& operator = ( const wxRegion& r )
|
||||
{ Ref(r); return (*this); }
|
||||
wxRegion( const wxRegion& r ) { Ref(r); }
|
||||
wxRegion& operator = ( const wxRegion& r ) { Ref(r); return *this; }
|
||||
|
||||
bool operator == ( const wxRegion& region );
|
||||
bool operator != ( const wxRegion& region );
|
||||
@@ -98,11 +96,22 @@ public:
|
||||
public:
|
||||
wxList *GetRectList() const;
|
||||
GdkRegion *GetRegion() const;
|
||||
|
||||
|
||||
protected:
|
||||
// helper of Intersect()
|
||||
bool IntersectRegionOnly(const wxRegion& reg);
|
||||
|
||||
// call this before modifying the region
|
||||
void Unshare();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxRegion);
|
||||
DECLARE_DYNAMIC_CLASS(wxRegion);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegionIterator: decomposes a region into rectangles
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxRegionIterator: public wxObject
|
||||
{
|
||||
public:
|
||||
@@ -124,7 +133,7 @@ public:
|
||||
wxCoord GetWidth() const { return GetW(); }
|
||||
wxCoord GetH() const;
|
||||
wxCoord GetHeight() const { return GetH(); }
|
||||
wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
|
||||
wxRect GetRect() const;
|
||||
|
||||
private:
|
||||
size_t m_current;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -17,31 +17,20 @@
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_SCROLLBAR
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxScrollBar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char *wxScrollBarNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxScrollBar
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxScrollBar: public wxControl
|
||||
class wxScrollBar: public wxScrollBarBase
|
||||
{
|
||||
public:
|
||||
wxScrollBar()
|
||||
wxScrollBar()
|
||||
{ m_adjust = (GtkAdjustment *) NULL; m_oldPos = 0.0; }
|
||||
inline wxScrollBar( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
@@ -69,7 +58,7 @@ public:
|
||||
|
||||
// Backward compatibility
|
||||
// ----------------------
|
||||
|
||||
|
||||
int GetValue(void) const;
|
||||
void SetValue( int viewStart );
|
||||
void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const;
|
||||
@@ -81,18 +70,16 @@ public:
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void ApplyWidgetStyle();
|
||||
|
||||
|
||||
GtkAdjustment *m_adjust;
|
||||
float m_oldPos;
|
||||
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxScrollBar)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __GTKSCROLLBARH__
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: slider.h
|
||||
// Name: wx/gtk/slider.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKSLIDERH__
|
||||
@@ -14,70 +14,51 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_SLIDER
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxSlider;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char *wxSliderNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSlider
|
||||
//-----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxSlider: public wxControl
|
||||
class wxSlider : public wxSliderBase
|
||||
{
|
||||
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 )
|
||||
wxSlider() { }
|
||||
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 );
|
||||
Create( parent, id, value, minValue, maxValue,
|
||||
pos, size, style, validator, name );
|
||||
}
|
||||
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 );
|
||||
|
||||
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);
|
||||
|
||||
// implement the base class pure virtuals
|
||||
virtual int GetValue() const;
|
||||
virtual void SetValue( int );
|
||||
void SetRange( int minValue, int maxValue );
|
||||
int GetMin() const;
|
||||
int GetMax() const;
|
||||
void SetTickFreq( int n, int pos );
|
||||
int GetTickFreq() const;
|
||||
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 );
|
||||
virtual void SetValue(int value);
|
||||
|
||||
virtual void SetRange(int minValue, int maxValue);
|
||||
virtual int GetMin() const;
|
||||
virtual int GetMax() const;
|
||||
|
||||
virtual void SetLineSize(int lineSize);
|
||||
virtual void SetPageSize(int pageSize);
|
||||
virtual int GetLineSize() const;
|
||||
virtual int GetPageSize() const;
|
||||
|
||||
virtual void SetThumbLength(int lenPixels);
|
||||
virtual int GetThumbLength() const;
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
@@ -92,6 +73,4 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSlider)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKSLIDERH__
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: spinbutt.h
|
||||
// Name: wx/gtk/spinbutt.h
|
||||
// Purpose: wxSpinButton class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
@@ -8,19 +8,13 @@
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKSPINBUTTH__
|
||||
#define __GTKSPINBUTTH__
|
||||
#ifndef _WX_GTK_SPINBUTT_H_
|
||||
#define _WX_GTK_SPINBUTT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_SPINBTN
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxSpinButton
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -29,16 +23,22 @@ class wxSpinButton : public wxSpinButtonBase
|
||||
{
|
||||
public:
|
||||
wxSpinButton() { }
|
||||
wxSpinButton( wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_VERTICAL, const wxString& name = "wxSpinButton")
|
||||
wxSpinButton(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_VERTICAL,
|
||||
const wxString& name = wxSPIN_BUTTON_NAME)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create( wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_VERTICAL, const wxString& name = "wxSpinButton" );
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_VERTICAL,
|
||||
const wxString& name = wxSPIN_BUTTON_NAME);
|
||||
|
||||
virtual int GetValue() const;
|
||||
virtual void SetValue( int value );
|
||||
@@ -64,7 +64,4 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
// wxUSE_SPINBTN
|
||||
|
||||
#endif
|
||||
// __GTKSPINBUTTH__
|
||||
// _WX_GTK_SPINBUTT_H_
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: statbmp.h
|
||||
// Name: wx/gtk/statbmp.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
@@ -15,35 +15,14 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_STATBMP
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/icon.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxStaticBitmap;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char* wxStaticBitmapNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticBitmap
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxStaticBitmap: public wxControl
|
||||
class wxStaticBitmap : public wxStaticBitmapBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||
|
||||
public:
|
||||
wxStaticBitmap();
|
||||
wxStaticBitmap( wxWindow *parent,
|
||||
@@ -61,35 +40,25 @@ public:
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr);
|
||||
|
||||
virtual void SetIcon(const wxIcon& icon) { SetBitmap( icon ); }
|
||||
virtual void SetBitmap( const wxBitmap& bitmap );
|
||||
|
||||
wxBitmap& GetBitmap() { return m_bitmap; }
|
||||
const wxBitmap& GetBitmap() const { return m_bitmap; }
|
||||
virtual wxBitmap GetBitmap() const { return m_bitmap; }
|
||||
|
||||
// for compatibility with wxMSW
|
||||
const wxIcon& GetIcon() const
|
||||
wxIcon GetIcon() const
|
||||
{
|
||||
// don't use wxDynamicCast, icons and bitmaps are really the same thing
|
||||
// in wxGTK
|
||||
return (const wxIcon &)m_bitmap;
|
||||
}
|
||||
|
||||
// for compatibility with wxMSW
|
||||
void SetIcon(const wxIcon& icon)
|
||||
{
|
||||
SetBitmap( icon );
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
// creates the new pixmap widget
|
||||
void CreatePixmapWidget();
|
||||
|
||||
wxBitmap m_bitmap;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKSTATICBITMAPH__
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: stabox.h
|
||||
// Name: wx/gtk/stabox.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -15,50 +15,37 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_STATBOX
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxStaticBox;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const char *wxStaticBoxNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticBox
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxStaticBox: public wxControl
|
||||
class wxStaticBox : public wxStaticBoxBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
public:
|
||||
wxStaticBox();
|
||||
wxStaticBox( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = wxStaticBoxNameStr );
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = wxStaticBoxNameStr );
|
||||
|
||||
public:
|
||||
virtual void SetLabel( const wxString &label );
|
||||
|
||||
wxStaticBox(void);
|
||||
wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
||||
long style = 0, const wxString &name = wxStaticBoxNameStr );
|
||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
||||
long style = 0, const wxString &name = wxStaticBoxNameStr );
|
||||
void SetLabel( const wxString &label );
|
||||
// implementation
|
||||
|
||||
// implementation
|
||||
|
||||
void ApplyWidgetStyle();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __GTKSTATICBOXH__
|
||||
|
@@ -30,8 +30,6 @@ class wxStaticText;
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern const wxChar *wxStaticTextNameStr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticText
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -96,10 +96,6 @@ public:
|
||||
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();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: window.h
|
||||
// Name: wx/gtk/window.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
@@ -19,33 +19,32 @@
|
||||
// callback definition for inserting a window (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
typedef void (*wxInsertChildFunction)( wxWindow*, wxWindow* );
|
||||
class wxWindowGTK;
|
||||
typedef void (*wxInsertChildFunction)( wxWindowGTK*, wxWindowGTK* );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWindow
|
||||
// wxWindowGTK
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxWindow : public wxWindowBase
|
||||
class wxWindowGTK : public wxWindowBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxWindow)
|
||||
|
||||
public:
|
||||
// creating the window
|
||||
// -------------------
|
||||
wxWindow();
|
||||
wxWindow(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
wxWindowGTK();
|
||||
wxWindowGTK(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
virtual ~wxWindow();
|
||||
virtual ~wxWindowGTK();
|
||||
|
||||
// implement base class (pure) virtual methods
|
||||
// -------------------------------------------
|
||||
@@ -86,7 +85,9 @@ public:
|
||||
const wxFont *theFont = (const wxFont *) NULL)
|
||||
const;
|
||||
|
||||
#if wxUSE_MENUS
|
||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||
int range, bool refresh = TRUE );
|
||||
@@ -120,13 +121,13 @@ public:
|
||||
virtual void OnParentEnable( bool WXUNUSED(enable) ) {};
|
||||
|
||||
/* used by all window classes in the widget creation process */
|
||||
bool PreCreation( wxWindow *parent, const wxPoint &pos, const wxSize &size );
|
||||
bool PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size );
|
||||
void PostCreation();
|
||||
|
||||
/* internal addition of child windows. differs from class
|
||||
to class not by using virtual functions but by using
|
||||
the m_insertCallback */
|
||||
void DoAddChild(wxWindow *child);
|
||||
void DoAddChild(wxWindowGTK *child);
|
||||
|
||||
/* the methods below are required because many native widgets
|
||||
are composed of several subwidgets and setting a style for
|
||||
@@ -231,7 +232,8 @@ public:
|
||||
void Init();
|
||||
|
||||
private:
|
||||
DECLARE_NO_COPY_CLASS(wxWindow);
|
||||
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
|
||||
DECLARE_NO_COPY_CLASS(wxWindowGTK);
|
||||
};
|
||||
|
||||
#endif // __GTKWINDOWH__
|
||||
|
@@ -13,6 +13,8 @@
|
||||
#include "wx/motif/icon.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/icon.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/icon.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/icon.h"
|
||||
#elif defined(__WXMAC__)
|
||||
|
@@ -21,7 +21,6 @@
|
||||
// wxXPMHandler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_XPM
|
||||
class WXDLLEXPORT wxXPMHandler : public wxImageHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxXPMHandler)
|
||||
@@ -42,7 +41,6 @@ public:
|
||||
virtual bool DoCanRead( wxInputStream& stream );
|
||||
#endif
|
||||
};
|
||||
#endif // wxUSE_XPM
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -69,6 +69,7 @@ public:
|
||||
virtual void SetSelection(int n, bool select = TRUE) = 0;
|
||||
virtual void Select(int n) { SetSelection(n, TRUE); }
|
||||
void Deselect(int n) { SetSelection(n, FALSE); }
|
||||
void DeselectAll(int itemToLeaveSelected = -1);
|
||||
|
||||
virtual bool SetStringSelection(const wxString& s, bool select = TRUE);
|
||||
|
||||
@@ -76,11 +77,29 @@ public:
|
||||
// GetSelection which only works for listboxes with single selection)
|
||||
virtual int GetSelections(wxArrayInt& aSelections) const = 0;
|
||||
|
||||
// Set the specified item at the first visible item or scroll to max
|
||||
// set the specified item at the first visible item or scroll to max
|
||||
// range.
|
||||
void SetFirstItem(int n) { DoSetFirstItem(n); }
|
||||
void SetFirstItem(const wxString& s);
|
||||
|
||||
// ensures that the given item is visible scrolling the listbox if
|
||||
// necessary
|
||||
virtual void EnsureVisible(int n);
|
||||
|
||||
// a combination of Append() and EnsureVisible(): appends the item to the
|
||||
// listbox and ensures that it is visible i.e. not scrolled out of view
|
||||
void AppendAndEnsureVisible(const wxString& s);
|
||||
|
||||
// return TRUE if the listbox allows multiple selection
|
||||
bool HasMultipleSelection() const
|
||||
{
|
||||
return (m_windowStyle & wxLB_MULTIPLE) ||
|
||||
(m_windowStyle & wxLB_EXTENDED);
|
||||
}
|
||||
|
||||
// return TRUE if this listbox is sorted
|
||||
bool IsSorted() const { return (m_windowStyle & wxLB_SORT) != 0; }
|
||||
|
||||
// emulate selecting or deselecting the item event.GetInt() (depending on
|
||||
// event.GetExtraLong())
|
||||
void Command(wxCommandEvent& event);
|
||||
@@ -106,7 +125,9 @@ protected:
|
||||
// include the platform-specific class declaration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/listbox.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/listbox.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/listbox.h"
|
||||
|
@@ -16,6 +16,8 @@
|
||||
#pragma interface "listctrlbase.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_LISTCTRL
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// types
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -339,5 +341,7 @@ typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
|
||||
#define EVT_LIST_ITEM_MIDDLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL ),
|
||||
#define EVT_LIST_ITEM_ACTIVATED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL ),
|
||||
|
||||
#endif // wxUSE_LISTCTRL
|
||||
|
||||
#endif
|
||||
// _WX_LISTCTRL_H_BASE_
|
||||
|
@@ -268,6 +268,8 @@ protected:
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
|
||||
// log everything to a text window (GUI only of course)
|
||||
class WXDLLEXPORT wxLogTextCtrl : public wxLog
|
||||
{
|
||||
@@ -282,9 +284,14 @@ private:
|
||||
wxTextCtrl *m_pTextCtrl;
|
||||
};
|
||||
|
||||
#endif // wxUSE_TEXTCTRL
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// GUI log target, the default one for wxWindows programs
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_LOGGUI
|
||||
|
||||
class WXDLLEXPORT wxLogGui : public wxLog
|
||||
{
|
||||
public:
|
||||
@@ -307,12 +314,17 @@ protected:
|
||||
m_bWarnings; // any warnings?
|
||||
};
|
||||
|
||||
#endif // wxUSE_LOGGUI
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// (background) log window: this class forwards all log messages to the log
|
||||
// target which was active when it was instantiated, but also collects them
|
||||
// to the log window. This window has it's own menu which allows the user to
|
||||
// close it, clear the log contents or save it to the file.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_LOGWINDOW
|
||||
|
||||
class WXDLLEXPORT wxLogWindow : public wxLog
|
||||
{
|
||||
public:
|
||||
@@ -366,6 +378,8 @@ private:
|
||||
wxLogFrame *m_pLogFrame; // the log frame
|
||||
};
|
||||
|
||||
#endif // wxUSE_LOGWINDOW
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -16,6 +16,8 @@
|
||||
#pragma interface "menubase.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_MENUS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -28,6 +30,7 @@
|
||||
#include "wx/menuitem.h"
|
||||
|
||||
class WXDLLEXPORT wxMenu;
|
||||
class WXDLLEXPORT wxMenuBarBase;
|
||||
class WXDLLEXPORT wxMenuBar;
|
||||
class WXDLLEXPORT wxMenuItem;
|
||||
|
||||
@@ -181,7 +184,7 @@ public:
|
||||
wxMenuItemList& GetMenuItems() { return m_items; }
|
||||
|
||||
// search
|
||||
virtual int FindItem(const wxString& itemString) const;
|
||||
virtual int FindItem(const wxString& item) const;
|
||||
wxMenuItem* FindItem(int id, wxMenu **menu = NULL) const;
|
||||
|
||||
// get/set items attributes
|
||||
@@ -227,6 +230,14 @@ public:
|
||||
// menu or associated window will be used.
|
||||
void UpdateUI(wxEvtHandler* source = (wxEvtHandler*)NULL);
|
||||
|
||||
// get the menu bar this menu is attached to (may be NULL, always NULL for
|
||||
// popup menus)
|
||||
wxMenuBar *GetMenuBar() const { return m_menuBar; }
|
||||
|
||||
// called when the menu is attached/detached to/from a menu bar
|
||||
virtual void Attach(wxMenuBarBase *menubar);
|
||||
virtual void Detach();
|
||||
|
||||
// is the menu attached to a menu bar (or is it a popup one)?
|
||||
bool IsAttached() const { return m_menuBar != NULL; }
|
||||
|
||||
@@ -258,6 +269,12 @@ public:
|
||||
// pos != NULL
|
||||
wxMenuItem *FindChildItem(int id, size_t *pos = NULL) const;
|
||||
|
||||
// called to generate a wxCommandEvent, return TRUE if it was processed,
|
||||
// FALSE otherwise
|
||||
//
|
||||
// the checked parameter may have boolean value or -1 for uncheckable items
|
||||
bool SendEvent(int id, int checked = -1);
|
||||
|
||||
protected:
|
||||
// virtuals to override in derived classes
|
||||
// ---------------------------------------
|
||||
@@ -275,7 +292,9 @@ protected:
|
||||
// common part of all ctors
|
||||
void Init(long style);
|
||||
|
||||
protected:
|
||||
// associate the submenu with this menu
|
||||
void AddSubMenu(wxMenu *submenu);
|
||||
|
||||
wxMenuBar *m_menuBar; // menubar we belong to or NULL
|
||||
wxMenu *m_menuParent; // parent menu or NULL
|
||||
|
||||
@@ -333,6 +352,9 @@ public:
|
||||
// enable or disable a submenu
|
||||
virtual void EnableTop(size_t pos, bool enable) = 0;
|
||||
|
||||
// is the menu enabled?
|
||||
virtual bool IsEnabledTop(size_t pos) const { return TRUE; }
|
||||
|
||||
// get or change the label of the menu at given position
|
||||
virtual void SetLabelTop(size_t pos, const wxString& label) = 0;
|
||||
virtual wxString GetLabelTop(size_t pos) const = 0;
|
||||
@@ -342,13 +364,12 @@ public:
|
||||
|
||||
// by menu and item names, returns wxNOT_FOUND if not found or id of the
|
||||
// found item
|
||||
virtual int FindMenuItem(const wxString& menuString,
|
||||
const wxString& itemString) const = 0;
|
||||
virtual int FindMenuItem(const wxString& menu, const wxString& item) const;
|
||||
|
||||
// find item by id (in any menu), returns NULL if not found
|
||||
//
|
||||
// if menu is !NULL, it will be filled with wxMenu this item belongs to
|
||||
virtual wxMenuItem* FindItem(int id, wxMenu **menu = NULL) const = 0;
|
||||
virtual wxMenuItem* FindItem(int id, wxMenu **menu = NULL) const;
|
||||
|
||||
// find menu by its caption, return wxNOT_FOUND on failure
|
||||
int FindMenu(const wxString& title) const;
|
||||
@@ -373,11 +394,28 @@ public:
|
||||
void SetHelpString(int id, const wxString& helpString);
|
||||
wxString GetHelpString(int id) const;
|
||||
|
||||
// implementation helpers
|
||||
|
||||
// get the frame we are attached to (may return NULL)
|
||||
wxFrame *GetFrame() const { return m_menuBarFrame; }
|
||||
|
||||
// returns TRUE if we're attached to a frame
|
||||
bool IsAttached() const { return GetFrame() != NULL; }
|
||||
|
||||
// associate the menubar with the frame
|
||||
virtual void Attach(wxFrame *frame);
|
||||
|
||||
// called before deleting the menubar normally
|
||||
virtual void Detach();
|
||||
|
||||
// need to override these ones to avoid virtual function hiding
|
||||
virtual bool Enable(bool enable = TRUE) { return wxWindow::Enable(enable); }
|
||||
virtual void SetLabel(const wxString& s) { wxWindow::SetLabel(s); }
|
||||
virtual wxString GetLabel() const { return wxWindow::GetLabel(); }
|
||||
|
||||
// don't want menu bars to accept the focus by tabbing to them
|
||||
virtual bool AcceptsFocusFromKeyboard() const { return FALSE; }
|
||||
|
||||
// compatibility only: these functions are deprecated, use the new ones
|
||||
// instead
|
||||
#if WXWIN_COMPATIBILITY
|
||||
@@ -393,6 +431,9 @@ public:
|
||||
protected:
|
||||
// the list of all our menus
|
||||
wxMenuList m_menus;
|
||||
|
||||
// the frame we are attached to (may be NULL)
|
||||
wxFrame *m_menuBarFrame;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -402,7 +443,9 @@ protected:
|
||||
#ifdef wxUSE_BASE_CLASSES_ONLY
|
||||
#define wxMenuItem wxMenuItemBase
|
||||
#else // !wxUSE_BASE_CLASSES_ONLY
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/menu.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/menu.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/menu.h"
|
||||
@@ -419,5 +462,7 @@ protected:
|
||||
#endif
|
||||
#endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY
|
||||
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
#endif
|
||||
// _WX_MENU_H_BASE_
|
||||
|
@@ -12,6 +12,8 @@
|
||||
#ifndef _WX_MENUITEM_H_BASE_
|
||||
#define _WX_MENUITEM_H_BASE_
|
||||
|
||||
#if wxUSE_MENUS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -87,8 +89,12 @@ public:
|
||||
const wxString& GetHelp() const { return m_help; }
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
// extract the accelerator from the given menu string, return NULL if none
|
||||
// found
|
||||
static wxAcceleratorEntry *GetAccelFromString(const wxString& label);
|
||||
|
||||
// get our accelerator or NULL (caller must delete the pointer)
|
||||
virtual wxAcceleratorEntry *GetAccel() const { return NULL; }
|
||||
virtual wxAcceleratorEntry *GetAccel() const;
|
||||
|
||||
// set the accel for this item - this may also be done indirectly with
|
||||
// SetText()
|
||||
@@ -126,7 +132,9 @@ private:
|
||||
#ifdef wxUSE_BASE_CLASSES_ONLY
|
||||
#define wxMenuItem wxMenuItemBase
|
||||
#else // !wxUSE_BASE_CLASSES_ONLY
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/menuitem.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/menuitem.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/menuitem.h"
|
||||
@@ -143,5 +151,7 @@ private:
|
||||
#endif
|
||||
#endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY
|
||||
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
#endif
|
||||
// _WX_MENUITEM_H_BASE_
|
||||
|
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_MIMETYPE
|
||||
|
||||
// the things we really need
|
||||
#include "wx/string.h"
|
||||
#include "wx/dynarray.h"
|
||||
@@ -385,5 +387,7 @@ private:
|
||||
// the default mime manager for wxWindows programs
|
||||
WXDLLEXPORT_DATA(extern wxMimeTypesManager *) wxTheMimeTypesManager;
|
||||
|
||||
#endif // wxUSE_MIMETYPE
|
||||
|
||||
#endif
|
||||
//_WX_MIMETYPE_H_
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: accel.h
|
||||
// Name: wx/msw/accel.h
|
||||
// Purpose: wxAcceleratorTable class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
@@ -16,74 +16,32 @@
|
||||
#pragma interface "accel.h"
|
||||
#endif
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorTable;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Hold Ctrl key down
|
||||
#define wxACCEL_ALT 0x01
|
||||
|
||||
// Hold Ctrl key down
|
||||
#define wxACCEL_CTRL 0x02
|
||||
|
||||
// Hold Shift key down
|
||||
#define wxACCEL_SHIFT 0x04
|
||||
|
||||
// Hold no other key
|
||||
#define wxACCEL_NORMAL 0x00
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// an entry in wxAcceleratorTable corresponds to one accelerator
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorEntry
|
||||
{
|
||||
public:
|
||||
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0)
|
||||
{
|
||||
Set(flags, keyCode, cmd);
|
||||
}
|
||||
|
||||
void Set(int flags, int keyCode, int cmd)
|
||||
{
|
||||
m_flags = flags; m_keyCode = keyCode; m_command = cmd;
|
||||
}
|
||||
|
||||
int GetFlags() const { return m_flags; }
|
||||
int GetKeyCode() const { return m_keyCode; }
|
||||
int GetCommand() const { return m_command; }
|
||||
|
||||
//private:
|
||||
int m_flags;
|
||||
int m_keyCode; // ASCII or virtual keycode
|
||||
int m_command; // Command id to generate
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// the accel table has all accelerators for a given window or menu
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorTable : public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
|
||||
public:
|
||||
// default ctor
|
||||
wxAcceleratorTable();
|
||||
wxAcceleratorTable(const wxString& resource); // Load from .rc resource
|
||||
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array
|
||||
|
||||
// Copy constructors
|
||||
inline wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
|
||||
inline wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); }
|
||||
// copy ctor
|
||||
wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
|
||||
|
||||
~wxAcceleratorTable();
|
||||
// load from .rc resource (Windows specific)
|
||||
wxAcceleratorTable(const wxString& resource);
|
||||
|
||||
inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if ( *this != accel ) Ref(accel); return *this; }
|
||||
inline bool operator == (const wxAcceleratorTable& accel) const { return m_refData == accel.m_refData; }
|
||||
inline bool operator != (const wxAcceleratorTable& accel) const { return m_refData != accel.m_refData; }
|
||||
// initialize from array
|
||||
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
|
||||
|
||||
virtual ~wxAcceleratorTable();
|
||||
|
||||
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if ( *this != accel ) Ref(accel); return *this; }
|
||||
bool operator==(const wxAcceleratorTable& accel) const
|
||||
{ return m_refData == accel.m_refData; } // FIXME: this is wrong (VZ)
|
||||
bool operator!=(const wxAcceleratorTable& accel) const
|
||||
{ return !(*this == accel); }
|
||||
|
||||
bool Ok() const;
|
||||
void SetHACCEL(WXHACCEL hAccel);
|
||||
@@ -91,9 +49,10 @@ public:
|
||||
|
||||
// translate the accelerator, return TRUE if done
|
||||
bool Translate(wxWindow *window, WXMSG *msg) const;
|
||||
};
|
||||
|
||||
WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable;
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_ACCEL_H_
|
||||
|
@@ -39,8 +39,8 @@ public:
|
||||
virtual int MainLoop();
|
||||
virtual void ExitMainLoop();
|
||||
virtual bool Initialized();
|
||||
virtual bool Pending() ;
|
||||
virtual void Dispatch() ;
|
||||
virtual bool Pending();
|
||||
virtual void Dispatch();
|
||||
|
||||
virtual wxIcon GetStdIcon(int which) const;
|
||||
|
||||
@@ -64,9 +64,9 @@ public:
|
||||
bool GetAuto3D() const { return m_auto3D; }
|
||||
|
||||
protected:
|
||||
bool m_showOnInit;
|
||||
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
|
||||
bool m_auto3D ; // Always use 3D controls, except where overriden
|
||||
bool m_showOnInit;
|
||||
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
|
||||
bool m_auto3D ; // Always use 3D controls, except where overriden
|
||||
|
||||
/* Windows-specific wxApp definitions */
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
int m_nCmdShow;
|
||||
|
||||
protected:
|
||||
bool m_keepGoing ;
|
||||
bool m_keepGoing;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user