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 :

Retailler un dialog.


Sujet :

SWT/JFace Java

  1. #1
    Membre habitué Avatar de kkt8
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 472
    Points : 193
    Points
    193
    Par défaut Retailler un dialog.
    Bonjour,

    J'ai un dialog dans lequel j'ai plusieurs section.
    Lorsque j'expand ou collapse ces sections j'aimerais retailler le dialog en conséquence. Mais j'y arrive pas...
    Un problème du type de dialog que j'utilise ?
    Dois-je implémenter qqchose ?

    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
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
     
    public class BranchRunnerDialog extends SelectionDialog{
     
    	private Section sectionMain;
    	private Section sectionBuild;
    	private Section sectionArguments;
    	private Section sectionEnvironment;
    	private Section sectionRunner;
    	private Section sectionRun;
     
    	private int dialogHeightDefaut = 0;
    	private int dialogWidthDefaut = 0;
     
    	protected BranchRunnerDialog(Shell parentShell) {
    		super(parentShell);
    	}
     
     
    	protected Control createDialogArea(Composite parent) {
     
    		final Composite dialogArea = (Composite) super.createDialogArea(parent);
    		dialogArea.addControlListener(new ControlAdapter() {
    			public void controlResized(ControlEvent e) {
    				Rectangle area = dialogArea.getClientArea();
    	                        // ????
    				}
    			}
    		});
     
    		dialogArea.setLayout(new GridLayout(2,false));
     
    		// test toolbar
    		ToolBar toolbar = new ToolBar(dialogArea, SWT.VERTICAL|SWT.FLAT);
    		toolbar.setSize(35, dialogArea.getSize().y);
    		toolbar.setLocation(0, 0);
     
    		//Image imageBtn1 = new Image(display, "btn1.bmp");
    		ToolItem lButExpanded = new ToolItem(toolbar, SWT.PUSH);
    		lButExpanded.setImage(expandImage.createImage());
    		lButExpanded.addSelectionListener(new SelectionListener() {
    			@Override
    			public void widgetDefaultSelected(SelectionEvent e) {
    			}
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    				//sectionMain.setExpanded(true);
    				sectionArguments.setExpanded(true);
    				sectionEnvironment.setExpanded(true);
    				sectionRunner.setExpanded(true);
    				sectionRun.setExpanded(true);
    				sectionBuild.setExpanded(true);
    				int IsArgExp = (sectionArguments.isExpanded()? 110:0);
    				int IsEnvExp = (sectionEnvironment.isExpanded()? 150:0);
    				int IsRunExp = (sectionRunner.isExpanded()? 210:0);
    				dialogHeightResize = dialogHeightDefaut + 80 + IsArgExp + IsEnvExp + IsRunExp;
    				dialogArea.notifyListeners(SWT.Resize, new Event());
    			}
    		});
     
    		ToolItem lButCollapsed = new ToolItem(toolbar, SWT.PUSH);
    		lButCollapsed.setImage(collapseImage.createImage());
    		lButCollapsed.addSelectionListener(new SelectionListener() {
    		@Override
    		public void widgetDefaultSelected(SelectionEvent e) {
    		}
    		@Override
    		public void widgetSelected(SelectionEvent e) {
    			//sectionMain.setExpanded(false);
    			sectionArguments.setExpanded(false);
    			sectionEnvironment.setExpanded(false);
    			sectionRunner.setExpanded(false);
    			sectionBuild.setExpanded(false);
    			sectionRun.setExpanded(false);
    			dialogArea.notifyListeners(SWT.Resize, new Event());
    		}
    	});
     
     
    		toolkit = new FormToolkit(parent.getDisplay());
     
    /* 1ere section : MAIN */		
    		sectionMain = toolkit.createSection(dialogArea,Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    		// TODO à recup
    		sectionMain.addExpansionListener(new ExpansionAdapter() {
    			public void expansionStateChanged(ExpansionEvent e) {
    				sectionMain.setExpanded(true);
    			}});
    		sectionMain.setText("Main");
    		sectionMain.marginWidth = 10;
    		sectionMain.marginHeight = 5;
    		sectionMain.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		GridData data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionMain.setLayoutData(data);
    .....
    D'avance merci
    chris

  2. #2
    Expert éminent sénior
    Avatar de sinok
    Profil pro
    Inscrit en
    Août 2004
    Messages
    8 765
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Août 2004
    Messages : 8 765
    Points : 12 977
    Points
    12 977
    Par défaut
    En général un dialogue qui change de taille sans que l'utilisateur le demande est une mauvaise idée au point de vue design (d'autant plus qu'il pourrait par exemple sortir de l'écran en partie & cie). Les utilisateurs n'aiment pas du tout que leur fenêtre change sans qu'ils puissent y redire quelque chose.

    Je te conseille plutôt de rendre le contenu de ton Dialog Scrollable si tu as un problème de place. (cf ScrolledComposite)
    Hey, this is mine. That's mine. All this is mine. I'm claiming all this as mine. Except that bit. I don't want that bit. But all the rest of this is mine. Hey, this has been a really good day. I've eaten five times, I've slept six times, and I've made a lot of things mine. Tomorrow, I'm gonna see if I can't have sex with something.

  3. #3
    Membre habitué Avatar de kkt8
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 472
    Points : 193
    Points
    193
    Par défaut
    Oui tu as raison c'est mieux comme ça, du coup je me suis penchée un peu sur le truc, en fait j'ai une SelectionDialog, dans laquel je construit un composite classique dans lequel je met des boutons, ensuite je met des sections (qui elles aussi ont des composites avec des boutons, des labels ...).
    Et je voudrais garder les 1ers boutons dans le 1er composite, créer un autre composite (qui serait le scrollcomposite) dans lequel seront les sections.

    J'ai du mal avec les composites et les layout ...
    Comment intégrer un scrolledcomposite, ça tombe jamais bon ce que je tente :
    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
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
     
    protected Control createDialogArea(Composite parent) {
     
    		final Composite dialogArea = (Composite) super.createDialogArea(parent);
     
    		ImageDescriptor expandImage = null;
    		expandImage = Activator.getImageDescriptor("icons/expandall.png");
    		ImageDescriptor collapseImage = null;
    		collapseImage = Activator.getImageDescriptor("icons/collapseall.png");
     
    		dialogArea.setLayout(new GridLayout(2,false));
     
    		// test toolbar
    		ToolBar toolbar = new ToolBar(dialogArea, SWT.VERTICAL|SWT.FLAT);
    		toolbar.setSize(35, dialogArea.getSize().y);
    		toolbar.setLocation(0, 0);
     
    		//Image imageBtn1 = new Image(display, "btn1.bmp");
    		ToolItem lButExpanded = new ToolItem(toolbar, SWT.PUSH);
    		lButExpanded.setImage(expandImage.createImage());
    		lButExpanded.addSelectionListener(new SelectionListener() {
    			@Override
    			public void widgetDefaultSelected(SelectionEvent e) {
    			}
    			@Override
    			public void widgetSelected(SelectionEvent e) {
    				//sectionMain.setExpanded(true);
    				sectionArguments.setExpanded(true);
    				sectionEnvironment.setExpanded(true);
    				sectionRunner.setExpanded(true);
    				sectionRun.setExpanded(true);
    				sectionBuild.setExpanded(true);
    			}
    		});
     
    		ToolItem lButCollapsed = new ToolItem(toolbar, SWT.PUSH);
    		lButCollapsed.setImage(collapseImage.createImage());
    		lButCollapsed.addSelectionListener(new SelectionListener() {
    		@Override
    		public void widgetDefaultSelected(SelectionEvent e) {
    		}
    		@Override
    		public void widgetSelected(SelectionEvent e) {
    			//sectionMain.setExpanded(false);
    			sectionArguments.setExpanded(false);
    			sectionEnvironment.setExpanded(false);
    			sectionRunner.setExpanded(false);
    			sectionBuild.setExpanded(false);
    			sectionRun.setExpanded(false);
    		}
    	});
     
    		toolkit = new FormToolkit(parent.getDisplay());
    		// AJOUTER LA SCROLLEDCOMPOSITE LA
     
    /* 1ere section : MAIN */		
    		sectionMain = toolkit.createSection(dialogArea,Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    		sectionMain.addExpansionListener(new ExpansionAdapter() {
    			public void expansionStateChanged(ExpansionEvent e) {
    				sectionMain.setExpanded(true);
    			}});
    		sectionMain.setText("Main");
    		sectionMain.marginWidth = 10;
    		sectionMain.marginHeight = 5;
    		sectionMain.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		GridData data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionMain.setLayoutData(data);
     
    		Composite sectionClient = toolkit.createComposite(sectionMain, SWT.WRAP);
    		sectionClient.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		GridLayout layout = new GridLayout();
    		layout.numColumns = 1;
    		layout.makeColumnsEqualWidth = true;
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionClient.setLayoutData(data);
    		sectionClient.setLayout(layout);
     
    		Group groupMain = new Group(sectionClient, SWT.NONE);
    		groupMain.setLayout(new GridLayout());
    	  GridData gdGroup = new GridData(GridData.FILL_BOTH);
    	  groupMain.setLayoutData(gdGroup);
        groupMain.setText("Project:");
     
    		Composite col1 = toolkit.createComposite(groupMain);
    		col1.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		layout = new GridLayout();
    		layout.numColumns = 4;
    		layout.makeColumnsEqualWidth = false;
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		col1.setLayoutData(data);
    		col1.setLayout(layout);
     
    		// Project Label
    		Label lProject = new Label(col1, SWT.FILL);
    		lProject.setText("Project:");
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		lProject.setLayoutData(data);
    		// Project Name
    		Text lProjectName = new Text(col1, SWT.READ_ONLY|SWT.BORDER);
    		lProjectName.setText(projectToBuild.getName());
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		lProjectName.setLayoutData(data);
     
    		// Build configuration Label
    		Label lBuild = new Label(col1, SWT.FILL);
    		lBuild.setText("Active Configuration:");
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		lBuild.setLayoutData(data);
    		// Build configuration Name
    		Text lBuildName = new Text(col1, SWT.READ_ONLY|SWT.BORDER);
    		lBuildName.setText("Debug");
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		lBuildName.setLayoutData(data);
     
    		sectionMain.setClient(sectionClient);
     
    		//*
    /* 2eme section : BUILD */	
    		Button bFactice = new Button(dialogArea, SWT.NONE);
    		bFactice.setVisible(false);
    		sectionBuild = toolkit.createSection(dialogArea,Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    		sectionBuild.setText("Build");
    		sectionBuild.marginWidth = 10;
    		sectionBuild.marginHeight = 5;
    		sectionBuild.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionBuild.setLayoutData(data);
     
    		Composite sectionClientBuild = toolkit.createComposite(sectionBuild, SWT.WRAP);
    		sectionClientBuild.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		layout = new GridLayout();
    		layout.numColumns = 1;
    		layout.makeColumnsEqualWidth = true;
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionClientBuild.setLayoutData(data);
    		sectionClientBuild.setLayout(layout);
     
    		Group groupBuild = new Group(sectionClientBuild, SWT.NONE);
    		groupBuild.setLayout(new GridLayout());
    	    GridData gd = new GridData(GridData.FILL_BOTH);
    	    groupBuild.setLayoutData(gd);
    	    groupBuild.setText("Build options:");
     
    		Text fBuildOptions = new Text(groupBuild, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY);
    		fBuildOptions.setText("-g");
    	  gd = new GridData(GridData.FILL_BOTH);
    		gd.heightHint = 40;
    	  gd.widthHint = 100;
    	  fBuildOptions.setLayoutData(gd);
     
    		sectionBuild.setClient(sectionClientBuild);
     
    /* 3eme section : RUN */
    		bFactice = new Button(dialogArea, SWT.NONE);
    		bFactice.setVisible(false);
    		sectionRun = toolkit.createSection(dialogArea,Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    		sectionRun.setText("Run");
    		sectionRun.marginWidth = 10;
    		sectionRun.marginHeight = 5;
    		sectionRun.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionRun.setLayoutData(data);
     
    		Composite sectionClientRun = toolkit.createComposite(sectionRun, SWT.WRAP);
    		sectionClientRun.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		layout = new GridLayout();
    		layout.numColumns = 1;
    		layout.makeColumnsEqualWidth = true;
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionClientRun.setLayoutData(data);
    		sectionClientRun.setLayout(layout);
     
    /* 1ere sous-section de RUN : ARGUMENTS */	
    		bFactice = new Button(dialogArea, SWT.NONE);
    		bFactice.setVisible(false);
    		sectionArguments = toolkit.createSection(sectionClientRun,Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    		sectionArguments.setText("Arguments");
    		sectionArguments.marginWidth = 10;
    		sectionArguments.marginHeight = 5;
    		sectionArguments.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionArguments.setLayoutData(data);
     
    		Composite sectionClientArg = toolkit.createComposite(sectionArguments, SWT.WRAP);
    		sectionClientArg.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		layout = new GridLayout();
    		layout.numColumns = 1;
    		layout.makeColumnsEqualWidth = true;
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionClientArg.setLayoutData(data);
    		sectionClientArg.setLayout(layout);
     
    		Group group = new Group(sectionClientArg, SWT.NONE);
    	    group.setLayout(new GridLayout());
    	    gd = new GridData(GridData.FILL_BOTH);
    	    group.setLayoutData(gd);
     
    		group.setText("Program arguments:");
    		Text fPrgmArgumentsText = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
    	  gd = new GridData(GridData.FILL_BOTH);
    		gd.heightHint = 40;
    	  gd.widthHint = 100;
    		fPrgmArgumentsText.setLayoutData(gd);
     
    		Button fArgumentVariablesButton= new Button(group, SWT.PUSH);
    		fArgumentVariablesButton.setText("Variables...");
    		gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
    		fArgumentVariablesButton.setLayoutData(gd);
     
    		sectionArguments.setClient(sectionClientArg);
     
    /* 2eme sous-section de RUN :  : ENVIRONMENT */	
    		sectionEnvironment = toolkit.createSection(sectionClientRun,Section.TITLE_BAR|Section.TWISTIE);
    		sectionEnvironment.setText("Environment");
    		sectionEnvironment.marginWidth = 10;
    		sectionEnvironment.marginHeight = 5;
    		sectionEnvironment.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionEnvironment.setLayoutData(data);
     
    		Composite sectionClientEnv = toolkit.createComposite(sectionEnvironment, SWT.WRAP);
    		sectionClientEnv.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		layout = new GridLayout();
    		layout.numColumns = 1;
    		layout.makeColumnsEqualWidth = false;
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionClientEnv.setLayoutData(data);
    		sectionClientEnv.setLayout(layout);
     
    		Label lEnvir = new Label(sectionClientEnv, SWT.FILL);
    		lEnvir.setText("Environment variables to set:");
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		lEnvir.setLayoutData(data);
     
    		Composite compoEnviTable = toolkit.createComposite(sectionClientEnv, SWT.WRAP);
    		compoEnviTable.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		layout = new GridLayout();
    		layout.numColumns = 2;
    		layout.makeColumnsEqualWidth = false;
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		compoEnviTable.setLayoutData(data);
    		compoEnviTable.setLayout(layout);
     
    		Composite compoTable = toolkit.createComposite(compoEnviTable, SWT.WRAP);
    		compoTable.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		layout = new GridLayout();
    		layout.numColumns = 1;
    		layout.makeColumnsEqualWidth = false;
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		compoTable.setLayoutData(data);
    		compoTable.setLayout(layout);
     
    		TableViewer environmentTable = new TableViewer(compoTable, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
    		Table table = environmentTable.getTable();
    		table.setLayout(new GridLayout());
    		table.setLayoutData(new GridData(GridData.FILL_BOTH));
    		table.setHeaderVisible(true);
    		table.setLinesVisible(true);
    		table.setItemCount(4);
     
    		// Create columns
    		final TableColumn tc1 = new TableColumn(table, SWT.NONE, 0);
    		tc1.setText("Variable");
    		final TableColumn tc2 = new TableColumn(table, SWT.NONE, 1);
    		tc2.setText("Value");
    		final Table tref = table;
    		final Composite comp = sectionClientEnv;
    		sectionClientEnv.addControlListener(new ControlAdapter() {
    			public void controlResized(ControlEvent e) {
    				Rectangle area = comp.getClientArea();
    				Point size = tref.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    				ScrollBar vBar = tref.getVerticalBar();
    				int width = area.width - tref.computeTrim(0,0,0,0).width - 2;
    				if (size.y > area.height + tref.getHeaderHeight()) {
    					Point vBarSize = vBar.getSize();
    					width -= vBarSize.x;
    				}
    				Point oldSize = tref.getSize();
    				if (oldSize.x > area.width) {
    					tc1.setWidth(width/2-1);
    					tc2.setWidth(width - tc1.getWidth());
    					tref.setSize(area.width, area.height);
    				} else {
    					tref.setSize(area.width, area.height);
    					tc1.setWidth(width/2-1);
    					tc2.setWidth(width - tc1.getWidth());
    				}
    			}
    		});
     
    		// Create buttons
    		Composite compoButton = toolkit.createComposite(compoEnviTable, SWT.WRAP);
    		compoButton.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		RowLayout layoutR = new RowLayout(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_END);
    //		data = new GridData(GridData.FILL_HORIZONTAL);
    //		compoButton.setLayoutData(data);
    		compoButton.setLayout(layoutR);
     
    		Button envAddButton = new Button(compoButton, SWT.PUSH|SWT.FILL); 
    		envAddButton.setText("New...   ");
    		//gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
    		//envAddButton.setLayoutData(gd);
    		envAddButton.addSelectionListener(new SelectionAdapter() {
    			public void widgetSelected(SelectionEvent event) {
    				//handleEnvAddButtonSelected();
    			}
    		});
    		Button envSelectButton = new Button(compoButton, SWT.PUSH); 
    		envSelectButton.setText("Select...");
    		//gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
    		//envSelectButton.setLayoutData(gd);
    		envSelectButton.addSelectionListener(new SelectionAdapter() {
    			public void widgetSelected(SelectionEvent event) {
    				//handleEnvSelectButtonSelected();
    			}
    		});
     
    		sectionEnvironment.setClient(sectionClientEnv);
     
    /* 3eme sous-section de RUN :  : RUNNER */	
    		sectionRunner = toolkit.createSection(sectionClientRun,Section.TITLE_BAR|Section.TWISTIE);
    		sectionRunner.setText("Runner");
    		sectionRunner.marginWidth = 10;
    		sectionRunner.marginHeight = 5;
    		sectionRunner.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionRunner.setLayoutData(data);
     
    		Composite sectionClientRunner = toolkit.createComposite(sectionRunner, SWT.WRAP);
    		sectionClientRunner.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		layout = new GridLayout();
    		layout.numColumns = 1;
    		layout.makeColumnsEqualWidth = false;
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		sectionClientRunner.setLayoutData(data);
    		sectionClientRunner.setLayout(layout);
     
    		//		
    		Composite run1 = toolkit.createComposite(sectionClientRunner);
    		run1.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    		layout = new GridLayout();
    		layout.numColumns = 2;
    		layout.makeColumnsEqualWidth = false;
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		run1.setLayoutData(data);
    		run1.setLayout(layout);
     
    		// Runner Label
    		Label lRunner = new Label(run1, SWT.FILL);
    		lRunner.setText("Runner:");
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		lRunner.setLayoutData(data);
    		// Runner Name
    		Text lRunnerName = new Text(run1, SWT.READ_ONLY|SWT.BORDER);
    		lRunnerName.setText("StxP70 Runner");
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		lRunnerName.setLayoutData(data);
     
    		// Build configuration Label
    		Label lStRunner= new Label(run1, SWT.FILL);
    		lStRunner.setText("ST Runner:");
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		lStRunner.setLayoutData(data);
    		// Build configuration Name
    		Text lStRunnerName = new Text(run1, SWT.READ_ONLY|SWT.BORDER);
    		lStRunnerName.setText("sxrun");
    		data = new GridData(GridData.FILL_HORIZONTAL);
    		lStRunnerName.setLayoutData(data);
     
    		sectionRunner.setClient(sectionClientRunner);
    		sectionRun.setClient(sectionClientRun);
     
        return dialogArea;
    	}

Discussions similaires

  1. Pop-up d'une dialog box a partir d'un bouton
    Par bobbyjack dans le forum MFC
    Réponses: 21
    Dernier message: 13/09/2005, 15h32
  2. Difference entre fenetre et boite de dialog
    Par billyboy dans le forum Windows
    Réponses: 2
    Dernier message: 02/06/2003, 15h43
  3. Empecher le curseur de sortir du dialog
    Par Gadjo dans le forum MFC
    Réponses: 5
    Dernier message: 18/11/2002, 18h01
  4. [awt][dialog]
    Par Ultra-FX dans le forum Agents de placement/Fenêtres
    Réponses: 4
    Dernier message: 06/11/2002, 16h22
  5. Quoi ?! Common Dialog fait crasher DirectDraw ?
    Par Magus (Dave) dans le forum DirectX
    Réponses: 4
    Dernier message: 21/10/2002, 19h01

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