Mercurial > dwindows
comparison 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 |
comparison
equal
deleted
inserted
replaced
635:6cec85b90635 | 636:f6f887d2c5aa |
---|---|
7679 | 7679 |
7680 if(!pixmap) | 7680 if(!pixmap) |
7681 WinReleasePS(hps); | 7681 WinReleasePS(hps); |
7682 } | 7682 } |
7683 | 7683 |
7684 /* Draw a polygon on a window (preferably a render window). | |
7685 * Parameters: | |
7686 * handle: Handle to the window. | |
7687 * pixmap: Handle to the pixmap. (choose only one of these) | |
7688 * fill: Fill box TRUE or FALSE. | |
7689 * x: X coordinate. | |
7690 * y: Y coordinate. | |
7691 * width: Width of rectangle. | |
7692 * height: Height of rectangle. | |
7693 */ | |
7694 void API dw_draw_polygon( HWND handle, HPIXMAP pixmap, int fill, int npoints, int *x, int *y ) | |
7695 { | |
7696 HPS hps; | |
7697 int thisheight; | |
7698 POINTL *ptl[2]; | |
7699 POINTL start; | |
7700 | |
7701 if(handle) | |
7702 { | |
7703 hps = _set_colors(handle); | |
7704 thisheight = _get_height(handle); | |
7705 } | |
7706 else if(pixmap) | |
7707 { | |
7708 hps = _set_hps(pixmap->hps); | |
7709 thisheight = pixmap->height; | |
7710 } | |
7711 else | |
7712 return; | |
7713 /* | |
7714 * For a filled polygon we need to start an area | |
7715 */ | |
7716 if ( fill ) | |
7717 GpiBeginArea( hps, 0L ); | |
7718 if ( npoints ) | |
7719 { | |
7720 /* | |
7721 * Move to the first point of the polygon | |
7722 */ | |
7723 start.x = x[0]; | |
7724 start.y = y[0]; | |
7725 GpiMove( hps, &start ); | |
7726 /* | |
7727 * Convert the remainder of the x and y points | |
7728 */ | |
7729 for ( i = 1; i < npoints; i++ ) | |
7730 { | |
7731 ptl[i-1].x = x[i]; | |
7732 ptl[i-1].y = y[i]; | |
7733 } | |
7734 GpiPolyLine( hps, npoints-1, &ptl ); | |
7735 | |
7736 if ( fill ) | |
7737 GpiEndArea( hps ); | |
7738 } | |
7739 if ( !pixmap ) | |
7740 WinReleasePS(hps); | |
7741 } | |
7742 | |
7684 /* Draw a rectangle on a window (preferably a render window). | 7743 /* Draw a rectangle on a window (preferably a render window). |
7685 * Parameters: | 7744 * Parameters: |
7686 * handle: Handle to the window. | 7745 * handle: Handle to the window. |
7687 * pixmap: Handle to the pixmap. (choose only one of these) | 7746 * pixmap: Handle to the pixmap. (choose only one of these) |
7688 * fill: Fill box TRUE or FALSE. | 7747 * fill: Fill box TRUE or FALSE. |