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  查看評論
本站公眾號
   歡迎關注本站公眾號,獲取更多信息