lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Group-quote PDF: whitespace changes, and enhancement


From: Vadim Zeitlin
Subject: Re: [lmi] Group-quote PDF: whitespace changes, and enhancement
Date: Fri, 9 Feb 2018 03:25:05 +0100

On Thu, 8 Feb 2018 23:46:48 +0000 Greg Chicares <address@hidden> wrote:

GC> On 2018-02-08 22:34, Vadim Zeitlin wrote:
GC> > On Thu, 8 Feb 2018 21:48:20 +0000 Greg Chicares <address@hidden> wrote:
GC> [...]
GC> > GC> Context: If the "Insured Name" input that's copied into the 
"Participant"
GC> > GC> column of a group quote is rather long, it spills into the "Issue Age"
GC> > GC> column (as it always has). With a this datum [remove the quotes]:
GC> > GC>   "Director, Global Solution Architecture" [see footnote below]
GC> > 
GC> >  Hmm, when I produce the group premium quotes by editing the InsuredName 
in
GC> > the same census I used for the PDF pagination bug, I don't see any 
overflow
GC> > here because the "Participant" column is very wide (~60% of the page
GC> > width). What exactly do I need to see it?
GC> 
GC> You'd need to make "Supplemental amount" 
(Input::SupplementalSpecifiedAmount)
GC> nonzero; but apparently you can't do that with the 'sample*' products. Let's
GC> see...

 Thanks for the detailed and clear instructions! Jumping ahead, let me say
that they worked perfectly fine for me and I did see the problem.

GC>   File | Open | sample.database
GC>     Riders...TermIsNotRider: change from 0 to 1
GC>     Premiums...SplitMinPrem: change from 0 to 1

 As an aside, this window really needs a wxSearchCtrl somewhere (below the
tree?) to allow finding the terms quickly.

GC> >  It should be pretty simple: we just need to set the clipping rectangle
GC> > before calling DrawText() in wx_table_generator::do_output_values(). The
GC> > only potential problem is that I haven't used clipping with wxPdfDC yet,
GC> > but it's definitely implemented in its code and so I think it has all
GC> > chances to work.
GC> > 
GC> >  Please let me know if I should do this,
GC> Yes, please.

 I'll make a properly tested (including compiling it with MinGW, which I
didn't do yet) PR tomorrow, but I can already say that this trivial change:

---------------------------------- >8 --------------------------------------
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 39715bca6..942fc369c 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -306,6 +306,14 @@ void 
wx_table_generator::do_compute_column_widths_if_necessary()
                     }
             }

+            wxDCClipper clip
+                (dc_
+                ,wxRect
+                    {wxPoint{x, y_top}
+                    ,wxSize{width, row_height_}
+                    }
+                );
+
             dc_.DrawText(s, x_text, y_text);
             }
---------------------------------- >8 --------------------------------------

does work and clips the name as expected. I don't know if we should
restrict setting the clipping region only to the left-aligned columns
(because the others would become unreadable or, worse, wrongly readable, if
clipped). And I also don't know what do you think from my experimental use
of braces for simple ctors (i.e. those just using the values given to them
to initialize member variables and not performing some complicated action)
instead of parentheses. If you have any thoughts on either or both of these
subjects, please let me know.

 Thanks,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]