[Solved] [Calc] Multiple calls from a non-modal dialog box
Posted: Fri Jun 08, 2018 1:12 pm
Hello everyone,
I continue to discover with great pleasure the roland65 code snippet. Thanks again to Hubert Lambert who gave me the key to run this code as an independent file, without having to install a library. But since it's way above my level, there are things I do not understand and I'd like someone to explain to me here.
Recovering an old piece of code (not very evolved, but it's not the subject) I made a dialog box in the form of a numeric keypad to use it within Calc. Its specificity lies in that it contains a lot of controls (23) and not only two as in the example of roland65. It's a little more complicated to manage, especially because the controls do not only change places; they are also resized and their font still fits their height. The result, attached in this thread, seems to me already impressive whereas the computer that I use is an antediluvian machine, the fluidity of the resizing is more than correct.
This keypad is called by a button from Calc. Being non-modal, it is easy to fill several cells of the sheet with the numeric keypad, validating the values with the "Enter key" of the keypad, it being understood that only one cell must be selected at that time. For the moment, as long as the dialog box is open, it is impossible to click again the call button which is made unable all the time of display. This is done through the first line of the "ResizableNonModalNumericPad" macro. Comment or delete this line is interesting to note the effects: If we call a second time the macro "ResizableNonModalNumericPad" while the dialog box is displayed, it will restart just after closing.
My problem lies in the fact that I do not know the function that would allow me to know if the dialog box is open or not being displayed. In practice, I'll see a listener placed on a cell range that, when one of them is selected, call the dialog box. For the first call, there is obviously no problem; for the following, I need a function that signals NOT to redo a call...
And that's when we are a little amateur, who misses a lot to be enlightened...
I continue to discover with great pleasure the roland65 code snippet. Thanks again to Hubert Lambert who gave me the key to run this code as an independent file, without having to install a library. But since it's way above my level, there are things I do not understand and I'd like someone to explain to me here.
Recovering an old piece of code (not very evolved, but it's not the subject) I made a dialog box in the form of a numeric keypad to use it within Calc. Its specificity lies in that it contains a lot of controls (23) and not only two as in the example of roland65. It's a little more complicated to manage, especially because the controls do not only change places; they are also resized and their font still fits their height. The result, attached in this thread, seems to me already impressive whereas the computer that I use is an antediluvian machine, the fluidity of the resizing is more than correct.
This keypad is called by a button from Calc. Being non-modal, it is easy to fill several cells of the sheet with the numeric keypad, validating the values with the "Enter key" of the keypad, it being understood that only one cell must be selected at that time. For the moment, as long as the dialog box is open, it is impossible to click again the call button which is made unable all the time of display. This is done through the first line of the "ResizableNonModalNumericPad" macro. Comment or delete this line is interesting to note the effects: If we call a second time the macro "ResizableNonModalNumericPad" while the dialog box is displayed, it will restart just after closing.
My problem lies in the fact that I do not know the function that would allow me to know if the dialog box is open or not being displayed. In practice, I'll see a listener placed on a cell range that, when one of them is selected, call the dialog box. For the first call, there is obviously no problem; for the following, I need a function that signals NOT to redo a call...
And that's when we are a little amateur, who misses a lot to be enlightened...