changeset 82:9c2803aea121

Fix Addressbook example and HG ignores
author Frank Benoit <benoit@tionex.de>
date Mon, 12 May 2008 16:29:26 +0200
parents 931cabfa238f
children b7e2d67d5efa
files .hgignore examples/addressbook/AddressBook.d examples/addressbook/DataEntryDialog.d examples/addressbook/SearchDialog.d
diffstat 4 files changed, 24 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Sun May 11 21:38:15 2008 +0200
+++ b/.hgignore	Mon May 12 16:29:26 2008 +0200
@@ -18,21 +18,22 @@
 ^jface/dsss.last
 ^jface/dsss_imports
 
-^dwtexamples/dsss_objs
-^dwtexamples/dsss.last
-^dwtexamples/dsss_imports
+^examples/dsss_objs
+^examples/dsss.last
+^examples/dsss_imports
 
-^dwtsnippets/dsss_objs
-^dwtsnippets/dsss.last
-^dwtsnippets/dsss_imports
+^snippets/dsss_objs
+^snippets/dsss.last
+^snippets/dsss_imports
 
-^dwtexamples/simple$
-^dwtexamples/helloworld/HelloWorld[0-9]$
-^dwtexamples/addressbook/AddressBook$
-^dwtexamples/controlexample/ControlExample$
-^dwtexamples/controlexample/CustomControlExample$
-^dwtexamples/texteditor/TextEditor$
-^dwtsnippets/.*/Snippet[0-9]*$
+^examples/simple$
+^examples/helloworld/HelloWorld[0-9]$
+^examples/addressbook/AddressBook$
+^examples/clipboard/ClipboardExample$
+^examples/controlexample/ControlExample$
+^examples/controlexample/CustomControlExample$
+^examples/texteditor/TextEditor$
+^snippets/.*/Snippet[0-9]*$
 ^user/torhu_synctest$
 ^user/drawingboard/DrawingBoard$
 ^user/dragdrop/texttolabel$
--- a/examples/addressbook/AddressBook.d	Sun May 11 21:38:15 2008 +0200
+++ b/examples/addressbook/AddressBook.d	Mon May 12 16:29:26 2008 +0200
@@ -45,6 +45,9 @@
 import examples.addressbook.DataEntryDialog;
 import examples.addressbook.FindListener;
 
+version(JIVE){
+    import jive.stacktrace;
+}
 void main() {
     Display display = new Display();
     auto application = new AddressBook();
@@ -108,7 +111,7 @@
 
     createMenuBar();
 
-    searchDialog = new SearchDialog(shell);
+    searchDialog = new SearchDialog(shell, resAddressBook );
     searchDialog.setSearchAreaNames(columnNames);
     searchDialog.setSearchAreaLabel(resAddressBook.getString("Column"));
     searchDialog.addFindListener(new class() FindListener {
@@ -204,7 +207,7 @@
     box.open();
 }
 private void editEntry(TableItem item) {
-    DataEntryDialog dialog = new DataEntryDialog(shell);
+    DataEntryDialog dialog = new DataEntryDialog(shell, resAddressBook );
     dialog.setLabels(columnNames);
     char[][] values = new char[][table.getColumnCount()];
     for (int i = 0; i < values.length; i++) {
@@ -283,7 +286,7 @@
     isModified = false;
 }
 private void newEntry() {
-    DataEntryDialog dialog = new DataEntryDialog(shell);
+    DataEntryDialog dialog = new DataEntryDialog(shell, resAddressBook);
     dialog.setLabels(columnNames);
     char[][] data = dialog.open();
     if (data !is null) {
--- a/examples/addressbook/DataEntryDialog.d	Sun May 11 21:38:15 2008 +0200
+++ b/examples/addressbook/DataEntryDialog.d	Mon May 12 16:29:26 2008 +0200
@@ -41,9 +41,9 @@
     char[][] values;
     char[][] labels;
 
-public this(Shell parent) {
+public this(Shell parent, ResourceBundle bdl ) {
     if( resAddressBook is null ){
-        resAddressBook = ResourceBundle.getBundle("examples_addressbook");
+        resAddressBook = bdl;//ResourceBundle.getBundle("examples_addressbook");
     }
     shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.PRIMARY_MODAL);
     shell.setLayout(new GridLayout());
--- a/examples/addressbook/SearchDialog.d	Sun May 11 21:38:15 2008 +0200
+++ b/examples/addressbook/SearchDialog.d	Mon May 12 16:29:26 2008 +0200
@@ -59,9 +59,9 @@
  * @param parent    Shell
  *          The shell that is the parent of the dialog.
  */
-public this(Shell parent) {
+public this(Shell parent, ResourceBundle bdl ) {
     if( resAddressBook is null ){
-        resAddressBook = ResourceBundle.getBundle("examples_addressbook");
+        resAddressBook = bdl;//ResourceBundle.getBundle("examples_addressbook");
     }
     shell = new Shell(parent, DWT.CLOSE | DWT.BORDER | DWT.TITLE);
     GridLayout layout = new GridLayout();