' Empty GUI script created on 07-11-2012 10:42:28 by largo_winch
Uses "UI", "console"
' -- ID numbers of controls
Begin ControlID
%ButtonClose = 1001
%tmyListWords
%tMyInput
%myLabel
End ControlID
Function TBMain() As Long
Dim hDlg As DWord
Dialog New 0, "word_find_list 01",-1,-1, 320, 250, _
%WS_POPUP Or _
%WS_VISIBLE Or _
%WS_CLIPCHILDREN Or _
%WS_CAPTION Or _
%WS_SYSMENU Or _
%WS_MAXIMIZEBOX Or _
%WS_MINIMIZEBOX, _
0 To hDlg
Control Add Button, hDlg, %ButtonClose, "Click to kill", 230, 210, 50, 18
'Control Add Label, hDlg, %myLabel, "type in a word",240,50,90,20
Dialog Show Modal hDlg Call cbDialog
End Function
CallBack Function cbDialog() As Long
Local hDlg As Long, hText1 As Long, sMyContent As Long, sMyNewContent As String, thisposition As Long
'String suggestions(5) = "the", "thin", "turtle", "terrific", "thinbasic"
Select Case CBMSG
Case %WM_INITDIALOG
Dim vWordList(7) As String
vWordList(1) = "fun"
vWordList(2) = "further"
vWordList(3) = "father"
vWordList(4) = "fork"
vWordList(5) = "foreign"
vWordList(6) = "foster"
vWordList(7) = "friend"
Control Add LISTBOX, CBHNDL,%tMyListWords, vWordList(), 5,25,220,280, %WS_VSCROLL Or %LBS_NOINTEGRALHEIGHT,%WS_EX_CLIENTEDGE
Control Add Textbox CBHNDL, %tMyInput , "", 240, 25, 60, 24 ', %ES_AUTOHSCROLL Or %ES_LEFT Or %WS_BORDER Or %WS_TABSTOP Or %ES_MULTILINE Or %ES_WANTRETURN Or %WS_VSCROLL,,
Case %WM_COMMAND
If CBWPARAM = %ButtonClose Then Dialog End CBHNDL
Select Case CBCTL
Case %tMyListWords
Select Case CBCTLMSG
Case %LBN_SELCHANGE
'------------------------- ??? -------------------------- >
LISTBOX Get Text CBHNDL, %tMyListWords To sMyContent
Control Set Text CBHNDL, %tMyInput, sMyContent
' result always "0" instead of a string ???
'------------------------- ??? -------------------------- >
MsgBox 0, sMyContent
Case %LBN_DBLCLK
LISTBOX Get Text CBHNDL, %tMyListwords To sMyContent
Control Append Text CBHNDL, %tMyInput, "(DblClick " & sMyContent & ")"
End Select
End Select
Case %WM_DESTROY
End Select
End Function
Bookmarks