Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am making mapinfo addon and I am having problem with close action of buttonpads. How to add close action to dialog and buttonpad so that we can execute certain action on close of buttonpad or dialog?

share|improve this question
    
More info would help. What application are you customising? What language? –  Jamie Oct 11 '11 at 3:14
    
@Jamie I did an edit –  kinkajou Oct 11 '11 at 4:51

1 Answer 1

up vote 1 down vote accepted

A dialog and a buttonpad are two quite different things in the MapBasic language.

You would always know when a dialog has been closed. That's when the code after the Dialog statement is executed. So for a dialog you could do you "house cleaning" after the Dialog statement.

You could also add handlers to your OKButton and your CancelButton. These handlers would be called when the user "activates" these buttons and so you would also know that the user either okay'ed or cancel'ed the dialog. However these handlers will not be called if the user dismisses the dialog thru the cross in the upper right corner or thru the Esc key.

A buttonpad is a bit different. The user can't really close this "window" - he can only hide it. So when the user clicks the small cross on the buttonpad, the buttonpad still exists - it's just hidden. If you rightclick any of the other buttonpads, you can see a list of buttonpads, and yours would also be there.

You could add a specific Close button to the buttonpad, either as the first or the last button on the buttonpad. Then you could make this button call your "CloseButtonPad" handler and so you would know when the user wants the buttonpad closed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.