2011-02-08 11 views

risposta

2

Questo potrebbe non essere esattamente quello che stai chiedendo, ma si potrebbe integrare un widget di testo accanto al widget di Scala, rispondendo ai vostri valori di scala.

Per esempio:

final Scale scale = new Scale(shell, SWT.HORIZONTAL); 
     scaleValue = new Text(shell, SWT.SINGLE | SWT.BORDER); 

     //scale properties omitted... 

     scale.addListener(SWT.Selection, new Listener() { 
      public void handleEvent(Event event) { 
       int perspectivevalue = scale.getSelection(); 
       scaleValue.setText("" + (perspectivevalue)); 
      } 
     }); 

Questo ha l'effetto di aggiornare il valore nel widget di testo dato qualunque cosa si trascina il cursore Scala a.

Problemi correlati