CtrlRetriever
Using CtrlRetriever to edit C++ variables in dialog

main.cpp
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#define LAYOUTFILE <CtrlRetriever/CtrlRetriever.lay>
#include <CtrlCore/lay.h>
GUI_APP_MAIN
{
String text = "Some text";
bool option = true;
WithCtrlRetrieverLayout<TopWindow> dlg;
CtrlLayoutOK(dlg, "CtrlRetriever example");
CtrlRetriever r;
r
(dlg.option, option)
(dlg.text, text)
;
dlg.Run();
r.Retrieve();
PromptOK(String().Cat() << "text: [* " << DeQtf(text) << "]&"
<< "option: [* " << (option ? "true" : "false"));
}
CtrlRetriever.lay
#ifdef LAYOUTFILE
LAYOUT(CtrlRetrieverLayout, 200, 88)
ITEM(Label, dv___0, SetLabel("Text").LeftPosZ(8, 32).TopPosZ(8, 19))
ITEM(EditString, text, LeftPosZ(44, 152).TopPosZ(8, 19))
ITEM(Option, option, SetLabel("Option").LeftPosZ(44, 108).TopPosZ(36, 15))
ITEM(Button, ok, SetLabel("OK").LeftPosZ(132, 64).TopPosZ(60, 24))
END_LAYOUT
#endif
|