hiding controls

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

hiding controls

Postby nocomm » Mon Sep 22, 2003 12:30 am

Hi again!

Is there a possibility to hide controls and then activate them again, with also the ability to change them?!
Example: I defined a login screen with a label (to display an error text if login fails). First the label should be completely invisible, and when the login failed it should appear and contain a specific text, depending on the error (user not valid OR password not correct).

I tried the following:
childWidget.dispose(); // at the beginning
parentWidget.layout(true); // when login failed to reactivate all controls
childWidget.setText("blabla"); // ERROR

But in that case I get a runtime error, as a disposed item can not be changed.

So what are my possibilities?

I guess I could work with the setBounds-methods to let the childWidget disappear, but I do not like that workaround....

Thanx for your help again...
nocomm
nocomm
 
Posts: 9
Joined: Thu Sep 18, 2003 11:53 pm

Postby admin » Mon Sep 22, 2003 2:03 am

You can try to use TitleAreaDialog, or may be Wizard's (as I can see from your previous post, you have several steps). These controls allow to set messages, try for example in Eclipse create class with same name, or with wrong name.
admin
Moderator
 
Posts: 166
Joined: Thu Jul 24, 2003 12:25 am

Postby nocomm » Mon Sep 22, 2003 3:03 am

actually these all seem to much work for me...

I use the label as an info area now, so when no error occured there will be a short information on the possible program steps available => I do not need to hide the label now....

thank you anyway
nocomm
nocomm
 
Posts: 9
Joined: Thu Sep 18, 2003 11:53 pm

Postby admin » Mon Sep 22, 2003 3:09 am

This is directly as Java-wizards (and I think TitleAreaDialog) behaves - it shows some "good" message, and if there is some warning or error, it shows warning/error. I think that in any case it is good to use specially designed dialogs.
If you want to hide some control, for GridLayout (not for all cases, of course) you can set vertical hint in GridData to zero and call parent.layout().
admin
Moderator
 
Posts: 166
Joined: Thu Jul 24, 2003 12:25 am

Re: hiding controls

Postby Paul Singleton » Wed Sep 24, 2003 5:30 am

nocomm wrote:Is there a possibility to hide controls and then activate them again, with also the ability to change them?!


Is this a job for StackLayout?
Paul Singleton
Jambusters Ltd
Paul Singleton
 
Posts: 7
Joined: Wed Sep 24, 2003 4:33 am
Location: CREWE, England


Return to SWT Designer

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 1 guest