Applied patch/bug [ 748226 ] OGL samples does not follow settings from setup.h

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-06-05 17:26:35 +00:00
parent c1a23315cd
commit 6999716b96
11 changed files with 31 additions and 4 deletions

View File

@@ -10,7 +10,7 @@
WXDIR = $(WXWIN) WXDIR = $(WXWIN)
TARGET=mmboard TARGET=mmboard
EXTRALIBS=$(WXDIR)\contrib\lib\mmedia.lib EXTRALIBS=$(WXDIR)\lib\mmedia.lib
OBJECTS = $(TARGET).obj mmbman.obj OBJECTS = $(TARGET).obj mmbman.obj
!include $(WXDIR)\src\makeprog.b32 !include $(WXDIR)\src\makeprog.b32

View File

@@ -92,7 +92,9 @@ wxOutputStream& DiagramDocument::SaveObject(wxOutputStream& stream)
char buf[400]; char buf[400];
(void) wxGetTempFileName("diag", buf); (void) wxGetTempFileName("diag", buf);
#if wxUSE_PROLOGIO
diagram.SaveFile(buf); diagram.SaveFile(buf);
#endif
wxTransferFileToStream(buf, stream); wxTransferFileToStream(buf, stream);
@@ -113,7 +115,11 @@ wxInputStream& DiagramDocument::LoadObject(wxInputStream& stream)
wxTransferStreamToFile(stream, buf); wxTransferStreamToFile(stream, buf);
diagram.DeleteAllShapes(); diagram.DeleteAllShapes();
#if wxUSE_PROLOGIO
diagram.LoadFile(buf); diagram.LoadFile(buf);
#endif
wxRemoveFile(buf); wxRemoveFile(buf);
return stream; return stream;
@@ -548,6 +554,7 @@ void MyEvtHandler::OnEndSize(double x, double y)
* Diagram * Diagram
*/ */
#if wxUSE_PROLOGIO
bool MyDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) bool MyDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
{ {
wxDiagram::OnShapeSave(db, shape, expr); wxDiagram::OnShapeSave(db, shape, expr);
@@ -568,6 +575,7 @@ bool MyDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
delete[] label; delete[] label;
return TRUE; return TRUE;
} }
#endif
/* /*
* New shapes * New shapes

View File

@@ -35,8 +35,10 @@ class MyDiagram: public wxDiagram
{ {
public: public:
MyDiagram(void) {} MyDiagram(void) {}
#if wxUSE_PROLOGIO
bool OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr); bool OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr);
bool OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr); bool OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr);
#endif
}; };
/* /*

View File

@@ -25,6 +25,11 @@
#endif #endif
#include <wx/resource.h> #include <wx/resource.h>
#if !wxUSE_WX_RESOURCES
#error "OGL studio sample requires wxUSE_WX_RESOURCES"
#endif // wxUSE_WX_RESOURCES
#include "dialogs.h" #include "dialogs.h"
#include "doc.h" #include "doc.h"
#include "view.h" #include "view.h"

View File

@@ -60,6 +60,7 @@ bool csDiagramDocument::OnSaveDocument(const wxString& file)
if (file == "") if (file == "")
return FALSE; return FALSE;
#if wxUSE_PROLOGIO
if (!m_diagram.SaveFile(file)) if (!m_diagram.SaveFile(file))
{ {
wxString msgTitle; wxString msgTitle;
@@ -72,6 +73,7 @@ bool csDiagramDocument::OnSaveDocument(const wxString& file)
GetDocumentWindow()); GetDocumentWindow());
return FALSE; return FALSE;
} }
#endif
Modify(FALSE); Modify(FALSE);
SetFilename(file); SetFilename(file);
@@ -90,12 +92,14 @@ bool csDiagramDocument::OnOpenDocument(const wxString& file)
msgTitle = wxString("File error"); msgTitle = wxString("File error");
m_diagram.DeleteAllShapes(); m_diagram.DeleteAllShapes();
#if wxUSE_PROLOGIO
if (!m_diagram.LoadFile(file)) if (!m_diagram.LoadFile(file))
{ {
(void)wxMessageBox("Sorry, could not open this file.", msgTitle, wxOK|wxICON_EXCLAMATION, (void)wxMessageBox("Sorry, could not open this file.", msgTitle, wxOK|wxICON_EXCLAMATION,
GetDocumentWindow()); GetDocumentWindow());
return FALSE; return FALSE;
} }
#endif
SetFilename(file, TRUE); SetFilename(file, TRUE);
Modify(FALSE); Modify(FALSE);
UpdateAllViews(); UpdateAllViews();

View File

@@ -705,6 +705,7 @@ bool csEvtHandler::EditProperties()
* Diagram * Diagram
*/ */
#if wxUSE_PROLOGIO
bool csDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) bool csDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
{ {
wxDiagram::OnShapeSave(db, shape, expr); wxDiagram::OnShapeSave(db, shape, expr);
@@ -723,6 +724,7 @@ bool csDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
return TRUE; return TRUE;
} }
#endif
IMPLEMENT_DYNAMIC_CLASS(csThinRectangleShape, wxDrawnShape) IMPLEMENT_DYNAMIC_CLASS(csThinRectangleShape, wxDrawnShape)

View File

@@ -37,8 +37,10 @@ DECLARE_CLASS(csDiagram)
public: public:
csDiagram(csDiagramDocument* doc) { m_doc = doc; } csDiagram(csDiagramDocument* doc) { m_doc = doc; }
~csDiagram(); ~csDiagram();
#if wxUSE_PROLOGIO
bool OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr); bool OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr);
bool OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr); bool OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr);
#endif
inline csDiagramDocument* GetDocument() const { return m_doc; } inline csDiagramDocument* GetDocument() const { return m_doc; }
virtual void Redraw(wxDC& dc); virtual void Redraw(wxDC& dc);

View File

@@ -25,6 +25,10 @@
#include "wx/config.h" #include "wx/config.h"
#include "wx/laywin.h" #include "wx/laywin.h"
#if !wxUSE_WX_RESOURCES
#error "OGL studio sample requires wxUSE_WX_RESOURCES"
#endif // wxUSE_WX_RESOURCES
#include "studio.h" #include "studio.h"
#include "view.h" #include "view.h"
#include "doc.h" #include "doc.h"

View File

@@ -11,7 +11,7 @@ WXDIR = $(WXWIN)
TARGET=stctest TARGET=stctest
EXTRALIBS=$(WXDIR)\contrib\lib\stc.lib EXTRALIBS=$(WXDIR)\lib\stc.lib
OBJECTS = $(TARGET).obj OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.b32 !include $(WXDIR)\src\makeprog.b32

View File

@@ -2334,7 +2334,7 @@ wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject)
return (wxRealPoint *)node->Data(); return (wxRealPoint *)node->Data();
} }
else else
return FALSE; return NULL;
} }
/* /*

View File

@@ -11,7 +11,7 @@ WXDIR = $(WXWIN)
TARGET=stctest TARGET=stctest
EXTRALIBS=$(WXDIR)\contrib\lib\stc.lib EXTRALIBS=$(WXDIR)\lib\stc.lib
OBJECTS = $(TARGET).obj OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.b32 !include $(WXDIR)\src\makeprog.b32