Results 1 to 10 of 10

Thread: oRFTButtonband.pkg without background color button (to Nils Svedmyr)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    420

    Default oRFTButtonband.pkg without background color button (to Nils Svedmyr)

    We have been using oRFTButtonband.pkg for years and have now discovered that the background color button is missing, which we desperately need. Is there a newer version that contains this button, or do you see a way to add it?

  2. #2
    Join Date
    Feb 2009
    Location
    Goteborg, Sweden
    Posts
    2,817

    Default 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?
    Nils Svedmyr
    RDC Tools International
    www.rdctools.com

    "Humor is reason gone mad"
    Groucho Marx

  3. #3
    Join Date
    Apr 2009
    Posts
    420

    Default 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.
    Last edited by Emil Preter; 14-May-2019 at 06:48 AM.

  4. #4
    Join Date
    Feb 2009
    Location
    Somewhere in Vermont, USA - unless I'm not
    Posts
    9,061

    Default 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"
    Garret

    "If you think you are too small to make a difference, try sleeping with a mosquito"

    -Dalai Lama




  5. #5
    Join Date
    Apr 2009
    Posts
    420

    Default Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)

    Set TextColor of oDbRichEditText to clRed here Textcolor knows the selected text

    Set Color of oDbRichEditText to clRed here Color doesn't know the selected range

  6. #6
    Join Date
    Feb 2009
    Location
    Somewhere in Vermont, USA - unless I'm not
    Posts
    9,061

    Default Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)

    Maybe Send Select_All of oDbRichEditText before setting Color?
    Garret

    "If you think you are too small to make a difference, try sleeping with a mosquito"

    -Dalai Lama




  7. #7
    Join Date
    Apr 2009
    Posts
    420

    Default Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)

    also select all doesn't help. It only fills the whole field with color but doesn't adjust the RTF language

  8. #8
    Join Date
    Feb 2009
    Location
    Somewhere in Vermont, USA - unless I'm not
    Posts
    9,061

    Default Re: oRFTButtonband.pkg without background color button (to Nils Svedmyr)

    Ah well - I thought it'd work since changing the TextColor does.

    Sorry!
    Garret

    "If you think you are too small to make a difference, try sleeping with a mosquito"

    -Dalai Lama




  9. #9
    Join Date
    Apr 2009
    Posts
    420

    Default 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
    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
    With the new oRTFButtoBand.pkg there is the problem that when using:
    Set TextBackColor of hoFocus to rgbTextColor
    the backgroundColor is mostly not transparent so that the text is not seen
    and after an additional " Set TextBackColor of hoFocus to rgbTextColor " 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:

    Set TextBackColor of oDbRichEditText to clYellow

    always shows the changing TextBackColor and also always the text is visible.

    I think there is additional to change also on other positions of oRTFButtonBand.pkg.


    Can you imaging what it may be?

    In the meantime I found it out:

    I had for the background color to build a new PKG:
    Use cCJChangeBackColorMenuItem.Pkg

    till now there was only for the text color this PKG:
    Use cCJChangeColorMenuItem.Pkg
    Last edited by Emil Preter; 15-May-2019 at 11:05 AM.

  10. #10
    Join Date
    Feb 2009
    Location
    Somewhere in Vermont, USA - unless I'm not
    Posts
    9,061

    Default 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.
    Garret

    "If you think you are too small to make a difference, try sleeping with a mosquito"

    -Dalai Lama




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •