application. However, don't expect to be able to enable wxWindows windows with OLE-2
functionality using MFC.<P>
+<H3>Why do I sometimes get bizarre crash problems using VC++ 5/6?</H3>
+
+Some crash problems can be due to inconsistent compiler
+options (and of course this isn't limited to wxWindows).
+If strange/weird/impossible things start to happen please
+check (dumping IDE project file as makefile and doing text comparison
+if necessary) that the project settings, especially the list of defined
+symbols, struct packing, etc. are exactly the same for all items in
+the project. After this, delete everything (including PCH) and recompile.<P>
+
+VC++ 5's optimization code seems to be broken and can
+cause problems: this can be seen when deleting an object Dialog
+Editor, in Release mode with optimizations on. If in doubt,
+switch off optimisations, although this will result in much
+larger executables. It seems possible that the library can be created with
+strong optimization, so long as the application is not strongly
+optimized. For example, in wxWindows project, set to 'Minimum
+Size'. In Dialog Editor project, set to 'Customize: Favor Small
+Code' (and no others). This will then work.<P>
+
</font>
\constfunc{wxString}{GetFilename}{\void}
-Gets the filename associated with this document, or NULL if none is
+Gets the filename associated with this document, or "" if none is
associated.
\membersection{wxDocument::GetFirstView}
\func{virtual bool}{OnOpenDocument}{\param{const wxString\& }{filename}}
-Constructs an input file stream for the given filename (which must not be NULL),
+Constructs an input file stream for the given filename (which must not be empty),
and calls LoadObject. If LoadObject returns TRUE, the document is set to
unmodified; otherwise, an error message box is displayed. The document's
views are notified that the filename has changed, to give windows an opportunity
\func{virtual bool}{OnSaveDocument}{\param{const wxString\& }{filename}}
-Constructs an output file stream for the given filename (which must not be NULL),
+Constructs an output file stream for the given filename (which must not be empty),
and calls SaveObject. If SaveObject returns TRUE, the document is set to
unmodified; otherwise, an error message box is displayed.
\membersection{wxStringTokenizer::CountTokens}\label{wxstringtokenizercounttokens}
-\constfunc{virtual int}{CountTokens}{\void}
+\constfunc{int}{CountTokens}{\void}
Returns the number of tokens in the input string.
-\membersection{wxStringTokenizer::HasMoreToken}\label{wxstringtokenizerhasmoretoken}
+\membersection{wxStringTokenizer::HasMoreTokens}\label{wxstringtokenizerhasmoretokens}
-\constfunc{virtual bool}{HasMoreToken}{\void}
+\constfunc{bool}{HasMoreTokens}{\void}
Returns TRUE if the tokenizer has further tokens.
-\membersection{wxStringTokenizer::NextToken}\label{wxstringtokenizernexttoken}
+\membersection{wxStringTokenizer::GetNextToken}\label{wxstringtokenizergetnexttoken}
-\constfunc{virtual wxString}{NextToken}{\void}
+\constfunc{wxString}{GetNextToken}{\void}
Returns the next token.
\membersection{wxStringTokenizer::GetString}\label{wxstringtokenizergetstring}
-\constfunc{virtual wxString}{GetString}{\void}
+\constfunc{wxString}{GetString}{\void}
Returns the input string.
\docparam{cursor}{Specifies the cursor that the window should normally display.}
+\begin{comment}
\wxheading{Remarks}
Under Windows, you sometimes need to call ::wxSetCursor in addition to this
function if you want the cursor to change immediately, because under Windows,
wxWindows only sets the global cursor when it detects mouse movement.
+\end{comment
\wxheading{See also}
possible temporary workaround (comment out the final
XtDestroyWidget from ~wxWindow in window.cpp).
+- If you use flex and bison instead of yacc and lex, you may need
+ to change the relevant part of src/motif/makefile.unx to read:
+
+ ../common/y_tab.c: ../common/parser.y
+ $(YACC) ../common/parser.y
+ mv ../common/parser.tab.c ../common/y_tab.c
+
+ (the 'mv' command needs to be changed)
+
+- Some compilers, such as Sun C++, may give a lot of warnings about
+ virtual functions being hidden. Please ignore these, it's correct C++ syntax.
+ If you find any incorrect instances, though, such as a
+ missing 'const' in an overridden function, please let us know.
+
Other Notes
-----------
Size'. In Dialog Editor project, set to 'Customize: Favor Small
Code' (and no others). This will then work.
+Note (4): some crash problems can be due to inconsistent compiler
+options. If strange/weird/impossible things start to happen please
+check (dumping IDE project file as makefile and doing text comparison
+if necessary) that the project settings, especially the list of defined
+symbols, struct packing, etc. are exactly the same for all items in
+the project. After this, delete everything (including PCH) and recompile.
+
Visual C++ 1.5 compilation
--------------------------
virtual bool Destroy();
- void SetClientSize(int width, int height);
void GetClientSize(int *width, int *height) const;
void GetSize(int *width, int *height) const ;
void GetPosition(int *x, int *y) const ;
void SetTitle(const wxString& title);
void SetClientSize(int width, int height);
- void GetClientSize(int *width, int *height);
+ void GetClientSize(int *width, int *height) const;
void GetSize(int *width, int *height) const;
void GetPosition(int *x, int *y) const ;
#define wxUSE_TOOLTIPS 0
// Use tooltips
+#define wxUSE_DYNLIB_CLASS 0
+ // Use wxLibrary
+
/*
* Finer detail
*
#define wxHIDE_READONLY 0x0008
#define wxFILE_MUST_EXIST 0x0010
+// File selector - backward compatibility
+WXDLLEXPORT wxString wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
+ const char *default_filename = NULL, const char *default_extension = NULL,
+ const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
+ wxWindow *parent = NULL, int x = -1, int y = -1);
+
+// An extended version of wxFileSelector
+WXDLLEXPORT wxString wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
+ const char *default_filename = NULL, int *indexDefaultExtension = NULL,
+ const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
+ wxWindow *parent = NULL, int x = -1, int y = -1);
+
+// Generic file load dialog
+WXDLLEXPORT wxString wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
+
+// Generic file save dialog
+WXDLLEXPORT wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
+
#endif
// _WX_FILEDLG_H_
#define wxUSE_SERIAL 0
// Use serialization
+
+#define wxUSE_TOOLTIPS 0
+ // Use tooltips
+
+#define wxUSE_DYNLIB_CLASS 0
+ // Use wxLibrary
/*
* Finer detail
*
int CountTokens();
bool HasMoreToken();
+ inline bool HasMoreTokens() { return HasMoreToken(); };
wxString NextToken();
+ // A better name!
+ inline wxString GetNextToken() { return NextToken(); };
wxString GetString() { return m_string; }
void SetString(const wxString& to_tokenize,
#endif
#if !wxUSE_DOC_VIEW_ARCHITECTURE
-#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
#endif
#include "doc.h"
#endif
#if !wxUSE_DOC_VIEW_ARCHITECTURE
-#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
#endif
#include "wx/docview.h"
#endif
#if !wxUSE_DOC_VIEW_ARCHITECTURE
-#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
#endif
#include "docview.h"
#endif
#if !wxUSE_DOC_VIEW_ARCHITECTURE
-#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
#endif
#include "doc.h"
#endif
#if !wxUSE_DOC_VIEW_ARCHITECTURE
-#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
#endif
#include "docview.h"
#endif
#if !wxUSE_DOC_VIEW_ARCHITECTURE
-#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
#endif
#include "docview.h"
#endif
#if !wxUSE_CONSTRAINTS
-#error You must set wxUSE_CONSTRAINTS to 1 in wx_setup.h!
+#error You must set wxUSE_CONSTRAINTS to 1 in setup.h!
#endif
#include <ctype.h>
#endif
#if !wxUSE_PRINTING_ARCHITECTURE
-#error You must set wxUSE_PRINTING_ARCHITECTURE to 1 in wx_setup.h to compile this demo.
+#error You must set wxUSE_PRINTING_ARCHITECTURE to 1 in setup.h to compile this demo.
#endif
// Set this to 1 if you want to test PostScript printing under MSW.
long style,
const wxString& name)
{
- m_lastFocus = NULL;
+ m_lastFocus = 0;
bool ret = wxWindow::Create(parent, id, pos, size, style, name);
XtVaSetValues((Widget) m_mainWidget, XmNresizePolicy, XmRESIZE_NONE, NULL);
}
+void wxDialog::DoSetClientSize(int width, int height)
+{
+ wxWindow::SetSize(-1, -1, width, height);
+}
+
void wxDialog::SetTitle(const wxString& title)
{
m_dialogTitle = title;
Display *display = (Display*) win->GetXDisplay();
Window xwin = (Window) win->GetXWindow();
+ if (!xwin)
+ return;
+
XSetWindowAttributes attrs;
if (cursor)
*x = xx; *y = yy;
}
-void wxWindow::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
// A bit of optimization to help sort out the flickers.
int oldX, oldY, oldW, oldH;
*/
}
-void wxWindow::SetClientSize(int width, int height)
+void wxWindow::DoSetClientSize(int width, int height)
{
if (m_drawingArea)
{
// Get the underlying X window and display
WXWindow wxWindow::GetXWindow() const
{
- return (WXWindow) XtWindow((Widget) GetMainWidget());
+ if (GetMainWidget())
+ return (WXWindow) XtWindow((Widget) GetMainWidget());
+ else
+ return (WXWindow) 0;
}
WXDisplay *wxWindow::GetXDisplay() const
{
- return (WXDisplay*) XtDisplay((Widget) GetMainWidget());
+ if (GetMainWidget())
+ return (WXDisplay*) XtDisplay((Widget) GetMainWidget());
+ else
+ return (WXDisplay*) NULL;
}
WXWidget wxWindow::GetMainWidget() const
return wxEmptyString;
}
-char *wxFileSelectorEx(const char *title,
+wxString wxFileSelectorEx(const char *title,
const char *defaultDir,
const char *defaultFileName,
int* defaultFilterIndex,
../common/framecmn.cpp \
../common/stream.cpp \
../common/datstrm.cpp \
- ../common/fstream.cpp \
+ ../common/wfstream.cpp \
../common/mstream.cpp \
../common/zstream.cpp \
../common/objstrm.cpp \
#include "wx/thread.h"
#include "wx/utils.h"
+#if wxUSE_THREADS
+
enum thread_state {
STATE_IDLE = 0,
STATE_RUNNING,
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
+#endif
+ // wxUSE_THREADS