wxFrame::CreateToolBar() stuff

wxDC::SetBackground from Chris Breeze
zillions of compile fixes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1998-07-24 19:05:25 +00:00
parent d602f1d8b6
commit 46dc76ba35
53 changed files with 645 additions and 376 deletions

View File

@@ -21,8 +21,6 @@
#include "wx/filefn.h" #include "wx/filefn.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
<<<<<<< file.h
=======
// constants // constants
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -47,7 +45,6 @@ const off_t ofsInvalid = (off_t)-1;
#define wxS_DEFAULT (wxS_IRUSR | wxS_IWUSR | wxS_IRGRP | wxS_IROTH) #define wxS_DEFAULT (wxS_IRUSR | wxS_IWUSR | wxS_IRGRP | wxS_IROTH)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
>>>>>>> 1.7
// class wxFile: raw file IO // class wxFile: raw file IO
// //
// NB: for space efficiency this class has no virtual functions, including // NB: for space efficiency this class has no virtual functions, including
@@ -78,11 +75,6 @@ public:
wxFile(int fd) { m_fd = fd; } wxFile(int fd) { m_fd = fd; }
// open/close // open/close
<<<<<<< file.h
bool Create(const char *szFileName, bool bOverwrite = FALSE);
bool Open(const char *szFileName, OpenMode mode = read);
inline bool Close(); // Close is a NOP if not opened
=======
// create a new file (with the default value of bOverwrite, it will fail if // create a new file (with the default value of bOverwrite, it will fail if
// the file already exists, otherwise it will overwrite it and succeed) // the file already exists, otherwise it will overwrite it and succeed)
bool Create(const char *szFileName, bool bOverwrite = FALSE, bool Create(const char *szFileName, bool bOverwrite = FALSE,
@@ -90,7 +82,6 @@ public:
bool Open(const char *szFileName, OpenMode mode = read, bool Open(const char *szFileName, OpenMode mode = read,
int access = wxS_DEFAULT); int access = wxS_DEFAULT);
bool Close(); // Close is a NOP if not opened bool Close(); // Close is a NOP if not opened
>>>>>>> 1.7
// assign an existing file descriptor and get it back from wxFile object // assign an existing file descriptor and get it back from wxFile object
void Attach(int fd) { Close(); m_fd = fd; } void Attach(int fd) { Close(); m_fd = fd; }

View File

@@ -119,6 +119,9 @@ class wxDC: public wxObject
virtual void SetBrush( const wxBrush &brush ) = 0; virtual void SetBrush( const wxBrush &brush ) = 0;
virtual wxBrush *GetBrush(void) { return &m_brush; }; virtual wxBrush *GetBrush(void) { return &m_brush; };
virtual void SetBackground( const wxBrush &brush ) = 0;
virtual wxBrush *GetBackground(void) { return &m_backgroundBrush; };
virtual void SetLogicalFunction( int function ) = 0; virtual void SetLogicalFunction( int function ) = 0;
virtual int GetLogicalFunction(void) { return m_logicalFunction; }; virtual int GetLogicalFunction(void) { return m_logicalFunction; };

View File

@@ -80,6 +80,7 @@ class wxPaintDC: public wxDC
virtual void SetFont( const wxFont &font ); virtual void SetFont( const wxFont &font );
virtual void SetPen( const wxPen &pen ); virtual void SetPen( const wxPen &pen );
virtual void SetBrush( const wxBrush &brush ); virtual void SetBrush( const wxBrush &brush );
virtual void SetBackground( const wxBrush &brush );
virtual void SetLogicalFunction( int function ); virtual void SetLogicalFunction( int function );
virtual void SetTextForeground( const wxColour &col ); virtual void SetTextForeground( const wxColour &col );
virtual void SetTextBackground( const wxColour &col ); virtual void SetTextBackground( const wxColour &col );

View File

@@ -35,7 +35,7 @@ class wxTextDragSource;
// wxDropTarget // wxDropTarget
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
class wxDropTarget: wxObject class wxDropTarget: public wxObject
{ {
public: public:

View File

@@ -21,6 +21,7 @@
#include "wx/window.h" #include "wx/window.h"
#include "wx/menu.h" #include "wx/menu.h"
#include "wx/statusbr.h" #include "wx/statusbr.h"
#include "wx/toolbar.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// classes // classes
@@ -42,8 +43,9 @@ extern const char *wxFrameNameStr;
class wxFrame: public wxWindow class wxFrame: public wxWindow
{ {
DECLARE_DYNAMIC_CLASS(wxFrame)
public: public:
// construction
wxFrame(); wxFrame();
wxFrame( wxWindow *parent, wxWindowID id, const wxString &title, wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
@@ -54,38 +56,35 @@ public:
~wxFrame(); ~wxFrame();
bool Destroy(); bool Destroy();
// operations
//
virtual bool Show( bool show ); virtual bool Show( bool show );
virtual void Enable( bool enable ); virtual void Enable( bool enable );
// frame size
virtual void GetClientSize( int *width, int *height ) const; virtual void GetClientSize( int *width, int *height ) const;
// set minimal size for the frame (@@@ other params not implemented)
void SetSizeHints(int minW, int minH, // set minimal/maxmimal size for the frame
int maxW = -1, int maxH = -1, virtual void SetSizeHints( int minW, int minH, int maxW, int maxH, int incW = -1 );
int incW = -1);
// status bar
virtual bool CreateStatusBar( int number = 1 ); virtual bool CreateStatusBar( int number = 1 );
wxStatusBar *GetStatusBar(); virtual wxStatusBar *GetStatusBar();
virtual void SetStatusText( const wxString &text, int number = 0 ); virtual void SetStatusText( const wxString &text, int number = 0 );
virtual void SetStatusWidths( int n, int *width ); virtual void SetStatusWidths( int n, int *width );
// menu bar virtual wxToolBar *CreateToolBar( int style = 0,
void SetMenuBar( wxMenuBar *menuBar ); int orientation = wxHORIZONTAL, int rowsOrColumns = 1 );
wxMenuBar *GetMenuBar(); virtual wxToolBar *GetToolBar();
virtual void SetMenuBar( wxMenuBar *menuBar );
virtual wxMenuBar *GetMenuBar();
// frame title
void SetTitle( const wxString &title ); void SetTitle( const wxString &title );
wxString GetTitle() const { return m_title; } wxString GetTitle() const { return m_title; }
// implementation void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
void OnActivate( wxActivateEvent &event ) { } // called from docview.cpp
void OnSize( wxSizeEvent &event ); void OnSize( wxSizeEvent &event );
void OnCloseWindow( wxCloseEvent& event ); void OnCloseWindow( wxCloseEvent& event );
void OnIdle(wxIdleEvent& event); void OnIdle(wxIdleEvent& event);
virtual void AddChild( wxWindow *child );
virtual void GtkOnSize( int x, int y, int width, int height ); virtual void GtkOnSize( int x, int y, int width, int height );
private: private:
@@ -99,10 +98,12 @@ private:
GtkWidget *m_mainWindow; GtkWidget *m_mainWindow;
wxMenuBar *m_frameMenuBar; wxMenuBar *m_frameMenuBar;
wxStatusBar *m_frameStatusBar; wxStatusBar *m_frameStatusBar;
wxToolBar *m_frameToolBar;
int m_toolBarHeight;
bool m_doingOnSize; bool m_doingOnSize;
bool m_addPrivateChild; // for toolbar (and maybe menubar)
wxString m_title; wxString m_title;
DECLARE_DYNAMIC_CLASS(wxFrame)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@@ -68,9 +68,6 @@ class wxMDIParentFrame: public wxFrame
void GetClientSize(int *width, int *height) const; void GetClientSize(int *width, int *height) const;
wxMDIChildFrame *GetActiveChild(void) const; wxMDIChildFrame *GetActiveChild(void) const;
virtual void SetToolBar( wxToolBar *toolbar );
virtual wxWindow *GetToolBar(void) const;
wxMDIClientWindow *GetClientWindow(void) const; wxMDIClientWindow *GetClientWindow(void) const;
virtual wxMDIClientWindow *OnCreateClient(void); virtual wxMDIClientWindow *OnCreateClient(void);
@@ -95,7 +92,6 @@ class wxMDIParentFrame: public wxFrame
wxMDIClientWindow *m_clientWindow; wxMDIClientWindow *m_clientWindow;
bool m_parentFrameActive; bool m_parentFrameActive;
wxMenuBar *m_mdiMenuBar; wxMenuBar *m_mdiMenuBar;
wxToolBar *m_toolBar;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@@ -112,6 +112,8 @@ class wxToolBar: public wxControl
const wxString& helpString1 = "", const wxString& helpString2 = ""); const wxString& helpString1 = "", const wxString& helpString2 = "");
virtual void AddSeparator(void); virtual void AddSeparator(void);
virtual void ClearTools(void); virtual void ClearTools(void);
virtual void Layout(void);
virtual void EnableTool(int toolIndex, bool enable); virtual void EnableTool(int toolIndex, bool enable);
virtual void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on virtual void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on

View File

@@ -119,6 +119,9 @@ class wxDC: public wxObject
virtual void SetBrush( const wxBrush &brush ) = 0; virtual void SetBrush( const wxBrush &brush ) = 0;
virtual wxBrush *GetBrush(void) { return &m_brush; }; virtual wxBrush *GetBrush(void) { return &m_brush; };
virtual void SetBackground( const wxBrush &brush ) = 0;
virtual wxBrush *GetBackground(void) { return &m_backgroundBrush; };
virtual void SetLogicalFunction( int function ) = 0; virtual void SetLogicalFunction( int function ) = 0;
virtual int GetLogicalFunction(void) { return m_logicalFunction; }; virtual int GetLogicalFunction(void) { return m_logicalFunction; };

View File

@@ -80,6 +80,7 @@ class wxPaintDC: public wxDC
virtual void SetFont( const wxFont &font ); virtual void SetFont( const wxFont &font );
virtual void SetPen( const wxPen &pen ); virtual void SetPen( const wxPen &pen );
virtual void SetBrush( const wxBrush &brush ); virtual void SetBrush( const wxBrush &brush );
virtual void SetBackground( const wxBrush &brush );
virtual void SetLogicalFunction( int function ); virtual void SetLogicalFunction( int function );
virtual void SetTextForeground( const wxColour &col ); virtual void SetTextForeground( const wxColour &col );
virtual void SetTextBackground( const wxColour &col ); virtual void SetTextBackground( const wxColour &col );

View File

@@ -35,7 +35,7 @@ class wxTextDragSource;
// wxDropTarget // wxDropTarget
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
class wxDropTarget: wxObject class wxDropTarget: public wxObject
{ {
public: public:

View File

@@ -21,6 +21,7 @@
#include "wx/window.h" #include "wx/window.h"
#include "wx/menu.h" #include "wx/menu.h"
#include "wx/statusbr.h" #include "wx/statusbr.h"
#include "wx/toolbar.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// classes // classes
@@ -42,8 +43,9 @@ extern const char *wxFrameNameStr;
class wxFrame: public wxWindow class wxFrame: public wxWindow
{ {
DECLARE_DYNAMIC_CLASS(wxFrame)
public: public:
// construction
wxFrame(); wxFrame();
wxFrame( wxWindow *parent, wxWindowID id, const wxString &title, wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
@@ -54,38 +56,35 @@ public:
~wxFrame(); ~wxFrame();
bool Destroy(); bool Destroy();
// operations
//
virtual bool Show( bool show ); virtual bool Show( bool show );
virtual void Enable( bool enable ); virtual void Enable( bool enable );
// frame size
virtual void GetClientSize( int *width, int *height ) const; virtual void GetClientSize( int *width, int *height ) const;
// set minimal size for the frame (@@@ other params not implemented)
void SetSizeHints(int minW, int minH, // set minimal/maxmimal size for the frame
int maxW = -1, int maxH = -1, virtual void SetSizeHints( int minW, int minH, int maxW, int maxH, int incW = -1 );
int incW = -1);
// status bar
virtual bool CreateStatusBar( int number = 1 ); virtual bool CreateStatusBar( int number = 1 );
wxStatusBar *GetStatusBar(); virtual wxStatusBar *GetStatusBar();
virtual void SetStatusText( const wxString &text, int number = 0 ); virtual void SetStatusText( const wxString &text, int number = 0 );
virtual void SetStatusWidths( int n, int *width ); virtual void SetStatusWidths( int n, int *width );
// menu bar virtual wxToolBar *CreateToolBar( int style = 0,
void SetMenuBar( wxMenuBar *menuBar ); int orientation = wxHORIZONTAL, int rowsOrColumns = 1 );
wxMenuBar *GetMenuBar(); virtual wxToolBar *GetToolBar();
virtual void SetMenuBar( wxMenuBar *menuBar );
virtual wxMenuBar *GetMenuBar();
// frame title
void SetTitle( const wxString &title ); void SetTitle( const wxString &title );
wxString GetTitle() const { return m_title; } wxString GetTitle() const { return m_title; }
// implementation void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
void OnActivate( wxActivateEvent &event ) { } // called from docview.cpp
void OnSize( wxSizeEvent &event ); void OnSize( wxSizeEvent &event );
void OnCloseWindow( wxCloseEvent& event ); void OnCloseWindow( wxCloseEvent& event );
void OnIdle(wxIdleEvent& event); void OnIdle(wxIdleEvent& event);
virtual void AddChild( wxWindow *child );
virtual void GtkOnSize( int x, int y, int width, int height ); virtual void GtkOnSize( int x, int y, int width, int height );
private: private:
@@ -99,10 +98,12 @@ private:
GtkWidget *m_mainWindow; GtkWidget *m_mainWindow;
wxMenuBar *m_frameMenuBar; wxMenuBar *m_frameMenuBar;
wxStatusBar *m_frameStatusBar; wxStatusBar *m_frameStatusBar;
wxToolBar *m_frameToolBar;
int m_toolBarHeight;
bool m_doingOnSize; bool m_doingOnSize;
bool m_addPrivateChild; // for toolbar (and maybe menubar)
wxString m_title; wxString m_title;
DECLARE_DYNAMIC_CLASS(wxFrame)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@@ -68,9 +68,6 @@ class wxMDIParentFrame: public wxFrame
void GetClientSize(int *width, int *height) const; void GetClientSize(int *width, int *height) const;
wxMDIChildFrame *GetActiveChild(void) const; wxMDIChildFrame *GetActiveChild(void) const;
virtual void SetToolBar( wxToolBar *toolbar );
virtual wxWindow *GetToolBar(void) const;
wxMDIClientWindow *GetClientWindow(void) const; wxMDIClientWindow *GetClientWindow(void) const;
virtual wxMDIClientWindow *OnCreateClient(void); virtual wxMDIClientWindow *OnCreateClient(void);
@@ -95,7 +92,6 @@ class wxMDIParentFrame: public wxFrame
wxMDIClientWindow *m_clientWindow; wxMDIClientWindow *m_clientWindow;
bool m_parentFrameActive; bool m_parentFrameActive;
wxMenuBar *m_mdiMenuBar; wxMenuBar *m_mdiMenuBar;
wxToolBar *m_toolBar;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@@ -112,6 +112,8 @@ class wxToolBar: public wxControl
const wxString& helpString1 = "", const wxString& helpString2 = ""); const wxString& helpString1 = "", const wxString& helpString2 = "");
virtual void AddSeparator(void); virtual void AddSeparator(void);
virtual void ClearTools(void); virtual void ClearTools(void);
virtual void Layout(void);
virtual void EnableTool(int toolIndex, bool enable); virtual void EnableTool(int toolIndex, bool enable);
virtual void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on virtual void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on

View File

@@ -107,7 +107,8 @@ private:
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// global functions // global functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
inline WXDLLEXPORT wxLocale* wxGetLocale() { return g_pLocale; }
WXDLLEXPORT wxLocale* wxGetLocale();
// get the translation of the string in the current locale // get the translation of the string in the current locale
inline WXDLLEXPORT const char *wxGetTranslation(const char *sz) inline WXDLLEXPORT const char *wxGetTranslation(const char *sz)

View File

@@ -76,11 +76,6 @@ class WXDLLEXPORT wxList: public wxObject
wxList(int N, wxObject *Objects[]); wxList(int N, wxObject *Objects[]);
wxList(wxObject *object, ...); wxList(wxObject *object, ...);
#ifdef USE_STORABLE_CLASSES
wxList( istream &stream, char *data );
virtual void StoreObject( ostream &stream );
#endif
~wxList(void); ~wxList(void);
inline int Number(void) const { return n; } inline int Number(void) const { return n; }

View File

@@ -97,19 +97,24 @@ public:
*/ */
}; };
/*
The code is wrong and doesn't compile. Chris Breeze als reported, that
some functions of wxTransformMatrix cannot work because it is not
known if he matrix has been inverted. Be careful when using it.
// Transform X value from logical to device // Transform X value from logical to device
inline double wxTransformMatrix::TransformX(double x) const inline double wxTransformMatrix::TransformX(double x) const
{ {
// return (m_isIdentity ? x : (x * m_matrix[0][0] + y * m_matrix[1][0] + m_matrix[2][0])); return (m_isIdentity ? x : (x * m_matrix[0][0] + y * m_matrix[1][0] + m_matrix[2][0]));
return 0;
} }
// Transform Y value from logical to device // Transform Y value from logical to device
inline double wxTransformMatrix::TransformY(double y) const inline double wxTransformMatrix::TransformY(double y) const
{ {
// return (m_isIdentity ? y : (x * m_matrix[0][1] + y * m_matrix[1][1] + m_matrix[2][1])); return (m_isIdentity ? y : (x * m_matrix[0][1] + y * m_matrix[1][1] + m_matrix[2][1]));
return 0;
} }
*/
// Is the matrix the identity matrix? // Is the matrix the identity matrix?
// Perhaps there's some kind of optimization we can do to make this // Perhaps there's some kind of optimization we can do to make this

View File

@@ -16,7 +16,7 @@
#endif #endif
#include <wx/stream.h> #include <wx/stream.h>
#include "zlib.h" #include "../zlib/zlib.h"
class wxZlibInputStream: public wxFilterInputStream { class wxZlibInputStream: public wxFilterInputStream {
public: public:
@@ -27,7 +27,7 @@ class wxZlibInputStream: public wxFilterInputStream {
protected: protected:
size_t DoRead(void *buffer, size_t size); size_t DoRead(void *buffer, size_t size);
off_t DoSeekInput(off_t pos, wxSeekMode WXUNUSED(mode)) { return wxInvalidOffset; } off_t DoSeekInput(off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode)) { return wxInvalidOffset; }
off_t DoTellInput() const { return wxInvalidOffset; } off_t DoTellInput() const { return wxInvalidOffset; }
protected: protected:
@@ -47,7 +47,7 @@ class wxZlibOutputStream: public wxFilterOutputStream {
protected: protected:
size_t DoWrite(const void *buffer, size_t size); size_t DoWrite(const void *buffer, size_t size);
off_t DoSeekOutput(off_t pos, wxSeekMode WXUNUSED(mode)) { return wxInvalidOffset; } off_t DoSeekOutput(off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode)) { return wxInvalidOffset; }
off_t DoTellOutput() const { return wxInvalidOffset; } off_t DoTellOutput() const { return wxInvalidOffset; }
protected: protected:

View File

@@ -4,8 +4,48 @@
wxGTK uses GNU configure. If you have problems with your make use GNU wxGTK uses GNU configure. If you have problems with your make use GNU
make instead. make instead.
* Additional libraries
-----------------------
wxGTK requires the GTK (The Gimp Toolkit) to be installed,
which probably makes sense.
There will be a few more features of wxGTK, which will
require further libraries (on some platforms). These
features will be optional. I hope to teach configure
to check that out automatically.
Thread support:
Requires pthreads under Linux with glibc 2. pthreads are
always present on such systems, so just compile.
Requires pcthreads under Linux with libc 5. If you
haven't installed pcthreads, there will be no thread
support in wxGTK, but the library will compile.
Python scripting language support:
Requires Python. Soon to come.
* Other things to do
-----------------------------
Copy the two files from ~/wxGTK/misc/imlib to your
home directory. You may also edit imrc by hand as
you like. The palette file is required when using
wxGTK in 256-colour mode.
If you want to use wxGTK's ODBC support, you'll have
to create a .odbc.ini file. The readme file in
~/wxGTK/src/iodbc tells you what to do.
* Create your configuration * Create your configuration
----------------------------- -----------------------------
This must be done in ~/wxGTK/install/gtk
Usage: Usage:
./configure options ./configure options
@@ -47,11 +87,13 @@ The following options handle the kind of library you want to build.
broken. broken.
--with-mem_tracing Add built-in memory tracing. --with-mem_tracing Add built-in memory tracing.
Not yet.
--with-debug Add debug info to object --with-debug_info Add debug info to object
files. files.
--with-debug_flag Define __DEBUG__ and __WXDEBUG__ when
compiling.
* Feature Options * Feature Options
------------------- -------------------
@@ -65,37 +107,11 @@ producing a shared library, wxGTK's configure system auto-
matically enables all features, as long as they are already matically enables all features, as long as they are already
implemented. implemented.
* Additional libraries
-----------------------
[Note: Currently wxGTK will compile out-of-the-box
with no extra libraries required. Support for
OpenGl, threads, Python and hopefully ODBC
support will soon be added.]
wxGTK requires the GTK (The Gimp Toolkit) to be installed,
which probably makes sense.
There will be a few more features of wxGTK, which will
require further libraries (on some platforms). These
features will be optional. I hope to teach configure
to check that out automatically.
Thread support:
Requires pthreads under Linux without glibc or glibc 2.
OpenGl:
Requires OpenGl or MesaGl.
Python scripting language support:
Requires Python.
* Compiling * Compiling
------------- -------------
This must be done in ~/wxGTK
First you have to create all makefiles in all subdirectories: First you have to create all makefiles in all subdirectories:
make makefiles make makefiles
@@ -144,7 +160,7 @@ will do the work for you.
-------------------------- --------------------------
I propose to put all contributed programs in the directory I propose to put all contributed programs in the directory
"user", with a directory of its own. "~/wcGTK/user", with a directory of its own.
This directory then should include the following files: This directory then should include the following files:

18
install/gtk/configure vendored
View File

@@ -5710,11 +5710,7 @@ if test "$USE_MEM_TRACING" = 1 ; then
#define USE_MEMORY_TRACING $USE_MEM_TRACING #define USE_MEMORY_TRACING $USE_MEM_TRACING
EOF EOF
cat >> confdefs.h <<EOF fi
#define USE_GLOBAL_MEMORY_OPERATORS $USE_MEM_TRACING
EOF
fi
PROFILE= PROFILE=
if test "$USE_PROFILE" = 1 ; then if test "$USE_PROFILE" = 1 ; then
@@ -6052,7 +6048,7 @@ fi
# Extract the first word of "gtk-config", so it can be a program name with args. # Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2 set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:6056: checking for $ac_word" >&5 echo "configure:6052: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@@ -6083,7 +6079,7 @@ fi
min_gtk_version=0.99.7 min_gtk_version=0.99.7
echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6
echo "configure:6087: checking for GTK - version >= $min_gtk_version" >&5 echo "configure:6083: checking for GTK - version >= $min_gtk_version" >&5
no_gtk="" no_gtk=""
if test "$GTK_CONFIG" != "no" ; then if test "$GTK_CONFIG" != "no" ; then
GTK_CFLAGS=`$GTK_CONFIG --cflags` GTK_CFLAGS=`$GTK_CONFIG --cflags`
@@ -6096,7 +6092,7 @@ echo "configure:6087: checking for GTK - version >= $min_gtk_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c" echo $ac_n "cross compiling; assumed OK... $ac_c"
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 6100 "configure" #line 6096 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
@@ -6118,7 +6114,7 @@ main ()
} }
EOF EOF
if { (eval echo configure:6122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null if { (eval echo configure:6118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then then
: :
else else
@@ -6174,7 +6170,7 @@ OPENGL_LINK=
if test "$USE_OPENGL" = 1; then if test "$USE_OPENGL" = 1; then
echo $ac_n "checking for OpenGL includes""... $ac_c" 1>&6 echo $ac_n "checking for OpenGL includes""... $ac_c" 1>&6
echo "configure:6178: checking for OpenGL includes" >&5 echo "configure:6174: checking for OpenGL includes" >&5
ac_find_includes= ac_find_includes=
for ac_dir in $SEARCH_INCLUDE; for ac_dir in $SEARCH_INCLUDE;
@@ -6189,7 +6185,7 @@ for ac_dir in $SEARCH_INCLUDE;
OPENGL_INCLUDE="-I$ac_find_includes" OPENGL_INCLUDE="-I$ac_find_includes"
echo "$ac_t""found $ac_find_includes" 1>&6 echo "$ac_t""found $ac_find_includes" 1>&6
echo $ac_n "checking for OpenGL library""... $ac_c" 1>&6 echo $ac_n "checking for OpenGL library""... $ac_c" 1>&6
echo "configure:6193: checking for OpenGL library" >&5 echo "configure:6189: checking for OpenGL library" >&5
ac_find_libraries= ac_find_libraries=
for ac_dir in $SEARCH_LIB; for ac_dir in $SEARCH_LIB;

View File

@@ -963,7 +963,7 @@ fi
if test "$USE_MEM_TRACING" = 1 ; then if test "$USE_MEM_TRACING" = 1 ; then
AC_DEFINE_UNQUOTED(USE_MEMORY_TRACING,$USE_MEM_TRACING) AC_DEFINE_UNQUOTED(USE_MEMORY_TRACING,$USE_MEM_TRACING)
AC_DEFINE_UNQUOTED(USE_GLOBAL_MEMORY_OPERATORS,$USE_MEM_TRACING) dnl AC_DEFINE_UNQUOTED(USE_GLOBAL_MEMORY_OPERATORS,$USE_MEM_TRACING)
fi fi
PROFILE= PROFILE=

View File

@@ -21,17 +21,10 @@
#include "wx/mdi.h" #include "wx/mdi.h"
#endif #endif
#ifdef __WXMSW__ #include <wx/toolbar.h>
#ifdef __WIN95__
#include <wx/tbar95.h>
#else
#include <wx/tbarmsw.h>
#endif
#endif
#ifdef __WXGTK__ #ifdef __WXGTK__
//#include "list.xpm" #include "folder.xpm"
//#include "folder.xpm"
#endif #endif
#include "mdi.h" #include "mdi.h"
@@ -105,10 +98,8 @@ MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, c
wxTE_MULTILINE|wxSUNKEN_BORDER); wxTE_MULTILINE|wxSUNKEN_BORDER);
textWindow->SetValue("A help window"); textWindow->SetValue("A help window");
#ifdef __WXMSW__
toolBar = new TestRibbon(this, 0, 0, 100, 30, wxNO_BORDER, wxVERTICAL, 1); toolBar = new TestRibbon(this, 0, 0, 100, 30, wxNO_BORDER, wxVERTICAL, 1);
SetToolBar(toolBar); SetToolBar(toolBar);
#endif
} }
void MyFrame::OnQuit(wxCommandEvent& event) void MyFrame::OnQuit(wxCommandEvent& event)
@@ -257,14 +248,12 @@ void MyFrame::OnSize(wxSizeEvent& event)
int tw = 0; int tw = 0;
int th = 0; int th = 0;
#ifdef __WXMSW__
wxWindow* tbar = GetToolBar(); wxWindow* tbar = GetToolBar();
if (tbar) if (tbar)
{ {
tbar->GetSize(&tw, &th); tbar->GetSize(&tw, &th);
tbar->SetSize(w, th); tbar->SetSize(w, th);
} }
#endif
textWindow->SetSize(0, th, 200, h-th); textWindow->SetSize(0, th, 200, h-th);
GetClientWindow()->SetSize(200, th, w - 200, h-th); GetClientWindow()->SetSize(200, th, w - 200, h-th);
@@ -316,8 +305,6 @@ bool MyChild::OnClose(void)
return TRUE; return TRUE;
} }
#ifdef __WXMSW__
BEGIN_EVENT_TABLE(TestRibbon, wxToolBar) BEGIN_EVENT_TABLE(TestRibbon, wxToolBar)
EVT_PAINT(TestRibbon::OnPaint) EVT_PAINT(TestRibbon::OnPaint)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -328,6 +315,7 @@ TestRibbon::TestRibbon(wxFrame *frame, int x, int y, int w, int h,
{ {
wxBitmap* bitmaps[8]; wxBitmap* bitmaps[8];
#ifdef __WXMSW__
bitmaps[0] = new wxBitmap("icon1", wxBITMAP_TYPE_RESOURCE); bitmaps[0] = new wxBitmap("icon1", wxBITMAP_TYPE_RESOURCE);
bitmaps[1] = new wxBitmap("icon2", wxBITMAP_TYPE_RESOURCE); bitmaps[1] = new wxBitmap("icon2", wxBITMAP_TYPE_RESOURCE);
bitmaps[2] = new wxBitmap("icon3", wxBITMAP_TYPE_RESOURCE); bitmaps[2] = new wxBitmap("icon3", wxBITMAP_TYPE_RESOURCE);
@@ -336,6 +324,16 @@ TestRibbon::TestRibbon(wxFrame *frame, int x, int y, int w, int h,
bitmaps[5] = new wxBitmap("icon6", wxBITMAP_TYPE_RESOURCE); bitmaps[5] = new wxBitmap("icon6", wxBITMAP_TYPE_RESOURCE);
bitmaps[6] = new wxBitmap("icon7", wxBITMAP_TYPE_RESOURCE); bitmaps[6] = new wxBitmap("icon7", wxBITMAP_TYPE_RESOURCE);
bitmaps[7] = new wxBitmap("icon8", wxBITMAP_TYPE_RESOURCE); bitmaps[7] = new wxBitmap("icon8", wxBITMAP_TYPE_RESOURCE);
#else
bitmaps[0] = new wxBitmap( folder_xpm );
bitmaps[1] = new wxBitmap( folder_xpm );
bitmaps[2] = new wxBitmap( folder_xpm );
bitmaps[3] = new wxBitmap( folder_xpm );
bitmaps[4] = new wxBitmap( folder_xpm );
bitmaps[5] = new wxBitmap( folder_xpm );
bitmaps[6] = new wxBitmap( folder_xpm );
bitmaps[7] = new wxBitmap( folder_xpm );
#endif
#ifdef __WXMSW__ #ifdef __WXMSW__
int width = 24; int width = 24;
@@ -403,4 +401,3 @@ void TestRibbon::OnPaint(wxPaintEvent& event)
dc.DrawLine(0, h-1, w, h-1); dc.DrawLine(0, h-1, w, h-1);
} }
#endif

View File

@@ -34,8 +34,6 @@ class MyCanvas: public wxScrolledWindow
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#ifdef __WXMSW__
class TestRibbon: public wxToolBar class TestRibbon: public wxToolBar
{ {
public: public:
@@ -48,17 +46,13 @@ class TestRibbon: public wxToolBar
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif
// Define a new frame // Define a new frame
class MyFrame: public wxMDIParentFrame class MyFrame: public wxMDIParentFrame
{ {
public: public:
wxTextCtrl *textWindow; wxTextCtrl *textWindow;
#ifdef __WXMSW__
TestRibbon* toolBar; TestRibbon* toolBar;
#endif
MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style); MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
bool OnClose(void); bool OnClose(void);

View File

@@ -31,7 +31,7 @@
#error You must set WXDEBUG to 1 on the 'make' command line or make.env. #error You must set WXDEBUG to 1 on the 'make' command line or make.env.
#endif #endif
#define new WXDEBUG_NEW // #define new WXDEBUG_NEW
// Define a new application type // Define a new application type
class MyApp: public wxApp class MyApp: public wxApp
@@ -81,7 +81,7 @@ bool MyApp::OnInit(void)
frame->Show(TRUE); frame->Show(TRUE);
// wxDebugContext::SetCheckpoint(); // wxDebugContext::SetCheckpoint();
wxDebugContext::SetFile("debug.log"); // wxDebugContext::SetFile("debug.log");
wxString *thing = new wxString; // WXDEBUG_NEW wxString; wxString *thing = new wxString; // WXDEBUG_NEW wxString;
wxDate* date = new wxDate; wxDate* date = new wxDate;
@@ -92,9 +92,9 @@ bool MyApp::OnInit(void)
const char *data = (const char*) thing ; const char *data = (const char*) thing ;
wxDebugContext::PrintClasses(); // wxDebugContext::PrintClasses();
wxDebugContext::Dump(); // wxDebugContext::Dump();
wxDebugContext::PrintStatistics(); // wxDebugContext::PrintStatistics();
// Don't delete these two objects, to force wxApp to flag a memory leak. // Don't delete these two objects, to force wxApp to flag a memory leak.
// delete thing; // delete thing;

View File

@@ -811,7 +811,7 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
preview = new wxWindowsPrintPreview(printout, view->OnCreatePrintout()); preview = new wxWindowsPrintPreview(printout, view->OnCreatePrintout());
else else
#endif #endif
preview = new wxPostScriptPrintPreview(printout, view->OnCreatePrintout()); preview = new wxPostScriptPrintPreview(printout, view->OnCreatePrintout());
wxPreviewFrame *frame = new wxPreviewFrame(preview, (wxFrame *)wxTheApp->GetTopWindow(), "Print Preview", wxPreviewFrame *frame = new wxPreviewFrame(preview, (wxFrame *)wxTheApp->GetTopWindow(), "Print Preview",
wxPoint(100, 100), wxSize(600, 650)); wxPoint(100, 100), wxSize(600, 650));

View File

@@ -356,7 +356,7 @@ bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event)
while (table.entries[i].m_fn != NULL) while (table.entries[i].m_fn != NULL)
{ {
wxEventType eventType = (wxEventType) table.entries[i].m_eventType; // wxEventType eventType = (wxEventType) table.entries[i].m_eventType;
if ((event.GetEventType() == table.entries[i].m_eventType) && if ((event.GetEventType() == table.entries[i].m_eventType) &&
(table.entries[i].m_id == -1 || // Match, if event spec says any id will do (id == -1) (table.entries[i].m_id == -1 || // Match, if event spec says any id will do (id == -1)
@@ -407,7 +407,8 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
while (node) while (node)
{ {
wxEventTableEntry *entry = (wxEventTableEntry*)node->Data(); wxEventTableEntry *entry = (wxEventTableEntry*)node->Data();
wxEventType eventType = (wxEventType) entry->m_eventType;
// wxEventType eventType = (wxEventType) entry->m_eventType;
if (entry->m_fn) if (entry->m_fn)
{ {

View File

@@ -736,7 +736,11 @@ wxDos2UnixFilename (char *s)
} }
void void
#ifdef __WXMSW__
wxUnix2DosFilename (char *s) wxUnix2DosFilename (char *s)
#else
wxUnix2DosFilename (char *WXUNUSED(s))
#endif
{ {
// Yes, I really mean this to happen under DOS only! JACS // Yes, I really mean this to happen under DOS only! JACS
#ifdef __WXMSW__ #ifdef __WXMSW__
@@ -1346,7 +1350,7 @@ void WXDLLEXPORT wxSplitPath(const char *pszFileName,
uint nPosDos = pSepDos ? pSepDos - pszFileName : 0; uint nPosDos = pSepDos ? pSepDos - pszFileName : 0;
if ( nPosDos > nPosUnix ) if ( nPosDos > nPosUnix )
nPosUnix = nPosDos; nPosUnix = nPosDos;
uint nLen = Strlen(pszFileName); // uint nLen = Strlen(pszFileName);
if ( pstrPath ) if ( pstrPath )
*pstrPath = wxString(pszFileName, nPosUnix); *pstrPath = wxString(pszFileName, nPosUnix);

View File

@@ -10,7 +10,7 @@
#include "wx/frame.h" #include "wx/frame.h"
void wxFrame::OnIdle(wxIdleEvent& event) void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) )
{ {
DoMenuUpdates(); DoMenuUpdates();
} }

View File

@@ -210,40 +210,6 @@ wxList::~wxList (void)
} }
} }
#ifdef USE_STORABLE_CLASSES
wxList::wxList( istream &stream, char *WXUNUSED(data) )
{
char buf[200];
unsigned int num;
stream.read( (char*)(&num), sizeof(num) );
for (unsigned int i = 0; i < num; i++)
{
int len;
stream.read( (char*)(&len), sizeof(len) );
stream.read( (char*)(&buf), len );
buf[len] = 0;
Append( wxCreateStoredObject( buf, stream, NULL ) );
};
};
void wxList::StoreObject( ostream &stream )
{
unsigned int num = Number();
stream.write( (char*)(&num), sizeof(num) );
wxNode *node = First();
while (node)
{
wxObject *obj = (wxObject*) node->Data();
wxClassInfo *obj_info = obj->GetClassInfo();
int len = strlen(obj_info->className);
stream.write( (char*)(&len), sizeof(len) );
stream.write( obj_info->className, len );
obj->StoreObject( stream );
node = node->Next();
};
};
#endif
wxNode *wxList::Append(wxObject *object) wxNode *wxList::Append(wxObject *object)
{ {
wxNode *node = new wxNode(this, last_node, NULL, object); wxNode *node = new wxNode(this, last_node, NULL, object);

View File

@@ -308,7 +308,7 @@ void wxLog::DoLog(wxLogLevel level, const char *szString)
} }
} }
void wxLog::DoLogString(const char *szString) void wxLog::DoLogString(const char *WXUNUSED(szString))
{ {
wxFAIL_MSG("DoLogString must be overrided if it's called."); wxFAIL_MSG("DoLogString must be overrided if it's called.");
} }
@@ -558,19 +558,19 @@ wxLogFrame::wxLogFrame(const char *szTitle)
// @@ what about status bar? needed (for menu prompts)? // @@ what about status bar? needed (for menu prompts)?
} }
void wxLogFrame::OnClose(wxCommandEvent& event) void wxLogFrame::OnClose(wxCommandEvent& WXUNUSED(event))
{ {
// just hide the window // just hide the window
Show(FALSE); Show(FALSE);
} }
void wxLogFrame::OnCloseWindow(wxCloseEvent& event) void wxLogFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{ {
// just hide the window // just hide the window
Show(FALSE); Show(FALSE);
} }
void wxLogFrame::OnSave(wxCommandEvent& event) void wxLogFrame::OnSave(wxCommandEvent& WXUNUSED(event))
{ {
// get the file name // get the file name
// ----------------- // -----------------
@@ -583,9 +583,9 @@ void wxLogFrame::OnSave(wxCommandEvent& event)
// open file // open file
// --------- // ---------
wxFile file; wxFile file;
bool bOk; bool bOk = FALSE;
if ( wxFile::Exists(szFileName) ) { if ( wxFile::Exists(szFileName) ) {
bool bAppend; bool bAppend = FALSE;
wxString strMsg; wxString strMsg;
strMsg.Printf(_("Append log to file '%s' " strMsg.Printf(_("Append log to file '%s' "
"(choosing [No] will overwrite it)?"), szFileName); "(choosing [No] will overwrite it)?"), szFileName);
@@ -637,7 +637,7 @@ void wxLogFrame::OnSave(wxCommandEvent& event)
} }
} }
void wxLogFrame::OnClear(wxCommandEvent& event) void wxLogFrame::OnClear(wxCommandEvent& WXUNUSED(event))
{ {
m_pTextCtrl->Clear(); m_pTextCtrl->Clear();
} }

View File

@@ -387,7 +387,7 @@ int wxMemStruct::ValidateNode ()
ErrorMsg ("Object already deleted"); ErrorMsg ("Object already deleted");
else { else {
// Can't use the error routines as we have no recognisable object. // Can't use the error routines as we have no recognisable object.
wxTrace("Can't verify memory struct - all bets are off!\n"); // wxTrace("Can't verify memory struct - all bets are off!\n");
} }
return 0; return 0;
} }

View File

@@ -129,7 +129,8 @@ char* wxDatabase::GetErrorClass(void) {
return sqlstate; return sqlstate;
} }
bool wxDatabase::Open(char *thedatasource, bool exclusive, bool readOnly, char *username, char *password) bool wxDatabase::Open(char *thedatasource, bool WXUNUSED(exclusive),
bool WXUNUSED(readOnly), char *username, char *password)
{ {
err_occured = FALSE; err_occured = FALSE;
@@ -198,7 +199,7 @@ char *wxDatabase::GetDatabaseName(void)
char nameBuf[400]; char nameBuf[400];
int nameSize = 0; int nameSize = 0;
retcode = SQLGetInfo(hDBC, SQL_DATABASE_NAME, nameBuf, sizeof(nameBuf), (short *)&nameSize); retcode = SQLGetInfo(hDBC, SQL_DATABASE_NAME, (unsigned char*)nameBuf, sizeof(nameBuf), (short *)&nameSize);
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
return NULL; return NULL;
@@ -230,15 +231,15 @@ bool wxDatabase::InWaitForDataSource(void)
return FALSE; return FALSE;
} }
void wxDatabase::SetLoginTimeout(long seconds) void wxDatabase::SetLoginTimeout(long WXUNUSED(seconds))
{ {
} }
void wxDatabase::SetQueryTimeout(long seconds) void wxDatabase::SetQueryTimeout(long WXUNUSED(seconds))
{ {
} }
void wxDatabase::SetSynchronousMode(bool synchronous) void wxDatabase::SetSynchronousMode(bool WXUNUSED(synchronous))
{ {
} }
@@ -263,11 +264,11 @@ void wxDatabase::Cancel(void)
} }
// Overridables // Overridables
void wxDatabase::OnSetOptions(wxRecordSet *recordSet) void wxDatabase::OnSetOptions(wxRecordSet *WXUNUSED(recordSet))
{ {
} }
void wxDatabase::OnWaitForDataSource(bool stillExecuting) void wxDatabase::OnWaitForDataSource(bool WXUNUSED(stillExecuting))
{ {
} }
@@ -335,7 +336,7 @@ void wxDatabase::ResetRecordSets(void)
bool wxDatabase::GetInfo(long infoType, long *buf) bool wxDatabase::GetInfo(long infoType, long *buf)
{ {
short sz = 0; short sz = 0;
retcode = SQLGetInfo(hDBC, (UWORD)infoType, (char *)buf, sizeof(buf), &sz); retcode = SQLGetInfo(hDBC, (UWORD)infoType, (unsigned char*)buf, sizeof(buf), &sz);
if (retcode != SQL_ERROR) if (retcode != SQL_ERROR)
return TRUE; return TRUE;
@@ -349,7 +350,7 @@ bool wxDatabase::GetInfo(long infoType, char *buf, int bufSize)
bufSize = sizeof(buf); bufSize = sizeof(buf);
short sz = 0; short sz = 0;
retcode = SQLGetInfo(hDBC, (UWORD)infoType, buf, bufSize, &sz); retcode = SQLGetInfo(hDBC, (UWORD)infoType, (unsigned char*)buf, bufSize, &sz);
if (retcode != SQL_ERROR) if (retcode != SQL_ERROR)
return TRUE; return TRUE;
@@ -386,7 +387,7 @@ wxString wxDatabase::GetODBCVersionString(bool implementation)
int bufSize = sizeof(buf); int bufSize = sizeof(buf);
short sz = 0; short sz = 0;
retcode = SQLGetInfo(hDBC, (UWORD)SQL_ODBC_VER, buf, bufSize, &sz); retcode = SQLGetInfo(hDBC, (UWORD)SQL_ODBC_VER, (unsigned char*)buf, bufSize, &sz);
if (hDBC != 0 && noDBC) if (hDBC != 0 && noDBC)
{ {
@@ -427,7 +428,7 @@ float wxDatabase::GetODBCVersionFloat(bool implementation)
int bufSize = sizeof(buf); int bufSize = sizeof(buf);
short sz = 0; short sz = 0;
retcode = SQLGetInfo(hDBC, (UWORD)SQL_ODBC_VER, buf, bufSize, &sz); retcode = SQLGetInfo(hDBC, (UWORD)SQL_ODBC_VER, (unsigned char*)buf, bufSize, &sz);
if (hDBC != 0 && noDBC) if (hDBC != 0 && noDBC)
{ {
@@ -485,7 +486,7 @@ wxRecordSet::~wxRecordSet(void)
} }
// If SQL is non-NULL, table and columns can be NULL. // If SQL is non-NULL, table and columns can be NULL.
bool wxRecordSet::BeginQuery(int openType, char *sql, int options) bool wxRecordSet::BeginQuery(int WXUNUSED(openType), char *WXUNUSED(sql), int WXUNUSED(options))
{ {
// Needs to construct an appropriate SQL statement. By default // Needs to construct an appropriate SQL statement. By default
// (i.e. if table and columns are provided) then // (i.e. if table and columns are provided) then
@@ -565,7 +566,7 @@ void wxRecordSet::FillVars(int recnum) {
do { do {
((wxQueryCol*)node->Data())->FillVar(recnum); ((wxQueryCol*)node->Data())->FillVar(recnum);
} while (node = node->Next()); } while ((node = node->Next()));
} }
bool wxRecordSet::GetResultSet(void) bool wxRecordSet::GetResultSet(void)
@@ -796,7 +797,7 @@ bool wxRecordSet::GetTables(void)
bool wxRecordSet::GetColumns(char* table) bool wxRecordSet::GetColumns(char* table)
{ {
char* name=NULL; char* name=NULL;
char* wildcard = "%"; // char* wildcard = "%";
name = table ? table : tablename; name = table ? table : tablename;
@@ -836,7 +837,7 @@ bool wxRecordSet::GetColumns(char* table)
bool wxRecordSet::GetPrimaryKeys(char* table) bool wxRecordSet::GetPrimaryKeys(char* table)
{ {
char* name=NULL; char* name=NULL;
char* wildcard = "%"; // char* wildcard = "%";
name = table ? table : tablename; name = table ? table : tablename;
@@ -875,7 +876,7 @@ bool wxRecordSet::GetForeignKeys(char* PkTableName, char * FkTableName)
{ {
char* Pkname=NULL; char* Pkname=NULL;
char* Fkname=NULL; char* Fkname=NULL;
char* wildcard = "%"; // char* wildcard = "%";
// Try to disable situation: both PkTableName and FkTableName are NULL // Try to disable situation: both PkTableName and FkTableName are NULL
// set Pkname from tablename // set Pkname from tablename
@@ -1371,7 +1372,7 @@ void wxRecordSet::SetFieldDirty(const char* name, bool dirty)
((wxQueryCol*)node->Data())->SetFieldDirty(cursor, dirty); ((wxQueryCol*)node->Data())->SetFieldDirty(cursor, dirty);
} }
void wxRecordSet::SetFieldNull(void *p, bool isNull) void wxRecordSet::SetFieldNull(void *WXUNUSED(p), bool WXUNUSED(isNull))
{ {
} }
@@ -1534,7 +1535,7 @@ long wxQueryCol::GetSize(int row) {
wxNode* node = fields.Nth(row); wxNode* node = fields.Nth(row);
if (!node) if (!node)
return NULL; return 0;
return ((wxQueryField*)node->Data())->GetSize(); return ((wxQueryField*)node->Data())->GetSize();
} }
@@ -1599,7 +1600,7 @@ bool wxQueryField::AllocData(void) {
{ {
if (data) // JACS if (data) // JACS
delete[] (char*)data; delete[] (char*)data;
if (data = new char[size+1]) if ((data = new char[size+1]))
{ {
char *str = (char *)data; char *str = (char *)data;
int i; int i;
@@ -1613,7 +1614,7 @@ bool wxQueryField::AllocData(void) {
{ {
if (data) // JACS if (data) // JACS
delete (long*)data; delete (long*)data;
if (data = new long) if ((data = new long))
*(long*)data = 0L; *(long*)data = 0L;
break; break;
} }
@@ -1621,7 +1622,7 @@ bool wxQueryField::AllocData(void) {
{ {
if (data) if (data)
delete (short*)data; delete (short*)data;
if (data = new short) if ((data = new short))
*(short*)data = 0; *(short*)data = 0;
break; break;
} }
@@ -1630,7 +1631,7 @@ bool wxQueryField::AllocData(void) {
{ {
if (data) if (data)
delete (double*)data; delete (double*)data;
if (data = new double) if ((data = new double))
*(double*)data = 0; *(double*)data = 0;
break; break;
} }
@@ -1638,7 +1639,7 @@ bool wxQueryField::AllocData(void) {
{ {
if (data) if (data)
delete (float*)data; delete (float*)data;
if (data = new float) if ((data = new float))
*(float*)data = (float)0; *(float*)data = (float)0;
break; break;
} }

View File

@@ -17,7 +17,7 @@
#include <wx/stream.h> #include <wx/stream.h>
#include <wx/zstream.h> #include <wx/zstream.h>
#include <wx/utils.h> #include <wx/utils.h>
#include "zlib.h" #include "../zlib/zlib.h"
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma hdrstop #pragma hdrstop

View File

@@ -18,6 +18,7 @@
#include "wx/postscrp.h" #include "wx/postscrp.h"
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/memory.h"
#include "unistd.h" #include "unistd.h"
@@ -285,6 +286,18 @@ int wxEntry( int argc, char *argv[] )
wxClassInfo::InitializeClasses(); wxClassInfo::InitializeClasses();
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
#if !defined(_WINDLL)
streambuf* sBuf = new wxDebugStreamBuf;
#else
streambuf* sBuf = NULL;
#endif
ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf);
#endif
if (!wxTheApp) if (!wxTheApp)
{ {
if (!wxApp::GetInitializerFunction()) if (!wxApp::GetInitializerFunction())
@@ -347,6 +360,20 @@ int wxEntry( int argc, char *argv[] )
wxApp::CommonCleanUp(); wxApp::CommonCleanUp();
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
// wxDebugContext, too.
if (wxDebugContext::CountObjectsLeft() > 0)
{
wxTrace("There were memory leaks.\n");
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
wxDebugContext::SetStream(NULL, NULL);
#endif
return retValue; return retValue;
}; };

View File

@@ -649,6 +649,46 @@ void wxPaintDC::SetBrush( const wxBrush &brush )
}; };
}; };
// CMB 21/7/98: Added SetBackground. Sets background brush
// for Clear() and bg colour for shapes filled with cross-hatch brush
void wxPaintDC::SetBackground( const wxBrush &brush )
{
if (!Ok()) return;
if (m_backgroundBrush == brush) return;
m_backgroundBrush = brush;
if (!m_backgroundBrush.Ok()) return;
m_backgroundBrush.GetColour().CalcPixel( m_cmap );
gdk_gc_set_background( m_brushGC, m_backgroundBrush.GetColour().GetColor() );
gdk_gc_set_foreground( m_bgGC, m_backgroundBrush.GetColour().GetColor() );
GdkFill fillStyle = GDK_SOLID;
switch (m_backgroundBrush.GetStyle())
{
case wxSOLID:
case wxTRANSPARENT:
break;
default:
fillStyle = GDK_STIPPLED;
};
gdk_gc_set_fill( m_bgGC, fillStyle );
if (m_backgroundBrush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_stipple( m_bgGC, m_backgroundBrush.GetStipple()->GetPixmap() );
};
if (IS_HATCH(m_backgroundBrush.GetStyle()))
{
int num = m_backgroundBrush.GetStyle() - wxBDIAGONAL_HATCH;
gdk_gc_set_stipple( m_bgGC, hatches[num] );
};
};
void wxPaintDC::SetLogicalFunction( int function ) void wxPaintDC::SetLogicalFunction( int function )
{ {
if (m_logicalFunction == function) return; if (m_logicalFunction == function) return;
@@ -693,6 +733,14 @@ void wxPaintDC::SetTextBackground( const wxColour &col )
void wxPaintDC::SetBackgroundMode( int mode ) void wxPaintDC::SetBackgroundMode( int mode )
{ {
m_backgroundMode = mode; m_backgroundMode = mode;
// CMB 21/7/98: fill style of cross-hatch brushes is affected by
// transparent/solid background mode
if (m_brush.GetStyle() != wxSOLID && m_brush.GetStyle() != wxTRANSPARENT)
{
gdk_gc_set_fill( m_brushGC,
(m_backgroundMode == wxTRANSPARENT) ? GDK_STIPPLED : GDK_OPAQUE_STIPPLED);
}
}; };
void wxPaintDC::SetPalette( const wxPalette& WXUNUSED(palette) ) void wxPaintDC::SetPalette( const wxPalette& WXUNUSED(palette) )

View File

@@ -77,7 +77,9 @@ wxFrame::wxFrame()
m_doingOnSize = FALSE; m_doingOnSize = FALSE;
m_frameMenuBar = NULL; m_frameMenuBar = NULL;
m_frameStatusBar = NULL; m_frameStatusBar = NULL;
m_frameToolBar = NULL;
m_sizeSet = FALSE; m_sizeSet = FALSE;
m_addPrivateChild = FALSE;
wxTopLevelWindows.Insert( this ); wxTopLevelWindows.Insert( this );
}; };
@@ -85,7 +87,12 @@ wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
const wxPoint &pos, const wxSize &size, const wxPoint &pos, const wxSize &size,
long style, const wxString &name ) long style, const wxString &name )
{ {
m_doingOnSize = FALSE;
m_frameMenuBar = NULL;
m_frameStatusBar = NULL;
m_frameToolBar = NULL;
m_sizeSet = FALSE; m_sizeSet = FALSE;
m_addPrivateChild = FALSE;
Create( parent, id, title, pos, size, style, name ); Create( parent, id, title, pos, size, style, name );
wxTopLevelWindows.Insert( this ); wxTopLevelWindows.Insert( this );
}; };
@@ -131,9 +138,6 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
gtk_container_add( GTK_CONTAINER(m_mainWindow), m_wxwindow ); gtk_container_add( GTK_CONTAINER(m_mainWindow), m_wxwindow );
m_frameMenuBar = NULL;
m_frameStatusBar = NULL;
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate", gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this ); GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
@@ -195,6 +199,12 @@ void wxFrame::GetClientSize( int *width, int *height ) const
{ {
if (m_frameMenuBar) (*height) -= wxMENU_HEIGHT; if (m_frameMenuBar) (*height) -= wxMENU_HEIGHT;
if (m_frameStatusBar) (*height) -= wxSTATUS_HEIGHT; if (m_frameStatusBar) (*height) -= wxSTATUS_HEIGHT;
if (m_frameToolBar)
{
int y = 0;
m_frameToolBar->GetSize( NULL, &y );
(*height) -= y;
}
}; };
}; };
@@ -236,6 +246,12 @@ void wxFrame::GtkOnSize( int x, int y, int width, int height )
main_height -= wxMENU_HEIGHT; main_height -= wxMENU_HEIGHT;
}; };
int toolbar_height = 0;
if (m_frameToolBar) m_frameToolBar->GetSize( NULL, &toolbar_height );
main_y += toolbar_height;
main_height -= toolbar_height;
gtk_widget_set_uposition( GTK_WIDGET(m_wxwindow), main_x, main_y ); gtk_widget_set_uposition( GTK_WIDGET(m_wxwindow), main_x, main_y );
gtk_widget_set_usize( GTK_WIDGET(m_wxwindow), main_width, main_height ); gtk_widget_set_usize( GTK_WIDGET(m_wxwindow), main_width, main_height );
@@ -245,6 +261,12 @@ void wxFrame::GtkOnSize( int x, int y, int width, int height )
gtk_widget_set_usize( m_frameMenuBar->m_widget, width-2, wxMENU_HEIGHT-2 ); gtk_widget_set_usize( m_frameMenuBar->m_widget, width-2, wxMENU_HEIGHT-2 );
}; };
if (m_frameToolBar)
{
gtk_widget_set_uposition( m_frameToolBar->m_widget, 1, wxMENU_HEIGHT );
gtk_widget_set_usize( m_frameToolBar->m_widget, width-2, toolbar_height );
};
if (m_frameStatusBar) if (m_frameStatusBar)
{ {
m_frameStatusBar->SetSize( 0, main_height-wxSTATUS_HEIGHT, width, wxSTATUS_HEIGHT ); m_frameStatusBar->SetSize( 0, main_height-wxSTATUS_HEIGHT, width, wxSTATUS_HEIGHT );
@@ -265,7 +287,7 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
// no child: go out ! // no child: go out !
if (!GetChildren()->First()) if (!GetChildren()->First())
return; return;
// do we have exactly one child? // do we have exactly one child?
wxWindow *child = NULL; wxWindow *child = NULL;
for(wxNode *node = GetChildren()->First(); node; node = node->Next()) for(wxNode *node = GetChildren()->First(); node; node = node->Next())
@@ -273,8 +295,9 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
wxWindow *win = (wxWindow *)node->Data(); wxWindow *win = (wxWindow *)node->Data();
if (!win->IsKindOf(CLASSINFO(wxFrame)) && if (!win->IsKindOf(CLASSINFO(wxFrame)) &&
!win->IsKindOf(CLASSINFO(wxDialog)) !win->IsKindOf(CLASSINFO(wxDialog))
#if 0 // not in m_children anyway #if 0 // not in m_children anyway
&& (win != m_frameMenuBar) && && (win != m_frameMenuBar) &&
(win != m_frameToolBar) &&
(win != m_frameStatusBar) (win != m_frameStatusBar)
#endif #endif
) )
@@ -293,6 +316,25 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
} }
}; };
void wxFrame::AddChild( wxWindow *child )
{
if (m_addPrivateChild)
{
gtk_myfixed_put( GTK_MYFIXED(m_mainWindow), child->m_widget, child->m_x, child->m_y );
gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
}
else
{
m_children.Append( child );
if (m_wxwindow)
gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget, child->m_x, child->m_y );
gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
}
};
static void SetInvokingWindow( wxMenu *menu, wxWindow *win ) static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
{ {
menu->SetInvokingWindow( win ); menu->SetInvokingWindow( win );
@@ -329,6 +371,27 @@ void wxFrame::SetMenuBar( wxMenuBar *menuBar )
} }
}; };
wxMenuBar *wxFrame::GetMenuBar(void)
{
return m_frameMenuBar;
};
wxToolBar *wxFrame::CreateToolBar( int style, int WXUNUSED(orientation), int WXUNUSED(rowsOrColumns) )
{
m_addPrivateChild = TRUE;
m_frameToolBar = new wxToolBar( this, -1, wxDefaultPosition, wxDefaultSize, style );
m_addPrivateChild = FALSE;
return m_frameToolBar;
};
wxToolBar *wxFrame::GetToolBar(void)
{
return m_frameToolBar;
};
bool wxFrame::CreateStatusBar( int number ) bool wxFrame::CreateStatusBar( int number )
{ {
if (m_frameStatusBar) if (m_frameStatusBar)
@@ -350,25 +413,20 @@ void wxFrame::SetStatusWidths( int n, int *width )
if (m_frameStatusBar) m_frameStatusBar->SetStatusWidths( n, width ); if (m_frameStatusBar) m_frameStatusBar->SetStatusWidths( n, width );
}; };
wxStatusBar *wxFrame::GetStatusBar() wxStatusBar *wxFrame::GetStatusBar(void)
{ {
return m_frameStatusBar; return m_frameStatusBar;
}; };
wxMenuBar *wxFrame::GetMenuBar()
{
return m_frameMenuBar;
};
void wxFrame::SetTitle( const wxString &title ) void wxFrame::SetTitle( const wxString &title )
{ {
m_title = title; m_title = title;
gtk_window_set_title( GTK_WINDOW(m_widget), title ); gtk_window_set_title( GTK_WINDOW(m_widget), title );
}; };
void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int incW) void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) )
{ {
// VZ: I don't know a way to set the max size for the window in GTK and have if (m_wxwindow)
// no idea about what incW might be gdk_window_set_hints( m_wxwindow->window, -1, -1,
gtk_widget_set_usize(m_widget, minW, minH); minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
} }

View File

@@ -69,7 +69,6 @@ wxMDIParentFrame::wxMDIParentFrame(void)
m_clientWindow = NULL; m_clientWindow = NULL;
m_currentChild = NULL; m_currentChild = NULL;
m_parentFrameActive = TRUE; m_parentFrameActive = TRUE;
m_toolBar = NULL;
}; };
wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent, wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
@@ -80,7 +79,6 @@ wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
m_clientWindow = NULL; m_clientWindow = NULL;
m_currentChild = NULL; m_currentChild = NULL;
m_parentFrameActive = TRUE; m_parentFrameActive = TRUE;
m_toolBar = NULL;
Create( parent, id, title, pos, size, style, name ); Create( parent, id, title, pos, size, style, name );
}; };
@@ -132,16 +130,6 @@ void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
wxFrame::GetClientSize( width, height ); wxFrame::GetClientSize( width, height );
}; };
void wxMDIParentFrame::SetToolBar( wxToolBar *toolbar )
{
m_toolBar = toolbar;
};
wxWindow *wxMDIParentFrame::GetToolBar(void) const
{
return m_toolBar;
};
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const
{ {
return m_currentChild; return m_currentChild;
@@ -250,7 +238,8 @@ static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
while (node) while (node)
{ {
wxMenuItem *menuitem = (wxMenuItem*)node->Data(); wxMenuItem *menuitem = (wxMenuItem*)node->Data();
if (menuitem->GetSubMenu()) SetInvokingWindow( menuitem->GetSubMenu(), win ); if (menuitem->IsSubMenu())
SetInvokingWindow( menuitem->GetSubMenu(), win );
node = node->Next(); node = node->Next();
}; };
}; };
@@ -346,7 +335,7 @@ void wxMDIClientWindow::AddChild( wxWindow *child )
gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate", gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)child ); GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)child );
gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), child->m_widget, label_widget ); gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), child->m_widget, label_widget );
mdi_child->m_page = (GtkNotebookPage*) (g_list_last(GTK_NOTEBOOK(m_widget)->children)->data); mdi_child->m_page = (GtkNotebookPage*) (g_list_last(GTK_NOTEBOOK(m_widget)->children)->data);

View File

@@ -106,9 +106,17 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
bool wxToolBar::OnLeftClick( int toolIndex, bool toggleDown ) bool wxToolBar::OnLeftClick( int toolIndex, bool toggleDown )
{ {
wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, toolIndex );
event.SetEventObject( this );
event.SetInt( toolIndex );
event.SetExtraLong( (long) toggleDown);
/*
wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, toolIndex); wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, toolIndex);
event.SetEventObject(this); event.SetEventObject(this);
event.SetInt( toolIndex );
event.SetExtraLong((long) toggleDown); event.SetExtraLong((long) toggleDown);
*/
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
@@ -117,8 +125,9 @@ bool wxToolBar::OnLeftClick( int toolIndex, bool toggleDown )
void wxToolBar::OnRightClick( int toolIndex, float WXUNUSED(x), float WXUNUSED(y) ) void wxToolBar::OnRightClick( int toolIndex, float WXUNUSED(x), float WXUNUSED(y) )
{ {
wxCommandEvent event(wxEVT_COMMAND_TOOL_RCLICKED, toolIndex); wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, toolIndex );
event.SetEventObject(this); event.SetEventObject( this );
event.SetInt( toolIndex );
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
}; };
@@ -127,6 +136,7 @@ void wxToolBar::OnMouseEnter( int toolIndex )
{ {
wxCommandEvent event(wxEVT_COMMAND_TOOL_ENTER, toolIndex); wxCommandEvent event(wxEVT_COMMAND_TOOL_ENTER, toolIndex);
event.SetEventObject(this); event.SetEventObject(this);
event.SetInt( toolIndex );
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
}; };
@@ -169,6 +179,29 @@ void wxToolBar::ClearTools(void)
{ {
}; };
void wxToolBar::Layout(void)
{
m_x = 0;
m_y = 0;
m_width = 100;
m_height = 0;
wxNode *node = m_tools.First();
while (node)
{
wxToolBarTool *tool = (wxToolBarTool*)node->Data();
if (tool->m_bitmap1.Ok())
{
int tool_height = tool->m_bitmap1.GetHeight();
if (tool_height > m_height) m_height = tool_height;
};
node = node->Next();
};
m_height += 10;
};
void wxToolBar::EnableTool(int toolIndex, bool enable) void wxToolBar::EnableTool(int toolIndex, bool enable)
{ {
}; };

View File

@@ -308,7 +308,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &WXUNUSED(event) )
{ {
}; };
int wxTextCtrl::overflow(int c) int wxTextCtrl::overflow( int WXUNUSED(c) )
{ {
int len = pptr() - pbase(); int len = pptr() - pbase();
char *txt = new char[len+1]; char *txt = new char[len+1];

View File

@@ -1417,7 +1417,6 @@ void wxWindow::SetFocus(void)
bool wxWindow::OnClose(void) bool wxWindow::OnClose(void)
{ {
printf( "OnClose event.\n" );
return TRUE; return TRUE;
}; };
@@ -1431,6 +1430,21 @@ void wxWindow::AddChild( wxWindow *child )
// for wxFrame, wxDialog, wxWindow and // for wxFrame, wxDialog, wxWindow and
// wxMDIParentFrame. // wxMDIParentFrame.
// wxFrame and wxDialog as children aren't placed into the parents
if (child->IsKindOf(CLASSINFO(wxFrame)) || child->IsKindOf(CLASSINFO(wxDialog)))
{
m_children.Append( child );
if ((child->m_x != -1) && (child->m_y != -1))
gtk_widget_set_uposition( child->m_widget, child->m_x, child->m_y );
return;
}
// In the case of an wxMDIChildFrame descendant, we use the
// client windows's AddChild()
if (IsKindOf(CLASSINFO(wxMDIParentFrame))) if (IsKindOf(CLASSINFO(wxMDIParentFrame)))
{ {
if (child->IsKindOf(CLASSINFO(wxMDIChildFrame))) if (child->IsKindOf(CLASSINFO(wxMDIChildFrame)))
@@ -1440,30 +1454,32 @@ void wxWindow::AddChild( wxWindow *child )
{ {
client->AddChild( child ); client->AddChild( child );
return; return;
}; }
}; }
}; }
// wxNotebooks are very special, so they have their own AddChild // wxNotebook is very special, so it has a private AddChild()
if (IsKindOf(CLASSINFO(wxNotebook))) if (IsKindOf(CLASSINFO(wxNotebook)))
{ {
wxNotebook *tab = (wxNotebook*)this; wxNotebook *tab = (wxNotebook*)this;
tab->AddChild( child ); tab->AddChild( child );
return; return;
}; }
// wxFrame has a private AddChild
if (IsKindOf(CLASSINFO(wxFrame)))
{
wxFrame *frame = (wxFrame*)this;
frame->AddChild( child );
return;
}
// All the rest
m_children.Append( child ); m_children.Append( child );
if (child->IsKindOf(CLASSINFO(wxFrame)) || child->IsKindOf(CLASSINFO(wxDialog))) if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget, child->m_x, child->m_y );
{
if ((child->m_x != -1) && (child->m_y != -1))
gtk_widget_set_uposition( child->m_widget, child->m_x, child->m_y );
}
else
{
if (m_wxwindow)
gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget, child->m_x, child->m_y );
};
gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height ); gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
}; };

View File

@@ -18,6 +18,7 @@
#include "wx/postscrp.h" #include "wx/postscrp.h"
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/memory.h"
#include "unistd.h" #include "unistd.h"
@@ -285,6 +286,18 @@ int wxEntry( int argc, char *argv[] )
wxClassInfo::InitializeClasses(); wxClassInfo::InitializeClasses();
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
#if !defined(_WINDLL)
streambuf* sBuf = new wxDebugStreamBuf;
#else
streambuf* sBuf = NULL;
#endif
ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf);
#endif
if (!wxTheApp) if (!wxTheApp)
{ {
if (!wxApp::GetInitializerFunction()) if (!wxApp::GetInitializerFunction())
@@ -347,6 +360,20 @@ int wxEntry( int argc, char *argv[] )
wxApp::CommonCleanUp(); wxApp::CommonCleanUp();
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
// wxDebugContext, too.
if (wxDebugContext::CountObjectsLeft() > 0)
{
wxTrace("There were memory leaks.\n");
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
wxDebugContext::SetStream(NULL, NULL);
#endif
return retValue; return retValue;
}; };

View File

@@ -649,6 +649,46 @@ void wxPaintDC::SetBrush( const wxBrush &brush )
}; };
}; };
// CMB 21/7/98: Added SetBackground. Sets background brush
// for Clear() and bg colour for shapes filled with cross-hatch brush
void wxPaintDC::SetBackground( const wxBrush &brush )
{
if (!Ok()) return;
if (m_backgroundBrush == brush) return;
m_backgroundBrush = brush;
if (!m_backgroundBrush.Ok()) return;
m_backgroundBrush.GetColour().CalcPixel( m_cmap );
gdk_gc_set_background( m_brushGC, m_backgroundBrush.GetColour().GetColor() );
gdk_gc_set_foreground( m_bgGC, m_backgroundBrush.GetColour().GetColor() );
GdkFill fillStyle = GDK_SOLID;
switch (m_backgroundBrush.GetStyle())
{
case wxSOLID:
case wxTRANSPARENT:
break;
default:
fillStyle = GDK_STIPPLED;
};
gdk_gc_set_fill( m_bgGC, fillStyle );
if (m_backgroundBrush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_stipple( m_bgGC, m_backgroundBrush.GetStipple()->GetPixmap() );
};
if (IS_HATCH(m_backgroundBrush.GetStyle()))
{
int num = m_backgroundBrush.GetStyle() - wxBDIAGONAL_HATCH;
gdk_gc_set_stipple( m_bgGC, hatches[num] );
};
};
void wxPaintDC::SetLogicalFunction( int function ) void wxPaintDC::SetLogicalFunction( int function )
{ {
if (m_logicalFunction == function) return; if (m_logicalFunction == function) return;
@@ -693,6 +733,14 @@ void wxPaintDC::SetTextBackground( const wxColour &col )
void wxPaintDC::SetBackgroundMode( int mode ) void wxPaintDC::SetBackgroundMode( int mode )
{ {
m_backgroundMode = mode; m_backgroundMode = mode;
// CMB 21/7/98: fill style of cross-hatch brushes is affected by
// transparent/solid background mode
if (m_brush.GetStyle() != wxSOLID && m_brush.GetStyle() != wxTRANSPARENT)
{
gdk_gc_set_fill( m_brushGC,
(m_backgroundMode == wxTRANSPARENT) ? GDK_STIPPLED : GDK_OPAQUE_STIPPLED);
}
}; };
void wxPaintDC::SetPalette( const wxPalette& WXUNUSED(palette) ) void wxPaintDC::SetPalette( const wxPalette& WXUNUSED(palette) )

View File

@@ -77,7 +77,9 @@ wxFrame::wxFrame()
m_doingOnSize = FALSE; m_doingOnSize = FALSE;
m_frameMenuBar = NULL; m_frameMenuBar = NULL;
m_frameStatusBar = NULL; m_frameStatusBar = NULL;
m_frameToolBar = NULL;
m_sizeSet = FALSE; m_sizeSet = FALSE;
m_addPrivateChild = FALSE;
wxTopLevelWindows.Insert( this ); wxTopLevelWindows.Insert( this );
}; };
@@ -85,7 +87,12 @@ wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
const wxPoint &pos, const wxSize &size, const wxPoint &pos, const wxSize &size,
long style, const wxString &name ) long style, const wxString &name )
{ {
m_doingOnSize = FALSE;
m_frameMenuBar = NULL;
m_frameStatusBar = NULL;
m_frameToolBar = NULL;
m_sizeSet = FALSE; m_sizeSet = FALSE;
m_addPrivateChild = FALSE;
Create( parent, id, title, pos, size, style, name ); Create( parent, id, title, pos, size, style, name );
wxTopLevelWindows.Insert( this ); wxTopLevelWindows.Insert( this );
}; };
@@ -131,9 +138,6 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
gtk_container_add( GTK_CONTAINER(m_mainWindow), m_wxwindow ); gtk_container_add( GTK_CONTAINER(m_mainWindow), m_wxwindow );
m_frameMenuBar = NULL;
m_frameStatusBar = NULL;
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate", gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this ); GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
@@ -195,6 +199,12 @@ void wxFrame::GetClientSize( int *width, int *height ) const
{ {
if (m_frameMenuBar) (*height) -= wxMENU_HEIGHT; if (m_frameMenuBar) (*height) -= wxMENU_HEIGHT;
if (m_frameStatusBar) (*height) -= wxSTATUS_HEIGHT; if (m_frameStatusBar) (*height) -= wxSTATUS_HEIGHT;
if (m_frameToolBar)
{
int y = 0;
m_frameToolBar->GetSize( NULL, &y );
(*height) -= y;
}
}; };
}; };
@@ -236,6 +246,12 @@ void wxFrame::GtkOnSize( int x, int y, int width, int height )
main_height -= wxMENU_HEIGHT; main_height -= wxMENU_HEIGHT;
}; };
int toolbar_height = 0;
if (m_frameToolBar) m_frameToolBar->GetSize( NULL, &toolbar_height );
main_y += toolbar_height;
main_height -= toolbar_height;
gtk_widget_set_uposition( GTK_WIDGET(m_wxwindow), main_x, main_y ); gtk_widget_set_uposition( GTK_WIDGET(m_wxwindow), main_x, main_y );
gtk_widget_set_usize( GTK_WIDGET(m_wxwindow), main_width, main_height ); gtk_widget_set_usize( GTK_WIDGET(m_wxwindow), main_width, main_height );
@@ -245,6 +261,12 @@ void wxFrame::GtkOnSize( int x, int y, int width, int height )
gtk_widget_set_usize( m_frameMenuBar->m_widget, width-2, wxMENU_HEIGHT-2 ); gtk_widget_set_usize( m_frameMenuBar->m_widget, width-2, wxMENU_HEIGHT-2 );
}; };
if (m_frameToolBar)
{
gtk_widget_set_uposition( m_frameToolBar->m_widget, 1, wxMENU_HEIGHT );
gtk_widget_set_usize( m_frameToolBar->m_widget, width-2, toolbar_height );
};
if (m_frameStatusBar) if (m_frameStatusBar)
{ {
m_frameStatusBar->SetSize( 0, main_height-wxSTATUS_HEIGHT, width, wxSTATUS_HEIGHT ); m_frameStatusBar->SetSize( 0, main_height-wxSTATUS_HEIGHT, width, wxSTATUS_HEIGHT );
@@ -265,7 +287,7 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
// no child: go out ! // no child: go out !
if (!GetChildren()->First()) if (!GetChildren()->First())
return; return;
// do we have exactly one child? // do we have exactly one child?
wxWindow *child = NULL; wxWindow *child = NULL;
for(wxNode *node = GetChildren()->First(); node; node = node->Next()) for(wxNode *node = GetChildren()->First(); node; node = node->Next())
@@ -273,8 +295,9 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
wxWindow *win = (wxWindow *)node->Data(); wxWindow *win = (wxWindow *)node->Data();
if (!win->IsKindOf(CLASSINFO(wxFrame)) && if (!win->IsKindOf(CLASSINFO(wxFrame)) &&
!win->IsKindOf(CLASSINFO(wxDialog)) !win->IsKindOf(CLASSINFO(wxDialog))
#if 0 // not in m_children anyway #if 0 // not in m_children anyway
&& (win != m_frameMenuBar) && && (win != m_frameMenuBar) &&
(win != m_frameToolBar) &&
(win != m_frameStatusBar) (win != m_frameStatusBar)
#endif #endif
) )
@@ -293,6 +316,25 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
} }
}; };
void wxFrame::AddChild( wxWindow *child )
{
if (m_addPrivateChild)
{
gtk_myfixed_put( GTK_MYFIXED(m_mainWindow), child->m_widget, child->m_x, child->m_y );
gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
}
else
{
m_children.Append( child );
if (m_wxwindow)
gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget, child->m_x, child->m_y );
gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
}
};
static void SetInvokingWindow( wxMenu *menu, wxWindow *win ) static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
{ {
menu->SetInvokingWindow( win ); menu->SetInvokingWindow( win );
@@ -329,6 +371,27 @@ void wxFrame::SetMenuBar( wxMenuBar *menuBar )
} }
}; };
wxMenuBar *wxFrame::GetMenuBar(void)
{
return m_frameMenuBar;
};
wxToolBar *wxFrame::CreateToolBar( int style, int WXUNUSED(orientation), int WXUNUSED(rowsOrColumns) )
{
m_addPrivateChild = TRUE;
m_frameToolBar = new wxToolBar( this, -1, wxDefaultPosition, wxDefaultSize, style );
m_addPrivateChild = FALSE;
return m_frameToolBar;
};
wxToolBar *wxFrame::GetToolBar(void)
{
return m_frameToolBar;
};
bool wxFrame::CreateStatusBar( int number ) bool wxFrame::CreateStatusBar( int number )
{ {
if (m_frameStatusBar) if (m_frameStatusBar)
@@ -350,25 +413,20 @@ void wxFrame::SetStatusWidths( int n, int *width )
if (m_frameStatusBar) m_frameStatusBar->SetStatusWidths( n, width ); if (m_frameStatusBar) m_frameStatusBar->SetStatusWidths( n, width );
}; };
wxStatusBar *wxFrame::GetStatusBar() wxStatusBar *wxFrame::GetStatusBar(void)
{ {
return m_frameStatusBar; return m_frameStatusBar;
}; };
wxMenuBar *wxFrame::GetMenuBar()
{
return m_frameMenuBar;
};
void wxFrame::SetTitle( const wxString &title ) void wxFrame::SetTitle( const wxString &title )
{ {
m_title = title; m_title = title;
gtk_window_set_title( GTK_WINDOW(m_widget), title ); gtk_window_set_title( GTK_WINDOW(m_widget), title );
}; };
void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int incW) void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) )
{ {
// VZ: I don't know a way to set the max size for the window in GTK and have if (m_wxwindow)
// no idea about what incW might be gdk_window_set_hints( m_wxwindow->window, -1, -1,
gtk_widget_set_usize(m_widget, minW, minH); minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE );
} }

View File

@@ -69,7 +69,6 @@ wxMDIParentFrame::wxMDIParentFrame(void)
m_clientWindow = NULL; m_clientWindow = NULL;
m_currentChild = NULL; m_currentChild = NULL;
m_parentFrameActive = TRUE; m_parentFrameActive = TRUE;
m_toolBar = NULL;
}; };
wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent, wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
@@ -80,7 +79,6 @@ wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
m_clientWindow = NULL; m_clientWindow = NULL;
m_currentChild = NULL; m_currentChild = NULL;
m_parentFrameActive = TRUE; m_parentFrameActive = TRUE;
m_toolBar = NULL;
Create( parent, id, title, pos, size, style, name ); Create( parent, id, title, pos, size, style, name );
}; };
@@ -132,16 +130,6 @@ void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
wxFrame::GetClientSize( width, height ); wxFrame::GetClientSize( width, height );
}; };
void wxMDIParentFrame::SetToolBar( wxToolBar *toolbar )
{
m_toolBar = toolbar;
};
wxWindow *wxMDIParentFrame::GetToolBar(void) const
{
return m_toolBar;
};
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const
{ {
return m_currentChild; return m_currentChild;
@@ -250,7 +238,8 @@ static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
while (node) while (node)
{ {
wxMenuItem *menuitem = (wxMenuItem*)node->Data(); wxMenuItem *menuitem = (wxMenuItem*)node->Data();
if (menuitem->GetSubMenu()) SetInvokingWindow( menuitem->GetSubMenu(), win ); if (menuitem->IsSubMenu())
SetInvokingWindow( menuitem->GetSubMenu(), win );
node = node->Next(); node = node->Next();
}; };
}; };
@@ -346,7 +335,7 @@ void wxMDIClientWindow::AddChild( wxWindow *child )
gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate", gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)child ); GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)child );
gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), child->m_widget, label_widget ); gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), child->m_widget, label_widget );
mdi_child->m_page = (GtkNotebookPage*) (g_list_last(GTK_NOTEBOOK(m_widget)->children)->data); mdi_child->m_page = (GtkNotebookPage*) (g_list_last(GTK_NOTEBOOK(m_widget)->children)->data);

View File

@@ -106,9 +106,17 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
bool wxToolBar::OnLeftClick( int toolIndex, bool toggleDown ) bool wxToolBar::OnLeftClick( int toolIndex, bool toggleDown )
{ {
wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, toolIndex );
event.SetEventObject( this );
event.SetInt( toolIndex );
event.SetExtraLong( (long) toggleDown);
/*
wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, toolIndex); wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, toolIndex);
event.SetEventObject(this); event.SetEventObject(this);
event.SetInt( toolIndex );
event.SetExtraLong((long) toggleDown); event.SetExtraLong((long) toggleDown);
*/
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
@@ -117,8 +125,9 @@ bool wxToolBar::OnLeftClick( int toolIndex, bool toggleDown )
void wxToolBar::OnRightClick( int toolIndex, float WXUNUSED(x), float WXUNUSED(y) ) void wxToolBar::OnRightClick( int toolIndex, float WXUNUSED(x), float WXUNUSED(y) )
{ {
wxCommandEvent event(wxEVT_COMMAND_TOOL_RCLICKED, toolIndex); wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, toolIndex );
event.SetEventObject(this); event.SetEventObject( this );
event.SetInt( toolIndex );
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
}; };
@@ -127,6 +136,7 @@ void wxToolBar::OnMouseEnter( int toolIndex )
{ {
wxCommandEvent event(wxEVT_COMMAND_TOOL_ENTER, toolIndex); wxCommandEvent event(wxEVT_COMMAND_TOOL_ENTER, toolIndex);
event.SetEventObject(this); event.SetEventObject(this);
event.SetInt( toolIndex );
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
}; };
@@ -169,6 +179,29 @@ void wxToolBar::ClearTools(void)
{ {
}; };
void wxToolBar::Layout(void)
{
m_x = 0;
m_y = 0;
m_width = 100;
m_height = 0;
wxNode *node = m_tools.First();
while (node)
{
wxToolBarTool *tool = (wxToolBarTool*)node->Data();
if (tool->m_bitmap1.Ok())
{
int tool_height = tool->m_bitmap1.GetHeight();
if (tool_height > m_height) m_height = tool_height;
};
node = node->Next();
};
m_height += 10;
};
void wxToolBar::EnableTool(int toolIndex, bool enable) void wxToolBar::EnableTool(int toolIndex, bool enable)
{ {
}; };

View File

@@ -308,7 +308,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &WXUNUSED(event) )
{ {
}; };
int wxTextCtrl::overflow(int c) int wxTextCtrl::overflow( int WXUNUSED(c) )
{ {
int len = pptr() - pbase(); int len = pptr() - pbase();
char *txt = new char[len+1]; char *txt = new char[len+1];

View File

@@ -1417,7 +1417,6 @@ void wxWindow::SetFocus(void)
bool wxWindow::OnClose(void) bool wxWindow::OnClose(void)
{ {
printf( "OnClose event.\n" );
return TRUE; return TRUE;
}; };
@@ -1431,6 +1430,21 @@ void wxWindow::AddChild( wxWindow *child )
// for wxFrame, wxDialog, wxWindow and // for wxFrame, wxDialog, wxWindow and
// wxMDIParentFrame. // wxMDIParentFrame.
// wxFrame and wxDialog as children aren't placed into the parents
if (child->IsKindOf(CLASSINFO(wxFrame)) || child->IsKindOf(CLASSINFO(wxDialog)))
{
m_children.Append( child );
if ((child->m_x != -1) && (child->m_y != -1))
gtk_widget_set_uposition( child->m_widget, child->m_x, child->m_y );
return;
}
// In the case of an wxMDIChildFrame descendant, we use the
// client windows's AddChild()
if (IsKindOf(CLASSINFO(wxMDIParentFrame))) if (IsKindOf(CLASSINFO(wxMDIParentFrame)))
{ {
if (child->IsKindOf(CLASSINFO(wxMDIChildFrame))) if (child->IsKindOf(CLASSINFO(wxMDIChildFrame)))
@@ -1440,30 +1454,32 @@ void wxWindow::AddChild( wxWindow *child )
{ {
client->AddChild( child ); client->AddChild( child );
return; return;
}; }
}; }
}; }
// wxNotebooks are very special, so they have their own AddChild // wxNotebook is very special, so it has a private AddChild()
if (IsKindOf(CLASSINFO(wxNotebook))) if (IsKindOf(CLASSINFO(wxNotebook)))
{ {
wxNotebook *tab = (wxNotebook*)this; wxNotebook *tab = (wxNotebook*)this;
tab->AddChild( child ); tab->AddChild( child );
return; return;
}; }
// wxFrame has a private AddChild
if (IsKindOf(CLASSINFO(wxFrame)))
{
wxFrame *frame = (wxFrame*)this;
frame->AddChild( child );
return;
}
// All the rest
m_children.Append( child ); m_children.Append( child );
if (child->IsKindOf(CLASSINFO(wxFrame)) || child->IsKindOf(CLASSINFO(wxDialog))) if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget, child->m_x, child->m_y );
{
if ((child->m_x != -1) && (child->m_y != -1))
gtk_widget_set_uposition( child->m_widget, child->m_x, child->m_y );
}
else
{
if (m_wxwindow)
gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget, child->m_x, child->m_y );
};
gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height ); gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
}; };

View File

@@ -1,7 +1,9 @@
#ifndef _LINUX_CONFIG_H #ifndef _LINUX_CONFIG_H
#define _LINUX_CONFIG_H #define _LINUX_CONFIG_H
#ifdef __LINUX__
#include <linux/autoconf.h> #include <linux/autoconf.h>
#endif
/* /*
* Defines for what uname() should return * Defines for what uname() should return

View File

@@ -79,24 +79,16 @@ const ID_MD = 502;
IMPLEMENT_DYNAMIC_CLASS( MyFrame, wxFrame ) IMPLEMENT_DYNAMIC_CLASS( MyFrame, wxFrame )
BEGIN_EVENT_TABLE(MyFrame,wxFrame) BEGIN_EVENT_TABLE(MyFrame,wxFrame)
EVT_SIZE (MyFrame::OnSize)
EVT_MENU (ID_ABOUT, MyFrame::OnAbout) EVT_MENU (ID_ABOUT, MyFrame::OnAbout)
EVT_TOOL (ID_ABOUT, MyFrame::OnAbout)
EVT_MENU (ID_QUIT, MyFrame::OnCommand) EVT_MENU (ID_QUIT, MyFrame::OnCommand)
EVT_TOOL (ID_QUIT, MyFrame::OnCommand)
EVT_MENU (ID_HOME, MyFrame::OnCommand) EVT_MENU (ID_HOME, MyFrame::OnCommand)
EVT_TOOL (ID_HOME, MyFrame::OnCommand)
EVT_MENU (ID_PARENT, MyFrame::OnCommand) EVT_MENU (ID_PARENT, MyFrame::OnCommand)
EVT_TOOL (ID_PARENT, MyFrame::OnCommand)
EVT_MENU (ID_LIST, MyFrame::OnView) EVT_MENU (ID_LIST, MyFrame::OnView)
EVT_MENU (ID_REPORT, MyFrame::OnView) EVT_MENU (ID_REPORT, MyFrame::OnView)
EVT_MENU (ID_ICON, MyFrame::OnView) EVT_MENU (ID_ICON, MyFrame::OnView)
EVT_TOOL (ID_LIST, MyFrame::OnView) EVT_MENU (ID_TREE, MyFrame::OnView)
EVT_TOOL (ID_REPORT, MyFrame::OnView) EVT_MENU (ID_SINGLE, MyFrame::OnView)
EVT_TOOL (ID_ICON, MyFrame::OnView) EVT_MENU (ID_COMMANDER, MyFrame::OnView)
EVT_TOOL (ID_TREE, MyFrame::OnView)
EVT_TOOL (ID_SINGLE, MyFrame::OnView)
EVT_TOOL (ID_COMMANDER, MyFrame::OnView)
EVT_LIST_KEY_DOWN (ID_FILECTRL, MyFrame::OnListKeyDown) EVT_LIST_KEY_DOWN (ID_FILECTRL, MyFrame::OnListKeyDown)
EVT_LIST_DELETE_ITEM (ID_FILECTRL, MyFrame::OnListDeleteItem) EVT_LIST_DELETE_ITEM (ID_FILECTRL, MyFrame::OnListDeleteItem)
EVT_LIST_END_LABEL_EDIT (ID_FILECTRL, MyFrame::OnListEndLabelEdit) EVT_LIST_END_LABEL_EDIT (ID_FILECTRL, MyFrame::OnListEndLabelEdit)
@@ -129,56 +121,32 @@ MyFrame::MyFrame(void) :
SetStatusText( "Welcome", 0 ); SetStatusText( "Welcome", 0 );
SetStatusText( "wxFile v0.2 by Robert Roebling.", 1 ); SetStatusText( "wxFile v0.2 by Robert Roebling.", 1 );
m_tb = new wxToolBar( this, ID_TOOLBAR, wxPoint(2,60), wxSize(300-4,26) ); wxToolBar *m_tb = CreateToolBar( ID_TOOLBAR );
m_tb->SetMargins( 2, 2 ); m_tb->SetMargins( 2, 2 );
wxBitmap *bm;
m_tb->AddSeparator(); m_tb->AddSeparator();
m_tb->AddTool( ID_QUIT, wxBitmap( exit_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Exit wxFile" );
bm = new wxBitmap( exit_xpm );
m_tb->AddTool( ID_QUIT, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Exit wxFile" );
m_tb->AddSeparator(); m_tb->AddSeparator();
m_tb->AddTool( ID_PARENT, wxBitmap( prev_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Go to parent directory" );
bm = new wxBitmap( prev_xpm ); m_tb->AddTool( ID_HOME, wxBitmap( home_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Go to home directory" );
m_tb->AddTool( ID_PARENT, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Go to parent directory" );
bm = new wxBitmap( home_xpm );
m_tb->AddTool( ID_HOME, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Go to home directory" );
m_tb->AddSeparator(); m_tb->AddSeparator();
m_tb->AddTool( ID_DELETE, wxBitmap( delete_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Delete file" );
bm = new wxBitmap( delete_xpm );
m_tb->AddTool( ID_DELETE, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Delete file" );
m_tb->AddSeparator(); m_tb->AddSeparator();
m_tb->AddTool( ID_MD, wxBitmap( fileopen_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Create directory" );
bm = new wxBitmap( fileopen_xpm );
m_tb->AddTool( ID_MD, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Create directory" );
m_tb->AddSeparator(); m_tb->AddSeparator();
m_tb->AddTool( ID_LIST, wxBitmap( listview_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "List view" );
bm = new wxBitmap( listview_xpm ); m_tb->AddTool( ID_REPORT, wxBitmap( reportview_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Report view" );
m_tb->AddTool( ID_LIST, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "List view" ); m_tb->AddTool( ID_ICON, wxBitmap( iconview_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Icon view" );
bm = new wxBitmap( reportview_xpm );
m_tb->AddTool( ID_REPORT, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Report view" );
bm = new wxBitmap( iconview_xpm );
m_tb->AddTool( ID_ICON, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Icon view" );
m_tb->AddSeparator(); m_tb->AddSeparator();
m_tb->AddTool( ID_TREE, wxBitmap( treeview_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Tree view" );
bm = new wxBitmap( treeview_xpm ); m_tb->AddTool( ID_COMMANDER, wxBitmap( commanderview_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Commander view" );
m_tb->AddTool( ID_TREE, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Tree view" ); m_tb->AddTool( ID_SINGLE, wxBitmap( singleview_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Single view" );
bm = new wxBitmap( commanderview_xpm );
m_tb->AddTool( ID_COMMANDER, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Commander view" );
bm = new wxBitmap( singleview_xpm );
m_tb->AddTool( ID_SINGLE, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Single view" );
m_tb->AddSeparator(); m_tb->AddSeparator();
m_tb->AddTool( ID_MOUNT, wxBitmap( search_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Mount devices" );
bm = new wxBitmap( search_xpm );
m_tb->AddTool( ID_MOUNT, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Mount devices" );
m_tb->AddSeparator(); m_tb->AddSeparator();
m_tb->AddTool( ID_SEARCH, wxBitmap( save_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "Find file(s)" );
bm = new wxBitmap( save_xpm );
m_tb->AddTool( ID_SEARCH, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "Find file(s)" );
m_tb->AddSeparator(); m_tb->AddSeparator();
m_tb->AddTool( ID_ABOUT, wxBitmap( help_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "About wxFile" );
bm = new wxBitmap( help_xpm );
m_tb->AddTool( ID_ABOUT, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "About wxFile" );
m_tb->Layout(); m_tb->Layout();
@@ -205,16 +173,6 @@ MyFrame::MyFrame(void) :
m_splitter->SetMinimumPaneSize( 10 ); m_splitter->SetMinimumPaneSize( 10 );
}; };
void MyFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
{
int x = 0;
int y = 0;
GetClientSize( &x, &y );
m_tb->SetSize( 1, 0, x-2, 30 );
m_splitter->SetSize( 0, 31, x, y-31 );
};
void MyFrame::OnView( wxCommandEvent &event ) void MyFrame::OnView( wxCommandEvent &event )
{ {
int x = 0; int x = 0;

View File

@@ -52,7 +52,6 @@ class MyFrame: public wxFrame
public: public:
MyFrame(void); MyFrame(void);
void OnSize( wxSizeEvent &event );
void OnCommand( wxCommandEvent &event ); void OnCommand( wxCommandEvent &event );
void OnAbout( wxCommandEvent &event ); void OnAbout( wxCommandEvent &event );
void OnView( wxCommandEvent &event ); void OnView( wxCommandEvent &event );

View File

@@ -39,7 +39,7 @@ IMPLEMENT_DYNAMIC_CLASS( MyFrame, wxFrame )
BEGIN_EVENT_TABLE(MyFrame,wxFrame) BEGIN_EVENT_TABLE(MyFrame,wxFrame)
EVT_MENU (-1, MyFrame::OnCommand) EVT_MENU (-1, MyFrame::OnCommand)
EVT_COMMAND (-1,-1, MyFrame::OnCommand) EVT_COMMAND (-1,-1, MyFrame::OnCommand)
EVT_CHAR (wxLayoutWindow::OnChar) EVT_CHAR ( wxLayoutWindow::OnChar )
END_EVENT_TABLE() END_EVENT_TABLE()
MyFrame::MyFrame(void) : MyFrame::MyFrame(void) :

View File

@@ -23,7 +23,7 @@
#endif #endif
#include "wxllist.h" #include "wxllist.h"
#include "iostream" #include "iostream.h"
#include <wx/dc.h> #include <wx/dc.h>
#include <wx/postscrp.h> #include <wx/postscrp.h>

View File

@@ -25,8 +25,8 @@ public:
//virtual void OnDraw(wxDC &dc); //virtual void OnDraw(wxDC &dc);
void OnPaint(wxPaintEvent &WXUNUSED(event)); void OnPaint(wxPaintEvent &WXUNUSED(event));
virtual void OnMouse(wxMouseEvent& event); /*virtual*/ void OnMouse(wxMouseEvent& event);
virtual void OnChar(wxKeyEvent& event); /*virtual*/ void OnChar(wxKeyEvent& event);
void UpdateScrollbars(void); void UpdateScrollbars(void);
void Print(void); void Print(void);
void Erase(void) void Erase(void)

View File

@@ -470,16 +470,11 @@ MyFrame::MyFrame(void) :
m_canvas = new MyCanvas( this, -1, wxPoint(2,62), wxSize(300-4,120-4) ); m_canvas = new MyCanvas( this, -1, wxPoint(2,62), wxSize(300-4,120-4) );
m_canvas->SetScrollbars( 10, 10, 50, 50 ); m_canvas->SetScrollbars( 10, 10, 50, 50 );
m_tb = new wxToolBar( this, -1, wxPoint(2,60), wxSize(300-4,26) ); m_tb = CreateToolBar();
m_tb->SetMargins( 2, 2 ); m_tb->SetMargins( 2, 2 );
m_tb->AddTool( 0, wxBitmap( list_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "This is a button" );
wxBitmap *bm = new wxBitmap( list_xpm ); m_tb->AddTool( 0, wxBitmap( folder_xpm ), wxNullBitmap, TRUE, -1, -1, NULL, "This is a toggle" );
m_tb->AddTool( 0, *bm, wxNullBitmap, FALSE, -1, -1, NULL, "This is a button" );
bm = new wxBitmap( folder_xpm );
m_tb->AddTool( 0, *bm, wxNullBitmap, TRUE, -1, -1, NULL, "This is a toggle" );
m_tb->Layout(); m_tb->Layout();
m_tb->Show( TRUE );
// m_timer.Start( 1000, TRUE ); // m_timer.Start( 1000, TRUE );
}; };