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

Updater SWT 3.4M7 to 3.4

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/custom/StyledText.d

    r244 r246  
    11/******************************************************************************* 
    2  * Copyright (c) 2000, 2007 IBM Corporation and others. 
     2 * Copyright (c) 2000, 2008 IBM Corporation and others. 
    33 * All rights reserved. This program and the accompanying materials 
    44 * are made available under the terms of the Eclipse Public License v1.0 
     
    144144 * IMPORTANT: This class is <em>not</em> intended to be subclassed. 
    145145 * </p> 
     146 * 
     147 * @see <a href="http://www.eclipse.org/swt/snippets/#styledtext">StyledText snippets</a> 
     148 * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Examples: CustomControlExample, TextEditor</a> 
     149 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> 
    146150 */ 
    147151public class StyledText : Canvas { 
     
    198202    bool editable = true; 
    199203    bool wordWrap = false; 
    200     bool doubleClickEnabled = true; // see getDoubleClickEnabled 
    201     bool overwrite = false;         // insert/overwrite edit mode 
     204    bool doubleClickEnabled = true; // see getDoubleClickEnabled 
     205    bool overwrite = false;          // insert/overwrite edit mode 
    202206    int textLimit = -1;                 // limits the number of characters the user can type in the widget. Unlimited by default. 
    203207    int[int] keyActionMap; 
     
    215219    int lastLineBottom;                 // the bottom pixel of the last line been replaced 
    216220    bool isMirrored_; 
    217     bool bidiColoring = false;      // apply the BIDI algorithm on text segments of the same color 
     221    bool bidiColoring = false;      // apply the BIDI algorithm on text segments of the same color 
    218222    Image leftCaretBitmap = null; 
    219223    Image rightCaretBitmap = null; 
     
    264268        int startLine;                                  // first (wrapped) line to print 
    265269        int endLine;                                    // last (wrapped) line to print 
    266         bool singleLine;                                // widget single line mode 
     270        bool singleLine;                             // widget single line mode 
    267271        Point selection = null;                 // selected text 
    268         bool mirrored;                      // indicates the printing gc should be mirrored 
     272        bool mirrored;                      // indicates the printing gc should be mirrored 
    269273        int lineSpacing; 
    270274        int printMargin; 
     
    38253829 * It means this function can be used to retrieve the bottom pixel of any line. 
    38263830 * 
     3831 * @return the top pixel of a given line index 
     3832 *  
    38273833 * @since 3.2 
    38283834 */ 
     
    38513857 * Returns the line index for a y, relative to the client area. 
    38523858 * The line index returned is always in the range 0..lineCount - 1. 
     3859 *  
     3860 * @param y the y-coordinate pixel 
     3861 *  
     3862 * @return the line index for a given y-coordinate pixel 
    38533863 * 
    38543864 * @since 3.2 
     
    51285138    if (length is ime.getCommitCount()) { 
    51295139        content.replaceTextRange(start, end - start, ""); 
    5130         caretOffset = start
     5140        caretOffset = ime.getCompositionOffset()
    51315141        caretWidth = 0; 
    51325142        caretDirection = DWT.NULL; 
     
    51355145        caretOffset = ime.getCaretOffset(); 
    51365146        if (ime.getWideCaret()) { 
     5147            start = ime.getCompositionOffset(); 
    51375148            int lineIndex = getCaretLine(); 
    51385149            int lineOffset = content.getOffsetAtLine(lineIndex); 
     
    55185529        if (lastLineBottom !is newLastLineBottom) { 
    55195530            super.redraw(); 
    5520             if (wordWrap) setCaretLocation(); 
    55215531        } else { 
    55225532            super.redraw(0, firstLineTop, clientAreaWidth, newLastLineBottom - firstLineTop, false); 
     
    60656075 * 
    60666076 * @param printer the printer to print to 
     6077 * 
     6078 * @return a <code>Runnable</code> for printing the receiver's text 
     6079 * 
    60676080 * @exception DWTException <ul> 
    60686081 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    60946107 * @param printer the printer to print to 
    60956108 * @param options print options to use during printing 
     6109 * 
     6110 * @return a <code>Runnable</code> for printing the receiver's text 
     6111 * 
    60966112 * @exception DWTException <ul> 
    60976113 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    62526268 * Removes the specified bidirectional segment listener. 
    62536269 * 
    6254  * @param listener the listener 
     6270 * @param listener the listener which should no longer be notified 
     6271 *  
    62556272 * @exception DWTException <ul> 
    62566273 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    62606277 *    <li>ERROR_NULL_ARGUMENT when listener is null</li> 
    62616278 * </ul> 
     6279 *  
    62626280 * @since 2.0 
    62636281 */ 
     
    62706288 * Removes the specified extended modify listener. 
    62716289 * 
    6272  * @param extendedModifyListener the listener 
     6290 * @param extendedModifyListener the listener which should no longer be notified 
     6291 * 
    62736292 * @exception DWTException <ul> 
    62746293 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    62876306 * Removes the specified line background listener. 
    62886307 * 
    6289  * @param listener the listener 
     6308 * @param listener the listener which should no longer be notified 
     6309 *  
    62906310 * @exception DWTException <ul> 
    62916311 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    63046324 * Removes the specified line style listener. 
    63056325 * 
    6306  * @param listener the listener 
     6326 * @param listener the listener which should no longer be notified 
     6327 *  
    63076328 * @exception DWTException <ul> 
    63086329 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    63216342 * Removes the specified modify listener. 
    63226343 * 
    6323  * @param modifyListener the listener 
     6344 * @param modifyListener the listener which should no longer be notified 
     6345 *  
    63246346 * @exception DWTException <ul> 
    63256347 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    63386360 * Removes the specified listener. 
    63396361 * 
    6340  * @param listener the listener 
     6362 * @param listener the listener which should no longer be notified 
     6363 *  
    63416364 * @exception DWTException <ul> 
    63426365 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    63786401 * Removes the specified verify listener. 
    63796402 * 
    6380  * @param verifyListener the listener 
     6403 * @param verifyListener the listener which should no longer be notified 
     6404 *  
    63816405 * @exception DWTException <ul> 
    63826406 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    63956419 * Removes the specified key verify listener. 
    63966420 * 
    6397  * @param listener the listener 
     6421 * @param listener the listener which should no longer be notified 
     6422 *  
    63986423 * @exception DWTException <ul> 
    63996424 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    64116436 * Removes the specified word movement listener. 
    64126437 * 
    6413  * @param listener the listener 
     6438 * @param listener the listener which should no longer be notified 
     6439 *  
    64146440 * @exception DWTException <ul> 
    64156441 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    71097135    super.redraw(); 
    71107136} 
    7111 /** 
    7112  * @see dwt.widgets.Control#setForeground 
    7113  */ 
    71147137public override void setForeground(Color color) { 
    71157138    checkWidget(); 
     
    84008423    if (selection.y <= startOffset) { 
    84018424        // selection ends before text change 
     8425        if (wordWrap) setCaretLocation(); 
    84028426        return; 
    84038427    }