You can customize the GUI through our custom GUI mechanism, as per the example in the product demo project.
The simplest thing to do is to add this method to the CustomGUI class (see the demo)
protected override void Resume()
{
base.Resume ();
changeButton.Enabled = false;
changeAllButton.Enabled = false;
}
If however you need to set the button state programmatically, you can pass through the setting like this;
class CustomUserInterfaceFormProvider : IUserInterfaceFormProvider {
public bool ChangeAllowed{
get{return _changeAllowed;}
set{_changeAllowed = value;}
}
bool _changeAllowed = false;
public IUserInterfaceForm CreateUserInterfaceForm(){
CustomGUI f= new CustomGUI();
f.ChangeAllowed = ChangeAllowed;
return f;
}
}
public class CustomGUI : RapidSpellGUI
{
bool _changeAllowed = true;
protected override void Resume()
{
base.Resume ();
changeButton.Enabled = ChangeAllowed;
changeAllButton.Enabled = ChangeAllowed;
}
public bool ChangeAllowed{
get{return _changeAllowed;}
set{_changeAllowed = value;}
}
}
and then set the property in your UI provider instance
provider.ChangeAllowed = false;