Jump to content

uniHtmlMemo: reduce toolbar functions


erich.wanker

Recommended Posts

Hi ..

is it possible to reduce the toolbar functions with some javascript-code ???:

 

i need:

just 1 font (Arial) 

just 2 colors (black and red)

Textfunctions:

bold, cursive, underline,

bigger and smaller

 

 

Hope someone can help :-)

ThanX

Erich

Link to comment
Share on other sites

Hy Sherzod :-)

thanx for answer - BUT ..;-) it has nothing to do with the question :-)

 

i need a uniHTMLMemo with JUST 1 Font, 2 Colors(black and red) .. and text-manipulation for (bold, cursive, underline, bigger and smaller)

 

ThanX for infos

Erich

Link to comment
Share on other sites

On 8/7/2020 at 11:54 PM, erich.wanker said:

it has nothing to do with the question :-)

 

On 8/7/2020 at 11:54 PM, erich.wanker said:

underline

 

 

On 8/7/2020 at 4:32 PM, Sherzod said:

For example like this:

 

At least have you tried this code!?

procedure TMainForm.UniButton4Click(Sender: TObject);
begin
  UniHTMLMemo1.JSInterface.JSCall('execCmd', ['underline']);
end;

 

Link to comment
Share on other sites

Hy Sherzod :-)

nice greetings from austria ... thanX .. now i understand :-)
i can set the toolbar invisible - and create my own needed buttons .. OK ... sorry for my stupidity.. ;-)

Now i have a new problem: where can i find all possible commands...?

 

  • UniHTMLMemo1.JSInterface.JSCall('execCmd', ['   *****for bold*****   ']);
  • UniHTMLMemo1.JSInterface.JSCall('execCmd', ['   *****for italian*****   ']);
  • UniHTMLMemo1.JSInterface.JSCall('execCmd', ['   *****for Red font color *****   ']);
  • UniHTMLMemo1.JSInterface.JSCall('execCmd', ['   *****for bigger font *****   ']);
  • UniHTMLMemo1.JSInterface.JSCall('execCmd', ['   *****for smaller font *****   ']);
  • ....
Link to comment
Share on other sites

16 hours ago, erich.wanker said:
  • UniHTMLMemo1.JSInterface.JSCall('execCmd', ['   *****for bold*****   ']);
  • UniHTMLMemo1.JSInterface.JSCall('execCmd', ['   *****for italian*****   ']);
  • UniHTMLMemo1.JSInterface.JSCall('execCmd', ['   *****for Red font color *****   ']);
  • UniHTMLMemo1.JSInterface.JSCall('execCmd', ['   *****for bigger font *****   ']);
  • UniHTMLMemo1.JSInterface.JSCall('execCmd', ['   *****for smaller font *****   ']);

Hi,

JSCall('execCmd', ['bold']);
JSCall('execCmd', ['italic']);
JSCall('execCmd', ['FontSize', 5]); // 0-7

 

16 hours ago, erich.wanker said:

*****for Red font color *****

1. htmlMemo... -> UniEvents

function beforeInit(sender, config) 
{
    this.setColor = function(color) {
        this.execCmd('forecolor', Ext.isWebKit || Ext.isIE ? '#'+color : color);
        this.deferFocus();
    };
    
    this.setBGColor = function(color) {
        if (Ext.isGecko) {
            this.execCmd('useCSS', false);
            this.execCmd('hilitecolor', color);
            this.execCmd('useCSS', true);
            this.deferFocus();
        } else {
            this.execCmd(Ext.isOpera ? 'hilitecolor' : 'backcolor', Ext.isWebKit || Ext.isIE ? '#' + color : color);
            this.deferFocus();
        }
    }
}

2. Usage:

  UniHTMLMemo1.JSInterface.JSCall('setColor', ['FF0000']);
  UniHTMLMemo1.JSInterface.JSCall('setBGColor', ['FF0000']);

 

  • Upvote 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...