diff options
author | Just van Rossum <just@letterror.com> | 2002-02-04 12:52:44 (GMT) |
---|---|---|
committer | Just van Rossum <just@letterror.com> | 2002-02-04 12:52:44 (GMT) |
commit | 4014401c6cad2fae3489da2fd091ba6994904463 (patch) | |
tree | 863fbb5633721e9906dc5d7619776453b197687e /Mac/Tools/IDE | |
parent | bf0a9084c5258db33d764b4735ae9d7805b7908d (diff) | |
download | cpython-4014401c6cad2fae3489da2fd091ba6994904463.zip cpython-4014401c6cad2fae3489da2fd091ba6994904463.tar.gz cpython-4014401c6cad2fae3489da2fd091ba6994904463.tar.bz2 |
Added minimal support for floating windows.
Diffstat (limited to 'Mac/Tools/IDE')
-rw-r--r-- | Mac/Tools/IDE/PyEdit.py | 8 | ||||
-rw-r--r-- | Mac/Tools/IDE/Wapplication.py | 17 | ||||
-rw-r--r-- | Mac/Tools/IDE/Wwindows.py | 13 |
3 files changed, 27 insertions, 11 deletions
diff --git a/Mac/Tools/IDE/PyEdit.py b/Mac/Tools/IDE/PyEdit.py index 2117fc4..fcbdc09 100644 --- a/Mac/Tools/IDE/PyEdit.py +++ b/Mac/Tools/IDE/PyEdit.py @@ -17,6 +17,12 @@ import string import marshal import re +if hasattr(Win, "FrontNonFloatingWindow"): + MyFrontWindow = Win.FrontNonFloatingWindow +else: + MyFrontWindow = Win.FrontWindow + + try: import Wthreading except ImportError: @@ -1189,7 +1195,7 @@ def _filename_as_modname(fname): return string.join(string.split(modname, '.'), '_') def findeditor(topwindow, fromtop = 0): - wid = Win.FrontWindow() + wid = MyFrontWindow() if not fromtop: if topwindow.w and wid == topwindow.w.wid: wid = topwindow.w.wid.GetNextWindow() diff --git a/Mac/Tools/IDE/Wapplication.py b/Mac/Tools/IDE/Wapplication.py index 40eb0c6..fdcd9fb 100644 --- a/Mac/Tools/IDE/Wapplication.py +++ b/Mac/Tools/IDE/Wapplication.py @@ -6,9 +6,14 @@ import MacOS from Carbon import Events import traceback from types import * - from Carbon import Menu; MenuToolbox = Menu; del Menu +if hasattr(Win, "FrontNonFloatingWindow"): + MyFrontWindow = Win.FrontNonFloatingWindow +else: + MyFrontWindow = Win.FrontWindow + + KILLUNKNOWNWINDOWS = 0 # Set to 0 for debugging. class Application(FrameWork.Application): @@ -115,7 +120,7 @@ class Application(FrameWork.Application): break def do_frontWindowMethod(self, attr, *args): - wid = Win.FrontWindow() + wid = MyFrontWindow() if wid and self._windows.has_key(wid): window = self._windows[wid] if hasattr(window, attr): @@ -146,7 +151,7 @@ class Application(FrameWork.Application): if keycode in self.fkeymaps.keys(): # JJS ch = self.fkeymaps[keycode] modifiers = modifiers | FrameWork.cmdKey - wid = Win.FrontWindow() + wid = MyFrontWindow() if modifiers & FrameWork.cmdKey and not modifiers & FrameWork.shiftKey: if wid and self._windows.has_key(wid): self.checkmenus(self._windows[wid]) @@ -175,7 +180,7 @@ class Application(FrameWork.Application): Qd.InitCursor() (what, message, when, where, modifiers) = event self.checkopenwindowsmenu() - wid = Win.FrontWindow() + wid = MyFrontWindow() if wid and self._windows.has_key(wid): self.checkmenus(self._windows[wid]) else: @@ -209,7 +214,7 @@ class Application(FrameWork.Application): def checkopenwindowsmenu(self): if self._openwindowscheckmark: self.openwindowsmenu.menu.CheckMenuItem(self._openwindowscheckmark, 0) - window = Win.FrontWindow() + window = MyFrontWindow() if window: for item, wid in self._openwindows.items(): if wid == window: @@ -441,7 +446,7 @@ class Menu(FrameWork.Menu): def _getmenuhandler(self, callback): menuhandler = None - wid = Win.FrontWindow() + wid = MyFrontWindow() if wid and self.bar.parent._windows.has_key(wid): window = self.bar.parent._windows[wid] if hasattr(window, "domenu_" + callback): diff --git a/Mac/Tools/IDE/Wwindows.py b/Mac/Tools/IDE/Wwindows.py index f0ac92b..653499b 100644 --- a/Mac/Tools/IDE/Wwindows.py +++ b/Mac/Tools/IDE/Wwindows.py @@ -7,6 +7,11 @@ import struct import traceback from types import InstanceType, StringType +if hasattr(Win, "FrontNonFloatingWindow"): + MyFrontWindow = Win.FrontNonFloatingWindow +else: + MyFrontWindow = Win.FrontWindow + class Window(FrameWork.Window, Wbase.SelectableWidget): @@ -488,9 +493,9 @@ class ModalDialog(Dialog): def do_key(self, event): (what, message, when, where, modifiers) = event - w = Win.FrontWindow() - if w <> self.wid: - return + #w = Win.FrontWindow() + #if w <> self.wid: + # return c = chr(message & Events.charCodeMask) if modifiers & Events.cmdKey: self.app.checkmenus(self) @@ -552,7 +557,7 @@ def FrontWindowInsert(stuff): raise TypeError, 'string expected' import W app = W.getapplication() - wid = Win.FrontWindow() + wid = MyFrontWindow() if wid and app._windows.has_key(wid): window = app._windows[wid] if hasattr(window, "insert"): |