The documentation for WINLIB2 is on web page http://www.bbcbasic.co.uk/bbcwin/manual ... #newdialog
There is also an example SDL program general/dlgdemo.bbc which gives some clues.
I have been trying to use dlglib to create a simple dialog box, with some headings, some editable fields, a multi-line text box, and some buttons. However, I have found some differences between WINLIB2 and dlglib which I have listed here in case they are of use to anyone else, and I have some questions.
Comparison of BB4W WINLIB2 and SDL dlglib
Note there are likely to be errors and omissions - any corrections welcome!
These PROCs all seem the same in both BB4W & SDL:
PROC_groupbox(dlg%,text$,id%,x%,y%,cx%,cy%,style%)
PROC_checkbox(dlg%,text$,id%,x%,y%,cx%,cy%,style%)
PROC_radiobutton(dlg%,text$,id%,x%,y%,cx%,cy%,style%)
PROC_static(dlg%,text$,id%,x%,y%,cx%,cy%,style%)
PROC_closedialog(dlg%)
FN_newdialog(title$,x%,y%,cx%,cy%,font%,size%)
SDL parms are only (title$,x%,y%)
PROC_pushbutton(dlg%,text$,id%,x%,y%,cx%,cy%,style%)
SDL is PROC_button but parms seem the same.
PROC_editbox(dlg%,text$,id%,x%,y%,cx%,cy%,style%)
SDL is PROC_textbox
Parameters appear the same, but the style% is different:
ES_WANTRETURN and ES_MULTILINE are not defined in SDL and the value do not
seem to work to provide a multi-line edit box.
PROC_showdialog(dlg%)
SDL is result% = FN_showdialog(dlg%,x%,y%)
If x% or x% are &80000000 the width + height are centralised in the window
else they are offsets of top left in the window (in dialog units?)
Returned integer result% is I think the id% of clicked button.
Setting contents of Dialog Box:
BB4W: SYS "SetDlgItemText", !dlg%, id%, text$
SDL: PROC_setdlgitemtext(D%, 101, "New text")
BB4W: SYS "SetDlgItemInt", !dlg%, id%, value%, signed%
SDL: no obvious equivalent
Reading Contents of Dialog Box:
BB4W: DIM text% 255 :SYS "GetDlgItemText", !dlg%, id%, text%, 255
SDL: text$ = FN_getdlgitemtext(dlg%, id%)
BB4W: DIM text% 65535 :SYS "GetDlgItemText", !dlg%, id%, text%, 65535 TO Len%
SDL: no obvious equivalent
Questions
- Is there any other documentation for dlglib?
- Where can I find the definition of 'Dialog box units' that are used in WINLIB2 docs?
- How can a multi-line edit box be used with dlglib?
- How can the missing parms cx%,cy%,font%,size% in FN_newdialog be defined?
- Is there any explanation of PROC_registerdlgcallback(dlg%, FNmycb()) in dlgdemo?