diff --git a/src/musikcube/cursespp/App.cpp b/src/musikcube/cursespp/App.cpp index ccf856e1d..e6abdd743 100755 --- a/src/musikcube/cursespp/App.cpp +++ b/src/musikcube/cursespp/App.cpp @@ -34,6 +34,7 @@ #include +#include #include #include #include @@ -41,7 +42,7 @@ #include #include #include - +#include #include #ifdef WIN32 diff --git a/src/musikcube/cursespp/AppLayout.cpp b/src/musikcube/cursespp/AppLayout.cpp index bc0b8ac5c..734db1b03 100644 --- a/src/musikcube/cursespp/AppLayout.cpp +++ b/src/musikcube/cursespp/AppLayout.cpp @@ -111,6 +111,7 @@ void AppLayout::SetPadding(size_t t, size_t l, size_t b, size_t r) { this->paddingL = l; this->paddingB = b; this->paddingR = r; + this->Layout(); } cursespp::IWindowPtr AppLayout::GetFocus() { diff --git a/src/musikcube/cursespp/Checkbox.cpp b/src/musikcube/cursespp/Checkbox.cpp index f8d35db57..7552c58b1 100755 --- a/src/musikcube/cursespp/Checkbox.cpp +++ b/src/musikcube/cursespp/Checkbox.cpp @@ -37,7 +37,6 @@ #include #include #include - #include using namespace cursespp; diff --git a/src/musikcube/cursespp/InputOverlay.cpp b/src/musikcube/cursespp/InputOverlay.cpp index a65e6e57a..2a631b30b 100644 --- a/src/musikcube/cursespp/InputOverlay.cpp +++ b/src/musikcube/cursespp/InputOverlay.cpp @@ -39,6 +39,7 @@ #include #include #include +#include using namespace cursespp; diff --git a/src/musikcube/cursespp/LayoutBase.cpp b/src/musikcube/cursespp/LayoutBase.cpp index 97fe7638e..94bfccbf1 100755 --- a/src/musikcube/cursespp/LayoutBase.cpp +++ b/src/musikcube/cursespp/LayoutBase.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include diff --git a/src/musikcube/cursespp/ListOverlay.cpp b/src/musikcube/cursespp/ListOverlay.cpp index 3a04c54ce..3bdb96692 100644 --- a/src/musikcube/cursespp/ListOverlay.cpp +++ b/src/musikcube/cursespp/ListOverlay.cpp @@ -33,6 +33,8 @@ ////////////////////////////////////////////////////////////////////////////// #include +#include +#include #include #include #include diff --git a/src/musikcube/cursespp/MultiLineEntry.cpp b/src/musikcube/cursespp/MultiLineEntry.cpp index 078676eb9..40dfd6cd3 100755 --- a/src/musikcube/cursespp/MultiLineEntry.cpp +++ b/src/musikcube/cursespp/MultiLineEntry.cpp @@ -33,6 +33,7 @@ ////////////////////////////////////////////////////////////////////////////// #include +#include #include #include diff --git a/src/musikcube/cursespp/ScrollableWindow.cpp b/src/musikcube/cursespp/ScrollableWindow.cpp index c0144b724..b3cbb8e50 100755 --- a/src/musikcube/cursespp/ScrollableWindow.cpp +++ b/src/musikcube/cursespp/ScrollableWindow.cpp @@ -39,8 +39,6 @@ #include #include -#include - using namespace cursespp; static const size_t INVALID_INDEX = (size_t) -1; diff --git a/src/musikcube/cursespp/Scrollbar.cpp b/src/musikcube/cursespp/Scrollbar.cpp index 07516beb0..591a5a0c1 100644 --- a/src/musikcube/cursespp/Scrollbar.cpp +++ b/src/musikcube/cursespp/Scrollbar.cpp @@ -33,6 +33,7 @@ ////////////////////////////////////////////////////////////////////////////// #include +#include #include using namespace cursespp; diff --git a/src/musikcube/cursespp/SimpleScrollAdapter.cpp b/src/musikcube/cursespp/SimpleScrollAdapter.cpp index a03bc0066..a6a4bb46d 100755 --- a/src/musikcube/cursespp/SimpleScrollAdapter.cpp +++ b/src/musikcube/cursespp/SimpleScrollAdapter.cpp @@ -80,13 +80,13 @@ EntryPtr SimpleScrollAdapter::GetEntry(cursespp::ScrollableWindow* window, size_ if (window && selectable) { SingleLineEntry* single = static_cast(entry.get()); single->SetAttrs(Color(Color::Default)); - if (index == window->GetScrollPosition().logicalIndex) { + if (index == window->GetScrollPosition().logicalIndex) { single->SetAttrs(Color(Color::ListItemHighlighted)); - } } + } return entry; - } +} std::string SimpleScrollAdapter::StringAt(size_t index) { auto entry = this->entries.at(index); diff --git a/src/musikcube/cursespp/Text.cpp b/src/musikcube/cursespp/Text.cpp index bbd4c242c..eea133423 100755 --- a/src/musikcube/cursespp/Text.cpp +++ b/src/musikcube/cursespp/Text.cpp @@ -33,6 +33,7 @@ ////////////////////////////////////////////////////////////////////////////// #include +#include #include #include diff --git a/src/musikcube/cursespp/Win32Util.cpp b/src/musikcube/cursespp/Win32Util.cpp index fe317a8b9..29413125d 100644 --- a/src/musikcube/cursespp/Win32Util.cpp +++ b/src/musikcube/cursespp/Win32Util.cpp @@ -32,8 +32,6 @@ // ////////////////////////////////////////////////////////////////////////////// -#pragma once - #include #include #include diff --git a/src/musikcube/cursespp/cursespp/Colors.h b/src/musikcube/cursespp/cursespp/Colors.h index 1c3f38a34..2894c5ec0 100644 --- a/src/musikcube/cursespp/cursespp/Colors.h +++ b/src/musikcube/cursespp/cursespp/Colors.h @@ -36,6 +36,7 @@ #include #include +#include namespace cursespp { class Color { diff --git a/src/musikcube/cursespp/cursespp/NumberValidator.h b/src/musikcube/cursespp/cursespp/NumberValidator.h deleted file mode 100644 index 43a879f19..000000000 --- a/src/musikcube/cursespp/cursespp/NumberValidator.h +++ /dev/null @@ -1,84 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (c) 2007-2017 musikcube team -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// * Neither the name of the author nor the names of other contributors may -// be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include -#include - -namespace cursespp { - - template - struct NumberValidator : public InputOverlay::IValidator { - using Formatter = std::function; - - NumberValidator(T minimum, T maximum, Formatter formatter) - : minimum(minimum), maximum(maximum), formatter(formatter) { - } - - virtual bool IsValid(const std::string& input) const override { - try { - double result = std::stod(input); - if (bounded(minimum, maximum) && (result < minimum || result > maximum)) { - return false; - } - } - catch (std::invalid_argument) { - return false; - } - return true; - } - - virtual const std::string ErrorMessage() const override { - if (bounded(minimum, maximum)) { - std::string result = _TSTR("validator_dialog_number_parse_bounded_error"); - f8n::str::replace(result, "{{minimum}}", formatter(minimum)); - f8n::str::replace(result, "{{maximum}}", formatter(maximum)); - return result; - } - return _TSTR("validator_dialog_number_parse_error"); - } - - static bool bounded(T minimum, T maximum) { - return - minimum != std::numeric_limits::min() && - maximum != std::numeric_limits::max(); - } - - - Formatter formatter; - T minimum, maximum; - }; - -} diff --git a/src/musikcube/cursespp/cursespp/ScrollAdapterBase.h b/src/musikcube/cursespp/cursespp/ScrollAdapterBase.h index d42bca8fe..4183b1c59 100644 --- a/src/musikcube/cursespp/cursespp/ScrollAdapterBase.h +++ b/src/musikcube/cursespp/cursespp/ScrollAdapterBase.h @@ -36,6 +36,7 @@ #include #include +#include #include namespace cursespp { diff --git a/src/musikcube/cursespp/cursespp/ShortcutsWindow.h b/src/musikcube/cursespp/cursespp/ShortcutsWindow.h index 6bac171f5..f6a592628 100644 --- a/src/musikcube/cursespp/cursespp/ShortcutsWindow.h +++ b/src/musikcube/cursespp/cursespp/ShortcutsWindow.h @@ -37,6 +37,7 @@ #include #include #include +#include namespace cursespp { class ShortcutsWindow : diff --git a/src/musikcube/cursespp/cursespp/SimpleScrollAdapter.h b/src/musikcube/cursespp/cursespp/SimpleScrollAdapter.h index 88b5e5c47..a1e32014d 100644 --- a/src/musikcube/cursespp/cursespp/SimpleScrollAdapter.h +++ b/src/musikcube/cursespp/cursespp/SimpleScrollAdapter.h @@ -36,6 +36,7 @@ #include #include +#include #include namespace cursespp { diff --git a/src/musikcube/cursespp/cursespp/Text.h b/src/musikcube/cursespp/cursespp/Text.h index 2c3e75a63..881958fe4 100644 --- a/src/musikcube/cursespp/cursespp/Text.h +++ b/src/musikcube/cursespp/cursespp/Text.h @@ -34,6 +34,9 @@ #pragma once +#include +#include + namespace cursespp { namespace text { enum TextAlign { diff --git a/src/musikcube/cursespp/cursespp/TextInput.h b/src/musikcube/cursespp/cursespp/TextInput.h index 58f8b891c..2abff3904 100644 --- a/src/musikcube/cursespp/cursespp/TextInput.h +++ b/src/musikcube/cursespp/cursespp/TextInput.h @@ -39,6 +39,7 @@ #include #include #include +#include namespace cursespp { class TextInput : diff --git a/src/musikcube/cursespp/cursespp/Win32Util.h b/src/musikcube/cursespp/cursespp/Win32Util.h index ffa378508..542835491 100644 --- a/src/musikcube/cursespp/cursespp/Win32Util.h +++ b/src/musikcube/cursespp/cursespp/Win32Util.h @@ -36,6 +36,9 @@ #ifdef WIN32 +#include +#include + namespace cursespp { namespace win32 { void InterceptWndProc(); diff --git a/src/musikcube/musikcube.vcxproj b/src/musikcube/musikcube.vcxproj index 437ce7d68..f90b5b700 100755 --- a/src/musikcube/musikcube.vcxproj +++ b/src/musikcube/musikcube.vcxproj @@ -268,7 +268,6 @@ xcopy "$(SolutionDir)src\3rdparty\bin\win32\font\*.ttf" "$(TargetDir)fonts\" /Y - diff --git a/src/musikcube/musikcube.vcxproj.filters b/src/musikcube/musikcube.vcxproj.filters index 8afb5f441..bd9a6dedf 100755 --- a/src/musikcube/musikcube.vcxproj.filters +++ b/src/musikcube/musikcube.vcxproj.filters @@ -358,9 +358,6 @@ cursespp\include - - cursespp\include - cursespp\include