Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dialog: suppress case (error check) when button pressed
#1
I have a very simple dialogbox with an inputfield and button.
When the inputfield loses focus and if it is empty, it changes the static text above the inputfield to "empty"

I also have a button called "suppress", I want to keep the static text unchanged when the button "suppress" is pressed.
(the case N_KILLFOCUS<<16|3 must not be executed.)

DIALOG:
Function suppress
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str e3
if(!ShowDialog("suppress" &suppress &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 170 74 "Dialog"
;3 Edit 0x54030080 0x200 8 44 96 14 ""
;4 Button 0x54032000 0x0 118 44 48 14 "suppress"
;5 Static 0x54000000 0x0 8 30 48 10 "Inputfield 1:"
;END DIALOG
;DIALOG EDITOR: "" 0x2030604 "" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case EN_KILLFOCUS<<16|3
,,suppress_error_check(hDlg)
,case 4
,,out
,,out "Button pressed, static text above input field NOT changed"    
,case IDOK
,case IDCANCEL
ret 1

FUNCTION
Function suppress_error_check
Code:
Copy      Help
function int'hDlg
__Font-- f
str gettxt.getwintext(id(3 hDlg))
if(empty(gettxt))
,f.Create("" 8 0)
,f.SetDialogFontColor(hDlg 0x0000FF "5")                
,SetDlgItemText(hDlg 5 "Empty!")
#2
case EN_KILLFOCUS cannot be suppressed.
#3
Ok, thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)