static void CPROC AddButtonType( uintptr_t psv, PSI_CONTROL control ) { PMACRO_BUTTON button = (PMACRO_BUTTON)psv; PSI_CONTROL list = GetNearControl( control, LIST_CONTROL_TYPES ); PLISTITEM pli = GetSelectedItem( list ); TEXTCHAR *name = (TEXTCHAR*)GetItemData( pli ); if( pli && button ) { PMACRO_ELEMENT pme = New( MACRO_ELEMENT ); pme->me = NULL; pme->next = NULL; pme->button = CreateInvisibleControl( configure_key_dispatch.frame, name ); if( pme->button ) { pme->button->container_button = button->button; //lprintf( WIDE( "Setting container of %p to %p" ), pme->button, button->button ); LinkLast( button->elements, PMACRO_ELEMENT, pme ); { // fake this lock... // global code allows this to continue... which means loss of current_configuration datablock. // faking this starts a configuration thread. //g.flags.bIgnoreKeys = 0; ConfigureKeyExx( configure_key_dispatch.frame, pme->button, TRUE, FALSE ); //g.flags.bIgnoreKeys = 1; // I'm still editing this mode... } FillList( GetNearControl( control, LIST_MACRO_ELEMENTS ), button ); } else DebugBreak(); } }
static void CPROC MoveElementClone( uintptr_t psv, PSI_CONTROL control ) { PMACRO_BUTTON button = (PMACRO_BUTTON)psv; PMENU_BUTTON pmbNew = GetCloneButton( NULL, 0, 0, TRUE ); if( pmbNew ) { PMACRO_ELEMENT pme = New( MACRO_ELEMENT ); pme->me = NULL; pme->next = NULL; pme->button = pmbNew; LinkLast( button->elements, PMACRO_ELEMENT, pme ); FillList( GetNearControl( control, LIST_MACRO_ELEMENTS ), button ); } }
static uintptr_t CPROC LoadMacroElements( uintptr_t psv, arg_list args ) { PMACRO_BUTTON pmb = (PMACRO_BUTTON)psv; PARAM( args, TEXTCHAR *, name ); PMACRO_ELEMENT element = New( MACRO_ELEMENT ); PPAGE_DATA page = InterShell_GetCurrentLoadingPage(); PCanvasData canvas = InterShell_GetCurrentLoadingCanvas(); if( !pmb ) if( l.finished_startup ) { if( !l.shutdown.button ) l.shutdown.button = CreateButton( canvas, page ); pmb = &l.shutdown; } else { if( !l.startup.button ) l.startup.button = CreateButton( canvas, page ); pmb = &l.startup; } element->me = NULL; element->next = NULL; element->button = CreateInvisibleControl( canvas , name ); if( element->button ) { //lprintf( WIDE( "Setting container of %p to %p" ), element->button, pmb->button ); element->button->container_button = pmb->button; LinkLast( pmb->elements, PMACRO_ELEMENT, element ); if( !BeginSubConfigurationEx( element->button, name, (pmb==&l.startup) ?WIDE( "Startup macro element done" ) :(pmb==&l.shutdown) ?WIDE( "Shutdown macro element done" ) :WIDE( "macro element done" ) ) ) { PublicAddCommonButtonConfig( element->button ); } //SetCurrentLoadingButton( element->button ); //lprintf( WIDE( "Resulting with psv %08x" ), element->button->psvUser ); return element->button->psvUser; } else lprintf( "Failed to create a %s", name ); return 0; }