- Timestamp:
- 08/28/11 23:10:45 (13 years ago)
- Location:
- ps/trunk/source/tools/atlas
- Files:
-
- 5 edited
-
AtlasUI/CustomControls/Buttons/ToolButton.cpp (modified) (2 diffs)
-
AtlasUI/CustomControls/Buttons/ToolButton.h (modified) (2 diffs)
-
AtlasUI/ScenarioEditor/ScenarioEditor.cpp (modified) (3 diffs)
-
AtlasUI/ScenarioEditor/ScenarioEditor.h (modified) (2 diffs)
-
GameInterface/Handlers/GraphicsSetupHandlers.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/tools/atlas/AtlasUI/CustomControls/Buttons/ToolButton.cpp
r6910 r10129 1 /* Copyright (C) 20 09Wildfire Games.1 /* Copyright (C) 2011 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * … … 70 70 END_EVENT_TABLE() 71 71 72 ToolButtonBar::ToolButtonBar(ToolManager& toolManager, wxWindow* parent, SectionLayout* sectionLayout, int baseID )73 : wxToolBar(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL)72 ToolButtonBar::ToolButtonBar(ToolManager& toolManager, wxWindow* parent, SectionLayout* sectionLayout, int baseID, long style) 73 : wxToolBar(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, style) 74 74 , m_ToolManager(toolManager), m_SectionLayout(sectionLayout), m_Id(baseID), m_Size(-1) 75 75 { -
ps/trunk/source/tools/atlas/AtlasUI/CustomControls/Buttons/ToolButton.h
r6910 r10129 1 /* Copyright (C) 20 09Wildfire Games.1 /* Copyright (C) 2011 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * … … 45 45 { 46 46 public: 47 ToolButtonBar(ToolManager& toolManager, wxWindow* parent, SectionLayout* sectionLayout, int baseID );47 ToolButtonBar(ToolManager& toolManager, wxWindow* parent, SectionLayout* sectionLayout, int baseID, long style); 48 48 void AddToolButton(const wxString& shortLabel, const wxString& longLabel, 49 49 const wxString& iconPNGFilename, const wxString& toolName, const wxString& sectionPage); -
ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp
r10118 r10129 32 32 #include "General/Datafile.h" 33 33 34 #include "CustomControls/HighResTimer/HighResTimer.h"35 34 #include "CustomControls/Buttons/ToolButton.h" 36 35 #include "CustomControls/Canvas/Canvas.h" 36 #include "CustomControls/HighResTimer/HighResTimer.h" 37 37 38 38 #include "GameInterface/MessagePasser.h" … … 450 450 451 451 // Toolbar: 452 453 ToolButtonBar* toolbar = new ToolButtonBar(m_ToolManager, this, &m_SectionLayout, ID_Toolbar); 454 // TODO: configurable small vs large icon images 455 456 // (button label; tooltip text; image; internal tool name; section to switch to) 457 toolbar->AddToolButton(_("Default"), _("Default"), _T("default.png"), _T(""), _T("")); 458 toolbar->AddToolButton(_("Move"), _("Move/rotate object"), _T("moveobject.png"), _T("TransformObject"), _T("")/*_T("ObjectSidebar")*/); 459 toolbar->AddToolButton(_("Elevation"), _("Alter terrain elevation"), _T("alterelevation.png"), _T("AlterElevation"), _T("")/*_T("TerrainSidebar")*/); 460 toolbar->AddToolButton(_("Smooth"), _("Smooth terrain elevation"), _T("smoothelevation.png"), _T("SmoothElevation"), _T("")/*_T("TerrainSidebar")*/); 461 toolbar->AddToolButton(_("Flatten"), _("Flatten terrain elevation"), _T("flattenelevation.png"), _T("FlattenElevation"), _T("")/*_T("TerrainSidebar")*/); 462 toolbar->AddToolButton(_("Paint Terrain"), _("Paint terrain texture"), _T("paintterrain.png"), _T("PaintTerrain"), _T("")/*_T("TerrainSidebar")*/); 463 464 toolbar->Realize(); 465 SetToolBar(toolbar); 452 // wxOSX/Cocoa 2.9 doesn't seem to like SetToolBar, so we use CreateToolBar which implicitly associates 453 // the toolbar with the frame, and use OnCreateToolBar to construct our custom toolbar 454 // (this should be equivalent behavior on all platforms) 455 CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL, ID_Toolbar); 456 466 457 // Set the default tool to be selected 467 458 m_ToolManager.SetCurrentTool(_T("")); … … 536 527 } 537 528 529 wxToolBar* ScenarioEditor::OnCreateToolBar(long style, wxWindowID id, const wxString& WXUNUSED(name)) 530 { 531 ToolButtonBar* toolbar = new ToolButtonBar(m_ToolManager, this, &m_SectionLayout, id, style); 532 // TODO: configurable small vs large icon images 533 534 // (button label; tooltip text; image; internal tool name; section to switch to) 535 toolbar->AddToolButton(_("Default"), _("Default"), _T("default.png"), _T(""), _T("")); 536 toolbar->AddToolButton(_("Move"), _("Move/rotate object"), _T("moveobject.png"), _T("TransformObject"), _T("")/*_T("ObjectSidebar")*/); 537 toolbar->AddToolButton(_("Elevation"), _("Alter terrain elevation"), _T("alterelevation.png"), _T("AlterElevation"), _T("")/*_T("TerrainSidebar")*/); 538 toolbar->AddToolButton(_("Smooth"), _("Smooth terrain elevation"), _T("smoothelevation.png"), _T("SmoothElevation"), _T("")/*_T("TerrainSidebar")*/); 539 toolbar->AddToolButton(_("Flatten"), _("Flatten terrain elevation"), _T("flattenelevation.png"), _T("FlattenElevation"), _T("")/*_T("TerrainSidebar")*/); 540 toolbar->AddToolButton(_("Paint Terrain"), _("Paint terrain texture"), _T("paintterrain.png"), _T("PaintTerrain"), _T("")/*_T("TerrainSidebar")*/); 541 542 toolbar->Realize(); 543 544 return toolbar; 545 } 546 538 547 float ScenarioEditor::GetSpeedModifier() 539 548 { -
ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.h
r9649 r10129 19 19 #define INCLUDED_SCENARIOEDITOR 20 20 21 #include "wx/toolbar.h" 22 21 23 #include "General/AtlasWindowCommandProc.h" 22 24 #include "General/Observable.h" … … 35 37 void OnTimer(wxTimerEvent& event); 36 38 void OnIdle(wxIdleEvent& event); 39 wxToolBar* OnCreateToolBar(long style, wxWindowID id, const wxString &name); 37 40 38 41 void OnNew(wxCommandEvent& event); -
ps/trunk/source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp
r8433 r10129 1 /* Copyright (C) 201 0Wildfire Games.1 /* Copyright (C) 2011 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * … … 163 163 { 164 164 CVideoMode::UpdateRenderer(msg->width, msg->height); 165 166 #if OS_MACOSX 167 // OS X seems to require this to update the GL canvas 168 Atlas_GLSetCurrent(const_cast<void*>(g_GameLoop->glCanvas)); 169 #endif 165 170 } 166 171
Note:
See TracChangeset
for help on using the changeset viewer.
