Mercurial > dwindows
diff os2/dw.c @ 636:f6f887d2c5aa
Add _dw_log() internal logging function
Preliminary support for building with GTK+ on Windows with MinGW
Deprecate dw_menu_item_set_check(); use dw_menu_item_set_state()
Support dw_window_set_text() from groupbox
Support transparent bitmaps( GTK+ already did by default)
author | mhessling@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 10 Apr 2009 22:55:56 +0000 |
parents | c5e5671dec8f |
children | 9fa3cb5b3290 |
line wrap: on
line diff
--- a/os2/dw.c Fri Apr 10 10:30:54 2009 +0000 +++ b/os2/dw.c Fri Apr 10 22:55:56 2009 +0000 @@ -7681,6 +7681,65 @@ WinReleasePS(hps); } +/* Draw a polygon on a window (preferably a render window). + * Parameters: + * handle: Handle to the window. + * pixmap: Handle to the pixmap. (choose only one of these) + * fill: Fill box TRUE or FALSE. + * x: X coordinate. + * y: Y coordinate. + * width: Width of rectangle. + * height: Height of rectangle. + */ +void API dw_draw_polygon( HWND handle, HPIXMAP pixmap, int fill, int npoints, int *x, int *y ) +{ + HPS hps; + int thisheight; + POINTL *ptl[2]; + POINTL start; + + if(handle) + { + hps = _set_colors(handle); + thisheight = _get_height(handle); + } + else if(pixmap) + { + hps = _set_hps(pixmap->hps); + thisheight = pixmap->height; + } + else + return; + /* + * For a filled polygon we need to start an area + */ + if ( fill ) + GpiBeginArea( hps, 0L ); + if ( npoints ) + { + /* + * Move to the first point of the polygon + */ + start.x = x[0]; + start.y = y[0]; + GpiMove( hps, &start ); + /* + * Convert the remainder of the x and y points + */ + for ( i = 1; i < npoints; i++ ) + { + ptl[i-1].x = x[i]; + ptl[i-1].y = y[i]; + } + GpiPolyLine( hps, npoints-1, &ptl ); + + if ( fill ) + GpiEndArea( hps ); + } + if ( !pixmap ) + WinReleasePS(hps); +} + /* Draw a rectangle on a window (preferably a render window). * Parameters: * handle: Handle to the window.