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:
Julian Smart 1998-11-15 21:53:27 +00:00
parent 43a1889865
commit f57fe24c63
14 changed files with 85 additions and 17 deletions

View File

@ -53,6 +53,16 @@ High Priority
- 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.

View File

@ -1,8 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// 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
@ -26,8 +24,10 @@ WXDLLEXPORT_DATA(extern const char*) wxStatusLineNameStr;
class WXDLLEXPORT wxMDIClientWindow;
class WXDLLEXPORT wxMDIChildFrame;
#if wxUSE_MDI_WIDGETS
class XsMDICanvas;
class wxXsMDIWindow;
#endif
class WXDLLEXPORT wxMDIParentFrame: public wxFrame
{
@ -147,7 +147,9 @@ public:
bool Show(bool show);
void BuildClientArea(WXWidget parent);
inline WXWidget GetTopWidget() const { return m_mainWidget; };
#if wxUSE_MDI_WIDGETS
inline wxXsMDIWindow *GetMDIWindow() const { return m_mdiWindow; };
#endif
virtual void OnRaise();
virtual void OnLower();
@ -189,14 +191,17 @@ class WXDLLEXPORT wxMDIClientWindow: public wxWindow
// Explicitly call default scroll behaviour
void OnScroll(wxScrollEvent& event);
#if wxUSE_MDI_WIDGETS
inline XsMDICanvas* GetMDICanvas() const { return m_mdiCanvas; }
WXWidget GetTopWidget() const { return m_topWidget; }
#endif
protected:
#if wxUSE_MDI_WIDGETS
XsMDICanvas* m_mdiCanvas;
WXWidget m_topWidget;
#endif
DECLARE_EVENT_TABLE()
};

View File

@ -117,6 +117,11 @@
#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.
/*
* Finer detail
*

View File

@ -114,6 +114,9 @@ wxString wxFileConfig::GetLocalDir()
wxGetHomeDir(&strDir);
if (strDir.Last() != '/' && strDir.Last() != '\\')
strDir += "/";
return strDir;
}

View File

@ -124,7 +124,7 @@ arg1 : WORD
%%
#if defined(__WXGTK__) || defined(__WXMOTIF__)
#if (defined(__WXGTK__) || defined(__WXMOTIF__)) && !defined(NO_CONFIGURE)
#include "lexer.c"
#else
#include "../common/lex_yy.c"

View File

@ -70,7 +70,7 @@ void wxStartTimer(void)
{
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) // || defined(__AIXV3__)
struct timeval tp;
#ifdef __SYSV__
#if defined(__SYSV__) || (defined (__GNUWIN32__) && !defined (__MINGW32__))
gettimeofday(&tp, (struct timezone *)NULL);
#else
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__)
struct timeval tp;
#ifdef __SYSV__
#if defined(__SYSV__) || (defined (__GNUWIN32__) && !defined (__MINGW32__))
gettimeofday(&tp, (struct timezone *)NULL);
#else
gettimeofday(&tp);
@ -190,7 +190,7 @@ long wxGetCurrentTime(void)
{
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) // || defined(__AIXV3__)
struct timeval tp;
#ifdef __SYSV__
#if defined(__SYSV__) || (defined (__GNUWIN32__) && !defined (__MINGW32__))
gettimeofday(&tp, (struct timezone *)NULL);
#else
gettimeofday(&tp);

View File

@ -8,4 +8,4 @@ $(PROGRAM)$(GUISUFFIX): $(OBJECTS) $(WXLIB)
$(CC) $(LDFLAGS) -o $(PROGRAM)$(GUISUFFIX) $(OBJECTS) $(LDLIBS)
clean:
rm -f $(OBJECTS) minimal$(GUISUFFIX) core
rm -f $(OBJECTS) $(PROGRAM)$(GUISUFFIX) core

View File

@ -197,6 +197,14 @@ int wxEntry( int argc, char *argv[] )
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();
@ -206,6 +214,7 @@ int wxEntry( int argc, char *argv[] )
wxTheApp->DeletePendingObjects();
wxTheApp->OnExit();
wxApp::CleanUp();
@ -294,7 +303,7 @@ void wxApp::ProcessXEvent(WXEvent* _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;

View File

@ -198,7 +198,7 @@ $(WXLIB) : $(OBJECTS)
$(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

View File

@ -2217,6 +2217,30 @@ void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallba
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:

View File

@ -568,6 +568,13 @@ int wxEntry(WXHINSTANCE hInstance,
}
wxTheApp->OnExit();
// flush the logged messages if any
wxLog *pLog = wxLog::GetActiveTarget();
if ( pLog != NULL && pLog->HasPendingMessages() )
pLog->Flush();
wxApp::CleanUp();
delete wxTheApp;

View File

@ -40,10 +40,6 @@
#ifdef __GNUWIN32__
#include <sys/unistd.h>
#include <sys/stat.h>
#ifndef __MINGW32__
#include <std.h>
#endif //MINGW32
#endif //GNUWIN32
#include "wx/log.h"

View File

@ -44,6 +44,7 @@ IMPLEMENT_APP(MyApp)
MyApp::MyApp(void)
{
frame = NULL;
myDocManager= NULL;
}
// The `main program' equivalent, creating the windows and returning the
@ -53,7 +54,7 @@ bool MyApp::OnInit(void)
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",
@ -126,6 +127,13 @@ bool MyApp::OnInit(void)
return TRUE;
}
int MyApp::OnExit(void)
{
wxOGLCleanUp();
delete myDocManager;
return 0;
}
/*
* This is the top-level window of the application.
*/
@ -191,8 +199,7 @@ MyCanvas *MyFrame::CreateCanvas(wxView *view, wxFrame *parent)
// 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);

View File

@ -25,9 +25,11 @@ class MyApp: public wxApp
{
public:
MyFrame *frame;
wxDocManager* myDocManager;
MyApp(void);
bool OnInit(void);
int OnExit(void);
// Palette stuff
EditorToolPalette *CreatePalette(wxFrame *parent);