Changeset 173:33d9146198b2
- Timestamp:
- 10/26/08 09:53:07
(3 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
| r169 |
r173 |
|
| 1 | 1 | module test; |
|---|
| 2 | 2 | |
|---|
| 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; |
|---|
| | 3 | import dwt.std; |
|---|
| 9 | 4 | import dwtx.jface.text.Document; |
|---|
| 10 | 5 | import dwtx.jface.text.source.CompositeRuler; |
|---|
| … | … | |
| 16 | 11 | version(JIVE) import jive.stacktrace; |
|---|
| 17 | 12 | |
|---|
| 18 | | class SourceViewerTest : ApplicationWindow |
|---|
| | 13 | const char[] startText = `void main() |
|---|
| 19 | 14 | { |
|---|
| 20 | | this() |
|---|
| 21 | | { |
|---|
| | 15 | ApplicationWindow w = new SourceViewerTest(); |
|---|
| | 16 | w.setBlockOnOpen( true ); |
|---|
| | 17 | w.open(); |
|---|
| | 18 | Display.getCurrent.dispose(); |
|---|
| | 19 | } |
|---|
| | 20 | `; |
|---|
| | 21 | |
|---|
| | 22 | class SourceViewerTest : ApplicationWindow { |
|---|
| | 23 | this() { |
|---|
| 22 | 24 | super( null ); |
|---|
| 23 | 25 | } |
|---|
| 24 | 26 | |
|---|
| 25 | | protected Control createContents( Composite parent ) |
|---|
| 26 | | { |
|---|
| | 27 | protected Control createContents( Composite parent ) { |
|---|
| 27 | 28 | getShell.setText( "SourceViewerTest" ); |
|---|
| 28 | 29 | getShell.setSize( 350, 400 ); |
|---|
| … | … | |
| 38 | 39 | ruler.addDecorator( 0, lineCol ); |
|---|
| 39 | 40 | |
|---|
| 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 ); |
|---|
| 48 | 42 | |
|---|
| 49 | 43 | SourceViewer sv = new SourceViewer( container, ruler, DWT.BORDER | DWT.H_SCROLL | DWT.V_SCROLL ); |
|---|
| … | … | |
| 54 | 48 | } |
|---|
| 55 | 49 | |
|---|
| 56 | | void main() |
|---|
| 57 | | { |
|---|
| | 50 | void main() { |
|---|
| 58 | 51 | ApplicationWindow w = new SourceViewerTest(); |
|---|
| 59 | 52 | w.setBlockOnOpen( true ); |
|---|
| … | … | |
| 68 | 61 | |
|---|
| 69 | 62 | |
|---|
| 70 | | |
|---|