Dear David:

Your Print menu item stays enabled because MapInfo performs certain hidden
"handlers" when you activate a mapper window.  That's the handler that
enables most buttons on the Main ButtonPad, and it also enables the print
menu item.   Unfortunately, it runs AFTER your custom handler, so your
Disable line executes, but gets overriden by MapInfo.  

So you'll need to replace the original menu item with another one that
doesn't get activated automatically.   Your new menu item will have to
call, if applicable, the standard print item.




At 01:54 P.M. 23/02/2000 -0000, you wrote:
>Hello, (again)
>With reference to my last e-mail I attach the MB I have written to 
>try to disable the print facility when the user is not within the 
>Layout or the Browser. Although this disables the print facility 
>within the mapper, and then enables it within the layout and 
>browser, if you then change back to the mapper the print facility is 
>again enabled.
>Thank you to Eric Frost for his input with this query, but my MB 
>may need tweaking to solve this problem.
>David Crowther
>GIS Consultant
>[EMAIL PROTECTED]
>___________________________
>
>Traffic Director for London
>0171 222 4545 (ext:143)
>
>include "mapbasic.def"
>include "menu.def"
>include "icons.def"
>
>Declare Sub Main
>Declare sub WinFocusChangedHandler
>sub main
>       Alter Menu Item 112 disable
>end sub
>
>sub WinFocuschangedHandler
>       Dim i_win_type As Smallint
>       i_win_type=Windowinfo(CommandInfo(CMD_INFO_WIN),WIN_INFO_TYPE)
>               IF i_win_type = 2 or 3 then
>                       Alter Menu Item id 112 Enable
>               ELSEIF i_win_type = 1 then
>                       Alter Menu Item id 112 disable
>               End IF
>end sub
>
>
>
>
> 
>
>
---------------------------------
     Ing. Juan Pufleau Correa
Geografía y Electrónica, SA de CV
      Aguascalientes, Mexico
---------------------------------
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to