extensions to frame

This commit is contained in:
Peter Schojer 2008-09-09 05:59:23 +00:00
parent ab06f0a999
commit 1fe9732a5c
4 changed files with 43 additions and 11 deletions

View File

@ -99,6 +99,8 @@ void FrameRenderer::writeProperties(const Frame* pFrame, std::ostream& ostr)
ostr << ",height:" << pFrame->getHeight(); ostr << ",height:" << pFrame->getHeight();
if (!pFrame->getTitle().empty()) if (!pFrame->getTitle().empty())
ostr << ",title:'" << pFrame->getTitle() << "'"; ostr << ",title:'" << pFrame->getTitle() << "'";
if (pFrame->collapsible())
ostr << ",collapsible:true";
} }

View File

@ -91,6 +91,12 @@ public:
const std::string& getTitle() const; const std::string& getTitle() const;
/// Returns the title of the Frame /// Returns the title of the Frame
void setCollapsible(bool val);
/// En/Disable collapsible
bool collapsible() const;
/// Returns collapsible property
protected: protected:
Frame(const std::type_info& type); Frame(const std::type_info& type);
@ -109,8 +115,9 @@ protected:
/// Destroys the Frame. /// Destroys the Frame.
private: private:
View::Ptr _pChild; View::Ptr _pChild;
std::string _title; std::string _title;
bool _collapsible;
}; };
@ -148,6 +155,18 @@ inline const std::string& Frame::getTitle() const
} }
inline void Frame::setCollapsible(bool val)
{
_collapsible = val;
}
inline bool Frame::collapsible() const
{
return _collapsible;
}
} } // namespace Poco::WebWidgets } } // namespace Poco::WebWidgets

View File

@ -44,7 +44,8 @@ namespace WebWidgets {
Frame::Frame(): Frame::Frame():
View(typeid(Frame)), View(typeid(Frame)),
_pChild(), _pChild(),
_title() _title(),
_collapsible(false)
{ {
} }
@ -52,7 +53,8 @@ Frame::Frame():
Frame::Frame(const std::string& name): Frame::Frame(const std::string& name):
View(name, typeid(Frame)), View(name, typeid(Frame)),
_pChild(), _pChild(),
_title() _title(),
_collapsible(false)
{ {
} }
@ -60,7 +62,8 @@ Frame::Frame(const std::string& name):
Frame::Frame(const std::string& name, const std::string& title): Frame::Frame(const std::string& name, const std::string& title):
View(name, typeid(Frame)), View(name, typeid(Frame)),
_pChild(), _pChild(),
_title(title) _title(title),
_collapsible(false)
{ {
} }
@ -68,7 +71,8 @@ Frame::Frame(const std::string& name, const std::string& title):
Frame::Frame(View::Ptr pChild): Frame::Frame(View::Ptr pChild):
View(typeid(Frame)), View(typeid(Frame)),
_pChild(), _pChild(),
_title() _title(),
_collapsible(false)
{ {
setChild(pChild); setChild(pChild);
} }
@ -77,7 +81,8 @@ Frame::Frame(View::Ptr pChild):
Frame::Frame(const std::string& name, View::Ptr pChild): Frame::Frame(const std::string& name, View::Ptr pChild):
View(name, typeid(Frame)), View(name, typeid(Frame)),
_pChild(), _pChild(),
_title() _title(),
_collapsible(false)
{ {
setChild(pChild); setChild(pChild);
} }
@ -86,7 +91,8 @@ Frame::Frame(const std::string& name, View::Ptr pChild):
Frame::Frame(const std::string& name, const std::string& title, View::Ptr pChild): Frame::Frame(const std::string& name, const std::string& title, View::Ptr pChild):
View(name, typeid(Frame)), View(name, typeid(Frame)),
_pChild(), _pChild(),
_title(title) _title(title),
_collapsible(false)
{ {
setChild(pChild); setChild(pChild);
} }
@ -95,7 +101,8 @@ Frame::Frame(const std::string& name, const std::string& title, View::Ptr pChild
Frame::Frame(const std::type_info& type): Frame::Frame(const std::type_info& type):
View(type), View(type),
_pChild(), _pChild(),
_title() _title(),
_collapsible(false)
{ {
} }
@ -103,7 +110,8 @@ Frame::Frame(const std::type_info& type):
Frame::Frame(const std::string& name, const std::type_info& type): Frame::Frame(const std::string& name, const std::type_info& type):
View(name, type), View(name, type),
_pChild(), _pChild(),
_title() _title(),
_collapsible(false)
{ {
} }
@ -111,7 +119,8 @@ Frame::Frame(const std::string& name, const std::type_info& type):
Frame::Frame(View::Ptr pChild, const std::type_info& type): Frame::Frame(View::Ptr pChild, const std::type_info& type):
View(type), View(type),
_pChild(), _pChild(),
_title() _title(),
_collapsible(false)
{ {
setChild(pChild); setChild(pChild);
} }
@ -120,7 +129,8 @@ Frame::Frame(View::Ptr pChild, const std::type_info& type):
Frame::Frame(const std::string& name, View::Ptr pChild, const std::type_info& type): Frame::Frame(const std::string& name, View::Ptr pChild, const std::type_info& type):
View(name, typeid(Frame)), View(name, typeid(Frame)),
_pChild(), _pChild(),
_title() _title(),
_collapsible(false)
{ {
setChild(pChild); setChild(pChild);
} }

View File

@ -174,6 +174,7 @@ void RequestHandler::handleAjaxRequest(Poco::Net::HTTPServerRequest& request, Po
it = args.begin(); it = args.begin();
RequestProcessor* pProc = _pApp->getAjaxProcessor(id); RequestProcessor* pProc = _pApp->getAjaxProcessor(id);
poco_assert_dbg (pProc);
if (!pProc) if (!pProc)
{ {
response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_INTERNAL_SERVER_ERROR, "no requestprocessor found"); response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_INTERNAL_SERVER_ERROR, "no requestprocessor found");