trichview.com

trichview.support




Re: Check possibility of unmerge


Return to index


Author

Message

Sergey Tkachenko

Posted: 05/12/2003 17:29:45


These functions are used in RichViewActions:


function CanUnmergeRows(table: TRVTableItemInfo): Boolean;

var fr,fc,r,c,cs,rs,mr,mc: Integer;

begin

  Result := table.GetNormalizedSelectionBounds(True, fr, fc, cs, rs);

  if Result then begin

    for r := fr to fr+rs-1 do

      for c := fc to fc+cs-1 do

        if table.Rows.GetMainCell(r,c,mr,mc).RowSpan>1 then

          exit;

    Result := False;

  end;

end;


function CanUnmergeCols(table: TRVTableItemInfo): Boolean;

var fr,fc,r,c,cs,rs,mr,mc: Integer;

begin

  Result := table.GetNormalizedSelectionBounds(True, fr, fc, cs, rs);

  if Result then begin

    for r := fr to fr+rs-1 do

      for c := fc to fc+cs-1 do

        if table.Rows.GetMainCell(r,c,mr,mc).ColSpan>1 then

          exit;

    Result := False;

  end;

end;



>

> > How can i check, whether an unmerge operation is possible for the edited

> > cell?

>

> ... i would like to enable/disable the corresponding menu entries.

>

> > thanks and regards,

> > Jan

>





Powered by ABC Amber Outlook Express Converter