Bonjour,

J'aimerai faire en sorte que l'un de mes éléments dans un ExpandItem soit une ExpandBar (à la manière d'un Tree).

L'objectif est en fait d'insérer des widgets dans mon arborescence pour une modification directe de paramètres.

Voici le code que j'ai pour le moment (extrait en grande partie des exemples fournis par la doc Eclipse de SWT):
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
ExpandBar bar = new ExpandBar (shell, SWT.V_SCROLL);
composite = new Composite (bar, SWT.NONE);
layout = new GridLayout (2, false);
layout.marginLeft = layout.marginTop = layout.marginRight =
layout.marginBottom = 10;
layout.verticalSpacing = 10;
composite.setLayout(layout);    
 
//Test D'ajout d'une ExpandBar
GridData expSec = new GridData();
expSec.horizontalSpan = 2;
expSec.grabExcessVerticalSpace = true;
ExpandBar barSec = new ExpandBar(composite, SWT.NONE);
Composite compoSec = new Composite(barSec, SWT.NONE);
GridLayout laySec = new GridLayout(2, true);
compoSec.setLayout(laySec);
ExpandItem itemSec = new ExpandItem(barSec, SWT.NONE, 0);
itemSec.setText("TRIGGER");
itemSec.setHeight(compoSec.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
itemSec.setControl(compoSec);
barSec.setLayoutData(expSec);
 
//Fin d'implémentation du test d'ajout
A l'affichage, j'ai bien la "sous-barre" qui s'affiche, mais pas son contenu au déroulement de cette dernière.

Ma question est donc: est-il possible de créer une "sous-barre" de type sous-menu dans un objet ExpandBar? Si oui, par quels moyens puis-je y arriver?

Merci à tous et bonne journée

Abdehüe