mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-22 06:05:36 +08:00
Header changes (gtk.h etc no longer included in defs.h
but in *.cpp to speed up compilation (?) ) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
+66
-44
@@ -16,15 +16,6 @@
|
||||
#pragma interface "defs.h"
|
||||
#endif
|
||||
|
||||
#ifdef __WXGTK__
|
||||
|
||||
#include "glib.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "wx/setup.h"
|
||||
@@ -664,7 +655,8 @@ enum {
|
||||
|
||||
|
||||
// Logical ops
|
||||
typedef enum {
|
||||
typedef enum
|
||||
{
|
||||
wxCLEAR, // 0
|
||||
wxXOR, // src XOR dst
|
||||
wxINVERT, // NOT dst
|
||||
@@ -736,8 +728,8 @@ typedef enum {
|
||||
#define wxSIZE_NO_ADJUSTMENTS 0x0008
|
||||
|
||||
|
||||
// Data format for drag & drop and clipboard operations
|
||||
// numbers as per winuser.h
|
||||
/* Data format for drag & drop and clipboard operations
|
||||
* numbers as per winuser.h */
|
||||
|
||||
enum wxDataFormat
|
||||
{
|
||||
@@ -750,9 +742,10 @@ enum wxDataFormat
|
||||
wxDF_PRIVATE = 20
|
||||
};
|
||||
|
||||
// Virtual keycodes
|
||||
/* Virtual keycodes */
|
||||
|
||||
enum wxKeyCode {
|
||||
enum wxKeyCode
|
||||
{
|
||||
WXK_BACK = 8,
|
||||
WXK_TAB = 9,
|
||||
WXK_RETURN = 13,
|
||||
@@ -771,8 +764,8 @@ enum wxKeyCode {
|
||||
WXK_MENU,
|
||||
WXK_PAUSE,
|
||||
WXK_CAPITAL,
|
||||
WXK_PRIOR, // Page up
|
||||
WXK_NEXT, // Page down
|
||||
WXK_PRIOR, /* Page up */
|
||||
WXK_NEXT, /* Page down */
|
||||
WXK_END,
|
||||
WXK_HOME,
|
||||
WXK_LEFT,
|
||||
@@ -831,37 +824,36 @@ enum wxKeyCode {
|
||||
WXK_PAGEDOWN
|
||||
};
|
||||
|
||||
// Colours - see wx_gdi.cc for database
|
||||
|
||||
// OS mnemonics -- Identify the running OS (useful for Windows)
|
||||
// [Not all platforms are currently available or supported]
|
||||
enum {
|
||||
/* OS mnemonics -- Identify the running OS (useful for Windows)
|
||||
* [Not all platforms are currently available or supported] */
|
||||
enum
|
||||
{
|
||||
wxUNKNOWN_PLATFORM,
|
||||
wxCURSES, // Text-only CURSES
|
||||
wxXVIEW_X, // Sun's XView OpenLOOK toolkit
|
||||
wxMOTIF_X, // OSF Motif 1.x.x
|
||||
wxCOSE_X, // OSF Common Desktop Environment
|
||||
wxNEXTSTEP, // NeXTStep
|
||||
wxMACINTOSH, // Apple System 7
|
||||
wxGTK, // GTK
|
||||
wxQT, // Qt
|
||||
wxGEOS, // GEOS
|
||||
wxOS2_PM, // OS/2 Workplace
|
||||
wxWINDOWS, // Windows or WfW
|
||||
wxPENWINDOWS, // Windows for Pen Computing
|
||||
wxWINDOWS_NT, // Windows NT
|
||||
wxWIN32S, // Windows 32S API
|
||||
wxWIN95, // Windows 95
|
||||
wxWIN386 // Watcom 32-bit supervisor modus
|
||||
wxCURSES, /* Text-only CURSES */
|
||||
wxXVIEW_X, /* Sun's XView OpenLOOK toolkit */
|
||||
wxMOTIF_X, /* OSF Motif 1.x.x */
|
||||
wxCOSE_X, /* OSF Common Desktop Environment */
|
||||
wxNEXTSTEP, /* NeXTStep */
|
||||
wxMACINTOSH, /* Apple System 7 */
|
||||
wxGTK, /* GTK */
|
||||
wxQT, /* Qt */
|
||||
wxGEOS, /* GEOS */
|
||||
wxOS2_PM, /* OS/2 Workplace */
|
||||
wxWINDOWS, /* Windows or WfW */
|
||||
wxPENWINDOWS, /* Windows for Pen Computing */
|
||||
wxWINDOWS_NT, /* Windows NT */
|
||||
wxWIN32S, /* Windows 32S API */
|
||||
wxWIN95, /* Windows 95 */
|
||||
wxWIN386 /* Watcom 32-bit supervisor modus */
|
||||
};
|
||||
|
||||
// Printing
|
||||
/* Printing */
|
||||
#ifndef wxPORTRAIT
|
||||
#define wxPORTRAIT 1
|
||||
#define wxLANDSCAPE 2
|
||||
#endif
|
||||
|
||||
// Standard menu identifiers
|
||||
/* Standard menu identifiers */
|
||||
#define wxID_OPEN 5000
|
||||
#define wxID_CLOSE 5001
|
||||
#define wxID_NEW 5002
|
||||
@@ -908,13 +900,12 @@ enum {
|
||||
|
||||
#define wxID_HIGHEST 5999
|
||||
|
||||
// Shortcut for easier dialog-unit-to-pixel conversion
|
||||
/* Shortcut for easier dialog-unit-to-pixel conversion */
|
||||
#define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// Stand-ins for Windows types, to avoid
|
||||
// #including all of windows.h
|
||||
|
||||
/* Stand-ins for Windows types, to avoid
|
||||
* #including all of windows.h */
|
||||
typedef unsigned long WXHWND;
|
||||
typedef unsigned long WXHANDLE;
|
||||
typedef unsigned long WXHICON;
|
||||
@@ -956,7 +947,7 @@ typedef int (*WXFARPROC)();
|
||||
#endif
|
||||
|
||||
#ifdef __WXMOTIF__
|
||||
// Stand-ins for X/Xt/Motif types
|
||||
/* Stand-ins for X/Xt/Motif types */
|
||||
typedef void* WXWindow;
|
||||
typedef void* WXWidget;
|
||||
typedef void* WXAppContext;
|
||||
@@ -974,5 +965,36 @@ typedef void* WXCursor;
|
||||
typedef void* WXFontList;
|
||||
#endif
|
||||
|
||||
#ifdef __WXGTK__
|
||||
/* Stand-ins for GLIB types */
|
||||
typedef int gint;
|
||||
typedef unsigned guint;
|
||||
typedef unsigned long gulong;
|
||||
typedef void* gpointer;
|
||||
|
||||
/* Stand-ins for GDK types */
|
||||
typedef gulong GdkAtom;
|
||||
typedef struct _GdkColor GdkColor;
|
||||
typedef struct _GdkColormap GdkColormap;
|
||||
typedef struct _GdkFont GdkFont;
|
||||
typedef struct _GdkGC GdkGC;
|
||||
typedef struct _GdkWindow GdkWindow;
|
||||
typedef struct _GdkWindow GdkBitmap;
|
||||
typedef struct _GdkWindow GdkPixmap;
|
||||
typedef struct _GdkCursor GdkCursor;
|
||||
typedef struct _GdkRegion GdkRegion;
|
||||
|
||||
/* Stand-ins for GTK types */
|
||||
typedef struct _GtkWidget GtkWidget;
|
||||
typedef struct _GtkStyle GtkStyle;
|
||||
typedef struct _GtkAdjustment GtkAdjustment;
|
||||
typedef struct _GtkList GtkList;
|
||||
typedef struct _GtkToolbar GtkToolbar;
|
||||
typedef struct _GtkNotebook GtkNotebook;
|
||||
typedef struct _GtkNotebookPage GtkNotebookPage;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
// _WX_DEFS_H_
|
||||
|
||||
@@ -37,7 +37,7 @@ class wxFileDialog: public wxDialog
|
||||
|
||||
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = "", const wxString& defaultFile = "",
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
inline void SetMessage(const wxString& message) { m_message = message; }
|
||||
|
||||
@@ -143,8 +143,8 @@ class wxToolBar: public wxControl
|
||||
int m_separation;
|
||||
wxList m_tools;
|
||||
|
||||
GdkColor m_fg;
|
||||
GdkColor m_bg;
|
||||
GdkColor *m_fg;
|
||||
GdkColor *m_bg;
|
||||
int m_xMargin;
|
||||
int m_yMargin;
|
||||
bool m_hasToolAlready;
|
||||
|
||||
@@ -37,7 +37,7 @@ class wxFileDialog: public wxDialog
|
||||
|
||||
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = "", const wxString& defaultFile = "",
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
inline void SetMessage(const wxString& message) { m_message = message; }
|
||||
|
||||
@@ -143,8 +143,8 @@ class wxToolBar: public wxControl
|
||||
int m_separation;
|
||||
wxList m_tools;
|
||||
|
||||
GdkColor m_fg;
|
||||
GdkColor m_bg;
|
||||
GdkColor *m_fg;
|
||||
GdkColor *m_bg;
|
||||
int m_xMargin;
|
||||
int m_yMargin;
|
||||
bool m_hasToolAlready;
|
||||
|
||||
+2
-3
@@ -96,12 +96,11 @@ EXTRA_LINK = @EXTRA_LINK@
|
||||
# INCLUDES
|
||||
WX_INCLUDES = \
|
||||
$(TOOLKIT_DEF) \
|
||||
-I. \
|
||||
-I.. \
|
||||
-I$(WXBASEDIR)/include \
|
||||
-I. \
|
||||
$(GUI_TK_INCLUDE) \
|
||||
-I$(WXBASEDIR)/src/zlib \
|
||||
-I$(WXBASEDIR)/src/iodbc \
|
||||
$(GUI_TK_INCLUDE) \
|
||||
$(OPENGL_INCLUDE) \
|
||||
$(X_CFLAGS)
|
||||
|
||||
|
||||
@@ -25,11 +25,6 @@
|
||||
#include "../png/png.h"
|
||||
#include "wx/filefn.h"
|
||||
|
||||
#ifdef __WXGTK__
|
||||
#include "gdk/gdkprivate.h"
|
||||
#include "gdk/gdkx.h"
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxImage
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -1247,6 +1242,10 @@ wxImage::wxImage( const wxBitmap &bitmap )
|
||||
|
||||
#ifdef __WXGTK__
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gdk/gdkx.h"
|
||||
|
||||
wxBitmap wxImage::ConvertToBitmap() const
|
||||
{
|
||||
wxBitmap bitmap;
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
|
||||
#include "unistd.h"
|
||||
|
||||
#include "glib.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+3
-1
@@ -14,9 +14,11 @@
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/image.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gdk/gdkprivate.h"
|
||||
#include "gdk/gdkx.h"
|
||||
#include "wx/image.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMask
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
|
||||
#include "wx/bmpbuttn.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#include "wx/brush.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxBrush
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
|
||||
#include "wx/button.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
|
||||
#include "wx/checkbox.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
|
||||
#include "wx/checklst.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxCheckListBox
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
|
||||
#include "wx/choice.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
|
||||
#include "wx/clipbrd.h"
|
||||
|
||||
#include "glib.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gdk/gdkprivate.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
#include "wx/combobox.h"
|
||||
#include <wx/intl.h>
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "wx/cursor.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxCursor
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+23
-625
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,9 @@
|
||||
|
||||
#include "wx/dc.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include "wx/image.h"
|
||||
#include <math.h>
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// local data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
|
||||
#include "wx/dcmemory.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMemoryDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
#include "wx/image.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// start and end of document/page
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
#include "wx/dcscreen.h"
|
||||
#include "wx/window.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data initialization
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/app.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include "wx/intl.h"
|
||||
#include "wx/utils.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
#include "gdk/gdkprivate.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
+95
-90
@@ -16,151 +16,156 @@
|
||||
#include "wx/intl.h"
|
||||
#include "wx/generic/msgdlgg.h"
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxFileDialog
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void gtk_filedialog_ok_callback( GtkWidget *WXUNUSED(widget), gpointer data )
|
||||
{
|
||||
wxFileDialog *dialog = (wxFileDialog*)data;
|
||||
wxCommandEvent event(wxEVT_NULL);
|
||||
int style;
|
||||
wxFileDialog *dialog = (wxFileDialog*)data;
|
||||
wxCommandEvent event(wxEVT_NULL);
|
||||
int style;
|
||||
|
||||
style=dialog->GetStyle();
|
||||
style = dialog->GetStyle();
|
||||
|
||||
if((style&wxSAVE)&&(style&wxOVERWRITE_PROMPT))
|
||||
if(wxFileExists(gtk_file_selection_get_filename(GTK_FILE_SELECTION(dialog->m_widget) ))) {
|
||||
if((style&wxSAVE)&&(style&wxOVERWRITE_PROMPT))
|
||||
{
|
||||
if(wxFileExists(gtk_file_selection_get_filename(GTK_FILE_SELECTION(dialog->m_widget) )))
|
||||
{
|
||||
if(wxMessageBox(_("File exists. Overwrite?"),
|
||||
_("Confirm"), wxYES_NO) != wxYES)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
dialog->OnOK( event );
|
||||
dialog->OnOK( event );
|
||||
}
|
||||
|
||||
void gtk_filedialog_cancel_callback( GtkWidget *WXUNUSED(widget), gpointer data )
|
||||
{
|
||||
wxFileDialog *dialog = (wxFileDialog*)data;
|
||||
wxCommandEvent event(wxEVT_NULL);
|
||||
dialog->OnCancel( event );
|
||||
wxFileDialog *dialog = (wxFileDialog*)data;
|
||||
wxCommandEvent event(wxEVT_NULL);
|
||||
dialog->OnCancel( event );
|
||||
}
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxFileDialog,wxDialog)
|
||||
|
||||
wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
||||
const wxString& defaultDir, const wxString& defaultFileName,
|
||||
const wxString& wildCard,
|
||||
long style, const wxPoint& pos )
|
||||
wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
|
||||
const wxString& defaultDir, const wxString& defaultFileName,
|
||||
const wxString& wildCard,
|
||||
long style, const wxPoint& pos )
|
||||
{
|
||||
m_needParent = FALSE;
|
||||
m_needParent = FALSE;
|
||||
|
||||
PreCreation( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, "filedialog" );
|
||||
m_message = message;
|
||||
m_path = "";
|
||||
m_fileName = defaultFileName;
|
||||
m_dir = defaultDir;
|
||||
m_wildCard = wildCard;
|
||||
m_dialogStyle = style;
|
||||
m_filterIndex = 1;
|
||||
PreCreation( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, "filedialog" );
|
||||
m_message = message;
|
||||
m_path = "";
|
||||
m_fileName = defaultFileName;
|
||||
m_dir = defaultDir;
|
||||
m_wildCard = wildCard;
|
||||
m_dialogStyle = style;
|
||||
m_filterIndex = 1;
|
||||
|
||||
m_widget = gtk_file_selection_new( m_message );
|
||||
m_widget = gtk_file_selection_new( m_message );
|
||||
|
||||
int x = (gdk_screen_width () - 400) / 2;
|
||||
int y = (gdk_screen_height () - 400) / 2;
|
||||
gtk_widget_set_uposition( m_widget, x, y );
|
||||
int x = (gdk_screen_width () - 400) / 2;
|
||||
int y = (gdk_screen_height () - 400) / 2;
|
||||
gtk_widget_set_uposition( m_widget, x, y );
|
||||
|
||||
GtkFileSelection *sel = GTK_FILE_SELECTION(m_widget);
|
||||
GtkFileSelection *sel = GTK_FILE_SELECTION(m_widget);
|
||||
|
||||
m_path.Append(m_dir);
|
||||
if(! m_path.IsEmpty() && m_path.Last()!='/') m_path.Append('/');
|
||||
m_path.Append(m_fileName);
|
||||
m_path.Append(m_dir);
|
||||
if(! m_path.IsEmpty() && m_path.Last()!='/') m_path.Append('/');
|
||||
m_path.Append(m_fileName);
|
||||
|
||||
if(m_path.Length()>1) gtk_file_selection_set_filename(sel,m_path);
|
||||
if(m_path.Length()>1) gtk_file_selection_set_filename(sel,m_path);
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(sel->ok_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(gtk_filedialog_ok_callback), (gpointer*)this );
|
||||
gtk_signal_connect( GTK_OBJECT(sel->ok_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(gtk_filedialog_ok_callback), (gpointer*)this );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
|
||||
gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
|
||||
}
|
||||
|
||||
int wxFileDialog::ShowModal(void)
|
||||
{
|
||||
int ret = wxDialog::ShowModal();
|
||||
int ret = wxDialog::ShowModal();
|
||||
|
||||
if (ret == wxID_OK)
|
||||
{
|
||||
m_fileName = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
|
||||
m_path = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
|
||||
}
|
||||
return ret;
|
||||
if (ret == wxID_OK)
|
||||
{
|
||||
m_fileName = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
|
||||
m_path = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
char *wxFileSelector(const char *title,
|
||||
const char *defaultDir, const char *defaultFileName,
|
||||
const char *defaultExtension, const char *filter, int flags,
|
||||
wxWindow *parent, int x, int y)
|
||||
char *wxFileSelector( const char *title,
|
||||
const char *defaultDir, const char *defaultFileName,
|
||||
const char *defaultExtension, const char *filter, int flags,
|
||||
wxWindow *parent, int x, int y )
|
||||
{
|
||||
wxString filter2("");
|
||||
if ( defaultExtension && !filter )
|
||||
filter2 = wxString("*.") + wxString(defaultExtension) ;
|
||||
else if ( filter )
|
||||
filter2 = filter;
|
||||
wxString filter2("");
|
||||
if ( defaultExtension && !filter )
|
||||
filter2 = wxString("*.") + wxString(defaultExtension) ;
|
||||
else if ( filter )
|
||||
filter2 = filter;
|
||||
|
||||
wxString defaultDirString;
|
||||
if (defaultDir)
|
||||
defaultDirString = defaultDir;
|
||||
else
|
||||
defaultDirString = "";
|
||||
wxString defaultDirString;
|
||||
if (defaultDir)
|
||||
defaultDirString = defaultDir;
|
||||
else
|
||||
defaultDirString = "";
|
||||
|
||||
wxString defaultFilenameString;
|
||||
if (defaultFileName)
|
||||
defaultFilenameString = defaultFileName;
|
||||
else
|
||||
defaultFilenameString = "";
|
||||
wxString defaultFilenameString;
|
||||
if (defaultFileName)
|
||||
defaultFilenameString = defaultFileName;
|
||||
else
|
||||
defaultFilenameString = "";
|
||||
|
||||
wxFileDialog fileDialog( parent, title, defaultDirString, defaultFilenameString, filter2, flags, wxPoint(x, y) );
|
||||
|
||||
wxFileDialog fileDialog(parent, title, defaultDirString, defaultFilenameString,
|
||||
filter2, flags, wxPoint(x, y));
|
||||
|
||||
if ( fileDialog.ShowModal() == wxID_OK )
|
||||
{
|
||||
strcpy(wxBuffer, (const char *)fileDialog.GetPath());
|
||||
return wxBuffer;
|
||||
}
|
||||
else
|
||||
return (char *) NULL;
|
||||
if ( fileDialog.ShowModal() == wxID_OK )
|
||||
{
|
||||
strcpy(wxBuffer, (const char *)fileDialog.GetPath());
|
||||
return wxBuffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (char *) NULL;
|
||||
}
|
||||
}
|
||||
|
||||
char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name,
|
||||
wxWindow *parent )
|
||||
char* wxLoadFileSelector( const char *what, const char *extension, const char *default_name, wxWindow *parent )
|
||||
{
|
||||
char *ext = (char *)extension;
|
||||
char *ext = (char *)extension;
|
||||
|
||||
char prompt[50];
|
||||
wxString str = _("Load %s file");
|
||||
sprintf(prompt, str, what);
|
||||
char prompt[50];
|
||||
wxString str = _("Load %s file");
|
||||
sprintf(prompt, str, what);
|
||||
|
||||
if (*ext == '.') ext++;
|
||||
char wild[60];
|
||||
sprintf(wild, "*.%s", ext);
|
||||
if (*ext == '.') ext++;
|
||||
char wild[60];
|
||||
sprintf(wild, "*.%s", ext);
|
||||
|
||||
return wxFileSelector (prompt, (const char *) NULL, default_name, ext, wild, 0, parent);
|
||||
return wxFileSelector (prompt, (const char *) NULL, default_name, ext, wild, 0, parent);
|
||||
}
|
||||
|
||||
char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
|
||||
wxWindow *parent )
|
||||
{
|
||||
char *ext = (char *)extension;
|
||||
char *ext = (char *)extension;
|
||||
|
||||
char prompt[50];
|
||||
wxString str = _("Save %s file");
|
||||
sprintf(prompt, str, what);
|
||||
char prompt[50];
|
||||
wxString str = _("Save %s file");
|
||||
sprintf(prompt, str, what);
|
||||
|
||||
if (*ext == '.') ext++;
|
||||
char wild[60];
|
||||
sprintf(wild, "*.%s", ext);
|
||||
if (*ext == '.') ext++;
|
||||
char wild[60];
|
||||
sprintf(wild, "*.%s", ext);
|
||||
|
||||
return wxFileSelector (prompt, (const char *) NULL, default_name, ext, wild, 0, parent);
|
||||
return wxFileSelector (prompt, (const char *) NULL, default_name, ext, wild, 0, parent);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "wx/log.h"
|
||||
#include <strings.h>
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// local data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
#include "wx/toolbar.h"
|
||||
#include "wx/statusbr.h"
|
||||
#include "wx/dcclient.h"
|
||||
|
||||
#include "glib.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#endif
|
||||
|
||||
#include "wx/gauge.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxGauge
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#include "wx/intl.h"
|
||||
#include "wx/checklst.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// conditional compilation
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
+137
-133
@@ -14,9 +14,13 @@
|
||||
#include "wx/mdi.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/menu.h"
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
#include <wx/intl.h>
|
||||
|
||||
#include "glib.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -35,16 +39,16 @@ extern wxList wxPendingDelete;
|
||||
|
||||
static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
|
||||
{
|
||||
if ((win->m_x == alloc->x) &&
|
||||
(win->m_y == alloc->y) &&
|
||||
(win->m_width == alloc->width) &&
|
||||
(win->m_height == alloc->height) &&
|
||||
(win->m_sizeSet))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ((win->m_x == alloc->x) &&
|
||||
(win->m_y == alloc->y) &&
|
||||
(win->m_width == alloc->width) &&
|
||||
(win->m_height == alloc->height) &&
|
||||
(win->m_sizeSet))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
|
||||
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -56,19 +60,19 @@ static void gtk_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
||||
gint WXUNUSED(nPage),
|
||||
wxMDIClientWindow *client_win )
|
||||
{
|
||||
wxNode *node = client_win->m_children.First();
|
||||
while (node)
|
||||
{
|
||||
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
||||
if (child_frame->m_page == page)
|
||||
wxNode *node = client_win->m_children.First();
|
||||
while (node)
|
||||
{
|
||||
wxMDIParentFrame *mdi_frame = (wxMDIParentFrame*)client_win->m_parent;
|
||||
mdi_frame->m_currentChild = child_frame;
|
||||
mdi_frame->SetMDIMenuBar( child_frame->m_menuBar );
|
||||
return;
|
||||
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
||||
if (child_frame->m_page == page)
|
||||
{
|
||||
wxMDIParentFrame *mdi_frame = (wxMDIParentFrame*)client_win->m_parent;
|
||||
mdi_frame->m_currentChild = child_frame;
|
||||
mdi_frame->SetMDIMenuBar( child_frame->m_menuBar );
|
||||
return;
|
||||
}
|
||||
node = node->Next();
|
||||
}
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -82,9 +86,9 @@ END_EVENT_TABLE()
|
||||
|
||||
wxMDIParentFrame::wxMDIParentFrame(void)
|
||||
{
|
||||
m_clientWindow = (wxMDIClientWindow *) NULL;
|
||||
m_currentChild = (wxMDIChildFrame *) NULL;
|
||||
m_parentFrameActive = TRUE;
|
||||
m_clientWindow = (wxMDIClientWindow *) NULL;
|
||||
m_currentChild = (wxMDIChildFrame *) NULL;
|
||||
m_parentFrameActive = TRUE;
|
||||
}
|
||||
|
||||
wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
|
||||
@@ -92,10 +96,10 @@ wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style, const wxString& name )
|
||||
{
|
||||
m_clientWindow = (wxMDIClientWindow *) NULL;
|
||||
m_currentChild = (wxMDIChildFrame *) NULL;
|
||||
m_parentFrameActive = TRUE;
|
||||
Create( parent, id, title, pos, size, style, name );
|
||||
m_clientWindow = (wxMDIClientWindow *) NULL;
|
||||
m_currentChild = (wxMDIChildFrame *) NULL;
|
||||
m_parentFrameActive = TRUE;
|
||||
Create( parent, id, title, pos, size, style, name );
|
||||
}
|
||||
|
||||
wxMDIParentFrame::~wxMDIParentFrame(void)
|
||||
@@ -107,75 +111,75 @@ bool wxMDIParentFrame::Create( wxWindow *parent,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style, const wxString& name )
|
||||
{
|
||||
wxFrame::Create( parent, id, title, pos, size, style, name );
|
||||
wxFrame::Create( parent, id, title, pos, size, style, name );
|
||||
|
||||
OnCreateClient();
|
||||
OnCreateClient();
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
|
||||
{
|
||||
wxFrame::GtkOnSize( x, y, width, height );
|
||||
wxFrame::GtkOnSize( x, y, width, height );
|
||||
|
||||
if (m_mdiMenuBar)
|
||||
{
|
||||
m_mdiMenuBar->m_x = 0;
|
||||
m_mdiMenuBar->m_y = 0;
|
||||
m_mdiMenuBar->m_width = m_width;
|
||||
m_mdiMenuBar->m_height = wxMENU_HEIGHT;
|
||||
gtk_myfixed_move( GTK_MYFIXED(m_wxwindow), m_mdiMenuBar->m_widget, 0, 0 );
|
||||
gtk_widget_set_usize( m_mdiMenuBar->m_widget, m_width, wxMENU_HEIGHT );
|
||||
}
|
||||
if (m_mdiMenuBar)
|
||||
{
|
||||
m_mdiMenuBar->m_x = 0;
|
||||
m_mdiMenuBar->m_y = 0;
|
||||
m_mdiMenuBar->m_width = m_width;
|
||||
m_mdiMenuBar->m_height = wxMENU_HEIGHT;
|
||||
gtk_myfixed_move( GTK_MYFIXED(m_wxwindow), m_mdiMenuBar->m_widget, 0, 0 );
|
||||
gtk_widget_set_usize( m_mdiMenuBar->m_widget, m_width, wxMENU_HEIGHT );
|
||||
}
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::SetMDIMenuBar( wxMenuBar *menu_bar )
|
||||
{
|
||||
if (m_mdiMenuBar) m_mdiMenuBar->Show( FALSE );
|
||||
m_mdiMenuBar = menu_bar;
|
||||
if (m_mdiMenuBar)
|
||||
{
|
||||
m_mdiMenuBar->m_x = 0;
|
||||
m_mdiMenuBar->m_y = 0;
|
||||
m_mdiMenuBar->m_width = m_width;
|
||||
m_mdiMenuBar->m_height = wxMENU_HEIGHT;
|
||||
gtk_myfixed_move( GTK_MYFIXED(m_wxwindow), m_mdiMenuBar->m_widget, 0, 0 );
|
||||
gtk_widget_set_usize( m_mdiMenuBar->m_widget, m_width, wxMENU_HEIGHT );
|
||||
m_mdiMenuBar->Show( TRUE );
|
||||
}
|
||||
if (m_mdiMenuBar) m_mdiMenuBar->Show( FALSE );
|
||||
m_mdiMenuBar = menu_bar;
|
||||
if (m_mdiMenuBar)
|
||||
{
|
||||
m_mdiMenuBar->m_x = 0;
|
||||
m_mdiMenuBar->m_y = 0;
|
||||
m_mdiMenuBar->m_width = m_width;
|
||||
m_mdiMenuBar->m_height = wxMENU_HEIGHT;
|
||||
gtk_myfixed_move( GTK_MYFIXED(m_wxwindow), m_mdiMenuBar->m_widget, 0, 0 );
|
||||
gtk_widget_set_usize( m_mdiMenuBar->m_widget, m_width, wxMENU_HEIGHT );
|
||||
m_mdiMenuBar->Show( TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
|
||||
{
|
||||
wxFrame::GetClientSize( width, height );
|
||||
wxFrame::GetClientSize( width, height );
|
||||
}
|
||||
|
||||
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const
|
||||
{
|
||||
return m_currentChild;
|
||||
return m_currentChild;
|
||||
}
|
||||
|
||||
wxMDIClientWindow *wxMDIParentFrame::GetClientWindow(void) const
|
||||
{
|
||||
return m_clientWindow;
|
||||
return m_clientWindow;
|
||||
}
|
||||
|
||||
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient(void)
|
||||
{
|
||||
m_clientWindow = new wxMDIClientWindow( this );
|
||||
return m_clientWindow;
|
||||
m_clientWindow = new wxMDIClientWindow( this );
|
||||
return m_clientWindow;
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::ActivateNext(void)
|
||||
{
|
||||
if (m_clientWindow)
|
||||
gtk_notebook_next_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
|
||||
if (m_clientWindow)
|
||||
gtk_notebook_next_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::ActivatePrevious(void)
|
||||
{
|
||||
if (m_clientWindow)
|
||||
gtk_notebook_prev_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
|
||||
if (m_clientWindow)
|
||||
gtk_notebook_prev_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::OnActivate( wxActivateEvent& WXUNUSED(event) )
|
||||
@@ -193,13 +197,13 @@ void wxMDIParentFrame::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(eve
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame,wxFrame)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxMDIChildFrame, wxFrame)
|
||||
EVT_ACTIVATE(wxMDIChildFrame::OnActivate)
|
||||
EVT_ACTIVATE(wxMDIChildFrame::OnActivate)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxMDIChildFrame::wxMDIChildFrame(void)
|
||||
{
|
||||
m_menuBar = (wxMenuBar *) NULL;
|
||||
m_page = (GtkNotebookPage *) NULL;
|
||||
m_menuBar = (wxMenuBar *) NULL;
|
||||
m_page = (GtkNotebookPage *) NULL;
|
||||
}
|
||||
|
||||
wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
|
||||
@@ -207,23 +211,23 @@ wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
|
||||
const wxPoint& WXUNUSED(pos), const wxSize& size,
|
||||
long style, const wxString& name )
|
||||
{
|
||||
m_menuBar = (wxMenuBar *) NULL;
|
||||
m_page = (GtkNotebookPage *) NULL;
|
||||
Create( parent, id, title, wxDefaultPosition, size, style, name );
|
||||
m_menuBar = (wxMenuBar *) NULL;
|
||||
m_page = (GtkNotebookPage *) NULL;
|
||||
Create( parent, id, title, wxDefaultPosition, size, style, name );
|
||||
}
|
||||
|
||||
wxMDIChildFrame::~wxMDIChildFrame(void)
|
||||
{
|
||||
if (m_menuBar)
|
||||
{
|
||||
wxMDIParentFrame *mdi_frame = (wxMDIParentFrame*)m_parent->m_parent;
|
||||
if (mdi_frame->m_currentChild == this)
|
||||
if (m_menuBar)
|
||||
{
|
||||
mdi_frame->SetMDIMenuBar( (wxMenuBar *) NULL );
|
||||
mdi_frame->m_currentChild = (wxMDIChildFrame *) NULL;
|
||||
wxMDIParentFrame *mdi_frame = (wxMDIParentFrame*)m_parent->m_parent;
|
||||
if (mdi_frame->m_currentChild == this)
|
||||
{
|
||||
mdi_frame->SetMDIMenuBar( (wxMenuBar *) NULL );
|
||||
mdi_frame->m_currentChild = (wxMDIChildFrame *) NULL;
|
||||
}
|
||||
delete m_menuBar;
|
||||
}
|
||||
delete m_menuBar;
|
||||
}
|
||||
}
|
||||
|
||||
bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
|
||||
@@ -231,64 +235,64 @@ bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
|
||||
const wxPoint& WXUNUSED(pos), const wxSize& size,
|
||||
long style, const wxString& name )
|
||||
{
|
||||
m_title = title;
|
||||
m_title = title;
|
||||
|
||||
return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
|
||||
return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
|
||||
}
|
||||
|
||||
void wxMDIChildFrame::GetClientSize( int *width, int *height ) const
|
||||
{
|
||||
wxWindow::GetClientSize( width, height );
|
||||
wxWindow::GetClientSize( width, height );
|
||||
}
|
||||
|
||||
void wxMDIChildFrame::AddChild( wxWindow *child )
|
||||
{
|
||||
wxWindow::AddChild( child );
|
||||
wxWindow::AddChild( child );
|
||||
}
|
||||
|
||||
static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
|
||||
{
|
||||
menu->SetInvokingWindow( win );
|
||||
wxNode *node = menu->m_items.First();
|
||||
while (node)
|
||||
{
|
||||
wxMenuItem *menuitem = (wxMenuItem*)node->Data();
|
||||
if (menuitem->IsSubMenu())
|
||||
SetInvokingWindow( menuitem->GetSubMenu(), win );
|
||||
node = node->Next();
|
||||
}
|
||||
menu->SetInvokingWindow( win );
|
||||
wxNode *node = menu->m_items.First();
|
||||
while (node)
|
||||
{
|
||||
wxMenuItem *menuitem = (wxMenuItem*)node->Data();
|
||||
if (menuitem->IsSubMenu())
|
||||
SetInvokingWindow( menuitem->GetSubMenu(), win );
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
|
||||
void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
|
||||
{
|
||||
m_menuBar = menu_bar;
|
||||
m_menuBar = menu_bar;
|
||||
|
||||
if (m_menuBar)
|
||||
{
|
||||
wxMDIParentFrame *mdi_frame = (wxMDIParentFrame*)m_parent->m_parent;
|
||||
|
||||
if (m_menuBar->m_parent != this)
|
||||
if (m_menuBar)
|
||||
{
|
||||
wxNode *node = m_menuBar->m_menus.First();
|
||||
while (node)
|
||||
{
|
||||
wxMenu *menu = (wxMenu*)node->Data();
|
||||
SetInvokingWindow( menu, this );
|
||||
node = node->Next();
|
||||
}
|
||||
wxMDIParentFrame *mdi_frame = (wxMDIParentFrame*)m_parent->m_parent;
|
||||
|
||||
m_menuBar->m_parent = mdi_frame;
|
||||
if (m_menuBar->m_parent != this)
|
||||
{
|
||||
wxNode *node = m_menuBar->m_menus.First();
|
||||
while (node)
|
||||
{
|
||||
wxMenu *menu = (wxMenu*)node->Data();
|
||||
SetInvokingWindow( menu, this );
|
||||
node = node->Next();
|
||||
}
|
||||
|
||||
m_menuBar->m_parent = mdi_frame;
|
||||
}
|
||||
mdi_frame->SetMDIMenuBar( m_menuBar );
|
||||
|
||||
gtk_myfixed_put( GTK_MYFIXED(mdi_frame->m_wxwindow),
|
||||
m_menuBar->m_widget, m_menuBar->m_x, m_menuBar->m_y );
|
||||
}
|
||||
mdi_frame->SetMDIMenuBar( m_menuBar );
|
||||
|
||||
gtk_myfixed_put( GTK_MYFIXED(mdi_frame->m_wxwindow),
|
||||
m_menuBar->m_widget, m_menuBar->m_x, m_menuBar->m_y );
|
||||
}
|
||||
}
|
||||
|
||||
wxMenuBar *wxMDIChildFrame::GetMenuBar()
|
||||
{
|
||||
return m_menuBar;
|
||||
return m_menuBar;
|
||||
}
|
||||
|
||||
void wxMDIChildFrame::Activate(void)
|
||||
@@ -305,24 +309,24 @@ void wxMDIChildFrame::OnActivate( wxActivateEvent &WXUNUSED(event) )
|
||||
|
||||
static void wxInsertChildInMDI( wxMDIClientWindow* parent, wxMDIChildFrame* child )
|
||||
{
|
||||
wxString s = child->m_title;
|
||||
if (s.IsNull()) s = _("MDI child");
|
||||
wxString s = child->m_title;
|
||||
if (s.IsNull()) s = _("MDI child");
|
||||
|
||||
GtkWidget *label_widget = gtk_label_new( s );
|
||||
gtk_misc_set_alignment( GTK_MISC(label_widget), 0.0, 0.5 );
|
||||
GtkWidget *label_widget = gtk_label_new( s );
|
||||
gtk_misc_set_alignment( GTK_MISC(label_widget), 0.0, 0.5 );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate",
|
||||
GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)child );
|
||||
gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate",
|
||||
GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)child );
|
||||
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK(parent->m_widget);
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK(parent->m_widget);
|
||||
|
||||
gtk_notebook_append_page( notebook, child->m_widget, label_widget );
|
||||
gtk_notebook_append_page( notebook, child->m_widget, label_widget );
|
||||
|
||||
child->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data);
|
||||
child->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data);
|
||||
|
||||
gtk_notebook_set_page( notebook, parent->m_children.Number()-1 );
|
||||
gtk_notebook_set_page( notebook, parent->m_children.Number()-1 );
|
||||
|
||||
gtk_page_change_callback( (GtkNotebook *) NULL, child->m_page, 0, parent );
|
||||
gtk_page_change_callback( (GtkNotebook *) NULL, child->m_page, 0, parent );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -337,7 +341,7 @@ wxMDIClientWindow::wxMDIClientWindow(void)
|
||||
|
||||
wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, long style )
|
||||
{
|
||||
CreateClient( parent, style );
|
||||
CreateClient( parent, style );
|
||||
}
|
||||
|
||||
wxMDIClientWindow::~wxMDIClientWindow(void)
|
||||
@@ -346,28 +350,28 @@ wxMDIClientWindow::~wxMDIClientWindow(void)
|
||||
|
||||
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
m_needParent = TRUE;
|
||||
|
||||
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
|
||||
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
|
||||
|
||||
PreCreation( parent, -1, wxPoint(10,10), wxSize(100,100), style, "wxMDIClientWindow" );
|
||||
PreCreation( parent, -1, wxPoint(10,10), wxSize(100,100), style, "wxMDIClientWindow" );
|
||||
|
||||
m_widget = gtk_notebook_new();
|
||||
m_widget = gtk_notebook_new();
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
|
||||
GTK_SIGNAL_FUNC(gtk_page_change_callback), (gpointer)this );
|
||||
gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
|
||||
GTK_SIGNAL_FUNC(gtk_page_change_callback), (gpointer)this );
|
||||
|
||||
gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 );
|
||||
gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 );
|
||||
|
||||
m_parent->AddChild( this );
|
||||
m_parent->AddChild( this );
|
||||
|
||||
(m_parent->m_insertCallback)( m_parent, this );
|
||||
(m_parent->m_insertCallback)( m_parent, this );
|
||||
|
||||
PostCreation();
|
||||
PostCreation();
|
||||
|
||||
Show( TRUE );
|
||||
Show( TRUE );
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+292
-252
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,10 @@
|
||||
#include "wx/minifram.h"
|
||||
#include "wx/dcscreen.h"
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "clicked"
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
#include "wx/imaglist.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "wx/palette.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPalette
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "wx/pen.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPen
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
#include "wx/radiobox.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/frame.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#endif
|
||||
|
||||
#include "wx/radiobut.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// data
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
|
||||
#include "wx/region.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxRegion
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include "wx/utils.h"
|
||||
#include <math.h>
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
#include "wx/settings.h"
|
||||
#include "wx/debug.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
/*
|
||||
#define wxSYS_COLOUR_SCROLLBAR 0
|
||||
#define wxSYS_COLOUR_BACKGROUND 1
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
#include "wx/utils.h"
|
||||
#include <math.h>
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+70
-62
@@ -16,6 +16,9 @@
|
||||
#include "wx/utils.h"
|
||||
#include <math.h>
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// data
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -28,31 +31,31 @@ extern bool g_blockEventsOnDrag;
|
||||
|
||||
static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *win )
|
||||
{
|
||||
if (!win->HasVMT()) return;
|
||||
if (g_blockEventsOnDrag) return;
|
||||
if (!win->HasVMT()) return;
|
||||
if (g_blockEventsOnDrag) return;
|
||||
|
||||
float diff = win->m_adjust->value - win->m_oldPos;
|
||||
if (fabs(diff) < 0.2) return;
|
||||
float diff = win->m_adjust->value - win->m_oldPos;
|
||||
if (fabs(diff) < 0.2) return;
|
||||
|
||||
wxEventType command = wxEVT_NULL;
|
||||
wxEventType command = wxEVT_NULL;
|
||||
|
||||
float line_step = win->m_adjust->step_increment;
|
||||
float page_step = win->m_adjust->page_increment;
|
||||
float line_step = win->m_adjust->step_increment;
|
||||
float page_step = win->m_adjust->page_increment;
|
||||
|
||||
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
||||
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
||||
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
||||
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
||||
else command = wxEVT_SCROLL_THUMBTRACK;
|
||||
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
|
||||
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
|
||||
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
|
||||
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
|
||||
else command = wxEVT_SCROLL_THUMBTRACK;
|
||||
|
||||
int value = (int)(win->m_adjust->value+0.5);
|
||||
int value = (int)(win->m_adjust->value+0.5);
|
||||
|
||||
wxSpinEvent event( command, win->GetId());
|
||||
event.SetPosition( value );
|
||||
event.SetOrientation( wxVERTICAL );
|
||||
event.SetEventObject( win );
|
||||
wxSpinEvent event( command, win->GetId());
|
||||
event.SetPosition( value );
|
||||
event.SetOrientation( wxVERTICAL );
|
||||
event.SetEventObject( win );
|
||||
|
||||
win->ProcessEvent( event );
|
||||
win->ProcessEvent( event );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -72,38 +75,40 @@ wxSpinButton::wxSpinButton()
|
||||
bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
|
||||
long style, const wxString& name)
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
m_needParent = TRUE;
|
||||
|
||||
wxSize new_size = size;
|
||||
new_size.x = 16;
|
||||
if (new_size.y == -1) new_size.y = 30;
|
||||
wxSize new_size = size;
|
||||
new_size.x = 16;
|
||||
if (new_size.y == -1) new_size.y = 30;
|
||||
|
||||
PreCreation( parent, id, pos, new_size, style, name );
|
||||
PreCreation( parent, id, pos, new_size, style, name );
|
||||
|
||||
// SetValidator( validator );
|
||||
|
||||
m_oldPos = 0.0;
|
||||
m_oldPos = 0.0;
|
||||
|
||||
m_adjust = (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 100.0, 1.0, 5.0, 0.0);
|
||||
m_adjust = (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 100.0, 1.0, 5.0, 0.0);
|
||||
|
||||
m_widget = gtk_spin_button_new( m_adjust, 0, 0 );
|
||||
m_widget = gtk_spin_button_new( m_adjust, 0, 0 );
|
||||
|
||||
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), (m_windowStyle & wxSP_WRAP) );
|
||||
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), (m_windowStyle & wxSP_WRAP) );
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (m_adjust), "value_changed",
|
||||
(GtkSignalFunc) gtk_spinbutt_callback, (gpointer) this );
|
||||
gtk_signal_connect( GTK_OBJECT (m_adjust),
|
||||
"value_changed",
|
||||
(GtkSignalFunc) gtk_spinbutt_callback,
|
||||
(gpointer) this );
|
||||
|
||||
m_parent->AddChild( this );
|
||||
m_parent->AddChild( this );
|
||||
|
||||
(m_parent->m_insertCallback)( m_parent, this );
|
||||
(m_parent->m_insertCallback)( m_parent, this );
|
||||
|
||||
PostCreation();
|
||||
PostCreation();
|
||||
|
||||
SetBackgroundColour( parent->GetBackgroundColour() );
|
||||
SetBackgroundColour( parent->GetBackgroundColour() );
|
||||
|
||||
Show( TRUE );
|
||||
Show( TRUE );
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxSpinButton::~wxSpinButton()
|
||||
@@ -112,71 +117,74 @@ wxSpinButton::~wxSpinButton()
|
||||
|
||||
int wxSpinButton::GetMin() const
|
||||
{
|
||||
wxCHECK_MSG( (m_widget != NULL), 0, "invalid spin button" );
|
||||
wxCHECK_MSG( (m_widget != NULL), 0, "invalid spin button" );
|
||||
|
||||
return (int)(m_adjust->lower+0.5);
|
||||
return (int)(m_adjust->lower+0.5);
|
||||
}
|
||||
|
||||
int wxSpinButton::GetMax() const
|
||||
{
|
||||
wxCHECK_MSG( (m_widget != NULL), 0, "invalid spin button" );
|
||||
wxCHECK_MSG( (m_widget != NULL), 0, "invalid spin button" );
|
||||
|
||||
return (int)(m_adjust->upper+0.5);
|
||||
return (int)(m_adjust->upper+0.5);
|
||||
}
|
||||
|
||||
int wxSpinButton::GetValue() const
|
||||
{
|
||||
wxCHECK_MSG( (m_widget != NULL), 0, "invalid spin button" );
|
||||
wxCHECK_MSG( (m_widget != NULL), 0, "invalid spin button" );
|
||||
|
||||
return (int)(m_adjust->value+0.5);
|
||||
return (int)(m_adjust->value+0.5);
|
||||
}
|
||||
|
||||
void wxSpinButton::SetValue( int value )
|
||||
{
|
||||
wxCHECK_RET( (m_widget != NULL), "invalid spin button" );
|
||||
wxCHECK_RET( (m_widget != NULL), "invalid spin button" );
|
||||
|
||||
float fpos = (float)value;
|
||||
m_oldPos = fpos;
|
||||
if (fabs(fpos-m_adjust->value) < 0.2) return;
|
||||
m_adjust->value = fpos;
|
||||
float fpos = (float)value;
|
||||
m_oldPos = fpos;
|
||||
if (fabs(fpos-m_adjust->value) < 0.2) return;
|
||||
|
||||
m_adjust->value = fpos;
|
||||
|
||||
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
|
||||
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
|
||||
}
|
||||
|
||||
void wxSpinButton::SetRange(int minVal, int maxVal)
|
||||
{
|
||||
wxCHECK_RET( (m_widget != NULL), "invalid spin button" );
|
||||
wxCHECK_RET( (m_widget != NULL), "invalid spin button" );
|
||||
|
||||
float fmin = (float)minVal;
|
||||
float fmax = (float)maxVal;
|
||||
float fmin = (float)minVal;
|
||||
float fmax = (float)maxVal;
|
||||
|
||||
if ((fabs(fmin-m_adjust->lower) < 0.2) &&
|
||||
(fabs(fmax-m_adjust->upper) < 0.2))
|
||||
return;
|
||||
if ((fabs(fmin-m_adjust->lower) < 0.2) &&
|
||||
(fabs(fmax-m_adjust->upper) < 0.2))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_adjust->lower = fmin;
|
||||
m_adjust->upper = fmax;
|
||||
m_adjust->lower = fmin;
|
||||
m_adjust->upper = fmax;
|
||||
|
||||
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
|
||||
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
|
||||
}
|
||||
|
||||
void wxSpinButton::OnSize( wxSizeEvent &WXUNUSED(event) )
|
||||
{
|
||||
wxCHECK_RET( (m_widget != NULL), "invalid spin button" );
|
||||
wxCHECK_RET( (m_widget != NULL), "invalid spin button" );
|
||||
|
||||
m_width = 16;
|
||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||
m_width = 16;
|
||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||
}
|
||||
|
||||
bool wxSpinButton::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
return GTK_SPIN_BUTTON(m_widget)->panel == window;
|
||||
return GTK_SPIN_BUTTON(m_widget)->panel == window;
|
||||
}
|
||||
|
||||
void wxSpinButton::ApplyWidgetStyle()
|
||||
{
|
||||
SetWidgetStyle();
|
||||
gtk_widget_set_style( m_widget, m_widgetStyle );
|
||||
SetWidgetStyle();
|
||||
gtk_widget_set_style( m_widget, m_widgetStyle );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
|
||||
#include "wx/statbmp.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticBitmap
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
|
||||
#include "wx/statbox.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticBox
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
|
||||
#include "wx/stattext.h"
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxStaticText
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+18
-10
@@ -13,6 +13,10 @@
|
||||
|
||||
#include "wx/toolbar.h"
|
||||
|
||||
#include "glib.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// data
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -99,6 +103,8 @@ wxToolBar::wxToolBar( wxWindow *parent, wxWindowID id,
|
||||
|
||||
wxToolBar::~wxToolBar()
|
||||
{
|
||||
delete m_fg;
|
||||
delete m_bg;
|
||||
}
|
||||
|
||||
bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
|
||||
@@ -121,18 +127,20 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
|
||||
m_widget = GTK_WIDGET(m_toolbar);
|
||||
|
||||
gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
|
||||
|
||||
m_fg = new GdkColor;
|
||||
m_fg->red = 0;
|
||||
m_fg->green = 0;
|
||||
m_fg->blue = 0;
|
||||
gdk_color_alloc( gtk_widget_get_colormap( GTK_WIDGET(m_toolbar) ), m_fg );
|
||||
|
||||
m_fg.red = 0;
|
||||
m_fg.green = 0;
|
||||
m_fg.blue = 0;
|
||||
gdk_color_alloc( gtk_widget_get_colormap( GTK_WIDGET(m_toolbar) ), &m_fg );
|
||||
m_bg = new GdkColor;
|
||||
m_bg->red = 65535;
|
||||
m_bg->green = 65535;
|
||||
m_bg->blue = 50000;
|
||||
gdk_color_alloc( gtk_widget_get_colormap( GTK_WIDGET(m_toolbar) ), m_bg );
|
||||
|
||||
m_bg.red = 65535;
|
||||
m_bg.green = 65535;
|
||||
m_bg.blue = 50000;
|
||||
gdk_color_alloc( gtk_widget_get_colormap( GTK_WIDGET(m_toolbar) ), &m_bg );
|
||||
|
||||
gtk_tooltips_set_colors( GTK_TOOLBAR(m_toolbar)->tooltips, &m_bg, &m_fg );
|
||||
gtk_tooltips_set_colors( GTK_TOOLBAR(m_toolbar)->tooltips, m_bg, m_fg );
|
||||
|
||||
m_xMargin = 0;
|
||||
m_yMargin = 0;
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user