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

Custome value User control

$
0
0
Author:Oleg
Posted: Mon Aug 31, 2015 3:26 pm (GMT+1)


Rinovo wrote:
Maybe someone have example of using PopUpControls?


Below is cutted source code.
( It is a TabPage, not a ModalDialog )

Code:

class TabAuxLogItem
   : public DG::TabPage
   , private DG::PopUpObserver
{
public:

   TabAuxLogItem( const DG::TabControl& tabControl, short tabItem=1 );
   ~TabAuxLogItem();

private:
   
   virtual void   PopUpChanged (const DG::PopUpChangeEvent& ev);

private:
   DG::PopUp         mi_prf;
};


Code:

TabAuxLogItem::TabAuxLogItem( const DG::TabControl& tabControl, short tabItem )
   : DG::TabPage( tabControl, tabItem, ACAPI_GetOwnResModule(), RTAB_AUXL_ITEM, ACAPI_GetOwnResModule() )
   , mi_prf( GetReference(), PRF )
{
   mi_prf.Attach( *this );
}

TabAuxLogItem::~TabAuxLogItem()
{
   mi_prf.Detach( *this );
}

void TabAuxLogItem::PopUpChanged (const DG::PopUpChangeEvent& ev)
{
   if ( ev.GetSource() == &mi_prf )
   {
      UID id = (UID)mi_prf.GetItemValue( mi_prf.GetSelectedItem() );
      UpdateProfileID( id );
   }
}


Viewing all articles
Browse latest Browse all 564

Trending Articles