Groupbox width [#13888]

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

Gingernut63
Posts: 236
Joined: Thu Jul 14, 2011 4:13 am

Groupbox width [#13888]

Post by Gingernut63 »

On options page Tools > Options > Player the GroupBoxes adjust their width to the resizing of the window.

How do you program a GroupBox to do that, or is that function not available outside of the main program?
MonkeySqueeze – Squeezing music into your life!
https://twitter.com/#!/MonkeySqueeze1
MonkeySqueeze Support: http://www.mediamonkey.com/forum/viewto ... =2&t=59515
MonkeySqueeze Development: http://www.mediamonkey.com/forum/viewto ... 19&t=59907
MediaMonkey user since 2005
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Groupbox width

Post by Peke »

You temper with Object Anchors.
Example where you anchor Top Left in order to allow group Box to resize correctly http://www.mediamonkey.com/wiki/index.p ... n::Anchors

Code: Select all

This is test
|--------------|
|              |
|              |
|--------------|
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Gingernut63
Posts: 236
Joined: Thu Jul 14, 2011 4:13 am

Re: Groupbox width

Post by Gingernut63 »

Peke wrote:You temper with Object Anchors.
Example where you anchor Top Left in order to allow group Box to resize correctly http://www.mediamonkey.com/wiki/index.p ... n::Anchors

Code: Select all

This is test
|--------------|
|              |
|              |
|--------------|
Thanks for the reply Pavle, I have used Anchors for buttons, just didn't think to use for GroupBoxes.

I'm having problems getting this to work correctly, hence the delay in the response. :-?

I have four GroupBoxes on an options sheet. All four use the same code format as below. Opening the options sheet the first time all GroupBoxes work as intended, changing width as the window width is adjusted.

After clicking OK and reopening the options page the first GroupBox's width has reduced dramatically, as though the Sheet.Common.Width parameter is now -600. Standard width for my page is 780 to show all information. It remains like this no matter how many times the options page is reopened. The following three GroupBoxes work perfectly. It doesn't matter whether there are 1,2,3 or 4 GroupBoxes, the first coded GroupBox (as below) always has the same issue.

Any thoughts?

Code: Select all

Set Panel1 = SDB.UI.NewGroupBox(Sheet)
	Panel1.Common.SetRect 10,5,Sheet.Common.Width -20,55	
	Panel1.Common.Anchors = 1+2+4
Last edited by Gingernut63 on Fri Jan 06, 2017 3:53 pm, edited 1 time in total.
MonkeySqueeze – Squeezing music into your life!
https://twitter.com/#!/MonkeySqueeze1
MonkeySqueeze Support: http://www.mediamonkey.com/forum/viewto ... =2&t=59515
MonkeySqueeze Development: http://www.mediamonkey.com/forum/viewto ... 19&t=59907
MediaMonkey user since 2005
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Groupbox width

Post by Peke »

Can you make screenshot showing the direction of resize that do not work?
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Gingernut63
Posts: 236
Joined: Thu Jul 14, 2011 4:13 am

Re: Groupbox width

Post by Gingernut63 »

Peke wrote:Can you make screenshot showing the direction of resize that do not work?
Two screen shots (before and after) plus code. The first image is the first time the options page is opened. The second is what it looks like every time it is opened thereafter, even if the options page window is resized.

Image
Image

Code: Select all

Sub OnStartup
	Dim ind 
	
	ind = SDB.UI.AddOptionSheet("TestSheet",Script.ScriptPath,"InitSheet","SaveSheet",-2)
	
End Sub

Sub InitSheet(Sheet)
	Dim form, Panel1, Panel2, Panel3, Panel4
	
	Set Panel1 = SDB.UI.NewGroupBox(Sheet)
	Panel1.Common.SetRect 10,5,Sheet.Common.Width -20,50   
	Panel1.Common.Anchors = 1+2+4
	Panel1.Caption = "Panel 1"
	
	Set Panel2 = SDB.UI.NewGroupBox(Sheet)
	Panel2.Common.SetRect 10,65,Sheet.Common.Width -20,50   
	Panel2.Common.Anchors = 1+2+4
	Panel2.Caption = "Panel 2"
	
	Set Panel3 = SDB.UI.NewGroupBox(Sheet)
	Panel3.Common.SetRect 10,125,Sheet.Common.Width -20,50   
	Panel3.Common.Anchors = 1+2+4
	Panel3.Caption = "Panel 3"
	
	Set Panel4 = SDB.UI.NewGroupBox(Sheet)
	Panel4.Common.SetRect 10,185,Sheet.Common.Width -20,50   
	Panel4.Common.Anchors = 1+2+4
	Panel4.Caption = "Panel 4"
	
End Sub

Sub SaveSheet(Sheet)
	
End Sub
MonkeySqueeze – Squeezing music into your life!
https://twitter.com/#!/MonkeySqueeze1
MonkeySqueeze Support: http://www.mediamonkey.com/forum/viewto ... =2&t=59515
MonkeySqueeze Development: http://www.mediamonkey.com/forum/viewto ... 19&t=59907
MediaMonkey user since 2005
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Groupbox width

Post by Peke »

Try with:

Code: Select all

        Sub OnStartup
           Dim ind
           
           ind = SDB.UI.AddOptionSheet("TestSheet",Script.ScriptPath,"InitSheet","SaveSheet",-2)
           
        End Sub

        Sub InitSheet(Sheet)
           Dim form, Panel1, Panel2, Panel3, Panel4, PanelWidth

           PanelWidth = Sheet.Common.Width -20
           
           Set Panel1 = SDB.UI.NewGroupBox(Sheet)
           Panel1.Common.Anchors = 1+2+4
           Panel1.Caption = "Panel 1"
           
           Set Panel2 = SDB.UI.NewGroupBox(Sheet)
           Panel2.Common.Anchors = 1+2+4
           Panel2.Caption = "Panel 2"
           
           Set Panel3 = SDB.UI.NewGroupBox(Sheet)
           Panel3.Common.Anchors = 1+2+4
           Panel3.Caption = "Panel 3"
           
           Set Panel4 = SDB.UI.NewGroupBox(Sheet)
           Panel4.Common.Anchors = 1+2+4
           Panel4.Caption = "Panel 4"

           PanelWidth = Sheet.Common.Width -20

           Panel1.Common.SetRect 10,5,PanelWidth,50   
           Panel2.Common.SetRect 10,65,PanelWidth ,50   
           Panel3.Common.SetRect 10,125,PanelWidth,50   
           Panel4.Common.SetRect 10,185,PanelWidth,50   
        End Sub

        Sub SaveSheet(Sheet)
           
        End Sub
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Groupbox width

Post by Peke »

But YES there is a BUG first one is not read correctly.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Groupbox width [#13888]

Post by Peke »

Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Gingernut63
Posts: 236
Joined: Thu Jul 14, 2011 4:13 am

Re: Groupbox width [#13888]

Post by Gingernut63 »

MonkeySqueeze – Squeezing music into your life!
https://twitter.com/#!/MonkeySqueeze1
MonkeySqueeze Support: http://www.mediamonkey.com/forum/viewto ... =2&t=59515
MonkeySqueeze Development: http://www.mediamonkey.com/forum/viewto ... 19&t=59907
MediaMonkey user since 2005
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Groupbox width [#13888]

Post by Peke »

till then use my workaround
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Post Reply