lmi
[Top][All Lists]
Advanced

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

[lmi] Difficulty editing particular fields in census manager


From: Greg Chicares
Subject: [lmi] Difficulty editing particular fields in census manager
Date: Wed, 29 Aug 2018 21:09:43 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

To reproduce:
  File | New | Census
  Census | Add cell
  Census | Edit cell...
    "Riders" tab, "Spouse rider" group: check "Elected"
    OK
Double-click the "Spouse Rider Amount" column that now appears in the
census manager, and press the "2" key (or any other digit). (Use HEAD
for this, because it was only earlier today that the default "sample"
products acquired this rider.)

Symptoms: The default "10000" amount is highlighted. Attempting to
type any digit elicits only a beep, and does not alter the contents
of the edit control embedded in the dataview. It is nonetheless
possible to edit the value by certain other means:
 - Copy a valid value to the X (or msw) clipboard, then paste it in;
   the value is successfully changed. (To learn the range of valid
   values, use the tabbed dialog to enter a negative number and
   read the error message.)
 - While the default "10000" is displayed, first move the cursor
   into the middle of the number (or do the equivalent with the
   mouse), then insert or delete individual digits such that the
   value being edited never transgresses the valid limits. For
   example, move the cursor between the second and third characters
   of "10000" and press the "3" key to obtain "103000".
The same symptoms appear with some other fields, such as the
"Male Proportion" corresponding to the "Male" edit control in the
"Blend mortality" groupbox.

Discussion: Apparently this occurs for scalar trammelled numeric
fields with positive limits. (There aren't many of those, because
so many numeric fields are input sequences, whose elements are not
constrained by lmi's MVC framework.) The symptoms are suppressed
by this undesirable exploratory patch:

---------8<--------8<--------8<--------8<--------8<--------8<--------8<-------
diff --git a/census_view.cpp b/census_view.cpp
index f410bd07..3b701149 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -870,8 +870,8 @@ bool CensusViewDataViewModel::SetValueByRow
 
     cell = new_val;
 
-    Input& model = view_.cell_parms()[row];
-    model.Reconcile();
+//  Input& model = view_.cell_parms()[row];
+//  model.Reconcile();
 
     view_.document().Modify(true);
 
--------->8-------->8-------->8-------->8-------->8-------->8-------->8-------

which in effect reverts this commit...

$git log -G"model = view_.cell_parms"
commit a3bd6b0bb20c970931fd8cd1253513e324f840bc
Author: Gregory W. Chicares <address@hidden>
Date:   2011-12-14T00:47:33+00:00

    Reconcile MVC Model when a value is modified (VS)

...which remains desirable, yet is now seen to be imperfect.

I don't understand the physical reality, but notionally at least a
"cell editor" pops up within the dataview when the contents are
actively being edited, and closes when Enter is pressed. What we
want to do, I think, is:
 - suspend calling Reconcile() while that notional editor is open;
 - let Reconcile() be called only when it closes.
The MVC framework that drives the tabbed dialog works similarly:
its values are subjected to something like a wxValidator only when
the edit control loses focus.

Vadim, can you translate my impressionistic description to the
dataviewctrl API and suggest a way to fix this?



reply via email to

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