Groupbox width [#13888]

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

Moderator: Gurus

Groupbox width [#13888]

Postby Gingernut63 » Sat Dec 31, 2016 5:17 pm

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: viewtopic.php?f=2&t=59515
MonkeySqueeze Development: viewtopic.php?f=19&t=59907
MediaMonkey user since 2005
Gingernut63
 
Posts: 235
Joined: Thu Jul 14, 2011 4:13 am

Re: Groupbox width

Postby Peke » Sat Dec 31, 2016 9:36 pm

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,
Pavle
MM Core Developer and Admin of free MediaMonkey extensions Hosting
Image
Image
Peke
 
Posts: 10435
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia

Re: Groupbox width

Postby Gingernut63 » Sun Jan 01, 2017 5:07 pm

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: viewtopic.php?f=2&t=59515
MonkeySqueeze Development: viewtopic.php?f=19&t=59907
MediaMonkey user since 2005
Gingernut63
 
Posts: 235
Joined: Thu Jul 14, 2011 4:13 am

Re: Groupbox width

Postby Peke » Wed Jan 04, 2017 7:39 pm

Can you make screenshot showing the direction of resize that do not work?
Best regards,
Pavle
MM Core Developer and Admin of free MediaMonkey extensions Hosting
Image
Image
Peke
 
Posts: 10435
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia

Re: Groupbox width

Postby Gingernut63 » Fri Jan 06, 2017 3:51 pm

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: viewtopic.php?f=2&t=59515
MonkeySqueeze Development: viewtopic.php?f=19&t=59907
MediaMonkey user since 2005
Gingernut63
 
Posts: 235
Joined: Thu Jul 14, 2011 4:13 am

Re: Groupbox width

Postby Peke » Mon Jan 09, 2017 11:51 am

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,
Pavle
MM Core Developer and Admin of free MediaMonkey extensions Hosting
Image
Image
Peke
 
Posts: 10435
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia

Re: Groupbox width

Postby Peke » Mon Jan 09, 2017 11:57 am

But YES there is a BUG first one is not read correctly.
Best regards,
Pavle
MM Core Developer and Admin of free MediaMonkey extensions Hosting
Image
Image
Peke
 
Posts: 10435
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia

Re: Groupbox width [#13888]

Postby Peke » Mon Jan 09, 2017 12:26 pm

Best regards,
Pavle
MM Core Developer and Admin of free MediaMonkey extensions Hosting
Image
Image
Peke
 
Posts: 10435
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia

Re: Groupbox width [#13888]

Postby Gingernut63 » Mon Jan 09, 2017 2:31 pm

MonkeySqueeze – Squeezing music into your life!
https://twitter.com/#!/MonkeySqueeze1
MonkeySqueeze Support: viewtopic.php?f=2&t=59515
MonkeySqueeze Development: viewtopic.php?f=19&t=59907
MediaMonkey user since 2005
Gingernut63
 
Posts: 235
Joined: Thu Jul 14, 2011 4:13 am

Re: Groupbox width [#13888]

Postby Peke » Mon Jan 09, 2017 7:31 pm

till then use my workaround
Best regards,
Pavle
MM Core Developer and Admin of free MediaMonkey extensions Hosting
Image
Image
Peke
 
Posts: 10435
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia


Return to MediaMonkey 4 Addons developer forum

Who is online

Users browsing this forum: No registered users and 2 guests