by ZvezdanD » Sat Dec 27, 2008 7:16 pm
jiri wrote:both issues are already fixed at this moment.
Well, this is really nice and I apreciate it. I already tried that with a new MM version and found that you fixed two critical bugs and mentioned that in the Magic Nodes thread. But, what about:
I created one Option sheet in the Options dialog box and put one Web Document ActiveX control at it (SDB.UI.NewActiveX(oSheet, "Shell.Explorer")). When I open the Options dialog box and when I open my options sheet, Web control is showing without problem. But, if I temporarily switch to some another option sheet and turn back to my option sheet, Web control is not showing at all! If I close and reopen the Options dialog box, my Web control is showing again (until I switch to some another options sheet). Same problem have skinned/non-skinned MM2/MM3 versions.
Also, it is irritating that the Tab key not transfers focus to any ActiveX control (tried Web Document and Forms.ListBox). You know, there are some people which prefer the keyboard instead of the mouse.
Here is a text which I sent to Petr with e-mail, but I didn't get any response:
Here is one script file which could demonstrate several issues. The first one is with the Web browser control in the Option sheet:
- enter in the Options dialog box and click on the Test sheet (you could see one Web control on it);
- click on some another sheet;
- click again on the Test sheet -> it is now empty without the Web control;
- close and open again the Options dialog -> Web control is again here until you choose some another sheet.
The several issues are with the ActiveX controls and its focus. Here is the first one:
- choose Edit / Zvezdan's Test 3;
- press the Tab key several times -> focus is transferring between MM built-in controls as it should, until you come to the Web control which cannot get focus.
This means that when you are tabbed to the Web control which has SELECT element (listbox), the Up/Down keys transfers focus to the next MM control instead to change items in this list. Similarly, if you are tabbed to the Web control which has TEXTAREA element (multi-line edit box), none keys are accepted (i.e. typed in that control) except arrows keys which are transferring focus to the next MM control.
The second issue is related to the previous:
- in the same dialog box click on some MM control, i.e. set focus to it;
- click on the Web control which has listbox -> focus is not transfered to it;
- click on the same Web control again -> focus is now accepted;
If you click on some another Web control and after that click on the previous Web control with the listbox -> the focus is immediately accepted, but if you click on some MM control and after that click on the Web control with the listbox -> the focus is transfered only after second click.
If you select some item from this listbox, then click on some MM control and after that click on same listbox again -> the focus is transfered just after third click!
OK, this is not so serious because I could go around with this issue using the "<body onmousedown = 'this.focus();'>" (lines 75 and 108). Interestingly enough, this issue is only with the skinned MM version, all other issues are manifesting with both versions.
The next issue is with the Web control which has TEXTAREA:
- in the same dialog box click on the text field next to the Filter label;
- type several characters, just to be sure it accepts characters;
- press up or down arrow keys -> the focus is transfered to the next MM control.
If you type several lines of text, when you press up or down keys they are functioning as they should only in the middle of the text, but if you press the up arrow key when you are on the first line of the text, or if you press the down arrow key when you are on the last line of the text -> the Web control is loosing focus. I think this is so unusual because the focus should stay in the same control.
Luckily, I could go around with this issue as well with several lines of code (from the line 143).
Well, you could say that I need to do similar thing when I want to get focus when I am tabbing with the Tab key, but I cannot do this because the Web control never generate OnFocus event (tried that with the line 69 and the corresponding function).
This problem is not only with the Web control, but the same thing is with the Listbox control, if you have installed and registered Forms ActiveX (the line 168). When you come to it with the Tab key, it cannot accept up/down arrow keys, but they are transferring focus to another MM control. Interestingly, the textbox control from the Forms ActiveX (the line 187) has not a problems with the Tab key and up/down arrow keys.
One more question - why the mouse cursor is changing to the application hourglass when the mouse is over the scroll bar or the border of the Web control with the SELECT element (listbox)? I tried to set the cursor parameter for the SELECT style without any success. I noticed similar thing with the Textbox control from the Forms ActiveX when the cursor is changing between the default (pointer) shape and I-beam shape as you move the mouse over the text.
Some not so important questions - why the width and the height is not accepted when you use oCtrl.Common.SetRect on the listbox from the Forms controls? Instead, I need to use oCtrl.Common.Width and oCtrl.Common.Height after oCtrl.Interf.BorderStyle = 1. Why the font setting of the textbox of Forms control (the line 190 - oCtrl.Interf.FontName = "System") has such strange effect? Just try to type some text inside of it and you will see what I mean (the every second character has default font).
Regards,
Zvezdan
Here is a script which was attached:
Code: Select all
Sub OnStartUp()
Dim mnuTest
Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
mnuTest.Caption = "Zvezdan's Test 3"
mnuTest.OnClickFunc = "TestForm"
mnuTest.UseScript = Script.ScriptPath
Call SDB.UI.AddOptionSheet("Test sheet", _
Script.ScriptPath, "InitOptionSheet", "SaveOptionSheet", -1)
End Sub
Sub InitOptionSheet(oSheet)
Dim wbtMasks, sWebTbl
Set wbtMasks = SDB.UI.NewActiveX(oSheet, "Shell.Explorer")
wbtMasks.Common.SetRect 10, 10, 460, 188
sWebTbl = "<html><head><style type='text/css'>body {margin: 2px} " & _
"table {font: 11px 'tahoma' 'sans-serif'}</style></head>"
sWebTbl = sWebTbl & "<body><table cellspacing='2'><thead>" & _
"<tr bgcolor='Silver'><td width='4%'>" & _
"<input type='checkbox' name='chk0' "
sWebTbl = sWebTbl & "/></td><td width='4%'>#</td><td>Masks from "
sWebTbl = sWebTbl & "</td></tr></thead><tbody>"
sWebTbl = sWebTbl & "</tbody></table></body></html>"
wbtMasks.SetHTMLDocument sWebTbl
End Sub
Sub SaveOptionSheet(oSheet)
End Sub
Sub TestForm(Item)
Dim Form, oCtrl, sTmp, i
Set Form = SDB.UI.NewForm
Form.Common.SetRect 100, 100, 578, 546
Form.BorderStyle = 3
Form.FormPosition = 4
Form.Caption = "Zvezdan's Test 3"
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Position:"
oCtrl.Common.SetRect 10, 41, 53, 17
Set oCtrl = SDB.UI.NewDropDown(Form)
oCtrl.Style = csDropDownList
oCtrl.Common.SetRect 66, 38, 81, 21
Set oCtrl = SDB.UI.NewDropDown(Form)
oCtrl.Style = csDropDownList
oCtrl.Common.SetRect 154, 38, 90, 21
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Shortcut:"
oCtrl.Common.SetRect 426, 41, 53, 17
Set oCtrl = SDB.UI.NewEdit(Form)
oCtrl.Common.SetRect 487, 38, 73, 17
Set oCtrl = SDB.UI.NewRadioButton(Form)
oCtrl.Caption = "Field:"
oCtrl.Common.SetRect 10, 74, 53, 17
oCtrl.Checked = True
Set oCtrl = SDB.UI.NewActiveX(Form, "Shell.Explorer")
oCtrl.Common.SetRect 66, 75, 137, 71
'Script.RegisterEvent oCtrl.Interf.Document, "onFocus", "lstNodes_OnFocus"
sTmp = "<html><head><style type='text/css'>" _
& "body {margin: 0px 0px; overflow: hidden; border: none} " _
& "select {font: 11px 'tahoma' 'sans-serif'; margin: 0px 0px;" _
& " width: 137px; height: 71px}" _
& "</style></head><body"
'sTmp = sTmp & " onmousedown = 'this.focus();'" ' Because of MM bug
sTmp = sTmp & "><select size = '100'></select></body></html>"
oCtrl.SetHTMLDocument sTmp
For i = 0 To 10
ListBoxAddItem oCtrl, i
Next
Set oCtrl = SDB.UI.NewRadioButton(Form)
oCtrl.Caption = "Group:"
oCtrl.Common.SetRect 10, 152, 53, 17
Set oCtrl = SDB.UI.NewDropDown(Form)
oCtrl.Common.SetRect 66, 151, 137, 21
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Nodes:"
oCtrl.Common.SetRect 213, 76, 40, 17
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "Add"
oCtrl.Common.SetRect 212, 96, 33, 22
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "Del"
oCtrl.Common.SetRect 212, 121, 33, 22
Set oCtrl = SDB.UI.NewActiveX(Form, "Shell.Explorer")
oCtrl.Common.SetRect 255, 75, 154, 97
sTmp = "<html><head><style type='text/css'>" _
& "body {margin: 0px 0px; overflow: hidden; border: none} " _
& "select {font: 11px 'tahoma' 'sans-serif'; margin: 0px 0px;" _
& " width: 154px; height: 97px}" _
& "</style></head><body"
'sTmp = sTmp & " onmousedown = 'this.focus();'" ' Because of MM bug
sTmp = sTmp & "><select size = '100'></select></body></html>"
oCtrl.SetHTMLDocument sTmp
For i = 0 To 10
ListBoxAddItem oCtrl, i
Next
Set oCtrl = SDB.UI.NewCheckBox(Form)
oCtrl.Caption = "Show [Unknown] node"
oCtrl.Common.SetRect 420, 75, 129, 17
Set oCtrl = SDB.UI.NewCheckBox(Form)
oCtrl.Caption = "Show [All] node"
oCtrl.Common.SetRect 420, 95, 97, 17
Set oCtrl = SDB.UI.NewCheckBox(Form)
oCtrl.Caption = "Show tracks in tracklist"
oCtrl.Common.SetRect 420, 115, 129, 17
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Filter:"
oCtrl.Common.SetRect 10, 209, 53, 17
Set oCtrl = SDB.UI.NewActiveX(Form, "Shell.Explorer")
oCtrl.Common.SetRect 66, 209, 454, 50
sTmp = "<html><head><style type='text/css'>" _
& "body {margin: 0px 0px; overflow: hidden; border: none} " _
& "textarea {font: 12px 'courier new' 'serif'; overflow: auto;" _
& " margin: 0px 0px; border: 1px solid;" _
& " width: 454px; height: 49px}" _
& "</style></head>"
sTmp = sTmp & "<body>"
' The next statement is needed instead of previous because of MM bug with
' the up/down keys which transfer focus to the other controls on the form
' when the textual cursor is on the top/bottom of this control.
' sTmp = sTmp & "<script type='text/javascript'>var iKeyCode</script>" _
' & "<body" _
' & " onkeydown = 'iKeyCode = event.keyCode;'" _
' & " onkeyup = 'iKeyCode = """";'" _
' & " onfocusout = 'if(iKeyCode == 38 || iKeyCode == 40)" _
' & " event.srcElement.focus();'>"
sTmp = sTmp & "<textarea></textarea></body></html>"
oCtrl.SetHTMLDocument sTmp
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Icon:"
oCtrl.Common.SetRect 10, 270, 53, 17
Set oCtrl = SDB.UI.NewDropDown(Form)
oCtrl.Style = csDropDownList
oCtrl.Common.SetRect 66, 267, 73, 21
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Top items:"
oCtrl.Common.SetRect 151, 270, 75, 17
Set oCtrl = SDB.UI.NewSpinEdit(Form)
oCtrl.Common.SetRect 223, 267, 57, 17
On Error Resume Next
Set oCtrl = SDB.UI.NewActiveX(Form, "Forms.ListBox.1")
If Err = 0 Then
oCtrl.Common.SetRect 66, 300, 130, 130
oCtrl.Interf.BorderStyle = 1
oCtrl.Common.Width = 130
oCtrl.Common.Height = 130
For i = 0 To 10
oCtrl.Interf.AddItem i
Next
End If
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "Add"
oCtrl.Common.SetRect 220, 300, 33, 22
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "Del"
oCtrl.Common.SetRect 220, 350, 33, 22
Set oCtrl = SDB.UI.NewActiveX(Form, "Forms.TextBox.1")
oCtrl.Interf.MultiLine = True
oCtrl.Interf.ScrollBars = 3
oCtrl.Interf.FontName = "System" '"Fixedsys"
oCtrl.Common.SetRect 300, 300, 200, 130
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Mask:"
oCtrl.Common.SetRect 10, 448, 53, 17
Set oCtrl = SDB.UI.NewEdit(Form)
oCtrl.Common.SetRect 66, 445, 494, 17
oCtrl.Common.ControlName = "edtMask"
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "&OK"
oCtrl.Common.SetRect 407, 482, 73, 25
oCtrl.UseScript = Script.ScriptPath
oCtrl.Default = True
oCtrl.modalResult = 1
'Set SDB.Objects("ButtonOK") = oCtrl
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "&Cancel"
oCtrl.Common.SetRect 487, 482, 73, 25
oCtrl.UseScript = Script.ScriptPath
oCtrl.Cancel = True
oCtrl.modalResult = 2
Form.showModal
'Set SDB.Objects("ButtonOK") = Nothing
End Sub
Sub ListBoxAddItem(oCtrl, sText)
Dim oSelect, oOption
Set oSelect = oCtrl.Interf.Document.getElementsByTagName("select").Item(0)
Set oOption = oCtrl.Interf.Document.createElement("option")
oSelect.options.add(oOption)
oOption.text = sText
End Sub
Sub lstNodes_OnFocus()
MsgBox "Oh well"
End Sub
And another mail:
Oh, I forgot to mention one more issue...
- click on the listbox from the Forms ActiveX (control below Icon dropdown);
- press up or down arrow keys -> selected item from the list is not changing.
This problem don't have SELECT element of the Web control.
Regards,
Zvezdan
By the way, if you don't have installed Forms ActiveX, you will get error message with this script albeit it has On Error Resume Next before critical lines of code.
I think that after spending so much time trying to detect and resolve such issues, after writing sample scipt and writing such long explanation about test, I deserve to get at least some short information about their status.
[quote="jiri"]both issues are already fixed at this moment.[/quote]
Well, this is really nice and I apreciate it. I already tried that with a new MM version and found that you fixed two critical bugs and mentioned that in the Magic Nodes thread. But, what about:
[quote]I created one Option sheet in the Options dialog box and put one Web Document ActiveX control at it (SDB.UI.NewActiveX(oSheet, "Shell.Explorer")). When I open the Options dialog box and when I open my options sheet, Web control is showing without problem. But, if I temporarily switch to some another option sheet and turn back to my option sheet, Web control is not showing at all! If I close and reopen the Options dialog box, my Web control is showing again (until I switch to some another options sheet). Same problem have skinned/non-skinned MM2/MM3 versions.
Also, it is irritating that the Tab key not transfers focus to any ActiveX control (tried Web Document and Forms.ListBox). You know, there are some people which prefer the keyboard instead of the mouse.[/quote]
Here is a text which I sent to Petr with e-mail, but I didn't get any response:
[quote]Here is one script file which could demonstrate several issues. The first one is with the Web browser control in the Option sheet:
- enter in the Options dialog box and click on the Test sheet (you could see one Web control on it);
- click on some another sheet;
- click again on the Test sheet -> it is now empty without the Web control;
- close and open again the Options dialog -> Web control is again here until you choose some another sheet.
The several issues are with the ActiveX controls and its focus. Here is the first one:
- choose Edit / Zvezdan's Test 3;
- press the Tab key several times -> focus is transferring between MM built-in controls as it should, until you come to the Web control which cannot get focus.
This means that when you are tabbed to the Web control which has SELECT element (listbox), the Up/Down keys transfers focus to the next MM control instead to change items in this list. Similarly, if you are tabbed to the Web control which has TEXTAREA element (multi-line edit box), none keys are accepted (i.e. typed in that control) except arrows keys which are transferring focus to the next MM control.
The second issue is related to the previous:
- in the same dialog box click on some MM control, i.e. set focus to it;
- click on the Web control which has listbox -> focus is not transfered to it;
- click on the same Web control again -> focus is now accepted;
If you click on some another Web control and after that click on the previous Web control with the listbox -> the focus is immediately accepted, but if you click on some MM control and after that click on the Web control with the listbox -> the focus is transfered only after second click.
If you select some item from this listbox, then click on some MM control and after that click on same listbox again -> the focus is transfered just after third click!
OK, this is not so serious because I could go around with this issue using the "<body onmousedown = 'this.focus();'>" (lines 75 and 108). Interestingly enough, this issue is only with the skinned MM version, all other issues are manifesting with both versions.
The next issue is with the Web control which has TEXTAREA:
- in the same dialog box click on the text field next to the Filter label;
- type several characters, just to be sure it accepts characters;
- press up or down arrow keys -> the focus is transfered to the next MM control.
If you type several lines of text, when you press up or down keys they are functioning as they should only in the middle of the text, but if you press the up arrow key when you are on the first line of the text, or if you press the down arrow key when you are on the last line of the text -> the Web control is loosing focus. I think this is so unusual because the focus should stay in the same control.
Luckily, I could go around with this issue as well with several lines of code (from the line 143).
Well, you could say that I need to do similar thing when I want to get focus when I am tabbing with the Tab key, but I cannot do this because the Web control never generate OnFocus event (tried that with the line 69 and the corresponding function).
This problem is not only with the Web control, but the same thing is with the Listbox control, if you have installed and registered Forms ActiveX (the line 168). When you come to it with the Tab key, it cannot accept up/down arrow keys, but they are transferring focus to another MM control. Interestingly, the textbox control from the Forms ActiveX (the line 187) has not a problems with the Tab key and up/down arrow keys.
One more question - why the mouse cursor is changing to the application hourglass when the mouse is over the scroll bar or the border of the Web control with the SELECT element (listbox)? I tried to set the cursor parameter for the SELECT style without any success. I noticed similar thing with the Textbox control from the Forms ActiveX when the cursor is changing between the default (pointer) shape and I-beam shape as you move the mouse over the text.
Some not so important questions - why the width and the height is not accepted when you use oCtrl.Common.SetRect on the listbox from the Forms controls? Instead, I need to use oCtrl.Common.Width and oCtrl.Common.Height after oCtrl.Interf.BorderStyle = 1. Why the font setting of the textbox of Forms control (the line 190 - oCtrl.Interf.FontName = "System") has such strange effect? Just try to type some text inside of it and you will see what I mean (the every second character has default font).
Regards,
Zvezdan[/quote]
Here is a script which was attached:
[code]Sub OnStartUp()
Dim mnuTest
Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
mnuTest.Caption = "Zvezdan's Test 3"
mnuTest.OnClickFunc = "TestForm"
mnuTest.UseScript = Script.ScriptPath
Call SDB.UI.AddOptionSheet("Test sheet", _
Script.ScriptPath, "InitOptionSheet", "SaveOptionSheet", -1)
End Sub
Sub InitOptionSheet(oSheet)
Dim wbtMasks, sWebTbl
Set wbtMasks = SDB.UI.NewActiveX(oSheet, "Shell.Explorer")
wbtMasks.Common.SetRect 10, 10, 460, 188
sWebTbl = "<html><head><style type='text/css'>body {margin: 2px} " & _
"table {font: 11px 'tahoma' 'sans-serif'}</style></head>"
sWebTbl = sWebTbl & "<body><table cellspacing='2'><thead>" & _
"<tr bgcolor='Silver'><td width='4%'>" & _
"<input type='checkbox' name='chk0' "
sWebTbl = sWebTbl & "/></td><td width='4%'>#</td><td>Masks from "
sWebTbl = sWebTbl & "</td></tr></thead><tbody>"
sWebTbl = sWebTbl & "</tbody></table></body></html>"
wbtMasks.SetHTMLDocument sWebTbl
End Sub
Sub SaveOptionSheet(oSheet)
End Sub
Sub TestForm(Item)
Dim Form, oCtrl, sTmp, i
Set Form = SDB.UI.NewForm
Form.Common.SetRect 100, 100, 578, 546
Form.BorderStyle = 3
Form.FormPosition = 4
Form.Caption = "Zvezdan's Test 3"
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Position:"
oCtrl.Common.SetRect 10, 41, 53, 17
Set oCtrl = SDB.UI.NewDropDown(Form)
oCtrl.Style = csDropDownList
oCtrl.Common.SetRect 66, 38, 81, 21
Set oCtrl = SDB.UI.NewDropDown(Form)
oCtrl.Style = csDropDownList
oCtrl.Common.SetRect 154, 38, 90, 21
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Shortcut:"
oCtrl.Common.SetRect 426, 41, 53, 17
Set oCtrl = SDB.UI.NewEdit(Form)
oCtrl.Common.SetRect 487, 38, 73, 17
Set oCtrl = SDB.UI.NewRadioButton(Form)
oCtrl.Caption = "Field:"
oCtrl.Common.SetRect 10, 74, 53, 17
oCtrl.Checked = True
Set oCtrl = SDB.UI.NewActiveX(Form, "Shell.Explorer")
oCtrl.Common.SetRect 66, 75, 137, 71
'Script.RegisterEvent oCtrl.Interf.Document, "onFocus", "lstNodes_OnFocus"
sTmp = "<html><head><style type='text/css'>" _
& "body {margin: 0px 0px; overflow: hidden; border: none} " _
& "select {font: 11px 'tahoma' 'sans-serif'; margin: 0px 0px;" _
& " width: 137px; height: 71px}" _
& "</style></head><body"
'sTmp = sTmp & " onmousedown = 'this.focus();'" ' Because of MM bug
sTmp = sTmp & "><select size = '100'></select></body></html>"
oCtrl.SetHTMLDocument sTmp
For i = 0 To 10
ListBoxAddItem oCtrl, i
Next
Set oCtrl = SDB.UI.NewRadioButton(Form)
oCtrl.Caption = "Group:"
oCtrl.Common.SetRect 10, 152, 53, 17
Set oCtrl = SDB.UI.NewDropDown(Form)
oCtrl.Common.SetRect 66, 151, 137, 21
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Nodes:"
oCtrl.Common.SetRect 213, 76, 40, 17
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "Add"
oCtrl.Common.SetRect 212, 96, 33, 22
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "Del"
oCtrl.Common.SetRect 212, 121, 33, 22
Set oCtrl = SDB.UI.NewActiveX(Form, "Shell.Explorer")
oCtrl.Common.SetRect 255, 75, 154, 97
sTmp = "<html><head><style type='text/css'>" _
& "body {margin: 0px 0px; overflow: hidden; border: none} " _
& "select {font: 11px 'tahoma' 'sans-serif'; margin: 0px 0px;" _
& " width: 154px; height: 97px}" _
& "</style></head><body"
'sTmp = sTmp & " onmousedown = 'this.focus();'" ' Because of MM bug
sTmp = sTmp & "><select size = '100'></select></body></html>"
oCtrl.SetHTMLDocument sTmp
For i = 0 To 10
ListBoxAddItem oCtrl, i
Next
Set oCtrl = SDB.UI.NewCheckBox(Form)
oCtrl.Caption = "Show [Unknown] node"
oCtrl.Common.SetRect 420, 75, 129, 17
Set oCtrl = SDB.UI.NewCheckBox(Form)
oCtrl.Caption = "Show [All] node"
oCtrl.Common.SetRect 420, 95, 97, 17
Set oCtrl = SDB.UI.NewCheckBox(Form)
oCtrl.Caption = "Show tracks in tracklist"
oCtrl.Common.SetRect 420, 115, 129, 17
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Filter:"
oCtrl.Common.SetRect 10, 209, 53, 17
Set oCtrl = SDB.UI.NewActiveX(Form, "Shell.Explorer")
oCtrl.Common.SetRect 66, 209, 454, 50
sTmp = "<html><head><style type='text/css'>" _
& "body {margin: 0px 0px; overflow: hidden; border: none} " _
& "textarea {font: 12px 'courier new' 'serif'; overflow: auto;" _
& " margin: 0px 0px; border: 1px solid;" _
& " width: 454px; height: 49px}" _
& "</style></head>"
sTmp = sTmp & "<body>"
' The next statement is needed instead of previous because of MM bug with
' the up/down keys which transfer focus to the other controls on the form
' when the textual cursor is on the top/bottom of this control.
' sTmp = sTmp & "<script type='text/javascript'>var iKeyCode</script>" _
' & "<body" _
' & " onkeydown = 'iKeyCode = event.keyCode;'" _
' & " onkeyup = 'iKeyCode = """";'" _
' & " onfocusout = 'if(iKeyCode == 38 || iKeyCode == 40)" _
' & " event.srcElement.focus();'>"
sTmp = sTmp & "<textarea></textarea></body></html>"
oCtrl.SetHTMLDocument sTmp
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Icon:"
oCtrl.Common.SetRect 10, 270, 53, 17
Set oCtrl = SDB.UI.NewDropDown(Form)
oCtrl.Style = csDropDownList
oCtrl.Common.SetRect 66, 267, 73, 21
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Top items:"
oCtrl.Common.SetRect 151, 270, 75, 17
Set oCtrl = SDB.UI.NewSpinEdit(Form)
oCtrl.Common.SetRect 223, 267, 57, 17
On Error Resume Next
Set oCtrl = SDB.UI.NewActiveX(Form, "Forms.ListBox.1")
If Err = 0 Then
oCtrl.Common.SetRect 66, 300, 130, 130
oCtrl.Interf.BorderStyle = 1
oCtrl.Common.Width = 130
oCtrl.Common.Height = 130
For i = 0 To 10
oCtrl.Interf.AddItem i
Next
End If
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "Add"
oCtrl.Common.SetRect 220, 300, 33, 22
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "Del"
oCtrl.Common.SetRect 220, 350, 33, 22
Set oCtrl = SDB.UI.NewActiveX(Form, "Forms.TextBox.1")
oCtrl.Interf.MultiLine = True
oCtrl.Interf.ScrollBars = 3
oCtrl.Interf.FontName = "System" '"Fixedsys"
oCtrl.Common.SetRect 300, 300, 200, 130
Set oCtrl = SDB.UI.NewLabel(Form)
oCtrl.Caption = "Mask:"
oCtrl.Common.SetRect 10, 448, 53, 17
Set oCtrl = SDB.UI.NewEdit(Form)
oCtrl.Common.SetRect 66, 445, 494, 17
oCtrl.Common.ControlName = "edtMask"
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "&OK"
oCtrl.Common.SetRect 407, 482, 73, 25
oCtrl.UseScript = Script.ScriptPath
oCtrl.Default = True
oCtrl.modalResult = 1
'Set SDB.Objects("ButtonOK") = oCtrl
Set oCtrl = SDB.UI.NewButton(Form)
oCtrl.Caption = "&Cancel"
oCtrl.Common.SetRect 487, 482, 73, 25
oCtrl.UseScript = Script.ScriptPath
oCtrl.Cancel = True
oCtrl.modalResult = 2
Form.showModal
'Set SDB.Objects("ButtonOK") = Nothing
End Sub
Sub ListBoxAddItem(oCtrl, sText)
Dim oSelect, oOption
Set oSelect = oCtrl.Interf.Document.getElementsByTagName("select").Item(0)
Set oOption = oCtrl.Interf.Document.createElement("option")
oSelect.options.add(oOption)
oOption.text = sText
End Sub
Sub lstNodes_OnFocus()
MsgBox "Oh well"
End Sub[/code]
And another mail:
[quote]Oh, I forgot to mention one more issue...
- click on the listbox from the Forms ActiveX (control below Icon dropdown);
- press up or down arrow keys -> selected item from the list is not changing.
This problem don't have SELECT element of the Web control.
Regards,
Zvezdan
[/quote]
By the way, if you don't have installed Forms ActiveX, you will get error message with this script albeit it has On Error Resume Next before critical lines of code.
I think that after spending so much time trying to detect and resolve such issues, after writing sample scipt and writing such long explanation about test, I deserve to get at least some short information about their status.