Adjust GeUserArea as window is resized [SOLVED]
On 20/06/2015 at 13:40, xxxxxxxx wrote:
As users adjust the size of a dialog window, I need to resize the GeUserArea in the layout.
What message can I use to know if a user is resizing, and/or has resized a dialog window.
And how can I get the new sizes of the window, hopefully, while they are doing it, to adjust the GeUserArea?
On 29/06/2015 at 04:02, xxxxxxxx wrote:
actually it is pretty straight forward, as you get the new size as parameters to the DrawMsg() function.
See for example the Py-MemoryViewer.pyp from the SDK examples.
Furthermore you could also implement the Sized() method, if you need to update data upon resizing.
On 07/07/2015 at 14:12, xxxxxxxx wrote:
Getting the new size from the 'DrawMsg()' function works fine.
Could you explain how to best use the 'Sized()' method you mentioned.
How and when to use it?
Also, is there any direct way (message to intercept) to know if a user is docking or un-docking a dialog, or resizing a dialog?
On 13/07/2015 at 03:51, xxxxxxxx wrote:
I got the 'Sized()' working, but how about the docking, or un-docking a dialog message?
Or, is there any way to test if a dialog has the focus?
On 13/07/2015 at 09:11, xxxxxxxx wrote:
I'm not aware of any method to detect (un-)docking of a dialog.
Focus changes can be detected with messages BFM_GOTFOCUS and BFM_LOSTFOCUS.
On 10/08/2015 at 00:28, xxxxxxxx wrote:
I'm trying to detect when a dialog window gets or loses the focus.
I'm doing the following
def Message(self, msg, result) : if msg[c4d.BFM_GOTFOCUS]: print 'got' if msg[c4d.BFM_LOSTFOCUS]: print 'lost'
When I switch between dialogs, only the 'got' prints.
Why doesn't 'lost' print?
On 10/08/2015 at 00:53, xxxxxxxx wrote:
It should be
if msg.GetId() == c4d.BFM_GOTFOCUS: print 'got' elif msg.GetId() == c4d.BFM_LOSTFOCUS: print 'lost'
On 20/09/2015 at 14:08, xxxxxxxx wrote:
In my plugin, the non-modal main plugin dialog opens a non-modal sub-dialog. In the sub-dialog I've put the following:
def Message(self, msg, result) : if msg.GetId() == c4d.BFM_GOTFOCUS: print 'got' if msg.GetId() == c4d.BFM_LOSTFOCUS: print 'lost'
When the sub-dialog opens 'got' is printed. Correct.
When the sub-dialog loses the focus (main plugin dialog, or C4D window is clicked) both 'lost' and 'got' are printed. Seems wrong?
When the sub-dialog is closed 'lost' is printed. Correct
But, when I click back and forth between the C4D, or the main plugin dialog, and the sub dialog, nothing happens. This is a problem. I need to know when the sub-dialog gets the focus to update some things.
Shouldn't it print 'got' when you click back and forth between the dialogs.
On 06/01/2016 at 17:01, xxxxxxxx wrote:
Does anyone have any ideas on this?
Why doesn't the sub-dialog seem to get the 'BFM_GOTFOCUS' ?
On 07/01/2016 at 09:11, xxxxxxxx wrote:
just to be sure, we are not talking about the SubDialog class here, right? As the SubDialog concept is currently not available via Python, I assume you are talking about a second GeDialog window.
I did some tests here with a second dialog window being opened on button press in the first one. Both messages work as expected.
Can you perhaps post some more code to demonstrate your issue?
On 09/01/2016 at 02:27, xxxxxxxx wrote:
Yes, I am talking about a second GeDialog window.
Thanks for checking into it.
After further testing, it appears the problem I'm having is due to the 'c4d.BFM_LOSTFOCUS' message not always coming through when I click from the second dialog to either the first dialog or to C4D. When that happens, there is no 'c4d.BFM_GOTFOCUS' message when clicking back into the second dialog. I'm using the 'c4d.BFM_GOTFOCUS' to update some things after changes in C4D.
Most of the time it works though.
On 11/01/2016 at 00:37, xxxxxxxx wrote:
can you give me some code snippet and instructions how to reproduce the issue? As I said, with my tests. I have not seen any irregularities.