Skip navigation.
Home
l'art pour l'art

mark's blog

It's Roberts A. Heinleins 100th birthday!

Today is Robert A. Heinlein's 100th birthday!

TOAD: Lambda functions and closures are now part of C++0x

See all entries for

I just read that Lambda functions and closures are now part of C++0x. Once The GNU C++ Compiler supports these, I will redesign the current CPP+Signal'n Slots based closure syntax.

This means that

TCLOSURE2(
  slider,sigChanged,
  _this, this,
  _slider, slider,
  _this->setValue(_slider->getValue());
)

is going to look like

slider->sigChanged->connect([] { this->setValue(slider->getValue()); });

in the future.

TOAD: TModelLayout

See all entries for

Whew! After letting TOAD rest for about six months, there are finally some new commits. TModelLayout is now able to restore itself from a file and I've fixed some minor issues with TPen::setFont and vertical scrolling in TTextArea.

Happy 2008

TOAD: TModelLayout

See all entries for

I began implementing the new dialog editor, TModelLayout in examples/modellayout/. The screen shot below shows the layout editor on the left. On the top are the usual drawing tools. At the bottom are two lists. The first shows the models registered for the dialog, the second shows the widgets which can handle the selected model. The Add Widget button will add the selected widget to the dialog window, where it can be moved and resized with the Select Tool. On the right you see a simple dialog which I created with the layout editor.
(To start the layout editor, the program on the right has to be compiled and run with the option '--layout-editor' as usual.)

class TMyDialog: public TDialog
{
    TIntegerModel age;
    TFloatModel weight;
    TTextModel name;
    TBoolModel married;
  public:
    TMyDialog(TWindow *p, const string &t);
};
 
TMyDialog::TMyDialog(TWindow *p, const string &t): TDialog(p, t)
{
  TModelLayout *layout = new TModelLayout("TDialogLayout.atv");
  layout->addModel(&age,     "age");
  layout->addModel(&weight,  "weight");
  layout->addModel(&name,    "name");
  layout->addModel(&married, "married");
  setLayout(layout);
}

While I wrote the new layout class, I finally decided that the TTable classes needs to be improved as it is really no fun to use them.
I have also incorporated more code for the Cocoa (Mac OS X) port. It is still unusable but the compiles now.