Skip to content

Commit 2294b7f

Browse files
Improve search element in Text Edit. Does not tab after autocomplete.
1 parent 59bbe28 commit 2294b7f

File tree

7 files changed

+15
-9
lines changed

7 files changed

+15
-9
lines changed

CHANGELOG.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
1414
- Added on Text Editor, folding margin with markers style configurable with ``fold symbols`` in settings.cfg.
1515

1616
=== Changed
17+
- Better Search element in Text Editor which allows to be cleared.
1718
- When saving in Text Editor, the cursor remains at position, instead of jumping to Tree selection.
1819
- Improved autocompletion lists, by using existing words in Test Suite file (still needs more improvements).
1920
- Create directories when needed in New Project dialog.

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Likewise, the current version of wxPython, is 4.2.2, but RIDE is known to work w
4040

4141
`pip install -U robotframework-ride`
4242

43-
(3.8 <= python <= 3.13) Install current development version (**2.2dev13**) with:
43+
(3.8 <= python <= 3.13) Install current development version (**2.2dev14**) with:
4444

4545
`pip install -U https://github.com/robotframework/RIDE/archive/develop.zip`
4646

src/robotide/application/CHANGELOG.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
</li><li class="listitem">
88
Added on Text Editor, folding margin with markers style configurable with ``fold symbols`` in settings.cfg.
99
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_changed"></a>1.2. Changed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
10+
Better Search element in Text Editor which allows to be cleared.
11+
</li><li class="listitem">
1012
When saving in Text Editor, the cursor remains at position, instead of jumping to Tree selection.
1113
</li><li class="listitem">
1214
Improved autocompletion lists, by using existing words in Test Suite file (still needs more improvements).

src/robotide/application/releasenotes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def set_content(self, html_win, content):
168168
</ul>
169169
<p><strong>New Features and Fixes Highlights</strong></p>
170170
<ul class="simple">
171+
<li>Better Search element in Text Editor which allows to be cleared.</li>
171172
<li>When saving in Text Editor, the cursor remains at position, instead of jumping to Tree selection.</li>
172173
<li>Improved autocompletion lists, by using existing words in Test Suite file (still needs more improvements).</li>
173174
<li>Fixed not set text color on row labels in Grid Editor. Now the General <b>secondary foreground</b> is applied.</li>
@@ -234,7 +235,7 @@ def set_content(self, html_win, content):
234235
<pre class="literal-block">python -m robotide.postinstall -install</pre>
235236
<p>or</p>
236237
<pre class="literal-block">ride_postinstall.py -install</pre>
237-
<p>RIDE {VERSION} was released on 22/March/2025.</p>
238+
<p>RIDE {VERSION} was released on 24/March/2025.</p>
238239
<!-- <br/>
239240
<h3>May The Fourth Be With You!</h3>
240241
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>

src/robotide/editor/texteditor.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,11 +1012,13 @@ def _create_editor_toolbar(self):
10121012

10131013
def _create_search(self, container_sizer):
10141014
container_sizer.AddSpacer(5)
1015-
size = wx.Size(160, 32)
1015+
size = wx.Size(200, 32)
10161016
self.search_field = TextField(self, '', size=size, process_enters=True)
10171017
self.search_field.SetBackgroundColour(Colour(self.dlg.color_secondary_background))
10181018
self.search_field.SetForegroundColour(Colour(self.dlg.color_secondary_foreground))
10191019
self.search_field.Bind(wx.EVT_TEXT_ENTER, self.on_find)
1020+
self.search_field.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.on_find)
1021+
self.search_field.SetHint(_('Search'))
10201022
container_sizer.add_with_padding(self.search_field)
10211023
button = ButtonWithHandler(self, _('Search'), fsize=self.general_font_size, handler=self.on_find)
10221024
button.SetBackgroundColour(Colour(self.dlg.color_secondary_background))
@@ -1115,7 +1117,7 @@ def language(self, flanguage):
11151117
def on_find(self, event, forward=True):
11161118
if self.source_editor:
11171119
if event.GetEventType() != wx.wxEVT_TEXT_ENTER: # Was getting selected item from Tree
1118-
text = self.source_editor.GetSelectedText()
1120+
text = self.source_editor.GetSelectedText() or event.GetString()
11191121
else:
11201122
text = ''
11211123
if (len(text) > 0 and text.lower() != self.search_field.GetValue().lower() and
@@ -1738,7 +1740,7 @@ def on_key_down(self, event):
17381740
if event.GetKeyCode() == wx.WXK_TAB and not event.ControlDown() and not event.ShiftDown():
17391741
if self._showing_list: # Allows to use Tab for keyword selection
17401742
self._showing_list = False
1741-
wx.CallAfter(self.write_ident) # DEBUG: Make this configurable?
1743+
# wx.CallAfter(self.write_ident) # DEBUG: Make this configurable?
17421744
event.Skip()
17431745
self.mark_file_dirty(self.source_editor.GetModify())
17441746
return
@@ -1767,7 +1769,7 @@ def on_key_down(self, event):
17671769
self.auto_indent()
17681770
else:
17691771
self._showing_list = False
1770-
wx.CallAfter(self.write_ident) # DEBUG: Make this configurable?
1772+
# wx.CallAfter(self.write_ident) # DEBUG: Make this configurable?
17711773
event.Skip()
17721774
self.mark_file_dirty(self.source_editor.GetModify())
17731775
return

src/robotide/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
#
1616
# Automatically generated by `tasks.py`.
1717

18-
VERSION = 'v2.2dev13'
18+
VERSION = 'v2.2dev14'

src/robotide/widgets/text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
from wx import Size
1818

1919

20-
class TextField(wx.TextCtrl):
20+
class TextField(wx.SearchCtrl):
2121

2222
def __init__(self, parent, initial_value, process_enters=False, size=Size(200, 32)):
2323
flags = wx.TE_PROCESS_ENTER|wx.TE_LEFT if process_enters else wx.TE_LEFT
24-
wx.TextCtrl.__init__(self, parent, size=size, style=flags|wx.TE_NOHIDESEL)
24+
wx.SearchCtrl.__init__(self, parent, size=size, style=flags|wx.TE_NOHIDESEL)
2525
self.SetValue(initial_value)

0 commit comments

Comments
 (0)