Charles,
This is the PowerBASIC demo.
James
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
'I used IUP build 3.5
'http://sourceforge.net/projects/iup/files/3.5/Windows%20Libraries/iup-3.5_Win32_dll6_lib.zip/download
'SED_PBWIN
#COMPILE EXE
#DIM ALL
#INCLUDE ONCE "windows.inc"
#RESOURCE MANIFEST,1, "xpmanifest.xml"
'Change path to iup.dll if need be.
$DLLNAME = "\iup_dll6\iup.dll"
%IUP_CLOSE = -3
%IUP_ERROR = 1
DECLARE FUNCTION IupOpen CDECL IMPORT $DLLNAME ALIAS "IupOpen" (BYVAL argc AS DWORD,BYVAL argv AS DWORD)AS LONG
DECLARE FUNCTION IupCreate CDECL IMPORT $DLLNAME ALIAS "IupCreate"(cname As stringz) AS DWORD
DECLARE SUB IupClose CDECL IMPORT $DLLNAME ALIAS "IupClose"()
DECLARE FUNCTION IupSetAttributes CDECL IMPORT $DLLNAME ALIAS "IupSetAttributes"(BYVAL ih AS DWORD,strz As stringz) AS DWORD
DECLARE FUNCTION IupAppend CDECL IMPORT $DLLNAME ALIAS "IupAppend"(BYVAL ih AS DWORD,BYVAL child AS DWORD) AS DWORD
DECLARE SUB IupRefresh CDECL IMPORT $DLLNAME ALIAS "IupRefresh"(BYVAL ih AS DWORD)
DECLARE FUNCTION IupSetCallback CDECL IMPORT $DLLNAME ALIAS "IupSetCallback"(BYVAL ih As DWORD,sname As stringz,BYVAL func AS DWORD) AS DWORD
DECLARE FUNCTION IupShow CDECL IMPORT $DLLNAME ALIAS "IupShow"(BYVAL ih AS DWORD) As Long
DECLARE FUNCTION IupSetFocus CDECL IMPORT $DLLNAME ALIAS "IupSetFocus"(BYVAL ih As DWORD) AS DWORD
DECLARE SUB IupMainLoop CDECL IMPORT $DLLNAME ALIAS "IupMainLoop"()
FUNCTION PBMAIN () AS LONG
LOCAL rv As LONG
LOCAL win,vbox,topBox,serverFrame,serverBox,serverCombo,btnFetch,controlFrame, _
controlBox,btnAbout,btnClear,btnExit,dictFrame,serverList,transFrame, _
text,bottomBox,label,entry,btnSearch,chkAll,chkUTF AS DWORD
'Initialize IUP
rv = IupOpen(0,0)
IF rv = %IUP_ERROR THEN
MsgBox "Initialize Failed"
EXIT FUNCTION
END IF
'Create Main Window
win = Create("dialog","TITLE=Thesaurus, SIZE=500x300",0)
'create container to house ALL GUI objects
vbox = Create("vbox","MARGIN=10x10",0)
'Create Server panel
topBox = Create("hbox", " GAP=10", vbox)
serverFrame = Create("frame", "TITLE=Servers, EXPAND=YES", topBox)
serverBox= Create("hbox", "GAP=5", serverFrame)
serverCombo = Create("list", "DROPDOWN=YES, SIZE=120x, EXPAND=HORIZONTAL, VALUE=1", serverBox)
btnFetch = Create("button", "TITLE=Fetch, SIZE = 50x", serverBox)
'Create control panel
controlFrame = Create("frame", "TITLE=Controls", topBox)
controlBox = Create("hbox", "Margin=6x6, GAP=5", controlFrame)
btnAbout = Create("button", "TITLE=About, SIZE = 50x", controlBox)
btnClear = Create("button", "TITLE=Clear, SIZE = 50x", controlBox)
btnExit = Create("button", "TITLE=Exit, SIZE = 50x", controlBox)
'SETUP CALLBACK FOR EXIT BUTTON
IupSetCallback(btnExit, "ACTION", CODEPTR(quit_cb))
'Create dictionary panel
dictFrame = Create("frame", "TITLE=Dictionaries", vbox)
serverList = Create("list", "EXPAND=YES, VISIBLELINES=1", dictFrame)
'Create text part
transFrame = Create("frame", "TITLE=Translation", vbox)
text = Create("text", "MULTILINE=YES, EXPAND=YES", transFrame)
'Create entry and search button
bottomBox = Create("hbox", "GAP=10", vbox)
label = Create("label", "TITLE=Enter Word to Search For: , SIZE=x12", bottomBox)
entry = Create("text", " EXPAND=HORIZONTAL",bottomBox)
btnSearch = Create("button","TITLE=Search, SIZE=50x", bottomBox)
chkAll = Create("toggle", "TITLE=ALL, VALUE=ON,SIZE=x12", bottomBox)
chkUTF = Create("toggle", "TITLE=UTF-8, SIZE=x12", bottomBox)
'
'Add the main GUI container to the Window
AddChild(win, vbox)
'Show the Window
IupShow(win)
IupSetFocus(btnFetch)
IupMainLoop()
IupClose()
END FUNCTION
'==============================================================================
'Exit Button Callback
FUNCTION quit_cb()cdecl AS LONG
FUNCTION = %IUP_CLOSE
END FUNCTION
'***********************************************************************
'Helper functions
'***********************************************************************
'==============================================================================
SUB AddChild(parent As DWORD,child As DWORD)
IupAppend parent,child
IupRefresh parent
END SUB
'==============================================================================
FUNCTION Create ( Value As Stringz,Attr As Stringz,parent As DWORD)AS DWORD
LOCAL hWnd AS DWORD
hWnd = IupCreate(Value)
If hWnd Then
If Len(Attr) Then
IupSetAttributes(hWnd,Attr)
End If
If parent Then
AddChild parent,hWnd
End If
Function = hWnd
End If
END FUNCTION