Hello,
Please, could you explain me how to resize a Rhino plugin Window ?
It is on the UserControl that we must work or on the Rhino.UI.Panel ?
I have tried these statements but with no success :
<GuidAttribute("91A2D5CD-CC07-4ab6-8C74-00ED4F416924")> _
Public Class usrctl_frmInput
Implements Windows.Forms.IWin32Window
Private Sub ChangeWinSize()
Dim bDispAfterRedim As Boolean = Me.ResizeRedraw
Me.ResizeRedraw = True
Me.Width = 316
Me.Height = 127
Me.Update()
Me.UpdateBounds()
Me.Show()
Me.SuspendLayout()
Me.AutoScaleDimensions = New System.Drawing.Size(316, 127)
Me.Size = New System.Drawing.Size(316, 127)
Me.ResumeLayout(False)
Me.SuspendLayout()
Me.AutoScaleDimensions = New System.Drawing.Size(768, 374)
Me.Size = New System.Drawing.Size(768, 374)
Me.ResumeLayout(False)
End Sub
Is it better to put some statements in the Rhino.PlugIns.PlugIn herited class ?
But which statements ?
Public Class ModelPlugIn
Inherits Rhino.PlugIns.PlugIn
...
Public Sub ShowDockbar()
If Not Rhino.UI.Panels.IsPanelVisible(usrctl_frmInput.BarID) Then
Rhino.UI.Panels.OpenPanel(usrctl_frmInput.BarID)
End If
End Sub
Thank you
Jean-Luc
Tags: Change size, Height, Resize, Rhino plugin, Size, Width
Permalink Reply by damjan fio on February 18, 2013 at 9:14am dale knows this better for sure - but my 2 cents are:
put the statements in the Plugins Class,
i do it in c#, but its the same basically:
UserControl1 mycontrol = (Usercontrol1)Rhino.UI.Panels.GetPanel(typeof(UserControl1).GUID);
once you have the handle you can say things like: mycontrol.width = 250 etc.
Permalink Reply by Johnluc on February 18, 2013 at 10:19am Hello,
Thank you, but it doesn't work.
:o(
Jean-Luc
Permalink Reply by Dale Fugier on February 19, 2013 at 9:04am Hi Jean-Luc,
What are you trying to do?
Your user control is buried inside of a couple of other windows, and these windows provide automatic resizing based on what else the tab is docked with and where the tab is docked. So providing plug-in control over resizing might not be possible.
Again, let me know what you are trying to do and why.
Thanks,
-- Dale
Permalink Reply by Johnluc on March 8, 2013 at 9:42am Hello Dale,
Sorry for my answer's delay !
Here is an example, in attachment, of what I would like to do.
When I run the following plugin in Rhino, using the command "ResizePlugInWindow", I've got the following interface (It's just an example) :
So, first, I would like to have it directly like this :
Then, when I run the program using the button "Use files !", as the interface it too big, I hide the input controls to have only the output controls, and so, I would like that the window reduces automatically, like this :
And, when the program is finished, I show again the input controls, and I would like that the window maximizes automatically, like this :
Do you know if it is possible ?
Thank you very much !
Jean-Luc
Permalink Reply by Dale Fugier on March 8, 2013 at 11:07am Hi Jean-Luc,
By choosing to use a tabbed dock bar to host your user control, you essentially loose the ability to control the size of the parent window. Like I mentioned, your user control is buried inside of a couple of other windows.
If you need control over the size of the window, then you should probably create a modeless Windows form instead of using a docking container.
-- Dale
© 2013 Created by McNeel Admin.
