Interactive

BJLBJL Brussels, Belgium
edited 7:13PM in FastReport 3.0
FR 3.04 and BCB6

Since the ClickObject method has a TfrxView* Sender, there is a need to cast Sender to the type TfrxMemoView* to be able to get the content of the memo.

The compiler indicates that frxMemoView is undefined. However, the header file contains the line
#include "frxClass.hpp"

I was trying:

void __fastcall TFormStatCG::frxReport1ClickObject(TfrxView *Sender,
TMouseButton Button, TShiftState Shift, bool &Modified)
{
TrfxMemoView* SenderM = NULL;
if (dynamic_cast<TfrxMemoView*>(Sender))
{
SenderM = Sender;
...
String S = SenderM->Memo->Text;
...
}
}

Thanks

BJL

Comments

  • BJLBJL Brussels, Belgium
    edited 7:13PM
    Sorry, there was a mistake in the code (letters swaped). The following code works well.

    void __fastcall TFormStatCG::frxReport1ClickObject(TfrxView *Sender,
    TMouseButton Button, TShiftState Shift, bool &Modified)
    {
    if (dynamic_cast<TfrxMemoView*>(Sender))
    {
    if (dynamic_cast<TfrxMemoView*>(Sender)->Name == "MemoCpte"
    && GraphCptes.Pos(dynamic_cast<TfrxMemoView*>(Sender)->Text) == 0)
    {
    String S = dynamic_cast<TfrxMemoView*>(Sender)->Text;
    S = S.SubString(1, S.Pos("\r\n") - 1);
    GraphCptes += S + ",";
    }
    }
    }

    BJL

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.