Problem with Values in OptionSheet

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

Moderator: Gurus

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

Problem with Values in OptionSheet

Post by crap_inhuman » Sun Sep 15, 2013 4:22 pm

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: 702
Joined: Sat Jan 26, 2013 6:00 am
Location: Friedberg / Hessen / Germany
Contact:

Re: Problem with Values in OptionSheet

Post by crap_inhuman » Mon Sep 16, 2013 7:44 pm

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: 12711
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

Re: Problem with Values in OptionSheet

Post by Peke » Mon Sep 16, 2013 8:46 pm

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,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add SCREENSHOTS to forum

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

Re: Problem with Values in OptionSheet

Post by crap_inhuman » Mon Sep 16, 2013 11:39 pm

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