UI-Coordinates: DSL draft (WIP)

This commit is contained in:
Fischlurch 2017-09-14 22:24:54 +02:00
parent afda9e0a69
commit ff1b22a889
2 changed files with 29 additions and 1 deletions

View file

@ -28,6 +28,7 @@
#include "lib/test/run.hpp"
//#include "lib/test/test-helper.hpp"
#include "gui/interact/view-spec-dsl.hpp"
#include "gui/interact/ui-coord.hpp"
//#include "lib/idi/entry-id.hpp"
//#include "lib/diff/gen-node.hpp"
//#include "lib/util.hpp"
@ -83,6 +84,30 @@ namespace test {
void
verify_standardUsage()
{
using LocSpec = Spec<UICoord()>;
using CntSpec = Spec<UICoord(UICoord)>;
uint allocCounter = 0;
LocSpec::Builder<string> locationToken =[&](string pathElm)
{
return [pathElm]()
{
return UICoord::currentWindow().view(pathElm);
};
};
CntSpec::Builder<uint> allocationToken =[&](uint limit)
{
return [&,limit](UICoord target)
{
if (allocCounter < target)
return UICoord::currentWindow().view(pathElm).elm(++allocCounter);
else
return UICoord::currentWindow().view(pathElm).elm(limit);
};
};
UNIMPLEMENTED ("demonstrate the standard usage pattern");
}

View file

@ -3654,7 +3654,7 @@
</node>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1504479933641" ID="ID_686917529" MODIFIED="1504961932714" TEXT="DSL">
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1504479933641" ID="ID_686917529" MODIFIED="1505415912510" TEXT="DSL">
<cloud COLOR="#dac6a1"/>
<linktarget COLOR="#5e819b" DESTINATION="ID_686917529" ENDARROW="Default" ENDINCLINATION="-89;-122;" ID="Arrow_ID_1067086551" SOURCE="ID_1397553997" STARTARROW="None" STARTINCLINATION="-322;62;"/>
<icon BUILTIN="idea"/>
@ -3847,6 +3847,9 @@
<node CREATED="1504886010442" ID="ID_1660557914" MODIFIED="1504886017533" TEXT="panel has group"/>
</node>
</node>
<node CREATED="1505420642387" ID="ID_9234158" MODIFIED="1505420664306" TEXT="UI-Koordinaten Builder-DSL">
<icon BUILTIN="idea"/>
</node>
</node>
</node>
<node CREATED="1504886210096" ID="ID_1980896942" MODIFIED="1504886216139" TEXT="locate -&gt;">