The following program displays a text label and draws a
vertical bar on the screen. If you then hit the full
screen button on the right hand side of the title bar
it is redrawn, but some pixels at the top of the bar
are not painted. I've tried to isolate the problem but
just can't seem to find out why this is happending.
The redraw code for the text lable is causing the
problem. If I redraw the line then the text lable the
problem goes away. But there is no overlap of the pixel
space on the screen! (BTW my monitor is a ViewSonic 24 inch
in 1280 x 1024 mode).
Can anyone see what I'm doing wrong?
-----------------------------------------------------------
vertical bar on the screen. If you then hit the full
screen button on the right hand side of the title bar
it is redrawn, but some pixels at the top of the bar
are not painted. I've tried to isolate the problem but
just can't seem to find out why this is happending.
The redraw code for the text lable is causing the
problem. If I redraw the line then the text lable the
problem goes away. But there is no overlap of the pixel
space on the screen! (BTW my monitor is a ViewSonic 24 inch
in 1280 x 1024 mode).
Can anyone see what I'm doing wrong?
-----------------------------------------------------------
Code:
#COMPILE EXE #REGISTER NONE $INCLUDE "WIN32API.INC" GLOBAL dWidth AS LONG GLOBAL dHeight AS LONG GLOBAL sWidth AS LONG GLOBAL sHeight AS LONG GLOBAL hDlg AS LONG ' Global Dialog handle GLOBAL Lh AS LONG ' Height of one line '**************** Font Size Control Section GLOBAL FontIndex AS LONG GLOBAL hFont AS LONG ' Global Font handle GLOBAL hMyFont() AS LONG ' Global Font Sizes Table '**************** CALLBACK FUNCTION MA_Main() SELECT CASE CBMSG CASE %WM_DESTROY DestroyWindow hDlg CASE %WM_SIZE DIALOG PIXELS CBHNDL,LOWRD(CBLPARAM),HIWRD(CBLPARAM) TO UNITS sWidth,sHeight FontIndex=Lh*(sHeight/dHeight) CALL SendMessage(hFont,%WM_SETFONT,hMyFont(FontIndex),0) CONTROL SET LOC hDlg,100,sWidth/dWidth*0,sHeight/dHeight*20 CONTROL SET SIZE hDlg,100,sWidth/dWidth*320,sHeight/dHeight*Lh CONTROL SET TEXT hDlg,100,"This is a test message" CONTROL SET LOC hDlg,200,sWidth/dWidth*15,sHeight/dHeight*35 CONTROL SET SIZE hDlg,200,sWidth/dWidth*10,sHeight/dHeight*163 END SELECT END FUNCTION FUNCTION PBMAIN() AS LONG DIM hFont AS LONG DIM hMyFont(18:40) AS LONG FOR f&=18 TO 40 hMyFont(f&)=_ CreateFont(f&,0, _ 'height,width(default=0) 0,0, _ 'escapement(angle),orientation 700, _ 'weight (default=0,normal=400,bold=700) %FALSE, _ 'Italic %FALSE, _ 'Underline %FALSE, _ 'StrikeThru %ANSI_CHARSET, %OUT_CHARACTER_PRECIS, _ %CLIP_DEFAULT_PRECIS, %PROOF_QUALITY, _ %FIXED_PITCH OR %FF_DONTCARE,"MS Sans Serif" ) NEXT f& Lh=17 'Global line height FontIndex=Lh*(sHeight/dHeight) dWidth=320:sWidth=dWidth dHeight=240:sHeight=dHeight DIALOG NEW 0,"Missing Pixels in Full Screen",,,dWidth,dHeight,_ %WS_CAPTION OR %WS_SYSMENU OR %WS_THICKFRAME OR %WS_MAXIMIZEBOX OR _ %WS_MINIMIZEBOX OR %DS_CONTEXTHELP,0 TO hDlg CONTROL ADD LABEL,hDlg,100,"",sWidth/dWidth*0,_ sHeight/dHeight*20,sWidth/dWidth*320,sHeight/dHeight*Lh,%SS_CENTER CONTROL HANDLE hDlg,100 TO hFont CALL SendMessage(hFont,%WM_SETFONT,hMyFont(FontIndex),0) CONTROL ADD LINE,hDlg,200,"",sWidth/dWidth*15,_ sHeight/dHeight*35,sWidth/dWidth*10,_ sHeight/dHeight*16,%SS_BLACKRECT DIALOG SHOW MODAL hDlg, CALL MA_Main END FUNCTION
Comment