wxWindow split into wxWindowBase and wxWindow (wxGTK part)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-05-09 22:17:03 +00:00
parent 358d140ac9
commit f03fc89fff
101 changed files with 6352 additions and 7343 deletions
+3
View File
@@ -1,6 +1,9 @@
#ifndef _WX_CONTROL_H_BASE_
#define _WX_CONTROL_H_BASE_
// all classes derived from wxControl need the validators
#include "wx/validate.h"
#if defined(__WXMSW__)
#include "wx/msw/control.h"
#elif defined(__WXMOTIF__)
+5 -3
View File
@@ -1106,7 +1106,8 @@ typedef int (__stdcall *WXFARPROC)();
typedef int (*WXFARPROC)();
#endif
#endif
typedef WXHWND WXWidget;
#endif // MSW
#ifdef __WXMOTIF__
/* Stand-ins for X/Xt/Motif types */
@@ -1125,7 +1126,7 @@ typedef void* WXFont;
typedef void* WXImage;
typedef void* WXCursor;
typedef void* WXFontList;
#endif
#endif // Motif
#ifdef __WXGTK__
/* Stand-ins for GLIB types */
@@ -1160,7 +1161,8 @@ typedef struct _GtkAccelGroup GtkAccelGroup;
typedef struct _GtkItemFactory GtkItemFactory;
typedef struct _GtkSelectionData GtkSelectionData;
#endif
typedef GtkWidget *WXWidget;
#endif // GTK
// This is required because of clashing macros in windows.h, which may be
// included before or after wxWindows classes, and therefore must be
+353 -285
View File
File diff suppressed because it is too large Load Diff
+7 -9
View File
@@ -611,9 +611,9 @@ class WXDLLEXPORT wxListCtrl: public wxControl
// We have to hand down a few functions
void SetBackgroundColour( const wxColour &colour );
void SetForegroundColour( const wxColour &colour );
void SetFont( const wxFont &font );
bool SetBackgroundColour( const wxColour &colour );
bool SetForegroundColour( const wxColour &colour );
bool SetFont( const wxFont &font );
#if wxUSE_DRAG_AND_DROP
void SetDropTarget( wxDropTarget *dropTarget )
@@ -622,14 +622,12 @@ class WXDLLEXPORT wxListCtrl: public wxControl
{ return m_mainWin->GetDropTarget(); }
#endif
void SetCursor( const wxCursor &cursor )
{ if (m_mainWin) m_mainWin->wxWindow::SetCursor( cursor); }
bool SetCursor( const wxCursor &cursor )
{ return m_mainWin ? m_mainWin->wxWindow::SetCursor(cursor) : FALSE; }
wxColour GetBackgroundColour() const
{ if (m_mainWin) return m_mainWin->GetBackgroundColour();
else return wxColour(); }
{ return m_mainWin ? m_mainWin->GetBackgroundColour() : wxColour(); }
wxColour GetForegroundColour() const
{ if (m_mainWin) return m_mainWin->GetForegroundColour();
else return wxColour(); }
{ return m_mainWin ? m_mainWin->GetForegroundColour() : wxColour(); }
bool PopupMenu( wxMenu *menu, int x, int y )
{ return m_mainWin->PopupMenu( menu, x, y ); }
void SetFocus()
+1 -1
View File
@@ -120,7 +120,7 @@ public:
wxString GetTabText(int id) const;
// Layout tabs (optional, e.g. if resizing window)
void Layout(void);
void LayoutTabs();
// Draw all tabs
virtual void Draw(wxDC& dc);
+1 -1
View File
@@ -72,7 +72,7 @@ public:
void SetBitmapLabel( const wxBitmap& bitmap );
void SetBitmapSelected( const wxBitmap& bitmap );
virtual void Enable(const bool);
virtual bool Enable(const bool);
// implementation
+1 -1
View File
@@ -59,7 +59,7 @@ class wxButton: public wxControl
const wxString& name = wxButtonNameStr);
void SetDefault();
void SetLabel( const wxString &label );
void Enable( bool enable );
bool Enable( bool enable );
// implementation
+1 -1
View File
@@ -63,7 +63,7 @@ public:
bool GetValue() const;
void SetLabel( const wxString& label );
void Enable( bool enable );
bool Enable( bool enable );
// implementation
void ApplyWidgetStyle();
+5
View File
@@ -87,6 +87,9 @@ public:
virtual void Maximize() { }
virtual void Restore() { }
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
int GetReturnCode() const { return m_returnCode; }
// implementation
virtual void GtkOnSize( int x, int y, int width, int height );
@@ -105,6 +108,8 @@ protected:
int sizeFlags = wxSIZE_AUTO);
private:
int m_returnCode;
DECLARE_EVENT_TABLE()
};
+2 -2
View File
@@ -58,8 +58,8 @@ public:
wxFont( const wxFont& font );
~wxFont();
wxFont& operator = ( const wxFont& font );
bool operator == ( const wxFont& font );
bool operator != ( const wxFont& font );
bool operator == ( const wxFont& font ) const;
bool operator != ( const wxFont& font ) const;
bool Ok() const;
int GetPointSize() const;
+4 -4
View File
@@ -4,7 +4,7 @@
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@@ -50,7 +50,7 @@ class wxRadioBox: public wxControl
int n = 0, const wxString choices[] = (const wxString *) NULL,
int majorDim = 1, long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr )
const wxString& name = wxRadioBoxNameStr )
{
Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
}
@@ -60,7 +60,7 @@ class wxRadioBox: public wxControl
int n = 0, const wxString choices[] = (const wxString *) NULL,
int majorDim = 0, long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr );
const wxString& name = wxRadioBoxNameStr );
int FindString( const wxString& s) const;
void SetSelection( int n );
int GetSelection(void) const;
@@ -70,7 +70,7 @@ class wxRadioBox: public wxControl
void SetLabel( int item, wxBitmap *bitmap );
wxString GetLabel( int item ) const;
bool Show( bool show );
void Enable( bool enable );
bool Enable( bool enable );
void Enable( int item, bool enable );
void Show( int item, bool show );
virtual wxString GetStringSelection(void) const;
+1 -1
View File
@@ -60,7 +60,7 @@ class wxRadioButton: public wxControl
virtual void SetLabel(const wxString& label);
virtual void SetValue(bool val);
virtual bool GetValue(void) const;
void Enable( bool enable );
bool Enable( bool enable );
// implementation
+3 -3
View File
@@ -143,9 +143,9 @@ class wxTextCtrl: public wxControl
wxTextCtrl& operator<<(const char c);
#endif
void SetFont( const wxFont &font );
void SetForegroundColour(const wxColour &colour);
void SetBackgroundColour(const wxColour &colour);
bool SetFont( const wxFont &font );
bool SetForegroundColour(const wxColour &colour);
bool SetBackgroundColour(const wxColour &colour);
// implementation
+124 -437
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -72,7 +72,7 @@ public:
void SetBitmapLabel( const wxBitmap& bitmap );
void SetBitmapSelected( const wxBitmap& bitmap );
virtual void Enable(const bool);
virtual bool Enable(const bool);
// implementation
+1 -1
View File
@@ -59,7 +59,7 @@ class wxButton: public wxControl
const wxString& name = wxButtonNameStr);
void SetDefault();
void SetLabel( const wxString &label );
void Enable( bool enable );
bool Enable( bool enable );
// implementation
+1 -1
View File
@@ -63,7 +63,7 @@ public:
bool GetValue() const;
void SetLabel( const wxString& label );
void Enable( bool enable );
bool Enable( bool enable );
// implementation
void ApplyWidgetStyle();
+5
View File
@@ -87,6 +87,9 @@ public:
virtual void Maximize() { }
virtual void Restore() { }
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
int GetReturnCode() const { return m_returnCode; }
// implementation
virtual void GtkOnSize( int x, int y, int width, int height );
@@ -105,6 +108,8 @@ protected:
int sizeFlags = wxSIZE_AUTO);
private:
int m_returnCode;
DECLARE_EVENT_TABLE()
};
+2 -2
View File
@@ -58,8 +58,8 @@ public:
wxFont( const wxFont& font );
~wxFont();
wxFont& operator = ( const wxFont& font );
bool operator == ( const wxFont& font );
bool operator != ( const wxFont& font );
bool operator == ( const wxFont& font ) const;
bool operator != ( const wxFont& font ) const;
bool Ok() const;
int GetPointSize() const;
+4 -4
View File
@@ -4,7 +4,7 @@
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@@ -50,7 +50,7 @@ class wxRadioBox: public wxControl
int n = 0, const wxString choices[] = (const wxString *) NULL,
int majorDim = 1, long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr )
const wxString& name = wxRadioBoxNameStr )
{
Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
}
@@ -60,7 +60,7 @@ class wxRadioBox: public wxControl
int n = 0, const wxString choices[] = (const wxString *) NULL,
int majorDim = 0, long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr );
const wxString& name = wxRadioBoxNameStr );
int FindString( const wxString& s) const;
void SetSelection( int n );
int GetSelection(void) const;
@@ -70,7 +70,7 @@ class wxRadioBox: public wxControl
void SetLabel( int item, wxBitmap *bitmap );
wxString GetLabel( int item ) const;
bool Show( bool show );
void Enable( bool enable );
bool Enable( bool enable );
void Enable( int item, bool enable );
void Show( int item, bool show );
virtual wxString GetStringSelection(void) const;
+1 -1
View File
@@ -60,7 +60,7 @@ class wxRadioButton: public wxControl
virtual void SetLabel(const wxString& label);
virtual void SetValue(bool val);
virtual bool GetValue(void) const;
void Enable( bool enable );
bool Enable( bool enable );
// implementation
+3 -3
View File
@@ -143,9 +143,9 @@ class wxTextCtrl: public wxControl
wxTextCtrl& operator<<(const char c);
#endif
void SetFont( const wxFont &font );
void SetForegroundColour(const wxColour &colour);
void SetBackgroundColour(const wxColour &colour);
bool SetFont( const wxFont &font );
bool SetForegroundColour(const wxColour &colour);
bool SetBackgroundColour(const wxColour &colour);
// implementation
+124 -437
View File
File diff suppressed because it is too large Load Diff
+188 -147
View File
@@ -12,150 +12,192 @@
#ifndef _WX_LAYOUTH__
#define _WX_LAYOUTH__
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __GNUG__
#pragma interface "layout.h"
#pragma interface "layout.h"
#endif
#include "wx/defs.h"
class WXDLLEXPORT wxWindow;
// X stupidly defines these in X.h
#ifdef Above
#undef Above
#undef Above
#endif
#ifdef Below
#undef Below
#undef Below
#endif
// ----------------------------------------------------------------------------
// forward declrations
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxWindowBase;
class WXDLLEXPORT wxLayoutConstraints;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
#define wxLAYOUT_DEFAULT_MARGIN 0
enum wxEdge { wxLeft, wxTop, wxRight, wxBottom, wxWidth, wxHeight,
wxCentre, wxCenter = wxCentre, wxCentreX, wxCentreY };
enum wxRelationship { wxUnconstrained = 0,
wxAsIs,
wxPercentOf,
wxAbove,
wxBelow,
wxLeftOf,
wxRightOf,
wxSameAs,
wxAbsolute };
class WXDLLEXPORT wxLayoutConstraints;
class WXDLLEXPORT wxIndividualLayoutConstraint: public wxObject
enum wxEdge
{
DECLARE_DYNAMIC_CLASS(wxIndividualLayoutConstraint)
protected:
// To be allowed to modify the internal variables
friend class wxIndividualLayoutConstraint_Serialize;
// 'This' window is the parent or sibling of otherWin
wxWindow *otherWin;
wxEdge myEdge;
wxRelationship relationship;
int margin;
int value;
int percent;
wxEdge otherEdge;
bool done;
public:
wxIndividualLayoutConstraint();
~wxIndividualLayoutConstraint();
void Set(wxRelationship rel, wxWindow *otherW, wxEdge otherE, int val = 0, int marg = wxLAYOUT_DEFAULT_MARGIN);
//
// Sibling relationships
//
void LeftOf(wxWindow *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void RightOf(wxWindow *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void Above(wxWindow *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void Below(wxWindow *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
//
// 'Same edge' alignment
//
void SameAs(wxWindow *otherW, wxEdge edge, int marg = wxLAYOUT_DEFAULT_MARGIN);
// The edge is a percentage of the other window's edge
void PercentOf(wxWindow *otherW, wxEdge wh, int per);
//
// Edge has absolute value
//
void Absolute(int val);
//
// Dimension is unconstrained
//
inline void Unconstrained() { relationship = wxUnconstrained; }
//
// Dimension is 'as is' (use current size settings)
//
inline void AsIs() { relationship = wxAsIs; }
//
// Accessors
//
inline wxWindow *GetOtherWindow() { return otherWin; }
inline wxEdge GetMyEdge() const { return myEdge; }
inline void SetEdge(wxEdge which) { myEdge = which; }
inline void SetValue(int v) { value = v; }
inline int GetMargin() { return margin; }
inline void SetMargin(int m) { margin = m; }
inline int GetValue() const { return value; }
inline int GetPercent() const { return percent; }
inline int GetOtherEdge() const { return otherEdge; }
inline bool GetDone() const { return done; }
inline void SetDone(bool d) { done = d; }
inline wxRelationship GetRelationship() { return relationship; }
inline void SetRelationship(wxRelationship r) { relationship = r; }
// Reset constraint if it mentions otherWin
bool ResetIfWin(wxWindow *otherW);
// Try to satisfy constraint
bool SatisfyConstraint(wxLayoutConstraints *constraints, wxWindow *win);
// Get the value of this edge or dimension, or if this
// is not determinable, -1.
int GetEdge(wxEdge which, wxWindow *thisWin, wxWindow *other) const;
wxLeft, wxTop, wxRight, wxBottom, wxWidth, wxHeight,
wxCentre, wxCenter = wxCentre, wxCentreX, wxCentreY
};
class WXDLLEXPORT wxLayoutConstraints: public wxObject
enum wxRelationship
{
DECLARE_DYNAMIC_CLASS(wxLayoutConstraints)
public:
// Edge constraints
wxIndividualLayoutConstraint left;
wxIndividualLayoutConstraint top;
wxIndividualLayoutConstraint right;
wxIndividualLayoutConstraint bottom;
// Size constraints
wxIndividualLayoutConstraint width;
wxIndividualLayoutConstraint height;
// Centre constraints
wxIndividualLayoutConstraint centreX;
wxIndividualLayoutConstraint centreY;
wxLayoutConstraints();
~wxLayoutConstraints();
bool SatisfyConstraints(wxWindow *win, int *noChanges);
bool AreSatisfied() const
{
return left.GetDone() && top.GetDone() && right.GetDone() &&
bottom.GetDone() && centreX.GetDone() && centreY.GetDone();
}
wxUnconstrained = 0,
wxAsIs,
wxPercentOf,
wxAbove,
wxBelow,
wxLeftOf,
wxRightOf,
wxSameAs,
wxAbsolute
};
bool WXDLLEXPORT wxOldDoLayout(wxWindow *win);
enum wxSizerBehaviour
{
wxSizerShrink,
wxSizerExpand,
wxSizerNone
};
#define wxTYPE_SIZER 90
// =============================================================================
// classes
// =============================================================================
// ----------------------------------------------------------------------------
// wxIndividualLayoutConstraint: a constraint on window position
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxIndividualLayoutConstraint : public wxObject
{
DECLARE_DYNAMIC_CLASS(wxIndividualLayoutConstraint)
protected:
// To be allowed to modify the internal variables
friend class wxIndividualLayoutConstraint_Serialize;
// 'This' window is the parent or sibling of otherWin
wxWindowBase *otherWin;
wxEdge myEdge;
wxRelationship relationship;
int margin;
int value;
int percent;
wxEdge otherEdge;
bool done;
public:
wxIndividualLayoutConstraint();
~wxIndividualLayoutConstraint();
void Set(wxRelationship rel, wxWindowBase *otherW, wxEdge otherE, int val = 0, int marg = wxLAYOUT_DEFAULT_MARGIN);
//
// Sibling relationships
//
void LeftOf(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void RightOf(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void Above(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void Below(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
//
// 'Same edge' alignment
//
void SameAs(wxWindowBase *otherW, wxEdge edge, int marg = wxLAYOUT_DEFAULT_MARGIN);
// The edge is a percentage of the other window's edge
void PercentOf(wxWindowBase *otherW, wxEdge wh, int per);
//
// Edge has absolute value
//
void Absolute(int val);
//
// Dimension is unconstrained
//
void Unconstrained() { relationship = wxUnconstrained; }
//
// Dimension is 'as is' (use current size settings)
//
void AsIs() { relationship = wxAsIs; }
//
// Accessors
//
wxWindowBase *GetOtherWindow() { return otherWin; }
wxEdge GetMyEdge() const { return myEdge; }
void SetEdge(wxEdge which) { myEdge = which; }
void SetValue(int v) { value = v; }
int GetMargin() { return margin; }
void SetMargin(int m) { margin = m; }
int GetValue() const { return value; }
int GetPercent() const { return percent; }
int GetOtherEdge() const { return otherEdge; }
bool GetDone() const { return done; }
void SetDone(bool d) { done = d; }
wxRelationship GetRelationship() { return relationship; }
void SetRelationship(wxRelationship r) { relationship = r; }
// Reset constraint if it mentions otherWin
bool ResetIfWin(wxWindowBase *otherW);
// Try to satisfy constraint
bool SatisfyConstraint(wxLayoutConstraints *constraints, wxWindowBase *win);
// Get the value of this edge or dimension, or if this
// is not determinable, -1.
int GetEdge(wxEdge which, wxWindowBase *thisWin, wxWindowBase *other) const;
};
// ----------------------------------------------------------------------------
// wxLayoutConstraints: the complete set of constraints for a window
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxLayoutConstraints : public wxObject
{
DECLARE_DYNAMIC_CLASS(wxLayoutConstraints)
public:
// Edge constraints
wxIndividualLayoutConstraint left;
wxIndividualLayoutConstraint top;
wxIndividualLayoutConstraint right;
wxIndividualLayoutConstraint bottom;
// Size constraints
wxIndividualLayoutConstraint width;
wxIndividualLayoutConstraint height;
// Centre constraints
wxIndividualLayoutConstraint centreX;
wxIndividualLayoutConstraint centreY;
wxLayoutConstraints();
~wxLayoutConstraints();
bool SatisfyConstraints(wxWindowBase *win, int *noChanges);
bool AreSatisfied() const
{
return left.GetDone() && top.GetDone() && right.GetDone() &&
bottom.GetDone() && centreX.GetDone() && centreY.GetDone();
}
};
// ----------------------------------------------------------------------------
// sizers
// ----------------------------------------------------------------------------
/*
@@ -203,18 +245,9 @@ to the top of the hierarchy and call Layout() again.
*/
enum wxSizerBehaviour
{
wxSizerShrink,
wxSizerExpand,
wxSizerNone
};
#define wxTYPE_SIZER 90
class WXDLLEXPORT wxSizer : public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxSizer)
DECLARE_DYNAMIC_CLASS(wxSizer)
protected:
wxSizerBehaviour sizerBehaviour;
@@ -227,10 +260,10 @@ protected:
public:
wxSizer();
wxSizer(wxWindow *parent, wxSizerBehaviour behav = wxSizerNone);
wxSizer(wxWindowBase *parent, wxSizerBehaviour behav = wxSizerNone);
~wxSizer();
bool Create(wxWindow *parent, wxSizerBehaviour behav = wxSizerNone);
bool Create(wxWindowBase *parent, wxSizerBehaviour behav = wxSizerNone);
virtual void GetSize(int *w, int *h) const;
@@ -245,8 +278,8 @@ public:
int GetBorderX() { return borderX ; }
int GetBorderY() { return borderY ; }
virtual void AddSizerChild(wxWindow *child);
virtual void RemoveSizerChild(wxWindow *child);
virtual void AddSizerChild(wxWindowBase *child);
virtual void RemoveSizerChild(wxWindowBase *child);
virtual void SetBehaviour(wxSizerBehaviour b) { sizerBehaviour = b; }
virtual wxSizerBehaviour GetBehaviour() { return sizerBehaviour; }
@@ -265,7 +298,7 @@ protected:
class WXDLLEXPORT wxRowColSizer : public wxSizer
{
DECLARE_DYNAMIC_CLASS(wxRowColSizer)
DECLARE_DYNAMIC_CLASS(wxRowColSizer)
protected:
bool rowOrCol;
@@ -276,11 +309,11 @@ protected:
public:
// rowOrCol = TRUE to be laid out in rows, otherwise in columns.
wxRowColSizer();
wxRowColSizer(wxWindow *parent, bool rowOrCol = wxSIZER_ROWS,
wxRowColSizer(wxWindowBase *parent, bool rowOrCol = wxSIZER_ROWS,
int rowsOrColSize = 20, wxSizerBehaviour = wxSizerShrink);
~wxRowColSizer();
bool Create(wxWindow *parent, bool rowOrCol = wxSIZER_ROWS,
bool Create(wxWindowBase *parent, bool rowOrCol = wxSIZER_ROWS,
int rowsOrColSize = 20, wxSizerBehaviour = wxSizerShrink);
virtual void SetRowOrCol(bool rc) { rowOrCol = rc; }
@@ -296,17 +329,25 @@ public:
class WXDLLEXPORT wxSpacingSizer : public wxSizer
{
DECLARE_DYNAMIC_CLASS(wxSpacingSizer)
DECLARE_DYNAMIC_CLASS(wxSpacingSizer)
public:
wxSpacingSizer();
wxSpacingSizer(wxWindow *parent, wxRelationship rel, wxWindow *other, int spacing);
wxSpacingSizer(wxWindow *parent);
wxSpacingSizer(wxWindowBase *parent, wxRelationship rel, wxWindowBase *other, int spacing);
wxSpacingSizer(wxWindowBase *parent);
~wxSpacingSizer();
bool Create(wxWindow *parent, wxRelationship rel, wxWindow *other, int sp);
bool Create(wxWindow *parent);
bool Create(wxWindowBase *parent, wxRelationship rel, wxWindowBase *other, int sp);
bool Create(wxWindowBase *parent);
};
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------
#if WXWIN_COMPATIBILITY
extern bool WXDLLEXPORT wxOldDoLayout(wxWindowBase *win);
#endif // WXWIN_COMPATIBILITY
#endif
// _WX_LAYOUTH__
+20 -12
View File
@@ -142,7 +142,7 @@ public:
virtual ~wxNodeBase();
// @@ no check is done that the list is really keyed on strings
// FIXME no check is done that the list is really keyed on strings
const wxChar *GetKeyString() const { return m_key.string; }
long GetKeyInteger() const { return m_key.integer; }
@@ -339,8 +339,16 @@ private:
// 2. We redefine all non-type-safe wxList functions with type-safe versions
// which don't take any space (everything is inline), but bring compile
// time error checking.
//
// 3. The macro which is usually used (WX_DECLARE_LIST) is defined in terms of
// a more generic WX_DECLARE_LIST_2 macro which, in turn, uses the most
// generic WX_DECLARE_LIST_3 one. The last macro adds a sometimes
// interesting capability to store polymorphic objects in the list and is
// particularly useful with, for example, "wxWindow *" list where the
// wxWindowBase pointers are put into the list, but wxWindow pointers are
// retrieved from it.
#define WX_DECLARE_LIST_2(T, name, nodetype) \
#define WX_DECLARE_LIST_3(T, Tbase, name, nodetype) \
typedef int (*wxSortFuncFor_##name)(const T *, const T *); \
\
class WXDLLEXPORT nodetype : public wxNodeBase \
@@ -390,11 +398,11 @@ private:
return node ? (T*)(node->GetData()) : (T*)NULL; \
} \
\
nodetype *Append(T *object) \
nodetype *Append(Tbase *object) \
{ return (nodetype *)wxListBase::Append(object); } \
nodetype *Insert(T *object) \
nodetype *Insert(Tbase *object) \
{ return (nodetype *)Insert((nodetype*)NULL, object); } \
nodetype *Insert(nodetype *prev, T *object) \
nodetype *Insert(nodetype *prev, Tbase *object) \
{ return (nodetype *)wxListBase::Insert(prev, object); } \
\
nodetype *Append(long key, void *object) \
@@ -406,16 +414,16 @@ private:
{ return (nodetype *)wxListBase::DetachNode(node); } \
bool DeleteNode(nodetype *node) \
{ return wxListBase::DeleteNode(node); } \
bool DeleteObject(T *object) \
bool DeleteObject(Tbase *object) \
{ return wxListBase::DeleteObject(object); } \
\
nodetype *Find(T *object) const \
nodetype *Find(Tbase *object) const \
{ return (nodetype *)wxListBase::Find(object); } \
\
virtual nodetype *Find(const wxListKey& key) const \
{ return (nodetype *)wxListBase::Find(key); } \
\
int IndexOf( T *object ) const \
int IndexOf(Tbase *object) const \
{ return wxListBase::IndexOf(object); } \
\
void Sort(wxSortFuncFor_##name func) \
@@ -432,6 +440,9 @@ private:
} \
}
#define WX_DECLARE_LIST_2(elementtype, listname, nodename) \
WX_DECLARE_LIST_3(elementtype, elementtype, listname, nodename)
#define WX_DECLARE_LIST(elementtype, listname) \
typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \
WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node)
@@ -445,12 +456,9 @@ private:
// =============================================================================
// ----------------------------------------------------------------------------
// commonly used string classes
// commonly used list classes
// ----------------------------------------------------------------------------
class wxWindow;
WX_DECLARE_LIST(wxWindow, wxWindowList);
#ifdef wxLIST_COMPATIBILITY
// -----------------------------------------------------------------------------
+1 -1
View File
@@ -158,7 +158,7 @@ class WXDLLEXPORT wxToolBarBase : public wxControl
#endif
// Lay the tools out
virtual void Layout(void);
virtual void LayoutTools();
// Add all the buttons: required for Win95.
virtual bool CreateTools(void) { return TRUE; }
+2 -2
View File
@@ -62,10 +62,10 @@ class WXDLLEXPORT wxToolBarSimple : public wxToolBarBase
virtual void SpringUpButton(int index);
void Layout(void);
virtual void LayoutTools();
// The post-tool-addition call
bool Realize() { Layout(); return TRUE; };
virtual bool Realize() { LayoutTools(); return TRUE; };
protected:
int m_currentRowsOrColumns;
+6 -6
View File
@@ -18,7 +18,7 @@
#include "wx/event.h"
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxWindowBase;
/*
A validator has up to three purposes:
@@ -36,7 +36,7 @@ class WXDLLEXPORT wxValidator : public wxEvtHandler
{
public:
wxValidator();
~wxValidator();
virtual ~wxValidator();
// Make a clone of this validator (or return NULL) - currently necessary
// if you're passing a reference to a validator.
@@ -49,7 +49,7 @@ public:
// Called when the value in the window must be validated.
// This function can pop up an error message.
virtual bool Validate(wxWindow *WXUNUSED(parent)) { return FALSE; };
virtual bool Validate(wxWindowBase *WXUNUSED(parent)) { return FALSE; };
// Called to transfer data to the window
virtual bool TransferToWindow() { return FALSE; }
@@ -58,8 +58,8 @@ public:
virtual bool TransferFromWindow() { return FALSE; };
// accessors
wxWindow *GetWindow() const { return m_validatorWindow; }
void SetWindow(wxWindow *win) { m_validatorWindow = win; }
wxWindowBase *GetWindow() const { return m_validatorWindow; }
void SetWindow(wxWindowBase *win) { m_validatorWindow = win; }
// validators beep by default if invalid key is pressed, these functions
// allow to change it
@@ -67,7 +67,7 @@ public:
static void SetBellOnError(bool doIt = TRUE) { ms_isSilent = doIt; }
protected:
wxWindow *m_validatorWindow;
wxWindowBase *m_validatorWindow;
private:
static bool ms_isSilent;
+746 -7
View File
File diff suppressed because it is too large Load Diff
+1378 -1338
View File
File diff suppressed because it is too large Load Diff
-7
View File
@@ -37,13 +37,6 @@
#include "wx/utils.h" // for copystring() (beurk...)
#endif
// -----------------------------------------------------------------------------
// implementation of standard lists
// -----------------------------------------------------------------------------
#include "wx/listimpl.cpp"
WX_DEFINE_LIST(wxWindowList);
// =============================================================================
// implementation
// =============================================================================
+3 -3
View File
@@ -2846,7 +2846,7 @@ bool wxResourceParseString(char *s, wxResourceTable *table)
* resource loading facility
*/
bool wxWindow::LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table)
bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table)
{
if (!table)
table = wxDefaultResourceTable;
@@ -2885,7 +2885,7 @@ bool wxWindow::LoadFromResource(wxWindow *parent, const wxString& resourceName,
}
else
{
if (!this->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name))
if (!((wxWindow *)this)->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name))
return FALSE;
}
@@ -2932,7 +2932,7 @@ bool wxWindow::LoadFromResource(wxWindow *parent, const wxString& resourceName,
return TRUE;
}
wxControl *wxWindow::CreateItem(const wxItemResource *resource, const wxItemResource* parentResource, const wxResourceTable *table)
wxControl *wxWindowBase::CreateItem(const wxItemResource *resource, const wxItemResource* parentResource, const wxResourceTable *table)
{
if (!table)
table = wxDefaultResourceTable;
+1 -1
View File
@@ -398,7 +398,7 @@ void wxToolBarBase::Command(wxCommandEvent& WXUNUSED(event))
{
}
void wxToolBarBase::Layout()
void wxToolBarBase::LayoutTools()
{
}
+1 -1
View File
@@ -364,7 +364,7 @@ void wxToolBarSimple::SpringUpButton(int index)
}
}
void wxToolBarSimple::Layout(void)
void wxToolBarSimple::LayoutTools(void)
{
m_currentRowsOrColumns = 0;
m_lastX = m_xMargin;
+1 -1
View File
@@ -459,7 +459,7 @@ wxFindWindowByLabel1 (const wxString& title, wxWindow * parent)
if (parent)
{
for ( wxNode * node = parent->GetChildren().GetFirst();
for ( wxWindowList::Node * node = parent->GetChildren().GetFirst();
node;
node = node->GetNext() )
{
+1 -1
View File
@@ -129,7 +129,7 @@ bool wxTextValidator::Validate(wxWindow *parent)
wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;
// If window is disabled, simply return
if ( !control->Enabled() )
if ( !control->IsEnabled() )
return TRUE;
wxString val(control->GetValue());
+1134 -40
View File
File diff suppressed because it is too large Load Diff
+20 -11
View File
@@ -2330,7 +2330,7 @@ bool wxListCtrl::Create( wxWindow *parent, wxWindowID id,
m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, s );
if (GetWindowStyleFlag() & wxLC_REPORT)
if (HasFlag(wxLC_REPORT))
m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(size.x,23), wxTAB_TRAVERSAL );
else
m_headerWin = (wxListHeaderWindow *) NULL;
@@ -2349,7 +2349,7 @@ void wxListCtrl::OnSize( wxSizeEvent &WXUNUSED(event) )
void wxListCtrl::SetSingleStyle( long style, bool add )
{
long flag = GetWindowStyleFlag();
long flag = GetWindowStyle();
if (add)
{
@@ -2382,7 +2382,7 @@ void wxListCtrl::SetWindowStyleFlag( long flag )
if (flag & wxLC_REPORT)
{
if (!(GetWindowStyleFlag() & wxLC_REPORT))
if (!HasFlag(wxLC_REPORT))
{
// m_mainWin->SetSize( 0, 24, width, height-24 );
if (!m_headerWin)
@@ -2398,7 +2398,7 @@ void wxListCtrl::SetWindowStyleFlag( long flag )
}
else
{
if (GetWindowStyleFlag() & wxLC_REPORT)
if (HasFlag(wxLC_REPORT))
{
// m_mainWin->SetSize( 0, 0, width, height );
m_headerWin->Show( FALSE );
@@ -2769,7 +2769,7 @@ void wxListCtrl::OnIdle( wxIdleEvent &WXUNUSED(event) )
int w = 0;
int h = 0;
if (GetWindowStyleFlag() & wxLC_REPORT)
if (HasFlag(wxLC_REPORT))
{
m_headerWin->GetPosition( &x, &y );
m_headerWin->GetSize( &w, &h );
@@ -2795,9 +2795,10 @@ void wxListCtrl::OnIdle( wxIdleEvent &WXUNUSED(event) )
m_mainWin->Refresh();
}
void wxListCtrl::SetBackgroundColour( const wxColour &colour )
bool wxListCtrl::SetBackgroundColour( const wxColour &colour )
{
wxWindow::SetBackgroundColour( colour );
if ( !wxWindow::SetBackgroundColour( colour ) )
return FALSE;
if (m_mainWin)
{
@@ -2809,11 +2810,14 @@ void wxListCtrl::SetBackgroundColour( const wxColour &colour )
{
m_headerWin->SetBackgroundColour( colour );
}
return TRUE;
}
void wxListCtrl::SetForegroundColour( const wxColour &colour )
bool wxListCtrl::SetForegroundColour( const wxColour &colour )
{
wxWindow::SetForegroundColour( colour );
if ( !wxWindow::SetForegroundColour( colour ) )
return FALSE;
if (m_mainWin)
{
@@ -2825,11 +2829,14 @@ void wxListCtrl::SetForegroundColour( const wxColour &colour )
{
m_headerWin->SetForegroundColour( colour );
}
return TRUE;
}
void wxListCtrl::SetFont( const wxFont &font )
bool wxListCtrl::SetFont( const wxFont &font )
{
wxWindow::SetFont( font );
if ( !wxWindow::SetFont( font ) )
return FALSE;
if (m_mainWin)
{
@@ -2841,5 +2848,7 @@ void wxListCtrl::SetFont( const wxFont &font )
{
m_headerWin->SetFont( font );
}
return TRUE;
}
+29 -29
View File
@@ -6,7 +6,7 @@
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart, Markus Holzem, Robert Roebling
// Licence: wxWindows license
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
@@ -51,29 +51,29 @@ wxSize wxSplitMessage2( const wxString &message, wxWindow *parent )
for (uint pos = 0; pos < message.Len(); pos++)
{
if (message[pos] == _T('\n'))
{
if (!line.IsEmpty())
{
wxStaticText *s1 = new wxStaticText( parent, -1, line, wxPoint(15,y) );
wxSize size1( s1->GetSize() );
if (size1.x > w) w = size1.x;
line = _T("");
}
y += 18;
}
else
{
line += message[pos];
}
{
if (!line.IsEmpty())
{
wxStaticText *s1 = new wxStaticText( parent, -1, line, wxPoint(15,y) );
wxSize size1( s1->GetSize() );
if (size1.x > w) w = size1.x;
line = _T("");
}
y += 18;
}
else
{
line += message[pos];
}
}
if (!line.IsEmpty())
{
wxStaticText *s2 = new wxStaticText( parent, -1, line, wxPoint(15,y) );
wxSize size2( s2->GetSize() );
if (size2.x > w) w = size2.x;
wxStaticText *s2 = new wxStaticText( parent, -1, line, wxPoint(15,y) );
wxSize size2( s2->GetSize() );
if (size2.x > w) w = size2.x;
}
y += 18;
return wxSize(w+30,y);
@@ -81,9 +81,9 @@ wxSize wxSplitMessage2( const wxString &message, wxWindow *parent )
#if !USE_SHARED_LIBRARY
BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
EVT_BUTTON(wxID_CANCEL, wxGenericMessageDialog::OnCancel)
EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
EVT_BUTTON(wxID_CANCEL, wxGenericMessageDialog::OnCancel)
END_EVENT_TABLE()
IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
@@ -107,21 +107,21 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString
if (style & wxYES_NO)
{
yes = new wxButton( this, wxID_YES, _("Yes"), wxPoint(-1,y), wxSize(80,-1) );
m_buttons.Append( yes );
m_buttons.Append( yes );
no = new wxButton( this, wxID_NO, _("No"), wxPoint(-1,y), wxSize(80,-1) );
m_buttons.Append( no );
m_buttons.Append( no );
}
if (style & wxOK)
{
ok = new wxButton( this, wxID_OK, _("OK"), wxPoint(-1,y), wxSize(80,-1) );
m_buttons.Append( ok );
m_buttons.Append( ok );
}
if (style & wxCANCEL)
{
cancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxPoint(-1,y), wxSize(80,-1) );
m_buttons.Append( cancel );
m_buttons.Append( cancel );
}
if (ok)
@@ -144,10 +144,10 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString
while (node)
{
wxWindow *win = (wxWindow*)node->Data();
int x = (n*2+1)*space - 40 + 15;
win->Move( x, -1 );
int x = (n*2+1)*space - 40 + 15;
win->Move( x, -1 );
node = node->Next();
n++;
n++;
}
#ifdef __WXGTK__
+8 -8
View File
@@ -109,24 +109,24 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event )
return;
}
wxNode *start_node = GetChildren().Find( winFocus );
wxWindowList::Node *start_node = GetChildren().Find( winFocus );
if (!start_node)
start_node = GetChildren().First();
start_node = GetChildren().GetFirst();
wxNode *node = event.GetDirection() ? start_node->Next()
: start_node->Previous();
wxWindowList::Node *node = event.GetDirection() ? start_node->GetNext()
: start_node->GetPrevious();
while (node != start_node)
{
if (!node)
{
node = event.GetDirection() ? GetChildren().First()
: GetChildren().Last();
node = event.GetDirection() ? GetChildren().GetFirst()
: GetChildren().GetLast();
continue;
}
wxWindow *child = (wxWindow *)node->Data();
wxWindow *child = node->GetData();
if (child->AcceptsFocus())
{
@@ -135,7 +135,7 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event )
return;
}
node = event.GetDirection() ? node->Next() : node->Previous();
node = event.GetDirection() ? node->GetNext() : node->GetPrevious();
}
// we cycled through all of our children and none of them wanted to accept
+2 -2
View File
@@ -623,7 +623,7 @@ bool wxTabView::RemoveTab(int id)
m_noTabs --;
// The layout has changed
Layout();
LayoutTabs();
return TRUE;
}
tabNode = tabNode->Next();
@@ -703,7 +703,7 @@ void wxTabView::ClearTabs(bool deleteTabs)
// Layout tabs (optional, e.g. if resizing window)
void wxTabView::Layout(void)
void wxTabView::LayoutTabs(void)
{
// Make a list of the tab controls, deleting the wxTabLayers.
wxList controls;
+22 -18
View File
@@ -45,7 +45,6 @@
wxApp *wxTheApp = (wxApp *) NULL;
wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
extern wxList wxPendingDelete;
#if wxUSE_THREADS
extern wxList *wxPendingEvents;
extern wxCriticalSection *wxPendingEventsLocker;
@@ -277,8 +276,8 @@ bool wxApp::OnInitGui()
m_colorCube = (unsigned char*)malloc(32 * 32 * 32);
for (int r = 0; r < 32; r++)
{
for (int r = 0; r < 32; r++)
{
for (int g = 0; g < 32; g++)
{
for (int b = 0; b < 32; b++)
@@ -287,21 +286,26 @@ bool wxApp::OnInitGui()
int gg = (g << 3) | (g >> 2);
int bb = (b << 3) | (b >> 2);
GdkColor *colors = cmap->colors;
if(colors)
{
int max = 3 * 65536;
int index = -1;
int index = -1;
for (int i = 0; i < cmap->size; i++)
{
int rdiff = ((rr << 8) - colors[i].red);
int gdiff = ((gg << 8) - colors[i].green);
int bdiff = ((bb << 8) - colors[i].blue);
int sum = ABS (rdiff) + ABS (gdiff) + ABS (bdiff);
if (sum < max) { index = i; max = sum; }
GdkColor *colors = cmap->colors;
if(colors)
{
int max = 3 * 65536;
for (int i = 0; i < cmap->size; i++)
{
int rdiff = ((rr << 8) - colors[i].red);
int gdiff = ((gg << 8) - colors[i].green);
int bdiff = ((bb << 8) - colors[i].blue);
int sum = ABS (rdiff) + ABS (gdiff) + ABS (bdiff);
if (sum < max)
{
index = i; max = sum;
}
}
}
}
m_colorCube[ (r*1024) + (g*32) + b ] = index;
}
}
@@ -448,8 +452,8 @@ void wxApp::DeletePendingObjects()
delete obj;
if (wxPendingDelete.Member(obj))
delete node;
if (wxPendingDelete.Find(obj))
delete node;
node = wxPendingDelete.First();
}
+7 -4
View File
@@ -166,7 +166,7 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
m_parent->AddChild( this );
(m_parent->m_insertCallback)( m_parent, this );
m_parent->InsertChild( this );
PostCreation();
@@ -278,11 +278,14 @@ void wxBitmapButton::SetBitmapSelected( const wxBitmap& bitmap )
SetBitmap();
}
void wxBitmapButton::Enable( const bool enable )
bool wxBitmapButton::Enable( bool enable )
{
wxWindow::Enable(enable);
if ( !wxWindow::Enable(enable) )
return FALSE;
SetBitmap();
SetBitmap();
return TRUE;
}
void wxBitmapButton::HasFocus()
+6 -7
View File
@@ -96,9 +96,7 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label,
gtk_signal_connect( GTK_OBJECT(m_widget), "clicked",
GTK_SIGNAL_FUNC(gtk_button_clicked_callback), (gpointer*)this );
m_parent->AddChild( this );
(m_parent->m_insertCallback)( m_parent, this );
m_parent->DoAddChild( this );
PostCreation();
@@ -128,13 +126,14 @@ void wxButton::SetLabel( const wxString &label )
gtk_label_set( GTK_LABEL( GTK_BUTTON(m_widget)->child ), GetLabel().mbc_str() );
}
void wxButton::Enable( bool enable )
bool wxButton::Enable( bool enable )
{
wxCHECK_RET( m_widget != NULL, _T("invalid button") );
wxControl::Enable( enable );
if ( !wxControl::Enable( enable ) )
return FALSE;
gtk_widget_set_sensitive( GTK_BUTTON(m_widget)->child, enable );
return TRUE;
}
void wxButton::ApplyWidgetStyle()
+6 -7
View File
@@ -124,9 +124,7 @@ bool wxCheckBox::Create(wxWindow *parent,
GTK_SIGNAL_FUNC(gtk_checkbox_clicked_callback),
(gpointer *)this );
m_parent->AddChild( this );
(m_parent->m_insertCallback)( m_parent, this );
m_parent->DoAddChild( this );
PostCreation();
@@ -169,13 +167,14 @@ void wxCheckBox::SetLabel( const wxString& label )
gtk_label_set( GTK_LABEL(m_widgetLabel), GetLabel().mbc_str() );
}
void wxCheckBox::Enable( bool enable )
bool wxCheckBox::Enable( bool enable )
{
wxCHECK_RET( m_widgetLabel != NULL, _T("invalid checkbox") );
wxControl::Enable( enable );
if ( !wxControl::Enable( enable ) )
return FALSE;
gtk_widget_set_sensitive( m_widgetLabel, enable );
return TRUE;
}
void wxCheckBox::ApplyWidgetStyle()
+1 -3
View File
@@ -99,9 +99,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
}
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
m_parent->AddChild( this );
(m_parent->m_insertCallback)( m_parent, this );
m_parent->DoAddChild( this );
PostCreation();
+2 -4
View File
@@ -134,9 +134,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
gtk_widget_show( list_item );
}
m_parent->AddChild( this );
(m_parent->m_insertCallback)( m_parent, this );
m_parent->DoAddChild( this );
PostCreation();
@@ -582,7 +580,7 @@ void wxComboBox::OnChar( wxKeyEvent &event )
void wxComboBox::OnSize( wxSizeEvent &event )
{
wxControl::OnSize( event );
event.Skip();
return;
+6 -5
View File
@@ -110,8 +110,9 @@ wxWindowDC::wxWindowDC( wxWindow *window )
if (!window) return;
GtkWidget *widget = window->m_wxwindow;
if (!widget) return;
GtkWidget *widget = window->GetWxWindow();
if (!widget)
return;
m_window = widget->window;
@@ -126,10 +127,10 @@ wxWindowDC::wxWindowDC( wxWindow *window )
/* still not realized ? */
if (!m_window) return;
if (window->m_wxwindow)
m_cmap = gtk_widget_get_colormap( window->m_wxwindow );
if (window->GetWxWindow())
m_cmap = gtk_widget_get_colormap( window->GetWxWindow() );
else
m_cmap = gtk_widget_get_colormap( window->m_widget );
m_cmap = gtk_widget_get_colormap( window->GetHandle() );
m_isMemDC = FALSE;
+33 -35
View File
@@ -69,11 +69,9 @@ static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation
printf( ".\n" );
*/
if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
if ((win->GetWidth() != alloc->width) || (win->GetHeight() != alloc->height))
{
win->m_sizeSet = FALSE;
win->m_width = alloc->width;
win->m_height = alloc->height;
win->InternalSetSize( alloc->width, alloc->height );
}
}
@@ -87,10 +85,9 @@ static gint gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEvent
if (!win->HasVMT()) return FALSE;
win->m_x = event->x;
win->m_y = event->y;
win->InternalSetPosition(event->x, event->y);
wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() );
wxMoveEvent mevent( wxPoint(win->GetX(),win->GetY()), win->GetId() );
mevent.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( mevent );
@@ -114,7 +111,7 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
{
wxIcon icon( win->m_icon );
win->m_icon = wxNullIcon;
win->SetIcon( icon );
win->SetIcon( icon );
}
return FALSE;
@@ -129,43 +126,43 @@ gtk_dialog_map_callback( GtkWidget *widget, wxDialog *win )
{
/* I haven''t been able to set the position of
the dialog before it is shown, so I do it here */
gtk_widget_set_uposition( widget, win->m_x, win->m_y );
gtk_widget_set_uposition( widget, win->GetX(), win->GetY() );
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
long decor = (long) GDK_DECOR_BORDER;
long func = (long) GDK_FUNC_MOVE ;
if ((win->m_windowStyle & wxCAPTION) != 0)
decor |= GDK_DECOR_TITLE;
if ((win->m_windowStyle & wxSYSTEM_MENU) != 0)
if ((win->GetWindowStyle() & wxCAPTION) != 0)
decor |= GDK_DECOR_TITLE;
if ((win->GetWindowStyle() & wxSYSTEM_MENU) != 0)
{
decor |= GDK_DECOR_MENU;
func |= GDK_FUNC_CLOSE;
}
if ((win->m_windowStyle & wxMINIMIZE_BOX) != 0)
if ((win->GetWindowStyle() & wxMINIMIZE_BOX) != 0)
{
func |= GDK_FUNC_MINIMIZE;
decor |= GDK_DECOR_MINIMIZE;
func |= GDK_FUNC_MINIMIZE;
decor |= GDK_DECOR_MINIMIZE;
}
if ((win->m_windowStyle & wxMAXIMIZE_BOX) != 0)
if ((win->GetWindowStyle() & wxMAXIMIZE_BOX) != 0)
{
decor |= GDK_DECOR_MAXIMIZE;
func |= GDK_FUNC_MAXIMIZE;
decor |= GDK_DECOR_MAXIMIZE;
func |= GDK_FUNC_MAXIMIZE;
}
if ((win->m_windowStyle & wxRESIZE_BORDER) != 0)
if ((win->GetWindowStyle() & wxRESIZE_BORDER) != 0)
{
func |= GDK_FUNC_RESIZE;
decor |= GDK_DECOR_RESIZEH;
}
gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);
gdk_window_set_decorations( win->GetHandle()->window, (GdkWMDecoration)decor);
gdk_window_set_functions( win->GetHandle()->window, (GdkWMFunction)func);
/* GTK's shrinking/growing policy */
if ((win->m_windowStyle & wxRESIZE_BORDER) == 0)
gtk_window_set_policy(GTK_WINDOW(win->m_widget), 0, 0, 1);
if ((win->GetWindowStyle() & wxRESIZE_BORDER) == 0)
gtk_window_set_policy(GTK_WINDOW(win->GetHandle()), 0, 0, 1);
else
gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
gtk_window_set_policy(GTK_WINDOW(win->GetHandle()), 1, 1, 1);
return FALSE;
}
@@ -186,6 +183,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxPanel)
void wxDialog::Init()
{
m_returnCode = 0;
m_sizeSet = FALSE;
m_modalShowing = FALSE;
}
@@ -236,12 +234,12 @@ bool wxDialog::Create( wxWindow *parent,
/* we cannot set MWM hints before the widget has
been realized, so we do this directly after realization */
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
GTK_SIGNAL_FUNC(gtk_dialog_realized_callback), (gpointer) this );
GTK_SIGNAL_FUNC(gtk_dialog_realized_callback), (gpointer) this );
/* we set the position of the window after the map event. setting it
before has no effect (with KWM) */
gtk_signal_connect( GTK_OBJECT(m_widget), "map",
GTK_SIGNAL_FUNC(gtk_dialog_map_callback), (gpointer) this );
GTK_SIGNAL_FUNC(gtk_dialog_map_callback), (gpointer) this );
/* the user resized the frame by dragging etc. */
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
@@ -434,17 +432,17 @@ void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
if ((m_x != -1) || (m_y != -1))
{
if ((m_x != old_x) || (m_y != old_y))
{
/* we set the position here and when showing the dialog
for the first time in idle time */
{
/* we set the position here and when showing the dialog
for the first time in idle time */
gtk_widget_set_uposition( m_widget, m_x, m_y );
}
}
}
if ((m_width != old_width) || (m_height != old_height))
{
/* actual resizing is deferred to GtkOnSize in idle time and
when showing the dialog */
when showing the dialog */
m_sizeSet = FALSE;
}
@@ -517,12 +515,12 @@ bool wxDialog::Show( bool show )
if (show != m_isShown)
{
if (show)
{
gtk_widget_show( m_widget );
}
{
gtk_widget_show( m_widget );
}
else
gtk_widget_hide( m_widget );
m_isShown = show;
}
+211 -211
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More