static void ConfigureMacroButton( PMACRO_BUTTON button, PSI_CONTROL parent ) { PSI_CONTROL frame = LoadXMLFrameOver( parent, WIDE( "ConfigureMacroButton.isFrame" ) ); if( frame ) { int okay = 0; int done = 0; l.configuration_parent = parent; SetCommonButtons( frame, &done, &okay ); { PSI_CONTROL list; SetListboxIsTree( list = GetControl( frame, LIST_CONTROL_TYPES ), 1 ); ResetList( list ); FillControlsList( list, 1, TASK_PREFIX WIDE( "/control" ), NULL ); SetCommonButtonControls( frame ); SetButtonPushMethod( GetControl( frame, BUTTON_ADD_CONTROL ), AddButtonType, (uintptr_t)button ); //SetButtonPushMethod( GetControl( frame, BUTTON_EDIT_CONTROL ), AddButtonType, (uintptr_t)button ); { PSI_CONTROL list = GetControl( frame, LIST_MACRO_ELEMENTS ); if( list ) { PMACRO_ELEMENT pme = button->elements; while( pme ) { SetItemData( AddListItem( list, (pme->button->text&&pme->button->text[0])?pme->button->text:pme->button->pTypeName ), (uintptr_t)pme ); pme = NextThing( pme ); } } } SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_UP ), MoveElementUp, (uintptr_t)button ); SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_CLONE ), MoveElementClone, (uintptr_t)button ); SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_CLONE_ELEMENT ), CloneElement, (uintptr_t)button ); SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_DOWN ), MoveElementDown, (uintptr_t)button ); SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_CONFIGURE ), ConfigureElement, (uintptr_t)button ); SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_REMOVE ), MoveElementRemove, (uintptr_t)button ); } DisplayFrameOver( frame, parent ); CommonWait( frame ); if( okay ) { GetCommonButtonControls( frame ); } DestroyFrame( &frame ); } }
static uintptr_t OnConfigureControl( CONTROL_NAME )( uintptr_t psv, PSI_CONTROL parent_frame ) { PSLIDER_INFO info = (PSLIDER_INFO)psv; { PSI_CONTROL frame = NULL; int okay = 0; int done = 0; if( !frame ) { frame = LoadXMLFrame( "seek_slider_properties.frame" ); if( frame ) { TEXTCHAR buffer[256]; SetCommonButtonControls( frame ); SetCheckState( GetControl( frame, CHECKBOX_HORIZONTAL ), info->flags.bHorizontal ); SetCheckState( GetControl( frame, CHECKBOX_DRAGGING ), info->flags.bDragging ); SetControlText( GetControl( frame, EDIT_BACKGROUND_IMAGE ), info->image_name ); snprintf(buffer, sizeof(buffer), "%d", info->min); SetControlText( GetControl( frame, EDIT_MIN ), buffer ); snprintf(buffer, sizeof(buffer), "%d", info->max); SetControlText( GetControl( frame, EDIT_MAX ), buffer ); snprintf(buffer, sizeof(buffer), "%d", info->current); SetControlText( GetControl( frame, EDIT_CURRENT ), buffer ); SetCommonButtons( frame, &done, &okay ); DisplayFrameOver( frame, parent_frame ); CommonWait( frame ); if( okay ) { GetCommonButtonControls( frame ); info->font = InterShell_GetCurrentButtonFont(); if( info->font ) SetCommonFont( info->control, (*info->font ) ); info->color = GetColorFromWell( GetControl( frame, CLR_TEXT_COLOR ) ); info->backcolor = GetColorFromWell( GetControl( frame, CLR_BACKGROUND ) ); { GetControlText( GetControl( frame, EDIT_BACKGROUND_IMAGE ), buffer, sizeof( buffer ) ); if( info->image_name ) Release( info->image_name ); info->image_name = StrDup( buffer ); } // SetSliderColor( info->control, info->color ); // SetSliderkBackColor( info->control, info->backcolor ); info->flags.bHorizontal = GetCheckState( GetControl( frame, CHECKBOX_HORIZONTAL ) ); info->flags.bDragging = GetCheckState( GetControl( frame, CHECKBOX_DRAGGING ) ); GetControlText( GetControl( frame, EDIT_MIN), buffer, sizeof( buffer ) ); info->min = atoi(buffer); GetControlText( GetControl( frame, EDIT_MAX), buffer, sizeof( buffer ) ); info->max = atoi(buffer); GetControlText( GetControl( frame, EDIT_CURRENT), buffer, sizeof( buffer ) ); info->current = atoi(buffer); } DestroyFrame( &frame ); } } } return psv; }