this.children.setVerticalDimensions( clipY, clipY + clipHeight );
	public void paintContent(int x, int y, int leftBorder, int rightBorder, Graphics g) {		// TODO robertvirkus adjust yOffset when childIndicatorHeight > contentHeight		super.paintContent(x, y, leftBorder, rightBorder, g);		//		if (this.isFocused) {//			System.out.println( this + ": backgroundYOffset=" + this.backgroundYOffset);//		}		if (this.hasChildren) {			// paint child indicator			//rightBorder -= this.childIndicatorWidth;			//#if polish.css.command-child-indicator				if (this.childIndicator != null) {					g.drawImage( this.childIndicator, rightBorder, y, Graphics.TOP | Graphics.RIGHT );				} else {			//#endif					//#if polish.css.command-child-indicator-color						if ( this.childIndicatorColor != -1 ) {							g.setColor( this.childIndicatorColor );													}					//#endif					x = rightBorder - this.childIndicatorWidth;					int indicatorY = y + this.childIndicatorYOffset;					//#if polish.midp2						g.fillTriangle(x, indicatorY, rightBorder, indicatorY + this.childIndicatorHeight/2, x, indicatorY + this.childIndicatorHeight );					//#else						g.drawLine( x, indicatorY, rightBorder, indicatorY + this.childIndicatorHeight/2 );						g.drawLine( x, indicatorY + this.childIndicatorHeight, rightBorder, indicatorY + this.childIndicatorHeight/2 );						g.drawLine( x, indicatorY, x, indicatorY + this.childIndicatorHeight );					//#endif			//#if polish.css.command-child-indicator				}			//#endif						if (this.isOpen) {				// draw children:				// when there is enough space to the right, open it on the right side, otherwise open it on the left:				int clipX = g.getClipX();				int clipWidth = g.getClipWidth();				int clipY = g.getClipY() - 1;				int clipHeight = g.getClipHeight();//				g.setColor(0x00FF00);//				g.fillRect(clipX, clipY, clipWidth, clipHeight);								int availableWidth = (clipWidth * 2) / 3;				int childrenWidth = this.children.getItemWidth( availableWidth, availableWidth );				int childrenHeight = this.children.itemHeight; // is initialised because of the getItemWidth() call				rightBorder += this.paddingHorizontal;//				System.out.println("drawing children: children-width " + childrenWidth + ", clipWidth=" + clipWidth + ", leftBorder=" + leftBorder + ", rightBorder=" + rightBorder);//				System.out.println("rightBorder + childrenWidth=" + (rightBorder + childrenWidth) + ", clipX + clipWidth=" + ( clipX + clipWidth ));//				System.out.println("clipX + clipWidth - childrenWidth=" + (clipX + clipWidth - childrenWidth) + ", (leftBorder + 10)=" + (leftBorder + 10));//				System.out.println("clipX=" + clipX + ", leftBorder - childrenWidth=" + (leftBorder - childrenWidth));				if ( rightBorder + childrenWidth < clipX + clipWidth ) {										x = rightBorder;				} else if ( clipX + clipWidth - childrenWidth > (leftBorder + 10) ) {					x = clipX + clipWidth - (childrenWidth + 1);				} else {					x = Math.max( leftBorder - childrenWidth, clipX );				}				//System.out.println("submenu: y=" + y + ", y + childrenHeight=" + (y + childrenHeight) + ", clipY + clipHeight=" + (clipY + clipHeight));				if ( y + childrenHeight > clipY + clipHeight ) {					y -= (y + childrenHeight) - (clipY + clipHeight);					//System.out.println("submenu: adjusted y=" + y + ", clipY=" + clipY);					if ( y < clipY ) {						y = clipY;						this.children.setVerticalDimensions( clipY, clipY + clipHeight );					}//					g.setColor( 0x00FFFF);//					for (int i = 0; i < 15; i++) {//						g.drawLine( x - 20,y-i, x+childrenWidth+10, y-i);						//					}				}				this.children.paint( x, y, x, x + childrenWidth, g);			}		}	}