#include "GuiToolstripMenu.h"
#include "../Templates/GuiThemeStyleFactory.h"
#include "../../GraphicsComposition/GuiGraphicsStackComposition.h"
#include "../../GraphicsComposition/GuiGraphicsSharedSizeComposition.h"
#include "../../GraphicsHost/GuiGraphicsHost_ShortcutKey.h"
namespace
{
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
compositions
;
const
wchar_t
*
const
IToolstripUpdateLayoutInvoker
::
=
L"vl::presentation::controls::IToolstripUpdateLayoutInvoker"
;
void
GuiToolstripCollectionBase
::
()
{
if
(
)
{
->
();
}
}
bool
GuiToolstripCollectionBase
::
(
,
*
const
&
)
{
return
!
.
(
) && !
->
()->
();
}
void
GuiToolstripCollectionBase
::
(
,
*
const
&
)
{
if
(
auto
=
->
<
IToolstripUpdateLayoutInvoker
>())
{
invoker
->
(
nullptr
);
}
();
}
void
GuiToolstripCollectionBase
::
(
,
*
const
&
)
{
if
(
auto
=
->
<
IToolstripUpdateLayoutInvoker
>())
{
invoker
->
(
);
}
();
}
void
GuiToolstripCollectionBase
::
(
,
)
{
();
}
GuiToolstripCollectionBase
::
(
*
)
:contentCallback(
)
{
}
GuiToolstripCollectionBase
::
()
{
}
void
::
(
,
*
)
{
auto
=
->
()
];
if
(
->
())
{
stackItem
->
(
::
LimitToElementAndChildren
);
->
()->
(
(
0
,
0
,
0
,
0
));
}
else
{
stackItem
->
(
::
);
->
()->
(
(-
1
, -
1
, -
1
, -
1
));
}
}
void
::
(
compositions
::
*
,
compositions
::
&
)
{
auto
=
->
();
=
(
child
);
(
index
,
child
);
();
}
void
::
(
,
*
const
&
)
{
*
=
->
().
(
);
auto
=
];
->
.
(
eventHandler
);
.
(
);
GuiToolstripCollectionBase
::
(
,
);
}
void
::
(
,
*
const
&
)
{
{
*
=
new
;
stackItem
->
(
->
());
->
(
,
stackItem
);
}
{
auto
=
->
.
(
this
, &
::
);
.
(
,
eventHandler
);
}
(
,
);
GuiToolstripCollectionBase
::
(
,
);
}
void
::
(
,
)
{
for
(
=
0
;
i
<
;
i
++)
{
auto
=
->
().
(
);
->
(
stackItem
);
(
stackItem
);
}
GuiToolstripCollectionBase
::
(
,
);
}
::
(
*
,
compositions
::
*
)
:
GuiToolstripCollectionBase
(
)
,stackComposition(
)
{
->
(
(
1
,
1
));
}
::
()
{
}
void
::()
{
sharedSizeRootComposition
->
ForceCalculateSizeImmediately
();
}
::(
theme
::
,
* )
:
(
,
)
{
sharedSizeRootComposition
=
new
GuiSharedSizeRootComposition
();
sharedSizeRootComposition
->
(
(
0
,
0
,
0
,
0
));
sharedSizeRootComposition
->
(
::
LimitToElementAndChildren
);
->
(
sharedSizeRootComposition
);
=
new
;
->
(
::
);
->
(
(
0
,
0
,
0
,
0
));
->
(
::
LimitToElementAndChildren
);
sharedSizeRootComposition
->
(
);
new
(
this
,
);
}
::()
{
}
collections
::
<
*>&
::()
{
return
*
.
();
}
::(
theme
::
)
:
(
)
{
=
new
;
->
(
::
);
->
(
(
0
,
0
,
0
,
0
));
->
(
::
LimitToElementAndChildren
);
->
(
);
new
(
nullptr
,
);
}
::()
{
}
collections
::
<
*>&
::()
{
return
*
.
();
}
::
(
theme
::
)
:
(
)
{
=
new
;
->
(
::
);
->
(
(
0
,
0
,
0
,
0
));
->
(
::
LimitToElementAndChildren
);
->
(
);
new
(
nullptr
,
);
}
::
()
{
}
collections
::
<
*>&
::
()
{
return
*
.
();
}
void
::
(
*
)
{
=
;
}
void
::
()
{
auto
=
();
if
(
host
==
this
)
{
::
();
}
else
{
host
->
<
>()->
();
}
}
void
::
()
{
if
(
)
{
(
->
());
(
->
());
(
->
());
(
->
());
(
->
());
if
(
->
())
{
(
->
()->
());
}
else
{
(
L""
);
}
}
else
{
(
nullptr
);
(
nullptr
);
(
L""
);
(
true
);
(
false
);
(
L""
);
}
}
void
::
(
compositions
::
*
,
compositions
::
&
)
{
if
(
)
{
->
();
}
}
void
::
(
compositions
::
*
,
compositions
::
&
)
{
if
(
)
{
->
.
(
,
);
}
}
void
::
(
compositions
::
*
,
compositions
::
&
)
{
();
}
::
(
theme
::
)
:
(
)
,command(
0
)
{
(
false
);
.
(
this
, &
::
);
.
(
this
, &
::
OnLayoutAwaredPropertyChanged
);
.
(
this
, &
::
OnLayoutAwaredPropertyChanged
);
}
::
()
{
}
*
::
()
{
return
;
}
void
::
(
*
)
{
if
(
!=
)
{
if
(
)
{
->
.
(
descriptionChangedHandler
);
}
=
0
;
descriptionChangedHandler
0
;
if
(
)
{
=
;
descriptionChangedHandler
->
.
(
this
, &
::
OnCommandDescriptionChanged
);
}
();
}
}
*
::()
{
return
dynamic_cast
<
*>(
());
}
*
::()
{
if
(!
())
{
({});
}
return
dynamic_cast
<
*>(
());
}
void
::(
<
templates
::
> )
{
if
(!
)
{
auto
=
new
(
theme
::
::
,
this
);
if
(
)
{
newSubMenu
->
(
);
}
else
{
newSubMenu
->
(
TypedControlTemplateObject
(
true
)->
());
}
(
newSubMenu
,
true
);
}
}
*
::
(
const
&
)
{
if
(
==
IToolstripUpdateLayoutInvoker
::
)
{
return
(
IToolstripUpdateLayoutInvoker
*)
this
;
}
else
{
return
::
(
);
}
}
void
GuiToolstripNestedContainer
::
()
{
if
(
&&
!=
this
)
{
->
();
}
}
void
GuiToolstripNestedContainer
::
(
*
)
{
=
;
}
GuiToolstripNestedContainer
::
(
theme
::
)
:
(
)
{
}
GuiToolstripNestedContainer
::
()
{
}
*
GuiToolstripNestedContainer
::
(
const
&
)
{
if
(
==
IToolstripUpdateLayoutInvoker
::
)
{
return
(
IToolstripUpdateLayoutInvoker
*)
this
;
}
else
{
return
::
(
);
}
}
void
GuiToolstripGroupContainer
::
::
(
,
*
const
&
)
{
auto
=
->
->
()
*
2
];
CHECK_ERROR(controlStackItem->RemoveChild(child->GetBoundsComposition()), L"GuiToolstripGroupContainer::GroupCollection::BeforeRemove(vint, GuiControl* const&)#Internal error");
do
{
if
(!(
controlStackItem
->
(
->
())))
throw
(
L"GuiToolstripGroupContainer::GroupCollection::BeforeRemove(vint, GuiControl* const&)#Internal error"
);}
while
(
0
);
}
void
GuiToolstripGroupContainer
::
::
(
,
*
const
&
)
{
auto
=
new
;
->
()->
(
(
0
,
0
,
0
,
0
));
CHECK_ERROR(controlStackItem->AddChild(child->GetBoundsComposition()), L"GuiToolstripGroupContainer::GroupCollection::AfterInsert(vint, GuiControl* const&)#Internal error");
do
{
if
(!(
controlStackItem
->
(
->
())))
throw
(
L"GuiToolstripGroupContainer::GroupCollection::AfterInsert(vint, GuiControl* const&)#Internal error"
);}
while
(
0
);
if
(
->
->
().
() >
0
)
{
auto
=
new
;
auto
=
new
(
->
);
if
(
)
{
splitter
->
(
);
}
splitter
->
()->
(
(
0
,
0
,
0
,
0
));
splitterStackItem
->
(
splitter
->
());
->
->
(
==
0
?
0
:
*
2
-
1
,
splitterStackItem
);
}
->
->
(
*
2
,
controlStackItem
);
GuiToolstripCollectionBase
::
(
,
);
}
void
GuiToolstripGroupContainer
::
::
(
,
)
{
=
*
2
;
= (
+
-
1
) *
2
;
for
(
=
min
;
i
<=
max
;
i
++)
{
auto
=
->
->
()
min
];
->
->
(
stackItem
);
(
stackItem
);
}
GuiToolstripCollectionBase
::
(
,
);
}
GuiToolstripGroupContainer
::
::
(
GuiToolstripGroupContainer
*
)
:
GuiToolstripCollectionBase
(
)
, container(
)
{
}
GuiToolstripGroupContainer
::
::
()
{
}
GuiToolstripGroupContainer
::
ControlTemplatePropertyType
GuiToolstripGroupContainer
::
::
()
{
return
;
}
void
GuiToolstripGroupContainer
::
::
(
const
ControlTemplatePropertyType
&
)
{
;
();
}
void
GuiToolstripGroupContainer
::
::
()
{
auto
=
->
;
=
stack
->
().
();
for
(
=
1
;
i
<
count
;
i
+=
2
)
{
auto
=
stack
->
()
i
];
{
auto
=
stackItem
->
()
0
]->
();
CHECK_ERROR(control != nullptr, L"GuiToolstripGroupContainer::GroupCollection::RebuildSplitters()#Internal error");
do
{
if
(!(
control
!=
nullptr
))
throw
(
L"GuiToolstripGroupContainer::GroupCollection::RebuildSplitters()#Internal error"
);}
while
(
0
);
stackItem
->
(
control
->
());
delete
control
;
}
{
auto
=
new
(
->
);
if
(
)
{
control
->
(
);
}
control
->
()->
(
(
0
,
0
,
0
,
0
));
stackItem
->
(
control
->
());
}
}
}
void
GuiToolstripGroupContainer
::
()
{
auto
=
::
;
if
(
auto
=
<
>())
{
if
(
service
->
() ==
::
)
{
direction
=
::
;
}
}
if
(
direction
!=
->
())
{
if
(
direction
==
::
)
{
=
theme
::
::
;
}
else
{
=
theme
::
::
;
}
->
(
direction
);
();
();
}
::
();
}
GuiToolstripGroupContainer
::
(
theme
::
)
:
GuiToolstripNestedContainer
(
)
, splitterThemeName(
theme
::
::
)
{
=
new
;
->
(
::
);
->
(
(
0
,
0
,
0
,
0
));
->
(
::
LimitToElementAndChildren
);
->
(
);
new
(
this
);
}
GuiToolstripGroupContainer
::
()
{
}
GuiToolstripGroupContainer
::
ControlTemplatePropertyType
GuiToolstripGroupContainer
::
()
{
return
();
}
void
GuiToolstripGroupContainer
::
(
const
ControlTemplatePropertyType
&
)
{
(
);
}
collections
::
<
*>&
GuiToolstripGroupContainer
::
()
{
return
*
.
();
}
void
::
()
{
auto
=
::
;
if
(
auto
=
<
>())
{
if
(
service
->
() ==
::
)
{
direction
=
::
;
}
}
if
(
direction
!=
->
())
{
->
(
direction
);
();
}
::
();
}
::
(
theme
::
)
:
GuiToolstripNestedContainer
(
)
{
=
new
;
->
(
::
);
->
(
(
0
,
0
,
0
,
0
));
->
(
::
LimitToElementAndChildren
);
->
(
);
new
(
nullptr
,
);
}
::
()
{
}
collections
::
<
*>&
::
()
{
return
*
.
();
}
}
}
}