Show
Ignore:
Timestamp:
10/26/08 09:53:07 (4 years ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

minor edits in jface text example

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jface.text/Simple.d

    r169 r173  
    11module test; 
    22 
    3 import dwt.DWT; 
    4 import dwt.layout.FillLayout; 
    5 import dwt.widgets.Composite; 
    6 import dwt.widgets.Control; 
    7 import dwt.widgets.Display; 
    8 import dwt.widgets.Shell; 
     3import dwt.std; 
    94import dwtx.jface.text.Document; 
    105import dwtx.jface.text.source.CompositeRuler; 
     
    1611version(JIVE) import jive.stacktrace; 
    1712 
    18 class SourceViewerTest : ApplicationWindow 
     13const char[] startText = `void main() 
    1914{ 
    20     this() 
    21     { 
     15    ApplicationWindow w = new SourceViewerTest(); 
     16    w.setBlockOnOpen( true ); 
     17    w.open(); 
     18    Display.getCurrent.dispose(); 
     19
     20`; 
     21 
     22class SourceViewerTest : ApplicationWindow { 
     23    this() { 
    2224        super( null ); 
    2325    } 
    2426 
    25     protected Control createContents( Composite parent ) 
    26     { 
     27    protected Control createContents( Composite parent ) { 
    2728        getShell.setText( "SourceViewerTest" ); 
    2829        getShell.setSize( 350, 400 ); 
     
    3839        ruler.addDecorator( 0, lineCol ); 
    3940 
    40         Document doc = new Document( `void main() 
    41 
    42     ApplicationWindow w = new SourceViewerTest(); 
    43     w.setBlockOnOpen( true ); 
    44     w.open(); 
    45     Display.getCurrent.dispose(); 
    46 
    47 ` ); 
     41        Document doc = new Document( startText ); 
    4842 
    4943        SourceViewer sv = new SourceViewer( container, ruler, DWT.BORDER | DWT.H_SCROLL | DWT.V_SCROLL ); 
     
    5448} 
    5549 
    56 void main() 
    57 
     50void main() { 
    5851    ApplicationWindow w = new SourceViewerTest(); 
    5952    w.setBlockOnOpen( true ); 
     
    6861 
    6962 
    70