@@ -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
0 commit comments