Automatic rendering addition to a button image

Hi

In testing our application on Windows 7 I noticed a different rendering of a button (image) in Windows than on Mac OS X. Prerequisit is that the image has the property showClick set.
In Windows, in addition to the property settings the button get’s automatically a fine black line around the image and it’s a bit embossed (to mimik a button). Is this automatic addition done by Windows, Java or Servoy? Can it be disabled?

See the change of the image by setting the property showClick set (blue arrow) and showClick not set (red arrow) on Windows.

Regards,

Hi All

Any idea if this automatic rendering additions of Windows (or Servoy or Java on Windows) can be avoided?

The “little” detail of making a button to a label to get the desired appearance has really great implications on our access rights part of our application. As we have to control access right of buttons for user groups, the situation gets really worse if buttons have suddenly to become labels to get a correct a appearance, just because not only Servoy properties define the appearance, but as well some (somewhere) hidden logic.

Any clarification is very appreciated.

Regards,

That’s the windows L&F doing that!

just unselect the showClick, on the property of the button, and your done!

Hi Harjo and all others

Unfortunatly, at least to me, it’s not that easy. There are 3 different classes of objects:

  • Labels
  • Buttons
  • Images

In the toolbar (Servoy Version 5.2.x) there are 3 buttons to select the 3 above mentioned objects (A for label, ab embossed for button, and the green blue yellow carré to get an image. This is suggesting that there are 3 separate objects by saying Place Label, Place Button, Place Image…
So far so good.

But, if you have them placed in a form, the title of the properties pane says Label / Button (the Image is not mentioned any more in the title).
So, starting with 3 classes of objects, suddenly they are all the same. But even then there are subtle differences. By applying for example an onAction method to an image, and setting the showClick property, the image “looses” the LabelFor property. Set showClick again and you get the LabelFor property back. So it seems that a button is really a button if it has no LabelFor property!?

Coming back to our problem: Obviously it might be that one would like to give different group access to these 3 different classes of objects (we would like to :-), but the way Servoy handles them, i. e. does not separate them except when selecting in the toolbar, it’s not possible (except you work with naming and prefixing the elements)

But you see that the Windows L&F handles them differently, by “only” checking the showClick property (making a black border, even when the property borderType is set to Empty - not very logically, is it?

In my view there is something wrong here with these 3 objects.

Hope my explanation make it a bit clear what I mean. I suggest to clearly separate them as 3 different objects (as in the toolbar) with 3 own sets of properties (they might be very similar, but obviously logically not the same)

Regards,

In Servoy, they are unfortunatly handled nearly identical.

Harjo:
That’s the windows L&F doing that!

just unselect the showClick, on the property of the button, and your done!

there is nothing wrong with them
yes you can toggle between a real button or just a label by using the showClick property,
showClick == true then it is a Button if it is false then it is a label

And what the Look and Feel then does to them is up to the look and feel.

But i guess what you want is that the showclick is never a property but is hard set when you place it. So if you then want to turn it into a button(if it is now a label) you have to delete the current label and then add a new button of the right type on that place and set all the other properties again. (instead of just toggling the property)

What I am saying is that it’s just not well structured here, which can be seen in Servoy Human Interface itself.
In the toolbar they are cleanly separated objects - Label, Button, and Image (each represented by a button). Then these clear structure suddenly disappears into Label/Button. The Image is gone nowhere.

jcompagner:
there is nothing wrong with them
yes you can toggle between a real button or just a label by using the showClick property,
showClick == true then it is a Button if it is false then it is a label

It’s even more obscure: Your description is only true if you also apply an onAction method to the “label/button/image” object. Otherwise it doesn’t change to a button if you “only” apply an onDoubleClick or onRightClick method and set the showClick property.

jcompagner:
And what the Look and Feel then does to them is up to the look and feel.

I know we have no influence, but it’s still annoying if the L&F get’s in conflict with the Servoy property settings (like specifying an empty border and then getting a black border in the HI for example), as this nullyfies a proper design.

jcompagner:
But i guess what you want is that the showclick is never a property but is hard set when you place it. So if you then want to turn it into a button(if it is now a label) you have to delete the current label and then add a new button of the right type on that place and set all the other properties again. (instead of just toggling the property)

Yes, I would like that the 3 objects are cleanly separated and we can access them as such. Currently, this is not possible (or only via naming conventions which should not be the case). A button is a different object than a label, and also different of an image. And only because they might share most of the properties is not a reason to mix them up - in my opinion. Because as said, based on this it’s not really possible to implement a proper user acccess rights system to an application, for example.

Best regards,

just don’t touch the showclick property then…
Yes it is true that onaction also needs to be set, but if that is set then a button is not a button (in behavior) anyway. Because it doesn’t do anything

If you just place labels or buttons from the toolbar and you never touch the showclick then they are exactly that what you dropped.
A button stays a button if you place it on the form, and you then just attach a ondoubleclick…

you are right about a label will not become a button if you change showclick to true and don’t use the onaction.
I don’t think we can really change this that easy anymore because that could break the lnf of existing solutions.
The trick is that on the form.frm file (as txt file) you have to set an extra property:
onActionMethodID:“-1”,

then it will be a button, so yes this is a bit hidden.

Johan,

I just spend so much time in giving feedback in the hope things improve (otherwise it would be useless). I still hope you find in a future release a better solution for this. Of course I am also aware of, that such things can break up existing implementations. But I think it’s one of Servoy’s strengths to really try to make things better, as you have done in the past, even if implementations were affected (and caused some grumble on the developers’s side ;-)
But at the end it’s how things improve over time for us developer and as a result the quality of the applications we create for our customers.

Back to the discussion. You seem to (always) ignore the image object, but the image object seems to be the same as a label, which I have a problem to accept. Especially if these 3 objects are “real world” objects and thus easely to differentiate. They wouldn’t exist as 3 separate objects in the real world if there were no difference.

Thanks and regards,

problem for this is if we would say only showclick toggles between button/label we don’t look to the onaction command anymore
Then this could ‘break’ many solutions that somehow have this showclick on true on labels… So i don’t think that is that easy to do. But you could make a feature request for this.

there is no “image” object, place image (or drag’n’drop from the solution explorer tree an image to the forum) is just a short cut for placing a Label with a predefined image.
So there are no 3 objects there are only 2 objects, Buttons and Labels. Both can have an image or not.

jcompagner:
problem for this is if we would say only showclick toggles between button/label we don’t look to the onaction command anymore
Then this could ‘break’ many solutions that somehow have this showclick on true on labels… So i don’t think that is that easy to do. But you could make a feature request for this.

As labels with property showClick not set do anyway show no visual reaction, I think it can’t break any existing solutions. They remain as they are.

jcompagner:
there is no “image” object, place image (or drag’n’drop from the solution explorer tree an image to the forum) is just a short cut for placing a Label with a predefined image.
So there are no 3 objects there are only 2 objects, Buttons and Labels. Both can have an image or not.

That’s what we finally found. There is no image object. But the Place image… button suggests so. May be one could call this button “Place Label with Image…” then it would be immediately transparent what it is.

Regards,

As labels with property showClick not set do anyway show no visual reaction, I think it can’t break any existing solutions. They remain as they are.

no they are not, because they do not do anything right now… if we would change it they would suddenly be buttons (so suddenly they have a visual reaction), so big break for many solutions.

But labels do not have an onAction method applied, unless they are actually meant to be a button, do they?

exactly! and thats why it would be a problem if we only look at showclick…

now it is:

if (showclick && onaciton != 0) createButton()
else createLabel()

if we start doing this:

if (showclick) createButton()
else createLabel()

then all labels that somehow have showclick = true will become buttons…

Yes, I see, the alternative is to leave it forever as it is (I consciously don’t write: … leave it forever wrong, as I know you would oppose that).

As you corrected other things in the past which affected us developers quite severe, why not correct this. At least you could announce it, so developers are aware that with using Servoy Developer release xy would be one of the consequences (it would be quite easily fixable with find/replace).

Regards,

no a file replace is not really that easy possible, because the thing you have is a valid construct,

So for this to happen and that not everybody has to check every form they have we also need some tool/check, that needs to be run once just after a release that has it.
That will change showclick to false for all labels that have showclick to true and have no action event.

But something like this won’t happen for 6. So make a case pointing to this thread so that we can look if we can do something in the future.

That’s ok for me, I already made an entry in the Support System yesterday, case #385427.

Thanks and regards,

jcompagner:
no a file replace is not really that easy possible, because the thing you have is a valid construct,

So for this to happen and that not everybody has to check every form they have we also need some tool/check, that needs to be run once just after a release that has it.
That will change showclick to false for all labels that have showclick to true and have no action event.

But something like this won’t happen for 6. So make a case pointing to this thread so that we can look if we can do something in the future.