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