Skip to content

Instantly share code, notes, and snippets.

@Appendme

Appendme/gui.cpp Secret

Created September 14, 2019 16:40
Show Gist options
  • Save Appendme/7500f1bf52e34bf82a49e52e2e15f755 to your computer and use it in GitHub Desktop.
Save Appendme/7500f1bf52e34bf82a49e52e2e15f755 to your computer and use it in GitHub Desktop.
struct TAIMPUIControlPlacement
{
TAIMPUIControlPlacement()
: Alignment(ualNone)
, AlignmentMargins{}
, Anchors{}
, Bounds{}
{
}
TAIMPUIControlPlacement(
TAIMPUIControlAlignment Alignment,
int Size,
RECT AlignmentMargins = { 3, 3, 3, 3 })
: Alignment(Alignment)
, AlignmentMargins(AlignmentMargins)
, Anchors({ 1, 1, 0, 0 })
, Bounds({})
{
if (Alignment == ualClient ||
Alignment == ualTop ||
Alignment == ualBottom)
Bounds.bottom = Size;
if (Alignment == ualClient ||
Alignment == ualLeft ||
Alignment == ualRight)
Bounds.right = Size;
}
TAIMPUIControlPlacement(
TAIMPUIControlAlignment Alignment,
RECT Bounds,
RECT AlignmentMargins = { 3, 3, 3, 3 })
: Alignment(Alignment)
, AlignmentMargins(AlignmentMargins)
, Anchors({ 1, 1, 0, 0 })
, Bounds(Bounds)
{
}
TAIMPUIControlPlacement(
RECT Bounds,
RECT Anchors = { 1, 1, 0, 0 })
: Alignment(ualNone)
, AlignmentMargins({ 3, 3, 3, 3 })
, Anchors(Anchors)
, Bounds(Bounds)
{
}
TAIMPUIControlAlignment Alignment;
RECT AlignmentMargins;
RECT Anchors;
RECT Bounds;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment