Hi folks.
Now that I know for sure that my Windows programming skill are very lightweight, I have to ask you about this problem.
I use GRAPHIC SCALE to create a graphic window with special coordinate system. One notable thing is that I have the X axis reversed (positive end points to the left). Something that worked for me in 8.03 got me some more gray hair with 9.0.
I tried to construct a reasonably simple example to demonstrate my source of gray hair:
In the above example when I run it, the result points to the right (which it shouldn't with reversed x axis). Add 1 to either of the upper grafsize values "corrects" the result. Is there a logical problem somewhere ?
At least GRAPHIC LINE and POLYGON seems to suffer from this for me.
cheers.. aSa C[_]
Now that I know for sure that my Windows programming skill are very lightweight, I have to ask you about this problem.
I use GRAPHIC SCALE to create a graphic window with special coordinate system. One notable thing is that I have the X axis reversed (positive end points to the left). Something that worked for me in 8.03 got me some more gray hair with 9.0.
I tried to construct a reasonably simple example to demonstrate my source of gray hair:
Code:
#COMPILE EXE #DIM ALL ' PBWin 9.00.0085 ! %IDC_GRAPHIC_VIEW = 5000 GLOBAL grafsize_x,grafsize_y AS LONG _____________________________________________________________________________________________ FUNCTION PBMAIN () AS LONG LOCAL hDLG,desksize_x,desksize_y AS LONG LOCAL x1,y1,x2,y2,z AS SINGLE DESKTOP GET CLIENT TO desksize_x,desksize_y grafsize_x = desksize_x * 0.7: grafsize_y = desksize_y * 0.7 DIALOG NEW PIXELS, 0, "testing", , , grafsize_x, grafsize_y, %WS_CAPTION OR %WS_SYSMENU, 0 TO hDLG CONTROL ADD GRAPHIC, hDLG, %IDC_GRAPHIC_VIEW, "", 0, 0, grafsize_x, grafsize_y GRAPHIC ATTACH hDLG, %IDC_GRAPHIC_VIEW GRAPHIC CLEAR %BLACK ' these needs to be 0's here x1 = 0 y1 = 0 ' add or decrease one or both grafsizes "fixes" axis reversal x2 = grafsize_x '+1 y2 = grafsize_y '+1 ' x axis reversal !! GRAPHIC SCALE (x2,y1) - (x1,y2) DIALOG SHOW MODAL hDLG, CALL ShowGraphicsProc END FUNCTION _____________________________________________________________________________________________ CALLBACK FUNCTION ShowGraphicsProc() AS LONG SELECT CASE CBMSG CASE %WM_INITDIALOG ' in standard (=unreversed x axis) coordinate system result of this point to the right GRAPHIC LINE (grafsize_x*0.1,grafsize_y*0.2) - (grafsize_x*0.8,grafsize_y*0.35), %RED GRAPHIC LINE STEP - (grafsize_x*0.4,grafsize_y*0.7), %RED CASE %WM_COMMAND SELECT CASE CBCTL CASE %IDCANCEL IF CBCTLMSG = %BN_CLICKED THEN DIALOG END CBHNDL END IF END SELECT END SELECT END FUNCTION
At least GRAPHIC LINE and POLYGON seems to suffer from this for me.
cheers.. aSa C[_]

Comment