Hi Support,
I use the tool bar AdvRichEditorInsertRibbonToolBar and I want to know if it is possible to add one more item into the list of items in the drop box on the left (holds special characters such as copy right, Registered, TM, etc. Could I add the Deg (the little zero to the top left of Deg. C) symbol or more characters as needed?
Regards
You can access this dropdown picker and the list of items it has via:
AdvRichEditorFormatToolBar.SymbolPicker.Tools
Hi Bruno,
Thanks for your reply. Before I go and change a whole lot of code. The toolbar you refer to is not the insert ribbon tool bar I am referring to. The modules that I could use that you referred me to does not have format module I can load. The style of the tool bar does not really fit the form I am working with, and I would need the format tool for is the Insert ribbon type toolbar. However, I could be missing something. I have checked through all the components I have in my paid version of TMS VCL UI components, and I just don't see a component that refers to formatting the ribbon tool bar.
Is there a work around?
Regards
Tom Dalton
Sorry, with auto completion, the first entry returned here was AdvRichEditorFormatToolBar so I confused.
With TAdvRichEditorInsertRibbonToolBar, you can use:
with AdvRichEditorInsertRibbonToolBar1.Controls[2] as TAdvOfficeToolSelector do begin
// access the symbol picker here
end;
Hello Bruno,
Okay, I am this far:
procedure TAddSampleDetails.AdvRichEditorInsertRibbonToolBar1Click(
Sender: TObject);
Var I: integer;
CharAdd : boolean;
begin
With AdvRichEditorInsertRibbonToolBar1.Controls[2] as TAdvOfficeToolSelector do
begin
CharAdd := True;
For I := 0 to Tools.Count - 1 do
begin
If Tools.Items[I].Value = String(char(248)) then
CharAdd:=false;
end;
If CharAdd then
Tools.Add.Value := String(char(248));
end;
end;
It adds a value but not the Deg.C symbol. As far as I know it should be Char(248).
What I am not sure about is add this as a string?
Regards
Tom
The tool value text in the dropdownn is set with:
Tools.Add.Caption := String(char(248));
Hi Bruno,
Great, thank you, it is working. Just trying figure out which codes are to be used. The one I used did not give me the desired symbols.
However, herewith is the code that firstly checks to see if the symbol is loaded and then adds then if not found. Just so that you don't get multiple duplicates:
With AdvRichEditorInsertRibbonToolBar1.Controls[2] as TAdvOfficeToolSelector do
begin
CharAdd := True;
For I := 0 to Tools.Count - 1 do
begin
MyStr := Tools.Items[I].Caption;
If Tools.Items[I].Caption = String(Char(0176)) then
CharAdd:=false;
end;
If CharAdd then
begin
Tools.Add.Caption := String(Char(0176));
Tools.Add.Caption := String(Char(0181));
Tools.Add.Caption := String(Char(8467));
end;
end;
It does assume that the additional symbols are not loaded if the first new is not found.
Regards
Tom