Changeset 808

Show
Ignore:
Timestamp:
09/07/05 14:33:36 (3 years ago)
Author:
tzanko
Message:

nbshell: worked on tickets #13 and #16

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nbshell/trunk/ChangeLog

    r792 r808  
     109.07.2005: 
     2 
     3    * Fixed a bug in copy/paste according to ticket #13 
     4 
     5    * Deleted help message in the beginning (ticket #16) 
    1609.05.2005: 
    27 
  • nbshell/trunk/nbshell/PythonPlugin.py

    r773 r808  
    346346        if len(self.line2log) == 0: 
    347347            self.line2log.append(None) #the window always has at least one line 
     348        else: 
     349            self.line2log.append(None) #append ane empty line at the end 
     350            outtext.write('\n') 
    348351        self.window.SetText(outtext.getvalue()) 
    349352        self.window.GotoPos(self.window.GetTextLength()) 
     
    832835        if not wx.TheClipboard.Open(): 
    833836            return 
    834         if self.line2log[linenum] is None: 
     837        if self.line2log[linenum] is None:  
     838            #we are between cells 
    835839            if wx.TheClipboard.IsSupported(wx.CustomDataFormat('nbCell')): 
    836840                codecell = True 
    837841                wx.TheClipboard.GetData(cellobj) 
    838842        else: 
     843            #we are inside a cell.  
    839844            if wx.TheClipboard.IsSupported(wx.CustomDataFormat('nbCode')): 
    840845                codetext = True 
    841846                wx.TheClipboard.GetData(codeobj) 
     847            #if we are at the last character in the cell and there is a nbCell object 
     848            elif ((len(self.line2log) -1 == linenum or #if linenum is the last line in the cell 
     849                   self.line2log[linenum+1] is None or 
     850                   self.line2log[linenum+1][0] != self.line2log[linenum][0]) and 
     851                  #and caret is at the end of the line 
     852                  pos == self.window.PositionFromLine(linenum) +\ 
     853                         self.window.LineLength(linenum)): 
     854                linenum += 1 #this will be the place where we paste the cells 
     855                wx.TheClipboard.GetData(cellobj) 
     856                codecell = True 
    842857            elif (wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)) or 
    843                   wx.TheClipboard.IsSupported(wx.DataFormat(DF_UNICODETEXT))): 
     858                  wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_UNICODETEXT))): 
    844859                rawtext = True 
    845860                wx.TheClipboard.GetData(textobj) 
  • nbshell/trunk/nbshell/Sheet.py

    r771 r808  
    411411        #We only need to set self.last 
    412412        self.element = self.notebook.default_sheet() 
    413         textelem = etree.Element('para') 
    414         textelem.text =\ 
    415 """ This is a temporary message, until I write proper help. 
    416 Please use Return to insert, Shift-Return to execute inputs and Ctrl-Return to 
    417 reexecute an input and all inputs that follow. """ 
    418         self.element[0:0] = [textelem] 
     413        #textelem = etree.Element('para') 
     414        #textelem.text =\ 
     415#""" This is a temporary message, until I write proper help. 
     416#Please use Return to insert, Shift-Return to execute inputs and Ctrl-Return to 
     417#reexecute an input and all inputs that follow. """ 
     418#        self.element[0:0] = [textelem] 
    419419        # Now remove the old sheet and replace it with the new one 
    420420        oldsheet = self.notebook.root.find('sheet')