#ifndef VCZH_PRESENTATION_CONTROLS_GUIBASICCONTROLS
#define VCZH_PRESENTATION_CONTROLS_GUIBASICCONTROLS
#include "../GraphicsHost/GuiGraphicsHost_Alt.h"
#include "../GraphicsHost/GuiGraphicsHost_Tab.h"
#include "Templates/GuiControlTemplates.h"
namespace
{
namespace
{
namespace
{
enum
class
;
}
namespace
{
template
<
typename
,
typename
=
>
struct
;
template
<
typename
>
struct
<
,
typename
<
decltype
(
::Identifier),
const
wchar_t
*
const
>::
>
{
static
()
{
return
(
::Identifier,
false
);
}
};
template
<
typename
>
struct
<
,
typename
<
decltype
(
::GetIdentifier()),
>::
>
{
static
()
{
return
<
>(
::GetIdentifier());
}
};
class
:
public
,
public
<
>
{
friend
class
;
protected
:
*
=
nullptr
;
bool
=
false
;
void
();
public
:
(
*
);
();
bool
();
};
class
:
public
,
protected
compositions
::
,
protected
compositions
::
,
public
<
>
{
friend
class
compositions
::
;
protected
:
using
=
collections
::
<
*>;
using
=
collections
::
<
,
<
>>;
using
ControlTemplatePropertyType
=
<
templates
::
>;
using
=
compositions
::
;
private
:
theme
::
;
ControlTemplatePropertyType
;
templates
::
*
=
nullptr
;
<
>
;
public
:
<
>
();
protected
:
compositions
::
*
=
nullptr
;
compositions
::
*
=
nullptr
;
compositions
::
*
=
nullptr
;
compositions
::
*
=
nullptr
;
bool
=
false
;
<
>
;
<
>
;
bool
=
false
;
= -
1
;
bool
=
true
;
bool
=
true
;
bool
=
true
;
;
;
<
>
;
;
description
::
;
compositions
::
*
=
nullptr
;
;
*
=
nullptr
;
;
description
::
;
*
=
nullptr
;
=
0
;
virtual
void
BeforeControlTemplateUninstalled
();
virtual
void
AfterControlTemplateInstalled
(
bool
);
virtual
void
CheckAndStoreControlTemplate
(
templates
::
*
);
virtual
void
EnsureControlTemplateExists
();
virtual
void
();
virtual
void
(
*
);
virtual
void
(
*
);
virtual
void
(
*
,
*
);
virtual
void
();
virtual
void
();
virtual
void
(
elements
::
*
);
virtual
void
OnBeforeReleaseGraphicsHost
();
virtual
void
();
virtual
void
();
void
(
compositions
::
*
,
compositions
::
&
);
void
(
compositions
::
*
,
compositions
::
&
);
void
(
compositions
::
*
);
bool
IsControlVisibleAndEnabled
();
bool
()
override
;
bool
()
override
;
compositions
::
*
()
override
;
compositions
::
*
()
override
;
void
()
override
;
bool
()
override
;
bool
()
override
;
static
bool
(
*
,
bool
);
public
:
using
=
templates
::
;
(
theme
::
);
();
compositions
::
;
compositions
::
;
compositions
::
;
compositions
::
;
compositions
::
;
compositions
::
;
compositions
::
;
compositions
::
;
compositions
::
;
compositions
::
;
compositions
::
;
compositions
::
;
void
(
<
void
()>
);
compositions
::
();
theme
::
();
void
(
theme
::
);
ControlTemplatePropertyType
();
void
(
const
ControlTemplatePropertyType
&
);
void
SetControlThemeNameAndTemplate
(
theme
::
,
const
ControlTemplatePropertyType
&
);
templates
::
*
();
compositions
::
*
();
compositions
::
*
();
compositions
::
*
();
*
();
();
*
(
);
bool
(
*
);
bool
(
*
);
virtual
*
();
virtual
bool
();
virtual
bool
();
virtual
bool
()
override
;
void
(
bool
);
virtual
()
override
;
void
(
);
virtual
bool
();
virtual
void
(
bool
);
virtual
bool
();
virtual
void
(
bool
);
virtual
const
&
()
override
;
virtual
bool
(
const
&
);
void
(
compositions
::
*
);
virtual
const
&
();
virtual
void
(
const
&
);
virtual
const
<
>&
();
virtual
void
(
const
<
>&
);
virtual
const
&
();
virtual
description
::
();
virtual
void
(
const
description
::
&
);
virtual
void
();
description
::
();
void
(
const
description
::
&
);
*
();
*
(
*
);
();
void
(
);
bool
(
);
void
();
virtual
*
(
const
&
);
template
<
typename
>
*
()
{
return
dynamic_cast
<
*>(
(
<
>::
()));
}
templates
::
*
TypedControlTemplateObject
(
bool
)
{
if
(
)
{
EnsureControlTemplateExists
();
}
return
;
}
bool
(
const
&
,
<
>
);
};
class
:
public
,
public
,
public
<
>
{
protected
:
controls
::
*
GetControlHostForInstance
()
override
;
void
()
override
;
public
:
(
theme
::
);
();
};
template
<
typename
>
class
:
public
{
public
:
<
>
;
()
{
}
(
<
>
)
:object(
)
{
}
};
#define GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME_3(UNIQUE) controlTemplateObject ## UNIQUE
#define GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME_2(UNIQUE) GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME_3(UNIQUE)
#define GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME_2(__LINE__)
#define GUI_SPECIFY_CONTROL_TEMPLATE_TYPE_2(TEMPLATE, BASE_TYPE, NAME) \
public: \
using ControlTemplateType = templates::Gui##TEMPLATE; \
private: \
templates::Gui##TEMPLATE* NAME = nullptr; \
void BeforeControlTemplateUninstalled_(); \
void AfterControlTemplateInstalled_(bool initialize); \
protected: \
void BeforeControlTemplateUninstalled()override \
{\
BeforeControlTemplateUninstalled_(); \
BASE_TYPE::BeforeControlTemplateUninstalled(); \
}\
void AfterControlTemplateInstalled(bool initialize)override \
{\
BASE_TYPE::AfterControlTemplateInstalled(initialize); \
AfterControlTemplateInstalled_(initialize); \
}\
void CheckAndStoreControlTemplate(templates::GuiControlTemplate* value)override \
{ \
auto ct = dynamic_cast<templates::Gui##TEMPLATE*>(value); \
CHECK_ERROR(ct, L"The assigned control template is not vl::presentation::templates::Gui" L ## # TEMPLATE L"."); \
NAME = ct; \
BASE_TYPE::CheckAndStoreControlTemplate(value); \
} \
public: \
templates::Gui##TEMPLATE* TypedControlTemplateObject(bool ensureExists) \
{ \
if (ensureExists) \
{ \
EnsureControlTemplateExists(); \
} \
return NAME; \
} \
private: \
#define GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(TEMPLATE, BASE_TYPE) GUI_SPECIFY_CONTROL_TEMPLATE_TYPE_2(TEMPLATE, BASE_TYPE, GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME)
}
}
}
#endif