Composite widgets, built on top of the WebWidgets, should derive from this class, and use setImplementation() to set the widget that implements the composite widget (which is typically a WContainerWidget or a WTable, or another widget that allows composition, including perhaps another WCompositeWidget).html
〔复合 widget 创建在 WebWidget 之上,定义时应继承自 WCompositeWidget 类,并使用 setImplementation() 来告诉 这个复合widget去实现某个具体的widget,通常这个具体的widget会是WContainerWidget 或 WTable,再或者是其余的容许复合操做的 WCompositeWidget 实例。〕c++
Using this class you can completely hide the implementation of your composite widget, and provide access to only the standard WWidget methods.web
〔使用 WCompisteWidget,咱们可以彻底隐藏具体 widget 的实现,只经过标准的 WWidget 提供的接口来访问。〕ide
Usage example:ui
class MyWidget : public Wt::WCompositeWidget
{
public:
MyWidget(WContainerWidget *parent = 0)
: WCompositeWidget(parent)
// initialize members ...
{
setImplementation(impl_ = new WContainerWidget());
// further initialization code ...
}
private:
Wt::ContainerWidget *impl_;
};
Styling through CSS is propagated to its implementation.this