X-Function, Tab-based Dialog
The following example shows how to create a tab-based X-Function dialog, as well as an event1 function to catch when tab is changed.
#include <event_utils.h>
Put the following code in TabDialog_event1.
//Codes for tab change if ( GETNE_ON_ACTIVE_TAB_CHANGE == nEventID ) { int nLastTabIndex = -1; if ( !trGetN.GetAttribute(STR_LAST_TAB_INDEX_ATTRIB, nLastTabIndex) ) nLastTabIndex = -1; printf("TabChanged: Old=%d, New=%d\n", nLastTabIndex, nRow); trGetN.SetAttribute(STR_LAST_TAB_INDEX_ATTRIB, nRow); }
Put the following code in TabDialog_before_execute.
if ( is_xf_startup(nGetNDialog, dwCntrl) ) { STATS_GETN_GROUPED_SUBNODES_AS_TABS; //Show the branches in tab GETN_ENABLE_TABCHANGE_EVENT(trGetN, true); //Enable event for tab change }