Changeset 144:7248e4c09c4f

Show
Ignore:
Timestamp:
08/07/08 17:04:04 (4 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Fix: make TextEditor? not using the tango.util.collection

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • examples/texteditor/Images.d

    r80 r144  
    1111 *     Thomas Graber <d4rkdragon@gmail.com> 
    1212 *******************************************************************************/ 
    13 module examples.texteditor.Images; 
     13module texteditor.Images; 
    1414 
    1515import dwt.dwthelper.InputStream; 
  • examples/texteditor/TextEditor.d

    r115 r144  
    1111 *     Thomas Graber <d4rkdragon@gmail.com> 
    1212 *******************************************************************************/ 
    13 module examples.texteditor.TextEditor; 
     13module texteditor.TextEditor; 
    1414 
    1515import dwt.DWT; 
     
    4040import dwt.dwthelper.utils; 
    4141 
    42 import tango.util.collection.ArraySeq; 
    43  
    44 import examples.texteditor.Images; 
     42import texteditor.Images; 
    4543 
    4644version( JIVE ){ 
     
    5553    StyledText text; 
    5654    Images images; 
    57     alias ArraySeq!(StyleRange) StyleCache; 
    58     StyleCache cachedStyles; 
     55    StyleRange[] cachedStyles; 
    5956 
    6057    Color RED = null; 
     
    334331        // handle the pasting of styles would be to access the Clipboard directly and 
    335332        // parse the RTF text. 
    336         cachedStyles = new StyleCache()
     333        cachedStyles = null
    337334        Point sel = text.getSelectionRange(); 
    338335        int startX = sel.x; 
     
    341338            if (style !is null) { 
    342339                style.start = style.start - startX; 
    343                 if (cachedStyles.toArray().length > 0) { 
    344                     StyleRange lastStyle = cachedStyles.tail()
     340                if (cachedStyles.length > 0) { 
     341                    StyleRange lastStyle = cachedStyles[$-1]
    345342                    if (lastStyle.similarTo(style) && lastStyle.start + lastStyle.length is style.start) { 
    346343                        lastStyle.length++; 
    347344                    } else { 
    348                         cachedStyles.append(style)
     345                        cachedStyles ~= style
    349346                    } 
    350347                } else { 
    351                     cachedStyles.append(style)
     348                    cachedStyles ~= style
    352349                } 
    353350            } 
     
    360357    void handleExtendedModify(ExtendedModifyEvent event) { 
    361358        if (event.length is 0) return; 
    362         StyleRange style; 
    363359        //PORTING event.length is char count, but it needs to decide on codepoint count 
    364360        auto cont = text.getTextRange(event.start, event.length); 
    365361        if ( codepointCount(cont) is 1 || cont == text.getLineDelimiter()) { 
     362            StyleRange style; 
    366363            // Have the new text take on the style of the text to its right (during 
    367364            // typing) if no style information is active.