As I understand the documentation, the "dialog unit" is the
count of characters to be displayed. I'm trying to compute
the size of the box based on the LEN of the text being
displayed. But it seems necessary to do some computation
on the size to even get close, e.g. 7*(L+1) as below. What
am I missing. I'd like the code to work on any display, and
I'm a little worried about just developing a empirical formula
using my display 24 inch display.
--------------------------------------------------------------
$COMPILE EXE
$INCLUDE "WIN32API.INC"
FUNCTION PBMAIN()
DIM List(1:10) AS STRING
LOCAL i AS LONG
LOCAL hDlg AS LONG
LOCAL L AS LONG
FOR i=1 TO 10:
IF i>1 THEN List(i)=List(i-1)
List(i)=CHR$(64+i)+CHR$(64+i)+List(i):NEXT i
DIALOG NEW 0,"This tests the width of dialog boxes",,,320,240,%WS_CAPTION OR %WS_SYSMENU,0 TO hDlg
L=2
FOR i=1 TO 10
CONTROL ADD COMBOBOX,hDlg,200+i,List(),10,5+i*16,7*(LEN(List(i))+1),11*10,%CBS_DROPDOWNLIST+%WS_TABSTOP
COMBOBOX SELECT hDlg,200+i,i
NEXT i
DIALOG SHOW MODAL hDlg
END FUNCTION
count of characters to be displayed. I'm trying to compute
the size of the box based on the LEN of the text being
displayed. But it seems necessary to do some computation
on the size to even get close, e.g. 7*(L+1) as below. What
am I missing. I'd like the code to work on any display, and
I'm a little worried about just developing a empirical formula
using my display 24 inch display.
--------------------------------------------------------------
$COMPILE EXE
$INCLUDE "WIN32API.INC"
FUNCTION PBMAIN()
DIM List(1:10) AS STRING
LOCAL i AS LONG
LOCAL hDlg AS LONG
LOCAL L AS LONG
FOR i=1 TO 10:
IF i>1 THEN List(i)=List(i-1)
List(i)=CHR$(64+i)+CHR$(64+i)+List(i):NEXT i
DIALOG NEW 0,"This tests the width of dialog boxes",,,320,240,%WS_CAPTION OR %WS_SYSMENU,0 TO hDlg
L=2
FOR i=1 TO 10
CONTROL ADD COMBOBOX,hDlg,200+i,List(),10,5+i*16,7*(LEN(List(i))+1),11*10,%CBS_DROPDOWNLIST+%WS_TABSTOP
COMBOBOX SELECT hDlg,200+i,i
NEXT i
DIALOG SHOW MODAL hDlg
END FUNCTION
Comment