David T. Lewis uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-dtl.997.mcz ==================== Summary ==================== Name: Morphic-dtl.997 Author: dtl Time: 23 August 2015, 9:32:02.122 pm UUID: e66cf3fd-1cd2-42c6-9fe2-c745eb1f688c Ancestors: Morphic-topa.996 Workspace "Send contents to printer" works in MVC, not in Morphic, due to missing implementation in the new Editor hierarchy. Add TextEditor>>sendContentsToPrinterWithLabel: for use with PluggableTextMorph. =============== Diff against Morphic-topa.996 =============== Item was changed: ----- Method: PluggableTextMorph>>sendContentsToPrinter (in category 'menu commands') ----- sendContentsToPrinter + self handleEdit: [textMorph editor sendContentsToPrinterWithLabel: owner knownName]! - self handleEdit: [textMorph editor sendContentsToPrinter]! Item was added: + ----- Method: TextEditor>>sendContentsToPrinterWithLabel: (in category 'menu messages') ----- + sendContentsToPrinterWithLabel: label + | textToPrint printer | + textToPrint := paragraph text. + textToPrint size = 0 ifTrue: [^self inform: 'nothing to print.']. + printer := TextPrinter defaultTextPrinter. + printer documentTitle: (label ifNil: ['Untitled']). + printer printText: textToPrint! |
Hi Dave,
I think this method belongs to Editor instead of TextEditor. Levente On Mon, 24 Aug 2015, [hidden email] wrote: > David T. Lewis uploaded a new version of Morphic to project The Trunk: > http://source.squeak.org/trunk/Morphic-dtl.997.mcz > > ==================== Summary ==================== > > Name: Morphic-dtl.997 > Author: dtl > Time: 23 August 2015, 9:32:02.122 pm > UUID: e66cf3fd-1cd2-42c6-9fe2-c745eb1f688c > Ancestors: Morphic-topa.996 > > Workspace "Send contents to printer" works in MVC, not in Morphic, due to missing implementation in the new Editor hierarchy. Add TextEditor>>sendContentsToPrinterWithLabel: for use with PluggableTextMorph. > > =============== Diff against Morphic-topa.996 =============== > > Item was changed: > ----- Method: PluggableTextMorph>>sendContentsToPrinter (in category 'menu commands') ----- > sendContentsToPrinter > + self handleEdit: [textMorph editor sendContentsToPrinterWithLabel: owner knownName]! > - self handleEdit: [textMorph editor sendContentsToPrinter]! > > Item was added: > + ----- Method: TextEditor>>sendContentsToPrinterWithLabel: (in category 'menu messages') ----- > + sendContentsToPrinterWithLabel: label > + | textToPrint printer | > + textToPrint := paragraph text. > + textToPrint size = 0 ifTrue: [^self inform: 'nothing to print.']. > + printer := TextPrinter defaultTextPrinter. > + printer documentTitle: (label ifNil: ['Untitled']). > + printer printText: textToPrint! > > > |
On Mon, Aug 24, 2015 at 11:42:58AM +0200, Levente Uzonyi wrote:
> Hi Dave, > > I think this method belongs to Editor instead of TextEditor. > > Levente I was not sure which was best. Most of the "menu messages" are in TextEditor, so I added the new one there for consistency. But as you say, Editor seems like a better place for them. Dave > > On Mon, 24 Aug 2015, [hidden email] wrote: > > >David T. Lewis uploaded a new version of Morphic to project The Trunk: > >http://source.squeak.org/trunk/Morphic-dtl.997.mcz > > > >==================== Summary ==================== > > > >Name: Morphic-dtl.997 > >Author: dtl > >Time: 23 August 2015, 9:32:02.122 pm > >UUID: e66cf3fd-1cd2-42c6-9fe2-c745eb1f688c > >Ancestors: Morphic-topa.996 > > > >Workspace "Send contents to printer" works in MVC, not in Morphic, due to > >missing implementation in the new Editor hierarchy. Add > >TextEditor>>sendContentsToPrinterWithLabel: for use with > >PluggableTextMorph. > > > >=============== Diff against Morphic-topa.996 =============== > > > >Item was changed: > > ----- Method: PluggableTextMorph>>sendContentsToPrinter (in category > > 'menu commands') ----- > > sendContentsToPrinter > >+ self handleEdit: [textMorph editor sendContentsToPrinterWithLabel: > >owner knownName]! > >- self handleEdit: [textMorph editor sendContentsToPrinter]! > > > >Item was added: > >+ ----- Method: TextEditor>>sendContentsToPrinterWithLabel: (in category > >'menu messages') ----- > >+ sendContentsToPrinterWithLabel: label > >+ | textToPrint printer | > >+ textToPrint := paragraph text. > >+ textToPrint size = 0 ifTrue: [^self inform: 'nothing to print.']. > >+ printer := TextPrinter defaultTextPrinter. > >+ printer documentTitle: (label ifNil: ['Untitled']). > >+ printer printText: textToPrint! > > > > > > |
On Mon, Aug 24, 2015 at 07:41:52AM -0400, David T. Lewis wrote:
> On Mon, Aug 24, 2015 at 11:42:58AM +0200, Levente Uzonyi wrote: > > Hi Dave, > > > > I think this method belongs to Editor instead of TextEditor. > > > > Levente > > I was not sure which was best. Most of the "menu messages" are in > TextEditor, so I added the new one there for consistency. But as you > say, Editor seems like a better place for them. > Sorry for replying to my own post, but I should note also that the class comment of Editor suggests that the original design intent was to support a variety of things that might be quite different from TextEditor (SimpleEditor? CellStyleEditor? what became of these?). So maybe the menu messages were put in TextEditor for that reason. The class comment is: New text editors. TextEditor provides most of the functionality that used to be in TextMorphEditor. SmalltalkEditor is has (sic) Smalltalk code specific features. SimpleEditor provides basic functionality for single line text editing. It does not handle fonts and styles, aligning and Smalltalk utilities. It handles one single line. CellStyleEditor allows entering alphabetic characters using only number keys, like many cell phones do. Dave > > > > > On Mon, 24 Aug 2015, [hidden email] wrote: > > > > >David T. Lewis uploaded a new version of Morphic to project The Trunk: > > >http://source.squeak.org/trunk/Morphic-dtl.997.mcz > > > > > >==================== Summary ==================== > > > > > >Name: Morphic-dtl.997 > > >Author: dtl > > >Time: 23 August 2015, 9:32:02.122 pm > > >UUID: e66cf3fd-1cd2-42c6-9fe2-c745eb1f688c > > >Ancestors: Morphic-topa.996 > > > > > >Workspace "Send contents to printer" works in MVC, not in Morphic, due to > > >missing implementation in the new Editor hierarchy. Add > > >TextEditor>>sendContentsToPrinterWithLabel: for use with > > >PluggableTextMorph. > > > > > >=============== Diff against Morphic-topa.996 =============== > > > > > >Item was changed: > > > ----- Method: PluggableTextMorph>>sendContentsToPrinter (in category > > > 'menu commands') ----- > > > sendContentsToPrinter > > >+ self handleEdit: [textMorph editor sendContentsToPrinterWithLabel: > > >owner knownName]! > > >- self handleEdit: [textMorph editor sendContentsToPrinter]! > > > > > >Item was added: > > >+ ----- Method: TextEditor>>sendContentsToPrinterWithLabel: (in category > > >'menu messages') ----- > > >+ sendContentsToPrinterWithLabel: label > > >+ | textToPrint printer | > > >+ textToPrint := paragraph text. > > >+ textToPrint size = 0 ifTrue: [^self inform: 'nothing to print.']. > > >+ printer := TextPrinter defaultTextPrinter. > > >+ printer documentTitle: (label ifNil: ['Untitled']). > > >+ printer printText: textToPrint! > > > > > > > > > |
Free forum by Nabble | Edit this page |