11 DialogBoxBuilder::DialogBoxBuilder(
const wstring& className,
const wstring& dialogBoxName,
int x,
int y,
const string& dialogBoxFunctionName,
const string& moduleName, uint16_t smallIconResource, uint16_t largeIconResource) :
16 standard_sizes::dialogBoxBuilderMinWidth,
17 standard_sizes::dialogBoxBuilderMinHeight
20 dialogBoxName(dialogBoxName),
21 functionName(dialogBoxFunctionName),
22 moduleName(moduleName),
23 smallIconResource(smallIconResource),
24 largeIconResource(largeIconResource)
31 (*this) =
DialogBoxBuilder(className, dialogBoxName, settings.
x, settings.
y, functionName);
38 DialogBox* result =
new DialogBox(className, dialogBoxName, settings, functionName, moduleName, smallIconResource, largeIconResource);
40 uint16_t currentTopOffset = 0;
42 for (
const builderComponentData& i : components)
44 currentTopOffset +=
static_cast<uint16_t
>(i.offsets.top);
50 xPosition = i.offsets.left;
54 xPosition = (settings.
width - i.settings.width) / 2;
58 xPosition = settings.
width - i.settings.width - i.offsets.right;
63 const_cast<builderComponentData&
>(i).settings.
x = xPosition;
64 const_cast<builderComponentData&
>(i).settings.
y = currentTopOffset;
74 currentTopOffset +=
static_cast<uint16_t
>(i.settings.height + i.offsets.bottom);
80 DialogBoxBuilder::builderComponentData::builderComponentData(
const wstring& componentName,
const interfaces::IStyles& styles, RECT&& offsets,
size_t typeHash, uint16_t width, uint16_t height, alignment type, any&& additionalData) :
81 componentName(componentName),
82 offsets(move(offsets)),
85 additionalData(move(additionalData))
87 settings.
width = width;
100 dialogBoxFunctionName,
const std::wstring className
Base class for all dialog boxes.
Builder for dialog boxes.
DialogBoxBuilder & clear()
DialogBoxBuilder(const std::wstring &className, const std::wstring &dialogBoxName, int x, int y, const std::string &dialogBoxFunctionName, const std::string &moduleName="", uint16_t smallIconResource=NULL, uint16_t largeIconResource=NULL)
DialogBox * build() const
DialogBox(const std::wstring &className, const std::wstring &dialogBoxName, const utility::ComponentSettings &settings, const std::string &dialogBoxFunctionName="", const std::string &moduleName="", uint16_t smallIconResource=NULL, uint16_t largeIconResource=NULL)
size_t getHash() const override
Used as key in creators.
Singleton with GUIFramework settings and some functionality.
const std::unordered_map< size_t, smartPointerType< utility::BaseComponentCreator > > & getCreators() const
Get all current registered creators.
static GUIFramework & get()
Singleton instance access.
INonResizableComponent(HWND nonResizableHandle)
Provides styles for other classes.
DialogBox::DialogBoxBuilder DialogBoxBuilder
All settings for windows.
interfaces::IStyles styles