Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » control widget on main form from composite?
control widget on main form from composite? [message #465966] Tue, 27 December 2005 06:37 Go to next message
Eclipse UserFriend
For one of the apps I'm working on I use multiple composites in a form. I
ran into a problem for which I do not see a quick solution... A simplefied
case:

I use a composite with 2 textboxes (separate class) in a form. Normaly I
update eg text values from main form in composite but this time I'm
looking at doing something the other way around. The composite changing
something on main form....

Is it possible to set a button on the form to enabled (not part of
composite) as soon as both textboxes contain data. How can this be done?
Re: control widget on main form from composite? [message #465970 is a reply to message #465966] Tue, 27 December 2005 10:30 Go to previous message
Eclipse UserFriend
if I'm understanding this correctly, you could add a ModifyListener to
each textbox (textbox.addModifyListener(ModifyListener)) then do
something to check the status of the boxes and update the button on the
main form if necessary.

a simplified (and non-optimal) method:

textbox1.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
button.setEnabled( (textbox1.getText().length() > 0) &&
(textbox2.getText().length() > 0) );
}
});



mp wrote:
> For one of the apps I'm working on I use multiple composites in a form.
> I ran into a problem for which I do not see a quick solution... A
> simplefied case:
>
> I use a composite with 2 textboxes (separate class) in a form. Normaly I
> update eg text values from main form in composite but this time I'm
> looking at doing something the other way around. The composite changing
> something on main form....
>
> Is it possible to set a button on the form to enabled (not part of
> composite) as soon as both textboxes contain data. How can this be done?
>
Previous Topic:Composite on TabFolder transparency
Next Topic:customizing swt widget
Goto Forum:
  


Current Time: Mon Jul 07 15:49:32 EDT 2025

Powered by FUDForum. Page generated in 0.04483 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top