Phil,
Rewrote the old listbox preselect script to work with the version 12+ Dialogs.
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Caption = 'Pre-Multiselect ListBox Example'
ClientHeight = 350
ClientWidth = 211
Position = poScreenCenter
object MSListBox1: tMSListBox
Left = 45
Top = 30
Width = 121
Height = 291
ItemHeight = 13
MultiSelect = True
TabOrder = 0
SelectedIndex = -1
end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,,OnClose,Quit
SetDialogProperty>Dialog1,MSListBox1,Text,item1%CRLF%item2%CRLF%item3%CRLF%item4%CRLF%item5%CRLF%item6%CRLF%item7%CRLF%item8%CRLF%item9%CRLF%item10%CRLF%item11%CRLF%item12%CRLF%item13%CRLF%item14
show>dialog1
Let>LB_SETSEL=389
//Run the following for each pre-chosen 0 based item selection
//The last number is the one to change 0 = the first item,
//3 = the fourth item, 5 = the sixth item, etc.
LibFunc>user32,SendMessageA,SMres,dialog1.msListBox1.handle,LB_SETSEL,1,0
LibFunc>user32,SendMessageA,SMres,dialog1.msListBox1.handle,LB_SETSEL,1,3
LibFunc>user32,SendMessageA,SMres,dialog1.msListBox1.handle,LB_SETSEL,1,5
LibFunc>user32,SendMessageA,SMres,dialog1.msListBox1.handle,LB_SETSEL,1,11
LibFunc>user32,SendMessageA,SMres,dialog1.msListBox1.handle,LB_SETSEL,1,12
Label>Loop
Wait>0.01
Goto>Loop
SRT>Quit
Exit>0
END>Quit
For the hint issue you might try using the Listbox events. Here's a sample that just puts the displayed text in a dialog. Its a little flakey but it is just a possible example.
Code: Select all
Dialog>Dialog2
object Dialog2: TForm
BorderStyle = bsNone
Caption = 'CustomHint'
ClientHeight = 29
ClientWidth = 723
object Label1: TLabel
Left = 5
Top = 8
Width = 32
Height = 13
Caption = ''
end
end
EndDialog>Dialog2
Dialog>Dialog1
object Dialog1: TForm
Caption = 'Pre-Multiselect ListBox Example'
ClientHeight = 350
ClientWidth = 211
Position = poScreenCenter
object MSListBox1: tMSListBox
Left = 45
Top = 30
Width = 121
Height = 291
ItemHeight = 13
MultiSelect = True
TabOrder = 0
SelectedIndex = -1
end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,MSListBox1,OnMouseEnter,srtHint
AddDialogHandler>Dialog1,MSListBox1,OnMouseLeave,srtHintOff
AddDialogHandler>Dialog1,,OnClose,Quit
SetDialogProperty>Dialog1,MSListBox1,Text,item1%CRLF%item2%CRLF%item3%CRLF%item4%CRLF%item5%CRLF%item6%CRLF%item7%CRLF%item8%CRLF%item9%CRLF%item10%CRLF%item11%CRLF%item12%CRLF%item13%CRLF%item14
show>dialog1
Let>LB_SETSEL=389
//Run the following for each pre-chosen 0 based item selection
//The last number is the one to change 0 = the first item,
//3 = the fourth item, 5 = the sixth item, etc.
LibFunc>user32,SendMessageA,SMres,dialog1.msListBox1.handle,LB_SETSEL,1,0
LibFunc>user32,SendMessageA,SMres,dialog1.msListBox1.handle,LB_SETSEL,1,3
LibFunc>user32,SendMessageA,SMres,dialog1.msListBox1.handle,LB_SETSEL,1,5
LibFunc>user32,SendMessageA,SMres,dialog1.msListBox1.handle,LB_SETSEL,1,11
LibFunc>user32,SendMessageA,SMres,dialog1.msListBox1.handle,LB_SETSEL,1,12
GetTextInit
Label>Loop
Wait>0.01
If>getTextFlag=1
GetCursorPos>Xpos,Ypos
GetTextAtPoint>Xpos,Ypos,vStr,vStrPos
MoveWindow>CustomHint,Xpos,Ypos
Wait>0.7
SetDialogProperty>Dialog2,Label1,Caption,vStr
Wait>3
EndIf
Goto>Loop
SRT>Quit
Exit>0
END>Quit
SRT>srtHint
Let>getTextFlag=1
Show>Dialog2
END>srtHint
SRT>srtHintOff
getTextFlag=0
CloseDialog>Dialog2
END>srtHintOff