Fix to parser.y to make it compile with makefile.unx; wxFileConfig
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
This commit is contained in:
parent
43a1889865
commit
f57fe24c63
@ -53,6 +53,16 @@ High Priority
|
|||||||
|
|
||||||
- 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.
|
- Miscellaneous events.
|
||||||
|
|
||||||
- Write makefiles for all samples and utilities.
|
- Write makefiles for all samples and utilities.
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: mdi.h
|
// Name: mdi.h
|
||||||
// Purpose: MDI (Multiple Document Interface) classes.
|
// 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
|
// Author: Julian Smart
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 17/09/98
|
// Created: 17/09/98
|
||||||
@ -26,8 +24,10 @@ WXDLLEXPORT_DATA(extern const char*) wxStatusLineNameStr;
|
|||||||
class WXDLLEXPORT wxMDIClientWindow;
|
class WXDLLEXPORT wxMDIClientWindow;
|
||||||
class WXDLLEXPORT wxMDIChildFrame;
|
class WXDLLEXPORT wxMDIChildFrame;
|
||||||
|
|
||||||
|
#if wxUSE_MDI_WIDGETS
|
||||||
class XsMDICanvas;
|
class XsMDICanvas;
|
||||||
class wxXsMDIWindow;
|
class wxXsMDIWindow;
|
||||||
|
#endif
|
||||||
|
|
||||||
class WXDLLEXPORT wxMDIParentFrame: public wxFrame
|
class WXDLLEXPORT wxMDIParentFrame: public wxFrame
|
||||||
{
|
{
|
||||||
@ -147,7 +147,9 @@ public:
|
|||||||
bool Show(bool show);
|
bool Show(bool show);
|
||||||
void BuildClientArea(WXWidget parent);
|
void BuildClientArea(WXWidget parent);
|
||||||
inline WXWidget GetTopWidget() const { return m_mainWidget; };
|
inline WXWidget GetTopWidget() const { return m_mainWidget; };
|
||||||
|
#if wxUSE_MDI_WIDGETS
|
||||||
inline wxXsMDIWindow *GetMDIWindow() const { return m_mdiWindow; };
|
inline wxXsMDIWindow *GetMDIWindow() const { return m_mdiWindow; };
|
||||||
|
#endif
|
||||||
virtual void OnRaise();
|
virtual void OnRaise();
|
||||||
virtual void OnLower();
|
virtual void OnLower();
|
||||||
|
|
||||||
@ -189,14 +191,17 @@ class WXDLLEXPORT wxMDIClientWindow: public wxWindow
|
|||||||
// Explicitly call default scroll behaviour
|
// Explicitly call default scroll behaviour
|
||||||
void OnScroll(wxScrollEvent& event);
|
void OnScroll(wxScrollEvent& event);
|
||||||
|
|
||||||
|
#if wxUSE_MDI_WIDGETS
|
||||||
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; }
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
#if wxUSE_MDI_WIDGETS
|
||||||
XsMDICanvas* m_mdiCanvas;
|
XsMDICanvas* m_mdiCanvas;
|
||||||
WXWidget m_topWidget;
|
WXWidget m_topWidget;
|
||||||
|
#endif
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
@ -117,6 +117,11 @@
|
|||||||
#define wxUSE_GADGETS 0
|
#define wxUSE_GADGETS 0
|
||||||
// Use gadgets where possible
|
// Use gadgets where possible
|
||||||
|
|
||||||
|
#define wxUSE_MDI_WIDGETS 1
|
||||||
|
// Use Scott Sadler's MDI widgets (buggy).
|
||||||
|
// If 0, uses normal frames.
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finer detail
|
* Finer detail
|
||||||
*
|
*
|
||||||
|
@ -114,6 +114,9 @@ wxString wxFileConfig::GetLocalDir()
|
|||||||
|
|
||||||
wxGetHomeDir(&strDir);
|
wxGetHomeDir(&strDir);
|
||||||
|
|
||||||
|
if (strDir.Last() != '/' && strDir.Last() != '\\')
|
||||||
|
strDir += "/";
|
||||||
|
|
||||||
return strDir;
|
return strDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ arg1 : WORD
|
|||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
#if (defined(__WXGTK__) || defined(__WXMOTIF__)) && !defined(NO_CONFIGURE)
|
||||||
#include "lexer.c"
|
#include "lexer.c"
|
||||||
#else
|
#else
|
||||||
#include "../common/lex_yy.c"
|
#include "../common/lex_yy.c"
|
||||||
|
@ -70,7 +70,7 @@ void wxStartTimer(void)
|
|||||||
{
|
{
|
||||||
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) // || defined(__AIXV3__)
|
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) // || defined(__AIXV3__)
|
||||||
struct timeval tp;
|
struct timeval tp;
|
||||||
#ifdef __SYSV__
|
#if defined(__SYSV__) || (defined (__GNUWIN32__) && !defined (__MINGW32__))
|
||||||
gettimeofday(&tp, (struct timezone *)NULL);
|
gettimeofday(&tp, (struct timezone *)NULL);
|
||||||
#else
|
#else
|
||||||
gettimeofday(&tp);
|
gettimeofday(&tp);
|
||||||
@ -94,7 +94,7 @@ long wxGetElapsedTime(bool resetTimer)
|
|||||||
{
|
{
|
||||||
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) // || defined(__AIXV3__)
|
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) // || defined(__AIXV3__)
|
||||||
struct timeval tp;
|
struct timeval tp;
|
||||||
#ifdef __SYSV__
|
#if defined(__SYSV__) || (defined (__GNUWIN32__) && !defined (__MINGW32__))
|
||||||
gettimeofday(&tp, (struct timezone *)NULL);
|
gettimeofday(&tp, (struct timezone *)NULL);
|
||||||
#else
|
#else
|
||||||
gettimeofday(&tp);
|
gettimeofday(&tp);
|
||||||
@ -190,7 +190,7 @@ long wxGetCurrentTime(void)
|
|||||||
{
|
{
|
||||||
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) // || defined(__AIXV3__)
|
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) // || defined(__AIXV3__)
|
||||||
struct timeval tp;
|
struct timeval tp;
|
||||||
#ifdef __SYSV__
|
#if defined(__SYSV__) || (defined (__GNUWIN32__) && !defined (__MINGW32__))
|
||||||
gettimeofday(&tp, (struct timezone *)NULL);
|
gettimeofday(&tp, (struct timezone *)NULL);
|
||||||
#else
|
#else
|
||||||
gettimeofday(&tp);
|
gettimeofday(&tp);
|
||||||
|
@ -8,4 +8,4 @@ $(PROGRAM)$(GUISUFFIX): $(OBJECTS) $(WXLIB)
|
|||||||
$(CC) $(LDFLAGS) -o $(PROGRAM)$(GUISUFFIX) $(OBJECTS) $(LDLIBS)
|
$(CC) $(LDFLAGS) -o $(PROGRAM)$(GUISUFFIX) $(OBJECTS) $(LDLIBS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJECTS) minimal$(GUISUFFIX) core
|
rm -f $(OBJECTS) $(PROGRAM)$(GUISUFFIX) core
|
||||||
|
@ -197,6 +197,14 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
|
|
||||||
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())
|
if (wxTheApp->GetTopWindow())
|
||||||
{
|
{
|
||||||
delete wxTheApp->GetTopWindow();
|
delete wxTheApp->GetTopWindow();
|
||||||
@ -206,6 +214,7 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
wxTheApp->DeletePendingObjects();
|
wxTheApp->DeletePendingObjects();
|
||||||
|
|
||||||
wxTheApp->OnExit();
|
wxTheApp->OnExit();
|
||||||
|
|
||||||
|
|
||||||
wxApp::CleanUp();
|
wxApp::CleanUp();
|
||||||
|
|
||||||
@ -294,7 +303,7 @@ void wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
{
|
{
|
||||||
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.
|
// Do nothing! We intercepted and processed the event as an accelerator.
|
||||||
return;
|
return;
|
||||||
|
@ -198,7 +198,7 @@ $(WXLIB) : $(OBJECTS)
|
|||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
../common/y_tab.$(OBJSUFF): ../common/y_tab.c ../common/lex_yy.c
|
../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
|
# Replace lex with flex if you run into compilation
|
||||||
# problems with lex_yy.c. See also note about LEX_SCANNER
|
# problems with lex_yy.c. See also note about LEX_SCANNER
|
||||||
|
@ -2217,6 +2217,30 @@ void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallba
|
|||||||
|
|
||||||
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)
|
switch (local_event.xany.type)
|
||||||
{
|
{
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
|
@ -568,6 +568,13 @@ int wxEntry(WXHINSTANCE hInstance,
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxTheApp->OnExit();
|
wxTheApp->OnExit();
|
||||||
|
|
||||||
|
// flush the logged messages if any
|
||||||
|
wxLog *pLog = wxLog::GetActiveTarget();
|
||||||
|
if ( pLog != NULL && pLog->HasPendingMessages() )
|
||||||
|
pLog->Flush();
|
||||||
|
|
||||||
|
|
||||||
wxApp::CleanUp();
|
wxApp::CleanUp();
|
||||||
|
|
||||||
delete wxTheApp;
|
delete wxTheApp;
|
||||||
|
@ -40,10 +40,6 @@
|
|||||||
#ifdef __GNUWIN32__
|
#ifdef __GNUWIN32__
|
||||||
#include <sys/unistd.h>
|
#include <sys/unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifndef __MINGW32__
|
|
||||||
#include <std.h>
|
|
||||||
#endif //MINGW32
|
|
||||||
|
|
||||||
#endif //GNUWIN32
|
#endif //GNUWIN32
|
||||||
|
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
|
@ -44,6 +44,7 @@ IMPLEMENT_APP(MyApp)
|
|||||||
MyApp::MyApp(void)
|
MyApp::MyApp(void)
|
||||||
{
|
{
|
||||||
frame = NULL;
|
frame = NULL;
|
||||||
|
myDocManager= NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The `main program' equivalent, creating the windows and returning the
|
// The `main program' equivalent, creating the windows and returning the
|
||||||
@ -53,7 +54,7 @@ bool MyApp::OnInit(void)
|
|||||||
wxOGLInitialize();
|
wxOGLInitialize();
|
||||||
|
|
||||||
//// Create a document manager
|
//// Create a document manager
|
||||||
wxDocManager *myDocManager = new wxDocManager;
|
myDocManager = new wxDocManager;
|
||||||
|
|
||||||
//// Create a template relating drawing documents to their views
|
//// Create a template relating drawing documents to their views
|
||||||
(void) new wxDocTemplate(myDocManager, "Diagram", "*.dia", "", "dia", "Diagram Doc", "Diagram View",
|
(void) new wxDocTemplate(myDocManager, "Diagram", "*.dia", "", "dia", "Diagram Doc", "Diagram View",
|
||||||
@ -126,6 +127,13 @@ bool MyApp::OnInit(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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.
|
||||||
*/
|
*/
|
||||||
@ -191,8 +199,7 @@ MyCanvas *MyFrame::CreateCanvas(wxView *view, wxFrame *parent)
|
|||||||
|
|
||||||
// Non-retained canvas
|
// Non-retained canvas
|
||||||
MyCanvas *canvas = new MyCanvas(view, parent, -1, wxPoint(0, 0), wxSize(width, height), 0);
|
MyCanvas *canvas = new MyCanvas(view, parent, -1, wxPoint(0, 0), wxSize(width, height), 0);
|
||||||
wxCursor *cursor = new wxCursor(wxCURSOR_HAND);
|
canvas->SetCursor(wxCursor(wxCURSOR_HAND));
|
||||||
canvas->SetCursor(cursor);
|
|
||||||
|
|
||||||
// Give it scrollbars
|
// Give it scrollbars
|
||||||
canvas->SetScrollbars(20, 20, 50, 50);
|
canvas->SetScrollbars(20, 20, 50, 50);
|
||||||
|
@ -25,9 +25,11 @@ class MyApp: public wxApp
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyFrame *frame;
|
MyFrame *frame;
|
||||||
|
wxDocManager* myDocManager;
|
||||||
|
|
||||||
MyApp(void);
|
MyApp(void);
|
||||||
bool OnInit(void);
|
bool OnInit(void);
|
||||||
|
int OnExit(void);
|
||||||
|
|
||||||
// Palette stuff
|
// Palette stuff
|
||||||
EditorToolPalette *CreatePalette(wxFrame *parent);
|
EditorToolPalette *CreatePalette(wxFrame *parent);
|
||||||
|
Loading…
Reference in New Issue
Block a user