I have written a custom MapBasic application that implements some
custom toolbars. Sometimes, after I have been running the application
for some time, if I make these toolbars floating and minimize MapInfo
and then restore it back, the floating toolbars disappear altogether.
Any ideas why this is happening? Is this a known behavior? Are there
any workarounds?
I am using MapInfo 8.0
This could be something related. If my MapBasic program calls some
custom third party dialogs dialogs, after I exit the third party
dialog, my MapBasic dialog box just does not appear again. It is not to
be seen anywhere but I know it exists. In fact, there is proof that it
is lurking somewhere because I can see my MapInfo application blinking
in the Windows XP task tab as though something is controlling it,
although I cannot see it.
Regards
Rakesh Rao
Yes, indeed, I am using WinChangedHandler in my code to react to window
view change events. Does that affect toolbars? If so, what do I do to
not make cause it to go missing?
Thanks
Rakesh
> Rakesh Rao- Hide quoted text -- Show quoted text -
I'm not saying that WinChangedHandler WILL affect toolbars; I was
asking if you'be put any code in an event handler that might
specifically close the toolbars.
I asked this cos I was bitten by this; my users wanted it so that when
they were finished using my app, and closed it, they would be left in
basic native MI, to carry on working on other stuff. So my
WinClosedHandler has code to disappear all my toolbars and menus.
Trouble was that when ANY of my windows closed, such as when removing a
map layer, the handler fired and I lost my menus and toolbars.
It took me a while to track this down, as I'd originally thought that
WinClosedHandler applied to the whole app. So I learent to disable the
WinClosedHandler whenever I'm removing a layer:
Set Handler WinClosedHandler Off
' code to remove the layer
Set Handler WinClosedHandler On
So I asked if you might have a similar situation, say in a
ForegroundTaskSwitchHandler or WinFocusChangedHandler. I remember that
you WERE doing some work on handlers.
HTH
Terry
Thanks for the replies. I have managed a workaround (for now) by
re-creating the toolbar once I return back from my dialog box and after
all the screen redraws, layer remove/add are completed.
I did disable the WinChangedHandler before I called any layer
manipulation statements but it did not seem to help. My toolbars (as
well as the MapInfo standard toolbars)are not visible after I return.
If I go to Options->Toolbars, they are listed there as loaded,
available and with the the property set as Floating, but I cannot see
them anywhere on the screen. I have to edit a setting here and say "OK"
for them to be visible again. Any ideas? Have you encountered this
before?
Also, what is the way to determine what toolbars are currently loaded
and what their status is? On/Off Floating/Docked etc? Can you point me
in the direction of which MapBasic API function to use for ths?
Thanks in advance
Rakesh Rao
> > Rakesh Rao- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -
I didn't really suggest that you necessarily disable a handler routine, unless it has code to disappear your button pad or menu. I don't know why the button pads should disappear when you minimise
Have you tried:
Alter Button Pad "Button_Pad_Name" Show
To ensure your pad is displayed, right after the MI window returns from minimised?
--------------------------------------------------
You can use NumAllWindows( ) to return the number of windows owned by MapInfo, including special windows such as ButtonPads and the Info window.
--------------------------------------------------
Then in a loop (of window_num), up to num. of all windows, you can test each window with:
WindowInfo( window_num, attribute )
With WIN_INFO_TYPE as the above attribute param
until WIN_BUTTONPAD (A ButtonPad window) or WIN_TOOLBAR (The Toolbar window) is returned
And with WIN_INFO_NAME (1) String value: the name of the window.
WIN_INFO_OPEN (11) Logical value: TRUE if the window is open (used with special windows such as the Info window).
WIN_INFO_STATE (9) SmallInt value, to return:
WIN_STATE_NORMAL if at normal size,
WIN_STATE_MINIMIZED if minimized,
WIN_STATE_MAXIMIZED if maximized, as the attribute param
--------------------------------------------------
ButtonPadInfo( "Button_Pad_Name", BTNPAD_INFO_FLOATING) will tell you if the toolbar is floating or docked
--------------------------------------------------
This should help you along
Best wishes (oh, and Happy New Year - of struggle :-)
I would add that MapInfo Pro occasionally and unpredictably removes my
toolbars - seems to me that started with about version 6 or so. I've
just always chalked it up to a bit of buggy code that never gets fixed,
and live with it. It happens to me, maybe once a week.
That's all.
A bit pathetic how insignificant our contributions sometimes are -
hopefully I can contribute in areas other than coding experience.
Tom