Tuesday, May 22nd 2012, 1:41am UTC+2

You are not logged in.

  • Login
  • Register

Dani

Trainee

Posts: 68

Location: GERMANY

1

Thursday, November 17th 2011, 11:23am

Command1/Text1 Enabled = False - not the expected behaviour

Hey everybody,

when setting

Jabaco Source

1
Command1.Enabled = False

the caption is not greyed out!
It just does not look right at runtime.
It is fine at designtime though.

Jabaco Source

1
Text1.enabled = False

does not seem to change anything.
It should be greyed out and locked!


Dani

theuserbl

Intermediate

2

Sunday, November 20th 2011, 5:08pm

RE: Command1/Text1 Enabled = False - not the expected behaviour

when setting

Jabaco Source

1
Command1.Enabled = False

the caption is not greyed out!
It just does not look right at runtime.
It is fine at designtime though.
?( Disable the CommandButton works fine for me.
I have no problems with enable and disable it.

Quoted

Jabaco Source

1
Text1.enabled = False

does not seem to change anything.
It should be greyed out and locked!
Thanks for the info.
Bug is now fixed:
[ http://code.google.com/p/jabacoframework/source/detail?r=87 ]
[ Jabaco-rev87.jar ]

Greatings
theuserbl

Dani

Trainee

Posts: 68

Location: GERMANY

3

Sunday, November 20th 2011, 7:45pm

Thanks a lot theuserbl,

for constantly updating the framework :thumbsup:
I still did not give it a try myselfe :whistling:

the problem I am facing here:

Quoted

when setting

Jabaco Source

1
Command1.Enabled = False

the caption is not greyed out!
It just does not look right at runtime.
It is fine at designtime though.

is not a malfunction. It is the looks! In my LAF environment the disabled Command Botton changes to the disabled look
BUT it's caption stays black (the 'enabled = True' appearence)!
Here is a picture of what I mean:
In the background you can see what it looks like at designtime and what it should look like at runtime.

Thanks again,


Dani

theuserbl

Intermediate

4

Sunday, November 20th 2011, 8:15pm

is not a malfunction. It is the looks! In my LAF environment the disabled Command Botton changes to the disabled look BUT it's caption stays black (the 'enabled = True' appearence)!
Is it wrong?
I can change it, but I think it is the normal Java SystemLookAndFeel for Windows. So it should like to look like WindowsXP disable-buttons.
The program at runtime looks also as WinXP and that in the designmode as Win2k.
If you want, you can also at runtime use an different LookAndFeel.

For example go click on the right top tree on "Project" and then in the Properties where "JVM Options" stand write

Source code

1
-Dswing.systemlaf=javax.swing.plaf.metal.MetalLookAndFeel
or

Source code

1
-Dswing.systemlaf=com.sun.java.swing.plaf.motif.MotifLookAndFeel
or

Source code

1
-Dswing.systemlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
At best it have to look with all LookAndFeels good.

Greatings
theuserbl

theuserbl

Intermediate

5

Sunday, November 20th 2011, 8:24pm

Hmmm.. have again looked at it.
The Caption color is set with ForeColor:

Source code

1
Command1.ForeColor


So I have to say, what an disabled button have to look like.
How solved VB6 this problem?
I can mix the ForeColor with white or black or gray. Or set it per default to gray. And which gray color? #808080 ?

Don't know.

Or is it better to input a new Property called ForeColorDisabled or so?
And hopw to call it? ForeColorDisabled? DisabledForeColor ? ForeDisabledColor ? DisabledColor ?

Greatings
theuserbl

Dani

Trainee

Posts: 68

Location: GERMANY

6

Sunday, November 20th 2011, 9:34pm

What you are saying makes sense!

All the controls that have a caption their ForeColor stays black when enabled = False.

So I guess it is meant to be that way. It just did not look right to me.
Kind of like I could push it but then I can't!
Oh well...
VB6 it is the way I described it. The color is &H80000010& on my system and I would probably call it ForeColorDisabled.
But now I don't know if it really makes sense to add a property. You would have to do thid fr the other controls too.

I was not aware of the possibility to use different LookAndFeel options. Very interesting and a bit scary ...
Its not easy to predict the outcome.
Do you know if there is any Mac OS LAF to be able to simulate the LookAndFeel outcome of the Mac on my development environment?
The Tabstrip for example behaves different on the Mac.

Personally I would rather like to see energy spent on other things:
It would be great to be able to add an image to the JBGrid header to accomplish a ColSortIndicator. (Or maybe even only the possibility to change the BackColor of a single ColumnHeader)
I know we can use the Jtable directly. Still it would be nice.
The Jtable ColSortIndicator is bound to the AutoSort property. Since I am sorting the underlying SQL it would be nice to be able to set a ColSortIndicator(Up/Down) with a simple property.
I don't know Java well enough to do this myself. But this would definitely be a nice feature.


Dani

This post has been edited 1 times, last edit by "Dani" (Nov 20th 2011, 10:44pm)


Dani

Trainee

Posts: 68

Location: GERMANY

7

Sunday, November 20th 2011, 9:42pm

Quoted

How solved VB6 this problem?
I can mix the ForeColor with white or black or gray. Or set it per default to gray. And which gray color? #808080 ?


it looks like grey is mixed with white in VB!


theuserbl

Intermediate

8

Sunday, November 20th 2011, 11:12pm

it looks like grey is mixed with white in VB!
It looks more like an "emboss-effect". So not only a changed color.

Have myself tried out to create something in Visual Basic Express 2008.

In this screenshot

in every row is the same ForeColor. And in the first colum all are enabled and in the second are disabled.
I have created one window where every background is green and one, where every background is red. The Background of the buttons don't changed.
As you see, for the enabled buttons the BackColor have no effect.
And for the disabled buttons the background of it is always white and for the foreground is used a darken BackColor.

And in this screenshot

I have changed the BackColor of the buttons insetead of the ForeColor.
In this case, the Captions text is a darken BackColor of the button background.

I think, that this behaviour is very Windows-typical. And I don't know if it looks nice on Applications with an different LookAndFeel then the WindowsLookAndFeel.

Greatings
theuserbl

Rate this thread
WoltLab Burning Board