Title: IDLE: Switch search dialogs to ttk widgets, and other refinement
Type: enhancement Stage: needs patch
Components: IDLE Versions: Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: markroseman, python-dev, terry.reedy
Priority: normal Keywords: patch

Created on 2016-07-10 20:19 by terry.reedy, last changed 2017-06-19 18:42 by terry.reedy.

File name Uploaded Description Edit
ttk-search.diff terry.reedy, 2016-07-11 00:04 review
search.diff markroseman, 2016-08-01 18:31 review
Messages (5)
msg270131 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-07-10 20:19
Scrollbars and the new query module now use ttk widgets.  Time to convert the other dialogs.

Changing imports is straightforward.

Use of an option that can only be changed in the style may be harder.  There was one instance of this among the scrollbars (converted in #24750) and I just skipped the minor tweak, and let the scrollbar in question look like all the rest.

The most difficult issue is changes in allowed methods.  For instance, the state of tk checkbuttons and radiobuttons can be controlled by either setting a control variable or by calling methods.  For ttk, the methods are gone. 

First are the search dialog modules: searchbase, search, replace, and grep.  The tk-only 'anchor' option is used but has no effect since the 'width' option is not used to allocate extra space for the buttons.  The tk-only select method is used, but at least in searchbase, it has no effect, as it always sets the button to the state it already had.  Its use in test files, however, has to be replaced, not deleted.

IDLE does not control the common dialogs.  But we could choose to replace them,  I would not do that for the os file dialogs, but already replaced the 'ask' messagebox used for Open Module for behavioral reasons (#27380).
msg270141 - (view) Author: Roundup Robot (python-dev) Date: 2016-07-11 00:21
New changeset 91fe65e3d7bb by Terry Jan Reedy in branch 'default':
Issue #27477: Convert IDLE search dialogs to using ttk widgets.
msg271653 - (view) Author: Mark Roseman (markroseman) * Date: 2016-07-29 21:53
Great start. Needs to have a ttk.Frame directly inside the toplevel window to avoid whitespace showing around grey widgets (like in query dialog shot). 

I'd also like to see the spacing adjusted (all platforms) and button positions changed on Mac to go at the bottom, as per

Open to a patch that does that?
msg271752 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-07-31 23:11
I debated whether to open a new search style issue and copy a message or defer ttk for config to another issue and re-title this.  I went with widget group rather than aspect (style) this time. There are multiple search behavior issues.

I added Notepad, Workpad, Libre Office Write, Tortoise Hg, and browsers to Notepad++ for Find/Search and Replace dialog box comparisons.  From top to bottom.

0.1 De-modalize: The others are not modal and it is a nuisance.  #24760 is about same for Config dialog. #24813 for Help stuff.  I should look at your patches now.

0.2 List under Windows menu so easier to bring to top to use or close.  Currently, cannot access Windows menu or anything else do to modality.  Fortunately, Windows does list on popup expansion of taskbar icon.

1.0 Title: delete obvious "Dialog", add file base name.  I sometime forget which file Search box is attached to and waste time searching wrong file.  Will get worse with multiple boxes.

1.1 With tk, can we delete [-] min and [[]] max buttons and leave [X] close button?  They are not present for 4 apps with floating boxes.  #24039 is about inconsistent behavior of these buttons.  If deleting them is a possible solution, I want to consider it.

2. I do not see 'whitespace around gray widgets', but I don't think I need to.  I do see widgets jammed against edges and agree space is needed.  Framing will also be wanted, I expect, as a pane for future single big window version of IDLE.

I just noticed that TortoiseHg has 4 options for its main pane, Search being one of them.  The 'tabs' are icons in a vertical strip to the right.  Search is a magnifying glass.  Each has a mouse hover popup word.

3. Regular expression, Match case, and Whole word modify What to search for, and belong together.  Wraparound, Up, and Down modify How to search, and I think also belong together on a line.  Grid would be 4 columns for these.

4.1 Close button should be at bottom or to the right. L.O.Write has [Help] and [Close] to bottom left and right respectively.  I want to consider this.  We could add a new parameter 'start_at' to classes, defaulting to the top.  "if start_at: <simulate TOC click>"  Then [Help] would display a new section "Search and Replace" added to the idle.rst and hence help.html.  'Find' is non-overlapping.  'Relational expression' uses patterns as defined in re doc.  I have found 'whole word' not as obvious as I expected.  It should have an explicit definition and behavior to match. Ditto for 'Match case' in a unicode world.

4.2  Putting the 4 F & R buttons across the bottom on platforms where that is the norm is OK with me.  I only see down the side so far on Windows.  Search could (should?) have [Find all] in addition to [Find next].  The 4 F & R buttons could be Find, Find all, Replace, Replace all (L.O.Write).  But behavior change should be different issue.
msg271791 - (view) Author: Mark Roseman (markroseman) * Date: 2016-08-01 18:31
Have attached search.diff, which does an initial bit of cosmetics: adds inner frame with spacing, tweaks a couple labels, and for Mac and X11, puts the command buttons at the bottom of the dialog rather than on the right (where they remain on Windows).
Date User Action Args
2017-06-19 18:42:13terry.reedysetcomponents: + IDLE
2016-08-01 18:31:53markrosemansetfiles: + search.diff

messages: + msg271791
2016-07-31 23:11:31terry.reedysetassignee: terry.reedy
messages: + msg271752
title: IDLE: Switch dialogs to ttk widgets. -> IDLE: Switch search dialogs to ttk widgets, and other refinement
2016-07-29 21:53:40markrosemansetnosy: + markroseman
messages: + msg271653
2016-07-11 00:21:49python-devsetnosy: + python-dev
messages: + msg270141
2016-07-11 00:04:09terry.reedysetfiles: + ttk-search.diff
keywords: + patch
2016-07-10 20:19:37terry.reedycreate