Problem with Values in OptionSheet

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Problem with Values in OptionSheet

Re: Problem with Values in OptionSheet

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

Thanks for your help, Peke !

Re: Problem with Values in OptionSheet

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.

Re: Problem with Values in OptionSheet

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 ?

Problem with Values in OptionSheet

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 ?

Top