oRFTButtonband.pkg without background color button (to Nils Svedmyr)
We have been using oRFTButtonband.pkg for years and have now discovered that the [B]background color button[/B] is missing, which we desperately need. Is there a newer version that contains this button, or do you see a way to add it?
Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)
Hi Emil,
I'm not sure I understand. There is the "oColorButton" object that sets the "TextColor" for text.
Are you asking if I could add a button that sets the "TextBackColor" for the entire RichEdit control?
Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)
Yes it would be nice if you could add a button that sets the "TextBackColor" for the entire RichEdit control.
I think this would be nearly same as to color the text, only to change "TextColor" with an other parameter which I unfortunately don't know:
Till now I have to write the needed text in word and then there to format the text and then with copy/paste to copy the formatted text in my cDbRichEditor field.
Most time I need it for RepiortWriter where you can't format fields with background color only normal text fields.
Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)
You could just copy the Text color button & change it to set "Color" instead of "TextColor"
Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)
Set TextColor of oDbRichEditText to clRed [B]here[/B] [B]Textcolor knows the selected text[/B]
Set Color of oDbRichEditText to clRed [B]here Color doesn't know the selected range[/B]
Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)
Maybe Send Select_All of oDbRichEditText before setting Color?
Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)
also [B]select all[/B] doesn't help. It only fills the whole field with color but doesn't adjust the RTF language
Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)
Ah well - I thought it'd work since changing the TextColor does.
Sorry!
Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)
I have now added to oRTFButtonBand.pkg:
[CODE]
//****************************************************************************
// This object shows a bitmap to indicate that the user can select a color
// for the text
//****************************************************************************
Object oColorBackButton is a cCJRTFMenuItem
Set pbControlBeginGroup to True
Set psCaption to "Farbe"
Set psDescription to "Text^Backfarbe ändern"
Set psImage to "ColorPalette.Ico"
Set peControlType to xtpControlSplitButtonPopup
Object oBlackMenuItem is a cCJChangeColorMenuItem
Set psImage to "Black40x12.Ico"
Set psCaption to "Schwarz"
Set psDescription to "Change the Color to Black"
Set peColor to clBlack
End_Object
Object oMaroonMenuItem is a cCJChangeColorMenuItem
Set peColor to clMaroon
Set psImage to "Maroon40x12.Ico"
Set psCaption to "Kastanienbraun"
Set psDescription to "Change the Color to Maroon"
End_Object
Object oGreenMenuItem is a cCJChangeColorMenuItem
Set peColor to clGreen
Set psImage to "Green40x12.Ico"
Set psCaption to "Grün"
Set psDescription to "Change the Color to Green"
End_Object
Object oOliveMenuItem is a cCJChangeColorMenuItem
Set peColor to clOlive
Set psImage to "Olive40x12.Ico"
Set psCaption to "Olivgrün"
Set psDescription to "Change the Color to Olive"
End_Object
Object oNavyMenuItem is a cCJChangeColorMenuItem
Set peColor to clNavy
Set psImage to "Navy40x12.Ico"
Set psCaption to "Marineblau"
Set psDescription to "Change the Color to Navy"
End_Object
Object oPurpleMenuItem is a cCJChangeColorMenuItem
Set peColor to clPurple
Set psImage to "Purple40x12.Ico"
Set psCaption to "Lila"
Set psDescription to "Change the Color to Purple"
End_Object
Object oTealMenuItem is a cCJChangeColorMenuItem
Set peColor to clTeal
Set psImage to "Teal40x12.Ico"
Set psCaption to "Blaugrün"
Set psDescription to "Change the Color to Teal"
End_Object
Object oGrayMenuItem is a cCJChangeColorMenuItem
Set peColor to clGray
Set psImage to "Gray40x12.Ico"
Set psCaption to "Grau"
Set psDescription to "Change the Color to Gray"
End_Object
Object oSilverMenuItem is a cCJChangeColorMenuItem
Set peColor to clSilver
Set psImage to "Silver40x12.Ico"
Set psCaption to "Silber"
Set psDescription to "Change the Color to Silver"
End_Object
Object oRedMenuItem is a cCJChangeColorMenuItem
Set peColor to clRed
Set psImage to "Red40x12.Ico"
Set psCaption to "Rot"
Set psDescription to "Change the Color to Red"
End_Object
Object oLimeMenuItem is a cCJChangeColorMenuItem
Set peColor to clLime
Set psImage to "Lime40x12.Ico"
Set psCaption to "Gelbgrün"
Set psDescription to "Change the Color to Lime"
End_Object
Object oYellowMenuItem is a cCJChangeColorMenuItem
Set peColor to clYellow
Set psImage to "Yellow40x12.Ico"
Set psCaption to "Gelb"
Set psDescription to "Change the Color to Yellow"
End_Object
Object oBlueMenuItem is a cCJChangeColorMenuItem
Set peColor to clBlue
Set psImage to "Blue40x12.Ico"
Set psCaption to "Blau"
Set psDescription to "Change the Color to Blue"
End_Object
Object oFuchsiaMenuItem is a cCJChangeColorMenuItem
Set peColor to clFuchsia
Set psImage to "Fuchsia40x12.Ico"
Set psCaption to "Violett"
Set psDescription to "Change the Color to Fuchsia"
End_Object
Object oAquaMenuItem is a cCJChangeColorMenuItem
Set peColor to clAqua
Set psImage to "Aqua40x12.Ico"
Set psCaption to "Aquamarin"
Set psDescription to "Change the Color to Aqua"
End_Object
Object oWhiteMenuItem is a cCJChangeColorMenuItem
Set peColor to clWhite
Set psImage to "White40x12.Ico"
Set psCaption to "Weiß"
Set psDescription to "Change the Color to White"
End_Object
//****************************************************************************
// Send a message to open the background color selector dialog
//****************************************************************************
Procedure OnExecute Variant vCommandBarControl
Handle hoFocus hoColorSelector
Integer rgbTextColor
Boolean bColorSelected bIsRichEdit
Get IsFocusRichEditControl (&hoFocus) to bIsRichEdit
If (bIsRichEdit) Begin
Get TextBackColor of hoFocus to rgbTextColor
Get Create U_ColorDialog to hoColorSelector
If (hoColorSelector > 0) Begin
Set SelectedColor of hoColorSelector to rgbTextColor
Get Show_Dialog of hoColorSelector to bColorSelected
If (bColorSelected) Begin
Get SelectedColor of hoColorSelector to rgbTextColor
Set TextBackColor of hoFocus to rgbTextColor
End
Send Destroy of hoColorSelector
End
End
End_Procedure
End_Object
[/CODE]
and in an other view to test without oRTFButtonBand.pkg:
[CODE] Object oBYellow is a Button
Set Size to 16 17
Set Location to 197 330
Set Bitmap to "yellow.bmp"
Set Label to "Yellow"
Set peAnchors to anBottomLeft
Procedure OnClick
Set TextBackColor of oDbRichEditText to clYellow
End_Procedure
End_Object
Object oBWhite is a Button
Set Size to 16 17
Set Location to 197 360
Set Bitmap to "White.bmp"
Set Label to "Weiß"
Set peAnchors to anBottomLeft
Procedure OnClick
Set TextBackColor of oDbRichEditText to clWhite
End_Procedure
[/CODE]
With the new oRTFButtoBand.pkg there is the problem that when using:
[B]Set TextBackColor of hoFocus to rgbTextColor[/B]
the backgroundColor is mostly not transparent so that the text is not seen
and after an additional " [B]Set TextBackColor of hoFocus to rgbTextColor[/B] " the new BackColor isn't set.
I have seen that cf and highlight then are not correct indexed.
If I use the second view without oRTFButtonband.pkg:
[B]Set TextBackColor of oDbRichEditText to clYellow
[/B]
always shows the changing TextBackColor and also always the text is visible.
[B][COLOR=#ff0000]I think there is additional to change also on other positions of oRTFButtonBand.pkg.
[/COLOR][/B]
Can you imaging what it may be?
[B]In the meantime I found it out:
[/B]
[COLOR=#ff0000]I had for the background color to build a new PKG:[/COLOR]
Use cCJChangeBackColorMenuItem.Pkg
till now there was only for the text color this PKG:
Use cCJChangeColorMenuItem.Pkg
Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)
Sorry - I don't know. I don't have the pkg as I use an entirely different setup.