Leider kann ich nicht sagen, dass orange Cursor meinen Geschmack treffen.
Aber hier habe ich eine Weg, wie man Cursor orange färbt:
Beim "setCaretColor(orange)" kommt ein inverses orange heraus, das eher nach Türkis aussieht.
Daher habe ich die RGB-Bits als "Not orange" invertiert. Der Cursor sollte ja orange leuchten.
Merkwürdigerweise führt "Color.orange" statt "RGB(255, 163, 0)" nicht zum Ziel sondern wirft eine Runtime-Exception.
Das gehört noch zum unerforschten Java-Land ....
Gruß!
A1880
Aber hier habe ich eine Weg, wie man Cursor orange färbt:
|
|
Jabaco Source |
1 2 3 4 5 6 7 8 9 |
Public Sub Form_Load() Dim orange As Long = RGB(255, 163, 0) Dim black As Long = RGB(0, 0, 0) Text1.BackColor = black Text1.ForeColor = orange ' Text1.Parent.setCaretColor(orange) Text1.Parent.setCaretColor(Not Orange) End Sub |
Beim "setCaretColor(orange)" kommt ein inverses orange heraus, das eher nach Türkis aussieht.
Daher habe ich die RGB-Bits als "Not orange" invertiert. Der Cursor sollte ja orange leuchten.
Merkwürdigerweise führt "Color.orange" statt "RGB(255, 163, 0)" nicht zum Ziel sondern wirft eine Runtime-Exception.
Das gehört noch zum unerforschten Java-Land ....
Gruß!
A1880
Hi,
in VB6 ist die Function RGBim Modul Information zu finden. Für Jabaco auch, außerdem gibt es da noch die Funktionen
* ColortoRGB
* RGBtoColor
das mit setCaretColor ist ein guter Tipp.
Frage: sollte man so wie in VB6 die Cursor-Farbe automatisch auf die complementäre Hintergrundfarbe setzen?
die Geschichte mit Not hab ich jetzt in einer MiniFunktion (in Information) gelöst:
bzw.:
Grüße
OlimilO
in VB6 ist die Function RGBim Modul Information zu finden. Für Jabaco auch, außerdem gibt es da noch die Funktionen
* ColortoRGB
* RGBtoColor
das mit setCaretColor ist ein guter Tipp.
Frage: sollte man so wie in VB6 die Cursor-Farbe automatisch auf die complementäre Hintergrundfarbe setzen?
die Geschichte mit Not hab ich jetzt in einer MiniFunktion (in Information) gelöst:
|
|
Jabaco Source |
1 2 3 4 5 |
Dim orangeColor As Color = Color.orange Dim orangeRGB As Long = ColortoRGB(orangeColor) Text1.BackColor = vbBlack Text1.ForeColor = orangeRGB Text1.Parent.setCaretColor(RGBtoColor(NotRGB(OrangeRGB))) |
|
|
Jabaco Source |
1 2 3 |
Function NotRGB(col As Long) As Long NotRGB = (&HFFFFFF And (Not col)) End Function |
bzw.:
|
|
Source code |
1 2 3 |
public static long NotRGB(long RGB) {
return (long)(0xFFFFFFL & (~ RGB))
}
|
Grüße
OlimilO
Ganz ohne Gewese geht es so:
Aus der Anweisung:
Macht Jabaco den Code:
Und der geht offenbar, zumindest bei manchen Farben, übel auf die Bretter.
Vielleicht wäre es besser, keine automatische Konversion von Objekten auf "Long" zu versuchen.
Gruß!
A1880
|
|
Jabaco Source |
1 2 3 4 5 |
Public Sub Form_Load() text1.Parent.setForeground color.orange text1.Parent.setBackground color.black Text1.Parent.setCaretColor color.orange End Sub |
Aus der Anweisung:
|
|
Source code |
1 |
text1.ForeColor = color.orange |
Macht Jabaco den Code:
|
|
Source code |
1 |
Text1.$ForeColor(Double.valueOf(Color.orange.toString()).longValue()); |
Und der geht offenbar, zumindest bei manchen Farben, übel auf die Bretter.
Vielleicht wäre es besser, keine automatische Konversion von Objekten auf "Long" zu versuchen.
Gruß!
A1880
Quoted
Vielleicht wäre es besser, keine automatische Konversion von Objekten auf "Long" zu versuchen.
Yes exactly, use
|
|
Jabaco Source |
1 |
Option Strict On |
Java has a strict type system. VB6 has not. This is why Jabaco has to do some conversions in order to simulate VB-behaviour.
Better not try to assign a variable of type Color to a property of type Long.
OlimilO
Similar threads
-
General topics, questions and discussions »-
Resize
(Sep 5th 2009, 11:27pm)
-
General topics, questions and discussions »-
Bug?
(Apr 21st 2009, 5:48pm)
-
General topics, questions and discussions »-
Framework bugs
(Jul 19th 2009, 6:29pm)
-
General topics, questions and discussions »-
Event Handling
(Mar 28th 2009, 11:06am)
