#include "GuiMenuControls.h"
#include "../../GraphicsHost/GuiGraphicsHost.h"
#include "../Templates/GuiThemeStyleFactory.h"
namespace
{
namespace
{
namespace
{
using
namespace
compositions
;
const
wchar_t
*
const
:: =
L"vl::presentation::controls::IGuiMenuService"
;
const
wchar_t
*
const
:: =
L"vl::presentation::controls::IGuiMenuDropdownProvider"
;
::()
:openingMenu(
0
)
{
}
void
::()
{
if
(
)
{
->
();
}
if
(
())
{
()->
();
}
}
*
::()
{
return
;
}
void
::(
* )
{
if
(
!=
&&
)
{
->
();
}
=
;
}
void
::(
* )
{
if
(
==
)
{
=
0
;
}
}
void
::()
{
}
void
::(
bool
)
{
}
*
::()
{
return
;
}
::
::()
{
return
::
;
}
bool
::()
{
return
true
;
}
bool
::()
{
return
false
;
}
void
::()
{
::
();
();
}
void
::(
& ,
bool
,
bool
)
{
::
(
,
,
);
if
(
)
{
if
(
auto
=
())
{
auto
=
.
();
auto
= (
nativeWindow
->
().
()
nativeWindow
->
());
auto
=
nativeWindow
->
(
preferredMenuClientSizeBeforeUpdating
)
nativeOffset
;
if
(
newSize
.
preferredNativeSize
.
)
newSize
.
preferredNativeSize
.
;
if
(
newSize
.
preferredNativeSize
.
)
newSize
.
preferredNativeSize
.
;
nativeWindow
->
(
newSize
nativeOffset
);
}
}
}
void
::(
,
)
{
auto
=
;
if
(
size
.
<
.
)
size
.
=
.
;
if
(
size
.
<
.
)
size
.
=
.
;
::
UpdateClientSizeAfterRendering
(
,
size
);
}
void
::(
compositions
::
* ,
compositions
::
& )
{
if
(
)
{
->
(
this
);
}
}
void
::()
{
if
(
)
{
();
}
::
();
}
void
::(
compositions
::
* ,
compositions
::
& )
{
if
(
)
{
->
(
this
);
* =
();
if
(
openingSubMenu
)
{
openingSubMenu
->
();
}
}
}
::(
theme
::
,
* )
:
(
,
::
)
, owner(
)
{
();
.
(
this
, &
::
);
.
(
this
, &
::
);
}
::()
{
}
void
::()
{
if
(
)
{
=
->
<
>();
}
}
*
::(
const
& )
{
if
(
==
::
)
{
return
(
*)
this
;
}
else
{
return
::
(
);
}
}
bool
::()
{
return
;
}
void
::(
bool
)
{
=
;
}
::()
{
return
;
}
void
::(
)
{
;
preferredMenuClientSizeBeforeUpdating
;
}
*
::()
{
return
0
;
}
::
::()
{
return
::
;
}
bool
::()
{
return
()!=
0
;
}
bool
::()
{
return
true
;
}
::(
theme
::
)
:
(
)
{
}
::()
{
}
*
::(
const
& )
{
if
(
==
::
)
{
return
(
*)
this
;
}
else
{
return
::
(
);
}
}
void
::()
{
auto
=
();
host
->
.
(
);
host
->
()->
()->
.
(
);
nullptr
;
nullptr
;
}
void
::(
bool
)
{
auto
=
TypedControlTemplateObject
(
true
);
auto
=
();
ct
->
(
());
ct
->
(
);
ct
->
(
);
ct
->
(
);
ct
->
(
!=
nullptr
);
host
->
.
(
this
, &
::
);
host
->
()->
()->
.
(
this
, &
::
);
}
*
::()
{
* =
TypedControlTemplateObject
(
true
)->
();
return
button
?
button
:
this
;
}
bool
::()
{
if
(!
())
{
if
(
)
{
* =
->
();
if
(
openingSiblingMenu
)
{
openingSiblingMenu
->
();
}
}
.
(
());
if
(
)
{
->
(
);
::
=
();
->
(
(),
direction
==
::
);
.
(
());
return
true
;
}
}
return
false
;
}
void
::()
{
::
();
=
<
>();
if
(
)
{
(!
->
IsSubMenuActivatedByMouseDown
());
}
if
(
)
{
->
();
}
}
compositions
::
*
::()
{
if
(
)
{
return
->
<
>();
}
else
{
return
::
();
}
}
void
::(
compositions
::
* ,
compositions
::
& )
{
.
(
());
TypedControlTemplateObject
(
true
)->
(
true
);
}
void
::(
compositions
::
* ,
compositions
::
& )
{
.
(
());
TypedControlTemplateObject
(
true
)->
(
false
);
}
void
::(
compositions
::
* ,
compositions
::
& )
{
if
(
())
{
if
(
&&
&&
->
())
{
();
}
}
}
void
::(
compositions
::
* ,
compositions
::
& )
{
if
(
())
{
if
(!
() &&
)
{
->
();
}
}
}
::
::()
{
return
?
->
():
::
;
}
void
::()
{
if
(
)
{
->
.
(
subMenuWindowOpenedHandler
);
->
.
(
subMenuWindowClosedHandler
);
subMenuWindowOpenedHandler
nullptr
;
subMenuWindowClosedHandler
nullptr
;
if
(
)
{
delete
;
}
}
}
*
::()
{
return
();
}
::(
theme
::
)
:
(
)
,subMenu(
0
)
,ownedSubMenu(
false
)
,ownerMenuService(
0
)
,cascadeAction(
true
)
{
(
false
);
.
(
);
.
(
);
.
(
);
.
(
);
.
(
);
}
::()
{
if
(!
|| !
())
{
();
}
}
<
>
::()
{
return
;
}
void
::(
<
> )
{
if
(
)
{
;
TypedControlTemplateObject
(
true
)->
(
);
.
(
());
}
}
<
>
::()
{
return
;
}
void
::(
<
> )
{
if
(
)
{
;
TypedControlTemplateObject
(
true
)->
(
);
.
(
());
}
}
const
&
::()
{
return
;
}
void
::(
const
& )
{
if
(
!=
)
{
;
TypedControlTemplateObject
(
true
)->
(
);
.
(
());
}
}
bool
::()
{
return
!=
0
;
}
*
::()
{
return
;
}
*
::(
<
templates
::
> )
{
if
(!
)
{
* =
new
(
theme
::
::
,
this
);
newSubMenu
->
(
?
:
TypedControlTemplateObject
(
true
)->
());
(
newSubMenu
,
true
);
}
return
;
}
void
::(
* ,
bool
)
{
if
(
)
{
();
nullptr
;
}
=
;
=
;
if
(
)
{
->
SetPreferredMenuClientSize
(
);
->
();
subMenuWindowOpenedHandler
->
.
(
this
, &
::
);
subMenuWindowClosedHandler
->
.
(
this
, &
::
);
}
TypedControlTemplateObject
(
true
)->
(
!=
nullptr
);
}
void
::()
{
if
(
)
{
();
=
0
;
=
false
;
TypedControlTemplateObject
(
true
)->
(
false
);
}
}
bool
::()
{
return
&&
;
}
bool
::()
{
if
(
)
{
return
->
();
}
else
{
return
false
;
}
}
void
::(
bool
)
{
if
(
&&
->
() !=
)
{
if
(
)
{
();
}
else
{
->
();
}
}
}
::()
{
return
;
}
void
::(
)
{
;
if
(
)
{
->
SetPreferredMenuClientSize
(
);
}
}
bool
::()
{
return
;
}
void
::(
bool
)
{
=
;
}
*
::(
const
& )
{
if
(
==
::
)
{
return
(
*)
this
;
}
else
{
return
::
(
);
}
}
}
}
}