Add wx headers and ext
This commit is contained in:
parent
6390dcef6a
commit
66d3c7b811
1531 changed files with 295895 additions and 0 deletions
14
wxheaders/wx/gtk1/accel.h
Normal file
14
wxheaders/wx/gtk1/accel.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/accel.h
|
||||
// Purpose: wxAcceleratorTable redirection file
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created:
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// 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"
|
||||
77
wxheaders/wx/gtk1/app.h
Normal file
77
wxheaders/wx/gtk1/app.h
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/app.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKAPPH__
|
||||
#define __GTKAPPH__
|
||||
|
||||
#include "wx/frame.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/strconv.h"
|
||||
|
||||
typedef struct _GdkVisual GdkVisual;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxApp;
|
||||
class WXDLLIMPEXP_FWD_BASE wxLog;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxApp
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxApp: public wxAppBase
|
||||
{
|
||||
public:
|
||||
wxApp();
|
||||
virtual ~wxApp();
|
||||
|
||||
/* override for altering the way wxGTK initializes the GUI
|
||||
* (palette/visual/colorcube). under wxMSW, OnInitGui() does nothing by
|
||||
* default. when overriding this method, the code in it is likely to be
|
||||
* platform dependent, otherwise use OnInit(). */
|
||||
virtual bool OnInitGui();
|
||||
|
||||
// override base class (pure) virtuals
|
||||
virtual void WakeUpIdle();
|
||||
|
||||
virtual bool Initialize(int& argc, wxChar **argv);
|
||||
virtual void CleanUp();
|
||||
|
||||
static bool InitialzeVisual();
|
||||
|
||||
virtual void OnAssertFailure(const wxChar *file,
|
||||
int line,
|
||||
const wxChar *func,
|
||||
const wxChar *cond,
|
||||
const wxChar *msg);
|
||||
|
||||
bool IsInAssert() const { return m_isInAssert; }
|
||||
|
||||
int m_idleTag;
|
||||
void RemoveIdleTag();
|
||||
|
||||
unsigned char *m_colorCube;
|
||||
|
||||
// Used by the wxGLApp and wxGLCanvas class for GL-based X visual
|
||||
// selection.
|
||||
void *m_glVisualInfo; // this is actually an XVisualInfo*
|
||||
void *m_glFBCInfo; // this is actually an GLXFBConfig*
|
||||
// This returns the current visual: either that used by wxRootWindow
|
||||
// or the XVisualInfo* for SGI.
|
||||
GdkVisual *GetGdkVisual();
|
||||
|
||||
private:
|
||||
// true if we're inside an assert modal dialog
|
||||
bool m_isInAssert;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxApp);
|
||||
};
|
||||
|
||||
#endif // __GTKAPPH__
|
||||
147
wxheaders/wx/gtk1/bitmap.h
Normal file
147
wxheaders/wx/gtk1/bitmap.h
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/bitmap.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __GTKBITMAPH__
|
||||
#define __GTKBITMAPH__
|
||||
|
||||
#include "wx/palette.h"
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxMask;
|
||||
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||
class WXDLLIMPEXP_FWD_CORE wxImage;
|
||||
class WXDLLIMPEXP_FWD_CORE wxCursor;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMask
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMask: public wxObject
|
||||
{
|
||||
public:
|
||||
wxMask();
|
||||
wxMask( const wxBitmap& bitmap, const wxColour& colour );
|
||||
#if wxUSE_PALETTE
|
||||
wxMask( const wxBitmap& bitmap, int paletteIndex );
|
||||
#endif // wxUSE_PALETTE
|
||||
wxMask( const wxBitmap& bitmap );
|
||||
virtual ~wxMask();
|
||||
|
||||
bool Create( const wxBitmap& bitmap, const wxColour& colour );
|
||||
#if wxUSE_PALETTE
|
||||
bool Create( const wxBitmap& bitmap, int paletteIndex );
|
||||
#endif // wxUSE_PALETTE
|
||||
bool Create( const wxBitmap& bitmap );
|
||||
|
||||
// implementation
|
||||
GdkBitmap *m_bitmap;
|
||||
int m_width;
|
||||
int m_height;
|
||||
|
||||
wxBitmap GetBitmap() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxMask);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxBitmap
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase
|
||||
{
|
||||
public:
|
||||
wxBitmap() {}
|
||||
wxBitmap( int width, int height, int depth = -1 ) { Create( width, height, depth ); }
|
||||
wxBitmap( const wxSize& sz, int depth = -1 ) { Create( sz, depth ); }
|
||||
wxBitmap( int width, int height, const wxDC& dc ) { Create(width, height, dc); }
|
||||
wxBitmap( const char bits[], int width, int height, int depth = 1 );
|
||||
wxBitmap( const char* const* bits );
|
||||
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE );
|
||||
wxBitmap( const wxImage& image, int depth = -1, double WXUNUSED(scale) = 1.0 ) { (void)CreateFromImage(image, depth); }
|
||||
wxBitmap( const wxImage& image, const wxDC& WXUNUSED(dc) ) { (void)CreateFromImage(image, -1); }
|
||||
explicit wxBitmap(const wxCursor& cursor);
|
||||
virtual ~wxBitmap();
|
||||
|
||||
bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
|
||||
bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH)
|
||||
{ return Create(sz.GetWidth(), sz.GetHeight(), depth); }
|
||||
bool Create(int width, int height, const wxDC& WXUNUSED(dc))
|
||||
{ return Create(width,height); }
|
||||
|
||||
virtual int GetHeight() const;
|
||||
virtual int GetWidth() const;
|
||||
virtual int GetDepth() const;
|
||||
|
||||
wxImage ConvertToImage() const;
|
||||
|
||||
wxMask *GetMask() const;
|
||||
void SetMask( wxMask *mask );
|
||||
|
||||
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
||||
|
||||
bool SaveFile(const wxString &name, wxBitmapType type,
|
||||
const wxPalette *palette = NULL) const;
|
||||
bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
wxPalette *GetPalette() const;
|
||||
void SetPalette(const wxPalette& palette);
|
||||
wxPalette *GetColourMap() const { return GetPalette(); }
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
static void InitStandardHandlers();
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
void SetHeight( int height );
|
||||
void SetWidth( int width );
|
||||
void SetDepth( int depth );
|
||||
void SetPixmap( GdkPixmap *pixmap );
|
||||
void SetBitmap( GdkBitmap *bitmap );
|
||||
|
||||
GdkPixmap *GetPixmap() const;
|
||||
GdkBitmap *GetBitmap() const;
|
||||
bool HasPixmap() const;
|
||||
|
||||
// Basically, this corresponds to Win32 StretchBlt()
|
||||
wxBitmap Rescale( int clipx, int clipy, int clipwidth, int clipheight, int width, int height );
|
||||
// OpenVMS needs the next statement to detect Rescale in an inherited class
|
||||
using wxBitmapHelpers::Rescale;
|
||||
|
||||
// raw bitmap access support functions
|
||||
void *GetRawData(wxPixelDataBase& data, int bpp);
|
||||
void UngetRawData(wxPixelDataBase& data);
|
||||
|
||||
bool HasAlpha() const;
|
||||
|
||||
protected:
|
||||
bool CreateFromImage(const wxImage& image, int depth);
|
||||
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
|
||||
private:
|
||||
// to be called from CreateFromImage only!
|
||||
bool CreateFromImageAsBitmap(const wxImage& image);
|
||||
bool CreateFromImageAsPixmap(const wxImage& image);
|
||||
|
||||
friend class wxBitmapHandler;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxBitmap);
|
||||
};
|
||||
|
||||
|
||||
#endif // __GTKBITMAPH__
|
||||
76
wxheaders/wx/gtk1/bmpbuttn.h
Normal file
76
wxheaders/wx/gtk1/bmpbuttn.h
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/bmpbutton.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __BMPBUTTONH__
|
||||
#define __BMPBUTTONH__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapButton
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxBitmapButton: public wxBitmapButtonBase
|
||||
{
|
||||
public:
|
||||
wxBitmapButton() { Init(); }
|
||||
|
||||
wxBitmapButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxBitmapBundle& bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxButtonNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, bitmap, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxBitmapBundle& bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxButtonNameStr));
|
||||
|
||||
bool CreateCloseButton(wxWindow* parent,
|
||||
wxWindowID winid,
|
||||
const wxString& name = wxString());
|
||||
|
||||
void SetLabel( const wxString &label );
|
||||
virtual void SetLabel( const wxBitmapBundle& bitmap ) { SetBitmapLabel(bitmap); }
|
||||
|
||||
virtual bool Enable(bool enable = TRUE);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
void GTKSetHasFocus();
|
||||
void GTKSetNotFocus();
|
||||
void StartSelect();
|
||||
void EndSelect();
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
|
||||
bool m_hasFocus:1;
|
||||
bool m_isSelected:1;
|
||||
|
||||
protected:
|
||||
virtual void OnSetBitmap();
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
void Init();
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxBitmapButton);
|
||||
};
|
||||
|
||||
#endif // __BMPBUTTONH__
|
||||
64
wxheaders/wx/gtk1/brush.h
Normal file
64
wxheaders/wx/gtk1/brush.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/brush.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __GTKBRUSHH__
|
||||
#define __GTKBRUSHH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxBrush;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxBrush
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxBrush: public wxBrushBase
|
||||
{
|
||||
public:
|
||||
wxBrush() { }
|
||||
|
||||
wxBrush( const wxColour &colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID );
|
||||
wxBrush( const wxBitmap &stippleBitmap );
|
||||
virtual ~wxBrush();
|
||||
|
||||
bool operator==(const wxBrush& brush) const;
|
||||
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
|
||||
|
||||
wxBrushStyle GetStyle() const;
|
||||
wxColour GetColour() const;
|
||||
wxBitmap *GetStipple() const;
|
||||
|
||||
void SetColour( const wxColour& col );
|
||||
void SetColour( unsigned char r, unsigned char g, unsigned char b );
|
||||
void SetStyle( wxBrushStyle style );
|
||||
void SetStipple( const wxBitmap& stipple );
|
||||
|
||||
|
||||
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants")
|
||||
wxBrush(const wxColour& col, int style);
|
||||
|
||||
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants")
|
||||
void SetStyle(int style) { SetStyle((wxBrushStyle)style); }
|
||||
|
||||
private:
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxBrush);
|
||||
};
|
||||
|
||||
#endif // __GTKBRUSHH__
|
||||
67
wxheaders/wx/gtk1/button.h
Normal file
67
wxheaders/wx/gtk1/button.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/button.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKBUTTONH__
|
||||
#define __GTKBUTTONH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxButton
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxButton: public wxButtonBase
|
||||
{
|
||||
public:
|
||||
wxButton();
|
||||
wxButton(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxButtonNameStr))
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
virtual ~wxButton();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxButtonNameStr));
|
||||
|
||||
virtual wxWindow *SetDefault();
|
||||
virtual void SetLabel( const wxString &label );
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
|
||||
// Since this wxButton doesn't derive from wxButtonBase (why?) we need
|
||||
// to override this here too...
|
||||
virtual bool ShouldInheritColours() const { return false; }
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxButton);
|
||||
};
|
||||
|
||||
#endif // __GTKBUTTONH__
|
||||
65
wxheaders/wx/gtk1/checkbox.h
Normal file
65
wxheaders/wx/gtk1/checkbox.h
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/checkbox.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKCHECKBOXH__
|
||||
#define __GTKCHECKBOXH__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCheckBox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
|
||||
{
|
||||
public:
|
||||
wxCheckBox();
|
||||
wxCheckBox( wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxCheckBoxNameStr))
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxCheckBoxNameStr) );
|
||||
|
||||
void SetValue( bool state );
|
||||
bool GetValue() const;
|
||||
|
||||
virtual void SetLabel( const wxString& label );
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void OnInternalIdle();
|
||||
|
||||
GtkWidget *m_widgetCheckbox;
|
||||
GtkWidget *m_widgetLabel;
|
||||
|
||||
bool m_blockEvent;
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxCheckBox);
|
||||
};
|
||||
|
||||
#endif // __GTKCHECKBOXH__
|
||||
59
wxheaders/wx/gtk1/checklst.h
Normal file
59
wxheaders/wx/gtk1/checklst.h
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/checklst.h
|
||||
// Purpose: wxCheckListBox class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKCHECKLISTH__
|
||||
#define __GTKCHECKLISTH__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// there is no "right" choice of the checkbox indicators, so allow the user to
|
||||
// define them himself if he wants
|
||||
#ifndef wxCHECKLBOX_CHECKED
|
||||
#define wxCHECKLBOX_CHECKED wxT('x')
|
||||
#define wxCHECKLBOX_UNCHECKED wxT(' ')
|
||||
|
||||
#define wxCHECKLBOX_STRING wxT("[ ] ")
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxCheckListBox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase
|
||||
{
|
||||
public:
|
||||
wxCheckListBox();
|
||||
wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int nStrings = 0,
|
||||
const wxString *choices = (const wxString *)NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxListBoxNameStr));
|
||||
wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxListBoxNameStr));
|
||||
|
||||
bool IsChecked(unsigned int index) const;
|
||||
void Check(unsigned int index, bool check = true);
|
||||
|
||||
int GetItemHeight() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxCheckListBox);
|
||||
};
|
||||
|
||||
#endif //__GTKCHECKLISTH__
|
||||
111
wxheaders/wx/gtk1/choice.h
Normal file
111
wxheaders/wx/gtk1/choice.h
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/choice.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKCHOICEH__
|
||||
#define __GTKCHOICEH__
|
||||
|
||||
class WXDLLIMPEXP_FWD_BASE wxSortedArrayString;
|
||||
class WXDLLIMPEXP_FWD_BASE wxArrayString;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxChoice
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxChoice : public wxChoiceBase
|
||||
{
|
||||
public:
|
||||
wxChoice();
|
||||
wxChoice( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxChoiceNameStr) )
|
||||
{
|
||||
m_strings = NULL;
|
||||
|
||||
Create(parent, id, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
wxChoice( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxChoiceNameStr) )
|
||||
{
|
||||
m_strings = NULL;
|
||||
|
||||
Create(parent, id, pos, size, choices, style, validator, name);
|
||||
}
|
||||
virtual ~wxChoice();
|
||||
bool Create( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxChoiceNameStr) );
|
||||
bool Create( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxChoiceNameStr) );
|
||||
|
||||
// implement base class pure virtuals
|
||||
void DoDeleteOneItem(unsigned int n);
|
||||
void DoClear();
|
||||
|
||||
int GetSelection() const;
|
||||
virtual void SetSelection(int n);
|
||||
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& string);
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
protected:
|
||||
wxList m_clientList; // contains the client data for the items
|
||||
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
|
||||
unsigned int pos,
|
||||
void **clientData, wxClientDataType type);
|
||||
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
virtual bool IsOwnGtkWindow( GdkWindow *window );
|
||||
|
||||
private:
|
||||
// DoInsertItems() helper
|
||||
int GtkAddHelper(GtkWidget *menu, unsigned int pos, const wxString& item);
|
||||
|
||||
// this array is only used for controls with wxCB_SORT style, so only
|
||||
// allocate it if it's needed (hence using pointer)
|
||||
wxSortedArrayString *m_strings;
|
||||
|
||||
public:
|
||||
// this circumvents a GTK+ 2.0 bug so that the selection is
|
||||
// invalidated properly
|
||||
int m_selection_hack;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxChoice);
|
||||
};
|
||||
|
||||
|
||||
#endif // __GTKCHOICEH__
|
||||
77
wxheaders/wx/gtk1/clipbrd.h
Normal file
77
wxheaders/wx/gtk1/clipbrd.h
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/clipbrd.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __GTKCLIPBOARDH__
|
||||
#define __GTKCLIPBOARDH__
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/dataobj.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/module.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxClipboard
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
|
||||
{
|
||||
public:
|
||||
wxClipboard();
|
||||
virtual ~wxClipboard();
|
||||
|
||||
// open the clipboard before SetData() and GetData()
|
||||
virtual bool Open();
|
||||
|
||||
// close the clipboard after SetData() and GetData()
|
||||
virtual void Close();
|
||||
|
||||
// query whether the clipboard is opened
|
||||
virtual bool IsOpened() const;
|
||||
|
||||
// set the clipboard data. all other formats will be deleted.
|
||||
virtual bool SetData( wxDataObject *data );
|
||||
|
||||
// add to the clipboard data.
|
||||
virtual bool AddData( wxDataObject *data );
|
||||
|
||||
// ask if data in correct format is available
|
||||
virtual bool IsSupported( const wxDataFormat& format );
|
||||
|
||||
// fill data with data on the clipboard (if available)
|
||||
virtual bool GetData( wxDataObject& data );
|
||||
|
||||
// clears wxTheClipboard and the system's clipboard if possible
|
||||
virtual void Clear();
|
||||
|
||||
// implementation from now on
|
||||
bool m_open;
|
||||
bool m_ownsClipboard;
|
||||
bool m_ownsPrimarySelection;
|
||||
wxDataObject *m_data;
|
||||
|
||||
GtkWidget *m_clipboardWidget; /* for getting and offering data */
|
||||
GtkWidget *m_targetsWidget; /* for getting list of supported formats */
|
||||
bool m_waiting; /* querying data or formats is asynchronous */
|
||||
|
||||
bool m_formatSupported;
|
||||
GdkAtom m_targetRequested;
|
||||
wxDataObject *m_receivedData;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxClipboard);
|
||||
};
|
||||
|
||||
#endif
|
||||
// wxUSE_CLIPBOARD
|
||||
|
||||
#endif
|
||||
// __GTKCLIPBOARDH__
|
||||
51
wxheaders/wx/gtk1/colordlg.h
Normal file
51
wxheaders/wx/gtk1/colordlg.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/colordlg.h
|
||||
// Purpose: wxColourDialog
|
||||
// Author: Vaclav Slavik
|
||||
// Modified by:
|
||||
// Created: 2004/06/04
|
||||
// Copyright: (c) Vaclav Slavik, 2004
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __COLORDLG_H__
|
||||
#define __COLORDLG_H__
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/dialog.h"
|
||||
|
||||
|
||||
class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxColourDialog() {}
|
||||
wxColourDialog(wxWindow *parent,
|
||||
wxColourData *data = NULL);
|
||||
virtual ~wxColourDialog() {}
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
|
||||
wxColourData &GetColourData() { return m_data; }
|
||||
|
||||
virtual int ShowModal();
|
||||
|
||||
protected:
|
||||
// implement some base class methods to do nothing to avoid asserts and
|
||||
// GTK warnings, since this is not a real wxDialog.
|
||||
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
|
||||
int WXUNUSED(width), int WXUNUSED(height),
|
||||
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
|
||||
virtual void DoMoveWindow(int WXUNUSED(x), int WXUNUSED(y),
|
||||
int WXUNUSED(width), int WXUNUSED(height)) {}
|
||||
|
||||
// copy data between the dialog and m_colourData:
|
||||
void ColourDataToDialog();
|
||||
void DialogToColourData();
|
||||
|
||||
wxColourData m_data;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxColourDialog);
|
||||
};
|
||||
|
||||
#endif
|
||||
69
wxheaders/wx/gtk1/colour.h
Normal file
69
wxheaders/wx/gtk1/colour.h
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/colour.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKCOLOURH__
|
||||
#define __GTKCOLOURH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/palette.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxPaintDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxColour;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxColour
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxColour : public wxColourBase
|
||||
{
|
||||
public:
|
||||
// constructors
|
||||
// ------------
|
||||
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
||||
|
||||
virtual ~wxColour();
|
||||
|
||||
virtual bool FromString(const wxString& str);
|
||||
|
||||
bool operator==(const wxColour& col) const;
|
||||
bool operator!=(const wxColour& col) const { return !(*this == col); }
|
||||
|
||||
unsigned char Red() const;
|
||||
unsigned char Green() const;
|
||||
unsigned char Blue() const;
|
||||
|
||||
|
||||
// Implementation part
|
||||
void CalcPixel( GdkColormap *cmap );
|
||||
int GetPixel() const;
|
||||
GdkColor *GetColor() const;
|
||||
|
||||
protected:
|
||||
// ref counting code
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
|
||||
virtual void
|
||||
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxColour);
|
||||
};
|
||||
|
||||
#endif // __GTKCOLOURH__
|
||||
189
wxheaders/wx/gtk1/combobox.h
Normal file
189
wxheaders/wx/gtk1/combobox.h
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/combobox.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Created: 01/02/97
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKCOMBOBOXH__
|
||||
#define __GTKCOMBOBOXH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_COMBOBOX
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxComboBox;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[];
|
||||
extern WXDLLIMPEXP_BASE const wxChar* wxEmptyString;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxComboBox
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxComboBox :
|
||||
public wxWindowWithItems<wxControl, wxComboBoxBase>
|
||||
{
|
||||
public:
|
||||
inline wxComboBox() {}
|
||||
inline wxComboBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxComboBoxNameStr))
|
||||
{
|
||||
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
inline wxComboBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxComboBoxNameStr))
|
||||
{
|
||||
Create(parent, id, value, pos, size, choices, style, validator, name);
|
||||
}
|
||||
|
||||
virtual ~wxComboBox();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxComboBoxNameStr));
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxComboBoxNameStr));
|
||||
|
||||
void DoClear();
|
||||
void DoDeleteOneItem(unsigned int n);
|
||||
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
int GetSelection() const;
|
||||
int GetCurrentSelection() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
wxString GetStringSelection() const;
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual void SetSelection(int n);
|
||||
virtual void SetString(unsigned int n, const wxString &text);
|
||||
|
||||
wxString GetValue() const { return DoGetValue(); }
|
||||
void SetValue(const wxString& value);
|
||||
void WriteText(const wxString& value);
|
||||
|
||||
void Copy();
|
||||
void Cut();
|
||||
void Paste();
|
||||
bool CanCopy() const;
|
||||
bool CanCut() const;
|
||||
bool CanPaste() const;
|
||||
void SetInsertionPoint( long pos );
|
||||
void SetInsertionPointEnd() { SetInsertionPoint( -1 ); }
|
||||
long GetInsertionPoint() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
void Remove(long from, long to) { Replace(from, to, wxEmptyString); }
|
||||
void Replace( long from, long to, const wxString& value );
|
||||
void SetSelection( long from, long to );
|
||||
void GetSelection( long* from, long* to ) const;
|
||||
void SetEditable( bool editable );
|
||||
void Undo() ;
|
||||
void Redo() ;
|
||||
bool CanUndo() const;
|
||||
bool CanRedo() const;
|
||||
void SelectAll();
|
||||
bool IsEditable() const ;
|
||||
bool HasSelection() const ;
|
||||
|
||||
// implementation
|
||||
|
||||
virtual void SetFocus();
|
||||
|
||||
void OnSize( wxSizeEvent &event );
|
||||
void OnChar( wxKeyEvent &event );
|
||||
|
||||
// Standard event handling
|
||||
void OnCut(wxCommandEvent& event);
|
||||
void OnCopy(wxCommandEvent& event);
|
||||
void OnPaste(wxCommandEvent& event);
|
||||
void OnUndo(wxCommandEvent& event);
|
||||
void OnRedo(wxCommandEvent& event);
|
||||
void OnDelete(wxCommandEvent& event);
|
||||
void OnSelectAll(wxCommandEvent& event);
|
||||
|
||||
void OnUpdateCut(wxUpdateUIEvent& event);
|
||||
void OnUpdateCopy(wxUpdateUIEvent& event);
|
||||
void OnUpdatePaste(wxUpdateUIEvent& event);
|
||||
void OnUpdateUndo(wxUpdateUIEvent& event);
|
||||
void OnUpdateRedo(wxUpdateUIEvent& event);
|
||||
void OnUpdateDelete(wxUpdateUIEvent& event);
|
||||
void OnUpdateSelectAll(wxUpdateUIEvent& event);
|
||||
|
||||
bool m_ignoreNextUpdate:1;
|
||||
wxList m_clientDataList;
|
||||
wxList m_clientObjectList;
|
||||
int m_prevSelection;
|
||||
|
||||
void DisableEvents();
|
||||
void EnableEvents();
|
||||
GtkWidget* GetConnectWidget();
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
virtual const wxTextEntry* WXGetTextEntry() const { return this; }
|
||||
|
||||
protected:
|
||||
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
|
||||
unsigned int pos,
|
||||
void **clientData, wxClientDataType type);
|
||||
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
// implement wxTextEntry pure virtual methods
|
||||
virtual wxString DoGetValue() const;
|
||||
virtual wxWindow *GetEditableWindow() { return this; }
|
||||
|
||||
// Widgets that use the style->base colour for the BG colour should
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const { return true; }
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox);
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// __GTKCOMBOBOXH__
|
||||
104
wxheaders/wx/gtk1/control.h
Normal file
104
wxheaders/wx/gtk1/control.h
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/control.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKCONTROLH__
|
||||
#define __GTKCONTROLH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/window.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxControl;
|
||||
|
||||
typedef struct _GtkLabel GtkLabel;
|
||||
typedef struct _GtkFrame GtkFrame;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxControl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// C-linkage function pointer types for GetDefaultAttributesFromGTKWidget
|
||||
extern "C" {
|
||||
typedef GtkWidget* (*wxGtkWidgetNew_t)(void);
|
||||
typedef GtkWidget* (*wxGtkWidgetNewFromStr_t)(const char*);
|
||||
typedef GtkWidget* (*wxGtkWidgetNewFromAdj_t)(GtkAdjustment*);
|
||||
}
|
||||
|
||||
class WXDLLIMPEXP_CORE wxControl : public wxControlBase
|
||||
{
|
||||
public:
|
||||
wxControl();
|
||||
wxControl(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxControlNameStr))
|
||||
{
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxControlNameStr));
|
||||
|
||||
virtual void SetLabel( const wxString &label );
|
||||
virtual wxString GetLabel() const;
|
||||
|
||||
virtual wxVisualAttributes GetDefaultAttributes() const;
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
void PostCreation(const wxSize& size);
|
||||
|
||||
// sets the label to the given string and also sets it for the given widget
|
||||
void GTKSetLabelForLabel(GtkLabel *w, const wxString& label);
|
||||
|
||||
// as GTKSetLabelForLabel() but for a GtkFrame widget
|
||||
void GTKSetLabelForFrame(GtkFrame *w, const wxString& label);
|
||||
|
||||
// remove mnemonics ("&"s) from the label
|
||||
static wxString GTKRemoveMnemonics(const wxString& label);
|
||||
|
||||
// These are used by GetDefaultAttributes
|
||||
static wxVisualAttributes
|
||||
GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
|
||||
bool useBase = false,
|
||||
int state = -1);
|
||||
static wxVisualAttributes
|
||||
GetDefaultAttributesFromGTKWidget(wxGtkWidgetNew_t,
|
||||
bool useBase = false,
|
||||
int state = -1);
|
||||
static wxVisualAttributes
|
||||
GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromStr_t,
|
||||
bool useBase = false,
|
||||
int state = -1);
|
||||
|
||||
static wxVisualAttributes
|
||||
GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromAdj_t,
|
||||
bool useBase = false,
|
||||
int state = -1);
|
||||
|
||||
// Widgets that use the style->base colour for the BG colour should
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const { return false; }
|
||||
|
||||
// this field contains the label in wx format, i.e. with "&" mnemonics
|
||||
wxString m_label;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxControl);
|
||||
};
|
||||
|
||||
#endif // __GTKCONTROLH__
|
||||
61
wxheaders/wx/gtk1/cursor.h
Normal file
61
wxheaders/wx/gtk1/cursor.h
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/cursor.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKCURSORH__
|
||||
#define __GTKCURSORH__
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
#include "wx/image.h"
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxCursor
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase
|
||||
{
|
||||
public:
|
||||
wxCursor();
|
||||
wxCursor(wxStockCursor id) { InitFromStock(id); }
|
||||
#if WXWIN_COMPATIBILITY_2_8
|
||||
wxCursor(int id) { InitFromStock((wxStockCursor)id); }
|
||||
#endif
|
||||
#if wxUSE_IMAGE
|
||||
wxCursor( const wxImage & image );
|
||||
wxCursor(const char* const* xpmData);
|
||||
#endif
|
||||
wxCursor(const wxString& name,
|
||||
wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
|
||||
int hotSpotX = 0, int hotSpotY = 0);
|
||||
wxCursor( const char bits[], int width, int height,
|
||||
int hotSpotX=-1, int hotSpotY=-1,
|
||||
const char maskBits[] = NULL,
|
||||
const wxColour* fg = NULL, const wxColour* bg = NULL);
|
||||
|
||||
virtual ~wxCursor();
|
||||
|
||||
// implementation
|
||||
|
||||
GdkCursor *GetCursor() const;
|
||||
|
||||
protected:
|
||||
void InitFromStock(wxStockCursor);
|
||||
#if wxUSE_IMAGE
|
||||
void InitFromImage(const wxImage& image);
|
||||
#endif
|
||||
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxCursor);
|
||||
};
|
||||
|
||||
#endif // __GTKCURSORH__
|
||||
74
wxheaders/wx/gtk1/dataform.h
Normal file
74
wxheaders/wx/gtk1/dataform.h
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/dataform.h
|
||||
// Purpose: declaration of the wxDataFormat class
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 19.10.99 (extracted from gtk/dataobj.h)
|
||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_DATAFORM_H
|
||||
#define _WX_GTK_DATAFORM_H
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDataFormat
|
||||
{
|
||||
public:
|
||||
// the clipboard formats under GDK are GdkAtoms
|
||||
typedef GdkAtom NativeFormat;
|
||||
|
||||
wxDataFormat();
|
||||
wxDataFormat( wxDataFormatId type );
|
||||
wxDataFormat( NativeFormat format );
|
||||
|
||||
// we have to provide all the overloads to allow using strings instead of
|
||||
// data formats (as a lot of existing code does)
|
||||
wxDataFormat( const wxString& id ) { InitFromString(id); }
|
||||
wxDataFormat( const char *id ) { InitFromString(id); }
|
||||
wxDataFormat( const wchar_t *id ) { InitFromString(id); }
|
||||
wxDataFormat( const wxCStrData& id ) { InitFromString(id); }
|
||||
|
||||
|
||||
wxDataFormat& operator=(const wxDataFormat& format)
|
||||
{ m_type = format.m_type; m_format = format.m_format; return *this; }
|
||||
wxDataFormat& operator=(NativeFormat format)
|
||||
{ SetId(format); return *this; }
|
||||
|
||||
// comparison (must have both versions)
|
||||
bool operator==(NativeFormat format) const
|
||||
{ return m_format == (NativeFormat)format; }
|
||||
bool operator!=(NativeFormat format) const
|
||||
{ return m_format != (NativeFormat)format; }
|
||||
bool operator==(wxDataFormatId format) const
|
||||
{ return m_type == (wxDataFormatId)format; }
|
||||
bool operator!=(wxDataFormatId format) const
|
||||
{ return m_type != (wxDataFormatId)format; }
|
||||
|
||||
// explicit and implicit conversions to NativeFormat which is one of
|
||||
// standard data types (implicit conversion is useful for preserving the
|
||||
// compatibility with old code)
|
||||
NativeFormat GetFormatId() const { return m_format; }
|
||||
operator NativeFormat() const { return m_format; }
|
||||
|
||||
void SetId( NativeFormat format );
|
||||
|
||||
// string ids are used for custom types - this SetId() must be used for
|
||||
// application-specific formats
|
||||
wxString GetId() const;
|
||||
void SetId( const wxString& id );
|
||||
|
||||
// implementation
|
||||
wxDataFormatId GetType() const;
|
||||
void SetType( wxDataFormatId type );
|
||||
|
||||
private:
|
||||
// common part of ctors from format name
|
||||
void InitFromString(const wxString& id);
|
||||
|
||||
wxDataFormatId m_type;
|
||||
NativeFormat m_format;
|
||||
|
||||
void PrepareFormats();
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_DATAFORM_H
|
||||
26
wxheaders/wx/gtk1/dataobj.h
Normal file
26
wxheaders/wx/gtk1/dataobj.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/dataobj.h
|
||||
// Purpose: declaration of the wxDataObject
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_DATAOBJ_H_
|
||||
#define _WX_GTK_DATAOBJ_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDataObject is the same as wxDataObjectBase under wxGTK
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDataObject : public wxDataObjectBase
|
||||
{
|
||||
public:
|
||||
wxDataObject();
|
||||
virtual ~wxDataObject();
|
||||
|
||||
virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const;
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_DATAOBJ_H_
|
||||
|
||||
84
wxheaders/wx/gtk1/dataobj2.h
Normal file
84
wxheaders/wx/gtk1/dataobj2.h
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/dataobj2.h
|
||||
// Purpose: declaration of standard wxDataObjectSimple-derived classes
|
||||
// Author: Robert Roebling
|
||||
// Created: 19.10.99 (extracted from gtk/dataobj.h)
|
||||
// Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_DATAOBJ2_H_
|
||||
#define _WX_GTK_DATAOBJ2_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapDataObject is a specialization of wxDataObject for bitmaps
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxBitmapDataObject();
|
||||
wxBitmapDataObject(const wxBitmap& bitmap);
|
||||
|
||||
// destr
|
||||
virtual ~wxBitmapDataObject();
|
||||
|
||||
// override base class virtual to update PNG data too
|
||||
virtual void SetBitmap(const wxBitmap& bitmap);
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
virtual size_t GetDataSize() const { return m_pngSize; }
|
||||
virtual bool GetDataHere(void *buf) const;
|
||||
virtual bool SetData(size_t len, const void *buf);
|
||||
|
||||
protected:
|
||||
void Init() { m_pngData = NULL; m_pngSize = 0; }
|
||||
void Clear() { free(m_pngData); }
|
||||
void ClearAll() { Clear(); Init(); }
|
||||
|
||||
size_t m_pngSize;
|
||||
void *m_pngData;
|
||||
|
||||
void DoConvertToPng();
|
||||
|
||||
private:
|
||||
// virtual function hiding suppression
|
||||
size_t GetDataSize(const wxDataFormat& format) const
|
||||
{ return(wxDataObjectSimple::GetDataSize(format)); }
|
||||
bool GetDataHere(const wxDataFormat& format, void* pBuf) const
|
||||
{ return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
|
||||
bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
|
||||
{ return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFileDataObject is a specialization of wxDataObject for file names
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase
|
||||
{
|
||||
public:
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
void AddFile( const wxString &filename );
|
||||
|
||||
virtual size_t GetDataSize() const;
|
||||
virtual bool GetDataHere(void *buf) const;
|
||||
virtual bool SetData(size_t len, const void *buf);
|
||||
|
||||
private:
|
||||
// virtual function hiding suppression
|
||||
size_t GetDataSize(const wxDataFormat& format) const
|
||||
{ return(wxDataObjectSimple::GetDataSize(format)); }
|
||||
bool GetDataHere(const wxDataFormat& format, void* pBuf) const
|
||||
{ return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
|
||||
bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
|
||||
{ return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_DATAOBJ2_H_
|
||||
|
||||
64
wxheaders/wx/gtk1/dc.h
Normal file
64
wxheaders/wx/gtk1/dc.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/dc.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKDCH__
|
||||
#define __GTKDCH__
|
||||
|
||||
#include "wx/dc.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGTKDCImpl : public wxDCImpl
|
||||
{
|
||||
public:
|
||||
wxGTKDCImpl(wxDC *owner);
|
||||
virtual ~wxGTKDCImpl() { }
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); }
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
// Resolution in pixels per logical inch
|
||||
virtual wxSize GetPPI() const;
|
||||
|
||||
virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return true; }
|
||||
virtual void EndDoc() { }
|
||||
virtual void StartPage() { }
|
||||
virtual void EndPage() { }
|
||||
|
||||
virtual GdkWindow* GetGDKWindow() const { return NULL; }
|
||||
|
||||
public:
|
||||
// implementation
|
||||
wxCoord XDEV2LOG(wxCoord x) const { return DeviceToLogicalX(x); }
|
||||
wxCoord XDEV2LOGREL(wxCoord x) const { return DeviceToLogicalXRel(x); }
|
||||
wxCoord YDEV2LOG(wxCoord y) const { return DeviceToLogicalY(y); }
|
||||
wxCoord YDEV2LOGREL(wxCoord y) const { return DeviceToLogicalYRel(y); }
|
||||
wxCoord XLOG2DEV(wxCoord x) const { return LogicalToDeviceX(x); }
|
||||
wxCoord XLOG2DEVREL(wxCoord x) const { return LogicalToDeviceXRel(x); }
|
||||
wxCoord YLOG2DEV(wxCoord y) const { return LogicalToDeviceY(y); }
|
||||
wxCoord YLOG2DEVREL(wxCoord y) const { return LogicalToDeviceYRel(y); }
|
||||
|
||||
// base class pure virtuals implemented here
|
||||
virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||
|
||||
private:
|
||||
wxDECLARE_ABSTRACT_CLASS(wxDC);
|
||||
};
|
||||
|
||||
// this must be defined when wxDC::Blit() honours the DC origin and needed to
|
||||
// allow wxUniv code in univ/winuniv.cpp to work with versions of wxGTK
|
||||
// 2.3.[23]
|
||||
#ifndef wxHAS_WORKING_GTK_DC_BLIT
|
||||
#define wxHAS_WORKING_GTK_DC_BLIT
|
||||
#endif
|
||||
|
||||
#endif // __GTKDCH__
|
||||
161
wxheaders/wx/gtk1/dcclient.h
Normal file
161
wxheaders/wx/gtk1/dcclient.h
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/dcclient.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKDCCLIENTH__
|
||||
#define __GTKDCCLIENTH__
|
||||
|
||||
#include "wx/gtk1/dc.h"
|
||||
#include "wx/window.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindowDCImpl;
|
||||
class WXDLLIMPEXP_FWD_CORE wxPaintDCImpl;
|
||||
class WXDLLIMPEXP_FWD_CORE wxClientDCImpl;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWindowDCImpl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxGTKDCImpl
|
||||
{
|
||||
public:
|
||||
wxWindowDCImpl(wxDC *owner);
|
||||
wxWindowDCImpl(wxDC *owner, wxWindow *win);
|
||||
|
||||
virtual ~wxWindowDCImpl();
|
||||
|
||||
virtual bool CanDrawBitmap() const { return true; }
|
||||
virtual bool CanGetTextExtent() const { return true; }
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, wxFloodFillStyle style=wxFLOOD_SURFACE );
|
||||
virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const;
|
||||
|
||||
virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 );
|
||||
virtual void DoCrossHair( wxCoord x, wxCoord y );
|
||||
virtual void DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
|
||||
wxCoord xc, wxCoord yc );
|
||||
virtual void DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height,
|
||||
double sa, double ea );
|
||||
virtual void DoDrawPoint( wxCoord x, wxCoord y );
|
||||
|
||||
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||
wxCoord xoffset, wxCoord yoffset);
|
||||
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||
wxCoord xoffset, wxCoord yoffset,
|
||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||
|
||||
virtual void DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
|
||||
virtual void DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0 );
|
||||
virtual void DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
|
||||
|
||||
virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y );
|
||||
virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y,
|
||||
bool useMask = false );
|
||||
|
||||
virtual bool DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||
wxRasterOperationMode logical_func = wxCOPY, bool useMask = false,
|
||||
wxCoord xsrcMask = -1, wxCoord ysrcMask = -1 );
|
||||
|
||||
virtual void DoDrawText( const wxString &text, wxCoord x, wxCoord y );
|
||||
virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
|
||||
double angle);
|
||||
virtual void DoGetTextExtent( const wxString &string,
|
||||
wxCoord *width, wxCoord *height,
|
||||
wxCoord *descent = NULL,
|
||||
wxCoord *externalLeading = NULL,
|
||||
const wxFont *theFont = NULL) const;
|
||||
|
||||
public:
|
||||
virtual wxCoord GetCharWidth() const;
|
||||
virtual wxCoord GetCharHeight() const;
|
||||
|
||||
virtual void Clear();
|
||||
|
||||
virtual void SetFont( const wxFont &font );
|
||||
virtual void SetPen( const wxPen &pen );
|
||||
virtual void SetBrush( const wxBrush &brush );
|
||||
virtual void SetBackground( const wxBrush &brush );
|
||||
virtual void SetLogicalFunction( wxRasterOperationMode function );
|
||||
virtual void SetTextForeground( const wxColour &col );
|
||||
virtual void SetTextBackground( const wxColour &col );
|
||||
virtual void SetBackgroundMode( int mode );
|
||||
virtual void SetPalette( const wxPalette& palette );
|
||||
|
||||
virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
|
||||
virtual void DestroyClippingRegion();
|
||||
virtual void DoSetDeviceClippingRegion( const wxRegion ®ion );
|
||||
|
||||
// Resolution in pixels per logical inch
|
||||
virtual wxSize GetPPI() const;
|
||||
virtual int GetDepth() const;
|
||||
|
||||
virtual GdkWindow* GetGDKWindow() const { return m_window; }
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
GdkWindow *m_window;
|
||||
GdkGC *m_penGC;
|
||||
GdkGC *m_brushGC;
|
||||
GdkGC *m_textGC;
|
||||
GdkGC *m_bgGC;
|
||||
GdkColormap *m_cmap;
|
||||
bool m_isMemDC;
|
||||
bool m_isScreenDC;
|
||||
wxWindow *m_owner;
|
||||
wxRegion m_currentClippingRegion;
|
||||
wxRegion m_paintClippingRegion;
|
||||
|
||||
void SetUpDC();
|
||||
void Destroy();
|
||||
virtual void ComputeScaleAndOrigin();
|
||||
|
||||
GdkWindow *GetWindow() { return m_window; }
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxWindowDCImpl);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxClientDCImpl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
|
||||
{
|
||||
public:
|
||||
wxClientDCImpl(wxDC *owner) : wxWindowDCImpl(owner) { }
|
||||
wxClientDCImpl(wxDC *owner, wxWindow *win);
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxClientDCImpl);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPaintDCImpl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
|
||||
{
|
||||
public:
|
||||
wxPaintDCImpl(wxDC *owner) : wxClientDCImpl(owner) { }
|
||||
wxPaintDCImpl(wxDC *owner, wxWindow *win);
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxPaintDCImpl);
|
||||
};
|
||||
|
||||
#endif // __GTKDCCLIENTH__
|
||||
68
wxheaders/wx/gtk1/dcmemory.h
Normal file
68
wxheaders/wx/gtk1/dcmemory.h
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/dcmemory.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKDCMEMORYH__
|
||||
#define __GTKDCMEMORYH__
|
||||
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/gtk1/dcclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxMemoryDCImpl;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMemoryDCImpl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMemoryDCImpl : public wxWindowDCImpl
|
||||
{
|
||||
public:
|
||||
wxMemoryDCImpl(wxMemoryDC *owner)
|
||||
: wxWindowDCImpl(owner)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
wxMemoryDCImpl(wxMemoryDC *owner, wxBitmap& bitmap)
|
||||
: wxWindowDCImpl(owner)
|
||||
{
|
||||
Init();
|
||||
|
||||
DoSelect(bitmap);
|
||||
}
|
||||
|
||||
wxMemoryDCImpl(wxMemoryDC *owner, wxDC *dc);
|
||||
virtual ~wxMemoryDCImpl();
|
||||
|
||||
virtual void DoSelect(const wxBitmap& bitmap);
|
||||
virtual void DoGetSize( int *width, int *height ) const;
|
||||
|
||||
// these get reimplemented for mono-bitmaps to behave
|
||||
// more like their Win32 couterparts. They now interpret
|
||||
// wxWHITE, wxWHITE_BRUSH and wxWHITE_PEN as drawing 0
|
||||
// and everything else as drawing 1.
|
||||
virtual void SetPen( const wxPen &pen );
|
||||
virtual void SetBrush( const wxBrush &brush );
|
||||
virtual void SetBackground( const wxBrush &brush );
|
||||
virtual void SetTextForeground( const wxColour &col );
|
||||
virtual void SetTextBackground( const wxColour &col );
|
||||
|
||||
// implementation
|
||||
wxBitmap m_selected;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxMemoryDCImpl);
|
||||
};
|
||||
|
||||
#endif // __GTKDCMEMORYH__
|
||||
|
||||
38
wxheaders/wx/gtk1/dcscreen.h
Normal file
38
wxheaders/wx/gtk1/dcscreen.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/dcscreen.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKDCSCREENH__
|
||||
#define __GTKDCSCREENH__
|
||||
|
||||
#include "wx/gtk1/dcclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxScreenDCImpl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxScreenDCImpl : public wxPaintDCImpl
|
||||
{
|
||||
public:
|
||||
wxScreenDCImpl(wxScreenDC *owner);
|
||||
virtual ~wxScreenDCImpl();
|
||||
|
||||
// implementation
|
||||
|
||||
static GdkWindow *sm_overlayWindow;
|
||||
static int sm_overlayWindowX;
|
||||
static int sm_overlayWindowY;
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxScreenDCImpl);
|
||||
};
|
||||
|
||||
#endif // __GTKDCSCREENH__
|
||||
|
||||
64
wxheaders/wx/gtk1/dialog.h
Normal file
64
wxheaders/wx/gtk1/dialog.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/dialog.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Created:
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKDIALOGH__
|
||||
#define __GTKDIALOGH__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDialog
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDialog: public wxDialogBase
|
||||
{
|
||||
public:
|
||||
wxDialog() { Init(); }
|
||||
wxDialog( wxWindow *parent, wxWindowID id,
|
||||
const wxString &title,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString &name = wxASCII_STR(wxDialogNameStr) );
|
||||
bool Create( wxWindow *parent, wxWindowID id,
|
||||
const wxString &title,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString &name = wxASCII_STR(wxDialogNameStr) );
|
||||
virtual ~wxDialog() {}
|
||||
|
||||
void OnApply( wxCommandEvent &event );
|
||||
void OnCancel( wxCommandEvent &event );
|
||||
void OnOK( wxCommandEvent &event );
|
||||
void OnPaint( wxPaintEvent& event );
|
||||
void OnCloseWindow( wxCloseEvent& event );
|
||||
/*
|
||||
void OnCharHook( wxKeyEvent& event );
|
||||
*/
|
||||
|
||||
virtual bool Show( bool show = TRUE );
|
||||
virtual int ShowModal();
|
||||
virtual void EndModal( int retCode );
|
||||
virtual bool IsModal() const;
|
||||
void SetModal( bool modal );
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
bool m_modalShowing;
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
private:
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
wxDECLARE_DYNAMIC_CLASS(wxDialog);
|
||||
};
|
||||
|
||||
#endif // __GTKDIALOGH__
|
||||
129
wxheaders/wx/gtk1/dnd.h
Normal file
129
wxheaders/wx/gtk1/dnd.h
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/dnd.h
|
||||
// Purpose: declaration of the wxDropTarget class
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Vadim Zeitlin, Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKDNDH__
|
||||
#define __GTKDNDH__
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/dataobj.h"
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// classes
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxDropTarget;
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextDropTarget;
|
||||
class WXDLLIMPEXP_FWD_CORE wxFileDropTarget;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxDropSource;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// this macro may be used instead for wxDropSource ctor arguments: it will use
|
||||
// the icon 'name' from an XPM file under GTK, but will expand to something
|
||||
// else under MSW. If you don't use it, you will have to use #ifdef in the
|
||||
// application code.
|
||||
#define wxDROP_ICON(name) wxICON(name)
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDropTarget
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDropTarget: public wxDropTargetBase
|
||||
{
|
||||
public:
|
||||
wxDropTarget(wxDataObject *dataObject = NULL );
|
||||
|
||||
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
||||
virtual bool OnDrop(wxCoord x, wxCoord y);
|
||||
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
|
||||
virtual bool GetData();
|
||||
|
||||
// implementation
|
||||
|
||||
GdkAtom GetMatchingPair(bool quiet = false);
|
||||
|
||||
void RegisterWidget( GtkWidget *widget );
|
||||
void UnregisterWidget( GtkWidget *widget );
|
||||
|
||||
GdkDragContext *m_dragContext;
|
||||
GtkWidget *m_dragWidget;
|
||||
GtkSelectionData *m_dragData;
|
||||
unsigned m_dragTime;
|
||||
bool m_firstMotion; // gdk has no "gdk_drag_enter" event
|
||||
|
||||
void SetDragContext( GdkDragContext *dc ) { m_dragContext = dc; }
|
||||
void SetDragWidget( GtkWidget *w ) { m_dragWidget = w; }
|
||||
void SetDragData( GtkSelectionData *sd ) { m_dragData = sd; }
|
||||
void SetDragTime(unsigned time) { m_dragTime = time; }
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDropSource
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase
|
||||
{
|
||||
public:
|
||||
// constructor. set data later with SetData()
|
||||
wxDropSource( wxWindow *win = NULL,
|
||||
const wxIcon © = wxNullIcon,
|
||||
const wxIcon &move = wxNullIcon,
|
||||
const wxIcon &none = wxNullIcon);
|
||||
|
||||
// constructor for setting one data object
|
||||
wxDropSource( wxDataObject& data,
|
||||
wxWindow *win,
|
||||
const wxIcon © = wxNullIcon,
|
||||
const wxIcon &move = wxNullIcon,
|
||||
const wxIcon &none = wxNullIcon);
|
||||
|
||||
virtual ~wxDropSource();
|
||||
|
||||
// start drag action
|
||||
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
|
||||
|
||||
// GTK implementation
|
||||
void RegisterWindow();
|
||||
void UnregisterWindow();
|
||||
|
||||
void PrepareIcon( int action, GdkDragContext *context );
|
||||
|
||||
GtkWidget *m_widget;
|
||||
GtkWidget *m_iconWindow;
|
||||
GdkDragContext *m_dragContext;
|
||||
wxWindow *m_window;
|
||||
|
||||
wxDragResult m_retValue;
|
||||
wxIcon m_iconCopy,
|
||||
m_iconMove,
|
||||
m_iconNone;
|
||||
|
||||
bool m_waiting;
|
||||
|
||||
private:
|
||||
// common part of both ctors
|
||||
void SetIcons(const wxIcon& copy,
|
||||
const wxIcon& move,
|
||||
const wxIcon& none);
|
||||
};
|
||||
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
#endif //__GTKDNDH__
|
||||
|
||||
68
wxheaders/wx/gtk1/filedlg.h
Normal file
68
wxheaders/wx/gtk1/filedlg.h
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/filedlg.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKFILEDLGH__
|
||||
#define __GTKFILEDLGH__
|
||||
|
||||
#include "wx/generic/filedlgg.h"
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxFileDialog
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFileDialog: public wxGenericFileDialog
|
||||
{
|
||||
public:
|
||||
wxFileDialog() { }
|
||||
|
||||
wxFileDialog(wxWindow *parent,
|
||||
const wxString& message = wxASCII_STR(wxFileSelectorPromptStr),
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
|
||||
long style = wxFD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
const wxString& name = wxASCII_STR(wxFileDialogNameStr));
|
||||
|
||||
virtual ~wxFileDialog();
|
||||
|
||||
virtual wxString GetPath() const;
|
||||
virtual void GetPaths(wxArrayString& paths) const;
|
||||
virtual wxString GetDirectory() const;
|
||||
virtual wxString GetFilename() const;
|
||||
virtual void GetFilenames(wxArrayString& files) const;
|
||||
virtual int GetFilterIndex() const;
|
||||
|
||||
virtual void SetMessage(const wxString& message);
|
||||
virtual void SetPath(const wxString& path);
|
||||
virtual void SetDirectory(const wxString& dir);
|
||||
virtual void SetFilename(const wxString& name);
|
||||
virtual void SetWildcard(const wxString& wildCard);
|
||||
virtual void SetFilterIndex(int filterIndex);
|
||||
|
||||
virtual int ShowModal();
|
||||
virtual bool Show( bool show = true );
|
||||
|
||||
//private:
|
||||
bool m_destroyed_by_delete;
|
||||
|
||||
// override this from wxTLW since the native
|
||||
// form doesn't have any m_wxwindow
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxFileDialog);
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
void OnFakeOk( wxCommandEvent &event );
|
||||
};
|
||||
|
||||
#endif // __GTKFILEDLGH__
|
||||
140
wxheaders/wx/gtk1/font.h
Normal file
140
wxheaders/wx/gtk1/font.h
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/font.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKFONTH__
|
||||
#define __GTKFONTH__
|
||||
|
||||
#include "wx/hash.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxPaintDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxFont;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFont
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFont : public wxFontBase
|
||||
{
|
||||
public:
|
||||
// ctors and such
|
||||
wxFont() { }
|
||||
|
||||
wxFont(const wxFontInfo& info)
|
||||
{
|
||||
Create(info.GetPointSize(),
|
||||
info.GetFamily(),
|
||||
info.GetStyle(),
|
||||
info.GetWeight(),
|
||||
info.IsUnderlined(),
|
||||
info.GetFaceName(),
|
||||
info.GetEncoding());
|
||||
|
||||
if ( info.IsUsingSizeInPixels() )
|
||||
SetPixelSize(info.GetPixelSize());
|
||||
}
|
||||
|
||||
wxFont(const wxString& fontname)
|
||||
{
|
||||
Create(fontname);
|
||||
}
|
||||
|
||||
wxFont(const wxNativeFontInfo& info);
|
||||
|
||||
wxFont(int size,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
wxFontWeight weight,
|
||||
bool underlined = false,
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||
{
|
||||
Create(size, family, style, weight, underlined, face, encoding);
|
||||
}
|
||||
|
||||
wxFont(const wxSize& pixelSize,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
wxFontWeight weight,
|
||||
bool underlined = false,
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||
{
|
||||
Create(10, family, style, weight, underlined, face, encoding);
|
||||
SetPixelSize(pixelSize);
|
||||
}
|
||||
|
||||
bool Create(int size,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
wxFontWeight weight,
|
||||
bool underlined = false,
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||
|
||||
|
||||
// wxGTK-specific
|
||||
bool Create(const wxString& fontname);
|
||||
|
||||
virtual ~wxFont();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual double GetFractionalPointSize() const;
|
||||
virtual wxFontStyle GetStyle() const;
|
||||
virtual int GetNumericWeight() const;
|
||||
virtual wxString GetFaceName() const;
|
||||
virtual bool GetUnderlined() const;
|
||||
virtual wxFontEncoding GetEncoding() const;
|
||||
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
|
||||
virtual bool IsFixedWidth() const;
|
||||
|
||||
virtual void SetFractionalPointSize(double pointSize);
|
||||
virtual void SetFamily(wxFontFamily family);
|
||||
virtual void SetStyle(wxFontStyle style);
|
||||
virtual void SetNumericWeight(int weight);
|
||||
virtual bool SetFaceName( const wxString& faceName );
|
||||
virtual void SetUnderlined( bool underlined );
|
||||
virtual void SetEncoding(wxFontEncoding encoding);
|
||||
|
||||
wxDECLARE_COMMON_FONT_METHODS();
|
||||
|
||||
wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants")
|
||||
wxFont(int size,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
bool underlined = false,
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
||||
{
|
||||
(void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
|
||||
}
|
||||
|
||||
// implementation from now on
|
||||
void Unshare();
|
||||
|
||||
GdkFont* GetInternalFont(float scale = 1.0) const;
|
||||
|
||||
protected:
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
|
||||
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
|
||||
virtual wxFontFamily DoGetFamily() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxFont);
|
||||
};
|
||||
|
||||
#endif // __GTKFONTH__
|
||||
39
wxheaders/wx/gtk1/fontdlg.h
Normal file
39
wxheaders/wx/gtk1/fontdlg.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/fontdlg.h
|
||||
// Purpose: wxFontDialog
|
||||
// Author: Robert Roebling
|
||||
// Created:
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTK_FONTDLGH__
|
||||
#define __GTK_FONTDLGH__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxFontDialog
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFontDialog : public wxFontDialogBase
|
||||
{
|
||||
public:
|
||||
wxFontDialog() : wxFontDialogBase() { /* must be Create()d later */ }
|
||||
wxFontDialog(wxWindow *parent)
|
||||
: wxFontDialogBase(parent) { Create(parent); }
|
||||
wxFontDialog(wxWindow *parent, const wxFontData& data)
|
||||
: wxFontDialogBase(parent, data) { Create(parent, data); }
|
||||
|
||||
virtual ~wxFontDialog();
|
||||
|
||||
// implementation only
|
||||
void SetChosenFont(const char *name);
|
||||
|
||||
protected:
|
||||
// create the GTK dialog
|
||||
virtual bool DoCreate(wxWindow *parent);
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxFontDialog);
|
||||
};
|
||||
|
||||
#endif
|
||||
106
wxheaders/wx/gtk1/frame.h
Normal file
106
wxheaders/wx/gtk1/frame.h
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/frame.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKFRAMEH__
|
||||
#define __GTKFRAMEH__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMenu;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMenuBar;
|
||||
class WXDLLIMPEXP_FWD_CORE wxToolBar;
|
||||
class WXDLLIMPEXP_FWD_CORE wxStatusBar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
|
||||
{
|
||||
public:
|
||||
// construction
|
||||
wxFrame() { Init(); }
|
||||
wxFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr));
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
virtual void PositionStatusBar();
|
||||
|
||||
virtual wxStatusBar* CreateStatusBar(int number = 1,
|
||||
long style = wxSTB_DEFAULT_STYLE,
|
||||
wxWindowID id = 0,
|
||||
const wxString& name = wxASCII_STR(wxStatusLineNameStr));
|
||||
|
||||
void SetStatusBar(wxStatusBar *statbar);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
#if wxUSE_TOOLBAR
|
||||
virtual wxToolBar* CreateToolBar(long style = -1,
|
||||
wxWindowID id = -1,
|
||||
const wxString& name = wxASCII_STR(wxToolBarNameStr));
|
||||
void SetToolBar(wxToolBar *toolbar);
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
wxPoint GetClientAreaOrigin() const { return wxPoint(0, 0); }
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
|
||||
// GTK callbacks
|
||||
virtual void GtkOnSize( int x, int y, int width, int height );
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
bool m_menuBarDetached;
|
||||
int m_menuBarHeight;
|
||||
bool m_toolBarDetached;
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// override wxWindow methods to take into account tool/menu/statusbars
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
virtual void DoGetClientSize( int *width, int *height ) const;
|
||||
|
||||
#if wxUSE_MENUS_NATIVE
|
||||
|
||||
virtual void DetachMenuBar();
|
||||
virtual void AttachMenuBar(wxMenuBar *menubar);
|
||||
|
||||
public:
|
||||
// Menu size is dynamic now, call this whenever it might change.
|
||||
void UpdateMenuBarSize();
|
||||
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxFrame);
|
||||
};
|
||||
|
||||
#endif // __GTKFRAMEH__
|
||||
76
wxheaders/wx/gtk1/gauge.h
Normal file
76
wxheaders/wx/gtk1/gauge.h
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/gauge.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKGAUGEH__
|
||||
#define __GTKGAUGEH__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxGaugeBox
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGauge: public wxGaugeBase
|
||||
{
|
||||
public:
|
||||
wxGauge() { Init(); }
|
||||
|
||||
wxGauge( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxGA_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxGaugeNameStr) )
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, range, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id, int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxGA_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxGaugeNameStr) );
|
||||
|
||||
void SetRange( int r );
|
||||
void SetValue( int pos );
|
||||
int GetRange() const;
|
||||
int GetValue() const;
|
||||
|
||||
bool IsVertical() const { return HasFlag(wxGA_VERTICAL); }
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
// -------------
|
||||
|
||||
// the max and current gauge values
|
||||
int m_rangeMax,
|
||||
m_gaugePos;
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init() { m_rangeMax = m_gaugePos = 0; }
|
||||
|
||||
// set the gauge value to the value of m_gaugePos
|
||||
void DoSetGauge();
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
virtual wxVisualAttributes GetDefaultAttributes() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxGauge);
|
||||
};
|
||||
|
||||
#endif
|
||||
// __GTKGAUGEH__
|
||||
127
wxheaders/wx/gtk1/glcanvas.h
Normal file
127
wxheaders/wx/gtk1/glcanvas.h
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/glcanvas.h
|
||||
// Purpose: wxGLCanvas, for using OpenGL/Mesa with wxWidgets and GTK
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// Created: 17/8/98
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GLCANVAS_H_
|
||||
#define _WX_GLCANVAS_H_
|
||||
|
||||
#include "wx/unix/glx11.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxGLCanvas
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasX11
|
||||
{
|
||||
public:
|
||||
wxGLCanvas(wxWindow *parent,
|
||||
const wxGLAttributes& dispAttrs,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxGLCanvasName,
|
||||
const wxPalette& palette = wxNullPalette);
|
||||
|
||||
explicit // avoid implicitly converting a wxWindow* to wxGLCanvas
|
||||
wxGLCanvas(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const int *attribList = NULL,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxGLCanvasName,
|
||||
const wxPalette& palette = wxNullPalette);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
const wxGLAttributes& dispAttrs,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxGLCanvasName,
|
||||
const wxPalette& palette = wxNullPalette);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxGLCanvasName,
|
||||
const int *attribList = NULL,
|
||||
const wxPalette& palette = wxNullPalette);
|
||||
|
||||
|
||||
// implement wxGLCanvasX11 methods
|
||||
// -------------------------------
|
||||
|
||||
virtual unsigned long GetXWindow() const;
|
||||
|
||||
|
||||
// deprecated methods
|
||||
// ------------------
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_8
|
||||
wxDEPRECATED_CONSTRUCTOR(
|
||||
wxGLCanvas(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxGLCanvasName,
|
||||
const int *attribList = NULL,
|
||||
const wxPalette& palette = wxNullPalette)
|
||||
);
|
||||
|
||||
wxDEPRECATED_CONSTRUCTOR(
|
||||
wxGLCanvas(wxWindow *parent,
|
||||
const wxGLContext *shared,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxGLCanvasName,
|
||||
const int *attribList = NULL,
|
||||
const wxPalette& palette = wxNullPalette)
|
||||
);
|
||||
|
||||
wxDEPRECATED_CONSTRUCTOR(
|
||||
wxGLCanvas(wxWindow *parent,
|
||||
const wxGLCanvas *shared,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxGLCanvasName,
|
||||
const int *attribList = NULL,
|
||||
const wxPalette& palette = wxNullPalette)
|
||||
);
|
||||
|
||||
// called from "realized" callback to create the implicit context if needed
|
||||
void GTKInitImplicitContext();
|
||||
#endif // WXWIN_COMPATIBILITY_2_8
|
||||
|
||||
// implementation from now on
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
|
||||
GtkWidget *m_glWidget;
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_8
|
||||
wxGLContext *m_sharedContext;
|
||||
wxGLCanvas *m_sharedContextOf;
|
||||
const bool m_createImplicitContext;
|
||||
#endif // WXWIN_COMPATIBILITY_2_8
|
||||
|
||||
private:
|
||||
wxDECLARE_CLASS(wxGLCanvas);
|
||||
};
|
||||
|
||||
#endif // _WX_GLCANVAS_H_
|
||||
|
||||
139
wxheaders/wx/gtk1/listbox.h
Normal file
139
wxheaders/wx/gtk1/listbox.h
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/listbox.h
|
||||
// Purpose: wxListBox class declaration
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKLISTBOXH__
|
||||
#define __GTKLISTBOXH__
|
||||
|
||||
#include "wx/list.h"
|
||||
|
||||
typedef struct _GtkList GtkList;
|
||||
|
||||
class WXDLLIMPEXP_FWD_BASE wxSortedArrayString;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListBox
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase
|
||||
{
|
||||
public:
|
||||
// ctors and such
|
||||
wxListBox();
|
||||
wxListBox( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxListBoxNameStr) )
|
||||
{
|
||||
#if wxUSE_CHECKLISTBOX
|
||||
m_hasCheckBoxes = false;
|
||||
#endif // wxUSE_CHECKLISTBOX
|
||||
Create(parent, id, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
wxListBox( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxListBoxNameStr) )
|
||||
{
|
||||
#if wxUSE_CHECKLISTBOX
|
||||
m_hasCheckBoxes = false;
|
||||
#endif // wxUSE_CHECKLISTBOX
|
||||
Create(parent, id, pos, size, choices, style, validator, name);
|
||||
}
|
||||
virtual ~wxListBox();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxListBoxNameStr));
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxListBoxNameStr));
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void DoClear();
|
||||
virtual void DoDeleteOneItem(unsigned int n);
|
||||
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
|
||||
virtual bool IsSelected(int n) const;
|
||||
virtual void DoSetSelection(int n, bool select);
|
||||
virtual int GetSelection() const;
|
||||
virtual int GetSelections(wxArrayInt& aSelections) const;
|
||||
|
||||
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
|
||||
unsigned int pos,
|
||||
void **clientData, wxClientDataType type);
|
||||
|
||||
virtual void DoSetFirstItem(int n);
|
||||
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation from now on
|
||||
|
||||
void GtkAddItem( const wxString &item, int pos=-1 );
|
||||
int GtkGetIndex( GtkWidget *item ) const;
|
||||
GtkWidget *GetConnectWidget();
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
void OnInternalIdle();
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
GtkList *m_list;
|
||||
wxList m_clientList;
|
||||
|
||||
#if wxUSE_CHECKLISTBOX
|
||||
bool m_hasCheckBoxes;
|
||||
#endif // wxUSE_CHECKLISTBOX
|
||||
|
||||
int m_prevSelection;
|
||||
bool m_blockEvent;
|
||||
|
||||
virtual void FixUpMouseEvent(GtkWidget *widget, wxCoord& x, wxCoord& y);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
// return the string label for the given item
|
||||
wxString GetRealLabel(struct _GList *item) const;
|
||||
|
||||
// Widgets that use the style->base colour for the BG colour should
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const { return true; }
|
||||
|
||||
private:
|
||||
// this array is only used for controls with wxCB_SORT style, so only
|
||||
// allocate it if it's needed (hence using pointer)
|
||||
wxSortedArrayString *m_strings;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxListBox);
|
||||
};
|
||||
|
||||
#endif // __GTKLISTBOXH__
|
||||
147
wxheaders/wx/gtk1/mdi.h
Normal file
147
wxheaders/wx/gtk1/mdi.h
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/mdi.h
|
||||
// Purpose: TDI-based MDI implementation for wxGTK1
|
||||
// Author: Robert Roebling
|
||||
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK1_MDI_H_
|
||||
#define _WX_GTK1_MDI_H_
|
||||
|
||||
#include "wx/frame.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
||||
|
||||
typedef struct _GtkNotebook GtkNotebook;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMDIParentFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
|
||||
{
|
||||
public:
|
||||
wxMDIParentFrame() { Init(); }
|
||||
wxMDIParentFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr));
|
||||
|
||||
// we don't store the active child in m_currentChild unlike the base class
|
||||
// version so override this method to find it dynamically
|
||||
virtual wxMDIChildFrame *GetActiveChild() const;
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
virtual void ActivateNext();
|
||||
virtual void ActivatePrevious();
|
||||
|
||||
static bool IsTDI() { return true; }
|
||||
|
||||
// implementation
|
||||
|
||||
bool m_justInserted;
|
||||
|
||||
virtual void GtkOnSize( int x, int y, int width, int height );
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxMDIParentFrame);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMDIChildFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxTDIChildFrame
|
||||
{
|
||||
public:
|
||||
wxMDIChildFrame() { Init(); }
|
||||
wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr));
|
||||
|
||||
virtual ~wxMDIChildFrame();
|
||||
|
||||
virtual void SetMenuBar( wxMenuBar *menu_bar );
|
||||
virtual wxMenuBar *GetMenuBar() const;
|
||||
|
||||
virtual void Activate();
|
||||
|
||||
virtual void SetTitle(const wxString& title);
|
||||
|
||||
// implementation
|
||||
|
||||
void OnActivate( wxActivateEvent& event );
|
||||
void OnMenuHighlight( wxMenuEvent& event );
|
||||
|
||||
wxMenuBar *m_menuBar;
|
||||
GtkNotebookPage *m_page;
|
||||
bool m_justInserted;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
GtkNotebook *GTKGetNotebook() const;
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
wxDECLARE_DYNAMIC_CLASS(wxMDIChildFrame);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMDIClientWindow
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
|
||||
{
|
||||
public:
|
||||
wxMDIClientWindow() { }
|
||||
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent,
|
||||
long style = wxVSCROLL | wxHSCROLL);
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxMDIClientWindow);
|
||||
};
|
||||
|
||||
#endif // _WX_GTK1_MDI_H_
|
||||
101
wxheaders/wx/gtk1/menu.h
Normal file
101
wxheaders/wx/gtk1/menu.h
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/menu.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKMENUH__
|
||||
#define __GTKMENUH__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMenuBar
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMenuBar : public wxMenuBarBase
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxMenuBar();
|
||||
wxMenuBar(long style);
|
||||
wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0);
|
||||
virtual ~wxMenuBar();
|
||||
|
||||
// implement base class (pure) virtuals
|
||||
virtual bool Append( wxMenu *menu, const wxString &title );
|
||||
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
|
||||
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
|
||||
virtual wxMenu *Remove(size_t pos);
|
||||
|
||||
virtual int FindMenuItem(const wxString& menuString,
|
||||
const wxString& itemString) const;
|
||||
virtual wxMenuItem* FindItem( int id, wxMenu **menu = NULL ) const;
|
||||
|
||||
virtual void EnableTop( size_t pos, bool flag );
|
||||
virtual void SetMenuLabel( size_t pos, const wxString& label );
|
||||
virtual wxString GetMenuLabel( size_t pos ) const;
|
||||
|
||||
// common part of Append and Insert
|
||||
bool GtkAppend(wxMenu *menu, const wxString& title, int pos=-1);
|
||||
|
||||
virtual void Attach(wxFrame *frame);
|
||||
virtual void Detach();
|
||||
|
||||
GtkAccelGroup *m_accel;
|
||||
GtkWidget *m_menubar;
|
||||
long m_style;
|
||||
|
||||
private:
|
||||
void Init(size_t n, wxMenu *menus[], const wxString titles[], long style);
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxMenuBar);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMenu
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMenu : public wxMenuBase
|
||||
{
|
||||
public:
|
||||
// ctors & dtor
|
||||
wxMenu(const wxString& title, long style = 0)
|
||||
: wxMenuBase(title, style) { Init(); }
|
||||
|
||||
wxMenu(long style = 0) : wxMenuBase(style) { Init(); }
|
||||
|
||||
virtual ~wxMenu();
|
||||
|
||||
// implement base class virtuals
|
||||
virtual wxMenuItem* DoAppend(wxMenuItem *item);
|
||||
virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item);
|
||||
virtual wxMenuItem* DoRemove(wxMenuItem *item);
|
||||
|
||||
// Returns the title, with mnemonics translated to wx format
|
||||
wxString GetTitle() const;
|
||||
|
||||
// TODO: virtual void SetTitle(const wxString& title);
|
||||
|
||||
// implementation
|
||||
int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
|
||||
|
||||
// implementation GTK only
|
||||
GtkWidget *m_menu; // GtkMenu
|
||||
GtkWidget *m_owner;
|
||||
GtkAccelGroup *m_accel;
|
||||
|
||||
private:
|
||||
// common code for all constructors:
|
||||
void Init();
|
||||
|
||||
// common part of Append (if pos == -1) and Insert
|
||||
bool GtkAppend(wxMenuItem *item, int pos=-1);
|
||||
|
||||
GtkWidget *m_prevRadio;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxMenu);
|
||||
};
|
||||
|
||||
#endif
|
||||
// __GTKMENUH__
|
||||
74
wxheaders/wx/gtk1/menuitem.h
Normal file
74
wxheaders/wx/gtk1/menuitem.h
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/menuitem.h
|
||||
// Purpose: wxMenuItem class
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKMENUITEMH__
|
||||
#define __GTKMENUITEMH__
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMenuItem
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase
|
||||
{
|
||||
public:
|
||||
wxMenuItem(wxMenu *parentMenu = NULL,
|
||||
int id = wxID_SEPARATOR,
|
||||
const wxString& text = wxEmptyString,
|
||||
const wxString& help = wxEmptyString,
|
||||
wxItemKind kind = wxITEM_NORMAL,
|
||||
wxMenu *subMenu = NULL);
|
||||
virtual ~wxMenuItem();
|
||||
|
||||
// implement base class virtuals
|
||||
virtual void SetItemLabel( const wxString& str );
|
||||
virtual wxString GetItemLabel() const;
|
||||
virtual void Enable( bool enable = TRUE );
|
||||
virtual void Check( bool check = TRUE );
|
||||
virtual bool IsChecked() const;
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
virtual wxAcceleratorEntry *GetAccel() const;
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
// implementation
|
||||
void SetMenuItem(GtkWidget *menuItem) { m_menuItem = menuItem; }
|
||||
GtkWidget *GetMenuItem() const { return m_menuItem; }
|
||||
GtkWidget *GetLabelWidget() const { return m_labelWidget; }
|
||||
void SetLabelWidget(GtkWidget *labelWidget) { m_labelWidget = labelWidget; }
|
||||
wxString GetFactoryPath() const;
|
||||
|
||||
wxString GetHotKey() const { return m_hotKey; }
|
||||
|
||||
// compatibility only, don't use in new code
|
||||
wxMenuItem(wxMenu *parentMenu,
|
||||
int id,
|
||||
const wxString& text,
|
||||
const wxString& help,
|
||||
bool isCheckable,
|
||||
wxMenu *subMenu = NULL);
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// DoSetText() transforms the accel mnemonics in our label from MSW/wxWin
|
||||
// style to GTK+ and is called from ctor and SetText()
|
||||
void DoSetText(const wxString& text);
|
||||
|
||||
wxString m_hotKey;
|
||||
|
||||
GtkWidget *m_menuItem; // GtkMenuItem
|
||||
GtkWidget* m_labelWidget; // Label widget
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxMenuItem);
|
||||
};
|
||||
|
||||
#endif
|
||||
//__GTKMENUITEMH__
|
||||
65
wxheaders/wx/gtk1/minifram.h
Normal file
65
wxheaders/wx/gtk1/minifram.h
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/minifram.h
|
||||
// Purpose: wxMiniFrame class
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKMINIFRAMEH__
|
||||
#define __GTKMINIFRAMEH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_MINIFRAME
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/frame.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxMiniFrame;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMiniFrame
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMiniFrame: public wxFrame
|
||||
{
|
||||
wxDECLARE_DYNAMIC_CLASS(wxMiniFrame);
|
||||
|
||||
public:
|
||||
wxMiniFrame() {}
|
||||
wxMiniFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxTINY_CAPTION,
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr))
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxTINY_CAPTION,
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr));
|
||||
|
||||
virtual void SetTitle( const wxString &title );
|
||||
// implementation
|
||||
|
||||
bool m_isDragging;
|
||||
int m_oldX,m_oldY;
|
||||
int m_diffX,m_diffY;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __GTKMINIFRAMEH__
|
||||
50
wxheaders/wx/gtk1/msgdlg.h
Normal file
50
wxheaders/wx/gtk1/msgdlg.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/msgdlg.h
|
||||
// Purpose: wxMessageDialog for GTK+2
|
||||
// Author: Vaclav Slavik
|
||||
// Modified by:
|
||||
// Created: 2003/02/28
|
||||
// Copyright: (c) Vaclav Slavik, 2003
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __MSGDLG_H__
|
||||
#define __MSGDLG_H__
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/dialog.h"
|
||||
|
||||
// type is an 'or' (|) of wxOK, wxCANCEL, wxYES_NO
|
||||
// Returns wxYES/NO/OK/CANCEL
|
||||
|
||||
extern WXDLLIMPEXP_DATA_CORE(const wxChar) wxMessageBoxCaptionStr[];
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMessageDialog: public wxDialog, public wxMessageDialogBase
|
||||
{
|
||||
public:
|
||||
wxMessageDialog(wxWindow *parent, const wxString& message,
|
||||
const wxString& caption = wxMessageBoxCaptionStr,
|
||||
long style = wxOK|wxCENTRE,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
virtual ~wxMessageDialog();
|
||||
|
||||
int ShowModal();
|
||||
virtual bool Show( bool WXUNUSED(show) = true ) { return false; }
|
||||
|
||||
protected:
|
||||
// implement some base class methods to do nothing to avoid asserts and
|
||||
// GTK warnings, since this is not a real wxDialog.
|
||||
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
|
||||
int WXUNUSED(width), int WXUNUSED(height),
|
||||
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
|
||||
virtual void DoMoveWindow(int WXUNUSED(x), int WXUNUSED(y),
|
||||
int WXUNUSED(width), int WXUNUSED(height)) {}
|
||||
|
||||
private:
|
||||
wxString m_caption;
|
||||
wxString m_message;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxMessageDialog);
|
||||
};
|
||||
|
||||
#endif
|
||||
149
wxheaders/wx/gtk1/notebook.h
Normal file
149
wxheaders/wx/gtk1/notebook.h
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/notebook.h
|
||||
// Purpose: wxNotebook class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// Copyright: (c) Julian Smart and Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKNOTEBOOKH__
|
||||
#define __GTKNOTEBOOKH__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// internal class
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxGtkNotebookPage;
|
||||
|
||||
#include "wx/list.h"
|
||||
WX_DECLARE_LIST(wxGtkNotebookPage, wxGtkNotebookPagesList);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxNotebook
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxNotebook : public wxNotebookBase
|
||||
{
|
||||
public:
|
||||
// default for dynamic class
|
||||
wxNotebook();
|
||||
// the same arguments as for wxControl
|
||||
wxNotebook(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxASCII_STR(wxNotebookNameStr));
|
||||
// Create() function
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxASCII_STR(wxNotebookNameStr));
|
||||
// dtor
|
||||
virtual ~wxNotebook();
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or wxNOT_FOUND on error)
|
||||
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||
int SetSelection(size_t nPage) { return DoSetSelection(nPage, SetSelection_SendEvent); }
|
||||
// get the currently selected page
|
||||
int GetSelection() const;
|
||||
|
||||
// changes selected page without sending events
|
||||
int ChangeSelection(size_t nPage) { return DoSetSelection(nPage); }
|
||||
|
||||
// set/get the title of a page
|
||||
bool SetPageText(size_t nPage, const wxString& strText);
|
||||
wxString GetPageText(size_t nPage) const;
|
||||
|
||||
// sets/returns item's image index in the current image list
|
||||
int GetPageImage(size_t nPage) const;
|
||||
bool SetPageImage(size_t nPage, int nImage);
|
||||
|
||||
// control the appearance of the notebook pages
|
||||
// set the size (the same for all pages)
|
||||
void SetPageSize(const wxSize& size);
|
||||
// set the padding between tabs (in pixels)
|
||||
void SetPadding(const wxSize& padding);
|
||||
// sets the size of the tabs (assumes all tabs are the same size)
|
||||
void SetTabSize(const wxSize& sz);
|
||||
|
||||
virtual int HitTest(const wxPoint& pt, long *flags = NULL) const;
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
// remove all pages
|
||||
bool DeleteAllPages();
|
||||
|
||||
// adds a new page to the notebook (it will be deleted by the notebook,
|
||||
// don't delete it yourself). If bSelect, this page becomes active.
|
||||
// the same as AddPage(), but adds it at the specified position
|
||||
bool InsertPage( size_t position,
|
||||
wxNotebookPage *win,
|
||||
const wxString& strText,
|
||||
bool bSelect = false,
|
||||
int imageId = NO_IMAGE );
|
||||
|
||||
// handler for tab navigation
|
||||
// --------------------------
|
||||
void OnNavigationKey(wxNavigationKeyEvent& event);
|
||||
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
#if wxUSE_CONSTRAINTS
|
||||
void SetConstraintSizes(bool recurse);
|
||||
bool DoPhase(int phase);
|
||||
#endif
|
||||
|
||||
// set all page's attributes
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
|
||||
// report if window belongs to notebook
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// helper function
|
||||
wxGtkNotebookPage* GetNotebookPage(int page) const;
|
||||
|
||||
// the additional page data (the pages themselves are in m_pages array)
|
||||
wxGtkNotebookPagesList m_pagesData;
|
||||
|
||||
// for reasons explained in gtk/notebook.cpp we store the current
|
||||
// selection internally instead of querying the notebook for it
|
||||
int m_selection;
|
||||
|
||||
// flag set to true while we're inside "switch_page" callback
|
||||
bool m_inSwitchPage;
|
||||
|
||||
// flag set to true when the switch-page signal has been programmatically generated
|
||||
bool m_skipNextPageChangeEvent;
|
||||
|
||||
protected:
|
||||
// remove one page from the notebook but do not destroy it
|
||||
virtual wxNotebookPage *DoRemovePage(size_t nPage);
|
||||
|
||||
int DoSetSelection(size_t nPage, int flags = 0);
|
||||
|
||||
private:
|
||||
// the padding set by SetPadding()
|
||||
int m_padding;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxNotebook);
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
#endif
|
||||
// __GTKNOTEBOOKH__
|
||||
79
wxheaders/wx/gtk1/pen.h
Normal file
79
wxheaders/wx/gtk1/pen.h
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/pen.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKPENH__
|
||||
#define __GTKPENH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxPen;
|
||||
|
||||
#if defined(__WXGTK127__)
|
||||
typedef signed char wxGTKDash;
|
||||
#else
|
||||
typedef char wxGTKDash;
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPen
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPen: public wxPenBase
|
||||
{
|
||||
public:
|
||||
wxPen() { }
|
||||
|
||||
wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID );
|
||||
|
||||
wxPen( const wxPenInfo& info );
|
||||
|
||||
bool operator==(const wxPen& pen) const;
|
||||
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
||||
|
||||
void SetColour( const wxColour &colour );
|
||||
void SetColour( unsigned char red, unsigned char green, unsigned char blue );
|
||||
void SetCap( wxPenCap capStyle );
|
||||
void SetJoin( wxPenJoin joinStyle );
|
||||
void SetStyle( wxPenStyle style );
|
||||
void SetWidth( int width );
|
||||
void SetDashes( int number_of_dashes, const wxDash *dash );
|
||||
void SetStipple(const wxBitmap& stipple);
|
||||
|
||||
wxColour GetColour() const;
|
||||
wxPenCap GetCap() const;
|
||||
wxPenJoin GetJoin() const;
|
||||
wxPenStyle GetStyle() const;
|
||||
int GetWidth() const;
|
||||
int GetDashes(wxDash **ptr) const;
|
||||
int GetDashCount() const;
|
||||
wxDash* GetDash() const;
|
||||
wxBitmap *GetStipple() const;
|
||||
|
||||
|
||||
wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants")
|
||||
wxPen(const wxColour& col, int width, int style);
|
||||
|
||||
wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants")
|
||||
void SetStyle(int style) { SetStyle((wxPenStyle)style); }
|
||||
|
||||
private:
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxPen);
|
||||
};
|
||||
|
||||
#endif // __GTKPENH__
|
||||
53
wxheaders/wx/gtk1/popupwin.h
Normal file
53
wxheaders/wx/gtk1/popupwin.h
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/popupwin.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Created:
|
||||
// Copyright: (c) 2001 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKPOPUPWINH__
|
||||
#define __GTKPOPUPWINH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/panel.h"
|
||||
#include "wx/icon.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPopUpWindow
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPopupWindow: public wxPopupWindowBase
|
||||
{
|
||||
public:
|
||||
wxPopupWindow() { }
|
||||
virtual ~wxPopupWindow();
|
||||
|
||||
wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE)
|
||||
{ (void)Create(parent, flags); }
|
||||
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
|
||||
|
||||
virtual bool Show( bool show = TRUE );
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
|
||||
protected:
|
||||
void GtkOnSize( int x, int y, int width, int height );
|
||||
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
private:
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
wxDECLARE_DYNAMIC_CLASS(wxPopupWindow);
|
||||
};
|
||||
|
||||
#endif // __GTKPOPUPWINDOWH__
|
||||
95
wxheaders/wx/gtk1/private.h
Normal file
95
wxheaders/wx/gtk1/private.h
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/private.h
|
||||
// Purpose: wxGTK private macros, functions &c
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 12.03.02
|
||||
// Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_PRIVATE_H_
|
||||
#define _WX_GTK_PRIVATE_H_
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "wx/event.h"
|
||||
|
||||
// fail all version tests if the GTK+ version is so ancient that it doesn't
|
||||
// even have GTK_CHECK_VERSION
|
||||
#ifndef GTK_CHECK_VERSION
|
||||
#define GTK_CHECK_VERSION(a, b, c) 0
|
||||
#endif
|
||||
|
||||
#define wxGTK_CONV(s) s.c_str()
|
||||
#define wxGTK_CONV_BACK(s) s
|
||||
|
||||
|
||||
// child is not a member of GTK_BUTTON() any more in GTK+ 2.0
|
||||
#define BUTTON_CHILD(w) GTK_BUTTON((w))->child
|
||||
|
||||
// event_window has disappeared from GtkToggleButton in GTK+ 2.0
|
||||
#define TOGGLE_BUTTON_EVENT_WIN(w) GTK_TOGGLE_BUTTON((w))->event_window
|
||||
|
||||
// gtk_editable_{copy|cut|paste}_clipboard() had an extra argument under
|
||||
// previous GTK+ versions but no more
|
||||
#if defined(__WXGTK20__) || (GTK_MINOR_VERSION > 0)
|
||||
#define DUMMY_CLIPBOARD_ARG
|
||||
#else
|
||||
#define DUMMY_CLIPBOARD_ARG ,0
|
||||
#endif
|
||||
|
||||
// _GtkEditable is private in GTK2
|
||||
#define GET_EDITABLE_POS(w) GTK_EDITABLE((w))->current_pos
|
||||
#define SET_EDITABLE_POS(w, pos) \
|
||||
GTK_EDITABLE((w))->current_pos = (pos)
|
||||
|
||||
// this GtkNotebook struct field has been renamed in GTK2
|
||||
#define NOTEBOOK_PANEL(nb) GTK_NOTEBOOK(nb)->panel
|
||||
|
||||
#define SCROLLBAR_CBACK_ARG
|
||||
#define GET_SCROLL_TYPE(w) GTK_RANGE((w))->scroll_type
|
||||
|
||||
// translate a GTK+ scroll type to a wxEventType
|
||||
inline wxEventType GtkScrollTypeToWx(guint scrollType)
|
||||
{
|
||||
wxEventType command;
|
||||
switch ( scrollType )
|
||||
{
|
||||
case GTK_SCROLL_STEP_BACKWARD:
|
||||
command = wxEVT_SCROLL_LINEUP;
|
||||
break;
|
||||
|
||||
case GTK_SCROLL_STEP_FORWARD:
|
||||
command = wxEVT_SCROLL_LINEDOWN;
|
||||
break;
|
||||
|
||||
case GTK_SCROLL_PAGE_BACKWARD:
|
||||
command = wxEVT_SCROLL_PAGEUP;
|
||||
break;
|
||||
|
||||
case GTK_SCROLL_PAGE_FORWARD:
|
||||
command = wxEVT_SCROLL_PAGEDOWN;
|
||||
break;
|
||||
|
||||
default:
|
||||
command = wxEVT_SCROLL_THUMBTRACK;
|
||||
}
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
inline wxEventType GtkScrollWinTypeToWx(guint scrollType)
|
||||
{
|
||||
// GtkScrollTypeToWx() returns SCROLL_XXX, not SCROLLWIN_XXX as we need
|
||||
return GtkScrollTypeToWx(scrollType) +
|
||||
wxEVT_SCROLLWIN_TOP - wxEVT_SCROLL_TOP;
|
||||
}
|
||||
|
||||
// Needed for implementing e.g. combobox on wxGTK within a modal dialog.
|
||||
void wxAddGrab(wxWindow* window);
|
||||
void wxRemoveGrab(wxWindow* window);
|
||||
|
||||
#endif // _WX_GTK_PRIVATE_H_
|
||||
|
||||
80
wxheaders/wx/gtk1/private/addremovectrl.h
Normal file
80
wxheaders/wx/gtk1/private/addremovectrl.h
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private/addremovectrl.h
|
||||
// Purpose: GTK specific wxAddRemoveImpl implementation
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2015-02-05
|
||||
// Copyright: (c) 2015 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_PRIVATE_ADDREMOVECTRL_H_
|
||||
#define _WX_GTK_PRIVATE_ADDREMOVECTRL_H_
|
||||
|
||||
#include "wx/artprov.h"
|
||||
#include "wx/bmpbuttn.h"
|
||||
#include "wx/toolbar.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxAddRemoveImpl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxAddRemoveImpl : public wxAddRemoveImplBase
|
||||
{
|
||||
public:
|
||||
wxAddRemoveImpl(wxAddRemoveAdaptor* adaptor,
|
||||
wxAddRemoveCtrl* parent,
|
||||
wxWindow* ctrlItems)
|
||||
: wxAddRemoveImplBase(adaptor, parent, ctrlItems),
|
||||
m_tbar(new wxToolBar(parent, wxID_ANY))
|
||||
{
|
||||
m_tbar->AddTool(wxID_ADD, wxString(), GetNamedBitmap("list-add"));
|
||||
m_tbar->AddTool(wxID_REMOVE, wxString(), GetNamedBitmap("list-remove"));
|
||||
|
||||
#if defined(__WXGTK3__) && !defined(__WXUNIVERSAL__)
|
||||
// Tweak the toolbar appearance to correspond to how the toolbars used
|
||||
// in other GNOME applications for similar purposes look.
|
||||
GtkToolbar* const toolbar = m_tbar->GTKGetToolbar();
|
||||
GtkStyleContext* context = gtk_widget_get_style_context(GTK_WIDGET(toolbar));
|
||||
gtk_style_context_add_class(context, GTK_STYLE_CLASS_INLINE_TOOLBAR);
|
||||
gtk_style_context_set_junction_sides(context, GTK_JUNCTION_TOP);
|
||||
#endif // GTK+3
|
||||
|
||||
wxSizer* const sizerTop = new wxBoxSizer(wxVERTICAL);
|
||||
sizerTop->Add(ctrlItems, wxSizerFlags(1).Expand());
|
||||
sizerTop->Add(m_tbar, wxSizerFlags().Expand());
|
||||
parent->SetSizer(sizerTop);
|
||||
|
||||
m_tbar->Bind(wxEVT_UPDATE_UI,
|
||||
&wxAddRemoveImplBase::OnUpdateUIAdd, this, wxID_ADD);
|
||||
m_tbar->Bind(wxEVT_UPDATE_UI,
|
||||
&wxAddRemoveImplBase::OnUpdateUIRemove, this, wxID_REMOVE);
|
||||
|
||||
m_tbar->Bind(wxEVT_TOOL, &wxAddRemoveImplBase::OnAdd, this, wxID_ADD);
|
||||
m_tbar->Bind(wxEVT_TOOL, &wxAddRemoveImplBase::OnRemove, this, wxID_REMOVE);
|
||||
}
|
||||
|
||||
virtual void SetButtonsToolTips(const wxString& addtip,
|
||||
const wxString& removetip) wxOVERRIDE
|
||||
{
|
||||
m_tbar->SetToolShortHelp(wxID_ADD, addtip);
|
||||
m_tbar->SetToolShortHelp(wxID_REMOVE, removetip);
|
||||
}
|
||||
|
||||
private:
|
||||
static wxBitmap GetNamedBitmap(const wxString& name)
|
||||
{
|
||||
// GTK UI guidelines recommend using "symbolic" versions of the icons
|
||||
// for these buttons, so try them first but fall back to the normal
|
||||
// ones if symbolic theme is not installed.
|
||||
wxBitmap bmp = wxArtProvider::GetBitmap(name + wxASCII_STR("-symbolic"), wxART_MENU);
|
||||
if ( !bmp.IsOk() )
|
||||
bmp = wxArtProvider::GetBitmap(name, wxART_MENU);
|
||||
return bmp;
|
||||
}
|
||||
|
||||
wxToolBar* const m_tbar;
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_PRIVATE_ADDREMOVECTRL_H_
|
||||
38
wxheaders/wx/gtk1/private/mnemonics.h
Normal file
38
wxheaders/wx/gtk1/private/mnemonics.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/private/mnemonics.h
|
||||
// Purpose: helper functions for dealing with GTK+ mnemonics
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2007-11-12
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _GTK_PRIVATE_MNEMONICS_H_
|
||||
#define _GTK_PRIVATE_MNEMONICS_H_
|
||||
|
||||
#if wxUSE_CONTROLS || wxUSE_MENUS
|
||||
|
||||
#include "wx/string.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// functions to convert between wxWidgets and GTK+ string containing mnemonics
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// remove all mnemonics from a string
|
||||
wxString wxGTKRemoveMnemonics(const wxString& label);
|
||||
|
||||
// convert a wx string with '&' to GTK+ string with '_'s
|
||||
wxString wxConvertMnemonicsToGTK(const wxString& label);
|
||||
|
||||
// convert a wx string with '&' to indicate mnemonics as well as HTML entities
|
||||
// to a GTK+ string with "&" used instead of '&', i.e. suitable for use
|
||||
// with GTK+ functions using markup strings
|
||||
wxString wxConvertMnemonicsToGTKMarkup(const wxString& label);
|
||||
|
||||
// convert GTK+ string with '_'s to wx string with '&'s
|
||||
wxString wxConvertMnemonicsFromGTK(const wxString& label);
|
||||
|
||||
#endif // wxUSE_CONTROLS || wxUSE_MENUS
|
||||
|
||||
#endif // _GTK_PRIVATE_MNEMONICS_H_
|
||||
|
||||
33
wxheaders/wx/gtk1/private/timer.h
Normal file
33
wxheaders/wx/gtk1/private/timer.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/private/timer.h
|
||||
// Purpose: wxTimerImpl for wxGTK
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK1_PRIVATE_TIMER_H_
|
||||
#define _WX_GTK1_PRIVATE_TIMER_H_
|
||||
|
||||
#include "wx/private/timer.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTimer
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGTKTimerImpl : public wxTimerImpl
|
||||
{
|
||||
public:
|
||||
wxGTKTimerImpl(wxTimer *timer) : wxTimerImpl(timer) { m_tag = -1; }
|
||||
|
||||
virtual bool Start(int millisecs = -1, bool oneShot = FALSE);
|
||||
virtual void Stop();
|
||||
|
||||
virtual bool IsRunning() const { return m_tag != -1; }
|
||||
|
||||
private:
|
||||
// registered timeout id, -1 if the timer isn't running
|
||||
int m_tag;
|
||||
};
|
||||
|
||||
#endif // _WX_GTK1_PRIVATE_TIMER_H_
|
||||
135
wxheaders/wx/gtk1/radiobox.h
Normal file
135
wxheaders/wx/gtk1/radiobox.h
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/radiobox.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_RADIOBOX_H_
|
||||
#define _WX_GTK_RADIOBOX_H_
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxRadioBox
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxRadioBox : public wxControl,
|
||||
public wxRadioBoxBase
|
||||
{
|
||||
public:
|
||||
// ctors and dtor
|
||||
wxRadioBox() { Init(); }
|
||||
wxRadioBox(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0,
|
||||
const wxString choices[] = (const wxString *) NULL,
|
||||
int majorDim = 1,
|
||||
long style = wxRA_SPECIFY_COLS,
|
||||
const wxValidator& val = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxRadioBoxNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
|
||||
}
|
||||
|
||||
wxRadioBox(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
int majorDim = 1,
|
||||
long style = wxRA_SPECIFY_COLS,
|
||||
const wxValidator& val = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxRadioBoxNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
Create( parent, id, title, pos, size, choices, majorDim, style, val, name );
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0,
|
||||
const wxString choices[] = (const wxString *) NULL,
|
||||
int majorDim = 0,
|
||||
long style = wxRA_SPECIFY_COLS,
|
||||
const wxValidator& val = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxRadioBoxNameStr));
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
int majorDim = 0,
|
||||
long style = wxRA_SPECIFY_COLS,
|
||||
const wxValidator& val = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxRadioBoxNameStr));
|
||||
|
||||
virtual ~wxRadioBox();
|
||||
|
||||
|
||||
// implement wxItemContainerImmutable methods
|
||||
virtual unsigned int GetCount() const;
|
||||
|
||||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
|
||||
|
||||
// implement wxRadioBoxBase methods
|
||||
virtual bool Show(unsigned int n, bool show = true);
|
||||
virtual bool Enable(unsigned int n, bool enable = true);
|
||||
|
||||
virtual bool IsItemEnabled(unsigned int n) const;
|
||||
virtual bool IsItemShown(unsigned int n) const;
|
||||
|
||||
|
||||
// override some base class methods to operate on radiobox itself too
|
||||
virtual bool Show( bool show = true );
|
||||
virtual bool Enable( bool enable = true );
|
||||
|
||||
virtual void SetLabel( const wxString& label );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
void SetFocus();
|
||||
void GtkDisableEvents();
|
||||
void GtkEnableEvents();
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
#if wxUSE_TOOLTIPS
|
||||
void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
bool m_hasFocus,
|
||||
m_lostFocus;
|
||||
wxList m_boxes;
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxRadioBox);
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_RADIOBOX_H_
|
||||
66
wxheaders/wx/gtk1/radiobut.h
Normal file
66
wxheaders/wx/gtk1/radiobut.h
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/radiobut.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKRADIOBUTTONH__
|
||||
#define __GTKRADIOBUTTONH__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxRadioButton
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase
|
||||
{
|
||||
public:
|
||||
wxRadioButton() { }
|
||||
wxRadioButton( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxRadioButtonNameStr) )
|
||||
{
|
||||
Create( parent, id, label, pos, size, style, validator, name );
|
||||
}
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxRadioButtonNameStr) );
|
||||
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual void SetValue(bool val);
|
||||
virtual bool GetValue() const;
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
|
||||
virtual bool IsRadioButton() const { return TRUE; }
|
||||
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void OnInternalIdle();
|
||||
|
||||
bool m_blockEvent;
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxRadioButton);
|
||||
};
|
||||
|
||||
#endif // __GTKRADIOBUTTONH__
|
||||
125
wxheaders/wx/gtk1/region.h
Normal file
125
wxheaders/wx/gtk1/region.h
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/region.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_REGION_H_
|
||||
#define _WX_GTK_REGION_H_
|
||||
|
||||
#include "wx/list.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegion
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxRegion : public wxRegionBase
|
||||
{
|
||||
public:
|
||||
wxRegion() { }
|
||||
|
||||
wxRegion( wxCoord x, wxCoord y, wxCoord w, wxCoord h )
|
||||
{
|
||||
InitRect(x, y, w, h);
|
||||
}
|
||||
|
||||
wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight )
|
||||
{
|
||||
InitRect(topLeft.x, topLeft.y,
|
||||
bottomRight.x - topLeft.x, bottomRight.y - topLeft.y);
|
||||
}
|
||||
|
||||
wxRegion( const wxRect& rect )
|
||||
{
|
||||
InitRect(rect.x, rect.y, rect.width, rect.height);
|
||||
}
|
||||
|
||||
wxRegion( size_t n, const wxPoint *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
|
||||
|
||||
wxRegion( const wxBitmap& bmp)
|
||||
{
|
||||
Union(bmp);
|
||||
}
|
||||
wxRegion( const wxBitmap& bmp,
|
||||
const wxColour& transColour, int tolerance = 0)
|
||||
{
|
||||
Union(bmp, transColour, tolerance);
|
||||
}
|
||||
|
||||
virtual ~wxRegion();
|
||||
|
||||
// wxRegionBase methods
|
||||
virtual void Clear();
|
||||
virtual bool IsEmpty() const;
|
||||
|
||||
public:
|
||||
// Init with GdkRegion, set ref count to 2 so that
|
||||
// the C++ class will not destroy the region!
|
||||
wxRegion( GdkRegion *region );
|
||||
|
||||
GdkRegion *GetRegion() const;
|
||||
|
||||
protected:
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
|
||||
// wxRegionBase pure virtuals
|
||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
||||
virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const;
|
||||
virtual wxRegionContain DoContainsRect(const wxRect& rect) const;
|
||||
|
||||
virtual bool DoOffset(wxCoord x, wxCoord y);
|
||||
virtual bool DoUnionWithRect(const wxRect& rect);
|
||||
virtual bool DoUnionWithRegion(const wxRegion& region);
|
||||
virtual bool DoIntersect(const wxRegion& region);
|
||||
virtual bool DoSubtract(const wxRegion& region);
|
||||
virtual bool DoXor(const wxRegion& region);
|
||||
|
||||
// common part of ctors for a rectangle region
|
||||
void InitRect(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxRegion);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegionIterator: decomposes a region into rectangles
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxRegionIterator: public wxObject
|
||||
{
|
||||
public:
|
||||
wxRegionIterator();
|
||||
wxRegionIterator(const wxRegion& region);
|
||||
|
||||
void Reset() { m_current = 0u; }
|
||||
void Reset(const wxRegion& region);
|
||||
|
||||
bool HaveRects() const;
|
||||
operator bool () const { return HaveRects(); }
|
||||
|
||||
wxRegionIterator& operator ++ ();
|
||||
wxRegionIterator operator ++ (int);
|
||||
|
||||
wxCoord GetX() const;
|
||||
wxCoord GetY() const;
|
||||
wxCoord GetW() const;
|
||||
wxCoord GetWidth() const { return GetW(); }
|
||||
wxCoord GetH() const;
|
||||
wxCoord GetHeight() const { return GetH(); }
|
||||
wxRect GetRect() const;
|
||||
|
||||
private:
|
||||
size_t m_current;
|
||||
wxRegion m_region;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxRegionIterator);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
// _WX_GTK_REGION_H_
|
||||
84
wxheaders/wx/gtk1/scrolbar.h
Normal file
84
wxheaders/wx/gtk1/scrolbar.h
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/scrolbar.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKSCROLLBARH__
|
||||
#define __GTKSCROLLBARH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxScrollBar
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxScrollBar: public wxScrollBarBase
|
||||
{
|
||||
public:
|
||||
wxScrollBar()
|
||||
{ m_adjust = NULL; m_oldPos = 0.0; }
|
||||
inline wxScrollBar( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSB_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxScrollBarNameStr) )
|
||||
{
|
||||
Create( parent, id, pos, size, style, validator, name );
|
||||
}
|
||||
bool Create( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSB_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxScrollBarNameStr) );
|
||||
virtual ~wxScrollBar();
|
||||
int GetThumbPosition() const;
|
||||
int GetThumbSize() const;
|
||||
int GetPageSize() const;
|
||||
int GetRange() const;
|
||||
virtual void SetThumbPosition( int viewStart );
|
||||
virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize,
|
||||
bool refresh = TRUE );
|
||||
|
||||
// Backward compatibility
|
||||
// ----------------------
|
||||
|
||||
int GetValue(void) const;
|
||||
void SetValue( int viewStart );
|
||||
void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const;
|
||||
int GetViewLength() const;
|
||||
int GetObjectLength() const;
|
||||
void SetPageSize( int pageLength );
|
||||
void SetObjectLength( int objectLength );
|
||||
void SetViewLength( int viewLength );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
|
||||
GtkAdjustment *m_adjust;
|
||||
float m_oldPos;
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxScrollBar);
|
||||
};
|
||||
|
||||
#endif
|
||||
// __GTKSCROLLBARH__
|
||||
57
wxheaders/wx/gtk1/scrolwin.h
Normal file
57
wxheaders/wx/gtk1/scrolwin.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/scrolwin.h
|
||||
// Purpose: wxScrolledWindow class
|
||||
// Author: Robert Roebling
|
||||
// Modified by: Vadim Zeitlin (2005-10-10): wxScrolledWindow is now common
|
||||
// Created: 01/02/97
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_SCROLLWIN_H_
|
||||
#define _WX_GTK_SCROLLWIN_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxScrolledWindow
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxScrollHelper : public wxScrollHelperBase
|
||||
{
|
||||
public:
|
||||
wxScrollHelper(wxWindow *win) : wxScrollHelperBase(win) { }
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
||||
int noUnitsX, int noUnitsY,
|
||||
int xPos = 0, int yPos = 0,
|
||||
bool noRefresh = false);
|
||||
virtual bool IsScrollbarShown(int orient) const;
|
||||
virtual void AdjustScrollbars();
|
||||
|
||||
protected:
|
||||
virtual void DoScroll(int x, int y);
|
||||
virtual void DoShowScrollbars(wxScrollbarVisibility horz,
|
||||
wxScrollbarVisibility vert);
|
||||
|
||||
// this does (each) half of AdjustScrollbars() work
|
||||
void DoAdjustScrollbar(GtkAdjustment *adj,
|
||||
int pixelsPerLine,
|
||||
int winSize,
|
||||
int virtSize,
|
||||
int *pos,
|
||||
int *lines,
|
||||
int *linesPerPage);
|
||||
|
||||
// and this does the same for Scroll()
|
||||
void DoScrollOneDir(int orient,
|
||||
GtkAdjustment *adj,
|
||||
int pos,
|
||||
int pixelsPerLine,
|
||||
int *posOld);
|
||||
|
||||
private:
|
||||
wxDECLARE_NO_COPY_CLASS(wxScrollHelper);
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_SCROLLWIN_H_
|
||||
|
||||
73
wxheaders/wx/gtk1/slider.h
Normal file
73
wxheaders/wx/gtk1/slider.h
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/slider.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKSLIDERH__
|
||||
#define __GTKSLIDERH__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSlider
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSlider : public wxSliderBase
|
||||
{
|
||||
public:
|
||||
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 = wxASCII_STR(wxSliderNameStr))
|
||||
{
|
||||
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 = wxASCII_STR(wxSliderNameStr));
|
||||
|
||||
// implement the base class pure virtuals
|
||||
virtual int GetValue() const;
|
||||
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;
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void GtkDisableEvents();
|
||||
void GtkEnableEvents();
|
||||
|
||||
GtkAdjustment *m_adjust;
|
||||
float m_oldPos;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxSlider);
|
||||
};
|
||||
|
||||
#endif // __GTKSLIDERH__
|
||||
64
wxheaders/wx/gtk1/spinbutt.h
Normal file
64
wxheaders/wx/gtk1/spinbutt.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/spinbutt.h
|
||||
// Purpose: wxSpinButton class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_SPINBUTT_H_
|
||||
#define _WX_GTK_SPINBUTT_H_
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxSpinButton
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE 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 = 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 = wxSPIN_BUTTON_NAME);
|
||||
|
||||
virtual int GetValue() const;
|
||||
virtual void SetValue( int value );
|
||||
virtual void SetRange( int minVal, int maxVal );
|
||||
virtual int GetMin() const;
|
||||
virtual int GetMax() const;
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
void OnSize( wxSizeEvent &event );
|
||||
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
|
||||
GtkAdjustment *m_adjust;
|
||||
float m_oldPos;
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
wxDECLARE_DYNAMIC_CLASS(wxSpinButton);
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_GTK_SPINBUTT_H_
|
||||
103
wxheaders/wx/gtk1/spinctrl.h
Normal file
103
wxheaders/wx/gtk1/spinctrl.h
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/spinctrl.h
|
||||
// Purpose: wxSpinCtrl class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKSPINCTRLH__
|
||||
#define __GTKSPINCTRLH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_SPINCTRL
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxSpinCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSpinCtrl : public wxControl
|
||||
{
|
||||
public:
|
||||
wxSpinCtrl() {}
|
||||
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 = wxT("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 = wxT("wxSpinCtrl"));
|
||||
|
||||
void SetValue(const wxString& text);
|
||||
void SetSelection(long from, long to);
|
||||
|
||||
virtual wxString GetTextValue() const;
|
||||
virtual int GetValue() const;
|
||||
virtual void SetValue( int value );
|
||||
virtual void SetRange( int minVal, int maxVal );
|
||||
virtual int GetMin() const;
|
||||
virtual int GetMax() const;
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
void OnChar( wxKeyEvent &event );
|
||||
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void GtkDisableEvents();
|
||||
void GtkEnableEvents();
|
||||
|
||||
void SetIncrement(int inc) { DoSetIncrement(inc); }
|
||||
int GetIncrement() const { return int(DoGetIncrement()); }
|
||||
|
||||
GtkAdjustment *m_adjust;
|
||||
float m_oldPos;
|
||||
|
||||
virtual int GetBase() const { return m_base; }
|
||||
virtual bool SetBase(int base);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
void DoSetIncrement(double inc);
|
||||
double DoGetIncrement() const;
|
||||
|
||||
// Widgets that use the style->base colour for the BG colour should
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const { return true; }
|
||||
|
||||
private:
|
||||
// Common part of all ctors.
|
||||
void Init()
|
||||
{
|
||||
m_base = 10;
|
||||
}
|
||||
|
||||
int m_base;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxSpinCtrl);
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
#endif
|
||||
// wxUSE_SPINCTRL
|
||||
|
||||
#endif
|
||||
// __GTKSPINCTRLH__
|
||||
48
wxheaders/wx/gtk1/statbmp.h
Normal file
48
wxheaders/wx/gtk1/statbmp.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/statbmp.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKSTATICBITMAPH__
|
||||
#define __GTKSTATICBITMAPH__
|
||||
|
||||
#include "wx/icon.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticBitmap
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase
|
||||
{
|
||||
public:
|
||||
wxStaticBitmap();
|
||||
wxStaticBitmap( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxBitmapBundle& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxASCII_STR(wxStaticBitmapNameStr) );
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxBitmapBundle& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxASCII_STR(wxStaticBitmapNameStr));
|
||||
|
||||
virtual void SetBitmap( const wxBitmapBundle& bitmap );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
private:
|
||||
wxBitmap m_bitmap;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxStaticBitmap);
|
||||
};
|
||||
|
||||
#endif // __GTKSTATICBITMAPH__
|
||||
51
wxheaders/wx/gtk1/statbox.h
Normal file
51
wxheaders/wx/gtk1/statbox.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/statbox.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKSTATICBOXH__
|
||||
#define __GTKSTATICBOXH__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticBox
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStaticBox : public wxStaticBoxBase
|
||||
{
|
||||
public:
|
||||
wxStaticBox();
|
||||
wxStaticBox( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = wxASCII_STR(wxStaticBoxNameStr) );
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = wxASCII_STR(wxStaticBoxNameStr) );
|
||||
|
||||
virtual void SetLabel( const wxString &label );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
|
||||
virtual bool IsTransparentForMouse() const { return TRUE; }
|
||||
|
||||
protected:
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxStaticBox);
|
||||
};
|
||||
|
||||
#endif // __GTKSTATICBOXH__
|
||||
48
wxheaders/wx/gtk1/statline.h
Normal file
48
wxheaders/wx/gtk1/statline.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/statline.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKSTATICLINEH__
|
||||
#define __GTKSTATICLINEH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_STATLINE
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStaticLine
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStaticLine : public wxStaticLineBase
|
||||
{
|
||||
public:
|
||||
wxStaticLine();
|
||||
wxStaticLine(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxASCII_STR(wxStaticLineNameStr));
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxASCII_STR(wxStaticLineNameStr));
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxStaticLine);
|
||||
};
|
||||
|
||||
#endif // wxUSE_STATLINE
|
||||
|
||||
#endif // __GTKSTATICLINEH__
|
||||
|
||||
57
wxheaders/wx/gtk1/stattext.h
Normal file
57
wxheaders/wx/gtk1/stattext.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/stattext.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKSTATICTEXTH__
|
||||
#define __GTKSTATICTEXTH__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticText
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStaticText : public wxStaticTextBase
|
||||
{
|
||||
public:
|
||||
wxStaticText();
|
||||
wxStaticText(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = wxASCII_STR(wxStaticTextNameStr) );
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &label,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = wxASCII_STR(wxStaticTextNameStr) );
|
||||
|
||||
virtual wxString GetLabel() const;
|
||||
virtual void SetLabel( const wxString &label );
|
||||
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
virtual bool SetForegroundColour( const wxColour& colour );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
protected:
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual wxString WXGetVisibleLabel() const wxOVERRIDE;
|
||||
virtual void WXSetVisibleLabel(const wxString& str) wxOVERRIDE;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxStaticText);
|
||||
};
|
||||
|
||||
#endif // __GTKSTATICTEXTH__
|
||||
195
wxheaders/wx/gtk1/textctrl.h
Normal file
195
wxheaders/wx/gtk1/textctrl.h
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/textctrl.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Created: 01/02/97
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKTEXTCTRLH__
|
||||
#define __GTKTEXTCTRLH__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTextCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTextCtrl: public wxTextCtrlBase
|
||||
{
|
||||
public:
|
||||
wxTextCtrl() { Init(); }
|
||||
wxTextCtrl(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &value = wxEmptyString,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString &name = wxASCII_STR(wxTextCtrlNameStr));
|
||||
|
||||
virtual ~wxTextCtrl();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &value = wxEmptyString,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString &name = wxASCII_STR(wxTextCtrlNameStr));
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
virtual int GetLineLength(long lineNo) const;
|
||||
virtual wxString GetLineText(long lineNo) const;
|
||||
virtual int GetNumberOfLines() const;
|
||||
|
||||
virtual bool IsModified() const;
|
||||
virtual bool IsEditable() const;
|
||||
|
||||
// If the return values from and to are the same, there is no selection.
|
||||
virtual void GetSelection(long* from, long* to) const;
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
|
||||
// editing
|
||||
virtual void Clear();
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
|
||||
// sets/clears the dirty flag
|
||||
virtual void MarkDirty();
|
||||
virtual void DiscardEdits();
|
||||
|
||||
virtual void SetMaxLength(unsigned long len);
|
||||
|
||||
// writing text inserts it at the current position, appending always
|
||||
// inserts it at the end
|
||||
virtual void WriteText(const wxString& text);
|
||||
virtual void AppendText(const wxString& text);
|
||||
|
||||
// apply text attribute to the range of text (only works with richedit
|
||||
// controls)
|
||||
virtual bool SetStyle(long start, long end, const wxTextAttr& style);
|
||||
|
||||
// translate between the position (which is just an index in the text ctrl
|
||||
// considering all its contents as a single strings) and (x, y) coordinates
|
||||
// which represent column and line.
|
||||
virtual long XYToPosition(long x, long y) const;
|
||||
virtual bool PositionToXY(long pos, long *x, long *y) const;
|
||||
|
||||
virtual void ShowPosition(long pos);
|
||||
|
||||
// Clipboard operations
|
||||
virtual void Copy();
|
||||
virtual void Cut();
|
||||
virtual void Paste();
|
||||
|
||||
// Undo/redo
|
||||
virtual void Undo();
|
||||
virtual void Redo();
|
||||
|
||||
virtual bool CanUndo() const;
|
||||
virtual bool CanRedo() const;
|
||||
|
||||
// Insertion point
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
||||
virtual void DoEnable( bool enable );
|
||||
|
||||
// Implementation from now on
|
||||
void OnDropFiles( wxDropFilesEvent &event );
|
||||
void OnChar( wxKeyEvent &event );
|
||||
|
||||
void OnCut(wxCommandEvent& event);
|
||||
void OnCopy(wxCommandEvent& event);
|
||||
void OnPaste(wxCommandEvent& event);
|
||||
void OnUndo(wxCommandEvent& event);
|
||||
void OnRedo(wxCommandEvent& event);
|
||||
|
||||
void OnUpdateCut(wxUpdateUIEvent& event);
|
||||
void OnUpdateCopy(wxUpdateUIEvent& event);
|
||||
void OnUpdatePaste(wxUpdateUIEvent& event);
|
||||
void OnUpdateUndo(wxUpdateUIEvent& event);
|
||||
void OnUpdateRedo(wxUpdateUIEvent& event);
|
||||
|
||||
bool SetFont(const wxFont& font);
|
||||
bool SetForegroundColour(const wxColour& colour);
|
||||
bool SetBackgroundColour(const wxColour& colour);
|
||||
|
||||
GtkWidget* GetConnectWidget();
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
void CalculateScrollbar();
|
||||
void OnInternalIdle();
|
||||
|
||||
void SetUpdateFont(bool update) { m_updateFont = update; }
|
||||
void UpdateFontIfNeeded();
|
||||
|
||||
void SetModified() { m_modified = true; }
|
||||
|
||||
// textctrl specific scrolling
|
||||
virtual bool ScrollLines(int lines);
|
||||
virtual bool ScrollPages(int pages);
|
||||
|
||||
// implementation only from now on
|
||||
|
||||
// tell the control to ignore next text changed signal
|
||||
void IgnoreNextTextUpdate();
|
||||
|
||||
// should we ignore the changed signal? always resets the flag
|
||||
bool IgnoreTextUpdate();
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// overridden wxWindow methods
|
||||
virtual void DoFreeze();
|
||||
virtual void DoThaw();
|
||||
|
||||
// get the vertical adjustment, if any, NULL otherwise
|
||||
GtkAdjustment *GetVAdj() const;
|
||||
|
||||
// scroll the control by the given number of pixels, return true if the
|
||||
// scroll position changed
|
||||
bool DoScroll(GtkAdjustment *adj, int diff);
|
||||
|
||||
// Widgets that use the style->base colour for the BG colour should
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const { return true; }
|
||||
|
||||
virtual void DoSetValue(const wxString &value, int flags = 0);
|
||||
virtual wxString DoGetValue() const;
|
||||
|
||||
private:
|
||||
// change the font for everything in this control
|
||||
void ChangeFontGlobally();
|
||||
|
||||
GtkWidget *m_text;
|
||||
GtkWidget *m_vScrollbar;
|
||||
|
||||
bool m_modified:1;
|
||||
bool m_vScrollbarVisible:1;
|
||||
bool m_updateFont:1;
|
||||
bool m_ignoreNextUpdate:1;
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
wxDECLARE_DYNAMIC_CLASS(wxTextCtrl);
|
||||
};
|
||||
|
||||
#endif // __GTKTEXTCTRLH__
|
||||
|
||||
136
wxheaders/wx/gtk1/tglbtn.h
Normal file
136
wxheaders/wx/gtk1/tglbtn.h
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/tglbtn.h
|
||||
// Purpose: Declaration of the wxToggleButton class, which implements a
|
||||
// toggle button under wxGTK.
|
||||
// Author: John Norris, minor changes by Axel Schlueter
|
||||
// Modified by:
|
||||
// Created: 08.02.01
|
||||
// Copyright: (c) 2000 Johnny C. Norris II
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_TOGGLEBUTTON_H_
|
||||
#define _WX_GTK_TOGGLEBUTTON_H_
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxToggleButton;
|
||||
class WXDLLIMPEXP_FWD_CORE wxToggleBitmapButton;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxToggleBitmapButton
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxToggleBitmapButton: public wxToggleButtonBase
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
wxToggleBitmapButton() {}
|
||||
wxToggleBitmapButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxCheckBoxNameStr))
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
// Create the control
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
|
||||
|
||||
// Get/set the value
|
||||
void SetValue(bool state);
|
||||
bool GetValue() const;
|
||||
|
||||
// Set the label
|
||||
virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); }
|
||||
virtual void SetLabel(const wxBitmap& label);
|
||||
bool Enable(bool enable = TRUE);
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
bool m_blockEvent;
|
||||
wxBitmap m_bitmap;
|
||||
|
||||
void OnSetBitmap();
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
bool IsOwnGtkWindow(GdkWindow *window);
|
||||
|
||||
virtual void OnInternalIdle();
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxToggleBitmapButton);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxToggleButton
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxToggleButton: public wxControl
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
wxToggleButton() {}
|
||||
wxToggleButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxCheckBoxNameStr))
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
// Create the control
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
|
||||
|
||||
// Get/set the value
|
||||
void SetValue(bool state);
|
||||
bool GetValue() const;
|
||||
|
||||
// Set the label
|
||||
void SetLabel(const wxString& label);
|
||||
bool Enable(bool enable = TRUE);
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
bool m_blockEvent;
|
||||
|
||||
void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
bool IsOwnGtkWindow(GdkWindow *window);
|
||||
|
||||
virtual void OnInternalIdle();
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxToggleButton);
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_TOGGLEBUTTON_H_
|
||||
|
||||
102
wxheaders/wx/gtk1/toolbar.h
Normal file
102
wxheaders/wx/gtk1/toolbar.h
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/toolbar.h
|
||||
// Purpose: GTK toolbar
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_TOOLBAR_H_
|
||||
#define _WX_GTK_TOOLBAR_H_
|
||||
|
||||
#if wxUSE_TOOLBAR
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxToolBar
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
wxToolBar() { Init(); }
|
||||
wxToolBar( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxASCII_STR(wxToolBarNameStr) )
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxASCII_STR(wxToolBarNameStr) );
|
||||
|
||||
virtual ~wxToolBar();
|
||||
|
||||
// override base class virtuals
|
||||
virtual void SetMargins(int x, int y);
|
||||
virtual void SetToolSeparation(int separation);
|
||||
|
||||
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
|
||||
|
||||
virtual void SetToolShortHelp(int id, const wxString& helpString);
|
||||
|
||||
virtual void SetWindowStyleFlag( long style );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
|
||||
GtkToolbar *m_toolbar;
|
||||
|
||||
bool m_blockEvent;
|
||||
|
||||
void OnInternalIdle();
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// choose the default border for this window
|
||||
virtual wxBorder GetDefaultBorder() const { return wxBORDER_DEFAULT; }
|
||||
|
||||
// set the GTK toolbar style and orientation
|
||||
void GtkSetStyle();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
|
||||
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
|
||||
|
||||
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
|
||||
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
|
||||
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
|
||||
|
||||
virtual wxToolBarToolBase *CreateTool(int id,
|
||||
const wxString& label,
|
||||
const wxBitmapBundle& bitmap1,
|
||||
const wxBitmapBundle& bitmap2,
|
||||
wxItemKind kind,
|
||||
wxObject *clientData,
|
||||
const wxString& shortHelpString,
|
||||
const wxString& longHelpString);
|
||||
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
||||
const wxString& label);
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxToolBar);
|
||||
};
|
||||
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
#endif
|
||||
// _WX_GTK_TOOLBAR_H_
|
||||
57
wxheaders/wx/gtk1/tooltip.h
Normal file
57
wxheaders/wx/gtk1/tooltip.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/tooltip.h
|
||||
// Purpose: wxToolTip class
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKTOOLTIPH__
|
||||
#define __GTKTOOLTIPH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/object.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// forward declarations
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxToolTip;
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxToolTip
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxToolTip : public wxObject
|
||||
{
|
||||
public:
|
||||
// globally change the tooltip parameters
|
||||
static void Enable( bool flag );
|
||||
static void SetDelay( long msecs );
|
||||
// set the delay after which the tooltip disappears or how long the tooltip remains visible
|
||||
static void SetAutoPop(long msecs);
|
||||
// set the delay between subsequent tooltips to appear
|
||||
static void SetReshow(long msecs);
|
||||
|
||||
wxToolTip( const wxString &tip );
|
||||
|
||||
// get/set the tooltip text
|
||||
void SetTip( const wxString &tip );
|
||||
wxString GetTip() const { return m_text; }
|
||||
|
||||
wxWindow *GetWindow() const { return m_window; }
|
||||
bool IsOk() const { return m_window != NULL; }
|
||||
|
||||
// implementation
|
||||
void Apply( wxWindow *win );
|
||||
|
||||
private:
|
||||
wxString m_text;
|
||||
wxWindow *m_window;
|
||||
|
||||
wxDECLARE_ABSTRACT_CLASS(wxToolTip);
|
||||
};
|
||||
|
||||
#endif // __GTKTOOLTIPH__
|
||||
129
wxheaders/wx/gtk1/toplevel.h
Normal file
129
wxheaders/wx/gtk1/toplevel.h
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/toplevel.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKTOPLEVELH__
|
||||
#define __GTKTOPLEVELH__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTopLevelWindowGTK
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTopLevelWindowGTK : public wxTopLevelWindowBase
|
||||
{
|
||||
public:
|
||||
// construction
|
||||
wxTopLevelWindowGTK() { Init(); }
|
||||
wxTopLevelWindowGTK(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr));
|
||||
|
||||
virtual ~wxTopLevelWindowGTK();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Maximize(bool maximize = true);
|
||||
virtual bool IsMaximized() const;
|
||||
virtual void Iconize(bool iconize = true);
|
||||
virtual bool IsIconized() const;
|
||||
virtual void SetIcons(const wxIconBundle& icons);
|
||||
virtual void Restore();
|
||||
|
||||
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
|
||||
virtual bool IsFullScreen() const { return m_fsIsShowing; }
|
||||
|
||||
virtual bool SetShape(const wxRegion& region);
|
||||
|
||||
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
||||
|
||||
virtual void SetWindowStyleFlag( long style );
|
||||
|
||||
virtual bool Show(bool show = true);
|
||||
|
||||
virtual void Raise();
|
||||
|
||||
virtual bool IsActive();
|
||||
|
||||
virtual void SetTitle( const wxString &title );
|
||||
virtual wxString GetTitle() const { return m_title; }
|
||||
|
||||
// Experimental, to allow help windows to be
|
||||
// viewable from within modal dialogs
|
||||
virtual void AddGrab();
|
||||
virtual void RemoveGrab();
|
||||
virtual bool IsGrabbed() const { return m_grabbed; }
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
|
||||
// move the window to the specified location and resize it: this is called
|
||||
// from both DoSetSize() and DoSetClientSize()
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
// GTK callbacks
|
||||
virtual void GtkOnSize( int x, int y, int width, int height );
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
// do *not* call this to iconize the frame, this is a private function!
|
||||
void SetIconizeState(bool iconic);
|
||||
|
||||
int m_miniEdge,
|
||||
m_miniTitle;
|
||||
GtkWidget *m_mainWidget;
|
||||
bool m_insertInClientArea; /* not from within OnCreateXXX */
|
||||
|
||||
bool m_fsIsShowing; /* full screen */
|
||||
long m_fsSaveGdkFunc, m_fsSaveGdkDecor;
|
||||
long m_fsSaveFlag;
|
||||
wxRect m_fsSaveFrame;
|
||||
|
||||
// m_windowStyle translated to GDK's terms
|
||||
long m_gdkFunc,
|
||||
m_gdkDecor;
|
||||
|
||||
// private gtk_timeout_add result for mimicking wxUSER_ATTENTION_INFO and
|
||||
// wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle.
|
||||
int m_urgency_hint;
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// override wxWindow methods to take into account tool/menu/statusbars
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
virtual void DoGetClientSize( int *width, int *height ) const;
|
||||
|
||||
wxString m_title;
|
||||
|
||||
// is the frame currently iconized?
|
||||
bool m_isIconized;
|
||||
// is the frame currently grabbed explicitly
|
||||
// by the application?
|
||||
bool m_grabbed;
|
||||
};
|
||||
|
||||
#endif // __GTKTOPLEVELH__
|
||||
364
wxheaders/wx/gtk1/treectrl.h
Normal file
364
wxheaders/wx/gtk1/treectrl.h
Normal file
|
|
@ -0,0 +1,364 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/treectrl.h
|
||||
// Purpose: wxTreeCtrl class
|
||||
// Author: Denis Pershin
|
||||
// Modified by:
|
||||
// Created: 08/08/98
|
||||
// Copyright: (c) Denis Pershin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TREECTRL_H_
|
||||
#define _WX_TREECTRL_H_
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/imaglist.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
// the type for "untyped" data
|
||||
typedef long wxDataType;
|
||||
|
||||
// fwd decl
|
||||
class WXDLLIMPEXP_CORE wxImageList;
|
||||
struct wxTreeViewItem;
|
||||
|
||||
// a callback function used for sorting tree items, it should return -1 if the
|
||||
// first item precedes the second, +1 if the second precedes the first or 0 if
|
||||
// they're equivalent
|
||||
class WXDLLIMPEXP_FWD_CORE wxTreeItemData;
|
||||
typedef int (*wxTreeItemCmpFunc)(wxTreeItemData *item1, wxTreeItemData *item2);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// values for the `flags' parameter of wxTreeCtrl::HitTest() which determine
|
||||
// where exactly the specified point is situated:
|
||||
// above the client area.
|
||||
static const int wxTREE_HITTEST_ABOVE = 0x0001;
|
||||
// below the client area.
|
||||
static const int wxTREE_HITTEST_BELOW = 0x0002;
|
||||
// in the client area but below the last item.
|
||||
static const int wxTREE_HITTEST_NOWHERE = 0x0004;
|
||||
// on the button associated with an item.
|
||||
static const int wxTREE_HITTEST_ONITEMBUTTON = 0x0010;
|
||||
// on the bitmap associated with an item.
|
||||
static const int wxTREE_HITTEST_ONITEMICON = 0x0020;
|
||||
// in the indentation associated with an item.
|
||||
static const int wxTREE_HITTEST_ONITEMINDENT = 0x0040;
|
||||
// on the label (string) associated with an item.
|
||||
static const int wxTREE_HITTEST_ONITEMLABEL = 0x0080;
|
||||
// in the area to the right of an item.
|
||||
static const int wxTREE_HITTEST_ONITEMRIGHT = 0x0100;
|
||||
// on the state icon for a tree view item that is in a user-defined state.
|
||||
static const int wxTREE_HITTEST_ONITEMSTATEICON = 0x0200;
|
||||
// to the right of the client area.
|
||||
static const int wxTREE_HITTEST_TOLEFT = 0x0400;
|
||||
// to the left of the client area.
|
||||
static const int wxTREE_HITTEST_TORIGHT = 0x0800;
|
||||
// anywhere on the item
|
||||
static const int wxTREE_HITTEST_ONITEM = wxTREE_HITTEST_ONITEMICON |
|
||||
wxTREE_HITTEST_ONITEMLABEL |
|
||||
wxTREE_HITTEST_ONITEMSTATEICON;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTreeItemId identifies an element of the tree. In this implementation, it's
|
||||
// just a trivial wrapper around GTK GtkTreeItem *. It's opaque for the
|
||||
// application.
|
||||
// ----------------------------------------------------------------------------
|
||||
class WXDLLIMPEXP_CORE wxTreeItemId {
|
||||
public:
|
||||
// ctors
|
||||
wxTreeItemId() { m_itemId = NULL; }
|
||||
|
||||
// default copy ctor/assignment operator are ok for us
|
||||
|
||||
// accessors
|
||||
// is this a valid tree item?
|
||||
bool IsOk() const { return m_itemId != NULL; }
|
||||
|
||||
// conversion to/from either real (system-dependent) tree item id or
|
||||
// to "long" which used to be the type for tree item ids in previous
|
||||
// versions of wxWidgets
|
||||
|
||||
// for wxTreeCtrl usage only
|
||||
wxTreeItemId(GtkTreeItem *itemId) { m_itemId = itemId; }
|
||||
operator GtkTreeItem *() const { return m_itemId; }
|
||||
void operator =(GtkTreeItem *item) { m_itemId = item; }
|
||||
|
||||
protected:
|
||||
GtkTreeItem *m_itemId;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTreeItemData is some (arbitrary) user class associated with some item. The
|
||||
// main advantage of having this class (compared to old untyped interface) is
|
||||
// that wxTreeItemData's are destroyed automatically by the tree and, as this
|
||||
// class has virtual dtor, it means that the memory will be automatically
|
||||
// freed. OTOH, we don't just use wxObject instead of wxTreeItemData because
|
||||
// the size of this class is critical: in any real application, each tree leaf
|
||||
// will have wxTreeItemData associated with it and number of leaves may be
|
||||
// quite big.
|
||||
//
|
||||
// Because the objects of this class are deleted by the tree, they should
|
||||
// always be allocated on the heap!
|
||||
// ----------------------------------------------------------------------------
|
||||
class WXDLLIMPEXP_CORE wxTreeItemData : private wxTreeItemId {
|
||||
public:
|
||||
// default ctor/copy ctor/assignment operator are ok
|
||||
|
||||
// dtor is virtual and all the items are deleted by the tree control when
|
||||
// it's deleted, so you normally don't have to care about freeing memory
|
||||
// allocated in your wxTreeItemData-derived class
|
||||
virtual ~wxTreeItemData() { }
|
||||
|
||||
// accessors: set/get the item associated with this node
|
||||
void SetId(const wxTreeItemId& id) { m_itemId = id; }
|
||||
const wxTreeItemId& GetId() const { return (wxTreeItemId&) m_itemId; }
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTreeCtrl: public wxControl {
|
||||
public:
|
||||
// creation
|
||||
// --------
|
||||
wxTreeCtrl() { Init(); }
|
||||
|
||||
wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR("wxTreeCtrl")) {
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
virtual ~wxTreeCtrl();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxASCII_STR("wxTreeCtrl"));
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
// get the total number of items in the control
|
||||
virtual unsigned int GetCount() const;
|
||||
|
||||
// indent is the number of pixels the children are indented relative to
|
||||
// the parents position. SetIndent() also redraws the control
|
||||
// immediately.
|
||||
unsigned int GetIndent() const;
|
||||
void SetIndent(unsigned int indent);
|
||||
|
||||
// image list: these functions allow to associate an image list with
|
||||
// the control and retrieve it. Note that the control does _not_ delete
|
||||
// the associated image list when it's deleted in order to allow image
|
||||
// lists to be shared between different controls.
|
||||
//
|
||||
// The normal image list is for the icons which correspond to the
|
||||
// normal tree item state (whether it is selected or not).
|
||||
// Additionally, the application might choose to show a state icon
|
||||
// which corresponds to an app-defined item state (for example,
|
||||
// checked/unchecked) which are taken from the state image list.
|
||||
wxImageList *GetImageList() const;
|
||||
wxImageList *GetStateImageList() const;
|
||||
|
||||
void SetImageList(wxImageList *imageList);
|
||||
void SetStateImageList(wxImageList *imageList);
|
||||
|
||||
// Functions to work with tree ctrl items. Unfortunately, they can _not_ be
|
||||
// member functions of wxTreeItem because they must know the tree the item
|
||||
// belongs to for Windows implementation and storing the pointer to
|
||||
// wxTreeCtrl in each wxTreeItem is just too much waste.
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
// retrieve items label
|
||||
wxString GetItemText(const wxTreeItemId& item) const;
|
||||
// get the normal item image
|
||||
int GetItemImage(const wxTreeItemId& item) const;
|
||||
// get the data associated with the item
|
||||
wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
|
||||
|
||||
// modifiers
|
||||
// ---------
|
||||
|
||||
// set items label
|
||||
void SetItemText(const wxTreeItemId& item, const wxString& text);
|
||||
// set the normal item image
|
||||
void SetItemImage(const wxTreeItemId& item, int image);
|
||||
// associate some data with the item
|
||||
void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
|
||||
|
||||
// item status inquiries
|
||||
// ---------------------
|
||||
|
||||
// is the item visible (it might be outside the view or not expanded)?
|
||||
bool IsVisible(const wxTreeItemId& item) const;
|
||||
// does the item has any children?
|
||||
bool ItemHasChildren(const wxTreeItemId& item) const;
|
||||
// is the item expanded (only makes sense if HasChildren())?
|
||||
bool IsExpanded(const wxTreeItemId& item) const;
|
||||
// is this item currently selected (the same as has focus)?
|
||||
bool IsSelected(const wxTreeItemId& item) const;
|
||||
|
||||
// number of children
|
||||
// ------------------
|
||||
|
||||
// if 'recursively' is false, only immediate children count, otherwise
|
||||
// the returned number is the number of all items in this branch
|
||||
size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = true);
|
||||
|
||||
// navigation
|
||||
// ----------
|
||||
|
||||
// wxTreeItemId.IsOk() will return false if there is no such item
|
||||
|
||||
// get the root tree item
|
||||
wxTreeItemId GetRootItem() const;
|
||||
|
||||
// get the item currently selected (may return NULL if no selection)
|
||||
wxTreeItemId GetSelection() const;
|
||||
|
||||
// get the parent of this item (may return NULL if root)
|
||||
wxTreeItemId GetItemParent(const wxTreeItemId& item) const;
|
||||
|
||||
// for this enumeration function you must pass in a "cookie" parameter
|
||||
// which is opaque for the application but is necessary for the library
|
||||
// to make these functions reentrant (i.e. allow more than one
|
||||
// enumeration on one and the same object simultaneously). Of course,
|
||||
// the "cookie" passed to GetFirstChild() and GetNextChild() should be
|
||||
// the same!
|
||||
|
||||
// get the last child of this item - this method doesn't use cookies
|
||||
wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
|
||||
|
||||
// get the next sibling of this item
|
||||
wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
|
||||
// get the previous sibling
|
||||
wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
|
||||
|
||||
// get first visible item
|
||||
wxTreeItemId GetFirstVisibleItem() const;
|
||||
// get the next visible item: item must be visible itself!
|
||||
// see IsVisible() and wxTreeCtrl::GetFirstVisibleItem()
|
||||
wxTreeItemId GetNextVisible(const wxTreeItemId& item) const;
|
||||
// get the previous visible item: item must be visible itself!
|
||||
wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const;
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
|
||||
// add the root node to the tree
|
||||
wxTreeItemId AddRoot(const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
|
||||
// insert a new item in as the first child of the parent
|
||||
wxTreeItemId PrependItem(const wxTreeItemId& parent,
|
||||
const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
|
||||
// insert a new item after a given one
|
||||
wxTreeItemId InsertItem(const wxTreeItemId& parent,
|
||||
const wxTreeItemId& idPrevious,
|
||||
const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
|
||||
// insert a new item in as the last child of the parent
|
||||
wxTreeItemId AppendItem(const wxTreeItemId& parent,
|
||||
const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
|
||||
// delete this item and associated data if any
|
||||
void Delete(const wxTreeItemId& item);
|
||||
// delete all items from the tree
|
||||
void DeleteAllItems();
|
||||
|
||||
// expand this item
|
||||
void Expand(const wxTreeItemId& item);
|
||||
// collapse the item without removing its children
|
||||
void Collapse(const wxTreeItemId& item);
|
||||
// collapse the item and remove all children
|
||||
void CollapseAndReset(const wxTreeItemId& item);
|
||||
// toggles the current state
|
||||
void Toggle(const wxTreeItemId& item);
|
||||
|
||||
// remove the selection from currently selected item (if any)
|
||||
void Unselect();
|
||||
// select this item
|
||||
void SelectItem(const wxTreeItemId& item);
|
||||
// make sure this item is visible (expanding the parent item and/or
|
||||
// scrolling to this item if necessary)
|
||||
void EnsureVisible(const wxTreeItemId& item);
|
||||
// scroll to this item (but don't expand its parent)
|
||||
void ScrollTo(const wxTreeItemId& item);
|
||||
|
||||
// start editing the item label: this (temporarily) replaces the item
|
||||
// with a one line edit control. The item will be selected if it hadn't
|
||||
// been before. textCtrlClass parameter allows you to create an edit
|
||||
// control of arbitrary user-defined class deriving from wxTextCtrl.
|
||||
wxTextCtrl* EditLabel(const wxTreeItemId& item,
|
||||
wxClassInfo* textCtrlClass = wxCLASSINFO(wxTextCtrl));
|
||||
// returns the same pointer as StartEdit() if the item is being edited,
|
||||
// NULL otherwise (it's assumed that no more than one item may be
|
||||
// edited simultaneously)
|
||||
wxTextCtrl* GetEditControl() const;
|
||||
// end editing and accept or discard the changes to item label
|
||||
void EndEditLabel(const wxTreeItemId& item, bool discardChanges = false);
|
||||
|
||||
// sort the children of this item using the specified callback function
|
||||
// (it should return -1, 0 or +1 as usual), if it's not specified
|
||||
// alphabetical comparison is performed.
|
||||
//
|
||||
// NB: this function is not reentrant!
|
||||
void SortChildren(const wxTreeItemId& item,
|
||||
wxTreeItemCmpFunc *cmpFunction = NULL);
|
||||
|
||||
// use Set/GetImageList and Set/GetStateImageList
|
||||
wxImageList *GetImageList(int) const
|
||||
{ return GetImageList(); }
|
||||
|
||||
void SendExpanding(const wxTreeItemId& item);
|
||||
void SendExpanded(const wxTreeItemId& item);
|
||||
void SendCollapsing(const wxTreeItemId& item);
|
||||
void SendCollapsed(const wxTreeItemId& item);
|
||||
void SendSelChanging(const wxTreeItemId& item);
|
||||
void SendSelChanged(const wxTreeItemId& item);
|
||||
|
||||
protected:
|
||||
|
||||
wxTreeItemId m_editItem;
|
||||
GtkTree *m_tree;
|
||||
GtkTreeItem *m_anchor;
|
||||
wxTextCtrl* m_textCtrl;
|
||||
wxImageList* m_imageListNormal;
|
||||
wxImageList* m_imageListState;
|
||||
|
||||
long m_curitemId;
|
||||
|
||||
void SendMessage(wxEventType command, const wxTreeItemId& item);
|
||||
// GtkTreeItem *findGtkTreeItem(wxTreeCtrlId &id) const;
|
||||
|
||||
// the common part of all ctors
|
||||
void Init();
|
||||
// insert a new item in as the last child of the parent
|
||||
wxTreeItemId p_InsertItem(GtkTreeItem *p,
|
||||
const wxString& text,
|
||||
int image, int selectedImage,
|
||||
wxTreeItemData *data);
|
||||
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxTreeCtrl);
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_TREECTRL_H_
|
||||
146
wxheaders/wx/gtk1/win_gtk.h
Normal file
146
wxheaders/wx/gtk1/win_gtk.h
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
/* ///////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/win_gtk.h
|
||||
// Purpose: wxWidgets's GTK base widget = GtkPizza
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////// */
|
||||
|
||||
|
||||
#ifndef __GTK_PIZZA_H__
|
||||
#define __GTK_PIZZA_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gtk/gtkcontainer.h>
|
||||
#include <gtk/gtkadjustment.h>
|
||||
#include <gtk/gtkfeatures.h>
|
||||
|
||||
#include "wx/dlimpexp.h"
|
||||
|
||||
#define GTK_PIZZA(obj) GTK_CHECK_CAST (obj, gtk_pizza_get_type (), GtkPizza)
|
||||
#define GTK_PIZZA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_pizza_get_type (), GtkPizzaClass)
|
||||
#define GTK_IS_PIZZA(obj) GTK_CHECK_TYPE (obj, gtk_pizza_get_type ())
|
||||
|
||||
/* Shadow types */
|
||||
typedef enum
|
||||
{
|
||||
GTK_MYSHADOW_NONE,
|
||||
GTK_MYSHADOW_THIN,
|
||||
GTK_MYSHADOW_IN,
|
||||
GTK_MYSHADOW_OUT
|
||||
} GtkMyShadowType;
|
||||
|
||||
typedef struct _GtkPizzaChild GtkPizzaChild;
|
||||
typedef struct _GtkPizza GtkPizza;
|
||||
typedef struct _GtkPizzaClass GtkPizzaClass;
|
||||
|
||||
struct _GtkPizzaChild
|
||||
{
|
||||
GtkWidget *widget;
|
||||
gint x;
|
||||
gint y;
|
||||
gint width;
|
||||
gint height;
|
||||
};
|
||||
|
||||
struct _GtkPizza
|
||||
{
|
||||
GtkContainer container;
|
||||
GList *children;
|
||||
GtkMyShadowType shadow_type;
|
||||
|
||||
guint width;
|
||||
guint height;
|
||||
|
||||
guint xoffset;
|
||||
guint yoffset;
|
||||
|
||||
GdkWindow *bin_window;
|
||||
|
||||
GdkVisibilityState visibility;
|
||||
gulong configure_serial;
|
||||
gint scroll_x;
|
||||
gint scroll_y;
|
||||
|
||||
gboolean clear_on_draw;
|
||||
gboolean use_filter;
|
||||
gboolean external_expose;
|
||||
};
|
||||
|
||||
struct _GtkPizzaClass
|
||||
{
|
||||
GtkContainerClass parent_class;
|
||||
|
||||
void (*set_scroll_adjustments) (GtkPizza *pizza,
|
||||
GtkAdjustment *hadjustment,
|
||||
GtkAdjustment *vadjustment);
|
||||
};
|
||||
|
||||
WXDLLIMPEXP_CORE
|
||||
GtkType gtk_pizza_get_type (void);
|
||||
WXDLLIMPEXP_CORE
|
||||
GtkWidget* gtk_pizza_new (void);
|
||||
|
||||
WXDLLIMPEXP_CORE
|
||||
void gtk_pizza_set_shadow_type (GtkPizza *pizza,
|
||||
GtkMyShadowType type);
|
||||
|
||||
WXDLLIMPEXP_CORE
|
||||
void gtk_pizza_set_clear (GtkPizza *pizza,
|
||||
gboolean clear);
|
||||
|
||||
WXDLLIMPEXP_CORE
|
||||
void gtk_pizza_set_filter (GtkPizza *pizza,
|
||||
gboolean use);
|
||||
|
||||
WXDLLIMPEXP_CORE
|
||||
void gtk_pizza_set_external (GtkPizza *pizza,
|
||||
gboolean expose);
|
||||
|
||||
WXDLLIMPEXP_CORE
|
||||
void gtk_pizza_scroll (GtkPizza *pizza,
|
||||
gint dx,
|
||||
gint dy);
|
||||
|
||||
WXDLLIMPEXP_CORE
|
||||
gint gtk_pizza_child_resized (GtkPizza *pizza,
|
||||
GtkWidget *widget);
|
||||
|
||||
WXDLLIMPEXP_CORE
|
||||
void gtk_pizza_put (GtkPizza *pizza,
|
||||
GtkWidget *widget,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
WXDLLIMPEXP_CORE
|
||||
void gtk_pizza_move (GtkPizza *pizza,
|
||||
GtkWidget *widget,
|
||||
gint x,
|
||||
gint y );
|
||||
|
||||
WXDLLIMPEXP_CORE
|
||||
void gtk_pizza_resize (GtkPizza *pizza,
|
||||
GtkWidget *widget,
|
||||
gint width,
|
||||
gint height );
|
||||
|
||||
WXDLLIMPEXP_CORE
|
||||
void gtk_pizza_set_size (GtkPizza *pizza,
|
||||
GtkWidget *widget,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#endif /* __GTK_PIZZA_H__ */
|
||||
273
wxheaders/wx/gtk1/window.h
Normal file
273
wxheaders/wx/gtk1/window.h
Normal file
|
|
@ -0,0 +1,273 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk1/window.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKWINDOWH__
|
||||
#define __GTKWINDOWH__
|
||||
|
||||
typedef struct _GtkTooltips GtkTooltips;
|
||||
#ifdef HAVE_XIM
|
||||
typedef struct _GdkIC GdkIC;
|
||||
typedef struct _GdkICAttr GdkICAttr;
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback definition for inserting a window (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindowGTK;
|
||||
typedef void (*wxInsertChildFunction)( wxWindowGTK*, wxWindowGTK* );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWindowGTK
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxWindowGTK : public wxWindowBase
|
||||
{
|
||||
public:
|
||||
// creating the window
|
||||
// -------------------
|
||||
wxWindowGTK();
|
||||
wxWindowGTK(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxASCII_STR(wxPanelNameStr));
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxASCII_STR(wxPanelNameStr));
|
||||
virtual ~wxWindowGTK();
|
||||
|
||||
// implement base class (pure) virtual methods
|
||||
// -------------------------------------------
|
||||
|
||||
virtual void SetLabel(const wxString& WXUNUSED(label)) { }
|
||||
virtual wxString GetLabel() const { return wxEmptyString; }
|
||||
|
||||
virtual bool Destroy();
|
||||
|
||||
virtual void Raise();
|
||||
virtual void Lower();
|
||||
|
||||
virtual bool Show( bool show = true );
|
||||
virtual void DoEnable( bool enable );
|
||||
|
||||
virtual void SetWindowStyleFlag( long style );
|
||||
|
||||
virtual bool IsRetained() const;
|
||||
|
||||
virtual void SetFocus();
|
||||
virtual bool AcceptsFocus() const;
|
||||
|
||||
virtual bool Reparent( wxWindowBase *newParent );
|
||||
|
||||
virtual void WarpPointer(int x, int y);
|
||||
|
||||
virtual void Refresh( bool eraseBackground = true,
|
||||
const wxRect *rect = (const wxRect *) NULL );
|
||||
virtual void Update();
|
||||
virtual void ClearBackground();
|
||||
|
||||
virtual bool SetBackgroundColour( const wxColour &colour );
|
||||
virtual bool SetForegroundColour( const wxColour &colour );
|
||||
virtual bool SetCursor( const wxCursor &cursor );
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
|
||||
virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
|
||||
|
||||
virtual int GetCharHeight() const;
|
||||
virtual int GetCharWidth() const;
|
||||
|
||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||
int range, bool refresh = true );
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
|
||||
virtual int GetScrollPos( int orient ) const;
|
||||
virtual int GetScrollThumb( int orient ) const;
|
||||
virtual int GetScrollRange( int orient ) const;
|
||||
virtual void ScrollWindow( int dx, int dy,
|
||||
const wxRect* rect = NULL );
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
virtual bool IsDoubleBuffered() const { return false; }
|
||||
|
||||
GdkWindow* GTKGetDrawingWindow() const;
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
virtual WXWidget GetHandle() const { return m_widget; }
|
||||
|
||||
// I don't want users to override what's done in idle so everything that
|
||||
// has to be done in idle time in order for wxGTK to work is done in
|
||||
// OnInternalIdle
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
// Internal representation of Update()
|
||||
void GtkUpdate();
|
||||
|
||||
// For compatibility across platforms (not in event table)
|
||||
void OnIdle(wxIdleEvent& WXUNUSED(event)) {}
|
||||
|
||||
// Used by all window classes in the widget creation process.
|
||||
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(wxWindowGTK *child);
|
||||
|
||||
// This methods sends wxPaintEvents to the window. It reads the
|
||||
// update region, breaks it up into rects and sends an event
|
||||
// for each rect. It is also responsible for background erase
|
||||
// events and NC paint events. It is called from "draw" and
|
||||
// "expose" handlers as well as from ::Update()
|
||||
void GtkSendPaintEvents();
|
||||
|
||||
// The methods below are required because many native widgets
|
||||
// are composed of several subwidgets and setting a style for
|
||||
// the widget means setting it for all subwidgets as well.
|
||||
// also, it is not clear which native widget is the top
|
||||
// widget where (most of) the input goes. even tooltips have
|
||||
// to be applied to all subwidgets.
|
||||
virtual GtkWidget* GetConnectWidget();
|
||||
virtual bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void ConnectWidget( GtkWidget *widget );
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
virtual void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
// Call after modifying the value of m_hAdjust or m_vAdjust to bring the
|
||||
// scrollbar in sync (this does not generate any wx events)
|
||||
void GtkUpdateScrollbar(int orient);
|
||||
|
||||
// Called from GTK signal handlers. it indicates that
|
||||
// the layout functions have to be called later on
|
||||
// (i.e. in idle time, implemented in OnInternalIdle() ).
|
||||
void GtkUpdateSize() { m_sizeSet = false; }
|
||||
|
||||
// fix up the mouse event coords, used by wxListBox only so far
|
||||
virtual void FixUpMouseEvent(GtkWidget * WXUNUSED(widget),
|
||||
wxCoord& WXUNUSED(x),
|
||||
wxCoord& WXUNUSED(y)) { }
|
||||
|
||||
// is this window transparent for the mouse events (as wxStaticBox is)?
|
||||
virtual bool IsTransparentForMouse() const { return false; }
|
||||
|
||||
// is this a radiobutton (used by radiobutton code itself only)?
|
||||
virtual bool IsRadioButton() const { return false; }
|
||||
|
||||
// position and size of the window
|
||||
int m_x, m_y;
|
||||
int m_width, m_height;
|
||||
int m_oldClientWidth,m_oldClientHeight;
|
||||
|
||||
// see the docs in src/gtk/window.cpp
|
||||
GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
|
||||
GtkWidget *m_wxwindow; // mostly the client area as per wxWidgets
|
||||
|
||||
// this widget will be queried for GTK's focus events
|
||||
GtkWidget *m_focusWidget;
|
||||
|
||||
#ifdef HAVE_XIM
|
||||
// XIM support for wxWidgets
|
||||
GdkIC *m_ic;
|
||||
GdkICAttr *m_icattr;
|
||||
#endif // HAVE_XIM
|
||||
|
||||
// The area to be cleared (and not just refreshed)
|
||||
// We cannot make this distinction under GTK 2.0.
|
||||
wxRegion m_clearRegion;
|
||||
|
||||
// scrolling stuff
|
||||
GtkAdjustment *m_hAdjust,*m_vAdjust;
|
||||
float m_oldHorizontalPos;
|
||||
float m_oldVerticalPos;
|
||||
|
||||
// extra (wxGTK-specific) flags
|
||||
bool m_needParent:1; // ! wxFrame, wxDialog, wxNotebookPage ?
|
||||
bool m_noExpose:1; // wxGLCanvas has its own redrawing
|
||||
bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size"
|
||||
bool m_hasScrolling:1;
|
||||
bool m_hasVMT:1;
|
||||
bool m_sizeSet:1;
|
||||
bool m_resizing:1;
|
||||
bool m_acceptsFocus:1; // true if not static
|
||||
bool m_hasFocus:1; // true if == FindFocus()
|
||||
bool m_isScrolling:1; // dragging scrollbar thumb?
|
||||
bool m_clipPaintRegion:1; // true after ScrollWindow()
|
||||
bool m_needsStyleChange:1; // May not be able to change
|
||||
// background style until OnIdle
|
||||
|
||||
// C++ has no virtual methods in the constructor of any class but we need
|
||||
// different methods of inserting a child window into a wxFrame,
|
||||
// wxMDIFrame, wxNotebook etc. this is the callback that will get used.
|
||||
wxInsertChildFunction m_insertCallback;
|
||||
|
||||
// implement the base class pure virtuals
|
||||
virtual void DoGetTextExtent(const wxString& string,
|
||||
int *x, int *y,
|
||||
int *descent = NULL,
|
||||
int *externalLeading = NULL,
|
||||
const wxFont *theFont = NULL) const;
|
||||
|
||||
#if wxUSE_MENUS_NATIVE
|
||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
virtual void DoClientToScreen( int *x, int *y ) const;
|
||||
virtual void DoScreenToClient( int *x, int *y ) const;
|
||||
virtual void DoGetPosition( int *x, int *y ) const;
|
||||
virtual void DoGetSize( int *width, int *height ) const;
|
||||
virtual void DoGetClientSize( int *width, int *height ) const;
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
virtual void DoCaptureMouse();
|
||||
virtual void DoReleaseMouse();
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
virtual void DoSetToolTip( wxToolTip *tip );
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
protected:
|
||||
// common part of all ctors (not virtual because called from ctor)
|
||||
void Init();
|
||||
|
||||
// Called by ApplyWidgetStyle (which is called by SetFont() and
|
||||
// SetXXXColour etc to apply style changed to native widgets) to create
|
||||
// modified GTK style with non-standard attributes. If forceStyle=true,
|
||||
// creates empty GtkRcStyle if there are no modifications, otherwise
|
||||
// returns NULL in such case.
|
||||
GtkRcStyle *CreateWidgetStyle(bool forceStyle = false);
|
||||
|
||||
// Overridden in many GTK widgets who have to handle subwidgets
|
||||
virtual void ApplyWidgetStyle(bool forceStyle = false);
|
||||
|
||||
// helper function to ease native widgets wrapping, called by
|
||||
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
|
||||
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxWindowGTK);
|
||||
wxDECLARE_NO_COPY_CLASS(wxWindowGTK);
|
||||
};
|
||||
|
||||
extern WXDLLIMPEXP_CORE wxWindow *wxFindFocusedChild(wxWindowGTK *win);
|
||||
|
||||
#endif // __GTKWINDOWH__
|
||||
Loading…
Add table
Add a link
Reference in a new issue