Exemplo n.º 1
0
SInt32 myWindowDraw(WindowRef window,SInt32 param)
{
    /*------------------------------------------------------
        Use this method to draw the window based on the value
        of param.
            wNoHit: 		draw the frame and attributes
            wInGoAway: 		hilite or unhilite GoAway box
            wInZoomIn: 		hilite or unhilite ZoomIn Box
            wInZoomOut: 	hilite or unhilite ZoomOut Box
            wInCollapseBox: 	hilite or unhilite Collapse Box 
    --------------------------------------------------------*/
    static Boolean hilite=FALSE;
    WindowAttributes attributes;
    
    if(IsWindowVisible(window))
    {
        switch(param){
            case wNoHit:
                        hilite=FALSE;//redrawn so no box hiliteing
                        
                        drawWindowFrame(window);
                        
                        GetWindowAttributes(window,&attributes);
                        if(attributes & kWindowCloseBoxAttribute)//is there a close box?
                            drawWindowCloseBox(window,hilite);             
                        if(attributes & kWindowFullZoomAttribute)//is there a zoom box?
                            drawWindowZoomBox(window,hilite);
                        if(attributes & kWindowCollapseBoxAttribute)//is there a collapse box?
                            drawWindowCollapseBox(window,hilite);
                        
                        break;
            case wInGoAway: 
                        hilite=drawWindowCloseBox(window,!hilite);
                        break;
            case wInZoomIn:
            case wInZoomOut:
                        hilite=drawWindowZoomBox(window,!hilite);
                        break;
            case wInCollapseBox:
                        hilite=drawWindowCollapseBox(window,!hilite);
                        break;
        }
    }
    return 0;
}
Exemplo n.º 2
0
void
Style::drawDockBg(const QStyleOption *option, QPainter *painter, const QWidget *widget) const
{
    if (widget && widget->isWindow())
        drawWindowFrame(option, painter, widget);
}