Updated to optionally use Carbon Scrap manager.

This commit is contained in:
Jack Jansen 2001-12-31 15:02:56 +00:00
parent ad8381a8f0
commit 9cf00dd551
4 changed files with 39 additions and 13 deletions

View File

@ -141,7 +141,10 @@ class TEWindow(ScrolledWindow):
def menu_cut(self):
self.ted.TESelView()
self.ted.TECut()
Scrap.ZeroScrap()
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
TE.TEToScrap()
self.updatescrollbars()
self.parent.updatemenubar()
@ -149,7 +152,10 @@ class TEWindow(ScrolledWindow):
def menu_copy(self):
self.ted.TECopy()
Scrap.ZeroScrap()
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
TE.TEToScrap()
self.updatescrollbars()
self.parent.updatemenubar()
@ -226,8 +232,13 @@ class Ped(Application):
if hasattr(Scrap, 'InfoScrap'):
on = (Scrap.InfoScrap()[0] <> 0)
else:
# Not there yet on Carbon, simply always enable
on = 1
flavors = Scrap.GetCurrentScrap().GetScrapFlavorInfoList()
for tp, info in flavors:
if tp == 'TEXT':
on = 1
break
else:
on = 0
if on <> self.pastegroup_on:
self.pasteitem.enable(on)
self.pastegroup_on = on

View File

@ -297,14 +297,19 @@ class WasteWindow(ScrolledWindow):
def menu_cut(self):
self.ted.WESelView()
self.ted.WECut()
Scrap.ZeroScrap()
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECut()
self.updatescrollbars()
self.parent.updatemenubar()
def menu_copy(self):
Scrap.ZeroScrap()
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECopy()
self.updatescrollbars()
self.parent.updatemenubar()

View File

@ -235,14 +235,19 @@ class WasteWindow(ScrolledWindow):
def menu_cut(self):
self.ted.WESelView()
self.ted.WECut()
Scrap.ZeroScrap()
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECut()
self.updatescrollbars()
self.parent.updatemenubar()
def menu_copy(self):
Scrap.ZeroScrap()
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECopy()
self.updatescrollbars()
self.parent.updatemenubar()

View File

@ -190,15 +190,20 @@ class WasteWindow(ScrolledWindow):
def menu_cut(self):
self.ted.WESelView()
self.ted.WECut()
Scrap.ZeroScrap()
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECut()
self.updatescrollbars()
self.parent.updatemenubar()
self.changed = 1
def menu_copy(self):
Scrap.ZeroScrap()
if hasattr(Scrap, 'ZeroScrap'):
Scrap.ZeroScrap()
else:
Scrap.ClearCurrentScrap()
self.ted.WECopy()
self.updatescrollbars()
self.parent.updatemenubar()