OGL samples again buildable after deprecated/setup.h turned off by default. Minor cleaning where applicable.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -194,7 +194,7 @@ bool DiagramCommand::Do(void)
|
|||||||
{
|
{
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
case OGLEDIT_CUT:
|
case wxID_CUT:
|
||||||
{
|
{
|
||||||
if (shape)
|
if (shape)
|
||||||
{
|
{
|
||||||
@@ -340,7 +340,7 @@ bool DiagramCommand::Undo(void)
|
|||||||
{
|
{
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
case OGLEDIT_CUT:
|
case wxID_CUT:
|
||||||
{
|
{
|
||||||
if (shape)
|
if (shape)
|
||||||
{
|
{
|
||||||
@@ -428,7 +428,7 @@ void DiagramCommand::RemoveLines(wxShape *shape)
|
|||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxLineShape *line = (wxLineShape *)node->GetData();
|
wxLineShape *line = (wxLineShape *)node->GetData();
|
||||||
doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line));
|
doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), wxID_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line));
|
||||||
|
|
||||||
node = shape->GetLines().GetFirst();
|
node = shape->GetLines().GetFirst();
|
||||||
}
|
}
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
#include <wx/cmdproc.h>
|
#include <wx/cmdproc.h>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
|
|
||||||
#include <wx/deprecated/setup.h>
|
#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
|
||||||
|
|
||||||
#if wxUSE_PROLOGIO
|
#if wxUSE_PROLOGIO
|
||||||
#include <wx/deprecated/wxexpr.h>
|
#include <wx/deprecated/wxexpr.h>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
/*
|
/*
|
||||||
* Override a few members for this application
|
* Override a few members for this application
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class MyDiagram: public wxDiagram
|
class MyDiagram: public wxDiagram
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -50,7 +50,7 @@ class MyDiagram: public wxDiagram
|
|||||||
* A few new shape classes so we have a 1:1 mapping
|
* A few new shape classes so we have a 1:1 mapping
|
||||||
* between palette symbol and unique class
|
* between palette symbol and unique class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class wxRoundedRectangleShape: public wxRectangleShape
|
class wxRoundedRectangleShape: public wxRectangleShape
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxRoundedRectangleShape)
|
DECLARE_DYNAMIC_CLASS(wxRoundedRectangleShape)
|
||||||
@@ -71,7 +71,7 @@ class wxDiamondShape: public wxPolygonShape
|
|||||||
* All shape event behaviour is routed through this handler, so we don't
|
* All shape event behaviour is routed through this handler, so we don't
|
||||||
* have to derive from each shape class. We plug this in to each shape.
|
* have to derive from each shape class. We plug this in to each shape.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class MyEvtHandler: public wxShapeEvtHandler
|
class MyEvtHandler: public wxShapeEvtHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -93,14 +93,14 @@ class MyEvtHandler: public wxShapeEvtHandler
|
|||||||
/*
|
/*
|
||||||
* A diagram document, which contains a diagram.
|
* A diagram document, which contains a diagram.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class DiagramDocument: public wxDocument
|
class DiagramDocument: public wxDocument
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(DiagramDocument)
|
DECLARE_DYNAMIC_CLASS(DiagramDocument)
|
||||||
private:
|
private:
|
||||||
public:
|
public:
|
||||||
MyDiagram diagram;
|
MyDiagram diagram;
|
||||||
|
|
||||||
DiagramDocument(void);
|
DiagramDocument(void);
|
||||||
~DiagramDocument(void);
|
~DiagramDocument(void);
|
||||||
|
|
||||||
@@ -111,9 +111,9 @@ class DiagramDocument: public wxDocument
|
|||||||
virtual wxOutputStream& SaveObject(wxOutputStream& stream);
|
virtual wxOutputStream& SaveObject(wxOutputStream& stream);
|
||||||
virtual wxInputStream& LoadObject(wxInputStream& stream);
|
virtual wxInputStream& LoadObject(wxInputStream& stream);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline wxDiagram *GetDiagram() { return &diagram; }
|
inline wxDiagram *GetDiagram() { return &diagram; }
|
||||||
|
|
||||||
bool OnCloseDocument(void);
|
bool OnCloseDocument(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ class DiagramDocument: public wxDocument
|
|||||||
* Assume, as here, that we keep a pointer to the old shape so we reuse it
|
* Assume, as here, that we keep a pointer to the old shape so we reuse it
|
||||||
* when we recreate.
|
* when we recreate.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class DiagramCommand: public wxCommand
|
class DiagramCommand: public wxCommand
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
@@ -52,7 +52,7 @@ MyApp::MyApp(void)
|
|||||||
bool MyApp::OnInit(void)
|
bool MyApp::OnInit(void)
|
||||||
{
|
{
|
||||||
wxOGLInitialize();
|
wxOGLInitialize();
|
||||||
|
|
||||||
//// Create a document manager
|
//// Create a document manager
|
||||||
myDocManager = new wxDocManager;
|
myDocManager = new wxDocManager;
|
||||||
|
|
||||||
@@ -88,13 +88,13 @@ bool MyApp::OnInit(void)
|
|||||||
edit_menu->Append(wxID_UNDO, _T("&Undo"));
|
edit_menu->Append(wxID_UNDO, _T("&Undo"));
|
||||||
edit_menu->Append(wxID_REDO, _T("&Redo"));
|
edit_menu->Append(wxID_REDO, _T("&Redo"));
|
||||||
edit_menu->AppendSeparator();
|
edit_menu->AppendSeparator();
|
||||||
edit_menu->Append(OGLEDIT_CUT, _T("&Cut"));
|
edit_menu->Append(wxID_CUT, _T("&Cut"));
|
||||||
edit_menu->AppendSeparator();
|
edit_menu->AppendSeparator();
|
||||||
edit_menu->Append(OGLEDIT_CHANGE_BACKGROUND_COLOUR, _T("Change &background colour"));
|
edit_menu->Append(OGLEDIT_CHANGE_BACKGROUND_COLOUR, _T("Change &background colour"));
|
||||||
edit_menu->Append(OGLEDIT_EDIT_LABEL, _T("Edit &label"));
|
edit_menu->Append(OGLEDIT_EDIT_LABEL, _T("Edit &label"));
|
||||||
|
|
||||||
frame->editMenu = edit_menu;
|
frame->editMenu = edit_menu;
|
||||||
|
|
||||||
file_menu->AppendSeparator();
|
file_menu->AppendSeparator();
|
||||||
file_menu->Append(wxID_EXIT, _T("E&xit"));
|
file_menu->Append(wxID_EXIT, _T("E&xit"));
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ void MyFrame::OnSize(wxSizeEvent& event)
|
|||||||
int canvasY = 0;
|
int canvasY = 0;
|
||||||
int canvasW = cw - paletteW;
|
int canvasW = cw - paletteW;
|
||||||
int canvasH = ch;
|
int canvasH = ch;
|
||||||
|
|
||||||
palette->SetSize(paletteX, paletteY, paletteW, paletteH);
|
palette->SetSize(paletteX, paletteY, paletteW, paletteH);
|
||||||
canvas->SetSize(canvasX, canvasY, canvasW, canvasH);
|
canvas->SetSize(canvasX, canvasY, canvasW, canvasH);
|
||||||
}
|
}
|
||||||
|
@@ -17,23 +17,23 @@
|
|||||||
#define _OGLSAMPLE_OGLEDIT_H_
|
#define _OGLSAMPLE_OGLEDIT_H_
|
||||||
|
|
||||||
#include <wx/docview.h>
|
#include <wx/docview.h>
|
||||||
#include <wx/deprecated/setup.h>
|
#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
|
||||||
|
|
||||||
// Define a new application
|
// Define a new application
|
||||||
class MyFrame;
|
class MyFrame;
|
||||||
class EditorToolPalette;
|
class EditorToolPalette;
|
||||||
class MyApp: public wxApp
|
class MyApp: public wxApp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyFrame *frame;
|
MyFrame *frame;
|
||||||
wxDocManager* myDocManager;
|
wxDocManager* myDocManager;
|
||||||
|
|
||||||
MyApp(void);
|
MyApp(void);
|
||||||
bool OnInit(void);
|
bool OnInit(void);
|
||||||
int OnExit(void);
|
int OnExit(void);
|
||||||
|
|
||||||
// Palette stuff
|
// Palette stuff
|
||||||
EditorToolPalette *CreatePalette(wxFrame *parent);
|
EditorToolPalette *CreatePalette(wxFrame *parent);
|
||||||
};
|
};
|
||||||
|
|
||||||
DECLARE_APP(MyApp)
|
DECLARE_APP(MyApp)
|
||||||
@@ -42,22 +42,22 @@ DECLARE_APP(MyApp)
|
|||||||
class MyCanvas;
|
class MyCanvas;
|
||||||
class MyFrame: public wxDocParentFrame
|
class MyFrame: public wxDocParentFrame
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(MyFrame)
|
DECLARE_CLASS(MyFrame)
|
||||||
public:
|
public:
|
||||||
wxMenu *editMenu;
|
wxMenu *editMenu;
|
||||||
|
|
||||||
MyCanvas *canvas;
|
|
||||||
EditorToolPalette *palette;
|
|
||||||
|
|
||||||
MyFrame(wxDocManager *manager, wxFrame *parent, const wxString& title,
|
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
|
||||||
const wxSize& size = wxDefaultSize,
|
|
||||||
long style = wxDEFAULT_FRAME_STYLE);
|
|
||||||
|
|
||||||
MyCanvas *CreateCanvas(wxView *view, wxFrame *parent);
|
MyCanvas *canvas;
|
||||||
void OnSize(wxSizeEvent& event);
|
EditorToolPalette *palette;
|
||||||
void OnCloseWindow(wxCloseEvent& event);
|
|
||||||
void OnAbout(wxCommandEvent& event);
|
MyFrame(wxDocManager *manager, wxFrame *parent, const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE);
|
||||||
|
|
||||||
|
MyCanvas *CreateCanvas(wxView *view, wxFrame *parent);
|
||||||
|
void OnSize(wxSizeEvent& event);
|
||||||
|
void OnCloseWindow(wxCloseEvent& event);
|
||||||
|
void OnAbout(wxCommandEvent& event);
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -66,13 +66,14 @@ extern MyFrame *GetMainFrame(void);
|
|||||||
|
|
||||||
// Menu/undo/redo commands
|
// Menu/undo/redo commands
|
||||||
|
|
||||||
#define OGLEDIT_CUT 1
|
enum
|
||||||
#define OGLEDIT_ADD_SHAPE 2
|
{
|
||||||
#define OGLEDIT_ADD_LINE 3
|
OGLEDIT_ADD_SHAPE = wxID_HIGHEST,
|
||||||
#define OGLEDIT_EDIT_LABEL 4
|
OGLEDIT_ADD_LINE,
|
||||||
#define OGLEDIT_CHANGE_BACKGROUND_COLOUR 5
|
OGLEDIT_EDIT_LABEL,
|
||||||
|
OGLEDIT_CHANGE_BACKGROUND_COLOUR,
|
||||||
#define OGLEDIT_ABOUT 100
|
OGLEDIT_ABOUT = wxID_ABOUT
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _OGLSAMPLE_OGLEDIT_H_
|
// _OGLSAMPLE_OGLEDIT_H_
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(DiagramView, wxView)
|
IMPLEMENT_DYNAMIC_CLASS(DiagramView, wxView)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(DiagramView, wxView)
|
BEGIN_EVENT_TABLE(DiagramView, wxView)
|
||||||
EVT_MENU(OGLEDIT_CUT, DiagramView::OnCut)
|
EVT_MENU(wxID_CUT, DiagramView::OnCut)
|
||||||
EVT_MENU(OGLEDIT_CHANGE_BACKGROUND_COLOUR, DiagramView::OnChangeBackgroundColour)
|
EVT_MENU(OGLEDIT_CHANGE_BACKGROUND_COLOUR, DiagramView::OnChangeBackgroundColour)
|
||||||
EVT_MENU(OGLEDIT_EDIT_LABEL, DiagramView::OnEditLabel)
|
EVT_MENU(OGLEDIT_EDIT_LABEL, DiagramView::OnEditLabel)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@@ -195,7 +195,7 @@ void DiagramView::OnCut(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
wxShape *theShape = FindSelectedShape();
|
wxShape *theShape = FindSelectedShape();
|
||||||
if (theShape)
|
if (theShape)
|
||||||
doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, true, theShape));
|
doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), wxID_CUT, doc, NULL, 0.0, 0.0, true, theShape));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event))
|
void DiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event))
|
||||||
|
@@ -18,19 +18,13 @@
|
|||||||
|
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/deprecated/tbarsmpl.h>
|
#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Object editor tool palette
|
* Object editor tool palette
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TODO for wxWin: wxToolBar95 cannot be moved to a non-0,0 position!
|
|
||||||
// Needs to have a parent window...
|
|
||||||
// So use a simple toolbar at present.
|
|
||||||
// ABX: Simple toolbar is not available in default compilation and is deprecated
|
|
||||||
// so I use wxToolBar anyway
|
|
||||||
// #define TOOLPALETTECLASS wxToolBarSimple
|
|
||||||
#define TOOLPALETTECLASS wxToolBar
|
#define TOOLPALETTECLASS wxToolBar
|
||||||
|
|
||||||
class csEditorToolPalette: public TOOLPALETTECLASS
|
class csEditorToolPalette: public TOOLPALETTECLASS
|
||||||
|
@@ -24,8 +24,7 @@
|
|||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <wx/deprecated/setup.h>
|
#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
|
||||||
#include <wx/deprecated/wxexpr.h>
|
|
||||||
|
|
||||||
#include <wx/clipbrd.h>
|
#include <wx/clipbrd.h>
|
||||||
|
|
||||||
@@ -190,7 +189,7 @@ bool wxDiagramClipboard::CopyToClipboard(double scale)
|
|||||||
if (!newBitmap->Ok())
|
if (!newBitmap->Ok())
|
||||||
{
|
{
|
||||||
delete newBitmap;
|
delete newBitmap;
|
||||||
|
|
||||||
wxChar buf[200];
|
wxChar buf[200];
|
||||||
wxSprintf(buf, _T("Sorry, could not allocate clipboard bitmap (%dx%d)"), (maxX+10), (maxY+10));
|
wxSprintf(buf, _T("Sorry, could not allocate clipboard bitmap (%dx%d)"), (maxX+10), (maxY+10));
|
||||||
wxMessageBox(buf, _T("Clipboard copy problem"));
|
wxMessageBox(buf, _T("Clipboard copy problem"));
|
||||||
@@ -226,7 +225,7 @@ bool wxDiagramClipboard::CopyToClipboard(double scale)
|
|||||||
// Close clipboard
|
// Close clipboard
|
||||||
wxCloseClipboard();
|
wxCloseClipboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
delete newBitmap;
|
delete newBitmap;
|
||||||
delete mf;
|
delete mf;
|
||||||
|
|
||||||
|
@@ -24,14 +24,14 @@
|
|||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <wx/deprecated/setup.h>
|
|
||||||
#include <wx/deprecated/resource.h>
|
|
||||||
#include "dialogs.h"
|
#include "dialogs.h"
|
||||||
#include "doc.h"
|
#include "doc.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
#include "studio.h"
|
#include "studio.h"
|
||||||
#include "studio_resources.h"
|
#include "studio_resources.h"
|
||||||
|
|
||||||
|
#if wxUSE_WX_RESOURCES
|
||||||
|
|
||||||
IMPLEMENT_CLASS(csLabelEditingDialog, wxDialog)
|
IMPLEMENT_CLASS(csLabelEditingDialog, wxDialog)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(csLabelEditingDialog, wxDialog)
|
BEGIN_EVENT_TABLE(csLabelEditingDialog, wxDialog)
|
||||||
@@ -101,7 +101,7 @@ csSettingsDialog::csSettingsDialog(wxWindow* parent):
|
|||||||
m_generalSettings = new wxPanel;
|
m_generalSettings = new wxPanel;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
bool success =
|
bool success =
|
||||||
#endif
|
#endif
|
||||||
wxLoadFromResource(m_generalSettings, m_notebook, _T("general_settings_dialog"));
|
wxLoadFromResource(m_generalSettings, m_notebook, _T("general_settings_dialog"));
|
||||||
wxASSERT_MSG( (success), _T("Could not load general settings panel."));
|
wxASSERT_MSG( (success), _T("Could not load general settings panel."));
|
||||||
@@ -110,7 +110,7 @@ csSettingsDialog::csSettingsDialog(wxWindow* parent):
|
|||||||
m_diagramSettings = new wxPanel;
|
m_diagramSettings = new wxPanel;
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
success =
|
success =
|
||||||
#endif
|
#endif
|
||||||
wxLoadFromResource(m_diagramSettings, m_notebook, _T("diagram_settings_dialog"));
|
wxLoadFromResource(m_diagramSettings, m_notebook, _T("diagram_settings_dialog"));
|
||||||
wxASSERT_MSG( (success), _T("Could not load diagram settings panel."));
|
wxASSERT_MSG( (success), _T("Could not load diagram settings panel."));
|
||||||
@@ -257,7 +257,7 @@ END_EVENT_TABLE()
|
|||||||
// For 400x400 settings dialog, size your panels to about 375x325 in dialog editor
|
// For 400x400 settings dialog, size your panels to about 375x325 in dialog editor
|
||||||
|
|
||||||
csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxString& title,
|
csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxString& title,
|
||||||
wxPanel* attributeDialog, const wxString& attributeDialogName):
|
wxPanel* attributeDialog, const wxString& attributeDialogName):
|
||||||
wxDialog(parent, wxID_ANY, title, wxPoint(0, 0), wxSize(SHAPE_PROPERTY_DIALOG_WIDTH, SHAPE_PROPERTY_DIALOG_HEIGHT))
|
wxDialog(parent, wxID_ANY, title, wxPoint(0, 0), wxSize(SHAPE_PROPERTY_DIALOG_WIDTH, SHAPE_PROPERTY_DIALOG_HEIGHT))
|
||||||
{
|
{
|
||||||
m_attributeDialog = attributeDialog;
|
m_attributeDialog = attributeDialog;
|
||||||
@@ -269,7 +269,7 @@ csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxStrin
|
|||||||
|
|
||||||
m_generalPropertiesDialog = new csGeneralShapePropertiesDialog;
|
m_generalPropertiesDialog = new csGeneralShapePropertiesDialog;
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
bool success =
|
bool success =
|
||||||
#endif
|
#endif
|
||||||
wxLoadFromResource(m_generalPropertiesDialog, m_notebook, _T("general_shape_properties_dialog"));
|
wxLoadFromResource(m_generalPropertiesDialog, m_notebook, _T("general_shape_properties_dialog"));
|
||||||
wxASSERT_MSG( (success), _T("Could not load general properties panel."));
|
wxASSERT_MSG( (success), _T("Could not load general properties panel."));
|
||||||
@@ -416,6 +416,8 @@ void csGeneralShapePropertiesDialog::SetShapeLabel(const wxString& label)
|
|||||||
textCtrl->SetValue(label);
|
textCtrl->SetValue(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_WX_RESOURCES
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* csThinRectangleDialog
|
* csThinRectangleDialog
|
||||||
*/
|
*/
|
||||||
|
@@ -19,6 +19,10 @@
|
|||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#include <wx/notebook.h>
|
#include <wx/notebook.h>
|
||||||
|
|
||||||
|
#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
|
||||||
|
|
||||||
|
#if wxUSE_WX_RESOURCES
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Label editing dialog (about to become obsolete)
|
* Label editing dialog (about to become obsolete)
|
||||||
*/
|
*/
|
||||||
@@ -103,7 +107,7 @@ public:
|
|||||||
// Set some suitable defaults in the attribute dialogs (in the first instance,
|
// Set some suitable defaults in the attribute dialogs (in the first instance,
|
||||||
// just set all wxChoices to the first element)
|
// just set all wxChoices to the first element)
|
||||||
void SetDefaults();
|
void SetDefaults();
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
csGeneralShapePropertiesDialog* GetGeneralPropertiesDialog() const { return m_generalPropertiesDialog; }
|
csGeneralShapePropertiesDialog* GetGeneralPropertiesDialog() const { return m_generalPropertiesDialog; }
|
||||||
|
|
||||||
@@ -122,6 +126,8 @@ protected:
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // wxUSE_WX_RESOURCES
|
||||||
|
|
||||||
#define ID_SHAPE_PROPERTY_NOTEBOOK 1000
|
#define ID_SHAPE_PROPERTY_NOTEBOOK 1000
|
||||||
|
|
||||||
//// Specific attribute-editing panel classes below here
|
//// Specific attribute-editing panel classes below here
|
||||||
@@ -243,6 +249,5 @@ public:
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _STUDIO_DIALOGS_H_
|
// _STUDIO_DIALOGS_H_
|
||||||
|
@@ -53,6 +53,7 @@ bool csDiagramDocument::OnCloseDocument()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_PROLOGIO
|
||||||
bool csDiagramDocument::OnSaveDocument(const wxString& file)
|
bool csDiagramDocument::OnSaveDocument(const wxString& file)
|
||||||
{
|
{
|
||||||
if (file == wxEmptyString)
|
if (file == wxEmptyString)
|
||||||
@@ -97,9 +98,10 @@ bool csDiagramDocument::OnOpenDocument(const wxString& file)
|
|||||||
SetFilename(file, true);
|
SetFilename(file, true);
|
||||||
Modify(false);
|
Modify(false);
|
||||||
UpdateAllViews();
|
UpdateAllViews();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif // wxUSE_PROLOGIO
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -268,7 +270,7 @@ bool csCommandState::Do()
|
|||||||
((csDiagramView*) m_doc->GetFirstView())->SelectShape(m_shapeOnCanvas, false);
|
((csDiagramView*) m_doc->GetFirstView())->SelectShape(m_shapeOnCanvas, false);
|
||||||
|
|
||||||
m_shapeOnCanvas->Unlink();
|
m_shapeOnCanvas->Unlink();
|
||||||
|
|
||||||
m_doc->GetDiagram()->RemoveShape(m_shapeOnCanvas);
|
m_doc->GetDiagram()->RemoveShape(m_shapeOnCanvas);
|
||||||
|
|
||||||
m_savedState = m_shapeOnCanvas;
|
m_savedState = m_shapeOnCanvas;
|
||||||
@@ -347,7 +349,7 @@ bool csCommandState::Do()
|
|||||||
|
|
||||||
lineShape->GetFrom()->AddLine(lineShape, lineShape->GetTo(),
|
lineShape->GetFrom()->AddLine(lineShape, lineShape->GetTo(),
|
||||||
lineShape->GetAttachmentFrom(), lineShape->GetAttachmentTo());
|
lineShape->GetAttachmentFrom(), lineShape->GetAttachmentTo());
|
||||||
|
|
||||||
lineShape->Show(true);
|
lineShape->Show(true);
|
||||||
|
|
||||||
wxClientDC dc(lineShape->GetCanvas());
|
wxClientDC dc(lineShape->GetCanvas());
|
||||||
@@ -475,7 +477,7 @@ bool csCommandState::Do()
|
|||||||
|
|
||||||
if (isSelected)
|
if (isSelected)
|
||||||
m_shapeOnCanvas->Select(true, & dc);
|
m_shapeOnCanvas->Select(true, & dc);
|
||||||
|
|
||||||
m_doc->Modify(true);
|
m_doc->Modify(true);
|
||||||
m_doc->UpdateAllViews();
|
m_doc->UpdateAllViews();
|
||||||
|
|
||||||
|
@@ -20,16 +20,14 @@
|
|||||||
#include <wx/cmdproc.h>
|
#include <wx/cmdproc.h>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
|
|
||||||
#include <wx/deprecated/setup.h>
|
#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
|
||||||
#include <wx/deprecated/wxexpr.h>
|
|
||||||
|
|
||||||
#include <wx/ogl/ogl.h>
|
|
||||||
#include "shapes.h"
|
#include "shapes.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A diagram document, which contains a diagram.
|
* A diagram document, which contains a diagram.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class csDiagramDocument: public wxDocument
|
class csDiagramDocument: public wxDocument
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(csDiagramDocument)
|
DECLARE_DYNAMIC_CLASS(csDiagramDocument)
|
||||||
@@ -37,11 +35,13 @@ public:
|
|||||||
csDiagramDocument();
|
csDiagramDocument();
|
||||||
~csDiagramDocument();
|
~csDiagramDocument();
|
||||||
|
|
||||||
|
#if wxUSE_PROLOGIO
|
||||||
bool OnSaveDocument(const wxString& file);
|
bool OnSaveDocument(const wxString& file);
|
||||||
bool OnOpenDocument(const wxString& file);
|
bool OnOpenDocument(const wxString& file);
|
||||||
|
#endif // wxUSE_PROLOGIO
|
||||||
|
|
||||||
inline wxDiagram *GetDiagram() { return &m_diagram; }
|
inline wxDiagram *GetDiagram() { return &m_diagram; }
|
||||||
|
|
||||||
bool OnCloseDocument();
|
bool OnCloseDocument();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -71,7 +71,7 @@ protected:
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class csCommandState;
|
class csCommandState;
|
||||||
class csDiagramCommand: public wxCommand
|
class csDiagramCommand: public wxCommand
|
||||||
{
|
{
|
||||||
|
@@ -80,9 +80,11 @@ void csFrame::OnHelp(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
void csFrame::OnSettings(wxCommandEvent& WXUNUSED(event))
|
void csFrame::OnSettings(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
|
#if wxUSE_WX_RESOURCES
|
||||||
csSettingsDialog* dialog = new csSettingsDialog(this);
|
csSettingsDialog* dialog = new csSettingsDialog(this);
|
||||||
/* int ret = */ dialog->ShowModal();
|
/* int ret = */ dialog->ShowModal();
|
||||||
dialog->Destroy();
|
dialog->Destroy();
|
||||||
|
#endif // wxUSE_WX_RESOURCES
|
||||||
}
|
}
|
||||||
|
|
||||||
void csFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
void csFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||||
|
@@ -28,15 +28,12 @@
|
|||||||
#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 wx_setup.h!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <wx/deprecated/setup.h>
|
#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
|
||||||
#include <wx/deprecated/wxexpr.h>
|
|
||||||
|
|
||||||
#include "studio.h"
|
#include "studio.h"
|
||||||
#include "doc.h"
|
#include "doc.h"
|
||||||
#include "shapes.h"
|
#include "shapes.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
#include <wx/ogl/basicp.h>
|
|
||||||
#include <wx/ogl/linesp.h>
|
|
||||||
#include "cspalette.h"
|
#include "cspalette.h"
|
||||||
#include "dialogs.h"
|
#include "dialogs.h"
|
||||||
|
|
||||||
@@ -682,6 +679,9 @@ bool csEvtHandler::EditProperties()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxString newLabel(m_label);
|
||||||
|
|
||||||
|
#if wxUSE_WX_RESOURCES
|
||||||
csShapePropertiesDialog* dialog = new csShapePropertiesDialog(shape->GetCanvas()->GetParent(), title, attributeDialog, attributeDialogName);
|
csShapePropertiesDialog* dialog = new csShapePropertiesDialog(shape->GetCanvas()->GetParent(), title, attributeDialog, attributeDialogName);
|
||||||
dialog->GetGeneralPropertiesDialog()->SetShapeLabel(m_label);
|
dialog->GetGeneralPropertiesDialog()->SetShapeLabel(m_label);
|
||||||
if (dialog->ShowModal() == wxID_CANCEL)
|
if (dialog->ShowModal() == wxID_CANCEL)
|
||||||
@@ -690,8 +690,11 @@ bool csEvtHandler::EditProperties()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString newLabel = dialog->GetGeneralPropertiesDialog()->GetShapeLabel();
|
newLabel = dialog->GetGeneralPropertiesDialog()->GetShapeLabel();
|
||||||
dialog->Destroy();
|
dialog->Destroy();
|
||||||
|
#else
|
||||||
|
wxUnusedVar(attributeDialog);
|
||||||
|
#endif // wxUSE_WX_RESOURCES
|
||||||
|
|
||||||
wxShape* newShape = shape->CreateNewCopy();
|
wxShape* newShape = shape->CreateNewCopy();
|
||||||
|
|
||||||
@@ -708,6 +711,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);
|
||||||
@@ -726,6 +730,7 @@ bool csDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif // wxUSE_PROLOGIO
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(csThinRectangleShape, wxDrawnShape)
|
IMPLEMENT_DYNAMIC_CLASS(csThinRectangleShape, wxDrawnShape)
|
||||||
|
|
||||||
|
@@ -18,10 +18,7 @@
|
|||||||
|
|
||||||
#include <wx/docview.h>
|
#include <wx/docview.h>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/deprecated/setup.h>
|
#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
|
||||||
#include <wx/deprecated/wxexpr.h>
|
|
||||||
|
|
||||||
#include <wx/ogl/ogl.h>
|
|
||||||
#include <wx/ogl/basicp.h>
|
#include <wx/ogl/basicp.h>
|
||||||
#include <wx/ogl/linesp.h>
|
#include <wx/ogl/linesp.h>
|
||||||
#include <wx/ogl/drawn.h>
|
#include <wx/ogl/drawn.h>
|
||||||
@@ -31,15 +28,17 @@ class csDiagramDocument;
|
|||||||
/*
|
/*
|
||||||
* Override a few members for this application
|
* Override a few members for this application
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class csDiagram: public wxDiagram
|
class csDiagram: public wxDiagram
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(csDiagram)
|
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 // wxUSE_PROLOGIO
|
||||||
|
|
||||||
inline csDiagramDocument* GetDocument() const { return m_doc; }
|
inline csDiagramDocument* GetDocument() const { return m_doc; }
|
||||||
virtual void Redraw(wxDC& dc);
|
virtual void Redraw(wxDC& dc);
|
||||||
@@ -206,7 +205,7 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Temporary arc label object
|
* Temporary arc label object
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class csLabelShape: public wxLabelShape
|
class csLabelShape: public wxLabelShape
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(csLabelShape)
|
DECLARE_DYNAMIC_CLASS(csLabelShape)
|
||||||
|
@@ -21,8 +21,8 @@
|
|||||||
#include "wx/mdi.h"
|
#include "wx/mdi.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <wx/deprecated/setup.h>
|
#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
|
||||||
#include <wx/deprecated/resource.h>
|
|
||||||
#include "wx/config.h"
|
#include "wx/config.h"
|
||||||
#include "wx/laywin.h"
|
#include "wx/laywin.h"
|
||||||
|
|
||||||
@@ -92,11 +92,13 @@ csApp::~csApp()
|
|||||||
// Initialise this in OnInit, not statically
|
// Initialise this in OnInit, not statically
|
||||||
bool csApp::OnInit(void)
|
bool csApp::OnInit(void)
|
||||||
{
|
{
|
||||||
|
#if wxUSE_WX_RESOURCES
|
||||||
if (!wxResourceParseFile(_T("studio_resources.wxr")))
|
if (!wxResourceParseFile(_T("studio_resources.wxr")))
|
||||||
{
|
{
|
||||||
wxMessageBox(_T("Could not find or parse resource file: studio_resources.wxr"), _T("Studio"));
|
wxMessageBox(_T("Could not find or parse resource file: studio_resources.wxr"), _T("Studio"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if wxUSE_MS_HTML_HELP && !defined(__WXUNIVERSAL__)
|
#if wxUSE_MS_HTML_HELP && !defined(__WXUNIVERSAL__)
|
||||||
m_helpController = new wxWinHelpController;
|
m_helpController = new wxWinHelpController;
|
||||||
@@ -224,7 +226,7 @@ int csApp::OnExit(void)
|
|||||||
* Centralised code for creating a document frame.
|
* Centralised code for creating a document frame.
|
||||||
* Called from view.cpp, when a view is created.
|
* Called from view.cpp, when a view is created.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu** editMenuRet)
|
wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu** editMenuRet)
|
||||||
{
|
{
|
||||||
//// Make a child frame
|
//// Make a child frame
|
||||||
|
@@ -24,8 +24,7 @@
|
|||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <wx/deprecated/setup.h>
|
#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
|
||||||
#include <wx/deprecated/wxexpr.h>
|
|
||||||
|
|
||||||
#include "studio.h"
|
#include "studio.h"
|
||||||
#include "doc.h"
|
#include "doc.h"
|
||||||
@@ -189,7 +188,7 @@ wxBitmap* csSymbolDatabase::CreateToolBitmap(csSymbol* symbol, const wxSize& too
|
|||||||
memDC.SelectObject(wxNullBitmap);
|
memDC.SelectObject(wxNullBitmap);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
wxMemoryDC memDC;
|
wxMemoryDC memDC;
|
||||||
|
|
||||||
double height, width, maxSize;
|
double height, width, maxSize;
|
||||||
|
@@ -19,10 +19,7 @@
|
|||||||
#include <wx/docview.h>
|
#include <wx/docview.h>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
|
|
||||||
#include <wx/deprecated/setup.h>
|
#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
|
||||||
#include <wx/deprecated/wxexpr.h>
|
|
||||||
|
|
||||||
#include <wx/ogl/ogl.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* csSymbol
|
* csSymbol
|
||||||
|
@@ -877,6 +877,9 @@ void csCanvas::OnLeftClick(double x, double y, int WXUNUSED(keys))
|
|||||||
|
|
||||||
if (palette->GetSelection() == PALETTE_TEXT_TOOL)
|
if (palette->GetSelection() == PALETTE_TEXT_TOOL)
|
||||||
{
|
{
|
||||||
|
wxString newLabel;
|
||||||
|
|
||||||
|
#if wxUSE_WX_RESOURCES
|
||||||
// Ask for a label and create a new free-floating text region
|
// Ask for a label and create a new free-floating text region
|
||||||
csLabelEditingDialog* dialog = new csLabelEditingDialog(GetParent());
|
csLabelEditingDialog* dialog = new csLabelEditingDialog(GetParent());
|
||||||
|
|
||||||
@@ -888,8 +891,9 @@ void csCanvas::OnLeftClick(double x, double y, int WXUNUSED(keys))
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString newLabel = dialog->GetShapeLabel();
|
newLabel = dialog->GetShapeLabel();
|
||||||
dialog->Destroy();
|
dialog->Destroy();
|
||||||
|
#endif // wxUSE_WX_RESOURCES
|
||||||
|
|
||||||
wxShape* shape = new csTextBoxShape;
|
wxShape* shape = new csTextBoxShape;
|
||||||
shape->AssignNewIds();
|
shape->AssignNewIds();
|
||||||
|
Reference in New Issue
Block a user