[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] [PATCH] More XRC fixes, including wxDatePickerCtrl ones
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] [PATCH] More XRC fixes, including wxDatePickerCtrl ones |
Date: |
Sat, 18 Apr 2015 18:51:17 +0200 |
On Sat, 18 Apr 2015 13:51:14 +0000 Greg Chicares <address@hidden> wrote:
GC> To reproduce: open the 'skin.xrc' tabbed dialog and select the "Inforce"
tab.
Hello,
Just to be certain: are you testing this with the latest wxWidgets or with
the version before the changes allowing to use wxGROW together with the
other alignment flags in wxFlexGridSizer? I admit I haven't tested the
latest changes with the older wxWidgets version as I thought they would be
only used with the new one anyhow. I could retest them with the version of
wxWidgets currently used by lmi but I'm not sure if it's really worth doing
this as we know that these flags combinations wouldn't work correctly
without the latest changes anyhow and the latest version is needed for them
to work.
I am sorry if this was unclear, but the patches introducing the use of
wxGROW in combination with wxALIGN_XXX do require the latest wxWidgets with
my changes allowing this.
GC> (1) Text and date controls have grown vertically as well as horizontally,
but
GC> their height should not change. The height of such controls on other tabs
GC> does not change even if the dialog is resized.
I don't see this with the latest wxWidgets version.
GC> (2) Previously, all columns were the same width (because the controls they
GC> contained had identical hard-coded widths). Now, the middle column is less
GC> wide than the others. It should be the same not only for symmetry, but also
GC> because its controls need to accept currency amounts at least in the
millions
GC> (as do controls in other columns).
I do still see this. The reason for this is that the first column contains
a wxDatePickerCtrl which is wider than 80px (hard coded width of the text
controls) on my system, so the text controls are made wider to fit it, but
the second column doesn't have any wxDatePickerCtrl controls and so the
text controls in it remain at their hard coded width.
Unfortunately I don't think there is any simple to fix this. Lack of a
possibility to impose constraints on independent sizers is probably the
most important feature missing from the sizer-based layouts and this is
exactly what we would need here: the two columns are parts of independent
wxFlexGridSizers, yet we'd like to use the same width for them.
FWIW the only problem with the current layout is the asymmetry: the middle
column is still as wide as it was before (although again, it would make
sense to set its width in dialog units). But I agree that this asymmetry is
annoying. Unfortunately the only thing I can suggest is to tweak the hard
coded text control widths to make them wider than the date controls, e.g.
replace all "80,-1" with "50,-1d" ("d" stands for "dialog units"):
---------------------------------- >8 --------------------------------------
diff --git a/skin.xrc b/skin.xrc
index 5fc4648..5a773c1 100644
--- a/skin.xrc
+++ b/skin.xrc
@@ -1260,7 +1260,7 @@
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="ContractNumber">
<help>Contract number</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1275,7 +1275,7 @@
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="MasterContractNumber">
<help>Group master contract
number</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1303,7 +1303,7 @@
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceAnnualTargetPremium">
<help>Annual target premium</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1318,7 +1318,7 @@
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceYtdGrossPremium">
<help>Year-to-date payments counted
toward target premium</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1333,7 +1333,7 @@
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceYtdTaxablePremium">
<help>Year-to-date payments subject to
premium tax</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1367,7 +1367,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceMonthlyNoLapsePremium">
<help>Monthly premium required to
maintain no-lapse guarantee</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1382,7 +1382,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceCumulativeNoLapsePremium">
<help>Cumulative premium required to
maintain no-lapse guarantee</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1397,7 +1397,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceCumulativeNoLapsePayments">
<help>Cumulative payments for no-lapse
guarantee</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1412,7 +1412,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceCumulativeRopPayments">
<help>Cumulative payments for return
of premium death benefit option</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1444,7 +1444,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceGeneralAccountValue">
<help>Inforce account value--general
account</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1459,7 +1459,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceSeparateAccountValue">
<help>Inforce account value--separate
account</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1474,7 +1474,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceRegularLoanValue">
<help>Inforce account value--regular
loan</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1489,7 +1489,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceRegularLoanBalance">
<help>Inforce balance--regular
loan</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1504,7 +1504,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforcePreferredLoanValue">
<help>Inforce account value--preferred
loan</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1519,7 +1519,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforcePreferredLoanBalance">
<help>Inforce balance--preferred
loan</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1534,7 +1534,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceCumulativeSalesLoad">
<help>Cumulative refundable sales
load</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1549,7 +1549,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceSpecAmtLoadBase">
<help>Amount on which specified-amount
load is charged--generally the specified amount at issue</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1564,7 +1564,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceHoneymoonValue">
<help>Inforce honeymoon value</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1579,7 +1579,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceNetExperienceReserve">
<help>Inforce case net experience
reserve</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1594,7 +1594,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceYtdNetCoiCharge">
<help>Inforce case year-to-date net
COI charges</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1626,7 +1626,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceTaxBasis">
<help>Inforce tax basis</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1641,7 +1641,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceGlp">
<help>Inforce guideline level
premium</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1656,7 +1656,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceCumulativeGlp">
<help>Cumulative guideline level
premium</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1671,7 +1671,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceGsp">
<help>Inforce guideline single
premium</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1686,7 +1686,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceCumulativeGptPremiumsPaid">
<help>Cumulative 7702(f)(1) 'premiums
paid'</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1720,7 +1720,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceSevenPayPremium">
<help>Inforce seven-pay premium</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1748,7 +1748,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceAvBeforeLastMc">
<help>Inforce account value
immediately before last material change</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1763,7 +1763,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceDcv">
<help>Inforce deemed cash value</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
@@ -1778,7 +1778,7 @@ here, but it looks weird if we don't make this look like
its siblings.
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT</flag>
<object class="wxTextCtrl"
name="InforceLeastDeathBenefit">
<help>Inforce least death benefit
since beginning of last seven-pay period</help>
- <size>80,-1</size>
+ <size>50,-1d</size>
<value>0</value>
</object>
</object>
---------------------------------- >8 --------------------------------------
This is just a hack but it should solve the problem under Windows. For a
real solution, more changes to wxWidgets itself would be required (please
let me know if you think I should look into making them).
GC> (3) Resize the dialog to make it wider. Previously, only the spacing between
GC> columns changed (because control sizes were hard coded).
Not quite, rather it was because wxGROW wasn't used.
GC> Now, the first two columns become wider (good), but the third does not
GC> (it should, too).
This is simply because of
<growablecols>0,1</growablecols>
in the top level wxFlexGridSizer. I thought this was intentional, so I
didn't change it, but just adding ",2" to it is enough to make the last
column resize too:
---------------------------------- >8 --------------------------------------
diff --git a/skin.xrc b/skin.xrc
index 5fc4648..6b3616f 100644
--- a/skin.xrc
+++ b/skin.xrc
@@ -1234,7 +1234,7 @@
<border>2</border>
<object class="wxFlexGridSizer">
<cols>3</cols>
- <growablecols>0,1</growablecols>
+ <growablecols>0,1,2</growablecols>
<growablerows>0</growablerows>
<object class="sizeritem">
<flag>wxGROW|wxALL</flag>
---------------------------------- >8 --------------------------------------
GC> (4) Resize the dialog to make it taller. Unsurprisingly, the text and date
GC> controls' height increases.
This doesn't happen with the latest wxWidgets version.
GC> Surprisingly, the date controls' scroll buttons don't repaint nicely.
This is probably indeed a bug in wxMSW, but it's hardly very important
because normally the date controls height should never change.
GC> while (2) and (3) might be considered latent problems in the original
GC> XRC file that have been unmasked by allowing controls to grow
GC> horizontally, though I'm not sure how to fix them.
Before my changes to allow using wxGROW and wxALIGN_XXX flags together in
2D sizers, the only way to allow a 2D sizer item to grow in one direction
but not the other was to put it into a nested 1D sizer and use proportion
of 1 and wxALIGN_XXX (but not wxGROW) flag for it. This definitely did work
but was much more cumbersome than the natural solution of simply specifying
both wxGROW and wxALIGN_XXX. So the real fix is updating to the latest
wxMSW.
Sorry again if I didn't explain that the latest version was needed in
order for this flag combination to work,
VZ