X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2ba06d5a8ccf8c224fcfbd52fa01a55abf7befbd..3030ae493df7500fd5da7555f141c0c8a690bd8a:/contrib/samples/ogl/studio/cspalette.cpp diff --git a/contrib/samples/ogl/studio/cspalette.cpp b/contrib/samples/ogl/studio/cspalette.cpp index 4c2551f9e8..3eb05d3b8a 100644 --- a/contrib/samples/ogl/studio/cspalette.cpp +++ b/contrib/samples/ogl/studio/cspalette.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cspalette.cpp +// Name: contrib/samples/ogl/studio/cspalette.cpp // Purpose: OGLEdit palette // Author: Julian Smart // Modified by: @@ -9,10 +9,6 @@ // 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/laywin.h" #include #include @@ -36,7 +32,7 @@ #include "cspalette.h" #include "symbols.h" -#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) +#ifndef __WXMSW__ #include "bitmaps/arrow.xpm" #include "bitmaps/texttool.xpm" #endif @@ -72,6 +68,7 @@ bool csEditorToolPalette::OnLeftClick(int toolIndex, bool toggled) void csEditorToolPalette::OnMouseEnter(int toolIndex) { +#if wxUSE_STATUSBAR wxString msg = wxEmptyString; if (toolIndex == PALETTE_ARROW) msg = _T("Pointer"); @@ -82,6 +79,9 @@ void csEditorToolPalette::OnMouseEnter(int toolIndex) msg = symbol->GetName(); } ((wxFrame*) wxGetApp().GetTopWindow())->SetStatusText(msg); +#else + wxUnusedVar(toolIndex); +#endif // wxUSE_STATUSBAR } void csEditorToolPalette::SetSize(int x, int y, int width, int height, int sizeFlags) @@ -118,7 +118,7 @@ bool csApp::CreatePalette(wxFrame *parent) wxBitmap PaletteArrow(_T("arrowtool")); wxBitmap TextTool(_T("texttool")); wxSize toolBitmapSize(32, 32); -#elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) +#else // !__WXMSW__ wxBitmap PaletteArrow(arrow_xpm); wxBitmap TextTool(texttool_xpm); wxSize toolBitmapSize(22, 22); @@ -130,8 +130,8 @@ bool csApp::CreatePalette(wxFrame *parent) palette->SetToolBitmapSize(toolBitmapSize); - palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, _T("Pointer")); - palette->AddTool(PALETTE_TEXT_TOOL, TextTool, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, _T("Text")); + palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, true, 0, wxDefaultCoord, NULL, _T("Pointer")); + palette->AddTool(PALETTE_TEXT_TOOL, TextTool, wxNullBitmap, true, 0, wxDefaultCoord, NULL, _T("Text")); wxChar** symbols = new wxChar*[20]; int noSymbols = 0; @@ -141,7 +141,7 @@ bool csApp::CreatePalette(wxFrame *parent) symbols[noSymbols] = _T("Thin Rectangle"); noSymbols ++; - + symbols[noSymbols] = _T("Triangle"); noSymbols ++; @@ -171,7 +171,7 @@ bool csApp::CreatePalette(wxFrame *parent) if (symbol) { wxBitmap* bitmap = GetSymbolDatabase()->CreateToolBitmap(symbol, toolBitmapSize); - palette->AddTool(symbol->GetToolId(), *bitmap, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, symbol->GetName()); + palette->AddTool(symbol->GetToolId(), *bitmap, wxNullBitmap, true, 0, wxDefaultCoord, NULL, symbol->GetName()); delete bitmap; } @@ -185,7 +185,7 @@ bool csApp::CreatePalette(wxFrame *parent) csSymbol* symbol = (csSymbol*) node->Data(); wxBitmap* bitmap = GetSymbolDatabase()->CreateToolBitmap(symbol, toolBitmapSize); - palette->AddTool(symbol->GetToolId(), *bitmap, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, symbol->GetName()); + palette->AddTool(symbol->GetToolId(), *bitmap, wxNullBitmap, true, 0, wxDefaultCoord, NULL, symbol->GetName()); delete bitmap; @@ -200,4 +200,3 @@ bool csApp::CreatePalette(wxFrame *parent) return true; } -