Skip to content

Commit

Permalink
Refactor, add createMarkup in BaseMainWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyPanda07 committed Jun 30, 2023
1 parent 4dcd77e commit d905bc7
Show file tree
Hide file tree
Showing 36 changed files with 62 additions and 105 deletions.
32 changes: 14 additions & 18 deletions GUIFramework/GUIFramework.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@
<ClInclude Include="src\BaseComponents\StandardComponents\BaseTrackbarControl.h" />
<ClInclude Include="src\BaseComponents\StandardComponents\ScrollBars\BaseVerticalAndHorizontalScrollBar.h" />
<ClInclude Include="src\BaseComponents\StandardComponents\ScrollBars\BaseVerticalScrollBar.h" />
<ClInclude Include="src\ComponentsHeader.h" />
<ClInclude Include="src\Components\Buttons\ImageButton.h" />
<ClInclude Include="src\CompositesHeader.h" />
<ClInclude Include="src\Composites\GroupBox.h" />
<ClInclude Include="src\BaseComponents\StandardComponents\ListViews\BaseIconListView.h" />
<ClInclude Include="src\BaseComponents\StandardComponents\ProgressBars\BaseInfiniteProgressBar.h" />
Expand Down Expand Up @@ -237,10 +235,10 @@
<ClInclude Include="src\Styles\Composites\DialogBoxStyles.h" />
<ClInclude Include="src\Styles\Composites\SeparateWindowStyles.h" />
<ClInclude Include="src\Styles\DefaultStyles.h" />
<ClInclude Include="src\Utility\Holders\LoadableHolders\BaseLoadableHolder.h" />
<ClInclude Include="src\Utility\Holders\LoadableHolders\CursorsHolder.h" />
<ClInclude Include="src\Utility\Holders\LoadableHolders\IconsHolder.h" />
<ClInclude Include="src\Utility\Holders\LoadableHolders\ImagesHolder.h" />
<ClInclude Include="src\Holders\LoadableHolders\BaseLoadableHolder.h" />
<ClInclude Include="src\Holders\LoadableHolders\CursorsHolder.h" />
<ClInclude Include="src\Holders\LoadableHolders\IconsHolder.h" />
<ClInclude Include="src\Holders\LoadableHolders\ImagesHolder.h" />
<ClInclude Include="src\Interfaces\Components\IResizableComponent.h" />
<ClInclude Include="src\Interfaces\Components\ITextOperations.h" />
<ClInclude Include="src\Interfaces\Iterators\IBaseConstForwardIterator.h" />
Expand All @@ -254,12 +252,12 @@
<ClInclude Include="src\Core.h" />
<ClInclude Include="src\BaseComposites\StandardComposites\BaseSeparateWindow.h" />
<ClInclude Include="src\Utility\ComponentSettings.h" />
<ClInclude Include="src\Utility\Holders\LoadableHolders\Iterators\loadable_const_forward_iterator.h" />
<ClInclude Include="src\Utility\Holders\LoadableHolders\Iterators\loadable_forward_iterator.h" />
<ClInclude Include="src\Holders\LoadableHolders\Iterators\loadable_const_forward_iterator.h" />
<ClInclude Include="src\Holders\LoadableHolders\Iterators\loadable_forward_iterator.h" />
<ClInclude Include="src\Utility\Keys.h" />
<ClInclude Include="src\Utility\Paint\Draw.h" />
<ClInclude Include="src\Utility\Utility.h" />
<ClInclude Include="src\Utility\Holders\WindowHolder.h" />
<ClInclude Include="src\Holders\WindowHolder.h" />
<ClInclude Include="src\WindowMessages.h" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -354,9 +352,7 @@
<ClCompile Include="src\BaseComponents\StandardComponents\BaseTrackbarControl.cpp" />
<ClCompile Include="src\BaseComponents\StandardComponents\ScrollBars\BaseVerticalAndHorizontalScrollBar.cpp" />
<ClCompile Include="src\BaseComponents\StandardComponents\ScrollBars\BaseVerticalScrollBar.cpp" />
<ClCompile Include="src\ComponentsHeader.cpp" />
<ClCompile Include="src\Components\Buttons\ImageButton.cpp" />
<ClCompile Include="src\CompositesHeader.cpp" />
<ClCompile Include="src\Composites\GroupBox.cpp" />
<ClCompile Include="src\BaseComponents\StandardComponents\ProgressBars\BaseInfiniteProgressBar.cpp" />
<ClCompile Include="src\BaseComponents\StandardComponents\ListBoxes\BaseListBox.cpp" />
Expand Down Expand Up @@ -468,10 +464,10 @@
<ClCompile Include="src\Styles\Composites\DialogBoxStyles.cpp" />
<ClCompile Include="src\Styles\Composites\SeparateWindowStyles.cpp" />
<ClCompile Include="src\Styles\DefaultStyles.cpp" />
<ClCompile Include="src\Utility\Holders\LoadableHolders\BaseLoadableHolder.cpp" />
<ClCompile Include="src\Utility\Holders\LoadableHolders\CursorsHolder.cpp" />
<ClCompile Include="src\Utility\Holders\LoadableHolders\IconsHolder.cpp" />
<ClCompile Include="src\Utility\Holders\LoadableHolders\ImagesHolder.cpp" />
<ClCompile Include="src\Holders\LoadableHolders\BaseLoadableHolder.cpp" />
<ClCompile Include="src\Holders\LoadableHolders\CursorsHolder.cpp" />
<ClCompile Include="src\Holders\LoadableHolders\IconsHolder.cpp" />
<ClCompile Include="src\Holders\LoadableHolders\ImagesHolder.cpp" />
<ClCompile Include="src\Interfaces\Components\IResizableComponent.cpp" />
<ClCompile Include="src\Interfaces\Components\ITextOperations.cpp" />
<ClCompile Include="src\Interfaces\Menu\IMenuItem.cpp" />
Expand All @@ -482,11 +478,11 @@
<ClCompile Include="src\Core.cpp" />
<ClCompile Include="src\BaseComposites\StandardComposites\BaseSeparateWindow.cpp" />
<ClCompile Include="src\Utility\ComponentSettings.cpp" />
<ClCompile Include="src\Utility\Holders\LoadableHolders\Iterators\loadable_const_forward_iterator.cpp" />
<ClCompile Include="src\Utility\Holders\LoadableHolders\Iterators\loadable_forward_iterator.cpp" />
<ClCompile Include="src\Holders\LoadableHolders\Iterators\loadable_const_forward_iterator.cpp" />
<ClCompile Include="src\Holders\LoadableHolders\Iterators\loadable_forward_iterator.cpp" />
<ClCompile Include="src\Utility\Paint\Draw.cpp" />
<ClCompile Include="src\Utility\Utility.cpp" />
<ClCompile Include="src\Utility\Holders\WindowHolder.cpp" />
<ClCompile Include="src\Holders\WindowHolder.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="GUIFrameworkMacros.props" />
Expand Down
40 changes: 14 additions & 26 deletions GUIFramework/GUIFramework.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
<ClInclude Include="src\Utility\Creators\Components\TabControlCreator.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\Utility\Holders\WindowHolder.h">
<ClInclude Include="src\Holders\WindowHolder.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\Exceptions\NotImplemented.h">
Expand All @@ -249,7 +249,7 @@
<ClInclude Include="src\BaseComponents\StandardComponents\ListViews\BaseListView.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\Utility\Holders\LoadableHolders\ImagesHolder.h">
<ClInclude Include="src\Holders\LoadableHolders\ImagesHolder.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\BaseComponents\StandardComponents\ListViews\BaseTextListView.h">
Expand Down Expand Up @@ -285,13 +285,13 @@
<ClInclude Include="src\BaseComponents\StandardComponents\ListViews\BaseListTextIconListView.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\Utility\Holders\LoadableHolders\BaseLoadableHolder.h">
<ClInclude Include="src\Holders\LoadableHolders\BaseLoadableHolder.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\Utility\Holders\LoadableHolders\IconsHolder.h">
<ClInclude Include="src\Holders\LoadableHolders\IconsHolder.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\Utility\Holders\LoadableHolders\CursorsHolder.h">
<ClInclude Include="src\Holders\LoadableHolders\CursorsHolder.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\Components\ListViews\IconListView.h">
Expand Down Expand Up @@ -486,10 +486,10 @@
<ClInclude Include="src\Interfaces\Utility\ISerializable.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\Utility\Holders\LoadableHolders\Iterators\loadable_const_forward_iterator.h">
<ClInclude Include="src\Holders\LoadableHolders\Iterators\loadable_const_forward_iterator.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\Utility\Holders\LoadableHolders\Iterators\loadable_forward_iterator.h">
<ClInclude Include="src\Holders\LoadableHolders\Iterators\loadable_forward_iterator.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\Styles\Components\EditControlStyles.h">
Expand All @@ -510,12 +510,6 @@
<ClInclude Include="src\Utility\Creators\Components\Buttons\ImageButtonCreator.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\ComponentsHeader.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\CompositesHeader.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="src\Deserialization\Recreator.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
Expand Down Expand Up @@ -920,7 +914,7 @@
<ClCompile Include="src\Utility\Creators\Components\TabControlCreator.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\Utility\Holders\WindowHolder.cpp">
<ClCompile Include="src\Holders\WindowHolder.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\Exceptions\NotImplemented.cpp">
Expand All @@ -929,7 +923,7 @@
<ClCompile Include="src\BaseComponents\StandardComponents\ListViews\BaseListView.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\Utility\Holders\LoadableHolders\ImagesHolder.cpp">
<ClCompile Include="src\Holders\LoadableHolders\ImagesHolder.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\BaseComponents\StandardComponents\ListViews\BaseTextListView.cpp">
Expand Down Expand Up @@ -965,13 +959,13 @@
<ClCompile Include="src\BaseComponents\StandardComponents\ListViews\BaseListTextIconListView.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\Utility\Holders\LoadableHolders\BaseLoadableHolder.cpp">
<ClCompile Include="src\Holders\LoadableHolders\BaseLoadableHolder.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\Utility\Holders\LoadableHolders\IconsHolder.cpp">
<ClCompile Include="src\Holders\LoadableHolders\IconsHolder.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\Utility\Holders\LoadableHolders\CursorsHolder.cpp">
<ClCompile Include="src\Holders\LoadableHolders\CursorsHolder.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\Components\ListViews\IconListView.cpp">
Expand Down Expand Up @@ -1166,10 +1160,10 @@
<ClCompile Include="src\Interfaces\Utility\ISerializable.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\Utility\Holders\LoadableHolders\Iterators\loadable_const_forward_iterator.cpp">
<ClCompile Include="src\Holders\LoadableHolders\Iterators\loadable_const_forward_iterator.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\Utility\Holders\LoadableHolders\Iterators\loadable_forward_iterator.cpp">
<ClCompile Include="src\Holders\LoadableHolders\Iterators\loadable_forward_iterator.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\Styles\Components\EditControlStyles.cpp">
Expand All @@ -1190,12 +1184,6 @@
<ClCompile Include="src\Utility\Creators\Components\Buttons\ImageButtonCreator.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\ComponentsHeader.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\CompositesHeader.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="src\Deserialization\Recreator.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
Expand Down
2 changes: 1 addition & 1 deletion GUIFramework/src/BaseComponents/BaseComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Core.h"
#include "Utility/Utility.h"
#include "Utility/ComponentSettings.h"
#include "Utility/Holders/LoadableHolders/IconsHolder.h"
#include "Holders/LoadableHolders/IconsHolder.h"
#include "Interfaces/Styles/IStyles.h"
#include "Interfaces/Utility/ISerializable.h"
#include "Interfaces/Localization/ITextLocalized.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "BaseComponents/BaseComponent.h"
#include "Utility/Holders/LoadableHolders/ImagesHolder.h"
#include "Holders/LoadableHolders/ImagesHolder.h"

namespace gui_framework
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "GUIFramework.h"
#include "Styles/Composites/DialogBoxStyles.h"
#include "Utility//Holders/WindowHolder.h"
#include "Holders/WindowHolder.h"

using namespace std;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ namespace gui_framework

}

void BaseMainWindow::createMarkup()
{

}

LRESULT BaseMainWindow::windowMessagesHandle(HWND handle, UINT message, WPARAM wparam, LPARAM lparam, bool& isUsed)
{
LRESULT result = BaseSeparateWindow::windowMessagesHandle(handle, message, wparam, lparam, isUsed);
Expand Down Expand Up @@ -123,6 +128,8 @@ namespace gui_framework
this->setExitMode(exitMode::quit);

this->initTray(trayIconResource, alwaysShowTrayIcon);

this->setBackgroundColor(240, 240, 240);
}

void BaseMainWindow::initTray(uint16_t trayIconResource, bool alwaysShowTrayIcon)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ namespace gui_framework
protected:
virtual void onDestroyEvent();

virtual void createMarkup();

virtual LRESULT windowMessagesHandle(HWND handle, UINT message, WPARAM wparam, LPARAM lparam, bool& isUsed) override;

public:
Expand Down Expand Up @@ -74,5 +76,7 @@ namespace gui_framework
virtual json::JSONBuilder getStructure() const override;

virtual ~BaseMainWindow();

friend class WindowHolder;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include "Exceptions/FileDoesNotExist.h"

#include "Utility/Holders/LoadableHolders/CursorsHolder.h"
#include "Utility/Holders/LoadableHolders/ImagesHolder.h"
#include "Utility/Holders/LoadableHolders/IconsHolder.h"
#include "Holders/LoadableHolders/CursorsHolder.h"
#include "Holders/LoadableHolders/ImagesHolder.h"
#include "Holders/LoadableHolders/IconsHolder.h"

using namespace std;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "BaseComposites/BaseComposite.h"
#include "Utility/Holders/LoadableHolders/BaseLoadableHolder.h"
#include "Holders/LoadableHolders/BaseLoadableHolder.h"
#include "Interfaces/Components/IComponentVisibility.h"

namespace gui_framework
Expand Down
2 changes: 1 addition & 1 deletion GUIFramework/src/Components/Buttons/ImageButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "BaseComposites/BaseComposite.h"
#include "Styles/Components/Buttons/DefaultButtonStyles.h"
#include "Utility/Holders/LoadableHolders/BaseLoadableHolder.h"
#include "Holders/LoadableHolders/BaseLoadableHolder.h"
#include "GUIFramework.h"

#pragma warning(disable: 6001)
Expand Down
1 change: 0 additions & 1 deletion GUIFramework/src/ComponentsHeader.cpp

This file was deleted.

32 changes: 0 additions & 32 deletions GUIFramework/src/ComponentsHeader.h

This file was deleted.

1 change: 0 additions & 1 deletion GUIFramework/src/CompositesHeader.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions GUIFramework/src/CompositesHeader.h

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "IconListViewParser.h"

#include "Utility/Holders/LoadableHolders/BaseLoadableHolder.h"
#include "Holders/LoadableHolders/BaseLoadableHolder.h"

using namespace std;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "Deserialization/Parsers/BaseComponentParser.h"
#include "Utility/Holders/LoadableHolders/BaseLoadableHolder.h"
#include "Holders/LoadableHolders/BaseLoadableHolder.h"

namespace gui_framework
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "WindowHolder.h"

#include "GUIFramework.h"

#include "Exceptions/GetLastErrorException.h"
#include "BaseComposites/StandardComposites/BaseMainWindow.h"

using namespace std;

Expand All @@ -19,7 +19,10 @@ namespace gui_framework
compositeWindow(move(compositeWindow)),
unregisterClass(unregisterClass)
{

if (BaseMainWindow* mainWindow = dynamic_cast<BaseMainWindow*>(this->compositeWindow.get()))
{
mainWindow->createMarkup();
}
}

BaseComposite* WindowHolder::get()
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion GUIFramework/src/Interfaces/Components/ICloseable.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "ICloseable.h"

#include "CompositesHeader.h"
#include "BaseComposites/BaseComposite.h"
#include "GUIFramework.h"
#include "Exceptions/CantFindFunctionFromModuleException.h"

using namespace std;
Expand Down
Loading

0 comments on commit d905bc7

Please sign in to comment.