There is a big bug which breaks Rhino panels UI drawing in SR1.
- Opening a panel raises two times the event “VisibleChanged” event.
- Closing a panel raises two times the event “VisibleChanged” event but Visibility property is True, in SR0 it was False which is the right one.
- Closing the panel makes that all the other panels of the container have the closed panel inside but without any background. (see the following video)
Here the code:
Plugin:
public class PanelBugRh6Sr1PlugIn : PlugIn
{
public PanelBugRh6Sr1PlugIn()
{
Instance = this;
}
public static PanelBugRh6Sr1PlugIn Instance { get; private set; }
protected override LoadReturnCode OnLoad(ref string errorMessage)
{
Panels.RegisterPanel(this, typeof(PanelTestCtrl), "TestPanel", System.Drawing.SystemIcons.Application);
return base.OnLoad(ref errorMessage);
}
}
Open panel command:
public class PanelBugRh6Sr1CommandOpen : Command
{
public PanelBugRh6Sr1CommandOpen()
{
Instance = this;
}
///<summary>The only instance of this command.</summary>
public static PanelBugRh6Sr1CommandOpen Instance { get; private set; }
public override string EnglishName => "PanelBugRh6Sr1CommandOpen";
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
return Panels.OpenPanelAsSibling(PanelTestCtrl.Id, PanelIds.Layers) ? Result.Success : Result.Failure;
}
}
Close Panel Command:
public class PanelBugRh6Sr1CommandClose : Command
{
public PanelBugRh6Sr1CommandClose()
{
Instance = this;
}
public static PanelBugRh6Sr1CommandClose Instance { get; private set; }
public override string EnglishName => "PanelBugRh6Sr1CommandClose";
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
Panels.ClosePanel(typeof(PanelTestCtrl));
return Result.Success;
}
}
Here the example plugin source code with the rhp file: PanelBug_Rh6_Sr1.7z (206.9 KB)
I hope you can fix it soon, so it’s breaking all the workflow of our plugin.
Thanks and best regards.
Enric