trichview.com

trichview.support




OnCaretMove & enable / disable buttons for tables


Return to index


Author

Message

Pieter E.

Posted: 02/11/2005 16:03:46


Dear Sergey,


I've got the following code in the OnCaretMove:


void __fastcall TForm1::rveCaretMove(TObject *Sender)

{

TCustomRichViewEdit *Custrve;

TCustomRVItemInfo *Custitem;

if(!rve->GetCurrentItemEx(__classid(TRVTableItemInfo), Custrve, Custitem))

  {

    ToolButton1->Enabled = false;

    ToolButton2->Enabled = false;

    return;

  }

else 

  {

    TRVTableItemInfo *TableItem = (TRVTableItemInfo*)Custitem;

    int r, c, cs, rs;

    bool bSelected = TableItem->GetNormalizedSelectionBounds true, r, c,

cs, rs);

    ToolButton1->Enabled = bSelected;

    ToolButton2->Enabled = bSelected;


    ShowMessage("HELLO"); // TO TEST IF IT WORKS

  }

}

//----


When I run the application, the ShowMessage seems to popup forever. I think

the above code shouldn't be placed in the OnCaretMove... 

I've tried to put the above code in 'OnRVMouseUp' and 'OnKeyPress' but this

doesn't process the code always like it should be / I wanted...


I'd like to enable / disable buttons (for cellcolor & table properties) when

entering a table. (I don't want to use rvActions)


Could you give me some advice???


Thanks.


Pieter E.





Powered by ABC Amber Outlook Express Converter