PDA

View Full Version : How can I hide/show driver-painted buttons?



avid
July 15th, 2004, 02:12 AM
Ben,

Marcel found a problem with the drop-down button in my new utils driver. He placed it in a frame which used a STATE to toggle visibility of the whole frame and its contents. Everything in the frame became correctly hidden EXCEPT my drop down (which is registered to be painted by my driver).

Unfortunately there is no call to the driver when the the parent of the driver-painted button changes visibility. I just simply do not know it has happened.

After an experiment where I polled the parent on a timer (where Marcel did not like the slight lag), I now have a temporary "workaround" where it is necessary to specify the same STATE variable as a qualifier to the drop-down button. But I would like to think that this is temporary and should not really be needed.

So, is the problem clear? And is there any chance of a new call to let me handle this case?

Brian

Ben S
July 17th, 2004, 07:18 PM
The problem relates to a general issue of how NetRemote is rendering the screen, and something that will be fixed post 1.0.

"Frames" and "buttons" are all in one window, it does not create a new "window" for each frame like you might expect. This is the general reason why you can't have some frames in the skin that have a greater z-order than the main panel.

So the drop-down button is a window attached to the main window, not to the frame. Post 1.0, hiding the frame will also hide any sub-windows (including your menu).

For now, I can add a "IsVisible" method that you can call on a button to have it move up through the frame hierarchy and tell you if it's visible or not.

avid
July 18th, 2004, 01:20 AM
Ben,

I think I tried the equaivalent of the "IsVisible" method (GetParent()->GetEnabled()), but it was not enough. Once I figured out that GetEnabled returned the opposite of what I expected, the problem was that I still didn't get any calls when I became hidden - PaintButton was only called when I should be re-shown.

So I simply can't tell when I should hide the window.

Brian