added enable switch

This commit is contained in:
Peter Schojer 2008-09-11 12:15:11 +00:00
parent f0ffa66fc3
commit 8ff2f8f7e4
3 changed files with 31 additions and 7 deletions

View File

@ -88,6 +88,9 @@ void PanelRenderer::renderHead(const Renderable* pRenderable, const RenderContex
ostr << ",header:true,maximizable:true,collapsible:true";
else
ostr << ",header:false";
if (!pPanel->enabled())
ostr << ",disabled:true";
// a panel has exactly one child
// if this child is a layout we are fine otherwise we have to generate the items array

View File

@ -111,7 +111,9 @@ public:
bool showHeader() const;
/// Returns if the header of the Panel is shown
void enable(bool val);
bool enabled() const;
protected:
~Panel();
/// Destroys the Panel.
@ -122,6 +124,7 @@ private:
bool _modal;
bool _showCloseIcon;
bool _showHeader;
bool _enabled;
};
@ -195,6 +198,18 @@ inline bool Panel::showHeader() const
}
inline void Panel::enable(bool val)
{
_enabled = val;
}
inline bool Panel::enabled() const
{
return _enabled;
}
} } // namespace Poco::WebWidgets

View File

@ -47,7 +47,8 @@ Panel::Panel():
_title(),
_modal(false),
_showCloseIcon(true),
_showHeader(true)
_showHeader(true),
_enabled(true)
{
}
@ -58,7 +59,8 @@ Panel::Panel(const std::string& name):
_title(),
_modal(false),
_showCloseIcon(true),
_showHeader(true)
_showHeader(true),
_enabled(true)
{
}
@ -69,7 +71,8 @@ Panel::Panel(const std::string& name, const std::string& title):
_title(title),
_modal(false),
_showCloseIcon(true),
_showHeader(true)
_showHeader(true),
_enabled(true)
{
}
@ -80,7 +83,8 @@ Panel::Panel(View::Ptr pChild):
_title(),
_modal(false),
_showCloseIcon(true),
_showHeader(true)
_showHeader(true),
_enabled(true)
{
setChild(pChild);
}
@ -92,7 +96,8 @@ Panel::Panel(const std::string& name, View::Ptr pChild):
_title(),
_modal(false),
_showCloseIcon(true),
_showHeader(true)
_showHeader(true),
_enabled(true)
{
setChild(pChild);
}
@ -104,7 +109,8 @@ Panel::Panel(const std::string& name, const std::string& title, View::Ptr pChild
_title(title),
_modal(false),
_showCloseIcon(true),
_showHeader(true)
_showHeader(true),
_enabled(true)
{
setChild(pChild);
}