BBC BASIC for Windows
Programming >> User Interface >> Graphics paint issue -- incomplete objects
http://bb4w.conforums.com/index.cgi?board=ui&action=display&num=1418984249

Graphics paint issue -- incomplete objects
Post by g3nrw on Dec 19th, 2014, 09:17am

When displaying a BB4W-generated window, I sometimes find that part of an object is missing, but when I sweep over the object with the cursor, it repaints correctly.

Here is an extreme example that someone just sent me:

http://homepage.ntlworld.com/wadei/incomplete%20paint.jpg

The bottom is missing from some of the controls, and the right half of some radio buttons is also missing.

I suspect I have made the bounding boxes too big for some controls, such that they encroach on nearby controls.

Ideas anyone? (apart from comments on the non-Microsoft-approved layout!)

--
Ian


Re: Graphics paint issue -- incomplete objects
Post by rtr2 on Dec 19th, 2014, 11:50am

on Dec 19th, 2014, 09:17am, g3nrw wrote:
When displaying a BB4W-generated window, I sometimes find that part of an object is missing, but when I sweep over the object with the cursor, it repaints correctly.

Just to clarify, your picture would suggest that this is in fact a set of Windows Controls (probably in a dialogue box) rather than BB4W-drawn graphics.

Quote:
I suspect I have made the bounding boxes too big for some controls, such that they encroach on nearby controls.

It certainly looks like an overlapping-controls issue. Correct that, if necessary, and let us know if it fixes the problem.

Quote:
Ideas anyone?

How do you draw the horizontal 'dividing lines'? In several places it looks as though they may be responsible. I wonder why you haven't used 'group boxes' as the means of organising the controls (maybe that's what you meant by "non-Microsoft-approved layout").

If you fancy a challenge, write a little utility which would examine a dialogue-box template, extract all the controls' rectangles, and report whether any of them overlap; there's an API function - IntersectRect - which would be helpful. In fact, perhaps this could be a 'holiday challenge' for BB4W users in general (the Liberty BASIC boys are fond of competitions of this sort)!

Richard.

Re: Graphics paint issue -- incomplete objects
Post by g3nrw on Dec 20th, 2014, 09:06am

Thanks Richard

Yes, it was an overlapping bounding box situation. Now fixed.

I tried to use Group boxes, but dropped them because:

a. There isn't enough vertical room
b. More important, they are barely visible

How did I draw the horizontal "dividing lines"?

Code:
PROC_static(dlg%, \
\  "_________________________________________________________________________________________" + \
\  "_________________________________________________________________________________________" + \
\  "_________________________________________________________________________________________" , \
\staticUnderline%,   0, 19, panelWidth%, 9,0)
 


Re your challenge: being more used to the graphics capability of VB, I have been looking at the possibility of positioning the controls on a form using the mouse, then extracting the X/Y/delta-X/delta-Y parameters for BB4W. But don't hold your breath!

--
Ian

Re: Graphics paint issue -- incomplete objects
Post by rtr2 on Dec 20th, 2014, 11:59am

on Dec 20th, 2014, 09:06am, g3nrw wrote:
I have been looking at the possibility of positioning the controls on a form using the mouse

Did you not design your form using DLGEDIT (or one of the improved, custom, versions such as JDlgEdit or DlgEditCE)? Designing a complex dialogue box without a graphical aid is hard work!

Incidentally I presume nothing came of the idea of porting FreeForm to BB4W, which somebody said they were planning to attempt.

Richard.

Re: Graphics paint issue -- incomplete objects
Post by g3nrw on Dec 20th, 2014, 2:57pm

Dlgeditce is a new one on me. I will have a look at it.

Yes, it is hard to write the raw code, specially when you have to move most of the controls down the screen by 5 units to make room for something else!

--
Ian