Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Command1/Text1 Enabled = False - not the expected behaviour
Hey everybody,
when setting
the caption is not greyed out!
It just does not look right at runtime.
It is fine at designtime though.
does not seem to change anything.
It should be greyed out and locked!
Dani
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
RE: Command1/Text1 Enabled = False - not the expected behaviour
when setting
![]()
Jabaco Source
1Command1.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.
Thanks for the info.
Quoted
![]()
Jabaco Source
1Text1.enabled = False
does not seem to change anything.
It should be greyed out and locked!
Bug is now fixed:
[ http://code.google.com/p/jabacoframework/source/detail?r=87 ]
[ Jabaco-rev87.jar ]
Greatings
theuserbl
Thanks a lot theuserbl,
for constantly updating the framework
I still did not give it a try myselfe
the problem I am facing here:
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
for constantly updating the framework
I still did not give it a try myselfe
the problem I am facing here:
Quoted
when setting
![]()
Jabaco Source
1Command1.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
Is it wrong?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)!
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 |
|
|
Source code |
1 |
-Dswing.systemlaf=com.sun.java.swing.plaf.motif.MotifLookAndFeel |
|
|
Source code |
1 |
-Dswing.systemlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel |
Greatings
theuserbl
Hmmm.. have again looked at it.
The Caption color is set with 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
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
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
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)
It looks more like an "emboss-effect". So not only a changed color.it looks like grey is mixed with white in VB!
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
Hey there theuserbl,
I had to come back to this!
I simply do not like the 'DisabledForeColor' so I did some more testing...

As you can see when we are working with a JLabel compared to JBLabel in the disabled state the foreground is greyed out.
But as soon as I pass a foreground color this color is also used when the control is disabled. So that is pretty much what you described above.
Still the default Java setting for a disabled control has a different foreground color.
When I outcomment the foreground property setting in the CommandButton.jsrc and then set a Command1.Enabled = False it changes its forecolor to grey of some sort!
That is actually the case with some other controls

But not all of them!
Frames change the forecolor even though they have the same foreground property.
I wonder why? Do you have any clou?
Do you think this is worth dealing with?
I have added a
to my project but of course thats only my systems color...
Dani
I had to come back to this!
I simply do not like the 'DisabledForeColor' so I did some more testing...
As you can see when we are working with a JLabel compared to JBLabel in the disabled state the foreground is greyed out.
But as soon as I pass a foreground color this color is also used when the control is disabled. So that is pretty much what you described above.
Still the default Java setting for a disabled control has a different foreground color.
When I outcomment the foreground property setting in the CommandButton.jsrc and then set a Command1.Enabled = False it changes its forecolor to grey of some sort!
That is actually the case with some other controls
But not all of them!
Frames change the forecolor even though they have the same foreground property.
I wonder why? Do you have any clou?
Do you think this is worth dealing with?
I have added a
|
|
Jabaco Source |
1 2 |
Public Property Let ForeColor(v As Long) If v = -2147483630 Then Exit Sub |
to my project but of course thats only my systems color...
Dani
Havn't much time at the moment.
But I want to say, that colors are everytime a problem in Jabaco.
For example the background of an RichTextBox and TextBox are on Windows white. On Linux it is in Jabaco-programs gray.
The default background of such an control in Java is on Linux white, too.
The reason is, that Jabaco uses for the background the java.awt.SystemColor.window, which is on Windows white and Linux gray.
The result is, that if I change the LookAndFeel of the Jabaco-program to Metal, the same program differes in color on Windows and Linux.
At
[ http://code.google.com/p/jabacoframework…nformation.java ]
are the negative numbers, which represent the system-colors of Jabaco.
The default colors for every control is defined in the file Jabaco.xml in the Jabaco-directory.
I would prefer, if Manual would add a System color called "Nothing" or "None", so that this happens, that no color will be set.
And I would prefer, if for all controls as default the "Nothing" or "None" would be set.
An additional problem ist, that the VB6-names of the System-color only exists in the IDE.
Desktop, Title.Active.Background, Title.Active.Foreground, Title.Inactive.Background, Title.Inactive.Foreground, Window.Background, Windows.Foreground, etc. are all only existing in the Jabco-IDE.
Greatimgs
theuserbl
But I want to say, that colors are everytime a problem in Jabaco.
For example the background of an RichTextBox and TextBox are on Windows white. On Linux it is in Jabaco-programs gray.
The default background of such an control in Java is on Linux white, too.
The reason is, that Jabaco uses for the background the java.awt.SystemColor.window, which is on Windows white and Linux gray.
The result is, that if I change the LookAndFeel of the Jabaco-program to Metal, the same program differes in color on Windows and Linux.
At
[ http://code.google.com/p/jabacoframework…nformation.java ]
are the negative numbers, which represent the system-colors of Jabaco.
The default colors for every control is defined in the file Jabaco.xml in the Jabaco-directory.
Quoted
I have added a
![]()
Jabaco Source
1 2 Public Property Let ForeColor(v As Long) If v = -2147483630 Then Exit Sub
to my project but of course thats only my systems color...
I would prefer, if Manual would add a System color called "Nothing" or "None", so that this happens, that no color will be set.
And I would prefer, if for all controls as default the "Nothing" or "None" would be set.
An additional problem ist, that the VB6-names of the System-color only exists in the IDE.
Desktop, Title.Active.Background, Title.Active.Foreground, Title.Inactive.Background, Title.Inactive.Foreground, Window.Background, Windows.Foreground, etc. are all only existing in the Jabco-IDE.
Greatimgs
theuserbl
Hey there theuserbl,
that is a great tip I did not know. Thanks!
...exactly my thoughts! I started playing with that...
I think that would be a good and flexible approach.
If a user wants to set a different color, no problem, the forecolor property is already there.
And of course you can already use it to set a different color for enabled=False.
There are always ways to work around these issues but it is not very efifcient.
Well, I guess we will have to wait some more then...
Thanks for now,
Dani
Quoted
The default colors for every control is defined in the file Jabaco.xml in the Jabaco-directory.
that is a great tip I did not know. Thanks!
Quoted
I would prefer, if Manual would add a System color called "Nothing" or "None", so that this happens, that no color will be set.
And I would prefer, if for all controls as default the "Nothing" or "None" would be set.
...exactly my thoughts! I started playing with that...
I think that would be a good and flexible approach.
If a user wants to set a different color, no problem, the forecolor property is already there.
And of course you can already use it to set a different color for enabled=False.
There are always ways to work around these issues but it is not very efifcient.
Well, I guess we will have to wait some more then...
Thanks for now,
Dani
Hey there theuserbl,
Quoted
The default colors for every control is defined in the file Jabaco.xml in the Jabaco-directory.
that is a great tip I did not know. Thanks!
This behavier makes also problems.
If it is not defined there, then in an enumeration the first one will be used and for number the 0 will be used.
Thats the reason why I begoin in the Anchor property with TopLeft. To have that as default.
Quoted
Quoted
I would prefer, if Manual would add a System color called "Nothing" or "None", so that this happens, that no color will be set.
And I would prefer, if for all controls as default the "Nothing" or "None" would be set.
...exactly my thoughts! I started playing with that...
Possibly it helps you to have the numbers behind the System colors:
In Visual Basic 6:
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
Scroll Bars = &H80000000& = -2147483648 Desktop = &H80000001& = -2147483647 Active Title Bar = &H80000002& = -2147483646 Inactive Title Bar = &H80000003& = -2147483645 Menu Bar = &H80000004& = -2147483644 Window Background = &H80000005& = -2147483643 Window Frame = &H80000006& = -2147483642 Menu Text = &H80000007& = -2147483641 Window Text = &H80000008& = -2147483640 Active Title Bar Text = &H80000009& = -2147483639 Active Border = &H8000000A& = -2147483638 Inactive Border = &H8000000B& = -2147483637 Application Workspace = &H8000000C& = -2147483636 Highlight = &H8000000D& = -2147483635 Highlight Text = &H8000000E& = -2147483634 Button Face = &H8000000F& = -2147483633 Button Shadow = &H80000010& = -2147483632 Disabled Text = &H80000011& = -2147483631 Button Text = &H80000012& = -2147483630 Inactive Title Bar Text = &H80000013& = -2147483629 Button Highlight = &H80000014& = -2147483628 Button Dark Shadow = &H80000015& = -2147483627 Button Light Shadow = &H80000016& = -2147483626 ToolTip Text = &H80000017& = -2147483625 ToolTip = &H80000018& = -2147483624 |
In Jabaco:
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Desktop = -2147483647 Title.Active.Backcolor = -2147483646 Title.Active.Forecolor = -2147483639 Title.Inactive.Backcolor = -2147483645 Title.Inactive.Forecolor = -2147483629 Window.Backcolor = -2147483643 Window.Forecolor = -2147483640 Window.Border = -2147483642 Control.Backcolor = -2147483633 Control.Forecolor = -2147483630 Control.Disabled = -2147483631 Border.Active = -2147483638 Border.Inactive = -2147483637 Shadow.Dark = -2147483627 Shadow.Light = -2147483626 Selection.Backcolor = -2147483635 Selection.Forecolor = -2147483634 Menu.Backcolor = -2147483644 Menu.ForeColor = -2147483641 Tooltip.Backcolor = -2147483624 Tooltip.Forecolor = -2147483625 |
In VB.NET all Systems Colors are in System.Drawing.SystemColors
For example System.Drawing.SystemColors.Desktop
But in VB.NET it returns a Color not a number.
Only for information
Greatings
theuserbl
Only wanted to say, that the number -1 for no color would nice.
But if you set it as default, it have to be in the XML-file set.
And I am unsure, if it is a good idea, tpo say, that people have not only replacing Jabaco.jar with a newer one, they have also replace the xml-file.
And in the xml-file Jabaco saves settings, like the last opend files. If the xml-file will be replaced, the list of the last opend files are lost.
Greatings
theuserbl
But if you set it as default, it have to be in the XML-file set.
And I am unsure, if it is a good idea, tpo say, that people have not only replacing Jabaco.jar with a newer one, they have also replace the xml-file.
And in the xml-file Jabaco saves settings, like the last opend files. If the xml-file will be replaced, the list of the last opend files are lost.
Greatings
theuserbl
Similar threads
-
Tips, Tricks, Samples & Tutorials »-
Present Snatch
(Nov 15th 2011, 8:14am)
-
Tips, Tricks, Samples & Tutorials »-
ORPG in Jabaco-applet
(Apr 19th 2010, 11:55pm)
-
Bugreports and known bugs »-
[VERSION 1.5.2] Dialog behaves visually as if set .enabled=False
(Oct 31st 2011, 7:43pm)
-
General topics, questions and discussions »-
Empty String
(Sep 26th 2011, 6:10pm)
-
Visual Basic 6 Compatibility »-
WebBrowser
(Sep 21st 2009, 5:49pm)
