mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-31 22:45:36 +01:00
fixes to img class
This commit is contained in:
parent
30e0ed3dd2
commit
8fbff94a54
@ -39,6 +39,7 @@
|
|||||||
#include "Poco/WebWidgets/ExtJS/Utility.h"
|
#include "Poco/WebWidgets/ExtJS/Utility.h"
|
||||||
#include "Poco/WebWidgets/ImageButtonCell.h"
|
#include "Poco/WebWidgets/ImageButtonCell.h"
|
||||||
#include "Poco/WebWidgets/ImageButton.h"
|
#include "Poco/WebWidgets/ImageButton.h"
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
@ -88,18 +89,22 @@ void ImageButtonCellRenderer::renderHead(const Renderable* pRenderable, const Re
|
|||||||
|
|
||||||
void ImageButtonCellRenderer::writeHTML(const ImageButtonCell* pButtonCell, bool showTxt, std::ostream& ostr)
|
void ImageButtonCellRenderer::writeHTML(const ImageButtonCell* pButtonCell, bool showTxt, std::ostream& ostr)
|
||||||
{
|
{
|
||||||
Image::Ptr ptrImg = pButtonCell->getImage();
|
Image::Ptr pImg = pButtonCell->getImage();
|
||||||
const Poco::WebWidgets::ImageButton* pOwner = static_cast<const Poco::WebWidgets::ImageButton*>(pButtonCell->getOwner());
|
const Poco::WebWidgets::ImageButton* pOwner = static_cast<const Poco::WebWidgets::ImageButton*>(pButtonCell->getOwner());
|
||||||
poco_check_ptr (pOwner);
|
poco_check_ptr (pOwner);
|
||||||
|
if (pOwner->hasClass())
|
||||||
|
ostr << "'<div class=\"" << Utility::safe(pOwner->getClass()) << "\">";
|
||||||
ostr << "'<div>";
|
ostr << "'<div>";
|
||||||
ostr << "<div><center>";
|
ostr << "<div><center>";
|
||||||
ostr << "<input src=\"" << Utility::safe(ptrImg->getURI().toString()) << "\"";
|
ostr << "<input src=\"" << Utility::safe(pImg->getURI().toString()) << "\"";
|
||||||
if (!pOwner->getName().empty())
|
if (!pOwner->getName().empty())
|
||||||
ostr << " name=\"" << pOwner->getName() << "\"";
|
ostr << " name=\"" << pOwner->getName() << "\"";
|
||||||
if (pOwner->getWidth() > 0)
|
if (pOwner->getWidth() > 0)
|
||||||
ostr << " width=\"" << pOwner->getWidth() << "\"";
|
ostr << " width=\"" << pOwner->getWidth() << "\"";
|
||||||
if (pOwner->getHeight() > 0)
|
if (pOwner->getHeight() > 0)
|
||||||
ostr << " height=\"" << pOwner->getHeight() << "\"";
|
ostr << " height=\"" << pOwner->getHeight() << "\"";
|
||||||
|
if (pImg->hasClass())
|
||||||
|
ostr << " class=\"" << pImg->getClass() << "\"";
|
||||||
std::string tooltip = pOwner->getToolTip();
|
std::string tooltip = pOwner->getToolTip();
|
||||||
if (!tooltip.empty())
|
if (!tooltip.empty())
|
||||||
ostr << " alt=\"" << Utility::safe(tooltip) << "\"";
|
ostr << " alt=\"" << Utility::safe(tooltip) << "\"";
|
||||||
@ -107,8 +112,10 @@ void ImageButtonCellRenderer::writeHTML(const ImageButtonCell* pButtonCell, bool
|
|||||||
if (pOwner->buttonClicked.hasJavaScriptCode())
|
if (pOwner->buttonClicked.hasJavaScriptCode())
|
||||||
{
|
{
|
||||||
ostr << " onclick=\"";
|
ostr << " onclick=\"";
|
||||||
|
std::ostringstream str;
|
||||||
//FIXME: this will only work without params!
|
//FIXME: this will only work without params!
|
||||||
Utility::writeFunctionCode(ostr, "fct", pOwner->buttonClicked, &ButtonCellRenderer::createClickServerCallback, pOwner);
|
Utility::writeFunctionCode(str, "fct", pOwner->buttonClicked, &ButtonCellRenderer::createClickServerCallback, pOwner);
|
||||||
|
ostr << Utility::safe(str.str());
|
||||||
ostr << "\"";
|
ostr << "\"";
|
||||||
}
|
}
|
||||||
ostr << " type=\"image\"/>";
|
ostr << " type=\"image\"/>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user