Check on Jump in RVMouseDown funcrion

General TRichView support forum. Please post your questions here
Post Reply
AVBSoft
Posts: 29
Joined: Tue Oct 21, 2008 11:37 am
Contact:

Check on Jump in RVMouseDown funcrion

Post by AVBSoft »

Hi Sergiy.

I use TRicView control (v10), which can contain Hyperlinks, tables with Hiperlinks
If HyperLink is outside of Table function work well.

When Hyperlink is in table, anfter run my function ("SelectCell(RVData);"), OnJump function doesn't run.
Because I'd like chech Jymp style in RVMouseDown funcrion, and can't do it correct...

Code: Select all

void __fastcall Tm_MainFrm::m_DescriptionViewStrRVMouseDown(
      TCustomRichView *Sender, TMouseButton Button, TShiftState Shift,
      int ItemNo, int X, int Y)
{
    if (GetDataPtr->GetCurrentMode() != eamTestMode && GetActiveView() != eavAnswers)
        return;

    //Review mode
    if (GetDataPtr->GetCurrentMode() == eamReviewMode)
        return;

    TCustomRVFormattedData* RVData;
    int a,b;

    X += Sender->HScrollPos;
    Y += Sender->VScrollPos * Sender->VSmallStep;

    Sender->GetItemAt(X, Y, RVData, a, b, false);


======================================
[color=red]  //  Check Jump in table cell !!! ?????????????

 ???????????????????????

    TRVStyle * pRVStyle;
    pRVStyle = ((TCustomRVFormattedData*)RVData)->GetRVStyle();

    if (((TCustomRVFormattedData*)RVData)->GetItem(pRVStyle->ItemNo)->GetBoolValueEx(rvbpJump, pRVStyle)) ???
        return;

???????????????????[/color]
==========================


    if (GetDataPtr->GetCurrentMode() == eamTestMode)
    {
        HighlightCell(RVData);
        SelectCell(RVData);
    }

    //Learn mode
    if (GetDataPtr->GetCurrentMode() == eamLearnMode)
    {
        AnswersListShowCorrectIncorrect(RVData);
    }

     
}
//---------------------------------------------------------------------------



void Tm_MainFrm::SelectCell(TCustomRVFormattedData* RVData)
{
    if (!RVData->InheritsFrom(__classid(TRVTableCellData)))
        return;

    TRVTableItemInfo*   pTable = ((TRVTableCellData*)RVData)->GetTable();
    int                 Row,
                        Col;
    TColor              Color;
    int                 AnswerN = -1;
    CBaseItem*          pBaseItem = NULL;
    bool                bNeedUpdateAllRows = false;
    //bool

    pTable->GetCellPosition((TRVTableCellData*)RVData, Row, Col);

    ASSERT(pTable == m_AnswerTable);

............. Work with cells etc...

   
    m_DescriptionViewStr->Format();  // m_DescriptionViewStr -> TRichView
}
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do not use pRVStyle->ItemNo.
For ItemNo, use the value returned by GetItemAt(), in a variable.
Post Reply