Would you like fries with that?

I completly rewrote the popup text window API today to be much more C++ey, and with it come a few new widgets that can be placed inside: radio buttons and checkboxes.

The title area at the top now shows tooltips, too, like the original ZZT:

The code to construct the above window is:

TUIWindow w("Options");
w.addWidget(new TUILabel("General"));
w.addWidget(new TUIWidget());
TUIRadioGroup *sfx = new TUIRadioGroup("Sound:         ");
sfx->add("On");
sfx->add("Off");
w.addWidget(sfx);
TUIRadioGroup *web = new TUIRadioGroup("Online scores: ");
web->add("On");
web->add("Off");
w.addWidget(web);
w.addWidget(new TUIWidget());	
w.addWidget(new TUILabel("Special Effects"));
w.addWidget(new TUIWidget());
w.addWidget(new TUICheckBox("Pan between boards"));
w.addWidget(new TUICheckBox("Torch gradient",true));
w.addWidget(new TUICheckBox("Animated water"));
w.addWidget(new TUIWidget());	
w.addWidget(new TUIHyperLink("save","Save settings"));
w.addWidget(new TUIHyperLink("cancel","Cancel"));

Much nicer. Of course, you can still construct a popup window the ZZT way:

w.buildFromString("$woah\r
this kind of thing gets hard to maintain\r
when it's all stuffed in a giant string\r
crazy ZZTers.\r
\r
!agree;I agree\r");

Though you can’t add radio buttons or checkboxes through that. After I finish up the text-editing widget, I’ll start working on adding a very basic level editor to DreamZZT.

This Post Has 3 Comments

    1. Yup, all over your friends page! pwnt! 🙂

  1. The word “widget” is funny.

    Kind of like “map”.

Comments are closed.

Close Menu