Tables Question
Tables Question
Hi Sergey,
Here's a question not related to line numbers!
I use code in my main rve style to color the para background. Works fine and looks like what I want. However, when I pasted some tables in, the para bgnd is drawing in them and I don't want it in there (see screenshot below). How can I suppress the para bgnd color from drawing into my tables? I've tried everything I can think of and the only way I have gotten rid of the bgnds in the tables is to turn it off for everything!
Line 5 is a regular para and is fine. Lines 7 and 10 are the tables and I don't want the blue para bgnd bar to be drawn in those. If I decide to implement tables at all, it will be to add images like you see in the screenshot. So if the answer is to remove the image from the table that will be an issue.
Thanks Sergey
Stan
Here's a question not related to line numbers!
I use code in my main rve style to color the para background. Works fine and looks like what I want. However, when I pasted some tables in, the para bgnd is drawing in them and I don't want it in there (see screenshot below). How can I suppress the para bgnd color from drawing into my tables? I've tried everything I can think of and the only way I have gotten rid of the bgnds in the tables is to turn it off for everything!
Line 5 is a regular para and is fine. Lines 7 and 10 are the tables and I don't want the blue para bgnd bar to be drawn in those. If I decide to implement tables at all, it will be to add images like you see in the screenshot. So if the answer is to remove the image from the table that will be an issue.
Thanks Sergey
Stan
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Tables Question
But if you draw paragraph backgrounds yourself, you can just check if a paragraph contains a table, and do not draw background in this case (?)
Re: Tables Question
Tried that first thing. No go. If I select a line above the table(s), it highlights. Here's the code. Right now I have several attempts commented out but you can get an idea of what I was doing...part of it is the tables have the same itemno's as the rve. I think it's trying to highlight the same item no but I can't seem to get it stopped...Sergey Tkachenko wrote: ↑Sun Jan 02, 2022 8:46 pm But if you draw paragraph backgrounds yourself, you can just check if a paragraph contains a table, and do not draw background in this case (?)
Code: Select all
if not EditorActiveLine1.Checked then exit;
if ActiveRVE <> rve then exit;
//if rve.GetItemStyle( rve.CurItemNo ) = rvsTable then exit;
//if rve.GetItemStyle( Sender.ItemNo ) = rvsTable then exit;
//if rve.GetCurrentItemEx(TRVTableItemInfo, rv, item) then exit;
if not rve.Modified and (rve.GetTextLen = 0) and
( not FileExists( FileNameFromDate(CalendarView1.Date) + '.rvf' )) then exit;
i := Sender.ItemNo;
j := rve.CurItemNo;
RVAlign := rvvaBaseline;
if (rve.GetItemStyle(j) = rvsPicture) then
rve.GetPictureInfo(j, s, gr, RVAlign, RVTag );
if (rve.GetItemStyle(j) = rvsBreak) or
( RVAlign = rvvaLeft ) or
( RVAlign = rvvaRight ) then exit;
if TCustomRVFormattedData(Sender.RVData) = rve.RVData then
j := rve.CurItemNo;
repeat
DoLineHL := i=j;
if DoLineHL then
break;
dec(i);
//was IsFromNewLine but wasn't always working that way so I changed it to
//IsParaStart 9/9/2021. SRD
until TCustomRVFormattedData(Sender.RVData).IsParaStart(i+1);
if DoLineHL then begin
//ACanvas.Brush.Style := bsSolid;
//ACanvas.Brush.Color := $CCCCFF;
//ACanvas.FillRect(ARect);
r := ARect;
if ShowLinenumberIndicators1.Checked and ExtendEditorSel1.Checked then
r.Left := 0;
if rve.GetItemTextW(j) <> '' then
r.Bottom := r.Bottom + 2;
//if OfficeTextSel1.Checked then r.Left := 0;
ColorBlend(ACanvas, r, SRDJournalThemes.EditorActiveLine , 225);
end;
Re: Tables Question
Hi Sergey,
FYI, I tried a plain table with no image, still does it, and in a simple test app and it's still doing it there.
Stan
FYI, I tried a plain table with no image, still does it, and in a simple test app and it's still doing it there.
Stan
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Tables Question
Can you create a simple project reproducing this problem?
Re: Tables Question
Hi Sergey,
I'll attach a simple test file and the project unit. I don't think I can do the whole thing as attachment size is limited here.
Let me know if this is sufficient.
Stan
I'll attach a simple test file and the project unit. I don't think I can do the whole thing as attachment size is limited here.
Let me know if this is sufficient.
Stan
- Attachments
-
- Project1.dproj
- (31.73 KiB) Downloaded 851 times
-
- Project1.dpr
- (234 Bytes) Downloaded 819 times
-
- Unit1.pas
- (2.09 KiB) Downloaded 779 times
-
- test.rvf
- (4.09 KiB) Downloaded 819 times
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Tables Question
Please attach DFM file
PS: you can attach ZIP files
PS: you can attach ZIP files
Re: Tables Question
OK, attached a zip. No DCUs or EXE in it but everything else its there.Sergey Tkachenko wrote: ↑Mon Jan 03, 2022 10:56 am Please attach DFM file
PS: you can attach ZIP files
Note that this was happening in version 19.5. I updated to version 20 this morning and still the same effect.
Stan
- Attachments
-
- rve test.zip
- (64.01 KiB) Downloaded 842 times
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Tables Question
Attached.
By default, the demo highlights the current paragraph, both in a table cells and not.
There are two checkboxes.
One turns off highlighting in table cells.
Another one turns off highlighting tables themselves.
By default, the demo highlights the current paragraph, both in a table cells and not.
There are two checkboxes.
One turns off highlighting in table cells.
Another one turns off highlighting tables themselves.
- Attachments
-
- rve test app.zip
- (6.83 KiB) Downloaded 820 times
Re: Tables Question
Hi Sergey,
Yes, that all worked. THANKS. The key was this:
I thought it was going to be something like that. And I actually tried things along those lines, but the closest I got was this:
and...
It never occurred to me to set up a separate var and then compare it the way you did. Sigh.
Well, thanks again.
Stan
Yes, that all worked. THANKS. The key was this:
Code: Select all
Edit := rve.TopLevelEditor;
if TCustomRVFormattedData(Sender.RVData) <> Edit.RVData then
exit;
Code: Select all
if rve = rve.InPlaceEditor then exit;
Code: Select all
if rve = rve.TopLevelEditor then exit;
Well, thanks again.
Stan