|
39 | 39 |
|
40 | 40 | import com.sun.star.awt.ActionEvent;
|
41 | 41 | import com.sun.star.awt.SpinEvent;
|
| 42 | +import com.sun.star.awt.TextEvent; |
42 | 43 | import com.sun.star.awt.XButton;
|
43 | 44 | import com.sun.star.awt.XCheckBox;
|
44 | 45 | import com.sun.star.awt.XContainerWindowProvider;
|
|
60 | 61 | import de.muenchen.allg.itd51.wollmux.core.dialog.adapter.AbstractAdjustmentListener;
|
61 | 62 | import de.muenchen.allg.itd51.wollmux.core.dialog.adapter.AbstractItemListener;
|
62 | 63 | import de.muenchen.allg.itd51.wollmux.core.dialog.adapter.AbstractSpinListener;
|
| 64 | +import de.muenchen.allg.itd51.wollmux.core.dialog.adapter.AbstractTextListener; |
63 | 65 | import de.muenchen.allg.itd51.wollmux.core.dialog.adapter.AbstractTopWindowListener;
|
64 | 66 |
|
65 | 67 | /**
|
@@ -229,6 +231,7 @@ public void windowClosed(EventObject arg0)
|
229 | 231 | {
|
230 | 232 | spinListener[i - 1] = new MySpinListener();
|
231 | 233 | UNO.XSpinField(container.getControl("Count" + i)).addSpinListener(spinListener[i - 1]);
|
| 234 | + UNO.XTextComponent(container.getControl("Count" + i)).addTextListener(spinListener[i - 1]); |
232 | 235 | printListener[i - 1] = new MyActionListener();
|
233 | 236 | UNO.XButton(container.getControl("Print" + i)).addActionListener(printListener[i - 1]);
|
234 | 237 | }
|
@@ -336,7 +339,7 @@ private void updateSum()
|
336 | 339 | *
|
337 | 340 | * @author daniel.sikeler
|
338 | 341 | */
|
339 |
| - private class MySpinListener extends AbstractSpinListener |
| 342 | + private class MySpinListener extends AbstractSpinListener implements AbstractTextListener |
340 | 343 | {
|
341 | 344 | /**
|
342 | 345 | * Der Verfügungspunkt, bei dem die Anzahl der Kopien geänder werden soll.
|
@@ -371,6 +374,19 @@ private void updateCount(short copyCount)
|
371 | 374 | info.setCopyCount(copyCount);
|
372 | 375 | updateSum();
|
373 | 376 | }
|
| 377 | + |
| 378 | + @Override |
| 379 | + public void textChanged(TextEvent event) |
| 380 | + { |
| 381 | + try |
| 382 | + { |
| 383 | + short count = Short.parseShort(UNO.XTextComponent(event.Source).getText()); |
| 384 | + updateCount(count); |
| 385 | + } catch (NumberFormatException e) |
| 386 | + { |
| 387 | + LOGGER.error("Keine Zahl", e); |
| 388 | + } |
| 389 | + } |
374 | 390 | }
|
375 | 391 |
|
376 | 392 | /**
|
|
0 commit comments