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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    GeUserArea Tool Tips

    Cinema 4D SDK
    python
    4
    5
    610
    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.
    • ?
      A Former User
      last edited by

      Hello,
      Is there a tool tip for GeUserArea similar to BitmapButtonCustomGui's BITMAPBUTTON_TOOLTIP? I'd like to use the same tool tip as the rest of the C4D interface.

      ToolTip.png

      Thank you!

      1 Reply Last reply Reply Quote 0
      • P
        PluginStudent
        last edited by

        You can react to the message BFM_GETCURSORINFO. See GUI and Interaction Messages Manual

        1 Reply Last reply Reply Quote 1
        • M
          m_adam
          last edited by

          Hi @blastframe as @PluginStudent pointed it, you should use BFM_GETCURSORINFO.

          Here an example.

          import c4d
          
          
          class UA(c4d.gui.GeUserArea):
              def __init__(self):
                  super(UA, self).__init__()
          
              def DrawMsg(self, x1, y1, x2, y2, msg) :
                  self.OffScreenOn()
                  self.SetClippingRegion(x1, y1, x2, y2)
                  self.DrawSetPen(c4d.Vector(1.0, 0, 0))
                  self.DrawRectangle(x1, y1, x2, y2)
          
              def GetMinSize(self):
                  return 200, 200
          
              def Message(self, msg, result):
                  if msg.GetId() == c4d.BFM_GETCURSORINFO:
                      result.SetId(c4d.BFM_GETCURSORINFO)
                      result.SetInt32(c4d.RESULT_CURSOR, c4d.MOUSE_POINT_HAND)
                      result.SetString(c4d.RESULT_BUBBLEHELP_TITLE, "Bubblehelp Title")
                      result.SetString(c4d.RESULT_BUBBLEHELP, "This is an example GeUserArea")
                      return True
                  
                  return c4d.gui.GeUserArea.Message(self, msg, result)
          
          
          class ExampleDialog(c4d.gui.GeDialog):
              ID_UA = 10001
          
              def CreateLayout(self):
                  self.SetTitle("UserArea Example")
          
                  self.ua = UA()
                  self.AddUserArea(self.ID_UA, c4d.BFH_LEFT | c4d.BFV_TOP)
                  self.AttachUserArea(self.ua, self.ID_UA)
                  return True
          
          def main():
              global dlg
              dlg = ExampleDialog()
              dlg.Open(c4d.DLG_TYPE_ASYNC, xpos=-2, ypos=-2, defaultw=400, defaulth=400)
          
          if __name__=='__main__':
              main()
          

          Cheers,
          Maxime.

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

          1 Reply Last reply Reply Quote 1
          • ?
            A Former User
            last edited by

            @m_adam & @PluginStudent Thank you both! This was exactly what I needed. This forum is so so helpful.

            1 Reply Last reply Reply Quote 1
            • J
              JohnSmith
              last edited by JohnSmith

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • First post
                Last post