Posts: 32
Threads: 6
Joined: Aug 2005
Tried this with no luck. Is there a way that I can have the (;3 RichEdit20A 0x54233044 0x200 0 0 294 190 "") start at 0 10 instead of 0 0? I would like to put in some buttons and icons before the RichEdit but I do not know if that is possible.
Function DialogWithMenu2
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str rea3
if(!ShowDialog("DialogWithMenu2" &DialogWithMenu2 &controls 0 0 0 0 0 0 0 "dialog.ico" "DialogWithMenu")) ret
;BEGIN DIALOG
;0 "" 0x10CF0A44 0x100 0 0 294 190 "Dialog"
;3 RichEdit20A 0x54233044 0x200 0 0 294 190 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2020009 "*" ""
ret
;messages
sel message
,case WM_INITDIALOG
,
,case WM_SIZE
,RECT r; GetClientRect(hDlg &r)
,siz r.right r.bottom id(3 hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,;menu items:
,case 101 out "Open"
,case 103 out "Cut"
,case 104 out "Select All"
,case 105 out "Help"
,
,case IDOK
,case IDCANCEL
ret 1
;BEGIN MENU
;>&File
,;&Open : 101 0 0 Co
,;-
,;>&Recent
,,;Empty : 102 0 3
,,;<
,;<
;>&Edit
,;Cu&t : 103 0 0 Cx
,;-
,;Select &All : 104 0 0 Ca
,;<
;&Help : 105 0
;END MENU
Posts: 1,000
Threads: 253
Joined: Feb 2008
change:
;3 RichEdit20A 0x54233044 0x200 0 0 294 190 ""
to:
;3 RichEdit20A 0x54233044 0x200 0 10 294 190 ""
Worked for me
Posts: 32
Threads: 6
Joined: Aug 2005
That was too simple. If my work weren’t going to buy this for me I would buy it myself. It is such a fantastic find and I am sure that the pro version is fantastic + and people like you just make it that more appealing.
Posts: 32
Threads: 6
Joined: Aug 2005
As long as I am learning how to control the dialog I have another question. Is it possible to change the position of the (;3 RichEdit20A 0x54233044 0x200 0 10 294 190 "") based on if the dialog is maximized or not? The example does not work but I am hopping that it is just some simple mistake that I am making.
Example:
Function DialogWithMenu2
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str rea3
if(!ShowDialog("DialogWithMenu2" &DialogWithMenu2 &controls 0 0 0 0 0 0 0 "dialog.ico" "DialogWithMenu")) ret
;BEGIN DIALOG
;0 "" 0x10CF0A44 0x100 0 0 294 190 "Dialog"
;3 RichEdit20A 0x54233044 0x200 0 10 294 190 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2020009 "*" ""
ret
;messages
sel message
,case WM_INITDIALOG
,
,case WM_SIZE
if(IsZoomed(win("Dialog" "#32770")))
,;3 RichEdit20A 0x54233044 0x200 0 0 294 190 ""
if(!IsZoomed(win("Dialog" "#32770")))
,;3 RichEdit20A 0x54233044 0x200 0 10 294 190 ""
,RECT r; GetClientRect(hDlg &r)
,siz r.right r.bottom id(3 hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,;menu items:
,case 101 out "Open"
,case 103 out "Cut"
,case 104 out "Select All"
,case 105 out "Help"
,
,case IDOK
,case IDCANCEL
ret 1
;BEGIN MENU
;>&File
,;&Open : 101 0 0 Co
,;-
,;>&Recent
,,;Empty : 102 0 3
,,;<
,;<
;>&Edit
,;Cu&t : 103 0 0 Cx
,;-
,;Select &All : 104 0 0 Ca
,;<
;&Help : 105 0
;END MENU
Posts: 1,000
Threads: 253
Joined: Feb 2008
Doesn't work that way! You need to use MoveWindow just like you did with the OK button, but this time also use the main window dimensions to resize the edit box.
Posts: 32
Threads: 6
Joined: Aug 2005
More for me to learn. I will give it a try.
Posts: 32
Threads: 6
Joined: Aug 2005
I am having problems getting the main window dimensions. I am making up GetWinXY and some really strange things are happening or at least they are strange to me. I am going back to the Help Reference maybe I will understand a little more tomorrow.
Posts: 1,000
Threads: 253
Joined: Feb 2008
,case WM_SIZE
,int x y cx cy;GetWinXY(hDlg x y cx cy)
,MoveWindow id(3 hDlg) 0 20 cx-10 cy-55 1
The edit window is being move in relation to the main window hDlg...that's why the numbers are simply 0 and 20...instead of x and y+20...that would move the window as far as the main window is positioned on the screen within the main window...not what you want. But the cx and cy will give you the over all size. Do some subtracting to get it to size up just right and your good.
Jimmy Vig
Posts: 32
Threads: 6
Joined: Aug 2005
I think that this is the only way that it can be done but I do have a question. Why does the dialog call WM_SIZE before you change the size of the dialog? I put an out 1 so you can see that WM_SIZE is called before I move the dialog.
Function DialogWithMenu2
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str rea3
if(!ShowDialog("DialogWithMenu2" &DialogWithMenu2 &controls 0 0 0 0 0 0 0 "dialog.ico" "DialogWithMenu")) ret
;BEGIN DIALOG
;0 "" 0x10CF0A44 0x100 0 0 294 190 "Dialog"
;3 RichEdit20A 0x54233044 0x200 0 0 294 190 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2020009 "*" ""
ret
;messages
sel message
,case WM_INITDIALOG
,
,case WM_SIZE
,out "1"
,if(IsZoomed(win("Dialog" "#32770")))
,,mov 0 10 id(3 win("Dialog" "#32770"))
,if(!IsZoomed(win("Dialog" "#32770")))
,,mov 0 0 id(3 win("Dialog" "#32770"))
,RECT r; GetClientRect(hDlg &r)
,siz r.right r.bottom id(3 hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,;menu items:
,case 101 out "Open"
,case 103 out "Cut"
,case 104 out "Select All"
,case 105 out "Help"
,
,case IDOK
,case IDCANCEL
ret 1
;BEGIN MENU
;>&File
,;&Open : 101 0 0 Co
,;-
,;>&Recent
,,;Empty : 102 0 3
,,;<
,;<
;>&Edit
,;Cu&t : 103 0 0 Cx
,;-
,;Select &All : 104 0 0 Ca
,;<
;&Help : 105 0
;END MENU
Posts: 1,000
Threads: 253
Joined: Feb 2008
Function Resize_Rich
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str rea3
if(!ShowDialog("Resize_Rich" &Resize_Rich &controls 0 0 0 0 0 0 0 "dialog.ico" "Resize_Rich")) ret
;BEGIN DIALOG
;0 "" 0x10CF0A44 0x100 0 0 294 190 "Dialog"
;3 RichEdit20A 0x54233044 0x200 0 0 294 190 ""
;END DIALOG
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_SIZE
,int x y cx cy
,GetWinXY(hDlg x y cx cy)
,MoveWindow id(3 hDlg) 0 20 cx-10 cy-75 1
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,;menu items:
,case 101 out "Open"
,case 103 out "Cut"
,case 104 out "Select All"
,case 105 out "Help"
,
,case IDOK
,case IDCANCEL
ret 1
;BEGIN MENU
;>&File
,;&Open : 101 0 0 Co
,;-
,;>&Recent
,,;Empty : 102 0 3
,,;<
,;<
;>&Edit
,;Cu&t : 103 0 0 Cx
,;-
,;Select &All : 104 0 0 Ca
,;<
;&Help : 105 0
;END MENU
Posts: 32
Threads: 6
Joined: Aug 2005
That was my next question. You must be a mind reader.
|