From d0b7b5499ae9282c1b890aa3b467adbcc0d74e6a Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Wed, 12 Sep 2012 14:20:13 +0200 Subject: [PATCH] class library: implement openTextFile via openDocument Signed-off-by: Tim Blechmann --- SCClassLibrary/Common/Core/Symbol.sc | 4 ---- .../Common/GUI/PlusGUI/Collections/StringPlusGUI.sc | 9 +++++---- SCClassLibrary/deprecated/deprecated-3.7.sc | 13 +++++++++++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/SCClassLibrary/Common/Core/Symbol.sc b/SCClassLibrary/Common/Core/Symbol.sc index b6ac32ddd..d3346c314 100644 --- a/SCClassLibrary/Common/Core/Symbol.sc +++ b/SCClassLibrary/Common/Core/Symbol.sc @@ -62,10 +62,6 @@ Symbol { } isRest { ^this.isMap.not } - openTextFile { arg selectionStart=0, selectionLength=0; - ^this.asString.openTextFile(selectionStart, selectionLength) - } - // Environment support // The compiler translates use of an Environment variable like ~myvar // to a call to one of these methods, for example: diff --git a/SCClassLibrary/Common/GUI/PlusGUI/Collections/StringPlusGUI.sc b/SCClassLibrary/Common/GUI/PlusGUI/Collections/StringPlusGUI.sc index dfba2b0ca..2b4280f11 100644 --- a/SCClassLibrary/Common/GUI/PlusGUI/Collections/StringPlusGUI.sc +++ b/SCClassLibrary/Common/GUI/PlusGUI/Collections/StringPlusGUI.sc @@ -3,10 +3,6 @@ Document.new(title, this, makeListener); } - openTextFile { arg selectionStart=0, selectionLength=0; - this.openDocument(selectionStart, selectionLength) - } - openHTMLFile{ arg selectionStart=0, selectionLength=0; if (Platform.openHTMLFileAction.notNil) { Platform.openHTMLFileAction.value(this, selectionStart, selectionLength) @@ -124,3 +120,8 @@ } } ++ Symbol { + openDocument { arg selectionStart=0, selectionLength=0; + ^this.asString.openDocument(selectionStart, selectionLength) + } +} diff --git a/SCClassLibrary/deprecated/deprecated-3.7.sc b/SCClassLibrary/deprecated/deprecated-3.7.sc index bf84e6fb8..1f9865d3d 100644 --- a/SCClassLibrary/deprecated/deprecated-3.7.sc +++ b/SCClassLibrary/deprecated/deprecated-3.7.sc @@ -24,3 +24,16 @@ } } + +// openTextFile is actually the same as openDocument ++ String { + openTextFile { arg selectionStart=0, selectionLength=0; + this.openDocument(selectionStart, selectionLength) + } +} + ++ Symbol { + openTextFile { arg selectionStart=0, selectionLength=0; + ^this.openDocument(selectionStart, selectionLength) + } +} -- 2.11.4.GIT