05-07-2008, 01:17 PM
Hi Gintaras,
I am having trouble doing a couple things from a smart dialog.
First, when a button is chosen, I would like it to end the dialog (i.e. without having to select OK or Cancel) and return its id
I have tried:
Function CommentPasteCopyCancel
but this won't return the button id
I have also tried:
Function CommentPasteCopyCancel
but this returns 1 for OK rather than the button value.
The reason I am trying to do this is that I want to call a smart dialog from a smart dialog. I am not sure if this is possible.
Basically I have a button choice on a dialog and when it is chosen, there are 4 options for the user to do with this selection.
I would like those choices to popup in a new dialog like below. The reason (I believe it has to be smart dialog is that the buttons have bmp's on them) which I don't think you can do with a regular dialog). Also, the buttons here are pushlike when I want them to be single click leads to --> close dialog and return value
The dialog that called this menu up will hopefully then be able to receive the return value and then execute the proper code using the variables local to that dialog.
Thanks for any insight. If there is a better strategy altogether, I would be so grateful, if you could point me in the right direction.
Thanks again,
Stuart
Function CommentPasteCopyCancel
I am having trouble doing a couple things from a smart dialog.
First, when a button is chosen, I would like it to end the dialog (i.e. without having to select OK or Cancel) and return its id
I have tried:
Function CommentPasteCopyCancel
but this won't return the button id
I have also tried:
Function CommentPasteCopyCancel
but this returns 1 for OK rather than the button value.
The reason I am trying to do this is that I want to call a smart dialog from a smart dialog. I am not sure if this is possible.
Basically I have a button choice on a dialog and when it is chosen, there are 4 options for the user to do with this selection.
I would like those choices to popup in a new dialog like below. The reason (I believe it has to be smart dialog is that the buttons have bmp's on them) which I don't think you can do with a regular dialog). Also, the buttons here are pushlike when I want them to be single click leads to --> close dialog and return value
The dialog that called this menu up will hopefully then be able to receive the return value and then execute the proper code using the variables local to that dialog.
Thanks for any insight. If there is a better strategy altogether, I would be so grateful, if you could point me in the right direction.
Thanks again,
Stuart
Function CommentPasteCopyCancel
\Dialog_Editor
function# hDlg message wParam lParam Action
if(hDlg) goto messages
str controls = "3 4 5"
str c2Can c3Com c4Pas c5Cop b8But
if(!ShowDialog("CommentPasteCopyCancel" &CommentPasteCopyCancel &controls)) ret
;BEGIN DIALOG
;0 "" 0x800000C0 0x0 0 0 83 15 "CommentPastCopyCancel"
;3 Button 0x54030088 0x0 0 0 20 16 "Comment"
;4 Button 0x54031083 0x0 20 0 20 16 "Paste"
;5 Button 0x54031083 0x0 40 0 22 16 "Copy"
;6 Button 0x54031083 0x0 62 0 22 16 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030000 "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,int CopyInt=qm.LoadPictureFile("Copy.bmp" 0) ;;loads bmp, gif or jpg.
,SendMessage(id(5 hDlg) BM_SETIMAGE IMAGE_BITMAP CopyInt)
,int CommentInt=qm.LoadPictureFile("Comment.bmp" 0) ;;loads bmp, gif or jpg.
,SendMessage(id(3 hDlg) BM_SETIMAGE IMAGE_BITMAP CommentInt)
,int PasteInt=qm.LoadPictureFile("Paste.bmp" 0) ;;loads bmp, gif or jpg.
,SendMessage(id(4 hDlg) BM_SETIMAGE IMAGE_BITMAP PasteInt)
,int CancelInt=qm.LoadPictureFile("Cancel.bmp" 0) ;;loads bmp, gif or jpg.
,SendMessage(id(6 hDlg) BM_SETIMAGE IMAGE_BITMAP CancelInt)
,ret 1
,case WM_DESTROY
,DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg