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
    • Register
    • Login

    What element did I clicked on?

    Scheduled Pinned Locked Moved SDK Help
    9 Posts 0 Posters 722 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 04/03/2005 at 07:08, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.x 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      I finaly got the scrolling list of items working (more or less 😉
      I populated it with text, using AddStaticText.
      Now, how do I get to know in what element the user clicked?
      Until now I wrote this:

        
      PluginDialog::Message(msg)  
      {var dev,chn;  
        
      dev = msg->GetData(BFM_INPUT_DEVICE);  
      if (dev == BFM_INPUT_MOUSE)  
      {  
         chn = msg->GetData(BFM_INPUT_CHANNEL);  
        
         if (chn == BFM_INPUT_MOUSELEFT)  
          {  
              ***WHAT GOES HERE???***  
          }  
         }  
         return super::Message(msg);  
      }  
      

      Each static item has its own ID. Is there any way to know what was the clicked static text item?

      Rui Batista

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 04/03/2005 at 07:32, xxxxxxxx wrote:

        You can use GeDialog::GetItemHeight() etc. to know where each fieldis. Then you have to check the X/Y position of the event (look in the container) against this for each ID.

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 04/03/2005 at 07:35, xxxxxxxx wrote:

          My text is inside a Scroll group. What if I have the scroll slider on another position?

          Rui Batista

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 04/03/2005 at 07:37, xxxxxxxx wrote:

            GetVisibleArea()

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

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 04/03/2005 at 07:58, xxxxxxxx wrote:

              Thank you Mikael. Will give it a try 🙂

              Rui Batista

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

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 04/03/2005 at 10:27, xxxxxxxx wrote:

                Ok, I have this:

                  
                GetVisibleArea(GROUP_SCROLL,&x;,&y;,&w;,&h;);  
                h=GetItemHeight(5000);  
                click=msg->GetData(BFM_INPUT_Y);   
                selected=ceil((y/h)-(click/h));  
                

                Item with ID 5000 is the Static Text item. They are all the same size. Must I add it any other value? Like, the spacing between group elements?
                How can I identify which one was clicked?
                Also, when I resize the window down and the scroll group shows a slider, it gets tougher to click on item as the cursor tends to change into a hand, to scroll. Can that be turned off?

                Rui Batista

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

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 04/03/2005 at 10:32, xxxxxxxx wrote:

                  When I said etc. I meant the other GetElement...() functions described in the documentation. For example GetElementX().
                  You might be able to avoid the cursor change by using SetMousePointer(). I haven't tried, so perhaps it doesn't work or flickers. In that case the answer is no.

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

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    On 04/03/2005 at 10:41, xxxxxxxx wrote:

                    "When I said etc. I meant the other GetElement...() functions described in the documentation. For example GetElementX()."

                    Now you got me, Mikael. I can't find and GetElement... in the docs. I only have Static Text items inside the scroll group. And they are all simple filenames, so they are short (single line strings).

                    Rui Batista

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

                      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                      On 04/03/2005 at 11:12, xxxxxxxx wrote:

                      When I said Element, I meant Item... 🙂
                      Have a look in the docs for GeBaseDialog. You'll find lots of useful functions in there.

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