| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Editra
Revision: 55423
Author: CJP
Date: 02 Sep 2008 13:17:10
Changes:Update find string when the FindReplaceData owned by the window has its find string changed.
Files:| ... | ...@@ -308,6 +308,15 @@ | |
| 308 | 308 | """ |
| 309 | 309 | return self._panel.GetPanelMode() |
| 310 | 310 | |
| 311 | def RefreshFindReplaceFields(self): | |
| 312 | """Refresh the values of the Find and Replace fields with the | |
| 313 | values that are currently in the FindReplaceData. | |
| 314 | ||
| 315 | """ | |
| 316 | data = self.GetData() | |
| 317 | self._panel.SetFindString(data.GetFindString()) | |
| 318 | self._panel.SetReplaceString(data.GetReplaceString()) | |
| 319 | ||
| 311 | 320 | def SetData(self, data): |
| 312 | 321 | """Set the dialogs FindReplaceData |
| 313 | 322 | @param data: FindReplaceData |
| ... | ...@@ -365,6 +374,13 @@ | |
| 365 | 374 | """ |
| 366 | 375 | self._panel.SetFindString(query) |
| 367 | 376 | |
| 377 | def SetReplaceString(self, rstring): | |
| 378 | """Set the replace controls search string | |
| 379 | @param query: string | |
| 380 | ||
| 381 | """ | |
| 382 | self._panel.SetReplaceString(rstring) | |
| 383 | ||
| 368 | 384 | #--------------------------------------------------------------------------# |
| 369 | 385 | |
| 370 | 386 | class MiniFindReplaceDlg(wx.MiniFrame, FindReplaceDlgBase): |
| ... | ...@@ -854,16 +870,16 @@ | |
| 854 | 870 | |
| 855 | 871 | """ |
| 856 | 872 | self._ftxt.SetValue(query) |
| 857 | self._data.SetFindString(query) | |
| 873 | self._fdata.SetFindString(query) | |
| 858 | 874 | |
| 859 | 875 | def SetData(self, data): |
| 860 | 876 | """Set the FindReplaceData and update the dialog with that data |
| 861 | 877 | @param data: wxFindReplaceData |
| 862 | 878 | |
| 863 | 879 | """ |
| 864 | self._data.Destroy() | |
| 865 | self._data = None | |
| 866 | self._data = data | |
| 880 | self._fdata.Destroy() | |
| 881 | self._fdata = None | |
| 882 | self._fdata = data | |
| 867 | 883 | self._ConfigureControls() |
| 868 | 884 | |
| 869 | 885 | def SetFlag(self, flag): |
| ... | ...@@ -893,6 +909,14 @@ | |
| 893 | 909 | if idx is not None: |
| 894 | 910 | self._lookin.SetSelection(idx) |
| 895 | 911 | |
| 912 | def SetReplaceString(self, rstring): | |
| 913 | """Set the replace fields string | |
| 914 | @param rstring: string | |
| 915 | ||
| 916 | """ | |
| 917 | self._rtxt.SetValue(rstring) | |
| 918 | self._fdata.SetReplaceString(rstring) | |
| 919 | ||
| 896 | 920 | def ShowDirectionBox(self, show=True): |
| 897 | 921 | """Show or hide the Direction group box |
| 898 | 922 | @keyword show: bool |
| ... | ...@@ -113,6 +113,9 @@ | |
| 113 | 113 | else: |
| 114 | 114 | pass |
| 115 | 115 | |
| 116 | # Update the text that should be shown in the find replace fields | |
| 117 | self._finddlg.RefreshFindReplaceFields() | |
| 118 | ||
| 116 | 119 | def GetClientString(self, multiline=False): |
| 117 | 120 | """Get the selected text in the current client buffer. By default |
| 118 | 121 | it will only return the selected text if its on a single line. |