On Monday 11 January 2010 06:58:19 am Ed Leafe wrote: > On Jan 11, 2010, at 8:13 AM, Paul McNett wrote: > >> In other words we are talking about new values that the user adds, he > >> just wants to be able to see them after he adds them. > >> For this to work, the only things that need to be done is to add user as > >> a ValueMode option and to have it save the value on LostFocus when the > >> ValueMode is user. > > > > Yes you would otherwise be using a textbox for free-form textual entry, > > so you want to populate the Choices with ["A", "B", "C"] but allow *any* > > textual entry. > > Which is what dComboBox does right now. > > > I agree > > that Dabo's dComboBox should support such usage out of the box, without > > raising 'string must be present in the choices'. > > I disagree. List controls simply do not work that way, and trying to > munge > the data binding code to accommodate a use case that is better served by > alternative approaches is a bad idea. > > Here's another approach: make a composite control with a dTextBox and a > dBitmapButton. The text box is bound to the column, and the button (with a > down triangle image, as in a combo box) brings up a context menu with the > A,B,C options. If a user selects one of the options, it populates the > textbox and the column. > > So rather than mess with the data binding concept and design, build a > custom control with the behavior that is needed. > > > -- Ed Leafe > +1 I agree with Ed. And it does not take a lot of code get Ed's solution working and the technique should also work in ClassDesigner. However, I do believe that the naming of the control is an issue. Dabo's "dComboBox " isn't what I'd call a combobox (at least from a VFP point of view). However, Dabo is just following the lead of wxPython (and I guess wxPython is following the lead of wx) in naming the control. I believe following the wxPython naming conventions is a good thing.
Bottom line it is the wx.ListCtrl class that is giving Dabo fits. On one hand we would like a popup/dropdown list to contain only vaild choices. On the other hand we want to have some way to deal with dynamic entries. Therefore, I offer a $25.00 bounty to anyone that comes up with a good solution (good to be determined by Ed and Paul). It should allow a fixed list and still be bound to a data field with dynamic text allowed. The data should not raise an exception if not in the list. And should work transparently with Dabo's data schema. In other words just turning off the exception is not a good solution. Johnf _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
