See last changelog
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -32,6 +32,7 @@ class wxToolBar;
|
|||||||
class wxBitmapButton;
|
class wxBitmapButton;
|
||||||
class wxStaticBitmap;
|
class wxStaticBitmap;
|
||||||
class wxFrame;
|
class wxFrame;
|
||||||
|
class wxDialog;
|
||||||
class wxTreeCtrl;
|
class wxTreeCtrl;
|
||||||
|
|
||||||
class wxMask;
|
class wxMask;
|
||||||
@@ -62,6 +63,7 @@ class wxMask: public wxObject
|
|||||||
friend wxBitmapButton;
|
friend wxBitmapButton;
|
||||||
friend wxStaticBitmap;
|
friend wxStaticBitmap;
|
||||||
friend wxFrame;
|
friend wxFrame;
|
||||||
|
friend wxDialog;
|
||||||
friend wxTreeCtrl;
|
friend wxTreeCtrl;
|
||||||
|
|
||||||
GdkBitmap *GetBitmap() const;
|
GdkBitmap *GetBitmap() const;
|
||||||
@@ -124,6 +126,7 @@ class wxBitmap: public wxObject
|
|||||||
friend wxBitmapButton;
|
friend wxBitmapButton;
|
||||||
friend wxStaticBitmap;
|
friend wxStaticBitmap;
|
||||||
friend wxFrame;
|
friend wxFrame;
|
||||||
|
friend wxDialog;
|
||||||
friend wxTreeCtrl;
|
friend wxTreeCtrl;
|
||||||
|
|
||||||
GdkPixmap *GetPixmap() const;
|
GdkPixmap *GetPixmap() const;
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
#include "wx/string.h"
|
#include "wx/string.h"
|
||||||
#include "wx/event.h"
|
#include "wx/event.h"
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
|
#include "wx/icon.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// forward decls
|
// forward decls
|
||||||
@@ -74,9 +75,19 @@ class wxDialog: public wxWindow
|
|||||||
virtual int ShowModal(void);
|
virtual int ShowModal(void);
|
||||||
virtual void EndModal(int retCode);
|
virtual void EndModal(int retCode);
|
||||||
virtual bool IsModal(void) const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
virtual bool IsModal(void) const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
||||||
|
void SetModal( bool modal );
|
||||||
virtual void InitDialog(void);
|
virtual void InitDialog(void);
|
||||||
virtual void Centre( int direction = wxHORIZONTAL );
|
virtual void Centre( int direction = wxHORIZONTAL );
|
||||||
|
|
||||||
|
virtual void SetSizeHints( int minW, int minH, int maxW, int maxH, int incW = -1 );
|
||||||
|
|
||||||
|
virtual void SetIcon( const wxIcon &icon );
|
||||||
|
virtual void Iconize( bool WXUNUSED(iconize)) { }
|
||||||
|
virtual bool IsIconized(void) const { return FALSE; }
|
||||||
|
bool Iconized(void) const { return IsIconized(); }
|
||||||
|
virtual void Maximize(void) { }
|
||||||
|
virtual void Restore(void) { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
friend wxWindow;
|
friend wxWindow;
|
||||||
@@ -85,6 +96,7 @@ class wxDialog: public wxWindow
|
|||||||
|
|
||||||
bool m_modalShowing;
|
bool m_modalShowing;
|
||||||
wxString m_title;
|
wxString m_title;
|
||||||
|
wxIcon m_icon;
|
||||||
|
|
||||||
virtual void ImplementSetPosition();
|
virtual void ImplementSetPosition();
|
||||||
|
|
||||||
|
@@ -81,7 +81,7 @@ class wxFont: public wxGDIObject
|
|||||||
friend wxPaintDC;
|
friend wxPaintDC;
|
||||||
friend wxWindow;
|
friend wxWindow;
|
||||||
|
|
||||||
GdkFont* GetInternalFont(float scale = 1.0);
|
GdkFont* GetInternalFont(float scale = 1.0) const;
|
||||||
|
|
||||||
// no data :-)
|
// no data :-)
|
||||||
};
|
};
|
||||||
|
@@ -89,9 +89,11 @@ public:
|
|||||||
virtual wxString GetTitle() const { return m_title; }
|
virtual wxString GetTitle() const { return m_title; }
|
||||||
|
|
||||||
virtual void SetIcon( const wxIcon &icon );
|
virtual void SetIcon( const wxIcon &icon );
|
||||||
void Iconize( bool WXUNUSED(iconize)) { }
|
virtual void Iconize( bool WXUNUSED(iconize)) { }
|
||||||
bool IsIconized(void) const { return FALSE; }
|
virtual bool IsIconized(void) const { return FALSE; }
|
||||||
bool Iconized(void) const { return FALSE; }
|
bool Iconized(void) const { return IsIconized(); }
|
||||||
|
virtual void Maximize(void) {}
|
||||||
|
virtual void Restore(void) {}
|
||||||
|
|
||||||
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
||||||
void OnSize( wxSizeEvent &event );
|
void OnSize( wxSizeEvent &event );
|
||||||
|
@@ -99,7 +99,8 @@ public:
|
|||||||
bool IsChecked() const;
|
bool IsChecked() const;
|
||||||
|
|
||||||
// help string (displayed in the status bar by default)
|
// help string (displayed in the status bar by default)
|
||||||
void SetHelpString(const wxString& str) { m_helpStr = str; }
|
void SetHelp(const wxString& str) { m_helpStr = str; }
|
||||||
|
const wxString& GetHelp() const { return m_helpStr; }
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
void SetMenuItem(GtkWidget *menuItem) { m_menuItem = menuItem; }
|
void SetMenuItem(GtkWidget *menuItem) { m_menuItem = menuItem; }
|
||||||
@@ -137,6 +138,7 @@ public:
|
|||||||
// find item by name/id
|
// find item by name/id
|
||||||
int FindItem( const wxString itemString ) const;
|
int FindItem( const wxString itemString ) const;
|
||||||
wxMenuItem *FindItem( int id ) const;
|
wxMenuItem *FindItem( int id ) const;
|
||||||
|
wxMenuItem *FindItemForId( int id ) const { return FindItem( id ); }
|
||||||
|
|
||||||
// get/set item's state
|
// get/set item's state
|
||||||
void Enable( int id, bool enable );
|
void Enable( int id, bool enable );
|
||||||
@@ -145,6 +147,11 @@ public:
|
|||||||
bool IsChecked( int id ) const;
|
bool IsChecked( int id ) const;
|
||||||
|
|
||||||
void SetLabel( int id, const wxString &label );
|
void SetLabel( int id, const wxString &label );
|
||||||
|
wxString GetLabel(int id) const;
|
||||||
|
|
||||||
|
// helpstring
|
||||||
|
virtual void SetHelpString(int id, const wxString& helpString);
|
||||||
|
virtual wxString GetHelpString(int id) const ;
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
wxList& GetItems() { return m_items; }
|
wxList& GetItems() { return m_items; }
|
||||||
|
@@ -96,6 +96,9 @@ public:
|
|||||||
virtual void GetPosition( int *x, int *y ) const;
|
virtual void GetPosition( int *x, int *y ) const;
|
||||||
virtual void Centre( int direction = wxHORIZONTAL );
|
virtual void Centre( int direction = wxHORIZONTAL );
|
||||||
virtual void Fit();
|
virtual void Fit();
|
||||||
|
// set minimal/maxmimal size for the frame
|
||||||
|
virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW),
|
||||||
|
int WXUNUSED(maxH), int WXUNUSED(incW) ) { }
|
||||||
|
|
||||||
void OnSize( wxSizeEvent &event );
|
void OnSize( wxSizeEvent &event );
|
||||||
void OnIdle( wxIdleEvent& event );
|
void OnIdle( wxIdleEvent& event );
|
||||||
@@ -113,7 +116,12 @@ public:
|
|||||||
virtual void RemoveChild( wxWindow *child );
|
virtual void RemoveChild( wxWindow *child );
|
||||||
void SetReturnCode( int retCode );
|
void SetReturnCode( int retCode );
|
||||||
int GetReturnCode();
|
int GetReturnCode();
|
||||||
wxWindow *GetParent();
|
wxWindow *GetParent() const
|
||||||
|
{ return m_parent; }
|
||||||
|
wxWindow *GetGrandParent(void) const
|
||||||
|
{ return (m_parent ? m_parent->m_parent : (wxWindow*)NULL); }
|
||||||
|
void wxWindow::SetParent( wxWindow *p )
|
||||||
|
{ m_parent = p; }
|
||||||
|
|
||||||
wxEvtHandler *GetEventHandler();
|
wxEvtHandler *GetEventHandler();
|
||||||
void SetEventHandler( wxEvtHandler *handler );
|
void SetEventHandler( wxEvtHandler *handler );
|
||||||
@@ -140,14 +148,21 @@ public:
|
|||||||
virtual wxColour GetForegroundColour() const;
|
virtual wxColour GetForegroundColour() const;
|
||||||
virtual void SetForegroundColour( const wxColour &colour );
|
virtual void SetForegroundColour( const wxColour &colour );
|
||||||
|
|
||||||
|
virtual int GetCharHeight(void) const;
|
||||||
|
virtual int GetCharWidth(void) const;
|
||||||
|
virtual void GetTextExtent( const wxString& string, int *x, int *y,
|
||||||
|
int *descent = NULL,
|
||||||
|
int *externalLeading = NULL,
|
||||||
|
const wxFont *theFont = NULL, bool use16 = FALSE) const;
|
||||||
|
|
||||||
virtual void SetDefaultBackgroundColour( const wxColour& col )
|
virtual void SetDefaultBackgroundColour( const wxColour& col )
|
||||||
{ m_defaultBackgroundColour = col; };
|
{ m_defaultBackgroundColour = col; }
|
||||||
virtual wxColour GetDefaultBackgroundColour() const
|
virtual wxColour GetDefaultBackgroundColour() const
|
||||||
{ return m_defaultBackgroundColour; };
|
{ return m_defaultBackgroundColour; }
|
||||||
virtual void SetDefaultForegroundColour( const wxColour& col )
|
virtual void SetDefaultForegroundColour( const wxColour& col )
|
||||||
{ m_defaultForegroundColour = col; };
|
{ m_defaultForegroundColour = col; }
|
||||||
virtual wxColour GetDefaultForegroundColour() const
|
virtual wxColour GetDefaultForegroundColour() const
|
||||||
{ return m_defaultForegroundColour; };
|
{ return m_defaultForegroundColour; }
|
||||||
|
|
||||||
virtual void SetFont( const wxFont &font );
|
virtual void SetFont( const wxFont &font );
|
||||||
virtual wxFont *GetFont();
|
virtual wxFont *GetFont();
|
||||||
|
@@ -32,6 +32,7 @@ class wxToolBar;
|
|||||||
class wxBitmapButton;
|
class wxBitmapButton;
|
||||||
class wxStaticBitmap;
|
class wxStaticBitmap;
|
||||||
class wxFrame;
|
class wxFrame;
|
||||||
|
class wxDialog;
|
||||||
class wxTreeCtrl;
|
class wxTreeCtrl;
|
||||||
|
|
||||||
class wxMask;
|
class wxMask;
|
||||||
@@ -62,6 +63,7 @@ class wxMask: public wxObject
|
|||||||
friend wxBitmapButton;
|
friend wxBitmapButton;
|
||||||
friend wxStaticBitmap;
|
friend wxStaticBitmap;
|
||||||
friend wxFrame;
|
friend wxFrame;
|
||||||
|
friend wxDialog;
|
||||||
friend wxTreeCtrl;
|
friend wxTreeCtrl;
|
||||||
|
|
||||||
GdkBitmap *GetBitmap() const;
|
GdkBitmap *GetBitmap() const;
|
||||||
@@ -124,6 +126,7 @@ class wxBitmap: public wxObject
|
|||||||
friend wxBitmapButton;
|
friend wxBitmapButton;
|
||||||
friend wxStaticBitmap;
|
friend wxStaticBitmap;
|
||||||
friend wxFrame;
|
friend wxFrame;
|
||||||
|
friend wxDialog;
|
||||||
friend wxTreeCtrl;
|
friend wxTreeCtrl;
|
||||||
|
|
||||||
GdkPixmap *GetPixmap() const;
|
GdkPixmap *GetPixmap() const;
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
#include "wx/string.h"
|
#include "wx/string.h"
|
||||||
#include "wx/event.h"
|
#include "wx/event.h"
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
|
#include "wx/icon.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// forward decls
|
// forward decls
|
||||||
@@ -74,9 +75,19 @@ class wxDialog: public wxWindow
|
|||||||
virtual int ShowModal(void);
|
virtual int ShowModal(void);
|
||||||
virtual void EndModal(int retCode);
|
virtual void EndModal(int retCode);
|
||||||
virtual bool IsModal(void) const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
virtual bool IsModal(void) const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
||||||
|
void SetModal( bool modal );
|
||||||
virtual void InitDialog(void);
|
virtual void InitDialog(void);
|
||||||
virtual void Centre( int direction = wxHORIZONTAL );
|
virtual void Centre( int direction = wxHORIZONTAL );
|
||||||
|
|
||||||
|
virtual void SetSizeHints( int minW, int minH, int maxW, int maxH, int incW = -1 );
|
||||||
|
|
||||||
|
virtual void SetIcon( const wxIcon &icon );
|
||||||
|
virtual void Iconize( bool WXUNUSED(iconize)) { }
|
||||||
|
virtual bool IsIconized(void) const { return FALSE; }
|
||||||
|
bool Iconized(void) const { return IsIconized(); }
|
||||||
|
virtual void Maximize(void) { }
|
||||||
|
virtual void Restore(void) { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
friend wxWindow;
|
friend wxWindow;
|
||||||
@@ -85,6 +96,7 @@ class wxDialog: public wxWindow
|
|||||||
|
|
||||||
bool m_modalShowing;
|
bool m_modalShowing;
|
||||||
wxString m_title;
|
wxString m_title;
|
||||||
|
wxIcon m_icon;
|
||||||
|
|
||||||
virtual void ImplementSetPosition();
|
virtual void ImplementSetPosition();
|
||||||
|
|
||||||
|
@@ -81,7 +81,7 @@ class wxFont: public wxGDIObject
|
|||||||
friend wxPaintDC;
|
friend wxPaintDC;
|
||||||
friend wxWindow;
|
friend wxWindow;
|
||||||
|
|
||||||
GdkFont* GetInternalFont(float scale = 1.0);
|
GdkFont* GetInternalFont(float scale = 1.0) const;
|
||||||
|
|
||||||
// no data :-)
|
// no data :-)
|
||||||
};
|
};
|
||||||
|
@@ -89,9 +89,11 @@ public:
|
|||||||
virtual wxString GetTitle() const { return m_title; }
|
virtual wxString GetTitle() const { return m_title; }
|
||||||
|
|
||||||
virtual void SetIcon( const wxIcon &icon );
|
virtual void SetIcon( const wxIcon &icon );
|
||||||
void Iconize( bool WXUNUSED(iconize)) { }
|
virtual void Iconize( bool WXUNUSED(iconize)) { }
|
||||||
bool IsIconized(void) const { return FALSE; }
|
virtual bool IsIconized(void) const { return FALSE; }
|
||||||
bool Iconized(void) const { return FALSE; }
|
bool Iconized(void) const { return IsIconized(); }
|
||||||
|
virtual void Maximize(void) {}
|
||||||
|
virtual void Restore(void) {}
|
||||||
|
|
||||||
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
||||||
void OnSize( wxSizeEvent &event );
|
void OnSize( wxSizeEvent &event );
|
||||||
|
@@ -99,7 +99,8 @@ public:
|
|||||||
bool IsChecked() const;
|
bool IsChecked() const;
|
||||||
|
|
||||||
// help string (displayed in the status bar by default)
|
// help string (displayed in the status bar by default)
|
||||||
void SetHelpString(const wxString& str) { m_helpStr = str; }
|
void SetHelp(const wxString& str) { m_helpStr = str; }
|
||||||
|
const wxString& GetHelp() const { return m_helpStr; }
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
void SetMenuItem(GtkWidget *menuItem) { m_menuItem = menuItem; }
|
void SetMenuItem(GtkWidget *menuItem) { m_menuItem = menuItem; }
|
||||||
@@ -137,6 +138,7 @@ public:
|
|||||||
// find item by name/id
|
// find item by name/id
|
||||||
int FindItem( const wxString itemString ) const;
|
int FindItem( const wxString itemString ) const;
|
||||||
wxMenuItem *FindItem( int id ) const;
|
wxMenuItem *FindItem( int id ) const;
|
||||||
|
wxMenuItem *FindItemForId( int id ) const { return FindItem( id ); }
|
||||||
|
|
||||||
// get/set item's state
|
// get/set item's state
|
||||||
void Enable( int id, bool enable );
|
void Enable( int id, bool enable );
|
||||||
@@ -145,6 +147,11 @@ public:
|
|||||||
bool IsChecked( int id ) const;
|
bool IsChecked( int id ) const;
|
||||||
|
|
||||||
void SetLabel( int id, const wxString &label );
|
void SetLabel( int id, const wxString &label );
|
||||||
|
wxString GetLabel(int id) const;
|
||||||
|
|
||||||
|
// helpstring
|
||||||
|
virtual void SetHelpString(int id, const wxString& helpString);
|
||||||
|
virtual wxString GetHelpString(int id) const ;
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
wxList& GetItems() { return m_items; }
|
wxList& GetItems() { return m_items; }
|
||||||
|
@@ -96,6 +96,9 @@ public:
|
|||||||
virtual void GetPosition( int *x, int *y ) const;
|
virtual void GetPosition( int *x, int *y ) const;
|
||||||
virtual void Centre( int direction = wxHORIZONTAL );
|
virtual void Centre( int direction = wxHORIZONTAL );
|
||||||
virtual void Fit();
|
virtual void Fit();
|
||||||
|
// set minimal/maxmimal size for the frame
|
||||||
|
virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW),
|
||||||
|
int WXUNUSED(maxH), int WXUNUSED(incW) ) { }
|
||||||
|
|
||||||
void OnSize( wxSizeEvent &event );
|
void OnSize( wxSizeEvent &event );
|
||||||
void OnIdle( wxIdleEvent& event );
|
void OnIdle( wxIdleEvent& event );
|
||||||
@@ -113,7 +116,12 @@ public:
|
|||||||
virtual void RemoveChild( wxWindow *child );
|
virtual void RemoveChild( wxWindow *child );
|
||||||
void SetReturnCode( int retCode );
|
void SetReturnCode( int retCode );
|
||||||
int GetReturnCode();
|
int GetReturnCode();
|
||||||
wxWindow *GetParent();
|
wxWindow *GetParent() const
|
||||||
|
{ return m_parent; }
|
||||||
|
wxWindow *GetGrandParent(void) const
|
||||||
|
{ return (m_parent ? m_parent->m_parent : (wxWindow*)NULL); }
|
||||||
|
void wxWindow::SetParent( wxWindow *p )
|
||||||
|
{ m_parent = p; }
|
||||||
|
|
||||||
wxEvtHandler *GetEventHandler();
|
wxEvtHandler *GetEventHandler();
|
||||||
void SetEventHandler( wxEvtHandler *handler );
|
void SetEventHandler( wxEvtHandler *handler );
|
||||||
@@ -140,14 +148,21 @@ public:
|
|||||||
virtual wxColour GetForegroundColour() const;
|
virtual wxColour GetForegroundColour() const;
|
||||||
virtual void SetForegroundColour( const wxColour &colour );
|
virtual void SetForegroundColour( const wxColour &colour );
|
||||||
|
|
||||||
|
virtual int GetCharHeight(void) const;
|
||||||
|
virtual int GetCharWidth(void) const;
|
||||||
|
virtual void GetTextExtent( const wxString& string, int *x, int *y,
|
||||||
|
int *descent = NULL,
|
||||||
|
int *externalLeading = NULL,
|
||||||
|
const wxFont *theFont = NULL, bool use16 = FALSE) const;
|
||||||
|
|
||||||
virtual void SetDefaultBackgroundColour( const wxColour& col )
|
virtual void SetDefaultBackgroundColour( const wxColour& col )
|
||||||
{ m_defaultBackgroundColour = col; };
|
{ m_defaultBackgroundColour = col; }
|
||||||
virtual wxColour GetDefaultBackgroundColour() const
|
virtual wxColour GetDefaultBackgroundColour() const
|
||||||
{ return m_defaultBackgroundColour; };
|
{ return m_defaultBackgroundColour; }
|
||||||
virtual void SetDefaultForegroundColour( const wxColour& col )
|
virtual void SetDefaultForegroundColour( const wxColour& col )
|
||||||
{ m_defaultForegroundColour = col; };
|
{ m_defaultForegroundColour = col; }
|
||||||
virtual wxColour GetDefaultForegroundColour() const
|
virtual wxColour GetDefaultForegroundColour() const
|
||||||
{ return m_defaultForegroundColour; };
|
{ return m_defaultForegroundColour; }
|
||||||
|
|
||||||
virtual void SetFont( const wxFont &font );
|
virtual void SetFont( const wxFont &font );
|
||||||
virtual wxFont *GetFont();
|
virtual wxFont *GetFont();
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
#elif defined(__WXMOTIF__)
|
#elif defined(__WXMOTIF__)
|
||||||
#include "wx/generic/treectrl.h"
|
#include "wx/generic/treectrl.h"
|
||||||
#elif defined(__WXGTK__)
|
#elif defined(__WXGTK__)
|
||||||
#include "wx/gtk/treectrl.h"
|
#include "wx/generic/treectrl.h"
|
||||||
#elif defined(__WXQT__)
|
#elif defined(__WXQT__)
|
||||||
#include "wx/qt/treectrl.h"
|
#include "wx/qt/treectrl.h"
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
0x00 0x00 0x00
|
0x0 0x0 0x0
|
||||||
0xff 0xff 0xff
|
0xff 0xff 0xff
|
||||||
0xdd 0xdd 0xdd
|
0xdd 0xdd 0xdd
|
||||||
0xbb 0xbb 0xbb
|
0xbb 0xbb 0xbb
|
||||||
@@ -6,43 +6,59 @@
|
|||||||
0x77 0x77 0x77
|
0x77 0x77 0x77
|
||||||
0x55 0x55 0x55
|
0x55 0x55 0x55
|
||||||
0x33 0x33 0x33
|
0x33 0x33 0x33
|
||||||
0x88 0x00 0x00
|
0x88 0x0 0x0
|
||||||
0xcc 0x00 0x00
|
0xcc 0x0 0x0
|
||||||
0xff 0x00 0x00
|
0xff 0x0 0x0
|
||||||
0xff 0x44 0x00
|
0xff 0x44 0x0
|
||||||
0xff 0x88 0x00
|
0xff 0x88 0x0
|
||||||
0xff 0xcc 0x00
|
0xff 0xcc 0x0
|
||||||
0xff 0xff 0x00
|
0xff 0xff 0x0
|
||||||
0xcc 0xcc 0x00
|
0xcc 0xcc 0x0
|
||||||
0x88 0x88 0x00
|
0x88 0x88 0x0
|
||||||
0x44 0x44 0x00
|
0x60 0x60 0x0
|
||||||
0x00 0x44 0x00
|
0x0 0x43 0x0
|
||||||
0x00 0x88 0x00
|
0x0 0x7f 0x0
|
||||||
0x00 0xcc 0x00
|
0x0 0xcc 0x0
|
||||||
0x00 0xff 0x00
|
0x0 0xff 0x0
|
||||||
0x00 0x44 0x44
|
0x0 0x44 0x44
|
||||||
0x00 0x88 0x88
|
0x0 0x88 0x88
|
||||||
0x00 0xff 0xff
|
0x0 0xff 0xff
|
||||||
0x00 0x00 0x44
|
0x0 0x0 0x44
|
||||||
0x00 0x00 0x88
|
0x0 0x0 0x88
|
||||||
0x00 0x00 0xff
|
0x0 0x0 0xff
|
||||||
0x88 0x00 0x88
|
0xff 0xcc 0x97
|
||||||
0xff 0xcc 0x99
|
0xef 0xb1 0x7b
|
||||||
0xcc 0xaa 0x77
|
0xdf 0x98 0x5f
|
||||||
0xaa 0x88 0x55
|
0xbf 0x87 0x56
|
||||||
0x88 0x66 0x33
|
0x9f 0x6b 0x42
|
||||||
0x66 0x44 0x11
|
0x7f 0x57 0x26
|
||||||
0x44 0x22 0x00
|
0x5f 0x39 0xc
|
||||||
0x22 0x00 0x00
|
0x3f 0x1c 0x0
|
||||||
0x00 0x44 0x88
|
0x21 0x0 0x0
|
||||||
0x44 0x88 0xcc
|
0x0 0x43 0x87
|
||||||
0x88 0xcc 0xff
|
0x2d 0x70 0xaf
|
||||||
0x00 0xcc 0x44
|
0x5a 0x9e 0xd7
|
||||||
0x44 0x88 0x44
|
0x87 0xcc 0xff
|
||||||
0x88 0xcc 0x00
|
0xff 0xe0 0xba
|
||||||
0x22 0x44 0x11
|
0x21 0x43 0xf
|
||||||
0x33 0x66 0x22
|
0x3d 0x5d 0x25
|
||||||
0x44 0x55 0x33
|
0x59 0x78 0x3a
|
||||||
0x66 0x88 0x44
|
0x75 0x93 0x4f
|
||||||
0x33 0x66 0x22
|
0x91 0xae 0x64
|
||||||
0x22 0x44 0x11
|
0xad 0xc8 0x7a
|
||||||
|
0xf0 0xa8 0xef
|
||||||
|
0xd0 0x88 0xd0
|
||||||
|
0xaf 0x66 0xaf
|
||||||
|
0x8e 0x44 0x8e
|
||||||
|
0x6d 0x22 0x6d
|
||||||
|
0x4b 0x0 0x4b
|
||||||
|
0xff 0xc0 0xbc
|
||||||
|
0xff 0x93 0x91
|
||||||
|
0xff 0x66 0x67
|
||||||
|
0xd8 0xf2 0xbf
|
||||||
|
0xff 0xc9 0x68
|
||||||
|
0xff 0x96 0x67
|
||||||
|
0xa5 0x60 0xff
|
||||||
|
0x51 0xff 0x99
|
||||||
|
0x3f 0xa5 0x63
|
||||||
|
0x98 0x90 0x67
|
||||||
|
@@ -552,22 +552,25 @@ void wxPaintDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(us
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool wxPaintDC::CanGetTextExtent(void) const
|
bool wxPaintDC::CanGetTextExtent(void) const
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height,
|
void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height,
|
||||||
long *WXUNUSED(descent), long *WXUNUSED(externalLeading),
|
long *descent, long *externalLeading,
|
||||||
wxFont *WXUNUSED(theFont), bool WXUNUSED(use16) )
|
wxFont *theFont, bool WXUNUSED(use16) )
|
||||||
{
|
{
|
||||||
if (!Ok()) return;
|
if (!Ok()) return;
|
||||||
|
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
wxFont fontToUse = m_font;
|
||||||
|
if (theFont) fontToUse = *theFont;
|
||||||
|
|
||||||
|
GdkFont *font = fontToUse.GetInternalFont( m_scaleY );
|
||||||
if (width) (*width) = long(gdk_string_width( font, string ) / m_scaleX);
|
if (width) (*width) = long(gdk_string_width( font, string ) / m_scaleX);
|
||||||
if (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
|
if (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
|
||||||
|
if (descent) (*descent) = long(font->descent / m_scaleY);
|
||||||
|
if (externalLeading) (*externalLeading) = 0; // ??
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxPaintDC::GetCharWidth(void)
|
long wxPaintDC::GetCharWidth(void)
|
||||||
@@ -575,7 +578,7 @@ long wxPaintDC::GetCharWidth(void)
|
|||||||
if (!Ok()) return 0;
|
if (!Ok()) return 0;
|
||||||
|
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||||
return gdk_string_width( font, "H" );
|
return long(gdk_string_width( font, "H" ) / m_scaleX);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxPaintDC::GetCharHeight(void)
|
long wxPaintDC::GetCharHeight(void)
|
||||||
@@ -583,7 +586,7 @@ long wxPaintDC::GetCharHeight(void)
|
|||||||
if (!Ok()) return 0;
|
if (!Ok()) return 0;
|
||||||
|
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||||
return font->ascent + font->descent;
|
return long((font->ascent + font->descent) / m_scaleY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPaintDC::Clear(void)
|
void wxPaintDC::Clear(void)
|
||||||
|
@@ -36,7 +36,7 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED
|
|||||||
win->Close();
|
win->Close();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxDialog
|
// wxDialog
|
||||||
@@ -56,7 +56,7 @@ wxDialog::wxDialog(void)
|
|||||||
m_title = "";
|
m_title = "";
|
||||||
m_modalShowing = FALSE;
|
m_modalShowing = FALSE;
|
||||||
wxTopLevelWindows.Insert( this );
|
wxTopLevelWindows.Insert( this );
|
||||||
};
|
}
|
||||||
|
|
||||||
wxDialog::wxDialog( wxWindow *parent,
|
wxDialog::wxDialog( wxWindow *parent,
|
||||||
wxWindowID id, const wxString &title,
|
wxWindowID id, const wxString &title,
|
||||||
@@ -66,7 +66,7 @@ wxDialog::wxDialog( wxWindow *parent,
|
|||||||
m_modalShowing = FALSE;
|
m_modalShowing = FALSE;
|
||||||
wxTopLevelWindows.Insert( this );
|
wxTopLevelWindows.Insert( this );
|
||||||
Create( parent, id, title, pos, size, style, name );
|
Create( parent, id, title, pos, size, style, name );
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxDialog::Create( wxWindow *parent,
|
bool wxDialog::Create( wxWindow *parent,
|
||||||
wxWindowID id, const wxString &title,
|
wxWindowID id, const wxString &title,
|
||||||
@@ -101,30 +101,30 @@ bool wxDialog::Create( wxWindow *parent,
|
|||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
}
|
||||||
|
|
||||||
wxDialog::~wxDialog(void)
|
wxDialog::~wxDialog(void)
|
||||||
{
|
{
|
||||||
wxTopLevelWindows.DeleteObject( this );
|
wxTopLevelWindows.DeleteObject( this );
|
||||||
if (wxTopLevelWindows.Number() == 0) wxTheApp->ExitMainLoop();
|
if (wxTopLevelWindows.Number() == 0) wxTheApp->ExitMainLoop();
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::SetTitle(const wxString& title )
|
void wxDialog::SetTitle(const wxString& title )
|
||||||
{
|
{
|
||||||
m_title = title;
|
m_title = title;
|
||||||
if (m_title.IsNull()) m_title = "";
|
if (m_title.IsNull()) m_title = "";
|
||||||
gtk_window_set_title( GTK_WINDOW(m_widget), m_title );
|
gtk_window_set_title( GTK_WINDOW(m_widget), m_title );
|
||||||
};
|
}
|
||||||
|
|
||||||
wxString wxDialog::GetTitle(void) const
|
wxString wxDialog::GetTitle(void) const
|
||||||
{
|
{
|
||||||
return (wxString&)m_title;
|
return (wxString&)m_title;
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::OnApply( wxCommandEvent &WXUNUSED(event) )
|
void wxDialog::OnApply( wxCommandEvent &WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
if (Validate()) TransferDataFromWindow();
|
if (Validate()) TransferDataFromWindow();
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
|
void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
@@ -136,8 +136,8 @@ void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
|
|||||||
{
|
{
|
||||||
SetReturnCode(wxID_CANCEL);
|
SetReturnCode(wxID_CANCEL);
|
||||||
this->Show(FALSE);
|
this->Show(FALSE);
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
|
void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
@@ -151,14 +151,14 @@ void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
|
|||||||
{
|
{
|
||||||
SetReturnCode(wxID_OK);
|
SetReturnCode(wxID_OK);
|
||||||
this->Show(FALSE);
|
this->Show(FALSE);
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
void wxDialog::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
// yes
|
// yes
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxDialog::OnClose(void)
|
bool wxDialog::OnClose(void)
|
||||||
{
|
{
|
||||||
@@ -189,8 +189,8 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
|||||||
if (GetEventHandler()->OnClose() || event.GetForce())
|
if (GetEventHandler()->OnClose() || event.GetForce())
|
||||||
{
|
{
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::ImplementSetPosition(void)
|
void wxDialog::ImplementSetPosition(void)
|
||||||
{
|
{
|
||||||
@@ -210,14 +210,22 @@ bool wxDialog::Show( bool show )
|
|||||||
if (!show && IsModal() && m_modalShowing)
|
if (!show && IsModal() && m_modalShowing)
|
||||||
{
|
{
|
||||||
EndModal( wxID_CANCEL );
|
EndModal( wxID_CANCEL );
|
||||||
};
|
}
|
||||||
|
|
||||||
wxWindow::Show( show );
|
wxWindow::Show( show );
|
||||||
|
|
||||||
if (show) InitDialog();
|
if (show) InitDialog();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
void wxDialog::SetModal(bool flag)
|
||||||
|
{
|
||||||
|
if (flag)
|
||||||
|
m_windowStyle |= wxDIALOG_MODAL;
|
||||||
|
else
|
||||||
|
if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL;
|
||||||
|
}
|
||||||
|
|
||||||
int wxDialog::ShowModal(void)
|
int wxDialog::ShowModal(void)
|
||||||
{
|
{
|
||||||
@@ -232,7 +240,7 @@ int wxDialog::ShowModal(void)
|
|||||||
gtk_grab_remove( m_widget );
|
gtk_grab_remove( m_widget );
|
||||||
|
|
||||||
return GetReturnCode();
|
return GetReturnCode();
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::EndModal( int retCode )
|
void wxDialog::EndModal( int retCode )
|
||||||
{
|
{
|
||||||
@@ -242,15 +250,34 @@ void wxDialog::EndModal( int retCode )
|
|||||||
{
|
{
|
||||||
wxFAIL_MSG( "wxDialog: called EndModal twice" );
|
wxFAIL_MSG( "wxDialog: called EndModal twice" );
|
||||||
return;
|
return;
|
||||||
};
|
}
|
||||||
|
|
||||||
m_modalShowing = FALSE;
|
m_modalShowing = FALSE;
|
||||||
|
|
||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::InitDialog(void)
|
void wxDialog::InitDialog(void)
|
||||||
{
|
{
|
||||||
wxWindow::InitDialog();
|
wxWindow::InitDialog();
|
||||||
};
|
}
|
||||||
|
|
||||||
|
void wxDialog::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) )
|
||||||
|
{
|
||||||
|
gdk_window_set_hints( m_widget->window, -1, -1,
|
||||||
|
minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDialog::SetIcon( const wxIcon &icon )
|
||||||
|
{
|
||||||
|
m_icon = icon;
|
||||||
|
if (!icon.Ok()) return;
|
||||||
|
|
||||||
|
wxMask *mask = icon.GetMask();
|
||||||
|
GdkBitmap *bm = NULL;
|
||||||
|
if (mask) bm = mask->GetBitmap();
|
||||||
|
|
||||||
|
gdk_window_set_icon( m_widget->window, NULL, icon.GetPixmap(), bm );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -255,7 +255,7 @@ static GdkFont *wxLoadQueryNearestFont(int point_size, int fontid,
|
|||||||
int style, int weight,
|
int style, int weight,
|
||||||
bool underlined);
|
bool underlined);
|
||||||
|
|
||||||
GdkFont *wxFont::GetInternalFont(float scale)
|
GdkFont *wxFont::GetInternalFont(float scale) const
|
||||||
{
|
{
|
||||||
if (M_FONTDATA->m_byXFontName) return M_FONTDATA->m_font;
|
if (M_FONTDATA->m_byXFontName) return M_FONTDATA->m_font;
|
||||||
|
|
||||||
|
@@ -515,8 +515,7 @@ void wxFrame::SetTitle( const wxString &title )
|
|||||||
|
|
||||||
void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) )
|
void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) )
|
||||||
{
|
{
|
||||||
if (m_wxwindow)
|
gdk_window_set_hints( m_widget->window, -1, -1,
|
||||||
gdk_window_set_hints( m_wxwindow->window, -1, -1,
|
|
||||||
minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
|
minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -254,7 +254,7 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
|
|||||||
wxMenuItem *mitem = new wxMenuItem();
|
wxMenuItem *mitem = new wxMenuItem();
|
||||||
mitem->SetId(id);
|
mitem->SetId(id);
|
||||||
mitem->SetText(item);
|
mitem->SetText(item);
|
||||||
mitem->SetHelpString(helpStr);
|
mitem->SetHelp(helpStr);
|
||||||
mitem->SetCheckable(checkable);
|
mitem->SetCheckable(checkable);
|
||||||
const char *text = mitem->GetText();
|
const char *text = mitem->GetText();
|
||||||
GtkWidget *menuItem = checkable ? gtk_check_menu_item_new_with_label(text)
|
GtkWidget *menuItem = checkable ? gtk_check_menu_item_new_with_label(text)
|
||||||
@@ -277,7 +277,7 @@ void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxStri
|
|||||||
mitem->SetText(text);
|
mitem->SetText(text);
|
||||||
|
|
||||||
GtkWidget *menuItem = gtk_menu_item_new_with_label(mitem->GetText());
|
GtkWidget *menuItem = gtk_menu_item_new_with_label(mitem->GetText());
|
||||||
mitem->SetHelpString(helpStr);
|
mitem->SetHelp(helpStr);
|
||||||
mitem->SetMenuItem(menuItem);
|
mitem->SetMenuItem(menuItem);
|
||||||
mitem->SetSubMenu(subMenu);
|
mitem->SetSubMenu(subMenu);
|
||||||
|
|
||||||
@@ -348,6 +348,26 @@ void wxMenu::SetLabel( int id, const wxString &label )
|
|||||||
item->SetText(label);
|
item->SetText(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxString wxMenu::GetLabel( int id ) const
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItem(id);
|
||||||
|
if (item) return item->GetText();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::SetHelpString( int id, const wxString& helpString )
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItem(id);
|
||||||
|
if (item) item->SetHelp( helpString );
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxMenu::GetHelpString( int id ) const
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItem(id);
|
||||||
|
if (item) return item->GetHelp();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
|
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
|
||||||
{
|
{
|
||||||
wxNode *node = m_items.First();
|
wxNode *node = m_items.First();
|
||||||
|
@@ -1393,6 +1393,31 @@ void wxWindow::Enable( bool enable )
|
|||||||
if (m_wxwindow) gtk_widget_set_sensitive( m_wxwindow, enable );
|
if (m_wxwindow) gtk_widget_set_sensitive( m_wxwindow, enable );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wxWindow::GetCharHeight(void) const
|
||||||
|
{
|
||||||
|
GdkFont *font = m_font.GetInternalFont( 1.0 );
|
||||||
|
return font->ascent + font->descent;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxWindow::GetCharWidth(void) const
|
||||||
|
{
|
||||||
|
GdkFont *font = m_font.GetInternalFont( 1.0 );
|
||||||
|
return gdk_string_width( font, "H" );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxWindow::GetTextExtent( const wxString& string, int *x, int *y,
|
||||||
|
int *descent, int *externalLeading, const wxFont *theFont, bool WXUNUSED(use16) ) const
|
||||||
|
{
|
||||||
|
wxFont fontToUse = m_font;
|
||||||
|
if (theFont) fontToUse = *theFont;
|
||||||
|
|
||||||
|
GdkFont *font = fontToUse.GetInternalFont( 1.0 );
|
||||||
|
if (x) (*y) = gdk_string_width( font, string );
|
||||||
|
if (y) (*y) = font->ascent + font->descent;
|
||||||
|
if (descent) (*descent) = font->descent;
|
||||||
|
if (externalLeading) (*externalLeading) = 0; // ??
|
||||||
|
}
|
||||||
|
|
||||||
void wxWindow::MakeModal( bool modal )
|
void wxWindow::MakeModal( bool modal )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -1516,11 +1541,6 @@ int wxWindow::GetReturnCode(void)
|
|||||||
return m_retCode;
|
return m_retCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindow *wxWindow::GetParent(void)
|
|
||||||
{
|
|
||||||
return m_parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxWindow::Raise(void)
|
void wxWindow::Raise(void)
|
||||||
{
|
{
|
||||||
if (m_widget) gdk_window_raise( m_widget->window );
|
if (m_widget) gdk_window_raise( m_widget->window );
|
||||||
|
@@ -552,22 +552,25 @@ void wxPaintDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(us
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool wxPaintDC::CanGetTextExtent(void) const
|
bool wxPaintDC::CanGetTextExtent(void) const
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height,
|
void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height,
|
||||||
long *WXUNUSED(descent), long *WXUNUSED(externalLeading),
|
long *descent, long *externalLeading,
|
||||||
wxFont *WXUNUSED(theFont), bool WXUNUSED(use16) )
|
wxFont *theFont, bool WXUNUSED(use16) )
|
||||||
{
|
{
|
||||||
if (!Ok()) return;
|
if (!Ok()) return;
|
||||||
|
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
wxFont fontToUse = m_font;
|
||||||
|
if (theFont) fontToUse = *theFont;
|
||||||
|
|
||||||
|
GdkFont *font = fontToUse.GetInternalFont( m_scaleY );
|
||||||
if (width) (*width) = long(gdk_string_width( font, string ) / m_scaleX);
|
if (width) (*width) = long(gdk_string_width( font, string ) / m_scaleX);
|
||||||
if (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
|
if (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
|
||||||
|
if (descent) (*descent) = long(font->descent / m_scaleY);
|
||||||
|
if (externalLeading) (*externalLeading) = 0; // ??
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxPaintDC::GetCharWidth(void)
|
long wxPaintDC::GetCharWidth(void)
|
||||||
@@ -575,7 +578,7 @@ long wxPaintDC::GetCharWidth(void)
|
|||||||
if (!Ok()) return 0;
|
if (!Ok()) return 0;
|
||||||
|
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||||
return gdk_string_width( font, "H" );
|
return long(gdk_string_width( font, "H" ) / m_scaleX);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxPaintDC::GetCharHeight(void)
|
long wxPaintDC::GetCharHeight(void)
|
||||||
@@ -583,7 +586,7 @@ long wxPaintDC::GetCharHeight(void)
|
|||||||
if (!Ok()) return 0;
|
if (!Ok()) return 0;
|
||||||
|
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||||
return font->ascent + font->descent;
|
return long((font->ascent + font->descent) / m_scaleY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPaintDC::Clear(void)
|
void wxPaintDC::Clear(void)
|
||||||
|
@@ -36,7 +36,7 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED
|
|||||||
win->Close();
|
win->Close();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxDialog
|
// wxDialog
|
||||||
@@ -56,7 +56,7 @@ wxDialog::wxDialog(void)
|
|||||||
m_title = "";
|
m_title = "";
|
||||||
m_modalShowing = FALSE;
|
m_modalShowing = FALSE;
|
||||||
wxTopLevelWindows.Insert( this );
|
wxTopLevelWindows.Insert( this );
|
||||||
};
|
}
|
||||||
|
|
||||||
wxDialog::wxDialog( wxWindow *parent,
|
wxDialog::wxDialog( wxWindow *parent,
|
||||||
wxWindowID id, const wxString &title,
|
wxWindowID id, const wxString &title,
|
||||||
@@ -66,7 +66,7 @@ wxDialog::wxDialog( wxWindow *parent,
|
|||||||
m_modalShowing = FALSE;
|
m_modalShowing = FALSE;
|
||||||
wxTopLevelWindows.Insert( this );
|
wxTopLevelWindows.Insert( this );
|
||||||
Create( parent, id, title, pos, size, style, name );
|
Create( parent, id, title, pos, size, style, name );
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxDialog::Create( wxWindow *parent,
|
bool wxDialog::Create( wxWindow *parent,
|
||||||
wxWindowID id, const wxString &title,
|
wxWindowID id, const wxString &title,
|
||||||
@@ -101,30 +101,30 @@ bool wxDialog::Create( wxWindow *parent,
|
|||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
}
|
||||||
|
|
||||||
wxDialog::~wxDialog(void)
|
wxDialog::~wxDialog(void)
|
||||||
{
|
{
|
||||||
wxTopLevelWindows.DeleteObject( this );
|
wxTopLevelWindows.DeleteObject( this );
|
||||||
if (wxTopLevelWindows.Number() == 0) wxTheApp->ExitMainLoop();
|
if (wxTopLevelWindows.Number() == 0) wxTheApp->ExitMainLoop();
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::SetTitle(const wxString& title )
|
void wxDialog::SetTitle(const wxString& title )
|
||||||
{
|
{
|
||||||
m_title = title;
|
m_title = title;
|
||||||
if (m_title.IsNull()) m_title = "";
|
if (m_title.IsNull()) m_title = "";
|
||||||
gtk_window_set_title( GTK_WINDOW(m_widget), m_title );
|
gtk_window_set_title( GTK_WINDOW(m_widget), m_title );
|
||||||
};
|
}
|
||||||
|
|
||||||
wxString wxDialog::GetTitle(void) const
|
wxString wxDialog::GetTitle(void) const
|
||||||
{
|
{
|
||||||
return (wxString&)m_title;
|
return (wxString&)m_title;
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::OnApply( wxCommandEvent &WXUNUSED(event) )
|
void wxDialog::OnApply( wxCommandEvent &WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
if (Validate()) TransferDataFromWindow();
|
if (Validate()) TransferDataFromWindow();
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
|
void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
@@ -136,8 +136,8 @@ void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
|
|||||||
{
|
{
|
||||||
SetReturnCode(wxID_CANCEL);
|
SetReturnCode(wxID_CANCEL);
|
||||||
this->Show(FALSE);
|
this->Show(FALSE);
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
|
void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
@@ -151,14 +151,14 @@ void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
|
|||||||
{
|
{
|
||||||
SetReturnCode(wxID_OK);
|
SetReturnCode(wxID_OK);
|
||||||
this->Show(FALSE);
|
this->Show(FALSE);
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
void wxDialog::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
// yes
|
// yes
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxDialog::OnClose(void)
|
bool wxDialog::OnClose(void)
|
||||||
{
|
{
|
||||||
@@ -189,8 +189,8 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
|||||||
if (GetEventHandler()->OnClose() || event.GetForce())
|
if (GetEventHandler()->OnClose() || event.GetForce())
|
||||||
{
|
{
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::ImplementSetPosition(void)
|
void wxDialog::ImplementSetPosition(void)
|
||||||
{
|
{
|
||||||
@@ -210,14 +210,22 @@ bool wxDialog::Show( bool show )
|
|||||||
if (!show && IsModal() && m_modalShowing)
|
if (!show && IsModal() && m_modalShowing)
|
||||||
{
|
{
|
||||||
EndModal( wxID_CANCEL );
|
EndModal( wxID_CANCEL );
|
||||||
};
|
}
|
||||||
|
|
||||||
wxWindow::Show( show );
|
wxWindow::Show( show );
|
||||||
|
|
||||||
if (show) InitDialog();
|
if (show) InitDialog();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
void wxDialog::SetModal(bool flag)
|
||||||
|
{
|
||||||
|
if (flag)
|
||||||
|
m_windowStyle |= wxDIALOG_MODAL;
|
||||||
|
else
|
||||||
|
if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL;
|
||||||
|
}
|
||||||
|
|
||||||
int wxDialog::ShowModal(void)
|
int wxDialog::ShowModal(void)
|
||||||
{
|
{
|
||||||
@@ -232,7 +240,7 @@ int wxDialog::ShowModal(void)
|
|||||||
gtk_grab_remove( m_widget );
|
gtk_grab_remove( m_widget );
|
||||||
|
|
||||||
return GetReturnCode();
|
return GetReturnCode();
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::EndModal( int retCode )
|
void wxDialog::EndModal( int retCode )
|
||||||
{
|
{
|
||||||
@@ -242,15 +250,34 @@ void wxDialog::EndModal( int retCode )
|
|||||||
{
|
{
|
||||||
wxFAIL_MSG( "wxDialog: called EndModal twice" );
|
wxFAIL_MSG( "wxDialog: called EndModal twice" );
|
||||||
return;
|
return;
|
||||||
};
|
}
|
||||||
|
|
||||||
m_modalShowing = FALSE;
|
m_modalShowing = FALSE;
|
||||||
|
|
||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxDialog::InitDialog(void)
|
void wxDialog::InitDialog(void)
|
||||||
{
|
{
|
||||||
wxWindow::InitDialog();
|
wxWindow::InitDialog();
|
||||||
};
|
}
|
||||||
|
|
||||||
|
void wxDialog::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) )
|
||||||
|
{
|
||||||
|
gdk_window_set_hints( m_widget->window, -1, -1,
|
||||||
|
minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDialog::SetIcon( const wxIcon &icon )
|
||||||
|
{
|
||||||
|
m_icon = icon;
|
||||||
|
if (!icon.Ok()) return;
|
||||||
|
|
||||||
|
wxMask *mask = icon.GetMask();
|
||||||
|
GdkBitmap *bm = NULL;
|
||||||
|
if (mask) bm = mask->GetBitmap();
|
||||||
|
|
||||||
|
gdk_window_set_icon( m_widget->window, NULL, icon.GetPixmap(), bm );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -255,7 +255,7 @@ static GdkFont *wxLoadQueryNearestFont(int point_size, int fontid,
|
|||||||
int style, int weight,
|
int style, int weight,
|
||||||
bool underlined);
|
bool underlined);
|
||||||
|
|
||||||
GdkFont *wxFont::GetInternalFont(float scale)
|
GdkFont *wxFont::GetInternalFont(float scale) const
|
||||||
{
|
{
|
||||||
if (M_FONTDATA->m_byXFontName) return M_FONTDATA->m_font;
|
if (M_FONTDATA->m_byXFontName) return M_FONTDATA->m_font;
|
||||||
|
|
||||||
|
@@ -515,8 +515,7 @@ void wxFrame::SetTitle( const wxString &title )
|
|||||||
|
|
||||||
void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) )
|
void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) )
|
||||||
{
|
{
|
||||||
if (m_wxwindow)
|
gdk_window_set_hints( m_widget->window, -1, -1,
|
||||||
gdk_window_set_hints( m_wxwindow->window, -1, -1,
|
|
||||||
minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
|
minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -254,7 +254,7 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
|
|||||||
wxMenuItem *mitem = new wxMenuItem();
|
wxMenuItem *mitem = new wxMenuItem();
|
||||||
mitem->SetId(id);
|
mitem->SetId(id);
|
||||||
mitem->SetText(item);
|
mitem->SetText(item);
|
||||||
mitem->SetHelpString(helpStr);
|
mitem->SetHelp(helpStr);
|
||||||
mitem->SetCheckable(checkable);
|
mitem->SetCheckable(checkable);
|
||||||
const char *text = mitem->GetText();
|
const char *text = mitem->GetText();
|
||||||
GtkWidget *menuItem = checkable ? gtk_check_menu_item_new_with_label(text)
|
GtkWidget *menuItem = checkable ? gtk_check_menu_item_new_with_label(text)
|
||||||
@@ -277,7 +277,7 @@ void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxStri
|
|||||||
mitem->SetText(text);
|
mitem->SetText(text);
|
||||||
|
|
||||||
GtkWidget *menuItem = gtk_menu_item_new_with_label(mitem->GetText());
|
GtkWidget *menuItem = gtk_menu_item_new_with_label(mitem->GetText());
|
||||||
mitem->SetHelpString(helpStr);
|
mitem->SetHelp(helpStr);
|
||||||
mitem->SetMenuItem(menuItem);
|
mitem->SetMenuItem(menuItem);
|
||||||
mitem->SetSubMenu(subMenu);
|
mitem->SetSubMenu(subMenu);
|
||||||
|
|
||||||
@@ -348,6 +348,26 @@ void wxMenu::SetLabel( int id, const wxString &label )
|
|||||||
item->SetText(label);
|
item->SetText(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxString wxMenu::GetLabel( int id ) const
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItem(id);
|
||||||
|
if (item) return item->GetText();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::SetHelpString( int id, const wxString& helpString )
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItem(id);
|
||||||
|
if (item) item->SetHelp( helpString );
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxMenu::GetHelpString( int id ) const
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItem(id);
|
||||||
|
if (item) return item->GetHelp();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
|
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
|
||||||
{
|
{
|
||||||
wxNode *node = m_items.First();
|
wxNode *node = m_items.First();
|
||||||
|
@@ -1393,6 +1393,31 @@ void wxWindow::Enable( bool enable )
|
|||||||
if (m_wxwindow) gtk_widget_set_sensitive( m_wxwindow, enable );
|
if (m_wxwindow) gtk_widget_set_sensitive( m_wxwindow, enable );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wxWindow::GetCharHeight(void) const
|
||||||
|
{
|
||||||
|
GdkFont *font = m_font.GetInternalFont( 1.0 );
|
||||||
|
return font->ascent + font->descent;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxWindow::GetCharWidth(void) const
|
||||||
|
{
|
||||||
|
GdkFont *font = m_font.GetInternalFont( 1.0 );
|
||||||
|
return gdk_string_width( font, "H" );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxWindow::GetTextExtent( const wxString& string, int *x, int *y,
|
||||||
|
int *descent, int *externalLeading, const wxFont *theFont, bool WXUNUSED(use16) ) const
|
||||||
|
{
|
||||||
|
wxFont fontToUse = m_font;
|
||||||
|
if (theFont) fontToUse = *theFont;
|
||||||
|
|
||||||
|
GdkFont *font = fontToUse.GetInternalFont( 1.0 );
|
||||||
|
if (x) (*y) = gdk_string_width( font, string );
|
||||||
|
if (y) (*y) = font->ascent + font->descent;
|
||||||
|
if (descent) (*descent) = font->descent;
|
||||||
|
if (externalLeading) (*externalLeading) = 0; // ??
|
||||||
|
}
|
||||||
|
|
||||||
void wxWindow::MakeModal( bool modal )
|
void wxWindow::MakeModal( bool modal )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -1516,11 +1541,6 @@ int wxWindow::GetReturnCode(void)
|
|||||||
return m_retCode;
|
return m_retCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindow *wxWindow::GetParent(void)
|
|
||||||
{
|
|
||||||
return m_parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxWindow::Raise(void)
|
void wxWindow::Raise(void)
|
||||||
{
|
{
|
||||||
if (m_widget) gdk_window_raise( m_widget->window );
|
if (m_widget) gdk_window_raise( m_widget->window );
|
||||||
|
Reference in New Issue
Block a user