08-09-2008, 01:08 AM
I really dig this quite a lot!
Just to make sure I've got the idea right:
CreateControl([Exstyle][Class][Text][Style][x][y][cx][cy][Hwnd][Id])
I've noticed that the x y cx cy do not work the same as when they are in the dialog editor...then I noticed this:
Function DE_CreateControl
I don't quite get what you are doing and why you would put the math in like this.
It just makes it weird because I was going to use dialog editor to layout the new controls and then just put the information in the CreateControl call. But they are always in the wrong spot and too small. Guess I could just do the math myself
Just to make sure I've got the idea right:
CreateControl([Exstyle][Class][Text][Style][x][y][cx][cy][Hwnd][Id])
I've noticed that the x y cx cy do not work the same as when they are in the dialog editor...then I noticed this:
Function DE_CreateControl
function# Exstyle $Class $Text Style x y cx cy Hwnd Id [Bottom] [DlgUnits] [invisible]
if DlgUnits
,x=MulDiv(x d.dbx 4)
,y=MulDiv(y d.dby 8)
,cx=MulDiv(cx d.dbx 4)
,cy=MulDiv(cy d.dby 8)
,
if Bottom
,RECT r; GetClientRect(Hwnd &r)
,y=r.bottom-cy; x=0
if(!invisible) Style|WS_VISIBLE
int h=CreateWindowExW(Exstyle @Class @Text (Style|WS_CHILD|WS_CLIPSIBLINGS) x y cx cy Hwnd Id _hinst 0)
if(!h) ret
if(Bottom) EnumChildWindows Hwnd &DE_GB h ;;send all groupboxes to bottom
SendMessage(h WM_SETFONT _hfont 0)
ret h
I don't quite get what you are doing and why you would put the math in like this.
It just makes it weird because I was going to use dialog editor to layout the new controls and then just put the information in the CreateControl call. But they are always in the wrong spot and too small. Guess I could just do the math myself
