#include "GuiDataGridExtensions.h"
#include "../../GraphicsComposition/GuiGraphicsTableComposition.h"
namespace
{
namespace
{
namespace
{
namespace
{
using
namespace
compositions
;
using
namespace
elements
;
using
namespace
theme
;
using
namespace
templates
;
::
()
{
}
::
()
{
if
(
)
{
(
);
}
}
*
::
()
{
return
;
}
templates
::
GuiGridVisualizerTemplate
*
::
()
{
return
;
}
void
::
()
{
=
nullptr
;
}
void
::
(
::
*
,
,
)
{
if
(
auto
=
dynamic_cast
<
*>(
->
()->
(
::
)))
{
auto
=
->
GetListViewControlTemplate
();
->
(
style
->
());
->
(
style
->
());
->
(
style
->
());
->
(
listViewItemView
->GetLargeImage(
));
->
(
listViewItemView
->GetSmallImage(
));
->
(
==
0
?
listViewItemView
->GetText(
) :
listViewItemView
->GetSubItem(
,
-
1
));
}
if
(
auto
=
dynamic_cast
<
*>(
->
()->
(
::
)))
{
->
(
->
(
));
->
(
dataGridView
->GetBindingCellValue(
,
));
}
}
void
::
(
bool
)
{
if
(
)
{
->
(
);
}
}
::
*
::
(
controls
::
list
::
*
)
{
*
=
{});
CHECK_ERROR(itemTemplate, L"DataVisualizerFactory::CreateItemTemplate(IDataGridContext*)#An instance of GuiGridEditorTemplate is expected.");
do
{
if
(!(
itemTemplate
))
throw
(
L"DataVisualizerFactory::CreateItemTemplate(IDataGridContext*)#An instance of GuiGridEditorTemplate is expected."
);}
while
(
0
);
if
(
)
{
auto
=
(
);
childTemplate
->
(
(
0
,
0
,
0
,
0
));
itemTemplate
->
()->
(
childTemplate
);
#define FORWARD_EVENT(NAME)\
itemTemplate->NAME##Changed.AttachLambda([=](GuiGraphicsComposition* sender, GuiEventArgs& arguments)\
{\
childTemplate->Set##NAME(itemTemplate->Get##NAME());\
});\
#define FORWARD_EVENT_IMPL(CLASS, TYPE, NAME, VALUE) FORWARD_EVENT(NAME)
GuiTemplate_PROPERTIES(FORWARD_EVENT_IMPL)
itemTemplate
->
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
itemTemplate
->
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
itemTemplate
->
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
itemTemplate
->
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
GuiControlTemplate_PROPERTIES(FORWARD_EVENT_IMPL)
itemTemplate
->
ContainerCompositionChanged
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
itemTemplate
->
FocusableCompositionChanged
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
itemTemplate
->
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
GuiGridCellTemplate_PROPERTIES(FORWARD_EVENT_IMPL)
itemTemplate
->
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
itemTemplate
->
SecondaryTextColorChanged
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
itemTemplate
->
ItemSeparatorColorChanged
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
itemTemplate
->
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
itemTemplate
->
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
GuiGridVisualizerTemplate_PROPERTIES(FORWARD_EVENT_IMPL)
itemTemplate
->
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
itemTemplate
->
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
itemTemplate
->
.
([=](
*
,
&
) {
childTemplate
->
(
itemTemplate
->
()); });
#undef FORWARD_EVENT_IMPL
#undef FORWARD_EVENT
}
return
itemTemplate
;
}
::
(
<
>
,
<
>
)
:templateFactory(
)
, decoratedFactory(
)
{
}
::
()
{
}
<
controls
::
list
::
>
::
(
controls
::
list
::
*
)
{
auto
=
<
>();
dataVisualizer
=
this
;
dataVisualizer
=
;
dataVisualizer
=
(
);
return
dataVisualizer
;
}
void
::
(
compositions
::
*
,
compositions
::
&
)
{
->
();
}
::
()
{
}
::
()
{
if
(
)
{
(
);
}
}
*
::
()
{
return
;
}
templates
::
*
::
()
{
return
;
}
void
::
()
{
=
nullptr
;
}
void
::
(
::
*
,
,
)
{
if
(
auto
=
dynamic_cast
<
*>(
->
()->
(
::
)))
{
auto
=
->
GetListViewControlTemplate
();
->
(
style
->
());
->
(
style
->
());
->
(
style
->
());
->
(
listViewItemView
->GetLargeImage(
));
->
(
listViewItemView
->GetSmallImage(
));
->
(
==
0
?
listViewItemView
->GetText(
) :
listViewItemView
->GetSubItem(
,
-
1
));
}
if
(
auto
=
dynamic_cast
<
*>(
->
()->
(
::
)))
{
->
(
->
(
));
->
(
dataGridView
->GetBindingCellValue(
,
));
}
->
.
(
this
, &
::
);
}
bool
::
()
{
if
(
)
{
return
->
();
}
return
true
;
}
::
(
<
>
)
:templateFactory(
)
{
}
::
()
{
}
<
>
::
(
controls
::
list
::
*
)
{
auto
=
<
>();
editor
=
this
;
editor
=
;
*
=
{});
CHECK_ERROR(itemTemplate, L"DataEditorFactory::CreateEditor(IDataGridContext*)#An instance of GuiGridEditorTemplate is expected.");
do
{
if
(!(
itemTemplate
))
throw
(
L"DataEditorFactory::CreateEditor(IDataGridContext*)#An instance of GuiGridEditorTemplate is expected."
);}
while
(
0
);
editor
=
itemTemplate
;
return
editor
;
}
void
MainColumnVisualizerTemplate
::
(
compositions
::
*
,
compositions
::
&
)
{
->
(
());
}
void
MainColumnVisualizerTemplate
::
(
compositions
::
*
,
compositions
::
&
)
{
->
(
());
}
void
MainColumnVisualizerTemplate
::
(
compositions
::
*
,
compositions
::
&
)
{
->
(
());
}
void
MainColumnVisualizerTemplate
::
(
compositions
::
*
,
compositions
::
&
)
{
auto
=
();
if
(
imageData
)
{
->
(
imageData
(),
imageData
());
}
else
{
->
(
nullptr
);
}
}
MainColumnVisualizerTemplate
::
MainColumnVisualizerTemplate
()
{
*
=
new
;
table
->
(
::
LimitToElementAndChildren
);
table
->
(
3
,
2
);
table
->
(
0
,
::
(
0.5
));
table
->
(
1
,
::
());
table
->
(
2
,
::
(
0.5
));
table
->
(
0
,
::
());
table
->
(
1
,
::
(
1.0
));
table
->
(
2
);
{
*
=
new
;
table
->
(
cell
);
cell
->
(
1
,
0
,
1
,
1
);
cell
->
(
(
16
,
16
));
=
::
();
->
(
true
);
cell
->
(
);
}
{
*
=
new
;
table
->
(
cell
);
cell
->
(
0
,
1
,
3
,
1
);
cell
->
(
(
0
,
0
,
8
,
0
));
=
::
();
->
(
::
,
::
);
->
(
true
);
cell
->
(
);
}
table
->
(
(
0
,
0
,
0
,
0
));
(
::
LimitToElementAndChildren
);
(
table
);
.
(
this
, &
MainColumnVisualizerTemplate
::
);
.
(
this
, &
MainColumnVisualizerTemplate
::
);
.
(
this
, &
MainColumnVisualizerTemplate
::
);
.
(
this
, &
MainColumnVisualizerTemplate
::
);
.
(
compositions
::
(
this
));
.
(
compositions
::
(
this
));
.
(
compositions
::
(
this
));
.
(
compositions
::
(
this
));
}
MainColumnVisualizerTemplate
::
~
MainColumnVisualizerTemplate
()
{
}
void
SubColumnVisualizerTemplate
::
(
compositions
::
*
,
compositions
::
&
)
{
->
(
());
}
void
SubColumnVisualizerTemplate
::
(
compositions
::
*
,
compositions
::
&
)
{
->
(
());
}
void
SubColumnVisualizerTemplate
::
(
compositions
::
*
,
compositions
::
&
)
{
->
(
());
}
void
SubColumnVisualizerTemplate
::
(
bool
)
{
=
::
();
->
(
::
);
->
(
true
);
(
::
LimitToElementAndChildren
);
(
(
8
,
0
,
8
,
0
));
(
);
.
(
this
, &
SubColumnVisualizerTemplate
::
);
.
(
this
, &
SubColumnVisualizerTemplate
::
);
if
(!
)
{
SecondaryTextColorChanged
.
(
this
, &
SubColumnVisualizerTemplate
::
);
}
.
(
compositions
::
(
this
));
.
(
compositions
::
(
this
));
if
(!
)
{
SecondaryTextColorChanged
.
(
compositions
::
(
this
));
}
}
SubColumnVisualizerTemplate
::
SubColumnVisualizerTemplate
(
bool
)
{
(
);
}
SubColumnVisualizerTemplate
::
SubColumnVisualizerTemplate
()
{
(
false
);
}
SubColumnVisualizerTemplate
::
~
SubColumnVisualizerTemplate
()
{
}
void
HyperlinkVisualizerTemplate
::
(
compositions
::
*
,
compositions
::
&
)
{
=
->
();
font
.
=
true
;
->
(
font
);
}
void
HyperlinkVisualizerTemplate
::
(
compositions
::
*
,
compositions
::
&
)
{
=
->
();
font
.
=
false
;
->
(
font
);
}
HyperlinkVisualizerTemplate
::
HyperlinkVisualizerTemplate
()
:
SubColumnVisualizerTemplate
(
true
)
{
->
(
(
0
,
0
,
255
));
->
(
true
);
()->
.
(
this
, &
HyperlinkVisualizerTemplate
::
);
()->
.
(
this
, &
HyperlinkVisualizerTemplate
::
);
(
()->
()->
(
::
));
}
HyperlinkVisualizerTemplate
::
~
HyperlinkVisualizerTemplate
()
{
}
void
FocusRectangleVisualizerTemplate
::
(
compositions
::
*
,
compositions
::
&
)
{
->
(
());
}
FocusRectangleVisualizerTemplate
::
FocusRectangleVisualizerTemplate
()
{
(
::
LimitToElementAndChildren
);
=
new
();
{
auto
=
::
();
->
(
focus
);
->
(
(
1
,
1
,
1
,
1
));
}
auto
=
new
();
{
container
->
(
::
LimitToElementAndChildren
);
container
->
(
(
2
,
2
,
2
,
2
));
}
(
);
(
container
);
(
container
);
.
(
this
, &
FocusRectangleVisualizerTemplate
::
);
.
(
compositions
::
(
this
));
}
FocusRectangleVisualizerTemplate
::
~
FocusRectangleVisualizerTemplate
()
{
}
void
CellBorderVisualizerTemplate
::
OnItemSeparatorColorChanged
(
*
,
compositions
::
&
)
{
->
(
());
->
(
());
}
CellBorderVisualizerTemplate
::
CellBorderVisualizerTemplate
()
{
(
::
LimitToElementAndChildren
);
auto
=
new
;
{
=
::
();
bounds1
->
(
);
bounds1
->
(
(-
1
,
0
,
0
,
0
));
}
auto
=
new
;
{
=
::
();
bounds2
->
(
);
bounds2
->
(
(
0
, -
1
,
0
,
0
));
}
auto
=
new
();
{
container
->
(
::
LimitToElementAndChildren
);
container
->
(
(
0
,
0
,
1
,
1
));
}
(
bounds1
);
(
bounds2
);
(
container
);
(
container
);
ItemSeparatorColorChanged
.
(
this
, &
CellBorderVisualizerTemplate
::
OnItemSeparatorColorChanged
);
ItemSeparatorColorChanged
.
(
compositions
::
(
this
));
}
CellBorderVisualizerTemplate
::
~
CellBorderVisualizerTemplate
()
{
}
}
}
}
}