Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disable menu items with ShowMenu and with dialog menu bar
#1
Question 1
When I try to trigger a MessageBox on de-activation of the dialog-window, I get an '(RT)' error.
(see code below)
The error is almost the same as described here:
Dialog Box
I implemented the solution from that topic and it works, but when I try to do it on the de-activation of an dialogbox I get an RT error.


Question 2
Is there a way to gray-out and disable an menu item? (ghost an item)
Example of grayed out menu item.

I want to disable the left edit-field (see code below) called 'checked' when the checkbox is unchecked.
With 'disable' I mean, the object is grayed out (ghosted) but still visible and can't be activated when clicked on.

I found something here but I couldn't get the syntax right.
http://msdn.microsoft.com/en-us/library/aa931329.aspx
Disable File Menu Item

Question 3
Is it possible to catch/get the interface-object that loses it's focus.
For example, If I go from the left editfield to the right editfield I a want to get ID and contents of the object (left editfield) that loses it's focus.

I tried to implement the 'SETFOCUS' / 'KILLFOCUS' from MSDN, but I couldn't get the syntax right.
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

The code:

Function test_dlg
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg)    
,goto messages


;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Static 0x54000000 0x0 92 10 48 12 "Unchecked"
;4 Static 0x54000000 0x0 6 10 48 12 "Checked"
;5 Edit 0x54030080 0x200 6 30 46 14 "checked"
;6 Edit 0x54030080 0x200 92 30 48 14 "unchecked"
;7 Button 0x54012003 0x0 70 62 48 12 "Check"
;END DIALOG
;DIALOG EDITOR: "" 0x2030307 "" "" ""

ret

;messages
sel message
,case WM_INITDIALOG act id(6 hDlg)    
,case WM_DESTROY    
,case WM_ACTIVATE  goto messages2
,case WM_COMMAND goto messages2
,

ret
;messages2
sel wParam    
,case WA_INACTIVE
,,mes("Disabled!")
,case 7
,,int checked=but(7 hDlg)
,,,if(checked=1)act id(5 hDlg)
,,,if(checked=0)act id(6 hDlg)        
,case IDOK
,case IDCANCEL
ret 1



Macro tst_dlg
Code:
Copy      Help
str controls = "5 6 7"
str e5che e6unc c7Che
if(!ShowDialog("test_dlg" &test_dlg &controls)) ret


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)