mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-20 14:02:38 +02:00
rendering fixes
This commit is contained in:
@@ -130,6 +130,7 @@ void PageRenderer::renderHead(const Renderable* pRenderable, const RenderContext
|
||||
ostr << "Ext.onReady(function() {";
|
||||
ostr << "var " << VAR_LOCALTMP << ";"; // tmp variable needed for table renderer
|
||||
ostr << "Ext.QuickTips.init();";
|
||||
ostr << "Ext.Ajax.timeout=60000;"; // increase the timeout to 60 secs
|
||||
ostr << "Ext.Ajax.on({'requestexception':function(conn, resp, obj){";
|
||||
ostr << "Ext.Msg.show({";
|
||||
ostr << "title:'Server Error',";
|
||||
|
@@ -63,7 +63,7 @@ void PanelRenderer::renderHead(const Renderable* pRenderable, const RenderContex
|
||||
ostr << "new Ext.Window({";
|
||||
|
||||
Utility::writeRenderableProperties(pRenderable, ostr);
|
||||
if (!pPanel->getName().empty())
|
||||
if (!pPanel->getName().empty() && pPanel->showHeader())
|
||||
ostr << ",title:'" << pPanel->getTitle() << "'";
|
||||
if (pPanel->getWidth() > 0)
|
||||
ostr << ",width:" << pPanel->getWidth();
|
||||
@@ -82,7 +82,11 @@ void PanelRenderer::renderHead(const Renderable* pRenderable, const RenderContex
|
||||
|
||||
// minimizable set to true only fires a minimize event, without an event handler attached
|
||||
// it is pretty useless, instead use collapsible
|
||||
if (pPanel->showHeader())
|
||||
ostr << ",header:true,maximizable:true,collapsible:true";
|
||||
else
|
||||
ostr << ",header:false";
|
||||
|
||||
// a panel has exactly one child
|
||||
// if this child is a layout we are fine otherwise we have to generate the items array
|
||||
View::Ptr pChild = pPanel->getChild();
|
||||
|
@@ -83,6 +83,8 @@ void TextFieldCellRenderer::writeCellProperties(const TextFieldCell* pCell, std:
|
||||
{
|
||||
Utility::writeCellProperties(pCell, ostr);
|
||||
|
||||
ostr << ",selectOnFocus:true";
|
||||
|
||||
if (writeValue&& !pCell->getValue().empty())
|
||||
{
|
||||
ostr << ",value:'" << Utility::safe(pCell->getString()) << "'";
|
||||
|
@@ -60,6 +60,7 @@
|
||||
#include "Poco/WebWidgets/ExtJS/TabViewRenderer.h"
|
||||
#include "Poco/WebWidgets/ExtJS/ListBoxCellRenderer.h"
|
||||
#include "Poco/WebWidgets/ExtJS/TableRenderer.h"
|
||||
#include "Poco/WebWidgets/ExtJS/ProgressIndicatorRenderer.h"
|
||||
|
||||
#include "Poco/WebWidgets/Label.h"
|
||||
#include "Poco/WebWidgets/Page.h"
|
||||
@@ -90,6 +91,7 @@
|
||||
#include "Poco/WebWidgets/Table.h"
|
||||
#include "Poco/WebWidgets/WebApplication.h"
|
||||
#include "Poco/WebWidgets/RequestHandler.h"
|
||||
#include "Poco/WebWidgets/ProgressIndicator.h"
|
||||
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/StringTokenizer.h"
|
||||
@@ -131,6 +133,7 @@ void Utility::initialize(LookAndFeel::Ptr ptr)
|
||||
ptr->registerRenderer(typeid(Image), new ImageRenderer());
|
||||
ptr->registerRenderer(typeid(TabView), new TabViewRenderer());
|
||||
ptr->registerRenderer(typeid(Table), new TableRenderer());
|
||||
ptr->registerRenderer(typeid(ProgressIndicator), new ProgressIndicatorRenderer());
|
||||
}
|
||||
|
||||
|
||||
|
@@ -105,6 +105,12 @@ public:
|
||||
const std::string& getTitle() const;
|
||||
/// Returns the title of this View.
|
||||
|
||||
void showHeader(bool show);
|
||||
/// Shows the header of the Panel
|
||||
|
||||
bool showHeader() const;
|
||||
/// Returns if the header of the Panel is shown
|
||||
|
||||
|
||||
protected:
|
||||
~Panel();
|
||||
@@ -115,6 +121,7 @@ private:
|
||||
std::string _title;
|
||||
bool _modal;
|
||||
bool _showCloseIcon;
|
||||
bool _showHeader;
|
||||
};
|
||||
|
||||
|
||||
@@ -176,6 +183,18 @@ inline const std::string& Panel::getTitle() const
|
||||
}
|
||||
|
||||
|
||||
inline void Panel::showHeader(bool show)
|
||||
{
|
||||
_showHeader = show;
|
||||
}
|
||||
|
||||
|
||||
inline bool Panel::showHeader() const
|
||||
{
|
||||
return _showHeader;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::WebWidgets
|
||||
|
||||
|
||||
|
@@ -46,7 +46,8 @@ Panel::Panel():
|
||||
_pChild(),
|
||||
_title(),
|
||||
_modal(false),
|
||||
_showCloseIcon(true)
|
||||
_showCloseIcon(true),
|
||||
_showHeader(true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -56,7 +57,8 @@ Panel::Panel(const std::string& name):
|
||||
_pChild(),
|
||||
_title(),
|
||||
_modal(false),
|
||||
_showCloseIcon(true)
|
||||
_showCloseIcon(true),
|
||||
_showHeader(true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -66,7 +68,8 @@ Panel::Panel(const std::string& name, const std::string& title):
|
||||
_pChild(),
|
||||
_title(title),
|
||||
_modal(false),
|
||||
_showCloseIcon(true)
|
||||
_showCloseIcon(true),
|
||||
_showHeader(true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -76,7 +79,8 @@ Panel::Panel(View::Ptr pChild):
|
||||
_pChild(),
|
||||
_title(),
|
||||
_modal(false),
|
||||
_showCloseIcon(true)
|
||||
_showCloseIcon(true),
|
||||
_showHeader(true)
|
||||
{
|
||||
setChild(pChild);
|
||||
}
|
||||
@@ -87,7 +91,8 @@ Panel::Panel(const std::string& name, View::Ptr pChild):
|
||||
_pChild(),
|
||||
_title(),
|
||||
_modal(false),
|
||||
_showCloseIcon(true)
|
||||
_showCloseIcon(true),
|
||||
_showHeader(true)
|
||||
{
|
||||
setChild(pChild);
|
||||
}
|
||||
@@ -98,7 +103,8 @@ Panel::Panel(const std::string& name, const std::string& title, View::Ptr pChild
|
||||
_pChild(),
|
||||
_title(title),
|
||||
_modal(false),
|
||||
_showCloseIcon(true)
|
||||
_showCloseIcon(true),
|
||||
_showHeader(true)
|
||||
{
|
||||
setChild(pChild);
|
||||
}
|
||||
|
Reference in New Issue
Block a user