#include "GuiTextControls.h"
#include "../../GraphicsComposition/GuiGraphicsTableComposition.h"
namespace
{
namespace
{
namespace
{
using
namespace
elements
;
using
namespace
elements
::
text
;
using
namespace
compositions
;
using
namespace
collections
;
::
TextElementOperatorCallback
::
TextElementOperatorCallback
(
*
)
:
GuiTextBoxCommonInterface
::
(
->
,
->
)
,textControl(
)
{
}
void
::
TextElementOperatorCallback
::
(
,
,
const
&
,
,
,
const
&
)
{
->
();
}
void
::
TextElementOperatorCallback
::
(
)
{
.
+=
;
.
+=
;
=
->
();
=
0
;
=
0
;
if
(
oldPoint
.
<
.
)
{
marginX
=
;
}
else
if
(
oldPoint
.
>
.
)
{
marginX
=-
;
}
if
(
oldPoint
.
<
.
)
{
marginY
=
;
}
else
if
(
oldPoint
.
>
.
)
{
marginY
=-
;
}
->
(
(
.
+
marginX
,
.
+
marginY
));
}
::
TextElementOperatorCallback
::
()
{
return
;
}
::
::
(
*
)
:textBox(
)
{
}
::
::
()
{
}
void
::
::
(
const
&
)
{
->
(
);
}
void
::
BeforeControlTemplateUninstalled_
()
{
auto
=
TypedControlTemplateObject
(
false
);
if
(!
ct
)
return
;
ct
->
(
nullptr
);
}
void
::
AfterControlTemplateInstalled_
(
bool
)
{
auto
=
TypedControlTemplateObject
(
true
);
<
>
(
1
);
colors
0
]
ct
->
();
->
(
colors
);
->
(
ct
->
());
ct
->
(
.
());
}
void
::
()
{
::
();
->
(
());
}
void
::
()
{
::
();
->
(
());
CalculateViewAndSetScroll
();
}
void
::
(
elements
::
*
)
{
CalculateViewAndSetScroll
();
::
(
);
}
::
()
{
&
=
->
();
return
(
lines
.
() +
*
2
,
lines
.
() +
*
2
);
}
void
::
(
)
{
->
(
.
()
(
,
));
}
void
::
CalculateViewAndSetScroll
()
{
auto
=
TypedControlTemplateObject
(
true
);
();
=
->
().
();
=
smallMove
*
5
;
if
(
auto
=
ct
->
())
{
scroll
->
(
smallMove
);
scroll
->
(
bigMove
);
}
if
(
auto
=
ct
->
())
{
scroll
->
(
smallMove
);
scroll
->
(
bigMove
);
}
}
void
::
(
compositions
::
*
,
compositions
::
&
)
{
if
(
())
{
();
}
}
::
(
theme
::
)
:
(
)
{
=
::
();
->
(
());
=
new
;
->
(
(
0
,
0
,
0
,
0
));
->
(
);
->
(
);
new
TextElementOperatorCallback
(
this
);
new
(
this
);
(
true
);
(
);
(
,
,
this
,
,
);
(
.
());
->
()->
.
(
this
, &
::
);
->
()->
.
(
this
, &
::
);
->
()->
.
(
this
, &
::
);
}
::
()
{
}
const
&
::
()
{
->
().
();
return
;
}
void
::
(
const
&
)
{
(
);
->
(
(
0
,
0
));
->
(
(
0
,
0
));
();
}
::
TextElementOperatorCallback
::
TextElementOperatorCallback
(
*
)
:
GuiTextBoxCommonInterface
::
(
->
,
->
)
{
}
bool
::
TextElementOperatorCallback
::
(
,
,
const
&
,
&
)
{
=
.
();
const
wchar_t
*
=
.
();
for
(
=
0
;
i
<
length
;
i
++)
{
if
(*
input
==
0
|| *
input
==
L'\r'
|| *
input
==
L'\n'
)
{
length
=
i
;
break
;
}
}
if
(
length
!=
.
())
{
if
(
length
==
0
)
{
return
false
;
}
.
(
length
);
}
return
true
;
}
void
::
TextElementOperatorCallback
::
(
,
,
const
&
,
,
,
const
&
)
{
}
void
::
TextElementOperatorCallback
::
(
)
{
=
.
;
=
->
().
;
=
0
;
if
(
oldX
<
newX
)
{
marginX
=
;
}
else
if
(
oldX
>
newX
)
{
marginX
=-
;
}
newX
+=
marginX
;
=-
;
=
->
().
()+
-
->
().
();
if
(
newX
>=
maxX
)
{
newX
=
maxX
-
1
;
}
if
(
newX
<
minX
)
{
newX
=
minX
;
}
->
(
(
newX
, -
));
}
::
TextElementOperatorCallback
::
()
{
return
;
}
void
::
BeforeControlTemplateUninstalled_
()
{
}
void
::
AfterControlTemplateInstalled_
(
bool
)
{
auto
=
TypedControlTemplateObject
(
true
);
<
>
(
1
);
colors
0
]
ct
->
();
->
(
colors
);
->
(
ct
->
());
}
void
::
()
{
::
();
->
(
());
}
void
::
()
{
::
();
->
(
());
();
}
void
::
()
{
->
(
1
,
::
(
->
().
() +
2
*
)
);
}
void
::
(
elements
::
*
)
{
::
(
);
();
}
void
::
(
compositions
::
*
,
compositions
::
&
)
{
if
(
())
{
();
}
}
::
(
theme
::
)
:
(
)
{
=
::
();
->
(
());
->
(
(-
::
, -
::
));
=
new
;
->
(
::
LimitToElementAndChildren
);
->
(
(
0
,
0
,
0
,
0
));
->
(
3
,
1
);
->
(
0
,
::
(
0.5
));
->
(
1
,
::
(
0
));
->
(
2
,
::
(
0.5
));
->
(
0
,
::
(
1.0
));
->
(
);
=
new
;
->
(
);
->
(
);
->
(
1
,
0
,
1
,
1
);
new
TextElementOperatorCallback
(
this
);
(
true
);
(
);
(
,
,
this
,
,
);
(
.
());
->
()->
.
(
this
, &
::
);
->
()->
.
(
this
, &
::
);
->
()->
.
(
this
, &
::
);
}
::
()
{
}
const
&
::
()
{
->
().
();
return
;
}
void
::
(
const
&
)
{
(
);
->
(
(
0
,
0
));
->
(
(
0
,
0
));
}
wchar_t
::
()
{
return
->
();
}
void
::
(
wchar_t
)
{
->
(
);
}
}
}
}