Wt::WCompositeWidget

来自:http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WCompositeWidget.html#_details

A widget that hides the implementation of composite widgets.

WCompositeWidget 隐藏了各构成 widget 的具体实现。

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会是WContainerWidgetWTable,再或者是其余的容许复合操做的 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_;
};

CSS

Styling through CSS is propagated to its implementation.this


类别: c++witty  查看评论
本站公众号
   欢迎关注本站公众号,获取更多信息