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

    build a customgui for LONG

    SDK Help
    0
    3
    275
    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
      Helper
      last edited by

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

      On 15/09/2004 at 07:20, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.207 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      I want to make a customgui for LONG values, kind of progress bar I can just set by the LONG value. I sucessfully designed a customgui together with a custom data type before, but here I have problems.
      First of all: Is it possible to make a customgui without custom data type? The data would only be a LONG value, so it would be nice to use LONG.
      Take a look at this code ( just displaying a number for testing, only the cpp part ). My problem: iCustomGui::SetData is never called.
       
      class grProgressBarGui : public iCustomGui
      grProgressBarGui::grProgressBarGui( const BaseContainer &settings, CUSTOMGUIPLUGIN *plugin ) :
              iCustomGui( settings, plugin ) {
       
      }
      LONG grProgressBarGui::GetCustomGuiWidth( ){
       return 100;
      }
      LONG grProgressBarGui::GetCustomGuiHeight( ) {
       return 100;
      }
      void grProgressBarGui::CustomGuiRedraw( ) {

      }
      Bool grProgressBarGui::SetDefaultForResEdit( ) {
       return TRUE;
      }
      Bool grProgressBarGui::SetData( const TriState<GeData>& tristate ) {
       m_progress = tristate.GetValue().GetLong();
       return InitValues();
      }
      void grProgressBarGui::LayoutModeChanged( ) {
      }
         
      Bool grProgressBarGui::SupportLayoutSwitch( ) {
       return TRUE;
      }
      Bool grProgressBarGui::CreateLayout( )
      {
       AddEditNumber( 25000, 0 );
       
       return TRUE;
      }
      Bool grProgressBarGui::Command( LONG id, const BaseContainer &msg )
      {
       
       return TRUE;
      }
      Bool grProgressBarGui::InitValues( void ) {

      SetLong( 25000, m_progress );
       return TRUE;
      }
      TriState<GeData> grProgressBarGui::GetData( ) {
       return GeData( m_progress );
      }
       
      class grProgressBarDialog : public CustomGuiData
      #include "grProgressBarDialog.h"
      #include "grProgressBarGui.h"
      #define D_symbol "PROGRESSBAR"
      static LONG restypetable[] = { DA_LONG };
      grProgressBarDialog::grProgressBarDialog( ) {
       m_properties.type = CUSTOMTYPE_END;
       m_properties.id = 0;
       m_properties.ident = NULL;
      }
      grProgressBarDialog::~grProgressBarDialog( ) {

      }
      LONG grProgressBarDialog::GetId( ) {
       return 1000009;
      }
      CDialog* grProgressBarDialog::Alloc( const BaseContainer& settings ) {

      grProgressBarGui* dlg = gNew grProgressBarGui( settings, GetPlugin() );
         
       if ( !dlg ) return NULL;
       
          CDialog *cdlg = dlg->Get();
          if ( !cdlg ) return NULL;
         
          return cdlg;
       
      }
      void grProgressBarDialog::Free( CDialog* dlg, void* userdata ) {
       if ( !dlg || !userdata ) return;
          grProgressBarGui* sub = static_cast<grProgressBarGui*>( userdata );
          gDelete( sub );
      }
      CHAR* grProgressBarDialog::GetResourceSym() {
       return D_symbol;
      }
      CustomProperty* grProgressBarDialog::GetProperties( ) {
       return &m_properties;
      }
      LONG grProgressBarDialog::GetResourceDataType( LONG*& table ) {
       table = restypetable;
       return sizeof( restypetable ) / sizeof( LONG );
      }

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

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

        On 15/09/2004 at 07:22, xxxxxxxx wrote:

        ah, and I include it in my dialog by
        PROGRESSBAR IDC_PROGRESS_WIZARD { }
        and call
        SetLong( IDC_PROGRESS_WIZARD, 50 );
        to set the value...but this call never reaches SetData

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

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

          On 21/09/2004 at 12:41, xxxxxxxx wrote:

          Most of your code looks right. I think the problem is that the dialog cannot use SetLong() with custom gui elements, only with built-in edit boxes and sliders. In a description you would be able to use your gui with a long. A workaround is to use FindCustomGui() and BaseCustomGui::SetData().

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