On Sat, Jul 16, 2011 at 11:46 AM, <[email protected]> wrote:
> In my ProductView ResDialog (attached), the following statement is issued in > the UpdateProduct method: > > prodControls[pbSaveChanges]~state = "FOCUS" > > This is intended to make the "Save Changes" pushbutton the default when the > user presses enter. But this doesn't happen. The operating system uses what is referred to as the dialog manager to control how dialogs behave. Part of what it does it determine what the 'default' push button is at any time. You are proably working at cross purpose to the dialog manager. I haven't looked at your program, but you probaly need to set the style to "DEFAULT" and set the focus. Something like this: prodControls[pbSaveChanges]~style = "DEFAULT" prodControls[pbSaveChanges]~state = "FOCUS" Part of the problem is the implementation of ooDialog. Rather than using set focus to move the focus in you should use the WM_NEXTDLGCTL message. But, ooDialog doesn't expose that anywhere. Something that should be added. Setting the focus directly bypasses the dialog manager. Using WM_NEXTDLGCTL goes through the dialog manager. Also, it could be you are not assigning a DEFAULT button when you create your dialog. If the Save Changes button is always the one that should be activated when the user hits Enter, just make it the default button from your resource editor. > I use the same approach for CustomerView (an RcDialog), and it works fine. It could be that in the program there is no button with the DEFAULT style. In which case, the button with the focus will be the button pushed when Enter is hit. -- Mark Miesfeld ------------------------------------------------------------------------------ AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on "Lean Startup Secrets Revealed." This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev _______________________________________________ Oorexx-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/oorexx-users
