No blinking cursor in textbox
My Jabaco applications suffer from a minor problem in TextBox controls.
When I set the mouse cursor into the TextBox area, no blinking cursor is shown.
It is not visible to the user that the TextBox actually has the focus and is waiting for user entries.
Any idea how to circumvent that?
Greetings
A1880
When I set the mouse cursor into the TextBox area, no blinking cursor is shown.
It is not visible to the user that the TextBox actually has the focus and is waiting for user entries.
Any idea how to circumvent that?
Greetings
A1880
Look at this:
http://code.google.com/p/jabacoframework…tBox.jsrc&old=9
There OlimilO have added tne line
which makes this problem.
I know what he wanted with it. A cursor with negative colors. So that you see on a black background still a cursor/carret with white color.
But it don't work correct and makes this problem.
Don't know, which would be the best solution to fix it. I see three possibilities:
1. Outcomment this line.
2. Writing instead
Then the carret have everytime the color of the foreground. Don't know if it already do it, if I would outcommenting it.
3. Trying to create a negative color. So that the foreground color is not important. Only the backgroundcolor.Currently I would have this solution for this:
But don't know, which of the three possibilities would be the better one. How works VB6?
http://code.google.com/p/jabacoframework…tBox.jsrc&old=9
There OlimilO have added tne line
|
|
Jabaco Source |
1 |
Parent.setCaretColor(RGBtoColor(NotRGB(v))) |
I know what he wanted with it. A cursor with negative colors. So that you see on a black background still a cursor/carret with white color.
But it don't work correct and makes this problem.
Don't know, which would be the best solution to fix it. I see three possibilities:
1. Outcomment this line.
2. Writing instead
|
|
Jabaco Source |
1 |
Parent.setCaretColor(Parent.getForeground()) |
3. Trying to create a negative color. So that the foreground color is not important. Only the backgroundcolor.Currently I would have this solution for this:
|
|
Jabaco Source |
1 |
Parent.setCaretColor(RGB (Parent.getBackground.getBlue XOR 255, Parent.getBackground.getGreen XOR 255, Parent.getBackground.getRed XOR 255)) |
But don't know, which of the three possibilities would be the better one. How works VB6?
This post has been edited 2 times, last edit by "theuserbl" (Jan 28th 2011, 8:56pm)
Quoted
Public Property Let BackColor(v As Long)
Parent.setBackground(RGBtoColor(v))
Base.setBackground(Parent.getBackground())
Parent.setCaretColor(RGBtoColor(NotRGB(v)))
End Property
The line is in the BackColor Property. I have the same issue in my program but if I set the BackColor of the textfield while the program runs, the caret is perfekt afterwards.
I dunno if changing the lines as suggested will solve the problem as it uses the same information at the same point as the not working one.
The same is when i change the backcolor in the IDE.
During run the color remains white, i have to modify the color while the program runs.
Maybe the Init of the textbox has a problem, it looks the textbox is built but not komplet set correct.
I am not a big programmer just my 5c, maybe it helps.
O.O You are right. Thanks for that info.
Quoted
The line is in the BackColor Property. I have the same issue in my program but if I set the BackColor of the textfield while the program runs, the caret is perfekt afterwards.
The BackColor Property is right implemented, so I have looked at the NotRGB implementation.
But NotRGB is right implemented, too:
http://code.google.com/p/jabacoframework…c=svn81&r=81#94
And NotRGB works in Java-programs perfet.
And now you they, that it works during running ok, whats true.
Right.
Quoted
I dunno if changing the lines as suggested will solve the problem as it uses the same information at the same point as the not working one.
Ok. Thanks. That clarify all.
Quoted
The same is when i change the backcolor in the IDE.
When you see after starting the IDE the BackColor white as 255;255;255 , then it is not really that color.
At first, there don't exists a special color. The color after starting the IDE is at first "Selection.Backcolor".
And "Selection.Backcolor" can be on different systems different. It is a system-color.
If you choose "Selection.Backcolor" it gives to RGBtoColor the color number -2147483635 which is as hex 8000000D. RGBtoColor looks for this system color number and give calls the right Java system color:
http://code.google.com/p/jabacoframework…rmation.java#30
But in
Parent.setCaretColor(RGBtoColor(NotRGB(v)))
NotRGB is called before RGBtoColor, because RGBtoColor return a color not a long integer.
So a hex 8000000D is after the NotRGB a hex 80FFFFF2. 80 is the alfha chanal. So the normal color is FFFFF2 => Red 255, Green 255, Blue 242.
Hmm.. a color which is not white and you can still differ from white. Possible the alpha chanel 80 gives the rest, so that you can not see the carret.
Have more to look at it a
MsgBox( RGBtoColor(-2147483635) )
gives out a ""java.awt.SystemColor[i=14]"
and a
MsgBox( RGBtoColor(255) )
gives out "java.awt.Color[r=255, g=0, b=0]"
Ok. Right.
Quoted
During run the color remains white, i have to modify the color while the program runs.
I think there problem have more to do with handling of system colors.
Quoted
Maybe the Init of the textbox has a problem, it looks the textbox is built but not komplet set correct.
Yes, it helps much to find the bug. Thanks.
Quoted
I am not a big programmer just my 5c, maybe it helps.
Nice that my thoughts helped you.
As an interim solution I use the following code, it sets each used Text field to the defined color white.
(Also @A1880)
After this, caret works perfekt.
As an interim solution I use the following code, it sets each used Text field to the defined color white.
(Also @A1880)
|
|
Source code |
1 2 3 4 5 6 |
Public Sub Applet_Init() Dim wt As Long = RGB(255, 255, 255) Text1.BackColor = wt Text2.BackColor = wt Text3.BackColor = wt End Sub |
After this, caret works perfekt.
No blinking cursor ... and some other!
Did anyone come up with a fix to this yet?
Also:
1. when I set a mouse listener for example tp a Jbgrid I can't get Me.mousepointer = vbHoureglass / vbDefault to work
--> does anyone know when setting a mouse listener to the JbGrid header, how to change the mousecursor?
2. at runtime when I set a Textbox (or other control) to FontBold nothing happens!
Thanks ...
Also:
1. when I set a mouse listener for example tp a Jbgrid I can't get Me.mousepointer = vbHoureglass / vbDefault to work
--> does anyone know when setting a mouse listener to the JbGrid header, how to change the mousecursor?
2. at runtime when I set a Textbox (or other control) to FontBold nothing happens!
Thanks ...
RE: No blinking cursor ... and some other!
Did anyone come up with a fix to this yet?
Thx for the reminder. Will be updated the next time.
Quoted
1. when I set a mouse listener for example tp a Jbgrid I can't get Me.mousepointer = vbHoureglass / vbDefault to work
--> does anyone know when setting a mouse listener to the JbGrid header, how to change the mousecursor?
Currently not tested. I will look at it the next times.
Quoted
2. at runtime when I set a Textbox (or other control) to FontBold nothing happens!
I have tried it out and it works perfect.
|
|
Jabaco Source |
1 2 3 |
Public Sub Command1_Click() Text1.FontBold = True End Sub |
works fine on my computer.
OK, here is the scenario for my .FontBold Problem. It has nothing to do with a XP theme.
In either case cmdChangeSettings.FontBold = False will not happen and prgRef.tmpBool1 = False seems not to be addressed!
When I define Dim tmpBool1 as Boolen locally in the Sub it works for the variable.
cmdChangeSettings.FontBold = False stays Bold
Any thoughts on this one?
Dani
|
|
Jabaco Source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
' in a module Global prgRef As tPrgRef 'ProgRef Referenz Array...about 20 values! Type tPrgRef tmpBool1 As Boolean = False End Type ' in a frm Public Sub cmdChangeSettings_Click() cmdChangeSettings.FontBold = True Dim dlgChangeSettings1 As New dlgChangeSettings dlgChangeSettings1.Show(1) prgRef.tmpBool1 = False If prgRef.tmpBool1 = False Then cmdChangeSettings.FontBold = False cmdChangeSettings.FontBold = False 'grdMain_init End Sub |
In either case cmdChangeSettings.FontBold = False will not happen and prgRef.tmpBool1 = False seems not to be addressed!
When I define Dim tmpBool1 as Boolen locally in the Sub it works for the variable.
cmdChangeSettings.FontBold = False stays Bold
Any thoughts on this one?
Dani
RE: No blinking cursor ... and some other!
New Version of the files:
[ Jabaco-rev84.jar ]
[ FrameworkTest-rev84.jar ]
[ FrameworkTest-rev84-OnTheFly.zip ]
[ jabacoframework-src-rev84.zip ]
Normally you need only Jabaco-rev84.jar. Rename it to Jabaco.jar and copy it in your Jabaco-directory.
Greatings
theuserbl
[ Jabaco-rev84.jar ]
[ FrameworkTest-rev84.jar ]
[ FrameworkTest-rev84-OnTheFly.zip ]
[ jabacoframework-src-rev84.zip ]
Normally you need only Jabaco-rev84.jar. Rename it to Jabaco.jar and copy it in your Jabaco-directory.
Yes. Done.Did anyone come up with a fix to this yet?
Fixed.
Quoted
2. at runtime when I set a Textbox (or other control) to FontBold nothing happens!
Currently still not looked at it.
Quoted
1. when I set a mouse listener for example tp a Jbgrid I can't get Me.mousepointer = vbHoureglass / vbDefault to work
--> does anyone know when setting a mouse listener to the JbGrid header, how to change the mousecursor?
Greatings
theuserbl
Hey everybody,
here is some more about Fonts:
.FontBold does not change!!
In the JBGrid it is possible to set every cell to a different FontColor
But when a cell is selected the FontColor turns to a Default ForeColor. Is there any way to prevent that?
So it would stay red and only the BackColor changes!
Dani
here is some more about Fonts:
|
|
Jabaco Source |
1 2 3 4 5 |
' JBGrid Public Sub Form_Load() grdTest.TextMatrix(0, 0) = "Test" grdTest.DataMatrix(0, 0).FontBold = True End Sub |
.FontBold does not change!!
In the JBGrid it is possible to set every cell to a different FontColor
|
|
Jabaco Source |
1 |
grdTest.DataMatrix(0, 0).CellForeColor = vbred |
But when a cell is selected the FontColor turns to a Default ForeColor. Is there any way to prevent that?
So it would stay red and only the BackColor changes!
Dani
Similar threads
-
General topics, questions and discussions »-
Enterkey behaviour
(Apr 16th 2010, 10:37am)
-
General topics, questions and discussions »-
Bug?
(Apr 21st 2009, 5:48pm)
-
Allgemeine Themen, Fragen und Diskussionen »-
Cursor in Textbox immer schwarz?
(Oct 6th 2009, 5:03pm)
-
General topics, questions and discussions »-
Framework bugs
(Jul 19th 2009, 6:29pm)
