Mercurial > projects > dwt-samples
comparison dwtexamples/controlexample/CustomControlExample.d @ 65:a84ba4d1820f
restructure the dsss.conf and resources
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 11 Apr 2008 21:15:36 +0200 |
parents | 5c244d50e532 |
children |
comparison
equal
deleted
inserted
replaced
64:b2bcc4b13c31 | 65:a84ba4d1820f |
---|---|
25 import dwtexamples.controlexample.CTabFolderTab; | 25 import dwtexamples.controlexample.CTabFolderTab; |
26 import dwtexamples.controlexample.SashFormTab; | 26 import dwtexamples.controlexample.SashFormTab; |
27 import dwtexamples.controlexample.StyledTextTab; | 27 import dwtexamples.controlexample.StyledTextTab; |
28 import dwtexamples.controlexample.Tab; | 28 import dwtexamples.controlexample.Tab; |
29 | 29 |
30 version( CUSTOM_CONTROL_EXAMPLE_MAIN ){ | 30 public class CustomControlExampleFactory : IControlExampleFactory { |
31 void main(){ | 31 CustomControlExample create(Shell shell, char[] title) { |
32 | |
32 Stdout.formatln( "The CustomControlExample: still work left" ); | 33 Stdout.formatln( "The CustomControlExample: still work left" ); |
33 Stdout.formatln( "warning in Control:setBounds() line=695 gtk_widget_size_allocate()" ); | 34 Stdout.formatln( "warning in Control:setBounds() line=695 gtk_widget_size_allocate()" ); |
34 Stdout.formatln( "Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 15" ); | 35 Stdout.formatln( "Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 15" ); |
35 Stdout.formatln( "for the CTabFolder widget. Params are OK. Further bugtracking needed." ); | 36 Stdout.formatln( "for the CTabFolder widget. Params are OK. Further bugtracking needed." ); |
36 Stdout.formatln( "please report problems" ); | 37 Stdout.formatln( "please report problems" ); |
37 CustomControlExample.main( null ); | 38 |
39 auto res = new CustomControlExample( shell ); | |
40 shell.setText(ControlExample.getResourceString("custom.window.title")); | |
41 return res; | |
38 } | 42 } |
39 } | 43 } |
44 | |
40 | 45 |
41 public class CustomControlExample : ControlExample { | 46 public class CustomControlExample : ControlExample { |
42 | 47 |
43 /** | 48 /** |
44 * Creates an instance of a CustomControlExample embedded | 49 * Creates an instance of a CustomControlExample embedded |
60 new CTabFolderTab (this), | 65 new CTabFolderTab (this), |
61 new SashFormTab (this), | 66 new SashFormTab (this), |
62 new StyledTextTab (this) | 67 new StyledTextTab (this) |
63 ]; | 68 ]; |
64 } | 69 } |
65 | |
66 /** | |
67 * Invokes as a standalone program. | |
68 */ | |
69 public static void main(char[][] args) { | |
70 Display display = new Display(); | |
71 Shell shell = new Shell(display); | |
72 shell.setLayout(new FillLayout()); | |
73 CustomControlExample instance = new CustomControlExample(shell); | |
74 shell.setText(getResourceString("custom.window.title")); | |
75 setShellSize(instance, shell); | |
76 shell.open(); | |
77 while (! shell.isDisposed()) { | |
78 if (! display.readAndDispatch()) display.sleep(); | |
79 } | |
80 instance.dispose(); | |
81 } | |
82 } | 70 } |