X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/92a19c2e7757ba742846f83e56356de0a607bdc2..3030ae493df7500fd5da7555f141c0c8a690bd8a:/contrib/samples/ogl/studio/symbols.cpp diff --git a/contrib/samples/ogl/studio/symbols.cpp b/contrib/samples/ogl/studio/symbols.cpp index b96fb69317..5aaffd6816 100644 --- a/contrib/samples/ogl/studio/symbols.cpp +++ b/contrib/samples/ogl/studio/symbols.cpp @@ -1,18 +1,14 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: symbols.cpp +// Name: contrib/samples/ogl/studio/symbols.cpp // Purpose: Implements the Studio symbol database // Author: Julian Smart // Modified by: // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -// #pragma implementation -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -21,10 +17,10 @@ #endif #ifndef WX_PRECOMP -#include +#include "wx/wx.h" #endif -#include +#include "wx/ogl/ogl.h" // base header of OGL, includes and adjusts wx/deprecated/setup.h #include "studio.h" #include "doc.h" @@ -73,41 +69,41 @@ void csSymbolDatabase::AddSymbol(csSymbol* symbol) void csSymbolDatabase::ClearSymbols() { - wxNode* node = m_symbols.First(); + wxObjectList::compatibility_iterator node = m_symbols.GetFirst(); while (node) { - csSymbol* symbol = (csSymbol*) node->Data(); + csSymbol* symbol = (csSymbol*) node->GetData(); delete symbol; - node = node->Next(); + node = node->GetNext(); } m_symbols.Clear(); } csSymbol* csSymbolDatabase::FindSymbol(const wxString& name) const { - wxNode* node = m_symbols.First(); + wxObjectList::compatibility_iterator node = m_symbols.GetFirst(); while (node) { - csSymbol* symbol = (csSymbol*) node->Data(); + csSymbol* symbol = (csSymbol*) node->GetData(); if (symbol->GetName() == name) return symbol; - node = node->Next(); + node = node->GetNext(); } return NULL; } csSymbol* csSymbolDatabase::FindSymbol(int toolId) const { - wxNode* node = m_symbols.First(); + wxObjectList::compatibility_iterator node = m_symbols.GetFirst(); while (node) { - csSymbol* symbol = (csSymbol*) node->Data(); + csSymbol* symbol = (csSymbol*) node->GetData(); if (symbol->GetToolId() == toolId) return symbol; - node = node->Next(); + node = node->GetNext(); } return NULL; } @@ -119,51 +115,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) @@ -178,7 +174,7 @@ wxBitmap* csSymbolDatabase::CreateToolBitmap(csSymbol* symbol, const wxSize& too memDC.SelectObject(*newBitmap); memDC.SetPen(* wxBLACK_PEN); memDC.SetBrush(* wxWHITE_BRUSH); - memDC.SetBackground(wxBrush(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE), wxSOLID)); + memDC.SetBackground(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), wxSOLID)); memDC.SetLogicalFunction(wxCOPY); memDC.Clear(); @@ -188,7 +184,7 @@ wxBitmap* csSymbolDatabase::CreateToolBitmap(csSymbol* symbol, const wxSize& too memDC.SelectObject(wxNullBitmap); #endif -#if 1 +#if 1 wxMemoryDC memDC; double height, width, maxSize; @@ -208,10 +204,10 @@ wxBitmap* csSymbolDatabase::CreateToolBitmap(csSymbol* symbol, const wxSize& too memDC.SetUserScale(scaleFactor, scaleFactor); - memDC.SetBackground(wxBrush(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE), wxSOLID)); + memDC.SetBackground(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), wxSOLID)); memDC.Clear(); - symbol->GetShape()->Show(TRUE); + symbol->GetShape()->Show(true); symbol->GetShape()->Move(memDC, centreX, centreY); memDC.SelectObject(wxNullBitmap); @@ -219,4 +215,3 @@ wxBitmap* csSymbolDatabase::CreateToolBitmap(csSymbol* symbol, const wxSize& too return newBitmap; } -