adds a / to user path if necessary; OGL sample cleans itself up;
wxLog fixes in app.cpp
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1002
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
14 files changed:
- wxGrid: scrollbars don't hide; problem with cell selection.
- wxGrid: scrollbars don't hide; problem with cell selection.
+- MDI: seems to be broken for a more complex application I'm testing.
+ Frame decorations don't draw properly, and a child window doesn't
+ process events properly. So probably we should have an alternative
+ implementation that uses tabs, a la wxGTK. The system menu could
+ be implemented using a pop-up menu that applies to the currently
+ active window.
+
+- Controls in a wxToolBar don't work. Probably due to form layout
+ problems; the workaround is to use a separate panel for controls.
+
- Miscellaneous events.
- Write makefiles for all samples and utilities.
- Miscellaneous events.
- Write makefiles for all samples and utilities.
/////////////////////////////////////////////////////////////////////////////
// Name: mdi.h
// Purpose: MDI (Multiple Document Interface) classes.
/////////////////////////////////////////////////////////////////////////////
// Name: mdi.h
// Purpose: MDI (Multiple Document Interface) classes.
-// This doesn't have to be implemented just like Windows,
-// it could be a tabbed design as in wxGTK.
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
class WXDLLEXPORT wxMDIClientWindow;
class WXDLLEXPORT wxMDIChildFrame;
class WXDLLEXPORT wxMDIClientWindow;
class WXDLLEXPORT wxMDIChildFrame;
class XsMDICanvas;
class wxXsMDIWindow;
class XsMDICanvas;
class wxXsMDIWindow;
class WXDLLEXPORT wxMDIParentFrame: public wxFrame
{
class WXDLLEXPORT wxMDIParentFrame: public wxFrame
{
bool Show(bool show);
void BuildClientArea(WXWidget parent);
inline WXWidget GetTopWidget() const { return m_mainWidget; };
bool Show(bool show);
void BuildClientArea(WXWidget parent);
inline WXWidget GetTopWidget() const { return m_mainWidget; };
inline wxXsMDIWindow *GetMDIWindow() const { return m_mdiWindow; };
inline wxXsMDIWindow *GetMDIWindow() const { return m_mdiWindow; };
virtual void OnRaise();
virtual void OnLower();
virtual void OnRaise();
virtual void OnLower();
// Explicitly call default scroll behaviour
void OnScroll(wxScrollEvent& event);
// Explicitly call default scroll behaviour
void OnScroll(wxScrollEvent& event);
inline XsMDICanvas* GetMDICanvas() const { return m_mdiCanvas; }
inline XsMDICanvas* GetMDICanvas() const { return m_mdiCanvas; }
WXWidget GetTopWidget() const { return m_topWidget; }
WXWidget GetTopWidget() const { return m_topWidget; }
XsMDICanvas* m_mdiCanvas;
WXWidget m_topWidget;
XsMDICanvas* m_mdiCanvas;
WXWidget m_topWidget;
#define wxUSE_GADGETS 0
// Use gadgets where possible
#define wxUSE_GADGETS 0
// Use gadgets where possible
+#define wxUSE_MDI_WIDGETS 1
+ // Use Scott Sadler's MDI widgets (buggy).
+ // If 0, uses normal frames.
+
+
+ if (strDir.Last() != '/' && strDir.Last() != '\\')
+ strDir += "/";
+
-#if defined(__WXGTK__) || defined(__WXMOTIF__)
+#if (defined(__WXGTK__) || defined(__WXMOTIF__)) && !defined(NO_CONFIGURE)
#include "lexer.c"
#else
#include "../common/lex_yy.c"
#include "lexer.c"
#else
#include "../common/lex_yy.c"
{
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) // || defined(__AIXV3__)
struct timeval tp;
{
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) // || defined(__AIXV3__)
struct timeval tp;
+#if defined(__SYSV__) || (defined (__GNUWIN32__) && !defined (__MINGW32__))
gettimeofday(&tp, (struct timezone *)NULL);
#else
gettimeofday(&tp);
gettimeofday(&tp, (struct timezone *)NULL);
#else
gettimeofday(&tp);
{
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) // || defined(__AIXV3__)
struct timeval tp;
{
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) // || defined(__AIXV3__)
struct timeval tp;
+#if defined(__SYSV__) || (defined (__GNUWIN32__) && !defined (__MINGW32__))
gettimeofday(&tp, (struct timezone *)NULL);
#else
gettimeofday(&tp);
gettimeofday(&tp, (struct timezone *)NULL);
#else
gettimeofday(&tp);
{
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) // || defined(__AIXV3__)
struct timeval tp;
{
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) // || defined(__AIXV3__)
struct timeval tp;
+#if defined(__SYSV__) || (defined (__GNUWIN32__) && !defined (__MINGW32__))
gettimeofday(&tp, (struct timezone *)NULL);
#else
gettimeofday(&tp);
gettimeofday(&tp, (struct timezone *)NULL);
#else
gettimeofday(&tp);
$(CC) $(LDFLAGS) -o $(PROGRAM)$(GUISUFFIX) $(OBJECTS) $(LDLIBS)
clean:
$(CC) $(LDFLAGS) -o $(PROGRAM)$(GUISUFFIX) $(OBJECTS) $(LDLIBS)
clean:
- rm -f $(OBJECTS) minimal$(GUISUFFIX) core
+ rm -f $(OBJECTS) $(PROGRAM)$(GUISUFFIX) core
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
+ // flush the logged messages if any
+ wxLog *pLog = wxLog::GetActiveTarget();
+ if ( pLog != NULL && pLog->HasPendingMessages() )
+ pLog->Flush();
+
+ delete wxLog::SetActiveTarget(new wxLogStderr); // So dialog boxes aren't used
+ // for further messages
+
if (wxTheApp->GetTopWindow())
{
delete wxTheApp->GetTopWindow();
if (wxTheApp->GetTopWindow())
{
delete wxTheApp->GetTopWindow();
wxTheApp->DeletePendingObjects();
wxTheApp->OnExit();
wxTheApp->DeletePendingObjects();
wxTheApp->OnExit();
{
XEvent* event = (XEvent*) _event;
{
XEvent* event = (XEvent*) _event;
- if (CheckForAccelerator(_event))
+ if ((event->type == KeyPress) && CheckForAccelerator(_event))
{
// Do nothing! We intercepted and processed the event as an accelerator.
return;
{
// Do nothing! We intercepted and processed the event as an accelerator.
return;
$(RANLIB) $@
../common/y_tab.$(OBJSUFF): ../common/y_tab.c ../common/lex_yy.c
$(RANLIB) $@
../common/y_tab.$(OBJSUFF): ../common/y_tab.c ../common/lex_yy.c
- $(CCLEX) -c $(CFLAGS) -o $@ ../common/y_tab.c
+ $(CCLEX) -c $(CFLAGS) -DNO_CONFIGURE -o $@ ../common/y_tab.c
# Replace lex with flex if you run into compilation
# problems with lex_yy.c. See also note about LEX_SCANNER
# Replace lex with flex if you run into compilation
# problems with lex_yy.c. See also note about LEX_SCANNER
local_event = *(cbs->event); // We must keep a copy!
local_event = *(cbs->event); // We must keep a copy!
+ /*
+ switch (local_event.xany.type)
+ {
+ case EnterNotify:
+ cout << "EnterNotify\n";
+ break;
+ case LeaveNotify:
+ cout << "LeaveNotify\n";
+ break;
+ case ButtonPress:
+ cout << "ButtonPress\n";
+ break;
+ case ButtonRelease:
+ cout << "ButtonRelease\n";
+ break;
+ case MotionNotify:
+ cout << "MotionNotify\n";
+ break;
+ default:
+ cout << "Something else\n";
+ break;
+ }
+ */
+
switch (local_event.xany.type)
{
case EnterNotify:
switch (local_event.xany.type)
{
case EnterNotify:
+
+ // flush the logged messages if any
+ wxLog *pLog = wxLog::GetActiveTarget();
+ if ( pLog != NULL && pLog->HasPendingMessages() )
+ pLog->Flush();
+
+
wxApp::CleanUp();
delete wxTheApp;
wxApp::CleanUp();
delete wxTheApp;
#ifdef __GNUWIN32__
#include <sys/unistd.h>
#include <sys/stat.h>
#ifdef __GNUWIN32__
#include <sys/unistd.h>
#include <sys/stat.h>
-#ifndef __MINGW32__
-#include <std.h>
-#endif //MINGW32
-
#endif //GNUWIN32
#include "wx/log.h"
#endif //GNUWIN32
#include "wx/log.h"
MyApp::MyApp(void)
{
frame = NULL;
MyApp::MyApp(void)
{
frame = NULL;
}
// The `main program' equivalent, creating the windows and returning the
}
// The `main program' equivalent, creating the windows and returning the
wxOGLInitialize();
//// Create a document manager
wxOGLInitialize();
//// Create a document manager
- wxDocManager *myDocManager = new wxDocManager;
+ myDocManager = new wxDocManager;
//// Create a template relating drawing documents to their views
(void) new wxDocTemplate(myDocManager, "Diagram", "*.dia", "", "dia", "Diagram Doc", "Diagram View",
//// Create a template relating drawing documents to their views
(void) new wxDocTemplate(myDocManager, "Diagram", "*.dia", "", "dia", "Diagram Doc", "Diagram View",
+int MyApp::OnExit(void)
+{
+ wxOGLCleanUp();
+ delete myDocManager;
+ return 0;
+}
+
/*
* This is the top-level window of the application.
*/
/*
* This is the top-level window of the application.
*/
// Non-retained canvas
MyCanvas *canvas = new MyCanvas(view, parent, -1, wxPoint(0, 0), wxSize(width, height), 0);
// Non-retained canvas
MyCanvas *canvas = new MyCanvas(view, parent, -1, wxPoint(0, 0), wxSize(width, height), 0);
- wxCursor *cursor = new wxCursor(wxCURSOR_HAND);
- canvas->SetCursor(cursor);
+ canvas->SetCursor(wxCursor(wxCURSOR_HAND));
// Give it scrollbars
canvas->SetScrollbars(20, 20, 50, 50);
// Give it scrollbars
canvas->SetScrollbars(20, 20, 50, 50);
{
public:
MyFrame *frame;
{
public:
MyFrame *frame;
+ wxDocManager* myDocManager;
MyApp(void);
bool OnInit(void);
MyApp(void);
bool OnInit(void);
// Palette stuff
EditorToolPalette *CreatePalette(wxFrame *parent);
// Palette stuff
EditorToolPalette *CreatePalette(wxFrame *parent);