mirror of
				https://github.com/pocoproject/poco.git
				synced 2025-11-04 04:09:57 +01:00 
			
		
		
		
	added enable switch
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user