webengine/osswebengine/WebKit/s60/misc/WebUtil.cpp
changeset 15 60c5402cb945
parent 10 a359256acfc6
child 38 4917f9bf7995
equal deleted inserted replaced
11:c8a366e56285 15:60c5402cb945
   746         	}
   746         	}
   747 
   747 
   748         	//scroll only for the list which is either multiple or single but with more than one lines
   748         	//scroll only for the list which is either multiple or single but with more than one lines
   749             if (isScrollList) {
   749             if (isScrollList) {
   750                 RenderListBox* render = static_cast<RenderListBox*>(e->renderer());
   750                 RenderListBox* render = static_cast<RenderListBox*>(e->renderer());
   751                 if (render->isScrollable()) {
   751                 
   752                     HTMLSelectElement* selectElement = static_cast<HTMLSelectElement*>( e );
   752                     HTMLSelectElement* selectElement = static_cast<HTMLSelectElement*>( e );
   753                     IntRect r = e->getRect();
   753                     IntRect r = e->getRect();
   754                     int curIndex = render->listIndexAtOffset(point.x() - r.x(), point.y() - r.y());
   754                     int curIndex = render->listIndexAtOffset(point.x() - r.x(), point.y() - r.y());
   755                     int topIndex = render->indexOffset();
   755                     int topIndex = render->indexOffset();
   756                     int bottomIndex = topIndex + selectElement->size() - 1;
   756                     int bottomIndex = topIndex + render->getSize() - 1;
   757                     TPoint curPointInSelectBox(point.x() - r.x(), point.y() - r.y());
   757                     TPoint curPointInSelectBox(point.x() - r.x(), point.y() - r.y());
   758                     IntRect itemRect = render->itemRect(0, 0, curIndex);
   758                     IntRect itemRect = render->itemRect(0, 0, curIndex);
   759                     int centerOfRect = itemRect.y() + (itemRect.height() * 1) / 4;
   759                     int centerOfRect = itemRect.y() + (itemRect.height() * 1) / 4;
   760                     if (tb == -1) {
   760                     if (tb == -1) {
   761                         if (curIndex == topIndex) {
   761                         if (curIndex == topIndex) {
   783                             TPoint tp(StaticObjectsContainer::instance()->webCursor()->position().iX, StaticObjectsContainer::instance()->webCursor()->position().iY + step);
   783                             TPoint tp(StaticObjectsContainer::instance()->webCursor()->position().iX, StaticObjectsContainer::instance()->webCursor()->position().iY + step);
   784                             StaticObjectsContainer::instance()->webCursor()->updatePositionAndElemType(tp);
   784                             StaticObjectsContainer::instance()->webCursor()->updatePositionAndElemType(tp);
   785                             ret = true;
   785                             ret = true;
   786                         }
   786                         }
   787                     }
   787                     }
   788                 }//isScrollable()
   788                 
   789             }//isScrollList
   789             }//isScrollList
   790         } //isControl
   790         } //isControl
   791     } //focusedElementType()
   791     } //focusedElementType()
   792 
   792 
   793     return ret;
   793     return ret;