Hello,
I would like to use the mini HTML capacities of the TMSFNCGrid and thought about to use the TMSFNCRichEditor & TMSFNCRichEditorHTMLIO for that. I declared the TMSFNCRichEditor as custom editor in
procedure TFormMain.FNCGridGetCellEditorType(Sender: TObject; ACol, ARow: Integer; var CellEditorType: TTMSFNCGridEditorType);
begin
if ACol = 3 then
begin
CellEditorType:= etCustom;
end;
end;
procedure TFormMain.FNCGridGetCellEditorCustomClassType(Sender: TObject; ACol,
ARow: Integer; var CellEditorCustomClassType: TTMSFNCGridEditorClass);
begin
if(ACol= 3) then
begin
CellEditorCustomClassType:= TTMSFNCRichEditor;
end;
end;
That is working so far, but after entering and leaving the cell an exception occurs
The grid frees the cell editor (the TMSFNCGrid) and finally in
procedure TTMSFNCRichEditor.DoExit;
begin
inherited;
Refresh;
end;
The exception is thrown when executing the Refresh
Any workaround for that?
Best regards
Sorry, forgot to say
Lazarus trunk / fpc 3.0 / Windows7
Thanks for reporting. We've applied a fix. Next update will have this fix.
Thank you,
can you pls provide an example how to implement the HTML reading/writing from/to the grid cell?
I guess currently its only possible with the TMSFNCRichEditorHTMLIO and reading/writing the HTML content by streams and converting it from/to strings. Any better suggestions?
Thank you and with best regards
I have created a sample that you can download here:
Thank you, thats even more easier. Waiting for the next package release
Hello,
is it possible to inquire the needed cell height for the HTML-Text to adjust the row height after leaving the cell editor?
With best regards
Sorry, the TMSFNCRichEditor does not expose this yet. We'll consider to add such function in a future update.
Should the TTMSFNCHTMLText control be capable to display multiline HTML text copied from the TMSFNCRichEditor?
I made a quick test and right now its not showing any text in different fontsizes. Also bold and strikeout attributes are not display by just copying by
HTMLText.Text:= RTFEditor.ContentAsHTML();
Best regards
The TTMSFNCHTMLText is limited to mini HTML: http://www.tmssoftware.com/site/minihtml.asp and therefore, it will not be 100% compatible with the full HTML handled in TMSFNCRichEditor.
I see, but the TTMSFNCHTMLText capabilities should be at least the same as for the TTMSFNCGrid cell?
The grid cell itself can also render HTML based on the miniHTML engine.
This is working as expected with the following code:
TMSFNCHTMLText1.Text := '<font size="14">14</font><br/><font size="16">16</font><br/><font size="18">18</font>';
Seems not working under Lazarus 1.6 / fpc 3.0 / win32 widgets / Windows7
How to send you a demo exe?
With best regards