IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

SWT/JFace Java Discussion :

[SWT] problème de layout


Sujet :

SWT/JFace Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Par défaut [SWT] problème de layout
    Hello,

    Je me retrouve encore avec un problème de positionnement de mes widgets

    voici mon code

    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
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
     
    	protected Control createDialogArea(Composite parent) {
    	    Composite body = (Composite)super.createDialogArea(parent);
     
    	    GridLayout gridLayout = new GridLayout();
    	    gridLayout.numColumns = 4;
    	    gridLayout.makeColumnsEqualWidth = true;
     
    	    body.setLayout(gridLayout);
    	    GridData gridData = new GridData();
    		gridData.heightHint = 250;
     
    		body.setLayoutData(gridData);
    		// Event label
    		Label eventLbl = new Label(body, SWT.LEFT);
    		eventLbl.setText("Event:");
     
    		// Events combo box
    		eventCbx = new Combo(body, SWT.NULL);
    		fillEventTypesList(widget);
    		eventCbx.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    		eventCbx.addSelectionListener(new SelectionAdapter() {
    			public void widgetSelected(SelectionEvent e) {
    				int index = ((CCombo) e.getSource()).getSelectionIndex();
    				String eventName = eventCbx.getItem(index);
    				event = makeWidgetEvent(eventName);
    				eventType = findEventType(eventName, widget.getType());
    			}
    		});
    		// Functions label
    		Label functionsLbl = new Label(body, SWT.LEFT);
    		functionsLbl.setText("Functions:");
    		gridData = new GridData(GridData.BEGINNING);
     
    		functionsLbl.setLayoutData(gridData);
    		fctList = new List(body,SWT.BORDER | SWT.SINGLE
    				| SWT.V_SCROLL);
    		gridData = new GridData(GridData.END);
    		gridData.verticalSpan = 2;
    		gridData.horizontalSpan = 1;
    		gridData.heightHint = 140;
     
    		//Functions list
    		fctList.setLayoutData(gridData);
    		fctList.addSelectionListener(new SelectionAdapter() {
    			public void widgetSelected(SelectionEvent e) {
    				int index = ((List) e.getSource()).getSelectionIndex();
    				funcName = fctList.getItem(index);
    			}
    		});
        	fillFunctionsList(widget, eventType);
        	// Parameters label
    		Label paramsLabel = new Label(body,SWT.NONE);
    		paramsLabel.setText("Parameters:");
    		gridData = new GridData(GridData.FILL_HORIZONTAL);
    		gridData.verticalSpan = 2;
    		gridData.heightHint = 240;
    		paramsLabel.setLayoutData(gridData);
    		// Parameters table
        	paramsTbl = new Table(body, SWT.SINGLE);
    		gridData = new GridData(GridData.FILL_BOTH);
    		gridData.horizontalSpan = 1;
    		gridData.verticalSpan = 2;
    		paramsTbl.setLayoutData(gridData);
    		paramsTbl.setHeaderVisible(true);
    		addColumn(paramsTbl, "Parameter", 100);
    		addColumn(paramsTbl, "Value", 200);
    et voici le résultat obtenu (voir fichier joint)

    j aimerais avoir sur la meme ligne event et sa combo, functions et sa liste
    et en dessous parameters et sa table

    d avance merci

  2. #2
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Par défaut
    oups il fallait juste supprimer la ligne suivante

    gridLayout.makeColumnsEqualWidth = true;

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [SWT] problème de layout (bis)
    Par *alexandre* dans le forum SWT/JFace
    Réponses: 3
    Dernier message: 30/05/2008, 15h24
  2. Problème avec layout en SWT
    Par talkhor dans le forum Agents de placement/Fenêtres
    Réponses: 3
    Dernier message: 22/08/2007, 17h25
  3. [SWT] Problème de GridLayout
    Par otsgd dans le forum SWT/JFace
    Réponses: 3
    Dernier message: 06/06/2006, 14h37
  4. [SWT] Problème avec la transparence des PNG
    Par sirjuh dans le forum SWT/JFace
    Réponses: 1
    Dernier message: 02/08/2004, 08h07
  5. [SWT] Problème de paramètre GridData
    Par yolepro dans le forum SWT/JFace
    Réponses: 4
    Dernier message: 06/12/2002, 10h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo