various extensions

This commit is contained in:
Peter Schojer
2008-09-30 08:47:32 +00:00
parent 5c9977d79a
commit 8ae571b205
11 changed files with 153 additions and 25 deletions

View File

@@ -79,7 +79,9 @@ public:
/// Renders button properties
static Poco::WebWidgets::JSDelegate createSelectionChangedServerCallback(const ListBox* pList);
/// JS signature: function(dataView, selArray){
/// JS signature: function(multiselectObj, dataView, selArray, idxArray)
/// selArray contains the selected elements (selArray[i].viewIndex contains the index
/// idxArray is a compact string of all selected indizes (ie "3", "1,3,4"
static void onBeforeLoad(void* pSender, std::pair<ListBoxCell*, Poco::Net::HTTPServerResponse*>& ld);

View File

@@ -109,6 +109,8 @@ void FrameRenderer::writeProperties(const Frame* pFrame, std::ostream& ostr)
ostr << ",x:" << pFrame->getPosition().posX << ",y:" << pFrame->getPosition().posY;
if (pFrame->hasClass())
ostr << ",cls:'" << pFrame->getClass() << "'";
if (!pFrame->showBorder())
ostr << ",border:false,bodyBorder:false";
}

View File

@@ -95,10 +95,13 @@ void ListBoxCellRenderer::renderProperties(const ListBoxCell* pListBoxCell, std:
if (pOwner->hasPosition())
ostr << ",x:" << pOwner->getPosition().posX << ",y:" << pOwner->getPosition().posY;
if (!pListBoxCell->autoScroll())
ostr << ",autoScroll:false";
if (pList)
{
bool hasListeners = pList->selectionChanged.hasJavaScriptCode();
bool hasListeners = pList->selectionChanged.hasJavaScriptCode() || !pList->rowSelected.empty() || !pList->rowDeselected.empty();
if (hasListeners)
{
ostr << ",listeners:{";
@@ -157,9 +160,9 @@ void ListBoxCellRenderer::renderProperties(const ListBoxCell* pListBoxCell, std:
Poco::WebWidgets::JSDelegate ListBoxCellRenderer::createSelectionChangedServerCallback(const ListBox* pList)
{
// selectionchange : ( dataView, selArray )
static const std::string signature("function(view, sel)");
static const std::string signature("function(ms, v, s, idx)");
std::map<std::string, std::string> addParams;
addParams.insert(std::make_pair(ListBoxCell::ARG_ROW, "+sel.toString()"));
addParams.insert(std::make_pair(ListBoxCell::ARG_ROW, "+idx"));
addParams.insert(std::make_pair(RequestHandler::KEY_EVID, ListBoxCell::EV_SELECTIONCHANGED));
return Utility::createServerCallback(signature, addParams, pList->id(), pList->selectionChanged.getOnSuccess(), pList->selectionChanged.getOnFailure());
}

View File

@@ -155,6 +155,8 @@ void PanelRenderer::renderHeadWithoutChildren(const Panel* pPanel, const RenderC
if (!pPanel->enabled())
ostr << ",disabled:true";
if (!pPanel->showBorder())
ostr << ",border:false,bodyBorder:false";
ostr << "})";
}