Problem with Values in OptionSheet

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

Moderators: Gurus, Addon Administrators

crap_inhuman
Posts: 934
Joined: Sat Jan 26, 2013 6:00 am
Location: Friedberg / Hessen / Germany
Contact:

Problem with Values in OptionSheet

Post by crap_inhuman »

i add a options sheet and put 4 multiline edit boxes in it. I read/write the text from the multiline to the ini-file of MM.
If i open the option sheet and go my sheet, i see the text stored in the ini-file. After that i go to another option sheet and go back, then i see in the multiline edit boxes the name i set with Common.ControlName !?!

Here is the code :

Code: Select all

Sub InitSheet(Sheet)
...
Dim GroupBox1
Set GroupBox1 = UI.NewGroupBox(Sheet)
GroupBox1.Caption = "Enter the keywords for linking with discogs (one keyword per line)"
GroupBox1.Common.Hint = "If you don't know what to enter here, let the keywords as is !!"
GroupBox1.Common.SetRect 10, 180, 500, 260

Set Label2 = UI.NewLabel(GroupBox1)
Label2.Common.SetRect 20, 20, 150, 25
Label2.Caption = SDB.Localize("Lyricist")
Set EditLyricist = UI.NewMultiLineEdit(GroupBox1)
EditLyricist.Common.SetRect 20, 35, 150, 75
EditLyricist.Common.ControlName = "LyricistKeywords"
tmp = Split(LyricistKeywords, "|")
editText = ""
For each x in tmp
	editText = editText & x & Chr(13)
Next
EditLyricist.Text = Left(editText, Len(editText)-1)
...

End Sub

Sub SaveSheet(Sheet)
...

Dim tmp, x, editText
Set edt = Sheet.Common.ChildControl("LyricistKeywords")
tmp = Split(edt.Text, Chr(13) & Chr(10))
editText = ""
For each x in tmp
	editText = editText & Trim(x) & "|"
Next
ini.StringValue("DiscogsAutoTagWeb", "LyricistKeywords") = Left(editText, Len(editText)-1)

...
End Sub
The first time i open the option sheet:
Image

The second time...
Image

What do i wrong ?
Metal up your ass !
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.

Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
crap_inhuman
Posts: 934
Joined: Sat Jan 26, 2013 6:00 am
Location: Friedberg / Hessen / Germany
Contact:

Re: Problem with Values in OptionSheet

Post by crap_inhuman »

I found the problem. The problem is the MultiLineEdit Box. I replace one MultiLineEdit Box with a Edit Box (single line), and test again. The edit box do what we expected, the MultiLineEdit doesn't.

Should the MultiLineEdit Boxes not used in option sheets ? Or is there a special way to use this boxes in option sheets ?
Metal up your ass !
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.

Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
Peke
Posts: 17525
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Problem with Values in OptionSheet

Post by Peke »

If you want to use multiline I would suggest you to use SDB.UI.NewTreeList and single edit line for changes, it is better controlled and readable.

See how it is done in Last.Fm Scrobbler plugin where I load collections for filtering rules.
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
crap_inhuman
Posts: 934
Joined: Sat Jan 26, 2013 6:00 am
Location: Friedberg / Hessen / Germany
Contact:

Re: Problem with Values in OptionSheet

Post by crap_inhuman »

Thanks for your help, Peke !
Metal up your ass !
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.

Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
Post Reply