Hi
In my application I want to enable all my tool buttons if my base map
(sTableName) is amongst those in the frontmost mapper, & otherwise
disable all my tool buttons except one. The problem is that the 'enable'
statement following all the disable statements wont work when the focus
changes, but only if i touch the custom button pad with my mouse. I have
checked & my program is making it into the appropriate part of the
routine when the appropriate condition is met. I've also found that if i
change the first 'disable' to an 'enable', all the buttons following are
enabled.
Many thanks in a advance
Ian Allan
'***************************
Sub WinFocusChangedHandler
'***************************
If WindowInfo(iFwin, WIN_INFO_TYPE) = WIN_MAPPER Then 'If i'm looking at
a mapper
For i = 1 To MapperInfo(FrontWindow(), MAPPER_INFO_LAYERS) 'loop to
check each map layer name
If LayerInfo(FrontWindow(), i, LAYER_INFO_NAME) = sTableName
Then 'sTableName variable contains the table name
Alter Button ID 201 Enable
Alter Button ID 202 Enable
Alter Button ID 203 Enable
Alter Button ID 204 Enable
Alter Button ID 205 Enable
Alter Button ID 206 Enable
Alter Button ID 207 Enable 'Launch new mapper
Exit For
Else
Alter Button ID 201 Disable 'If i change this to "enable"
202-207 are enabled as well
Alter Button ID 202 Disable
Alter Button ID 203 Disable
Alter Button ID 204 Disable
Alter Button ID 205 Disable
Alter Button ID 206 Disable
Alter Button ID 207 Enable 'Launch new mapper - this won't
work!!!
Exit For
End If
Next
End If
End Sub
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]