Quantcast
Channel: ArchiCAD-Talk - Developer Forum
Viewing all articles
Browse latest Browse all 564

User control UC257

$
0
0
Author:Oleg
Posted: Wed Sep 09, 2015 6:02 pm (GMT+1)


Actually It is wrong to mix C++ DG classes and plain C DG module functions.

Below is cutted source code of UC257 usage as a Pen control.
Note the ACAPI_Interface ( APIIo_SetUserControlCallbackID ) function, API_UCCallbackType struct, API_UserControlType enum. It is for AC standard lists like Pen, LineType etc. Full

More:
Look the DG_Test example of AC19 API
BuildingMaterialObserver class in BuildingMaterialDialog.hpp and cpp.
I dont study this example but I think it will basically same in more details.

Code:

...
#include "UCModule.hpp"
...

class TabWallAttrs
   : public DG::TabPage
   , private DG::UserControlObserver
{
public:

...

private:

   virtual void   UserControlChanged (const DG::UserControlChangeEvent& ev);

private:

   UC::UC257      mi_pcont;
};



Code:

TabWallAttrs::TabWallAttrs( ... )
   , mi_pconte( GetReference(), PCONTE )
{
   mi_pcont.Attach( *this );

   API_UCCallbackType ct = { APIUserControlType_Pen, GetId(), mi_pcont.GetId() };
   ACAPI_Interface ( APIIo_SetUserControlCallbackID, &ct, NULL );
}

TabWallAttrs::~TabWallAttrs()
{
   mi_pcont.Detach( *this );
}

void TabWallAttrs::UserControlChanged (const DG::UserControlChangeEvent& ev)
{
   if ( ev.GetSource() == &mi_pcont )
   {
   //   mi_pcont.GetValue()
   }
}



Viewing all articles
Browse latest Browse all 564

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>