comparison os2/dw.c @ 1424:36d0e26a5dea

Use the image handle to get the dimensions on OS/2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 03 Dec 2011 03:40:48 +0000
parents 1bb1865fed9d
children 1628bf383893
comparison
equal deleted inserted replaced
1423:1bb1865fed9d 1424:36d0e26a5dea
4724 thisheight = 18; 4724 thisheight = 18;
4725 } 4725 }
4726 /* Bitmap/Static */ 4726 /* Bitmap/Static */
4727 else if(strncmp(tmpbuf, "#5", 3)==0) 4727 else if(strncmp(tmpbuf, "#5", 3)==0)
4728 { 4728 {
4729 int bmwidth = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_width")); 4729 HBITMAP hbm = (HBITMAP)WinSendMsg(handle, SM_QUERYHANDLE, MPVOID, MPVOID);
4730 int bmheight = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_height")); 4730
4731 4731 if(hbm)
4732 if(bmwidth > 0 && bmheight > 0) 4732 {
4733 { 4733 BITMAPINFOHEADER2 bmp;
4734 thiswidth = bmwidth; 4734 bmp.cbFix = sizeof(BITMAPINFOHEADER2);
4735 thisheight = bmheight; 4735 /* Get the parameters of the bitmap */
4736 } 4736 if(GpiQueryBitmapInfoHeader(hbm, &bmp))
4737 {
4738 thiswidth = bmp.cx;
4739 thisheight = bmp.cy;
4740 }
4741 }
4737 } 4742 }
4738 /* Ranged: Slider/Percent/Scrollbar */ 4743 /* Ranged: Slider/Percent/Scrollbar */
4739 else if(strncmp(tmpbuf, "#38", 4)== 0 || 4744 else if(strncmp(tmpbuf, "#38", 4)== 0 ||
4740 strncmp(tmpbuf, "#8", 3)== 0) 4745 strncmp(tmpbuf, "#8", 3)== 0)
4741 { 4746 {