[pywin32-checkins] /hgrepo/p/py/pywin32/pywin32: 3 new changesets
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <pyw...@li...> - 2012-01-02 02:05:17
|
changeset a341ce8e7989 in /hgrepo/p/py/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgrepo/p/py/pywin32/pywin32?cmd=changeset;node=a341ce8e7989 summary: allow win32ui object attributes to appear in autocomplete list changeset 95c5dde755c2 in /hgrepo/p/py/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgrepo/p/py/pywin32/pywin32?cmd=changeset;node=95c5dde755c2 summary: add more LOGON32_* contants - from Dieter Verfaillie via 3439279 changeset 9b3d4f355d25 in /hgrepo/p/py/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgrepo/p/py/pywin32/pywin32?cmd=changeset;node=9b3d4f355d25 summary: add history for pythonwin search&replace dialog. #3468280 diffstat: CHANGES.txt | 3 +++ Pythonwin/pywin/scintilla/find.py | 38 +++++++++++++++++++++++++++++++------- Pythonwin/pywin/scintilla/view.py | 8 ++++++++ win32/Lib/win32con.py | 6 ++++++ 4 files changed, 48 insertions(+), 7 deletions(-) diffs (143 lines): diff -r 95b4f896b100 -r 9b3d4f355d25 CHANGES.txt --- a/CHANGES.txt Mon Jan 02 12:40:31 2012 +1100 +++ b/CHANGES.txt Mon Jan 02 13:03:39 2012 +1100 @@ -6,6 +6,9 @@ Since build 216: ---------------- +* The Pythonwin editor now remembers previous searches made in this session. + (patch #3468280 from kxroberto). + * The LOGFONT struct implementation (win32util) was extended to support the full LOGFONT struct as published by Microsoft. This includes changes to win32util.LogFontToDict and win32util.DictToLogFont. (Feature request diff -r 95b4f896b100 -r 9b3d4f355d25 Pythonwin/pywin/scintilla/find.py --- a/Pythonwin/pywin/scintilla/find.py Mon Jan 02 12:40:31 2012 +1100 +++ b/Pythonwin/pywin/scintilla/find.py Mon Jan 02 13:03:39 2012 +1100 @@ -31,6 +31,7 @@ curDialog = None lastSearch = defaultSearch = SearchParams() +searchHistory = [] def ShowFindDialog(): _ShowDialog(FindDialog) @@ -143,6 +144,17 @@ if lastSearch.remember: defaultSearch = lastSearch + + # track search history + try: + ix = searchHistory.index(searchParams.findText) + except ValueError: + if len(searchHistory) > 50: + searchHistory[50:] = [] + else: + del searchHistory[ix] + searchHistory.insert(0, searchParams.findText) + return rc def _ReplaceIt(control): @@ -181,8 +193,13 @@ self.editFindText.SetWindowText(sel) if (defaultSearch.remember): defaultSearch.findText = sel + for hist in searchHistory: + self.editFindText.AddString(hist) - self.editFindText.SetSel(0, -2) + if hasattr(self.editFindText, 'SetEditSel'): + self.editFindText.SetEditSel(0, -2) + else: + self.editFindText.SetSel(0, -2) self.editFindText.SetFocus() self.butMatchWords.SetCheck(defaultSearch.matchWords) self.butMatchCase.SetCheck(defaultSearch.matchCase) @@ -209,8 +226,9 @@ if not self.editFindText.GetWindowText(): win32api.MessageBeep() return - if self.DoFindNext() != FOUND_NOTHING and not self.butKeepDialogOpen.GetCheck(): - self.DestroyWindow() + if self.DoFindNext() != FOUND_NOTHING: + if not self.butKeepDialogOpen.GetCheck(): + self.DestroyWindow() class FindDialog(FindReplaceDialog): def _GetDialogTemplate(self): @@ -219,7 +237,8 @@ dt = [ ["Find", (0, 2, 240, 75), style, None, (8, "MS Sans Serif")], ["Static", "Fi&nd What:", 101, (5, 8, 40, 10), visible], - ["Edit", "", 102, (50, 7, 120, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL], + ["ComboBox", "", 102, (50, 7, 120, 120), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | + win32con.WS_VSCROLL |win32con.CBS_DROPDOWN |win32con.CBS_AUTOHSCROLL], ["Button", "Match &whole word only", 105, (5, 23, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "Match &case", 107, (5, 33, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "Keep &dialog open", 115, (5, 43, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], @@ -237,9 +256,11 @@ dt = [ ["Replace", (0, 2, 240, 95), style, 0, (8, "MS Sans Serif")], ["Static", "Fi&nd What:", 101, (5, 8, 40, 10), visible], - ["Edit", "", 102, (60, 7, 110, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL], + ["ComboBox", "", 102, (60, 7, 110, 120), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | + win32con.WS_VSCROLL |win32con.CBS_DROPDOWN |win32con.CBS_AUTOHSCROLL], ["Static", "Re&place with:", 103, (5, 25, 50, 10), visible], - ["Edit", "", 104, (60, 24, 110, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL], + ["ComboBox", "", 104, (60, 24, 110, 120), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | + win32con.WS_VSCROLL |win32con.CBS_DROPDOWN |win32con.CBS_AUTOHSCROLL], ["Button", "Match &whole word only", 105, (5, 42, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "Match &case", 107, (5, 52, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "Keep &dialog open", 115, (5, 62, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], @@ -261,7 +282,10 @@ self.HookMessage(self.OnActivate, win32con.WM_ACTIVATE) self.editReplaceText = self.GetDlgItem(104) self.editReplaceText.SetWindowText(lastSearch.replaceText) - self.editReplaceText.SetSel(0, -2) + if hasattr(self.editReplaceText, 'SetEditSel'): + self.editReplaceText.SetEditSel(0, -2) + else: + self.editReplaceText.SetSel(0, -2) self.butReplace = self.GetDlgItem(110) self.butReplaceAll = self.GetDlgItem(111) self.CheckButtonStates() diff -r 95b4f896b100 -r 9b3d4f355d25 Pythonwin/pywin/scintilla/view.py --- a/Pythonwin/pywin/scintilla/view.py Mon Jan 02 12:40:31 2012 +1100 +++ b/Pythonwin/pywin/scintilla/view.py Mon Jan 02 13:03:39 2012 +1100 @@ -406,6 +406,14 @@ items_dict = {} if ob is not None: try: # Catch unexpected errors when fetching attribute names from the object + # extra attributes of win32ui objects + if hasattr(ob, "_obj_"): + try: + items_dict.update(list2dict(dir(ob._obj_))) + except AttributeError: + pass # object has no __dict__ + + # normal attributes try: items_dict.update(list2dict(dir(ob))) except AttributeError: diff -r 95b4f896b100 -r 9b3d4f355d25 win32/Lib/win32con.py --- a/win32/Lib/win32con.py Mon Jan 02 12:40:31 2012 +1100 +++ b/win32/Lib/win32con.py Mon Jan 02 13:03:39 2012 +1100 @@ -4696,10 +4696,16 @@ MOVEFILE_DELAY_UNTIL_REBOOT = 4 MAX_COMPUTERNAME_LENGTH = 15 LOGON32_LOGON_INTERACTIVE = 2 +LOGON32_LOGON_NETWORK = 3 LOGON32_LOGON_BATCH = 4 LOGON32_LOGON_SERVICE = 5 +LOGON32_LOGON_UNLOCK = 7 +LOGON32_LOGON_NETWORK_CLEARTEXT = 8 +LOGON32_LOGON_NEW_CREDENTIALS = 9 LOGON32_PROVIDER_DEFAULT = 0 LOGON32_PROVIDER_WINNT35 = 1 +LOGON32_PROVIDER_WINNT40 = 2 +LOGON32_PROVIDER_WINNT50 = 3 VER_PLATFORM_WIN32s = 0 VER_PLATFORM_WIN32_WINDOWS = 1 VER_PLATFORM_WIN32_NT = 2 |