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.
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() } } |