Unicode compilation fixes for OGL (patch #791967)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -72,9 +72,9 @@ bool csEditorToolPalette::OnLeftClick(int toolIndex, bool toggled)
|
||||
|
||||
void csEditorToolPalette::OnMouseEnter(int toolIndex)
|
||||
{
|
||||
wxString msg("");
|
||||
wxString msg = wxEmptyString;
|
||||
if (toolIndex == PALETTE_ARROW)
|
||||
msg = "Pointer";
|
||||
msg = _T("Pointer");
|
||||
else if (toolIndex != -1)
|
||||
{
|
||||
csSymbol* symbol = wxGetApp().GetSymbolDatabase()->FindSymbol(toolIndex);
|
||||
@@ -115,8 +115,8 @@ bool csApp::CreatePalette(wxFrame *parent)
|
||||
|
||||
// Load palette bitmaps
|
||||
#ifdef __WXMSW__
|
||||
wxBitmap PaletteArrow("arrowtool");
|
||||
wxBitmap TextTool("texttool");
|
||||
wxBitmap PaletteArrow(_T("arrowtool"));
|
||||
wxBitmap TextTool(_T("texttool"));
|
||||
wxSize toolBitmapSize(32, 32);
|
||||
#elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__)
|
||||
wxBitmap PaletteArrow(arrow_xpm);
|
||||
@@ -130,37 +130,37 @@ bool csApp::CreatePalette(wxFrame *parent)
|
||||
|
||||
palette->SetToolBitmapSize(toolBitmapSize);
|
||||
|
||||
palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, TRUE, 0, -1, NULL, "Pointer");
|
||||
palette->AddTool(PALETTE_TEXT_TOOL, TextTool, wxNullBitmap, TRUE, 0, -1, NULL, "Text");
|
||||
palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, TRUE, 0, -1, NULL, _T("Pointer"));
|
||||
palette->AddTool(PALETTE_TEXT_TOOL, TextTool, wxNullBitmap, TRUE, 0, -1, NULL, _T("Text"));
|
||||
|
||||
char** symbols = new char*[20];
|
||||
int noSymbols = 0;
|
||||
|
||||
symbols[noSymbols] = "Wide Rectangle";
|
||||
symbols[noSymbols] = _T("Wide Rectangle");
|
||||
noSymbols ++;
|
||||
|
||||
symbols[noSymbols] = "Thin Rectangle";
|
||||
symbols[noSymbols] = _T("Thin Rectangle");
|
||||
noSymbols ++;
|
||||
|
||||
symbols[noSymbols] = "Triangle";
|
||||
symbols[noSymbols] = _T("Triangle");
|
||||
noSymbols ++;
|
||||
|
||||
symbols[noSymbols] = "Octagon";
|
||||
symbols[noSymbols] = _T("Octagon");
|
||||
noSymbols ++;
|
||||
|
||||
// For some reason, we're getting Gdk errors with
|
||||
// some shapes, such as ones that use DrawEllipse.
|
||||
#ifndef __WXGTK__
|
||||
symbols[noSymbols] = "Group";
|
||||
symbols[noSymbols] = _T("Group");
|
||||
noSymbols ++;
|
||||
|
||||
symbols[noSymbols] = "Circle";
|
||||
symbols[noSymbols] = _T("Circle");
|
||||
noSymbols ++;
|
||||
|
||||
symbols[noSymbols] = "Circle shadow";
|
||||
symbols[noSymbols] = _T("Circle shadow");
|
||||
noSymbols ++;
|
||||
|
||||
symbols[noSymbols] = "SemiCircle";
|
||||
symbols[noSymbols] = _T("SemiCircle");
|
||||
noSymbols ++;
|
||||
#endif
|
||||
|
||||
|
@@ -28,7 +28,10 @@
|
||||
// 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.
|
||||
#define TOOLPALETTECLASS wxToolBarSimple
|
||||
// ABX: Simple toolbar is not available in default compilation and is deprecated
|
||||
// so I use wxToolBar anyway
|
||||
// #define TOOLPALETTECLASS wxToolBarSimple
|
||||
#define TOOLPALETTECLASS wxToolBar
|
||||
|
||||
class csEditorToolPalette: public TOOLPALETTECLASS
|
||||
{
|
||||
|
@@ -112,8 +112,8 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo
|
||||
wxShape* fromShape = (wxShape*) mapping.Get((long) lineShape->GetFrom());
|
||||
wxShape* toShape = (wxShape*) mapping.Get((long) lineShape->GetTo());
|
||||
|
||||
wxASSERT_MSG( (fromShape != NULL), "Could not find 'from' shape");
|
||||
wxASSERT_MSG( (toShape != NULL), "Could not find 'to' shape");
|
||||
wxASSERT_MSG( (fromShape != NULL), _T("Could not find 'from' shape"));
|
||||
wxASSERT_MSG( (toShape != NULL), _T("Could not find 'to' shape"));
|
||||
|
||||
fromShape->AddLine(newShape, toShape, newShape->GetAttachmentFrom(),
|
||||
newShape->GetAttachmentTo());
|
||||
@@ -145,7 +145,7 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo
|
||||
{
|
||||
wxLineShape* newLineShape = (wxLineShape*) mapping.Get((long) lineShape);
|
||||
|
||||
wxASSERT_MSG( (newLineShape != NULL), "Could not find new line shape");
|
||||
wxASSERT_MSG( (newLineShape != NULL), _T("Could not find new line shape"));
|
||||
|
||||
newLines.Append(newLineShape);
|
||||
}
|
||||
@@ -178,8 +178,8 @@ bool wxDiagramClipboard::CopyToClipboard(double scale)
|
||||
// Draw on metafile DC
|
||||
Redraw(mfDC);
|
||||
|
||||
int printWidth = mfDC.MaxX() - mfDC.MinX();
|
||||
int printHeight = mfDC.MaxY() - mfDC.MinY();
|
||||
/* int printWidth = */ mfDC.MaxX() - mfDC.MinX();
|
||||
/* int printHeight = */ mfDC.MaxY() - mfDC.MinY();
|
||||
int maxX = (int)mfDC.MaxX();
|
||||
int maxY = (int)mfDC.MaxY();
|
||||
wxMetaFile *mf = mfDC.Close();
|
||||
@@ -192,7 +192,7 @@ bool wxDiagramClipboard::CopyToClipboard(double scale)
|
||||
|
||||
char buf[200];
|
||||
sprintf(buf, "Sorry, could not allocate clipboard bitmap (%dx%d)", (maxX+10), (maxY+10));
|
||||
wxMessageBox(buf, "Clipboard copy problem");
|
||||
wxMessageBox(buf, _T("Clipboard copy problem"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ bool csDiagramClipboard::OnStartCopy(wxDiagram* diagramTo)
|
||||
csDiagramDocument* doc = diagram->GetDocument();
|
||||
((csDiagramView*)doc->GetFirstView())->SelectAll(FALSE);
|
||||
|
||||
m_currentCmd = new csDiagramCommand("Paste", doc);
|
||||
m_currentCmd = new csDiagramCommand(_T("Paste"), doc);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -299,7 +299,7 @@ bool csDiagramClipboard::OnEndCopy(wxDiagram* diagramTo)
|
||||
|
||||
// Use the command framework to add the shapes, if we're copying to a diagram and
|
||||
// not the clipboard.
|
||||
bool csDiagramClipboard::OnAddShape(wxDiagram* diagramTo, wxShape* newShape, wxDC* dc)
|
||||
bool csDiagramClipboard::OnAddShape(wxDiagram* diagramTo, wxShape* newShape, wxDC* WXUNUSED(dc))
|
||||
{
|
||||
if (diagramTo == this)
|
||||
{
|
||||
@@ -308,7 +308,7 @@ bool csDiagramClipboard::OnAddShape(wxDiagram* diagramTo, wxShape* newShape, wxD
|
||||
else
|
||||
{
|
||||
csDiagram* diagram = (csDiagram*) diagramTo;
|
||||
csDiagramDocument* doc = diagram->GetDocument();
|
||||
/* csDiagramDocument* doc = */ diagram->GetDocument();
|
||||
|
||||
if (newShape->IsKindOf(CLASSINFO(wxLineShape)))
|
||||
m_currentCmd->AddState(new csCommandState(ID_CS_ADD_LINE_SELECT, newShape, NULL));
|
||||
|
@@ -40,7 +40,7 @@ END_EVENT_TABLE()
|
||||
|
||||
csLabelEditingDialog::csLabelEditingDialog(wxWindow* parent)
|
||||
{
|
||||
wxLoadFromResource(this, parent, "shape_label_dialog");
|
||||
wxLoadFromResource(this, parent, _T("shape_label_dialog"));
|
||||
|
||||
// Accelerators
|
||||
wxAcceleratorEntry entries[1];
|
||||
@@ -90,7 +90,7 @@ END_EVENT_TABLE()
|
||||
// For 400x400 settings dialog, size your panels to about 375x325 in dialog editor
|
||||
|
||||
csSettingsDialog::csSettingsDialog(wxWindow* parent):
|
||||
wxDialog(parent, -1, "Settings", wxPoint(0, 0), wxSize(PROPERTY_DIALOG_WIDTH, PROPERTY_DIALOG_HEIGHT))
|
||||
wxDialog(parent, -1, _T("Settings"), wxPoint(0, 0), wxSize(PROPERTY_DIALOG_WIDTH, PROPERTY_DIALOG_HEIGHT))
|
||||
{
|
||||
m_generalSettings = NULL;
|
||||
m_diagramSettings = NULL;
|
||||
@@ -100,22 +100,22 @@ csSettingsDialog::csSettingsDialog(wxWindow* parent):
|
||||
|
||||
m_generalSettings = new wxPanel;
|
||||
|
||||
bool success = wxLoadFromResource(m_generalSettings, m_notebook, "general_settings_dialog");
|
||||
wxASSERT_MSG( (success), "Could not load general settings panel.");
|
||||
m_notebook->AddPage(m_generalSettings, "General", TRUE);
|
||||
bool success = wxLoadFromResource(m_generalSettings, m_notebook, _T("general_settings_dialog"));
|
||||
wxASSERT_MSG( (success), _T("Could not load general settings panel."));
|
||||
m_notebook->AddPage(m_generalSettings, _T("General"), TRUE);
|
||||
|
||||
m_diagramSettings = new wxPanel;
|
||||
|
||||
success = wxLoadFromResource(m_diagramSettings, m_notebook, "diagram_settings_dialog");
|
||||
wxASSERT_MSG( (success), "Could not load diagram settings panel.");
|
||||
m_notebook->AddPage(m_diagramSettings, "Diagram");
|
||||
success = wxLoadFromResource(m_diagramSettings, m_notebook, _T("diagram_settings_dialog"));
|
||||
wxASSERT_MSG( (success), _T("Could not load diagram settings panel."));
|
||||
m_notebook->AddPage(m_diagramSettings, _T("Diagram"));
|
||||
|
||||
int largeButtonWidth = 70;
|
||||
int largeButtonHeight = 22;
|
||||
|
||||
wxButton* okButton = new wxButton(this, wxID_OK, "OK", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
wxButton* cancelButton = new wxButton(this, wxID_CANCEL, "Cancel", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
wxButton* helpButton = new wxButton(this, wxID_HELP, "Help", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
wxButton* okButton = new wxButton(this, wxID_OK, _T("OK"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
wxButton* cancelButton = new wxButton(this, wxID_CANCEL, _T("Cancel"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
wxButton* helpButton = new wxButton(this, wxID_HELP, _T("Help"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
|
||||
// Constraints for the notebook
|
||||
wxLayoutConstraints *c = new wxLayoutConstraints;
|
||||
@@ -164,15 +164,15 @@ void csSettingsDialog::OnOK(wxCommandEvent& event)
|
||||
bool csSettingsDialog::TransferDataToWindow()
|
||||
{
|
||||
wxTextCtrl* gridSpacing = (wxTextCtrl*) m_diagramSettings->FindWindow(ID_GRID_SPACING);
|
||||
wxASSERT_MSG( (gridSpacing != (wxTextCtrl*) NULL), "Could not find grid spacing control.");
|
||||
wxASSERT_MSG( (gridSpacing != (wxTextCtrl*) NULL), _T("Could not find grid spacing control."));
|
||||
|
||||
wxChoice* gridStyle = (wxChoice*) m_diagramSettings->FindWindow(ID_GRID_STYLE);
|
||||
wxASSERT_MSG( (gridStyle != (wxChoice*) NULL), "Could not find grid style control.");
|
||||
wxASSERT_MSG( (gridStyle != (wxChoice*) NULL), _T("Could not find grid style control."));
|
||||
|
||||
gridStyle->SetSelection(wxGetApp().GetGridStyle());
|
||||
|
||||
wxString str;
|
||||
str.Printf("%d", wxGetApp().GetGridSpacing());
|
||||
str.Printf(_T("%d"), wxGetApp().GetGridSpacing());
|
||||
gridSpacing->SetValue(str);
|
||||
|
||||
return TRUE;
|
||||
@@ -181,17 +181,20 @@ bool csSettingsDialog::TransferDataToWindow()
|
||||
bool csSettingsDialog::TransferDataFromWindow()
|
||||
{
|
||||
wxTextCtrl* gridSpacing = (wxTextCtrl*) m_diagramSettings->FindWindow(ID_GRID_SPACING);
|
||||
wxASSERT_MSG( (gridSpacing != (wxTextCtrl*) NULL), "Could not find grid spacing control.");
|
||||
wxASSERT_MSG( (gridSpacing != (wxTextCtrl*) NULL), _T("Could not find grid spacing control."));
|
||||
|
||||
wxChoice* gridStyle = (wxChoice*) m_diagramSettings->FindWindow(ID_GRID_STYLE);
|
||||
wxASSERT_MSG( (gridStyle != (wxChoice*) NULL), "Could not find grid style control.");
|
||||
wxASSERT_MSG( (gridStyle != (wxChoice*) NULL), _T("Could not find grid style control."));
|
||||
|
||||
wxGetApp().SetGridStyle(gridStyle->GetSelection());
|
||||
wxGetApp().SetGridSpacing(atoi(gridSpacing->GetValue()));
|
||||
wxString str = gridSpacing->GetValue();
|
||||
long grid_spacing;
|
||||
str.ToLong( &grid_spacing);
|
||||
wxGetApp().SetGridSpacing(grid_spacing);
|
||||
|
||||
if (wxGetApp().GetGridStyle() == csGRID_STYLE_DOTTED)
|
||||
{
|
||||
wxMessageBox("Dotted grid style not yet implemented.", "Studio", wxICON_EXCLAMATION);
|
||||
wxMessageBox(_T("Dotted grid style not yet implemented."), _T("Studio"), wxICON_EXCLAMATION);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -259,30 +262,30 @@ csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxStrin
|
||||
wxPoint(2, 2), wxSize(SHAPE_PROPERTY_DIALOG_WIDTH - 4, SHAPE_PROPERTY_DIALOG_HEIGHT - 4));
|
||||
|
||||
m_generalPropertiesDialog = new csGeneralShapePropertiesDialog;
|
||||
bool success = wxLoadFromResource(m_generalPropertiesDialog, m_notebook, "general_shape_properties_dialog");
|
||||
wxASSERT_MSG( (success), "Could not load general properties panel.");
|
||||
m_notebook->AddPage(m_generalPropertiesDialog, "General");
|
||||
bool success = wxLoadFromResource(m_generalPropertiesDialog, m_notebook, _T("general_shape_properties_dialog"));
|
||||
wxASSERT_MSG( (success), _T("Could not load general properties panel."));
|
||||
m_notebook->AddPage(m_generalPropertiesDialog, _T("General"));
|
||||
|
||||
success = wxLoadFromResource(m_attributeDialog, m_notebook, attributeDialogName);
|
||||
if (!success)
|
||||
{
|
||||
wxMessageBox("Could not load the attribute dialog for this shape.", "Studio", wxICON_EXCLAMATION);
|
||||
wxMessageBox(_T("Could not load the attribute dialog for this shape."), _T("Studio"), wxICON_EXCLAMATION);
|
||||
delete m_attributeDialog;
|
||||
m_attributeDialog = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_notebook->AddPage(m_attributeDialog, "Attributes");
|
||||
m_notebook->AddPage(m_attributeDialog, _T("Attributes"));
|
||||
}
|
||||
|
||||
// Try the alternative dialog (test code)
|
||||
wxString str(attributeDialogName);
|
||||
str += "1";
|
||||
str += _T("1");
|
||||
m_alternativeAttributeDialog = new wxPanel;
|
||||
success = wxLoadFromResource(m_alternativeAttributeDialog, m_notebook, str);
|
||||
if (success)
|
||||
{
|
||||
m_notebook->AddPage(m_alternativeAttributeDialog, "Attributes (alternative)");
|
||||
m_notebook->AddPage(m_alternativeAttributeDialog, _T("Attributes (alternative)"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -293,9 +296,9 @@ csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxStrin
|
||||
int largeButtonWidth = 70;
|
||||
int largeButtonHeight = 22;
|
||||
|
||||
wxButton* okButton = new wxButton(this, wxID_OK, "OK", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
wxButton* cancelButton = new wxButton(this, wxID_CANCEL, "Cancel", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
wxButton* helpButton = new wxButton(this, wxID_HELP, "Help", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
wxButton* okButton = new wxButton(this, wxID_OK, _T("OK"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
wxButton* cancelButton = new wxButton(this, wxID_CANCEL, _T("Cancel"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
wxButton* helpButton = new wxButton(this, wxID_HELP, _T("Help"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight));
|
||||
|
||||
// Constraints for the notebook
|
||||
wxLayoutConstraints *c = new wxLayoutConstraints;
|
||||
|
@@ -55,18 +55,18 @@ bool csDiagramDocument::OnCloseDocument()
|
||||
|
||||
bool csDiagramDocument::OnSaveDocument(const wxString& file)
|
||||
{
|
||||
if (file == "")
|
||||
if (file == wxEmptyString)
|
||||
return FALSE;
|
||||
|
||||
if (!m_diagram.SaveFile(file))
|
||||
{
|
||||
wxString msgTitle;
|
||||
if (wxTheApp->GetAppName() != "")
|
||||
if (wxTheApp->GetAppName() != wxEmptyString)
|
||||
msgTitle = wxTheApp->GetAppName();
|
||||
else
|
||||
msgTitle = wxString("File error");
|
||||
msgTitle = wxString(_T("File error"));
|
||||
|
||||
(void)wxMessageBox("Sorry, could not open this file for saving.", msgTitle, wxOK | wxICON_EXCLAMATION,
|
||||
(void)wxMessageBox(_T("Sorry, could not open this file for saving."), msgTitle, wxOK | wxICON_EXCLAMATION,
|
||||
GetDocumentWindow());
|
||||
return FALSE;
|
||||
}
|
||||
@@ -82,15 +82,15 @@ bool csDiagramDocument::OnOpenDocument(const wxString& file)
|
||||
return FALSE;
|
||||
|
||||
wxString msgTitle;
|
||||
if (wxTheApp->GetAppName() != "")
|
||||
if (wxTheApp->GetAppName() != wxEmptyString)
|
||||
msgTitle = wxTheApp->GetAppName();
|
||||
else
|
||||
msgTitle = wxString("File error");
|
||||
msgTitle = wxString(_T("File error"));
|
||||
|
||||
m_diagram.DeleteAllShapes();
|
||||
if (!m_diagram.LoadFile(file))
|
||||
{
|
||||
(void)wxMessageBox("Sorry, could not open this file.", msgTitle, wxOK|wxICON_EXCLAMATION,
|
||||
(void)wxMessageBox(_T("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION,
|
||||
GetDocumentWindow());
|
||||
return FALSE;
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ END_EVENT_TABLE()
|
||||
// Define my frame constructor
|
||||
csFrame::csFrame(wxDocManager* manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size,
|
||||
long style):
|
||||
wxDocMDIParentFrame(manager, parent, id, title, pos, size, style, "frame")
|
||||
wxDocMDIParentFrame(manager, parent, id, title, pos, size, style, _T("frame"))
|
||||
{
|
||||
CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL);
|
||||
wxGetApp().InitToolBar(GetToolBar());
|
||||
@@ -71,26 +71,26 @@ csFrame::csFrame(wxDocManager* manager, wxFrame *parent, wxWindowID id, const wx
|
||||
SetAcceleratorTable(accel);
|
||||
}
|
||||
|
||||
void csFrame::OnHelp(wxCommandEvent& event)
|
||||
void csFrame::OnHelp(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxGetApp().GetHelpController().DisplayContents();
|
||||
}
|
||||
|
||||
void csFrame::OnSettings(wxCommandEvent& event)
|
||||
void csFrame::OnSettings(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
csSettingsDialog* dialog = new csSettingsDialog(this);
|
||||
int ret = dialog->ShowModal();
|
||||
/* int ret = */ dialog->ShowModal();
|
||||
dialog->Destroy();
|
||||
}
|
||||
|
||||
void csFrame::OnQuit(wxCommandEvent& event)
|
||||
void csFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
Close(TRUE);
|
||||
}
|
||||
|
||||
void csFrame::OnAbout(wxCommandEvent& event)
|
||||
void csFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
(void)wxMessageBox("OGL Studio\n(c) 1999, Julian Smart", "About OGL Studio", wxICON_INFORMATION);
|
||||
(void)wxMessageBox(_T("OGL Studio\n(c) 1999, Julian Smart"), _T("About OGL Studio"), wxICON_INFORMATION);
|
||||
}
|
||||
|
||||
void csFrame::OnSashDragPaletteWindow(wxSashEvent& event)
|
||||
@@ -141,7 +141,7 @@ void csFrame::OnCloseWindow(wxCloseEvent& event)
|
||||
wxDocMDIParentFrame::OnCloseWindow(event);
|
||||
}
|
||||
|
||||
void csFrame::OnSize(wxSizeEvent& event)
|
||||
void csFrame::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||
{
|
||||
wxLayoutAlgorithm layout;
|
||||
layout.LayoutMDIFrame(this);
|
||||
|
@@ -37,8 +37,8 @@ csProjectTreeCtrl::csProjectTreeCtrl(wxWindow *parent, wxWindowID id, const wxPo
|
||||
wxTreeCtrl(parent, id, pos, size, style),
|
||||
m_imageList(16, 16)
|
||||
{
|
||||
m_imageList.Add(wxIcon("folder1"));
|
||||
m_imageList.Add(wxIcon("file1"));
|
||||
m_imageList.Add(wxIcon(_T("folder1")));
|
||||
m_imageList.Add(wxIcon(_T("file1")));
|
||||
|
||||
SetImageList(& m_imageList);
|
||||
}
|
||||
@@ -49,7 +49,7 @@ csProjectTreeCtrl::~csProjectTreeCtrl()
|
||||
}
|
||||
|
||||
// Create the project window
|
||||
bool csApp::CreateProjectWindow(wxFrame *parent)
|
||||
bool csApp::CreateProjectWindow(wxFrame *WXUNUSED(parent))
|
||||
{
|
||||
#if 0
|
||||
// Create a layout window
|
||||
|
@@ -84,7 +84,7 @@ void csEvtHandler::CopyData(wxShapeEvtHandler& copy)
|
||||
csCopy.m_label = m_label;
|
||||
}
|
||||
|
||||
void csEvtHandler::OnLeftClick(double x, double y, int keys, int attachment)
|
||||
void csEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, int WXUNUSED(attachment))
|
||||
{
|
||||
wxClientDC dc(GetShape()->GetCanvas());
|
||||
GetShape()->GetCanvas()->PrepareDC(dc);
|
||||
@@ -163,7 +163,7 @@ void csEvtHandler::OnLeftClick(double x, double y, int keys, int attachment)
|
||||
}
|
||||
}
|
||||
|
||||
void csEvtHandler::OnRightClick(double x, double y, int keys, int attachment)
|
||||
void csEvtHandler::OnRightClick(double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment))
|
||||
{
|
||||
// Have to convert back to physical coordinates from logical coordinates.
|
||||
|
||||
@@ -189,7 +189,7 @@ void csEvtHandler::OnRightClick(double x, double y, int keys, int attachment)
|
||||
* Implement connection of two shapes by right-dragging between them.
|
||||
*/
|
||||
|
||||
void csEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment)
|
||||
void csEvtHandler::OnBeginDragRight(double x, double y, int WXUNUSED(keys), int attachment)
|
||||
{
|
||||
wxClientDC dc(GetShape()->GetCanvas());
|
||||
GetShape()->GetCanvas()->PrepareDC(dc);
|
||||
@@ -203,7 +203,7 @@ void csEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment
|
||||
GetShape()->GetCanvas()->CaptureMouse();
|
||||
}
|
||||
|
||||
void csEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int attachment)
|
||||
void csEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys), int attachment)
|
||||
{
|
||||
wxClientDC dc(GetShape()->GetCanvas());
|
||||
GetShape()->GetCanvas()->PrepareDC(dc);
|
||||
@@ -216,7 +216,7 @@ void csEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int atta
|
||||
dc.DrawLine(xp, yp, x, y);
|
||||
}
|
||||
|
||||
void csEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment)
|
||||
void csEvtHandler::OnEndDragRight(double x, double y, int WXUNUSED(keys), int attachment)
|
||||
{
|
||||
GetShape()->GetCanvas()->ReleaseMouse();
|
||||
csCanvas *canvas = (csCanvas *)GetShape()->GetCanvas();
|
||||
@@ -230,7 +230,7 @@ void csEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment)
|
||||
wxLineShape* theShape = new csLineShape;
|
||||
|
||||
theShape->AssignNewIds();
|
||||
theShape->SetEventHandler(new csEvtHandler(theShape, theShape, wxString("")));
|
||||
theShape->SetEventHandler(new csEvtHandler(theShape, theShape, wxEmptyString));
|
||||
theShape->SetPen(wxBLACK_PEN);
|
||||
theShape->SetBrush(wxRED_BRUSH);
|
||||
|
||||
@@ -244,14 +244,14 @@ void csEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment)
|
||||
lineShape->MakeLineControlPoints(2);
|
||||
|
||||
if (haveArrow)
|
||||
lineShape->AddArrow(ARROW_ARROW, ARROW_POSITION_MIDDLE, 10.0, 0.0, "Normal arrowhead");
|
||||
lineShape->AddArrow(ARROW_ARROW, ARROW_POSITION_MIDDLE, 10.0, 0.0, _T("Normal arrowhead"));
|
||||
|
||||
lineShape->SetFrom(GetShape());
|
||||
lineShape->SetTo(otherShape);
|
||||
lineShape->SetAttachments(attachment, new_attachment);
|
||||
|
||||
canvas->GetView()->GetDocument()->GetCommandProcessor()->Submit(
|
||||
new csDiagramCommand("Line", (csDiagramDocument *)canvas->GetView()->GetDocument(),
|
||||
new csDiagramCommand(_T("Line"), (csDiagramDocument *)canvas->GetView()->GetDocument(),
|
||||
new csCommandState(ID_CS_ADD_LINE, lineShape, NULL)));
|
||||
}
|
||||
}
|
||||
@@ -409,7 +409,7 @@ void csEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment)
|
||||
newShape->SetX(xx);
|
||||
newShape->SetY(yy);
|
||||
|
||||
csDiagramCommand* cmd = new csDiagramCommand("Move", (csDiagramDocument*)canvas->GetView()->GetDocument(),
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Move"), (csDiagramDocument*)canvas->GetView()->GetDocument(),
|
||||
new csCommandState(ID_CS_MOVE, newShape, GetShape()));
|
||||
|
||||
// Move line points
|
||||
@@ -557,14 +557,14 @@ void csEvtHandler::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, i
|
||||
}
|
||||
}
|
||||
|
||||
csDiagramCommand* cmd = new csDiagramCommand("Size", (csDiagramDocument*)canvas->GetView()->GetDocument(),
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Size"), (csDiagramDocument*)canvas->GetView()->GetDocument(),
|
||||
new csCommandState(ID_CS_SIZE, newShape, shape));
|
||||
|
||||
canvas->GetView()->GetDocument()->GetCommandProcessor()->Submit(cmd);
|
||||
|
||||
}
|
||||
|
||||
void csEvtHandler::OnEndSize(double x, double y)
|
||||
void csEvtHandler::OnEndSize(double WXUNUSED(x), double WXUNUSED(y))
|
||||
{
|
||||
wxClientDC dc(GetShape()->GetCanvas());
|
||||
GetShape()->GetCanvas()->PrepareDC(dc);
|
||||
@@ -581,7 +581,7 @@ void csEvtHandler::OnChangeAttachment(int attachment, wxLineShape* line, wxList&
|
||||
// Problem. If we refresh after the attachment change, we'll get a flicker.
|
||||
// We really want to do both in a oner.
|
||||
|
||||
csDiagramCommand* cmd = new csDiagramCommand("Change attachment", (csDiagramDocument*)canvas->GetView()->GetDocument());
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Change attachment"), (csDiagramDocument*)canvas->GetView()->GetDocument());
|
||||
|
||||
wxLineShape* newLine = (wxLineShape*) line->CreateNewCopy();
|
||||
if (line->GetTo() == GetShape())
|
||||
@@ -600,7 +600,7 @@ void csEvtHandler::OnChangeAttachment(int attachment, wxLineShape* line, wxList&
|
||||
canvas->GetView()->GetDocument()->GetCommandProcessor()->Submit(cmd);
|
||||
}
|
||||
|
||||
void csEvtHandler::OnLeftDoubleClick(double x, double y, int keys, int attachment)
|
||||
void csEvtHandler::OnLeftDoubleClick(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys), int WXUNUSED(attachment))
|
||||
{
|
||||
EditProperties();
|
||||
}
|
||||
@@ -623,60 +623,60 @@ bool csEvtHandler::EditProperties()
|
||||
if (shape->IsKindOf(CLASSINFO(csThinRectangleShape)))
|
||||
{
|
||||
attributeDialog = new csThinRectangleDialog;
|
||||
attributeDialogName = "thin_rectangle";
|
||||
title = "Thin Rectangle Properties";
|
||||
attributeDialogName = _T("thin_rectangle");
|
||||
title = _T("Thin Rectangle Properties");
|
||||
}
|
||||
else if (shape->IsKindOf(CLASSINFO(csWideRectangleShape)))
|
||||
{
|
||||
attributeDialog = new csWideRectangleDialog;
|
||||
attributeDialogName = "wide_rectangle";
|
||||
title = "Wide Rectangle Properties";
|
||||
attributeDialogName = _T("wide_rectangle");
|
||||
title = _T("Wide Rectangle Properties");
|
||||
}
|
||||
else if (shape->IsKindOf(CLASSINFO(csTriangleShape)))
|
||||
{
|
||||
attributeDialog = new csTriangleDialog;
|
||||
attributeDialogName = "triangle";
|
||||
title = "Triangle Properties";
|
||||
attributeDialogName = _T("triangle");
|
||||
title = _T("Triangle Properties");
|
||||
}
|
||||
else if (shape->IsKindOf(CLASSINFO(csSemiCircleShape)))
|
||||
{
|
||||
attributeDialog = new csSemiCircleDialog;
|
||||
attributeDialogName = "semi_circle";
|
||||
title = "Semicircle Properties";
|
||||
attributeDialogName = _T("semi_circle");
|
||||
title = _T("Semicircle Properties");
|
||||
}
|
||||
else if (shape->IsKindOf(CLASSINFO(csCircleShape)))
|
||||
{
|
||||
attributeDialog = new csCircleDialog;
|
||||
attributeDialogName = "circle";
|
||||
title = "Circle Properties";
|
||||
attributeDialogName = _T("circle");
|
||||
title = _T("Circle Properties");
|
||||
}
|
||||
else if (shape->IsKindOf(CLASSINFO(csCircleShadowShape)))
|
||||
{
|
||||
attributeDialog = new csCircleShadowDialog;
|
||||
attributeDialogName = "circle_shadow";
|
||||
title = "Circle Shadow Properties";
|
||||
attributeDialogName = _T("circle_shadow");
|
||||
title = _T("Circle Shadow Properties");
|
||||
}
|
||||
else if (shape->IsKindOf(CLASSINFO(csTextBoxShape)))
|
||||
{
|
||||
attributeDialog = new csTextBoxDialog;
|
||||
attributeDialogName = "text_box";
|
||||
title = "Text Box Properties";
|
||||
attributeDialogName = _T("text_box");
|
||||
title = _T("Text Box Properties");
|
||||
}
|
||||
else if (shape->IsKindOf(CLASSINFO(csGroupShape)))
|
||||
{
|
||||
attributeDialog = new csGroupDialog;
|
||||
attributeDialogName = "group";
|
||||
title = "Group Properties";
|
||||
attributeDialogName = _T("group");
|
||||
title = _T("Group Properties");
|
||||
}
|
||||
else if (shape->IsKindOf(CLASSINFO(csOctagonShape)))
|
||||
{
|
||||
attributeDialog = new csOctagonDialog;
|
||||
attributeDialogName = "octagon";
|
||||
title = "Octagon Properties";
|
||||
attributeDialogName = _T("octagon");
|
||||
title = _T("Octagon Properties");
|
||||
}
|
||||
else
|
||||
{
|
||||
wxMessageBox("Unrecognised shape.", "Studio", wxICON_EXCLAMATION);
|
||||
wxMessageBox(_T("Unrecognised shape."), _T("Studio"), wxICON_EXCLAMATION);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ bool csEvtHandler::EditProperties()
|
||||
csEvtHandler* handler2 = (csEvtHandler *)newShape->GetEventHandler();
|
||||
handler2->m_label = newLabel;
|
||||
|
||||
view->GetDocument()->GetCommandProcessor()->Submit(new csDiagramCommand("Edit properties", (csDiagramDocument*) view->GetDocument(),
|
||||
view->GetDocument()->GetCommandProcessor()->Submit(new csDiagramCommand(_T("Edit properties"), (csDiagramDocument*) view->GetDocument(),
|
||||
new csCommandState(ID_CS_EDIT_PROPERTIES, newShape, shape)));
|
||||
|
||||
return TRUE;
|
||||
@@ -710,15 +710,15 @@ bool csDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
{
|
||||
wxDiagram::OnShapeSave(db, shape, expr);
|
||||
csEvtHandler *handler = (csEvtHandler *)shape.GetEventHandler();
|
||||
expr.AddAttributeValueString("label", handler->m_label);
|
||||
expr.AddAttributeValueString(_T("label"), handler->m_label);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool csDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
{
|
||||
wxDiagram::OnShapeLoad(db, shape, expr);
|
||||
wxString label("");
|
||||
expr.GetAttributeValue("label", label);
|
||||
wxString label = wxEmptyString;
|
||||
expr.GetAttributeValue(_T("label"), label);
|
||||
csEvtHandler *handler = new csEvtHandler(&shape, &shape, label);
|
||||
shape.SetEventHandler(handler);
|
||||
|
||||
@@ -979,7 +979,7 @@ IMPLEMENT_DYNAMIC_CLASS(csGroupShape, wxRectangleShape)
|
||||
|
||||
csGroupShape::csGroupShape()
|
||||
{
|
||||
SetPen(wxThePenList->FindOrCreatePen("BLACK", 1, wxDOT));
|
||||
SetPen(wxThePenList->FindOrCreatePen(_T("BLACK"), 1, wxDOT));
|
||||
SetBrush(wxTRANSPARENT_BRUSH);
|
||||
|
||||
SetSize(csSTANDARD_SHAPE_WIDTH, csSTANDARD_SHAPE_WIDTH);
|
||||
@@ -1049,7 +1049,7 @@ csLineShape::csLineShape()
|
||||
{
|
||||
}
|
||||
|
||||
bool csLineShape::OnMoveMiddleControlPoint(wxDC& dc, wxLineControlPoint* lpt, const wxRealPoint& pt)
|
||||
bool csLineShape::OnMoveMiddleControlPoint(wxDC& WXUNUSED(dc), wxLineControlPoint* lpt, const wxRealPoint& pt)
|
||||
{
|
||||
csDiagramView* view = ((csCanvas*)GetCanvas())->GetView();
|
||||
|
||||
@@ -1063,7 +1063,7 @@ bool csLineShape::OnMoveMiddleControlPoint(wxDC& dc, wxLineControlPoint* lpt, co
|
||||
lpt->SetX(lpt->m_originalPos.x); lpt->SetY(lpt->m_originalPos.y);
|
||||
lpt->m_point->x = lpt->m_originalPos.x; lpt->m_point->y = lpt->m_originalPos.y;
|
||||
|
||||
view->GetDocument()->GetCommandProcessor()->Submit(new csDiagramCommand("Move line point", (csDiagramDocument*) view->GetDocument(),
|
||||
view->GetDocument()->GetCommandProcessor()->Submit(new csDiagramCommand(_T("Move line point"), (csDiagramDocument*) view->GetDocument(),
|
||||
new csCommandState(ID_CS_MOVE_LINE_POINT, newShape, this)));
|
||||
|
||||
return TRUE;
|
||||
@@ -1160,12 +1160,12 @@ void studioShapeEditProc(wxMenu& menu, wxCommandEvent& event)
|
||||
if (event.GetId() == ID_CS_ROTATE_CLOCKWISE)
|
||||
{
|
||||
theta += ninetyDegrees;
|
||||
opStr = "Rotate clockwise";
|
||||
opStr = _T("Rotate clockwise");
|
||||
}
|
||||
else
|
||||
{
|
||||
theta -= ninetyDegrees;
|
||||
opStr = "Rotate anticlockwise";
|
||||
opStr = _T("Rotate anticlockwise");
|
||||
}
|
||||
|
||||
if (theta >= 2.0*myPi || theta < 0.0)
|
||||
|
@@ -226,7 +226,7 @@ class csEvtHandler: public wxShapeEvtHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(csEvtHandler)
|
||||
public:
|
||||
csEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL, const wxString& lab = "");
|
||||
csEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL, const wxString& lab = wxEmptyString);
|
||||
~csEvtHandler();
|
||||
|
||||
void OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
|
@@ -92,13 +92,13 @@ csApp::~csApp()
|
||||
// Initialise this in OnInit, not statically
|
||||
bool csApp::OnInit(void)
|
||||
{
|
||||
if (!wxResourceParseFile("studio_resources.wxr"))
|
||||
if (!wxResourceParseFile(_T("studio_resources.wxr")))
|
||||
{
|
||||
wxMessageBox("Could not find or parse resource file: studio_resources.wxr", "Studio");
|
||||
wxMessageBox(_T("Could not find or parse resource file: studio_resources.wxr"), _T("Studio"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
m_helpController.Initialize("studio.hlp");
|
||||
m_helpController.Initialize(_T("studio.hlp"));
|
||||
|
||||
ReadOptions();
|
||||
|
||||
@@ -110,7 +110,7 @@ bool csApp::OnInit(void)
|
||||
m_docManager = new wxDocManager;
|
||||
|
||||
//// Create a template relating drawing documents to their views
|
||||
(void) new wxDocTemplate(m_docManager, "Diagram", "*.dia", "", "dia", "Diagram Doc", "Diagram View",
|
||||
(void) new wxDocTemplate(m_docManager, _T("Diagram"), _T("*.dia"), wxEmptyString, _T("dia"), _T("Diagram Doc"), _T("Diagram View"),
|
||||
CLASSINFO(csDiagramDocument), CLASSINFO(csDiagramView));
|
||||
|
||||
// Create the main frame window.
|
||||
@@ -121,7 +121,7 @@ bool csApp::OnInit(void)
|
||||
#define wxDEFAULT_FRAME_STYLE_NO_CLIP \
|
||||
(wxSYSTEM_MENU | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION)
|
||||
|
||||
csFrame* frame = new csFrame(m_docManager, NULL, -1, "OGL Studio", m_mainFramePos, m_mainFrameSize,
|
||||
csFrame* frame = new csFrame(m_docManager, NULL, -1, _T("OGL Studio"), m_mainFramePos, m_mainFrameSize,
|
||||
wxDEFAULT_FRAME_STYLE_NO_CLIP | wxHSCROLL | wxVSCROLL);
|
||||
|
||||
// Give it an icon
|
||||
@@ -130,38 +130,38 @@ bool csApp::OnInit(void)
|
||||
// Make a menubar
|
||||
wxMenu *fileMenu = new wxMenu;
|
||||
|
||||
fileMenu->Append(wxID_NEW, "&New...\tCtrl+N");
|
||||
fileMenu->Append(wxID_OPEN, "&Open...\tCtrl+O");
|
||||
fileMenu->Append(wxID_NEW, _T("&New...\tCtrl+N"));
|
||||
fileMenu->Append(wxID_OPEN, _T("&Open...\tCtrl+O"));
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
|
||||
fileMenu->Append(wxID_PRINT, "&Print...\tCtrl+P");
|
||||
fileMenu->Append(wxID_PRINT_SETUP, "Print &Setup...");
|
||||
fileMenu->Append(wxID_PREVIEW, "Print Pre&view");
|
||||
fileMenu->Append(wxID_PRINT, _T("&Print...\tCtrl+P"));
|
||||
fileMenu->Append(wxID_PRINT_SETUP, _T("Print &Setup..."));
|
||||
fileMenu->Append(wxID_PREVIEW, _T("Print Pre&view"));
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->Append(wxID_EXIT, "E&xit");
|
||||
fileMenu->Append(wxID_EXIT, _T("E&xit"));
|
||||
|
||||
// A history of files visited. Use this menu.
|
||||
m_docManager->FileHistoryUseMenu(fileMenu);
|
||||
|
||||
wxMenu *viewMenu = new wxMenu;
|
||||
viewMenu->Append(ID_CS_SETTINGS, "&Settings...");
|
||||
viewMenu->Append(ID_CS_SETTINGS, _T("&Settings..."));
|
||||
|
||||
wxMenu *helpMenu = new wxMenu;
|
||||
helpMenu->Append(wxID_HELP, "&Help Contents\tF1");
|
||||
helpMenu->Append(ID_CS_ABOUT, "&About");
|
||||
helpMenu->Append(wxID_HELP, _T("&Help Contents\tF1"));
|
||||
helpMenu->Append(ID_CS_ABOUT, _T("&About"));
|
||||
|
||||
wxMenuBar *menuBar = new wxMenuBar;
|
||||
|
||||
menuBar->Append(fileMenu, "&File");
|
||||
menuBar->Append(viewMenu, "&View");
|
||||
menuBar->Append(helpMenu, "&Help");
|
||||
menuBar->Append(fileMenu, _T("&File"));
|
||||
menuBar->Append(viewMenu, _T("&View"));
|
||||
menuBar->Append(helpMenu, _T("&Help"));
|
||||
|
||||
// Associate the menu bar with the frame
|
||||
frame->SetMenuBar(menuBar);
|
||||
|
||||
// Load the file history
|
||||
wxConfig config("OGL Studio", "wxWindows");
|
||||
wxConfig config(_T("OGL Studio"), _T("wxWindows"));
|
||||
m_docManager->FileHistoryLoad(config);
|
||||
|
||||
frame->CreateStatusBar();
|
||||
@@ -177,12 +177,12 @@ bool csApp::OnInit(void)
|
||||
|
||||
// Create the shape editing menu
|
||||
m_shapeEditMenu = new ShapeEditMenu;
|
||||
m_shapeEditMenu->Append(ID_CS_EDIT_PROPERTIES, "Edit properties");
|
||||
m_shapeEditMenu->Append(ID_CS_EDIT_PROPERTIES, _T("Edit properties"));
|
||||
m_shapeEditMenu->AppendSeparator();
|
||||
m_shapeEditMenu->Append(ID_CS_ROTATE_CLOCKWISE, "Rotate clockwise");
|
||||
m_shapeEditMenu->Append(ID_CS_ROTATE_ANTICLOCKWISE, "Rotate anticlockwise");
|
||||
m_shapeEditMenu->Append(ID_CS_ROTATE_CLOCKWISE, _T("Rotate clockwise"));
|
||||
m_shapeEditMenu->Append(ID_CS_ROTATE_ANTICLOCKWISE, _T("Rotate anticlockwise"));
|
||||
m_shapeEditMenu->AppendSeparator();
|
||||
m_shapeEditMenu->Append(ID_CS_CUT, "Cut");
|
||||
m_shapeEditMenu->Append(ID_CS_CUT, _T("Cut"));
|
||||
|
||||
frame->Show(TRUE);
|
||||
|
||||
@@ -217,48 +217,48 @@ int csApp::OnExit(void)
|
||||
wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu** editMenuRet)
|
||||
{
|
||||
//// Make a child frame
|
||||
csMDIChildFrame *subframe = new csMDIChildFrame(doc, view, ((wxDocMDIParentFrame*)GetTopWindow()), -1, "Child Frame",
|
||||
csMDIChildFrame *subframe = new csMDIChildFrame(doc, view, ((wxDocMDIParentFrame*)GetTopWindow()), -1, _T("Child Frame"),
|
||||
wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
subframe->SetIcon(wxString("chart"));
|
||||
subframe->SetIcon(wxString(_T("chart")));
|
||||
#endif
|
||||
#ifdef __X__
|
||||
subframe->SetIcon(wxIcon("doc.xbm"));
|
||||
subframe->SetIcon(wxIcon(_T("doc.xbm")));
|
||||
#endif
|
||||
|
||||
//// Make a menubar
|
||||
wxMenu *fileMenu = new wxMenu;
|
||||
|
||||
fileMenu->Append(wxID_NEW, "&New...\tCtrl+N");
|
||||
fileMenu->Append(wxID_OPEN, "&Open...\tCtrl+O");
|
||||
fileMenu->Append(wxID_CLOSE, "&Close\tCtrl+W");
|
||||
fileMenu->Append(wxID_SAVE, "&Save\tCtrl+S");
|
||||
fileMenu->Append(wxID_SAVEAS, "Save &As...\tF12");
|
||||
fileMenu->Append(wxID_NEW, _T("&New...\tCtrl+N"));
|
||||
fileMenu->Append(wxID_OPEN, _T("&Open...\tCtrl+O"));
|
||||
fileMenu->Append(wxID_CLOSE, _T("&Close\tCtrl+W"));
|
||||
fileMenu->Append(wxID_SAVE, _T("&Save\tCtrl+S"));
|
||||
fileMenu->Append(wxID_SAVEAS, _T("Save &As...\tF12"));
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->Append(wxID_PRINT, "&Print...\tCtrl+P");
|
||||
fileMenu->Append(wxID_PRINT_SETUP, "Print &Setup...");
|
||||
fileMenu->Append(wxID_PREVIEW, "Print Pre&view");
|
||||
fileMenu->Append(wxID_PRINT, _T("&Print...\tCtrl+P"));
|
||||
fileMenu->Append(wxID_PRINT_SETUP, _T("Print &Setup..."));
|
||||
fileMenu->Append(wxID_PREVIEW, _T("Print Pre&view"));
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->Append(wxID_EXIT, "E&xit");
|
||||
fileMenu->Append(wxID_EXIT, _T("E&xit"));
|
||||
|
||||
wxMenu *editMenu = NULL;
|
||||
|
||||
editMenu = new wxMenu;
|
||||
editMenu->Append(wxID_UNDO, "&Undo\tCtrl+Z");
|
||||
editMenu->Append(wxID_REDO, "&Redo\tCtrl+Y");
|
||||
editMenu->Append(wxID_UNDO, _T("&Undo\tCtrl+Z"));
|
||||
editMenu->Append(wxID_REDO, _T("&Redo\tCtrl+Y"));
|
||||
editMenu->AppendSeparator();
|
||||
editMenu->Append(wxID_CUT, "Cu&t\tCtrl+X");
|
||||
editMenu->Append(wxID_COPY, "&Copy\tCtrl+C");
|
||||
editMenu->Append(wxID_PASTE, "&Paste\tCtrl+V");
|
||||
editMenu->Append(wxID_DUPLICATE, "&Duplicate\tCtrl+D");
|
||||
editMenu->Append(wxID_CUT, _T("Cu&t\tCtrl+X"));
|
||||
editMenu->Append(wxID_COPY, _T("&Copy\tCtrl+C"));
|
||||
editMenu->Append(wxID_PASTE, _T("&Paste\tCtrl+V"));
|
||||
editMenu->Append(wxID_DUPLICATE, _T("&Duplicate\tCtrl+D"));
|
||||
editMenu->AppendSeparator();
|
||||
editMenu->Append(wxID_CLEAR, "Cle&ar\tDelete");
|
||||
editMenu->Append(ID_CS_SELECT_ALL, "Select A&ll\tCtrl+A");
|
||||
editMenu->Append(wxID_CLEAR, _T("Cle&ar\tDelete"));
|
||||
editMenu->Append(ID_CS_SELECT_ALL, _T("Select A&ll\tCtrl+A"));
|
||||
editMenu->AppendSeparator();
|
||||
editMenu->Append(ID_CS_EDIT_PROPERTIES, "Edit P&roperties...");
|
||||
editMenu->Append(ID_CS_EDIT_PROPERTIES, _T("Edit P&roperties..."));
|
||||
|
||||
*editMenuRet = editMenu;
|
||||
|
||||
@@ -268,18 +268,18 @@ wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu**
|
||||
doc->GetCommandProcessor()->SetEditMenu(editMenu);
|
||||
|
||||
wxMenu *viewMenu = new wxMenu;
|
||||
viewMenu->Append(ID_CS_SETTINGS, "&Settings...");
|
||||
viewMenu->Append(ID_CS_SETTINGS, _T("&Settings..."));
|
||||
|
||||
wxMenu *helpMenu = new wxMenu;
|
||||
helpMenu->Append(wxID_HELP, "&Help Contents\tF1");
|
||||
helpMenu->Append(ID_CS_ABOUT, "&About");
|
||||
helpMenu->Append(wxID_HELP, _T("&Help Contents\tF1"));
|
||||
helpMenu->Append(ID_CS_ABOUT, _T("&About"));
|
||||
|
||||
wxMenuBar *menuBar = new wxMenuBar;
|
||||
|
||||
menuBar->Append(fileMenu, "&File");
|
||||
menuBar->Append(editMenu, "&Edit");
|
||||
menuBar->Append(viewMenu, "&View");
|
||||
menuBar->Append(helpMenu, "&Help");
|
||||
menuBar->Append(fileMenu, _T("&File"));
|
||||
menuBar->Append(editMenu, _T("&Edit"));
|
||||
menuBar->Append(viewMenu, _T("&View"));
|
||||
menuBar->Append(helpMenu, _T("&Help"));
|
||||
|
||||
//// Associate the menu bar with the frame
|
||||
subframe->SetMenuBar(menuBar);
|
||||
@@ -296,7 +296,7 @@ csCanvas *csApp::CreateCanvas(wxView *view, wxFrame *parent)
|
||||
// Non-retained canvas
|
||||
csCanvas *canvas = new csCanvas((csDiagramView*) view, parent, 1000, wxPoint(0, 0), wxSize(width, height), wxSUNKEN_BORDER);
|
||||
|
||||
wxColour bgColour("WHITE");
|
||||
wxColour bgColour(_T("WHITE"));
|
||||
canvas->SetBackgroundColour(bgColour);
|
||||
|
||||
wxCursor cursor(wxCURSOR_HAND);
|
||||
@@ -313,16 +313,16 @@ void csApp::InitToolBar(wxToolBar* toolBar)
|
||||
wxBitmap* bitmaps[10];
|
||||
|
||||
#ifdef __WXMSW__
|
||||
bitmaps[0] = new wxBitmap("new", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[1] = new wxBitmap("open", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[2] = new wxBitmap("save", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[3] = new wxBitmap("copy", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[4] = new wxBitmap("cut", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[5] = new wxBitmap("paste", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[6] = new wxBitmap("print", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[7] = new wxBitmap("help", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[8] = new wxBitmap("undo", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[9] = new wxBitmap("redo", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[0] = new wxBitmap(_T("new"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[1] = new wxBitmap(_T("open"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[2] = new wxBitmap(_T("save"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[3] = new wxBitmap(_T("copy"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[4] = new wxBitmap(_T("cut"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[5] = new wxBitmap(_T("paste"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[6] = new wxBitmap(_T("print"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[7] = new wxBitmap(_T("help"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[8] = new wxBitmap(_T("undo"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[9] = new wxBitmap(_T("redo"), wxBITMAP_TYPE_RESOURCE);
|
||||
#elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__)
|
||||
bitmaps[0] = new wxBitmap( new_xpm );
|
||||
bitmaps[1] = new wxBitmap( open_xpm );
|
||||
@@ -338,20 +338,20 @@ void csApp::InitToolBar(wxToolBar* toolBar)
|
||||
#error "Not implemented for this platform."
|
||||
#endif
|
||||
|
||||
toolBar->AddTool(wxID_NEW, *bitmaps[0], wxNullBitmap, FALSE, -1, -1, NULL, "New file");
|
||||
toolBar->AddTool(wxID_OPEN, *bitmaps[1], wxNullBitmap, FALSE, -1, -1, NULL, "Open file");
|
||||
toolBar->AddTool(wxID_SAVE, *bitmaps[2], wxNullBitmap, FALSE, -1, -1, NULL, "Save file");
|
||||
toolBar->AddTool(wxID_NEW, *bitmaps[0], wxNullBitmap, FALSE, -1, -1, NULL, _T("New file"));
|
||||
toolBar->AddTool(wxID_OPEN, *bitmaps[1], wxNullBitmap, FALSE, -1, -1, NULL, _T("Open file"));
|
||||
toolBar->AddTool(wxID_SAVE, *bitmaps[2], wxNullBitmap, FALSE, -1, -1, NULL, _T("Save file"));
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(wxID_PRINT, *bitmaps[6], wxNullBitmap, FALSE, -1, -1, NULL, "Print");
|
||||
toolBar->AddTool(wxID_PRINT, *bitmaps[6], wxNullBitmap, FALSE, -1, -1, NULL, _T("Print"));
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(wxID_COPY, *bitmaps[3], wxNullBitmap, FALSE, -1, -1, NULL, "Copy");
|
||||
toolBar->AddTool(wxID_CUT, *bitmaps[4], wxNullBitmap, FALSE, -1, -1, NULL, "Cut");
|
||||
toolBar->AddTool(wxID_PASTE, *bitmaps[5], wxNullBitmap, FALSE, -1, -1, NULL, "Paste");
|
||||
toolBar->AddTool(wxID_COPY, *bitmaps[3], wxNullBitmap, FALSE, -1, -1, NULL, _T("Copy"));
|
||||
toolBar->AddTool(wxID_CUT, *bitmaps[4], wxNullBitmap, FALSE, -1, -1, NULL, _T("Cut"));
|
||||
toolBar->AddTool(wxID_PASTE, *bitmaps[5], wxNullBitmap, FALSE, -1, -1, NULL, _T("Paste"));
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(wxID_UNDO, *bitmaps[8], wxNullBitmap, FALSE, -1, -1, NULL, "Undo");
|
||||
toolBar->AddTool(wxID_REDO, *bitmaps[9], wxNullBitmap, FALSE, -1, -1, NULL, "Redo");
|
||||
toolBar->AddTool(wxID_UNDO, *bitmaps[8], wxNullBitmap, FALSE, -1, -1, NULL, _T("Undo"));
|
||||
toolBar->AddTool(wxID_REDO, *bitmaps[9], wxNullBitmap, FALSE, -1, -1, NULL, _T("Redo"));
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(wxID_HELP, *bitmaps[7], wxNullBitmap, FALSE, -1, -1, NULL, "Help");
|
||||
toolBar->AddTool(wxID_HELP, *bitmaps[7], wxNullBitmap, FALSE, -1, -1, NULL, _T("Help"));
|
||||
|
||||
toolBar->Realize();
|
||||
|
||||
@@ -385,17 +385,17 @@ void csApp::CreateDiagramToolBar(wxFrame* parent)
|
||||
wxBitmap* bitmaps[11];
|
||||
|
||||
#ifdef __WXMSW__
|
||||
bitmaps[0] = new wxBitmap("alignl", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[1] = new wxBitmap("alignr", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[2] = new wxBitmap("alignt", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[3] = new wxBitmap("alignb", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[4] = new wxBitmap("horiz", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[5] = new wxBitmap("vert", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[6] = new wxBitmap("copysize", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[7] = new wxBitmap("linearrow", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[8] = new wxBitmap("newpoint", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[9] = new wxBitmap("cutpoint", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[10] = new wxBitmap("straighten", wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[0] = new wxBitmap(_T("alignl"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[1] = new wxBitmap(_T("alignr"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[2] = new wxBitmap(_T("alignt"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[3] = new wxBitmap(_T("alignb"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[4] = new wxBitmap(_T("horiz"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[5] = new wxBitmap(_T("vert"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[6] = new wxBitmap(_T("copysize"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[7] = new wxBitmap(_T("linearrow"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[8] = new wxBitmap(_T("newpoint"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[9] = new wxBitmap(_T("cutpoint"), wxBITMAP_TYPE_RESOURCE);
|
||||
bitmaps[10] = new wxBitmap(_T("straighten"), wxBITMAP_TYPE_RESOURCE);
|
||||
#elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__)
|
||||
bitmaps[0] = new wxBitmap( alignl_xpm );
|
||||
bitmaps[1] = new wxBitmap( alignr_xpm );
|
||||
@@ -412,18 +412,18 @@ void csApp::CreateDiagramToolBar(wxFrame* parent)
|
||||
#error "Not implemented for this platform."
|
||||
#endif
|
||||
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNL, *bitmaps[0], wxNullBitmap, FALSE, -1, -1, NULL, "Align left");
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNR, *bitmaps[1], wxNullBitmap, FALSE, -1, -1, NULL, "Align right");
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNT, *bitmaps[2], wxNullBitmap, FALSE, -1, -1, NULL, "Align top");
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNB, *bitmaps[3], wxNullBitmap, FALSE, -1, -1, NULL, "Align bottom");
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_HORIZ, *bitmaps[4], wxNullBitmap, FALSE, -1, -1, NULL, "Align horizontally");
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_VERT, *bitmaps[5], wxNullBitmap, FALSE, -1, -1, NULL, "Align vertically");
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_COPY_SIZE, *bitmaps[6], wxNullBitmap, FALSE, -1, -1, NULL, "Copy size");
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNL, *bitmaps[0], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align left"));
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNR, *bitmaps[1], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align right"));
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNT, *bitmaps[2], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align top"));
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNB, *bitmaps[3], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align bottom"));
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_HORIZ, *bitmaps[4], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align horizontally"));
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_VERT, *bitmaps[5], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align vertically"));
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_COPY_SIZE, *bitmaps[6], wxNullBitmap, FALSE, -1, -1, NULL, _T("Copy size"));
|
||||
m_diagramToolBar->AddSeparator();
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_LINE_ARROW, *bitmaps[7], wxNullBitmap, TRUE, -1, -1, NULL, "Toggle arrow");
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_NEW_POINT, *bitmaps[8], wxNullBitmap, FALSE, -1, -1, NULL, "New line point");
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_CUT_POINT, *bitmaps[9], wxNullBitmap, FALSE, -1, -1, NULL, "Cut line point");
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_STRAIGHTEN, *bitmaps[10], wxNullBitmap, FALSE, -1, -1, NULL, "Straighten lines");
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_LINE_ARROW, *bitmaps[7], wxNullBitmap, TRUE, -1, -1, NULL, _T("Toggle arrow"));
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_NEW_POINT, *bitmaps[8], wxNullBitmap, FALSE, -1, -1, NULL, _T("New line point"));
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_CUT_POINT, *bitmaps[9], wxNullBitmap, FALSE, -1, -1, NULL, _T("Cut line point"));
|
||||
m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_STRAIGHTEN, *bitmaps[10], wxNullBitmap, FALSE, -1, -1, NULL, _T("Straighten lines"));
|
||||
|
||||
m_diagramToolBar->Realize();
|
||||
|
||||
@@ -436,7 +436,7 @@ void csApp::CreateDiagramToolBar(wxFrame* parent)
|
||||
wxString *pointSizes = new wxString[maxPointSize];
|
||||
for (i = 1; i <= maxPointSize; i++)
|
||||
{
|
||||
pointSizes[i-1].Printf("%d", i);
|
||||
pointSizes[i-1].Printf(_T("%d"), i);
|
||||
}
|
||||
|
||||
int controlX = 260;
|
||||
@@ -453,7 +453,7 @@ void csApp::CreateDiagramToolBar(wxFrame* parent)
|
||||
#endif
|
||||
|
||||
m_pointSizeComboBox = new wxComboBox(m_diagramToolBar, ID_WINDOW_POINT_SIZE_COMBOBOX,
|
||||
"", wxPoint(controlX, 1), wxSize(pointSizeW, pointSizeH), maxPointSize, pointSizes);
|
||||
wxEmptyString, wxPoint(controlX, 1), wxSize(pointSizeW, pointSizeH), maxPointSize, pointSizes);
|
||||
delete[] pointSizes;
|
||||
|
||||
#ifdef __WXGTK__
|
||||
@@ -470,13 +470,13 @@ void csApp::CreateDiagramToolBar(wxFrame* parent)
|
||||
wxString *zoomStrings = new wxString[noStrings];
|
||||
for (i = 0; i < noStrings; i ++)
|
||||
{
|
||||
zoomStrings[noStrings - i - 1].Printf("%d%%", (i*increment + minZoom));
|
||||
zoomStrings[noStrings - i - 1].Printf(_T("%d%%"), (i*increment + minZoom));
|
||||
}
|
||||
|
||||
controlX += pointSizeW + 10;
|
||||
|
||||
m_zoomComboBox = new wxComboBox(m_diagramToolBar, ID_WINDOW_ZOOM_COMBOBOX,
|
||||
"", wxPoint(controlX, 1), wxSize(zoomW, zoomH), noStrings, zoomStrings);
|
||||
wxEmptyString, wxPoint(controlX, 1), wxSize(zoomW, zoomH), noStrings, zoomStrings);
|
||||
delete[] zoomStrings;
|
||||
|
||||
#ifdef __WXGTK__
|
||||
@@ -493,28 +493,28 @@ void csApp::CreateDiagramToolBar(wxFrame* parent)
|
||||
// Read/write configuration information
|
||||
bool csApp::ReadOptions()
|
||||
{
|
||||
wxConfig config("OGL Studio", "wxWindows");
|
||||
wxConfig config(_T("OGL Studio"), _T("wxWindows"));
|
||||
|
||||
config.Read("mainX", & m_mainFramePos.x);
|
||||
config.Read("mainY", & m_mainFramePos.y);
|
||||
config.Read("mainWidth", & m_mainFrameSize.x);
|
||||
config.Read("mainHeight", & m_mainFrameSize.y);
|
||||
config.Read("gridStyle", & m_gridStyle);
|
||||
config.Read("gridSpacing", & m_gridSpacing);
|
||||
config.Read(_T("mainX"), & m_mainFramePos.x);
|
||||
config.Read(_T("mainY"), & m_mainFramePos.y);
|
||||
config.Read(_T("mainWidth"), & m_mainFrameSize.x);
|
||||
config.Read(_T("mainHeight"), & m_mainFrameSize.y);
|
||||
config.Read(_T("gridStyle"), & m_gridStyle);
|
||||
config.Read(_T("gridSpacing"), & m_gridSpacing);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool csApp::WriteOptions()
|
||||
{
|
||||
wxConfig config("OGL Studio", "wxWindows");
|
||||
wxConfig config(_T("OGL Studio"), _T("wxWindows"));
|
||||
|
||||
config.Write("mainX", (long) m_mainFramePos.x);
|
||||
config.Write("mainY", (long) m_mainFramePos.y);
|
||||
config.Write("mainWidth", (long) m_mainFrameSize.x);
|
||||
config.Write("mainHeight", (long) m_mainFrameSize.y);
|
||||
config.Write("gridStyle", (long) m_gridStyle);
|
||||
config.Write("gridSpacing", (long) m_gridSpacing);
|
||||
config.Write(_T("mainX"), (long) m_mainFramePos.x);
|
||||
config.Write(_T("mainY"), (long) m_mainFramePos.y);
|
||||
config.Write(_T("mainWidth"), (long) m_mainFrameSize.x);
|
||||
config.Write(_T("mainHeight"), (long) m_mainFrameSize.y);
|
||||
config.Write(_T("gridStyle"), (long) m_gridStyle);
|
||||
config.Write(_T("gridSpacing"), (long) m_gridSpacing);
|
||||
|
||||
m_docManager->FileHistorySave(config);
|
||||
|
||||
|
@@ -120,51 +120,51 @@ void csApp::InitSymbols()
|
||||
|
||||
wxShape* shape = new csCircleShape();
|
||||
shape->AssignNewIds();
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxString("")));
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString));
|
||||
|
||||
m_symbolDatabase->AddSymbol(new csSymbol("Circle", shape));
|
||||
m_symbolDatabase->AddSymbol(new csSymbol(_T("Circle"), shape));
|
||||
|
||||
shape = new csCircleShadowShape();
|
||||
shape->AssignNewIds();
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxString("")));
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString));
|
||||
|
||||
m_symbolDatabase->AddSymbol(new csSymbol("Circle shadow", shape));
|
||||
m_symbolDatabase->AddSymbol(new csSymbol(_T("Circle shadow"), shape));
|
||||
|
||||
shape = new csThinRectangleShape();
|
||||
shape->AssignNewIds();
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxString("")));
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString));
|
||||
|
||||
m_symbolDatabase->AddSymbol(new csSymbol("Thin Rectangle", shape));
|
||||
m_symbolDatabase->AddSymbol(new csSymbol(_T("Thin Rectangle"), shape));
|
||||
|
||||
shape = new csWideRectangleShape();
|
||||
shape->AssignNewIds();
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxString("")));
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString));
|
||||
|
||||
m_symbolDatabase->AddSymbol(new csSymbol("Wide Rectangle", shape));
|
||||
m_symbolDatabase->AddSymbol(new csSymbol(_T("Wide Rectangle"), shape));
|
||||
|
||||
shape = new csSemiCircleShape();
|
||||
shape->AssignNewIds();
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxString("")));
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString));
|
||||
|
||||
m_symbolDatabase->AddSymbol(new csSymbol("SemiCircle", shape));
|
||||
m_symbolDatabase->AddSymbol(new csSymbol(_T("SemiCircle"), shape));
|
||||
|
||||
shape = new csTriangleShape();
|
||||
shape->AssignNewIds();
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxString("")));
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString));
|
||||
|
||||
m_symbolDatabase->AddSymbol(new csSymbol("Triangle", shape));
|
||||
m_symbolDatabase->AddSymbol(new csSymbol(_T("Triangle"), shape));
|
||||
|
||||
shape = new csOctagonShape();
|
||||
shape->AssignNewIds();
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxString("")));
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString));
|
||||
|
||||
m_symbolDatabase->AddSymbol(new csSymbol("Octagon", shape));
|
||||
m_symbolDatabase->AddSymbol(new csSymbol(_T("Octagon"), shape));
|
||||
|
||||
shape = new csGroupShape();
|
||||
shape->AssignNewIds();
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxString("")));
|
||||
shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString));
|
||||
|
||||
m_symbolDatabase->AddSymbol(new csSymbol("Group", shape));
|
||||
m_symbolDatabase->AddSymbol(new csSymbol(_T("Group"), shape));
|
||||
}
|
||||
|
||||
wxBitmap* csSymbolDatabase::CreateToolBitmap(csSymbol* symbol, const wxSize& toolSize)
|
||||
|
@@ -87,7 +87,7 @@ END_EVENT_TABLE()
|
||||
|
||||
// What to do when a view is created. Creates actual
|
||||
// windows for displaying the view.
|
||||
bool csDiagramView::OnCreate(wxDocument *doc, long flags)
|
||||
bool csDiagramView::OnCreate(wxDocument *doc, long WXUNUSED(flags))
|
||||
{
|
||||
wxMenu* editMenu;
|
||||
frame = wxGetApp().CreateChildFrame(doc, this, &editMenu);
|
||||
@@ -141,11 +141,11 @@ csDiagramView::~csDiagramView(void)
|
||||
|
||||
// Sneakily gets used for default print/preview
|
||||
// as well as drawing on the screen.
|
||||
void csDiagramView::OnDraw(wxDC *dc)
|
||||
void csDiagramView::OnDraw(wxDC *WXUNUSED(dc))
|
||||
{
|
||||
}
|
||||
|
||||
void csDiagramView::OnUpdate(wxView *sender, wxObject *hint)
|
||||
void csDiagramView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint))
|
||||
{
|
||||
if (canvas)
|
||||
canvas->Refresh();
|
||||
@@ -190,7 +190,7 @@ void csDiagramView::SelectShape(wxShape* shape, bool select)
|
||||
m_selections.DeleteObject(shape);
|
||||
}
|
||||
|
||||
void csDiagramView::OnSelectAll(wxCommandEvent& event)
|
||||
void csDiagramView::OnSelectAll(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
SelectAll(TRUE);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ void csDiagramView::OnRedoUpdate(wxUpdateUIEvent& event)
|
||||
event.Enable(doc->GetCommandProcessor()->CanRedo());
|
||||
}
|
||||
|
||||
void csDiagramView::OnCut(wxCommandEvent& event)
|
||||
void csDiagramView::OnCut(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
|
||||
@@ -253,7 +253,7 @@ void csDiagramView::OnCut(wxCommandEvent& event)
|
||||
DoCut(selections);
|
||||
}
|
||||
|
||||
void csDiagramView::OnClear(wxCommandEvent& event)
|
||||
void csDiagramView::OnClear(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxList selections;
|
||||
FindSelectedShapes(selections);
|
||||
@@ -261,7 +261,7 @@ void csDiagramView::OnClear(wxCommandEvent& event)
|
||||
DoCut(selections);
|
||||
}
|
||||
|
||||
void csDiagramView::OnCopy(wxCommandEvent& event)
|
||||
void csDiagramView::OnCopy(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
|
||||
@@ -275,14 +275,14 @@ void csDiagramView::OnCopy(wxCommandEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
void csDiagramView::OnPaste(wxCommandEvent& event)
|
||||
void csDiagramView::OnPaste(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
|
||||
wxGetApp().GetDiagramClipboard().Paste(doc->GetDiagram());
|
||||
}
|
||||
|
||||
void csDiagramView::OnDuplicate(wxCommandEvent& event)
|
||||
void csDiagramView::OnDuplicate(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
|
||||
@@ -311,7 +311,7 @@ void csDiagramView::OnCopyUpdate(wxUpdateUIEvent& event)
|
||||
|
||||
void csDiagramView::OnPasteUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
/* csDiagramDocument *doc = */ (csDiagramDocument *)GetDocument();
|
||||
|
||||
int n = wxGetApp().GetDiagramClipboard().GetCount();
|
||||
|
||||
@@ -329,7 +329,7 @@ void csDiagramView::DoCut(wxList& shapes)
|
||||
|
||||
if (shapes.Number() > 0)
|
||||
{
|
||||
csDiagramCommand* cmd = new csDiagramCommand("Cut", doc);
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Cut"), doc);
|
||||
|
||||
wxNode* node = shapes.First();
|
||||
while (node)
|
||||
@@ -379,7 +379,7 @@ void csDiagramView::DoCmd(wxList& shapes, wxList& oldShapes, int cmd, const wxSt
|
||||
}
|
||||
}
|
||||
|
||||
void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& event)
|
||||
void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
|
||||
@@ -408,7 +408,7 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& event)
|
||||
if (!theBrush)
|
||||
return;
|
||||
|
||||
csDiagramCommand* cmd = new csDiagramCommand("Change colour", doc);
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Change colour"), doc);
|
||||
|
||||
wxNode* node = selections.First();
|
||||
while (node)
|
||||
@@ -426,7 +426,7 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
void csDiagramView::OnEditProperties(wxCommandEvent& event)
|
||||
void csDiagramView::OnEditProperties(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxShape *theShape = FindFirstSelectedShape();
|
||||
if (theShape)
|
||||
@@ -459,7 +459,8 @@ void csDiagramView::OnPointSizeComboText(wxCommandEvent& event)
|
||||
wxASSERT( combo != NULL );
|
||||
|
||||
wxString str(combo->GetValue());
|
||||
int newPointSize = atoi((const char*) str);
|
||||
long newPointSize;
|
||||
str.ToLong( &newPointSize );
|
||||
|
||||
if (newPointSize < 2)
|
||||
return;
|
||||
@@ -476,7 +477,7 @@ void csDiagramView::ApplyPointSize(int pointSize)
|
||||
|
||||
if (selections.Number() > 0)
|
||||
{
|
||||
csDiagramCommand* cmd = new csDiagramCommand("Point size", doc);
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Point size"), doc);
|
||||
|
||||
wxNode* node = selections.First();
|
||||
while (node)
|
||||
@@ -560,16 +561,16 @@ void csDiagramView::SelectAll(bool select)
|
||||
}
|
||||
|
||||
|
||||
void csDiagramView::OnToggleArrowTool(wxCommandEvent& event)
|
||||
void csDiagramView::OnToggleArrowTool(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
|
||||
bool state = wxGetApp().GetDiagramToolBar()->GetToolState(DIAGRAM_TOOLBAR_LINE_ARROW);
|
||||
wxString stateName;
|
||||
if (state)
|
||||
stateName = "Arrow on";
|
||||
stateName = _T("Arrow on");
|
||||
else
|
||||
stateName = "Arrow off";
|
||||
stateName = _T("Arrow off");
|
||||
|
||||
wxList selections;
|
||||
FindSelectedShapes(selections, CLASSINFO(wxLineShape));
|
||||
@@ -590,7 +591,7 @@ void csDiagramView::OnToggleArrowTool(wxCommandEvent& event)
|
||||
if (theShape->GetArrows().Number() == 0)
|
||||
{
|
||||
newShape = (wxLineShape*) theShape->CreateNewCopy();
|
||||
newShape->AddArrow(ARROW_ARROW, ARROW_POSITION_MIDDLE, 10.0, 0.0, "Normal arrowhead");
|
||||
newShape->AddArrow(ARROW_ARROW, ARROW_POSITION_MIDDLE, 10.0, 0.0, _T("Normal arrowhead"));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -665,7 +666,7 @@ void csDiagramView::OnAlign(wxCommandEvent& event)
|
||||
return;
|
||||
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
csDiagramCommand* cmd = new csDiagramCommand("Align", doc);
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Align"), doc);
|
||||
|
||||
node = selections.First();
|
||||
wxShape* firstShape = (wxShape*) node->Data();
|
||||
@@ -681,8 +682,8 @@ void csDiagramView::OnAlign(wxCommandEvent& event)
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
if (shape != firstShape)
|
||||
{
|
||||
double x1 = shape->GetX();
|
||||
double y1 = shape->GetY();
|
||||
/* double x1 = */ shape->GetX();
|
||||
/* double y1 = */ shape->GetY();
|
||||
double width1, height1;
|
||||
shape->GetBoundingBoxMax(& width1, & height1);
|
||||
|
||||
@@ -745,10 +746,10 @@ void csDiagramView::OnAlignUpdate(wxUpdateUIEvent& event)
|
||||
event.Enable( (m_selections.Number() > 1) ) ;
|
||||
}
|
||||
|
||||
void csDiagramView::OnNewLinePoint(wxCommandEvent& event)
|
||||
void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
csDiagramCommand* cmd = new csDiagramCommand("New line point", doc);
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("New line point"), doc);
|
||||
|
||||
wxNode* node = m_selections.First();
|
||||
while (node)
|
||||
@@ -766,10 +767,10 @@ void csDiagramView::OnNewLinePoint(wxCommandEvent& event)
|
||||
doc->GetCommandProcessor()->Submit(cmd);
|
||||
}
|
||||
|
||||
void csDiagramView::OnCutLinePoint(wxCommandEvent& event)
|
||||
void csDiagramView::OnCutLinePoint(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
csDiagramCommand* cmd = new csDiagramCommand("Cut line point", doc);
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Cut line point"), doc);
|
||||
|
||||
wxNode* node = m_selections.First();
|
||||
while (node)
|
||||
@@ -787,10 +788,10 @@ void csDiagramView::OnCutLinePoint(wxCommandEvent& event)
|
||||
doc->GetCommandProcessor()->Submit(cmd);
|
||||
}
|
||||
|
||||
void csDiagramView::OnStraightenLines(wxCommandEvent& event)
|
||||
void csDiagramView::OnStraightenLines(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
csDiagramCommand* cmd = new csDiagramCommand("Straighten lines", doc);
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Straighten lines"), doc);
|
||||
|
||||
wxNode* node = m_selections.First();
|
||||
while (node)
|
||||
@@ -861,7 +862,7 @@ void csCanvas::DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2)
|
||||
dc.DrawRectangle((long) x1, (long) y1, (long) (x2 - x1), (long) (y2 - y1));
|
||||
}
|
||||
|
||||
void csCanvas::OnLeftClick(double x, double y, int keys)
|
||||
void csCanvas::OnLeftClick(double x, double y, int WXUNUSED(keys))
|
||||
{
|
||||
csEditorToolPalette *palette = wxGetApp().GetDiagramPalette();
|
||||
|
||||
@@ -881,8 +882,8 @@ void csCanvas::OnLeftClick(double x, double y, int keys)
|
||||
// Ask for a label and create a new free-floating text region
|
||||
csLabelEditingDialog* dialog = new csLabelEditingDialog(GetParent());
|
||||
|
||||
dialog->SetShapeLabel("");
|
||||
dialog->SetTitle("New text box");
|
||||
dialog->SetShapeLabel( wxEmptyString );
|
||||
dialog->SetTitle(_T("New text box"));
|
||||
if (dialog->ShowModal() == wxID_CANCEL)
|
||||
{
|
||||
dialog->Destroy();
|
||||
@@ -898,7 +899,8 @@ void csCanvas::OnLeftClick(double x, double y, int keys)
|
||||
|
||||
wxComboBox* comboBox = wxGetApp().GetPointSizeComboBox();
|
||||
wxString str(comboBox->GetValue());
|
||||
int pointSize = atoi((const char*) str);
|
||||
long pointSize;
|
||||
str.ToLong( &pointSize );
|
||||
|
||||
wxFont* newFont = wxTheFontList->FindOrCreateFont(pointSize,
|
||||
shape->GetFont()->GetFamily(),
|
||||
@@ -912,7 +914,7 @@ void csCanvas::OnLeftClick(double x, double y, int keys)
|
||||
shape->SetX(x);
|
||||
shape->SetY(y);
|
||||
|
||||
csDiagramCommand* cmd = new csDiagramCommand("Text box",
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Text box"),
|
||||
(csDiagramDocument *)GetView()->GetDocument(),
|
||||
new csCommandState(ID_CS_ADD_SHAPE, shape, NULL));
|
||||
GetView()->GetDocument()->GetCommandProcessor()->Submit(cmd);
|
||||
@@ -929,7 +931,8 @@ void csCanvas::OnLeftClick(double x, double y, int keys)
|
||||
|
||||
wxComboBox* comboBox = wxGetApp().GetPointSizeComboBox();
|
||||
wxString str(comboBox->GetValue());
|
||||
int pointSize = atoi((const char*) str);
|
||||
long pointSize;
|
||||
str.ToLong( &pointSize );
|
||||
|
||||
wxFont* newFont = wxTheFontList->FindOrCreateFont(pointSize,
|
||||
symbol->GetShape()->GetFont()->GetFamily(),
|
||||
@@ -953,14 +956,14 @@ void csCanvas::OnLeftClick(double x, double y, int keys)
|
||||
}
|
||||
}
|
||||
|
||||
void csCanvas::OnRightClick(double x, double y, int keys)
|
||||
void csCanvas::OnRightClick(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys))
|
||||
{
|
||||
}
|
||||
|
||||
// Initial point
|
||||
static double sg_initialX, sg_initialY;
|
||||
|
||||
void csCanvas::OnDragLeft(bool draw, double x, double y, int keys)
|
||||
void csCanvas::OnDragLeft(bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys))
|
||||
{
|
||||
wxClientDC dc(this);
|
||||
PrepareDC(dc);
|
||||
@@ -969,7 +972,7 @@ void csCanvas::OnDragLeft(bool draw, double x, double y, int keys)
|
||||
DrawOutline(dc, sg_initialX, sg_initialY, x, y);
|
||||
}
|
||||
|
||||
void csCanvas::OnBeginDragLeft(double x, double y, int keys)
|
||||
void csCanvas::OnBeginDragLeft(double x, double y, int WXUNUSED(keys))
|
||||
{
|
||||
sg_initialX = x;
|
||||
sg_initialY = y;
|
||||
@@ -982,7 +985,7 @@ void csCanvas::OnBeginDragLeft(double x, double y, int keys)
|
||||
CaptureMouse();
|
||||
}
|
||||
|
||||
void csCanvas::OnEndDragLeft(double x, double y, int keys)
|
||||
void csCanvas::OnEndDragLeft(double x, double y, int WXUNUSED(keys))
|
||||
{
|
||||
ReleaseMouse();
|
||||
|
||||
@@ -1015,15 +1018,15 @@ void csCanvas::OnEndDragLeft(double x, double y, int keys)
|
||||
}
|
||||
}
|
||||
|
||||
void csCanvas::OnDragRight(bool draw, double x, double y, int keys)
|
||||
void csCanvas::OnDragRight(bool WXUNUSED(draw), double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys))
|
||||
{
|
||||
}
|
||||
|
||||
void csCanvas::OnBeginDragRight(double x, double y, int keys)
|
||||
void csCanvas::OnBeginDragRight(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys))
|
||||
{
|
||||
}
|
||||
|
||||
void csCanvas::OnEndDragRight(double x, double y, int keys)
|
||||
void csCanvas::OnEndDragRight(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys))
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user