#include "GuiRibbonGalleryList.h"
#include "GuiRibbonImpl.h"
#include "../../GraphicsComposition/GuiGraphicsRepeatComposition.h"
#include "../Templates/GuiThemeStyleFactory.h"
#ifndef VCZH_DEBUG_NO_REFLECTION
#include "../../Reflection/TypeDescriptors/GuiReflectionPlugin.h"
#endif
namespace
{
namespace
{
namespace
{
using
namespace
reflection
::
description
;
using
namespace
collections
;
using
namespace
compositions
;
using
namespace
templates
;
namespace
{
::
()
{
}
::
()
{
if
(
)
{
.
<
>()
.
(
);
}
}
::
()
{
return
;
}
<
>
::
()
{
return
;
}
void
::
()
{
=
true
;
.
();
.
();
.
();
=
false
;
if
(
)
{
if
(
())
{
FOREACH_INDEXER(Value, groupValue, index, GetLazyList<Value>(itemSource))
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
<
>(
));
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
groupValue
);
index
++)
{
auto
=
<
>();
group
groupValue
);
group
(
groupValue
));
(
group
,
index
);
.
(
group
);
}
}
else
{
auto
=
<
>();
group
(
);
(
group
,
0
);
.
(
group
);
}
}
}
<
>
::
(
<
>
)
{
if
(!
)
{
return
nullptr
;
}
else
if
(
auto
=
.
<
>())
{
return
list
;
}
else
{
return
::
(
<
>(
));
}
}
void
::
(
<
>
,
)
{
if
(
auto
=
.
<
>())
{
observable
.
([
this
, index](
,
,
)
{
(
,
start
,
oldCount
,
newCount
);
});
}
}
void
::
(
,
,
)
{
if
(!
)
{
for
(
=
0
;
i
<
;
i
++)
{
(
);
}
for
(
=
0
;
i
<
;
i
++)
{
(
+
i
);
}
}
}
void
::
(
,
,
,
)
{
if
(!
)
{
=
(
);
=
countBeforeGroup
+
;
=
<
?
:
;
auto
=
]
;
for
(
=
0
;
i
<
minCount
;
i
++)
{
.
(
joinedIndex
+
i
,
itemValues
(
+
i
));
}
if
(
<
)
{
for
(
=
minCount
;
i
<
;
i
++)
{
.
(
joinedIndex
+
i
,
itemValues
(
+
i
));
}
}
else
if
(
>
)
{
for
(
=
minCount
;
i
<
;
i
++)
{
.
(
joinedIndex
+
i
);
}
}
] +=
-
;
}
}
::
(
)
{
=
0
;
for
(
=
0
;
i
<
;
i
++)
{
count
+=
i
];
}
return
count
;
}
void
::
(
)
{
=
(
);
auto
=
];
=
group
?
group
() :
0
;
.
(
,
itemCount
);
if
(
itemCount
>
0
)
{
for
(
=
0
;
i
<
itemCount
;
i
++)
{
.
(
countBeforeGroup
+
i
,
group
(
i
));
}
}
}
void
::
(
)
{
=
(
);
.
(
countBeforeGroup
,
]);
.
(
);
}
::
(
compositions
::
*
)
:associatedComposition(
)
{
.
(
);
GroupTitlePropertyChanged
.
(
);
GroupChildrenPropertyChanged
.
(
);
.
()
.
(
this
, &
::
);
}
::
()
{
.
()
.
(
);
}
<
>
::
()
{
return
;
}
void
::
(
<
>
)
{
if
(
)
{
;
();
}
}
bool
::
()
{
return
&&
;
}
<
>
::
()
{
return
;
}
void
::
(
const
<
>&
)
{
if
(
)
{
;
GroupTitlePropertyChanged
.
(
(
));
.
(
(
));
();
}
}
<
<
>>
::
()
{
return
;
}
void
::
(
const
<
<
>>&
)
{
if
(
)
{
;
GroupChildrenPropertyChanged
.
(
(
));
.
(
(
));
();
}
}
const
::
&
::
()
{
return
;
}
}
void
GuiBindableRibbonGalleryList
::
BeforeControlTemplateUninstalled_
()
{
}
void
GuiBindableRibbonGalleryList
::
AfterControlTemplateInstalled_
(
bool
)
{
auto
=
TypedControlTemplateObject
(
true
);
->
(
ct
->
());
->
(
ct
->
());
->
(
ct
->
GetGroupContainerTemplate
());
();
();
}
void
GuiBindableRibbonGalleryList
::
()
{
auto
=
->
()->
();
auto
=
->
()->
();
->
(
(
bSize
.
() -
cSize
.
(),
bSize
.
() -
cSize
.
()));
if
(
->
() >
0
)
{
=
->
();
if
(
columns
==
0
)
columns
=
1
;
= (
+
columns
-
1
) /
columns
;
= (
)(
->
().
()*(
rows
+
0.5
));
->
()->
(
(
0
,
height
));
}
else
{
->
()->
(
(
0
,
0
));
}
}
void
GuiBindableRibbonGalleryList
::
OnItemListSelectionChanged
(
compositions
::
*
,
compositions
::
&
)
{
auto
=
(
->
());
if
(
pos
.
!= -
1
&&
pos
.
!= -
1
)
{
for
(
=
0
;
i
<
.
();
i
++)
{
auto
=
i
];
if
(
group
())
{
=
group
()
();
for
(
=
0
;
j
<
count
;
j
++)
{
auto
=
MenuGetGroupItemBackground
(
i
,
j
);
background
->
(
pos
.
==
i
&&
pos
.
==
j
);
}
}
}
}
if
(!
&&
->
() != -
1
)
{
(
);
itemAppliedArgs
.
=
->
();
.
(
itemAppliedArgs
);
}
.
(
());
}
void
GuiBindableRibbonGalleryList
::
(
compositions
::
*
,
compositions
::
&
)
{
(
.
);
}
void
GuiBindableRibbonGalleryList
::
(
compositions
::
*
,
compositions
::
&
)
{
(
.
);
}
void
GuiBindableRibbonGalleryList
::
(
compositions
::
*
,
compositions
::
&
)
{
();
auto
=
->
();
->
()->
(
(
bounds
.
() +
20
,
1
));
for
(
=
0
;
i
<
.
();
i
++)
{
auto
=
i
];
if
(
group
())
{
=
group
()
();
for
(
=
0
;
j
<
count
;
j
++)
{
auto
=
MenuGetGroupItemBackground
(
i
,
j
);
background
->
()->
(
(
0
,
bounds
.
()));
}
}
}
}
void
GuiBindableRibbonGalleryList
::
(
compositions
::
*
,
compositions
::
&
)
{
->
(
this
,
(
0
,
0
));
}
void
GuiBindableRibbonGalleryList
::
(
compositions
::
*
,
compositions
::
&
)
{
->
();
}
void
GuiBindableRibbonGalleryList
::
(
compositions
::
*
,
compositions
::
&
)
{
->
();
}
void
GuiBindableRibbonGalleryList
::()
{
->
([
this
](
const
& )->
*
{
auto
=
<
<
list
::
>>(
groupValue
);
auto
=
new
;
groupTemplate
->
(
::
LimitToElementAndChildren
);
auto
=
new
;
groupContentStack
->
(
::
LimitToElementAndChildren
);
groupContentStack
->
(
(
0
,
0
,
0
,
0
));
groupContentStack
->
(
::
);
{
auto
=
new
;
groupContentStack
->
(
item
);
auto
=
new
(
theme
::
::
);
header
->
(
TypedControlTemplateObject
(
true
)->
());
header
->
()->
(
(
0
,
0
,
0
,
0
));
header
->
(
group
());
item
->
(
header
->
());
}
if
(
)
{
auto
=
new
;
item
->
(
(
1
,
1
));
groupContentStack
->
(
item
);
auto
=
new
();
groupItemFlow
->
(
::
LimitToElementAndChildren
);
groupItemFlow
->
(
(
0
,
0
,
0
,
0
));
groupItemFlow
->
(
group
());
groupItemFlow
->
([=](
const
& )->
*
{
auto
=
new
;
groupItemTemplate
->
(
::
LimitToElementAndChildren
);
auto
=
new
(
theme
::
::
);
if
(
auto
=
TypedControlTemplateObject
(
true
)->
())
{
backgroundButton
->
(
style
);
}
backgroundButton
->
(
false
);
backgroundButton
->
(
false
);
backgroundButton
->
.
([=](
* ,
& )
{
auto
=
->
().
(
dynamic_cast
<
*>(
groupTemplate
->
()));
auto
=
groupItemFlow
->
().
(
dynamic_cast
<
*>(
groupItemTemplate
->
()));
auto
=
({
groupIndex
,
itemIndex
});
->
(
index
,
true
);
->
(
index
);
->
();
});
backgroundButton
->
()->
()->
.
([=](
* ,
& )
{
auto
=
->
().
(
dynamic_cast
<
*>(
groupTemplate
->
()));
auto
=
groupItemFlow
->
().
(
dynamic_cast
<
*>(
groupItemTemplate
->
()));
auto
=
({
groupIndex
,
itemIndex
});
(
index
);
});
backgroundButton
->
()->
()->
.
([=](
* ,
& )
{
auto
=
->
().
(
dynamic_cast
<
*>(
groupTemplate
->
()));
auto
=
groupItemFlow
->
().
(
dynamic_cast
<
*>(
groupItemTemplate
->
()));
auto
=
({
groupIndex
,
itemIndex
});
(
index
);
});
groupItemTemplate
->
(
backgroundButton
->
());
auto
=
groupItemValue
);
itemTemplate
->
(
(
0
,
0
,
0
,
0
));
backgroundButton
->
()->
(
itemTemplate
);
return
groupItemTemplate
;
});
item
->
(
groupItemFlow
);
}
groupTemplate
->
(
groupContentStack
);
return
groupTemplate
;
});
}
*
GuiBindableRibbonGalleryList
::(
)
{
CHECK_ERROR(0 <= groupIndex && groupIndex < groupedItemSource.Count(), L"GuiBindableRibbonGalleryList::MenuGetGroupHeader(vint)#Group index out of range");
do
{
if
(!(
0
<=
&&
<
.
()))
throw
(
L"GuiBindableRibbonGalleryList::MenuGetGroupHeader(vint)#Group index out of range"
);}
while
(
0
);
auto
=
->
()
];
auto
=
stackItem
->
()
0
];
auto
=
dynamic_cast
<
*>(
groupTemplate
->
()
0
]);
auto
=
groupContentStack
->
()
0
];
auto
=
groupHeaderItem
->
()
0
]->
();
CHECK_ERROR(groupHeader, L"GuiBindableRibbonGalleryList::MenuGetGroupHeader(vint)#Internal error.");
do
{
if
(!(
groupHeader
))
throw
(
L"GuiBindableRibbonGalleryList::MenuGetGroupHeader(vint)#Internal error."
);}
while
(
0
);
return
groupHeader
;
}
compositions
::
*
GuiBindableRibbonGalleryList
::(
)
{
CHECK_ERROR(0 <= groupIndex && groupIndex < groupedItemSource.Count(), L"GuiBindableRibbonGalleryList::MenuGetGroupFlow(vint)#Group index out of range");
do
{
if
(!(
0
<=
&&
<
.
()))
throw
(
L"GuiBindableRibbonGalleryList::MenuGetGroupFlow(vint)#Group index out of range"
);}
while
(
0
);
if
(!
)
return
nullptr
;
auto
=
->
()
];
auto
=
stackItem
->
()
0
];
auto
=
dynamic_cast
<
*>(
groupTemplate
->
()
0
]);
auto
=
groupContentStack
->
()
1
];
auto
=
dynamic_cast
<
*>(
groupContentItem
->
()
0
]);
CHECK_ERROR(groupFlow, L"GuiBindableRibbonGalleryList::MenuGetGroupHeader(vint)#Internal error.");
do
{
if
(!(
groupFlow
))
throw
(
L"GuiBindableRibbonGalleryList::MenuGetGroupHeader(vint)#Internal error."
);}
while
(
0
);
return
groupFlow
;
}
*
GuiBindableRibbonGalleryList
::(
,
)
{
CHECK_ERROR(0 <= groupIndex && groupIndex < groupedItemSource.Count(), L"GuiBindableRibbonGalleryList::MenuGetGroupItemBackground(vint, vint)#Group index out of range");
do
{
if
(!(
0
<=
&&
<
.
()))
throw
(
L"GuiBindableRibbonGalleryList::MenuGetGroupItemBackground(vint, vint)#Group index out of range"
);}
while
(
0
);
auto
=
];
CHECK_ERROR(group->GetItemValues() && 0 <= itemIndex && itemIndex < group->GetItemValues()->GetCount(), L"GuiBindableRibbonGalleryList::MenuGetGroupHeader(vint, vint)#Item index out of range");
do
{
if
(!(
group
() &&
0
<=
&&
<
group
()
()))
throw
(
L"GuiBindableRibbonGalleryList::MenuGetGroupHeader(vint, vint)#Item index out of range"
);}
while
(
0
);
auto
=
(
);
auto
=
groupFlow
->
()
];
auto
=
groupFlowItem
->
()
0
];
auto
=
dynamic_cast
<
*>(
groupItemTemplate
->
()
0
]->
());
CHECK_ERROR(groupItemBackground, L"GuiBindableRibbonGalleryList::MenuGetGroupHeader(vint, vint)#Internal error.");
do
{
if
(!(
groupItemBackground
))
throw
(
L"GuiBindableRibbonGalleryList::MenuGetGroupHeader(vint, vint)#Internal error."
);}
while
(
0
);
return
groupItemBackground
;
}
void
GuiBindableRibbonGalleryList
::
(
)
{
if
(
!=
->
())
{
(
);
previewArgs
.
=
;
.
(
previewArgs
);
}
}
void
GuiBindableRibbonGalleryList
::
(
)
{
if
(
!=
->
())
{
(
);
previewArgs
.
=
;
.
(
previewArgs
);
}
}
*
GuiBindableRibbonGalleryList
::()
{
return
();
}
GuiBindableRibbonGalleryList
::
GuiBindableRibbonGalleryList
(
theme
::
)
:
(
)
,
(
)
{
.
(
);
.
(
);
.
(
);
.
(
);
.
(
);
=
new
(
theme
::
::
,
this
);
{
=
new
ribbon_impl
::
;
->
(
(
0
,
0
,
0
,
0
));
->
(
);
=
new
ribbon_impl
::
(
this
);
=
new
(
theme
::
::
);
->
()->
(
(
0
,
0
,
0
,
0
));
->
(
);
->
(
.
());
->
.
(
this
, &
GuiBindableRibbonGalleryList
::
OnItemListSelectionChanged
);
->
.
(
this
, &
GuiBindableRibbonGalleryList
::
);
->
.
(
this
, &
GuiBindableRibbonGalleryList
::
);
->
(
->
());
}
{
=
new
(
theme
::
::
);
->
SetHorizontalAlwaysVisible
(
false
);
->
(
false
);
->
(
true
);
->
()->
(
(
0
,
0
,
0
,
0
));
->
()->
(
->
());
=
new
GuiRepeatStackComposition
();
->
(
::
LimitToElementAndChildren
);
->
(
(
0
,
0
,
0
,
0
));
->
(
::
);
->
(
.
());
->
()->
(
);
();
}
.
(
this
, &
GuiBindableRibbonGalleryList
::
);
.
(
this
, &
GuiBindableRibbonGalleryList
::
);
.
(
this
, &
GuiBindableRibbonGalleryList
::
);
->
.
(
this
, &
GuiBindableRibbonGalleryList
::
);
->
();
}
GuiBindableRibbonGalleryList
::
~
GuiBindableRibbonGalleryList
()
{
delete
;
}
GuiBindableRibbonGalleryList
::
GuiBindableRibbonGalleryList
::
()
{
return
;
}
void
GuiBindableRibbonGalleryList
::
(
)
{
if
(
)
{
;
->
(
);
.
(
());
}
}
GuiBindableRibbonGalleryList
::
(
)
{
if
(
0
<=
&&
<
.
())
{
FOREACH_INDEXER(Ptr<list::GalleryGroup>, group, groupIndex, groupedItemSource)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
list
::
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
list
::
>
;
__foreach_iterator__
.
(
group
);
groupIndex
++)
{
auto
=
group
();
=
itemValues
?
itemValues
() :
0
;
if
(
>=
itemCount
)
{
-=
itemCount
;
}
else
{
return
(
groupIndex
,
);
}
}
}
return
{};
}
GuiBindableRibbonGalleryList
::
(
)
{
if
(
0
<=
.
&&
.
<
.
())
{
auto
=
(
.
);
auto
=
.
]
();
=
itemValues
?
itemValues
() :
0
;
if
(
0
<=
.
&&
.
<
itemCount
)
{
return
countBeforeGroup
+
.
;
}
}
return
-
1
;
}
GuiBindableRibbonGalleryList
::
()
{
return
->
();
}
void
GuiBindableRibbonGalleryList
::
(
)
{
->
(
);
}
GuiBindableRibbonGalleryList
::
()
{
return
->
();
}
void
GuiBindableRibbonGalleryList
::
(
)
{
->
(
);
}
GuiBindableRibbonGalleryList
::
()
{
return
->
();
}
description
::
GuiBindableRibbonGalleryList
::
()
{
=
->
();
if
(
index
== -
1
)
return
();
auto
=
(
index
);
return
pos
.
]
()
(
pos
.
);
}
void
GuiBindableRibbonGalleryList
::
(
)
{
if
(
== -
1
)
{
->
();
}
else
{
->
(
,
true
);
->
(
);
}
}
void
GuiBindableRibbonGalleryList
::
(
)
{
=
true
;
(
);
=
false
;
}
GuiBindableRibbonGalleryList
::
()
{
return
;
}
void
GuiBindableRibbonGalleryList
::
(
)
{
if
(
!=
)
{
=
;
();
}
}
*
GuiBindableRibbonGalleryList
::()
{
return
;
}
*
GuiBindableRibbonGalleryList
::
(
const
&
)
{
if
(
==
::
)
{
return
(
*)
this
;
}
else
{
return
::
(
);
}
}
}
}
}