|
From: Kevin A. <al...@se...> - 2001-10-08 21:53:47
|
I added the modal FindDialog to dialog.py and updated the dialogs sample to
demonstrate the dialog usage. I also added FindDialog to the addresses
sample, but haven't implemented the find logic for it yet, it just shows the
dialog when you click on the Find button.
ka
> -----Original Message-----
> From: pyt...@li...
> [mailto:pyt...@li...]On Behalf Of Kevin
> Altis
> Sent: Monday, October 08, 2001 11:36 AM
> To: pythoncard-Users
> Subject: [Pythoncard-users] Find dialog layout and issues
>
>
> I've put together a basic Find dialog layout. The resource description is
> shown below and also attached as a file that you can view using the
> resourceEditor sample. The final layout will probably be done
> with sizers if
> possible in order to avoid display problems under Linux and Solaris.
>
> I'm thinking about implementing this as a modal dialog and making
> it part of
> the dialog.py module. So, usage would be something like:
>
> dlg = FindDialog(self, 'text to find', 0, 0)
> if dlg.accepted():
> ...
>
> The last arguments would be for matching whole words only and
> matching case
> and would default to 0 (false).
>
> Should the dialog have an up/down direction searching option?
>
> wxPython appears to be unable to display the selection in a field if the
> window and field don't have focus, so I don't see any way of
> doing a normal
> non-modal Find dialog at this time, since there would be no
> feedback to the
> user that the selection has changed. I consider this a big limitation, so
> I'll be lobbying over on wx-dev to have this fixed in wxWindows, so
> eventually wxPython will work correctly.
>
> Another issue is that if the dialog is made non-modal, then it would be
> necessary to create the Find dialog in one method of the user code and
> provide a method callback as part of the dialog argument list to
> be executed
> when the user presses the Find Next button. An alternative
> solution would be
> to let the Find dialog call framework find classes directly once they are
> implemented.
>
> Anyway, this is just a heads up for anyone interested in this part of the
> framework. If you have some suggestions for the layout, how the dialog
> should work, or anything else related to doing text searching in the
> framework, let me know.
>
> ka
> ---
>
> {'stack':{'type':'Stack',
> 'name':'Find',
> 'title':'Find dialog',
> 'position':(5, 5),
> 'size':(370, 120),
>
> 'backgrounds': [
> {'type':'Background',
> 'file':'find.py',
> 'classname':'Find',
> 'name':'bgFind',
> 'components': [
>
> {'type':'StaticText',
> 'name':'stcFindWhat',
> 'position':(7, 10),
> 'text':'Find What:',
> },
>
> {'type':'TextField',
> 'name':'fldFind',
> 'position':(70, 7),
> 'size':(195, -1),
> },
>
> {'type':'Button',
> 'name':'btnFindNext',
> 'position':(280, 5),
> 'label':'Find Next',
> },
>
> {'type':'Button',
> 'name':'btnCancel',
> 'position':(280, 35),
> 'label':'Cancel',
> },
>
> {'type':'CheckBox',
> 'name':'chkMatchWholeWordOnly',
> 'position':(7, 35),
> 'label':'Match whole word only',
> },
>
> {'type':'CheckBox',
> 'name':'chkMatchCase',
> 'position':(7, 55),
> 'label':'Match case',
> },
>
> ] # end components
> } # end background
> ] # end backgrounds
> } }
>
|