Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Adjust GeUserArea as window is resized [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    12 Posts 0 Posters 897 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      On 29/06/2015 at 04:02, xxxxxxxx wrote:

      Hi Chris,

      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.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 07/07/2015 at 14:12, xxxxxxxx wrote:

        Andreas,

        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?

        Thanks,

        Chris

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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?

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 13/07/2015 at 09:11, xxxxxxxx wrote:

            Hi Chris,

            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.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 10/08/2015 at 00:28, xxxxxxxx wrote:

              Andreas,

              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?

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                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'
                
                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  On 20/09/2015 at 14:08, xxxxxxxx wrote:

                  Niklas,

                  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.

                  Thanks,

                  Chris

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    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' ?

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      On 07/01/2016 at 09:11, xxxxxxxx wrote:

                      Hi,

                      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?

                      1 Reply Last reply Reply Quote 0
                      • H Offline
                        Helper
                        last edited by

                        On 09/01/2016 at 02:27, xxxxxxxx wrote:

                        Andreas,

                        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.

                        Thanks

                        1 Reply Last reply Reply Quote 0
                        • H Offline
                          Helper
                          last edited by

                          On 11/01/2016 at 00:37, xxxxxxxx wrote:

                          Hi,
                          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.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post