layers of a bevel button vs a label

I need to put a label over a bevel button in addition to the caption property of the button. The .visible property of the label is determined by both the .value property of the label and a couple of other things. The .visible property is being set correctly but the label can’t be seen because the bevel button is on top of it.

I have tried the buttons on the tool bar but they don’t help.

I have had this working in an earlier version of my application but that version doesn’t exist any more.

Thanks
Guy

Alternatively you could just move the control you don’t want to be visible out of the form-area., for example MyBevelbutton.top = 10000

My suggestion would be that, rather than trying to manage 2 controls and show, position, etc. them individually, that you create your own button as a subclass of the canvas control. In this way, you have control as to what is printed and where, changing font and size as needed, and it’s all within one control.

If you were to want to do something like this… I suggest leaving both controls locations alone, and manipulate the VISIBLE property

Instead of doing assemblies, why don’t you draw what you need in a picture and make it the Bevel button icon property ?

I guess I can’t reply to each of those who posted about my question so here is one reply to the 5 who have answered. First thanks. Years ago when I was programming for a living getting an answer to a question was very difficult. You might have had one or two others you could ask but their experience and knowledge wasn’t much greater than yours.

What I am doing is creating a portion of an instrument panel to be used as for ‘free play’ by students learning to use the equipment. The panel contains the controls and indicators for the pneumatic system of a jet airplane. The simulation shows the buttons, knobs, lights and other indicators in one area and a schematic representation of the pneumatic system in another area. Using this tool the student can play out various scenarios and watch both the cockpit indications and the system components.

All of the buttons on the pneumatic panel have at least2 ways to provide feedback and some have 3. The first feed back provided is if the button is depressed or released. For that ‘tactile’ feed back the bevel button works perfectly well. The 2nd way feed back is provided is with a lighted rectangle in the center of the button. This rectangle, called a ‘bar’, indicates whether or not the button is in the proper position (depressed or released) for flight. This follows something called the ‘black panel concept’. When a pilot glances at a panel any light indicates something out of it’s normal position.

Note neither the button position or lighted bar give any feed back as to the state the valves controlled by the button. They only give feed back about the state of the button it’s self. For the most part feed back about the actual state of the pneumatic system are shown by messages on the Crew Alerting System or CAS display as well as an area on one of the CRTs showing pneumatic system pressures and temperatures.

Since no design philosophy, including the 'black panel concept, meets the real world and survives completely the aircraft’s designers decided that 5 valves required a direct display of their position. That indication was placed button controlling those valves. It is in the form of an ‘OPEN’ inscription when the valve is actually in the open position.

So as you can see I need to display the bevel button (set or released) , the bar, which I in the caption by 6 lower case Ls (“llllll”), and finally the OPEN caption shown above the caption.

What’s frustrating about this is I had most of this built and the ‘button, caption, text field’ solution was working fine. Through a clerical screw up I destroyed that file and had to start almost over. I sure that’s never happened to any one else.

I may have to use one or more likely a combination of the ideas you have provided but I really want to get my original scheme working again. It provided a visually very satisfying representation of the pneumatic panel.

If anyone can help me figure this out I would be grateful.

Thanks
Guy Dervage

all that being said… I would forego the bevel button control, and create a custom subclass of a canvas that can depict and react as required… this method gives you 100% control over all the visual aspects as well as the user interaction

I remember in the past you sometimes saw one control shining through the other, and that could be solved by just moving one of the controls outside of the viewing area.

This is what I do now to give the bevelbutton the same behavior on mac as well as on windows. (change the color / icon on mouseenter event).

Ok guys thanks for your help. I think I’ll try the canvas method. To emulate the behavior of a button what event of the canvas should I use. The mouse down event? Also I’m ending up with a lot of controls on this screen. Is there an upper limit.

Thanks again.
Guy

if it is a “button” then mousedown (or mouseup [be sure to return TRUE in mousedown])
if it is a “knob” or “slider” using “mouseDrag” (also need to return TRUE in mousedown])

And be sure to create a custom subclass for each “type” of control. DO NOT create a code instance for each control.
one custom class can support “x” number of instances… and use properties to control colors, labels, etc.

For a button, the proper event to emulate Action is MouseUp, with something like this :

if X >= 0 and Y >= 0 and X <= me.width and Y <= me.height then //Action stuff end if

So the behavior where a user may decide not to click after all, and drags the mouse cursor out of the button is preserved. Don’t forget to return true in MouseDown to enable MouseUp.

Took me a minute to understand why you bothered checking X & Y… then it dawned on me…
so for future posterity.

The MouseDOWN event will only occur when the mouse is within the bounds of the control,
However, the MouseUP event will occur regardless of where the mouse is pointing (remeber a MouseUP will not occur, without the MouseDOWN returning TRUE)… Since the mouse may have been move (dragged) while still holding down the button, what Michel posted insures that the “action stuff” will only happen if the MouseUP happens while the mouse is within the bounds of where the MouseDOWN event occured.