From fe0c803da4e61452dbba2f2200128f8f24953489 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sat, 5 Dec 2009 22:41:54 +0000 Subject: [PATCH] Add save button --- images/icons/save.png | Bin 0 -> 529 bytes include/GameScreens.hpp | 1 - include/gui/FromBottom.hpp | 38 +++++++++++++++++++++++++++++++ include/gui/ILayout.hpp | 3 ++- layouts/editor.xml | 11 +++++++++ schemas/layout.xsd | 12 ++++++++++ src/Editor.cpp | 28 ++++++++++------------- src/Main.cpp | 2 +- src/gui/FromBottom.cpp | 45 +++++++++++++++++++++++++++++++++++++ src/gui/Layout.cpp | 9 ++++++++ src/gui/RenderContext.cpp | 5 ++++- 11 files changed, 134 insertions(+), 20 deletions(-) create mode 100644 images/icons/save.png create mode 100644 include/gui/FromBottom.hpp create mode 100644 src/gui/FromBottom.cpp diff --git a/images/icons/save.png b/images/icons/save.png new file mode 100644 index 0000000000000000000000000000000000000000..8ea64d4ca94891b0590f29b0d403d54b81842289 GIT binary patch literal 529 zcmV+s0`C2ZP)Px#24YJ`L;xB9ApmMe`;g55000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXh- z79};UATe?P00EInL_t(o!|j&MN+dB9M$b)BU6l;E#9->uxsRAUMKZv!qyzxcURkfv#EfIQDBhI^#xGB-Du zug){GlOv>QN>LQG0kSN^L|@12h`c&aE!qPuKnt*N05h|g#C`HSC(E*CRZetsfDk-N zB^1NG$$hTBdFgKf*E9oxUT=lapbS4LMnpCL1t5r+IbWN(03ehPwX+~9nw(tbGvR+P zY^)sT00000NkvXXu0mjfsioTU literal 0 HcmV?d00001 diff --git a/include/GameScreens.hpp b/include/GameScreens.hpp index 76324bc..cb6816c 100644 --- a/include/GameScreens.hpp +++ b/include/GameScreens.hpp @@ -25,7 +25,6 @@ // Create the various screens // These may be called multiple times IScreenPtr makeEditorScreen(IMapPtr aMap); -IScreenPtr makeEditorScreen(const string& aMapName); IScreenPtr makeGameScreen(IMapPtr aMap); IScreenPtr makeUIDemo(); diff --git a/include/gui/FromBottom.hpp b/include/gui/FromBottom.hpp new file mode 100644 index 0000000..ff8acef --- /dev/null +++ b/include/gui/FromBottom.hpp @@ -0,0 +1,38 @@ +// +// Copyright (C) 2009 Nick Gasson +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#ifndef INC_FROM_BOTTOM_HPP +#define INC_FROM_BOTTOM_HPP + +#include "Platform.hpp" +#include "gui/ContainerWidget.hpp" + +namespace gui { + + // A special container widget which positions its children + // relative to the lower edge of its parent + class FromBottom : public ContainerWidget { + public: + FromBottom(const AttributeSet& attrs); + + void render(RenderContext& rc) const; + private: + int offset; + }; +} + +#endif diff --git a/include/gui/ILayout.hpp b/include/gui/ILayout.hpp index da49a68..d467d02 100644 --- a/include/gui/ILayout.hpp +++ b/include/gui/ILayout.hpp @@ -46,7 +46,8 @@ namespace gui { typedef shared_ptr ILayoutPtr; ILayoutPtr makeLayout(const string& file_name); - + string parentPath(const string& path); + } #endif diff --git a/layouts/editor.xml b/layouts/editor.xml index 84818a0..c5f18f0 100644 --- a/layouts/editor.xml +++ b/layouts/editor.xml @@ -38,4 +38,15 @@