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

    Dialog in script - Bitmap/ButtonBitmap possible?

    Scheduled Pinned Locked Moved SDK Help
    8 Posts 0 Posters 650 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 29/03/2010 at 06:34, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11.5 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      1)
      I have a script that makes a dialog,
      AddStaticText(0,BFH_SCALEFIT,0,0,"Set name:",0);
      AddEditText(0,BFH_CENTER,400,11);
      etc...

      Its posible to add a bitmap (a logo) or a bitmapbutton ? in the script an as easy way as that ?

      Another question (not related to previus topic) :
      Lets say a dialog have a add and remove button to remove or add items in a combobox or list, is that posible? and it automatically updates de list of items or we have to reload the dialog or something?...

      Thanks

      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 29/03/2010 at 12:06, xxxxxxxx wrote:

        As far as I know, there's no direct possibility to add a bitmap to a GeUserDialog in Coffee. But you could use the member function AddUserArea() to add a GeUserArea. The GeUserArea class offers the member function DrawBitmap(), which should do what you want.  
        Cheers,
        Jack

        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 29/03/2010 at 16:16, xxxxxxxx wrote:

          Any example please?

          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 30/03/2010 at 01:09, xxxxxxxx wrote:

            Sorry, I code in C++.
            No Coffee examples from me 😉 
            Anyone else?
            Cheers,
            Jack

            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 30/03/2010 at 08:38, xxxxxxxx wrote:

              Sorry if this question is too silly but:
              Is not posible to put c++ code inside a coffe script?

              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 30/03/2010 at 10:35, xxxxxxxx wrote:

                Of course not. Otherwise it would be called a C++ script.
                Cheers,
                Frank

                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 30/03/2010 at 14:02, xxxxxxxx wrote:

                  or maybe a Zoffee script.. 😄 sorry, couldn´t resist.

                  For examples, search the forum. You will have enough information and example code to create a user area.

                  Generally you should first have a look at basic programming operations in a procedural or object oriented language. It will save you time and head aches.

                  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 31/03/2010 at 05:12, xxxxxxxx wrote:

                    Yes, bitmaps or bitmap buttons are realized through user areas in dialogs.

                    Here is a simple example showing the basic use of user areas. It's just a pure red bitmap but you can use the BaseBitmap loading methods to load a custom bitmap.

                      
                    class MyUserArea : GeUserArea  
                    {  
                      public:  
                          MyUserArea(id,dialog);  
                          Init();  
                          GetUserWidth();  
                          GetUserHeight();  
                          Draw(x1,y1,x2,y2);  
                      
                      private:  
                          var bmp;  
                    }  
                      
                    MyUserArea::MyUserArea(id,dialog)  
                    {  
                      super(id,dialog);  
                    }  
                      
                    MyUserArea::Init()  
                    {  
                      var x = GetUserWidth();  
                      var y = GetUserHeight();  
                      
                      bmp = new(BaseBitmap,x,y);  
                      
                      bmp->SetPen(vector(1.0,0.0,0.0));  
                      
                      bmp->DrawRect(0,0,x-1,y-1);  
                    }  
                      
                    MyUserArea::GetUserWidth()  
                    {  
                      return 200;  
                    }  
                      
                    MyUserArea::GetUserHeight()  
                    {  
                      return 200;  
                    }  
                      
                    MyUserArea::Draw(x1,y1,x2,y2)  
                    {  
                      OffScreenOn();  
                      SetClippingRegion(x1,y1,x2,y2);  
                      
                      DrawBitmap(bmp,0,0,199,199,x1,y1,x2,y2,BMP_NORMAL);  
                    }  
                      
                      
                    class MyDialog : GeModalDialog  
                    {  
                      public:  
                          MyDialog();  
                          CreateLayout();  
                      
                      private:  
                          var ua;  
                    }  
                      
                    MyDialog::MyDialog()  
                    {  
                      super();  
                    }  
                      
                    MyDialog::CreateLayout()   
                    {  
                      SetTitle("My Dialog");  
                      
                      AddUserArea(5000,BFH_FIT|BFH_FIT,0,0);  
                      
                      ua = new(MyUserArea,5000,this);  
                      
                      return;  
                    }  
                      
                      
                    main(doc,op)  
                    {  
                      var d = new(MyDialog);  
                      d->Open(-1, -1);  
                    }  
                    

                    Please check the COFFEE documentation for explainations of the classes.

                    cheers,
                    Matthias

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