trichview.com

trichview.support




Re: Table cell colors


Return to index


Author

Message

Sergey Tkachenko

Posted: 12/19/2004 18:00:53


table.GetEditedCell.

It also makes sense to change color of all selected cells.

Direct assignment to the cell properties cannot be undone and redone.

Use this procedure to apply colors to the selected or edited cells:


var r,c: Integer;

  item: TCustomRVItemInfo;

  table: TRVTableItemInfo;


if RichViewEdit1.GetCurrentItemEx(TRVTableItemInfo, rve, item) then

begin

  table := TRVTableItemInfo(item);

  rve.BeginUndoGroup(rvutModifyItem);

  rve.SetUndoGroupMode(True);

  if table.GetEditedCell(r,c)<>nil then

  begin

    table.SetCellColor(cellColorcbx.ChosenColor,  r,c);

    table.SetCellBorderColor(BorderColorCBx.ChosenColor,  r,c);

  end

  else

  begin

    for r := 0 to table.Rows.Count-1 do

      for c := 0 to table.Rows[r].Count-1 do

        if (table.Cells[r,c]<>nil) and table.IsCellSelected(r,c) then

        begin

          table.SetCellColor(cellColorcbx.ChosenColor,  r,c);

          table.SetCellBorderColor(BorderColorCBx.ChosenColor,  r,c);

       end;

  end;

  rve.SetUndoGroupMode(False);

  rve.Change;

end;




> "Sergey Tkachenko" <[email protected]> wrote in message news:41c47b48

> > When you merge table cells, all the merged cells (except for the top

left

> > one) become equal to nil.

>

> Gotchya, thanks! How can you tell if your caret is in a table cell, so

that

> I can change the color of just that cell if the user wants to?

> --

> Best regards,

> Harold Holmes

>

>





Powered by ABC Amber Outlook Express Converter