Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dialog: how to change edit to static?
#5
I write one simple example: I change the styles from BS_AUTOCHECKBOX to BS_AUTORADIOBUTTON and dialog code as below, if under condition i=0 and i=1 , one dialog can "input" and the other can not "input", they will reach my goal. Big Grin
But I use the same method to your "Shareware macros" for SM_about, it does not work.... Sad , I don't know the root cause...

Function Dialog2
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3 4"
str c3Che e4

if(!ShowDialog("Dialog2" &Dialog2 &controls)) ret

str sm_dialog_definition=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 156 "Dialog"
;3 Button 0x54012009 0x0 34 34 48 10 "Check"
;4 Edit 0x54030080 0x200 34 54 96 14 ""
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030605 "" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDCANCEL
,case 3
,int i=0
,if i=0
,,SendMessage id(4 hDlg) EM_SETREADONLY !but(3 hDlg) 0
,else
,,out "1"
,,SendMessage id(4 hDlg) EM_SETREADONLY but(3 hDlg) 0
ret 1

and

Function Dialog2
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3 4"
str c3Che e4

if(!ShowDialog("Dialog2" &Dialog2 &controls)) ret

str sm_dialog_definition=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 156 "Dialog"
;3 Button 0x54012009 0x0 34 34 48 10 "Check"
;4 Edit 0x54030080 0x200 34 54 96 14 ""
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030605 "" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDCANCEL
,case 3
,int i=1
,if i=0
,,SendMessage id(4 hDlg) EM_SETREADONLY !but(3 hDlg) 0
,else
,,out "1"
,,SendMessage id(4 hDlg) EM_SETREADONLY but(3 hDlg) 0
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)