Group box and bitmaps (OpenInsight Specific)
At 15 APR 1999 04:51:06PM Steve C. wrote:
Group boxes and bitmaps revisited.
According to Cameron, the group box is a type of button. If so, does
anyone know how I can use Set_property or something else to set
the background of a group box like a form, give it a bitmap entity
and set it to resize. I tried using a button but the underlying
objects, edit lines and text,don't appear. I just want to highlite/
color a groupbox for effect.
Thanks…
Steve C.
At 15 APR 1999 11:31PM Dave Pociu wrote:
Steve,
As far as I know, you can change the background of a group box right in the Form designer. If you want to do it dynamically, then just set the BACKCOLOR ( I believe) property.
At 16 APR 1999 06:22AM Oystein Reigem wrote:
Steve,
I tried this with a bitmap. I don't know if you wanted a real group box with text and that line around the border?
If you programmatically change the BITMAP of the bitmap control all the controls on the bitmap will be painted over. That's what you noticed, presumably. But I found a way to get the controls repainted. I just set their SIZE:
OldVal=Set_Property( @Window:'.BUTTON', 'SIZE', Get_Property( @Window:'.BUTTON', "ORIG_SIZE" ) )
If for some reason this doesn't work you can always cut your bitmap up in smaller pieces without overlap with other controls.
And I'm certain there are sophisticated ways of doing it too. Perhaps one can somehow make the controls into children of the bitmap, and change the STYLE property of the bitmap control to remove the WS_CLIPCHILDREN bit, so that children aren't painted over… I'm just guessing, really. If it can be done I'm almost certain that crafty fellow Carl Pates knows how…
- Oystein -
At 19 APR 1999 06:42PM Cameron Revelation wrote:
According to Cameron, the group box is a type of button.
I'll agree with that
![]()
If so, does anyone know how I can use Set_property or something else to set the background of a group box like a form, give it a bitmap entity and set it to resize.
So what you want is a bitmap that is the same size (or roughly the same size) as the group box … to look like it is inside (?) the group box?
I tried using a button but the underlying objects, edit lines and text, don't appear.
Do you mean that you made a big bitmap button and put other controls on it?
I just want to highlite/color a groupbox for effect.
I am guessing that the problem is Z order related. Windows is of course 2-dimensional (or 1-dimensional, if you ask a Mac fan
but it does try to keep track of what windows are on top of what other windows. Well, to save memory, it takes some short-cuts, like saying, "I don't know exactly where the window is in the Z order, but I know it isn't top most".
Well, one way to help Windows set up its Z order is to tell it what the parent/child relationships are in your window. The problem is that the Form Designer doesn't let you design these … if you have a group box with 5 controls "inside" it, they all end up being direct children of the window itself, not the group box as a child and the 5 controls as its child.
So to get your bitmap to work, you need to set it as the child of the group box, and then set the controls within the group box to be the children of the bitmap. To do this, there is an API call "SetWindowParent" or something like that. You can also fudge the SYSREPOSWINEXES record, or manipulate the structure and use Utility("CREATE") (or the Start_Window 2-step).
Cameron Purdy
Revelation Software