/usr/include/Wt/Ext/Splitter is in libwtext-dev 3.3.4+dfsg-6ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef EXT_SPLITTER_H_
#define EXT_SPLITTER_H_
#include <Wt/WContainerWidget>
#include <Wt/Ext/ExtDllDefs.h>
namespace Wt {
class WTable;
class WTableCell;
namespace Ext {
class SplitterHandle;
/*! \class Splitter Wt/Ext/Splitter Wt/Ext/Splitter
* \brief A container widget with resize handles between its children.
*
* Provides a container in which widgets are laid out either
* horizontally (side by side, Horizontal orientation), or vertically
* (Vertical orientation).
*
* Widgets are separated by a SplitterHandle which the user may use to
* resize widgets. For this to work properly, you need to properly specify
* widths, and minimum- and maximum widths for the widgets:
*
* <ul>
* <li>They MUST have their width (or height) set using WWidget::resize(),
* in WLength::Pixel units. You cannot specify the size through CSS!</li>
*
* <li>Optionally, the may have a minimum width (or minimum height)
* set using WWidget::setMinimumSize() and
* WWidget::setMaximumSize(). Again, you cannot specify these
* properties through CSS!</li>
*
* <li>Probably you will want to insert each widget in a WScrollArea, or
* set the CSS overflow attribute to hidden (which clips anything that
* goes outside) or auto (to add scroll bars).</li>
* </ul>
*
* <i>Note: removing or adding widgets after initial render is not yet
* supported.</i>
*
* \ingroup ext
*/
class WT_EXT_API Splitter : public WContainerWidget
{
public:
/*! \brief Create a new horizontal splitter.
*/
Splitter(WContainerWidget *parent = 0);
/*! \brief Create a new splitter with the given orientation.
*/
Splitter(Orientation orientation, WContainerWidget *parent = 0);
/*! \brief Set the orientation.
*/
void setOrientation(Orientation orientation);
/*! \brief Return the orientation.
*/
Orientation orientation() const { return orientation_; }
/*! \brief Set the width of the resize handles (in pixels).
*
* The default width is 4 pixels.
*
* \sa handleWidth()
*/
void setHandleWidth(int width);
/*! \brief Return the width of the resize handles.
*
* The default width is 4 pixels.
*
* \sa setHandleWidth()
*/
int handleWidth() const { return handleWidth_; }
/*! \brief Returns the handle to the left (or above) the widget at
* the given <i>index</i>.
*
* There is no handle to the left of the widget at index 0, and 0 will
* be returned.
*/
SplitterHandle *handle(int index) const;
virtual void addWidget(WWidget *widget);
virtual void insertWidget(int index, WWidget *widget);
virtual void insertBefore(WWidget *widget, WWidget *before);
const std::vector<WWidget *>& children() const { return children_; }
private:
Orientation orientation_;
WContainerWidget *container_;
std::vector<WWidget *> children_;
std::vector<SplitterHandle *> handles_;
int handleWidth_;
virtual DomElement *createDomElement(WApplication *app);
void insertHandle(int index);
void deleteHandle(int index);
WWidget *widgetBefore(const SplitterHandle *handle) const;
WWidget *widgetAfter(const SplitterHandle *handle) const;
SplitterHandle *splitterBefore(const SplitterHandle *handle) const;
SplitterHandle *splitterAfter(const SplitterHandle *handle) const;
friend class SplitterHandle;
};
}
}
#endif // EXT_SPLITTER_H_
|