static void CallMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece ) { call_chain *chain; call_window *call = WndCall( wnd ); piece=piece; chain = GetCallChain( &call->tb, row ); switch( id ) { case MENU_INITIALIZE: if( chain == NULL ) { WndMenuGrayAll( wnd ); } else { WndMenuEnableAll( wnd ); WndMenuEnable( wnd, MENU_CALL_EXECUTE_TO_RETURN, ( row != 0 ) ); WndMenuEnable( wnd, MENU_CALL_SOURCE, ( chain->source_line != NULL ) ); } break; case MENU_CALL_BREAK: DlgBreak( row == 0 ? chain->lc.execution : FindNextIns( chain->lc.execution ) ); break; case MENU_CALL_SOURCE: WndSrcInspect( chain->lc.execution ); break; case MENU_CALL_UNWIND: UnWindToFrame( chain, row, CallNumRows( wnd ) ); break; case MENU_CALL_ASSEMBLY: WndAsmInspect( chain->lc.execution ); break; case MENU_CALL_EXECUTE_TO_RETURN: GoToAddr( FindNextIns( chain->lc.execution ) ); break; } }
static void FuncMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece ) { address addr; func_window *func = WndFunc( wnd ); piece=piece; addr = ( row == WND_NO_ROW ) ? NilAddr : NameListAddr( NameList( func ), row ); switch( id ) { case MENU_INITIALIZE: if( IS_NIL_ADDR( addr ) ) { WndMenuGrayAll( wnd ); } else { WndMenuEnableAll( wnd ); WndMenuEnable( wnd, MENU_FUNCTIONS_SOURCE, HasLineInfo( addr ) ); } WndMenuEnable( wnd, MENU_FUNCTIONS_D2_ONLY, TRUE ); WndMenuCheck( wnd, MENU_FUNCTIONS_D2_ONLY, func->d2_only ); break; case MENU_FUNCTIONS_SOURCE: WndSrcInspect( addr ); break; case MENU_FUNCTIONS_ASSEMBLY: WndAsmInspect( addr ); break; case MENU_FUNCTIONS_BREAK: DlgBreak( addr ); break; case MENU_FUNCTIONS_D2_ONLY: func->d2_only = !func->d2_only; FuncNewOptions( wnd ); break; } }
extern void GlobMenuItem( a_window *wnd, unsigned id, int row, int piece ) { glob_window *glob = WndGlob( wnd ); address addr; char buff[TXT_LEN]; piece=piece; addr = NameListAddr( NameList( glob ), row ); switch( id ) { case MENU_INITIALIZE: if( IS_NIL_ADDR( addr ) ) { WndMenuGrayAll( wnd ); } else { WndMenuEnableAll( wnd ); } WndMenuEnable( wnd, MENU_GLOB_D2_ONLY, TRUE ); WndMenuCheck( wnd, MENU_GLOB_D2_ONLY, glob->d2_only ); break; case MENU_GLOB_INSPECT_MEMORY: WndAddrInspect( addr ); break; case MENU_GLOB_WATCH: NameListName( NameList( glob ), row, buff, SN_QUALIFIED ); WndVarInspect( buff ); break; case MENU_GLOB_D2_ONLY: glob->d2_only = !glob->d2_only; GlobInit( wnd ); break; default: break; } }
static void ImgMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece ) { image_entry *img; char *new_name; char *old_name; piece=piece; img = ImgGetImage( row ); switch( id ) { case MENU_INITIALIZE: WndMenuGrayAll( wnd ); if( img != NULL ) { if( img->dip_handle == NO_MOD ) { WndMenuEnable( wnd, MENU_IMAGE_ADD_SYMBOLS, TRUE ); } else { WndMenuEnableAll( wnd ); } } break; case MENU_IMAGE_ADD_SYMBOLS: // nyi - change sym_file if( img->deferred_symbols ) { ReLoadSymInfo( img ); } else { new_name = DupStr( ImgSymName( img, TRUE ) ); if( !SymBrowse( &new_name ) ) { _Free( new_name ); } else { UnLoadSymInfo( img, TRUE ); old_name = img->sym_name; img->sym_name = new_name; if( ReLoadSymInfo( img ) ) { _Free( old_name ); } else { img->sym_name = old_name; _Free( new_name ); } } } ImgInit( wnd ); break; case MENU_IMAGE_DEL_SYMBOLS: UnLoadSymInfo( img, TRUE ); ImgInit( wnd ); break; case MENU_IMAGE_SHOW_FUNCTIONS: WndGblFuncInspect( img->dip_handle ); break; case MENU_IMAGE_SHOW_MODULES: WndModListInspect( img->dip_handle ); break; case MENU_IMAGE_SHOW_GLOBALS: WndGblVarInspect( img->dip_handle ); break; } }
static void BrkMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece ) { brkp *bp; piece=piece; if( row < 0 ) { bp = NULL; } else { bp = BrkGetBP( row ); } switch( id ) { case MENU_INITIALIZE: if( bp != NULL ) { WndMenuEnableAll( wnd ); WndMenuEnable( wnd, MENU_BREAK_ENABLE, !bp->status.b.active ); WndMenuEnable( wnd, MENU_BREAK_DISABLE, bp->status.b.active ); WndMenuEnable( wnd, MENU_BREAK_SOURCE, bp != NULL && IS_BP_EXECUTE( bp->th ) ); WndMenuEnable( wnd, MENU_BREAK_ASSEMBLY, bp != NULL && IS_BP_EXECUTE( bp->th ) ); } else { WndMenuGrayAll( wnd ); } WndMenuEnable( wnd, MENU_BREAK_CREATE_NEW, true ); break; case MENU_BREAK_ENABLE: ActPoint( bp, true ); break; case MENU_BREAK_DISABLE: ActPoint( bp, false ); break; case MENU_BREAK_CREATE_NEW: if( DlgBreak( NilAddr ) ) WndScrollBottom( wnd ); break; case MENU_BREAK_CLEAR: RemoveBreak( bp->loc.addr ); break; case MENU_BREAK_MODIFY: DlgBreak( bp->loc.addr ); break; case MENU_BREAK_SOURCE: WndSrcInspect( bp->loc.addr ); break; case MENU_BREAK_ASSEMBLY: WndAsmInspect( bp->loc.addr ); break; } }
extern void W4MenuItem( a_window *wnd, unsigned id, int row, int piece ) { row=row;piece=piece; switch( id ) { case MENU_INITIALIZE: WndMenuGrayAll( wnd ); if( row < 0 ) break; WndMenuEnableAll( wnd ); break; case MENU_W2_SAY: Say2( "Say", WndPopItem( wnd ) ); break; case MENU_W2_OPEN1: W1Open(); break; case MENU_W2_TOP: WndScrollAbs( wnd, 0 ); break; } }
STATIC void sampleMenuItem( a_window * wnd, gui_ctl_id id, int row, int piece ) /*****************************************************************************/ { sio_data * curr_sio; int sort_type; piece=piece; curr_sio = WndExtra( wnd ); row += STATUS_ROW + 1; switch( id ) { case MENU_INITIALIZE: if( row <= STATUS_ROW ) { WndMenuGrayAll( wnd ); if( row < 0 || row-1 >= curr_sio->level_open ) break; WndMenuEnable( wnd, MENU_SAMP_ZOOM_IN, true ); break; } WndMenuEnableAll( wnd ); WndMenuCheck( wnd, MENU_SAMP_GATHER, GetCurrentGather( curr_sio ) ); WndMenuCheck( wnd, MENU_SAMP_BAR_MAX_TIME, GetCurrentMaxBar( curr_sio ) ); WndMenuCheck( wnd, MENU_SAMP_ABS, GetCurrentAbsBar( curr_sio ) ); WndMenuCheck( wnd, MENU_SAMP_REL, GetCurrentRelBar( curr_sio ) ); sort_type = GetCurrentSort( curr_sio ); WndMenuCheck( wnd, MENU_SORT_COUNT, sort_type==SORT_COUNT ); WndMenuCheck( wnd, MENU_SORT_NAME, sort_type==SORT_NAME ); if( row <= STATUS_ROW || curr_sio->level_open >= LEVEL_ROUTINE ) { WndMenuEnable( wnd, MENU_SAMP_GATHER, false ); WndMenuEnable( wnd, MENU_SAMP_SORT, false ); WndMenuEnable( wnd, MENU_SORT_COUNT, false ); WndMenuEnable( wnd, MENU_SORT_NAME, false ); if( row <= STATUS_ROW ) { WndMenuEnable( wnd, MENU_SAMP_BAR_MAX_TIME, false ); WndMenuEnable( wnd, MENU_SAMP_ABS, false ); WndMenuEnable( wnd, MENU_SAMP_REL, false ); } } break; case MENU_SAMP_ZOOM_IN: WPZoomIn( wnd, row ); break; case MENU_SAMP_BACK_OUT: WPBackOut( wnd ); break; // case MENU_SAMP_DATA: // WPSImageOpen( curr_sio ); // break; case MENU_SAMP_GATHER: FlipCurrentGather( curr_sio ); WndMenuCheck( wnd, MENU_SAMP_GATHER, GetCurrentGather( curr_sio ) ); gatherSort( curr_sio ); setDisplay( wnd, curr_sio, true ); break; case MENU_SAMP_BAR_MAX_TIME: FlipCurrentMaxBar( curr_sio ); WndMenuCheck( wnd, MENU_SAMP_BAR_MAX_TIME, GetCurrentMaxBar( curr_sio ) ); setDisplay( wnd, curr_sio, false ); break; case MENU_SAMP_ABS: FlipCurrentAbsBar( curr_sio ); WndMenuCheck( wnd, MENU_SAMP_ABS, GetCurrentAbsBar( curr_sio ) ); setDisplay( wnd, curr_sio, false ); break; case MENU_SAMP_REL: FlipCurrentRelBar( curr_sio ); WndMenuCheck( wnd, MENU_SAMP_ABS, GetCurrentRelBar( curr_sio ) ); setDisplay( wnd, curr_sio, false ); break; case MENU_SORT_COUNT: case MENU_SORT_NAME: WndMenuCheck( wnd, MENU_SORT_COUNT, ( id == MENU_SORT_COUNT ) ); WndMenuCheck( wnd, MENU_SORT_NAME, ( id == MENU_SORT_COUNT ) ); if( id == MENU_SORT_COUNT ) { SetCurrentSort( curr_sio, SORT_COUNT ); } else { SetCurrentSort( curr_sio, SORT_NAME ); } SortCurrent( curr_sio ); setDisplay( wnd, curr_sio, true ); break; } }
OVL_EXTERN void IOMenuItem( a_window wnd, gui_ctl_id id, wnd_row row, wnd_piece piece ) { io_window *io = WndIO( wnd ); address addr; bool ok; item_mach item; io_location *curr; mad_radix old_radix; /* unused parameters */ (void)piece; if( row < io->num_rows && row >= 0 ) { curr = &io->list[row]; } else { curr = NULL; } switch( id ) { case MENU_INITIALIZE: if( curr == NULL ) { WndMenuGrayAll( wnd ); } else { WndMenuEnableAll( wnd ); } WndMenuEnable( wnd, MENU_IO_NEW_ADDRESS, true ); break; case MENU_IO_DELETE: io->num_rows--; memcpy( &io->list[row], &io->list[row + 1], ( io->num_rows - row ) * sizeof( io_location ) ); WndNoSelect( wnd ); WndSetRepaint( wnd ); break; case MENU_IO_NEW_ADDRESS: addr = NilAddr; if( !DlgGivenAddr( LIT_DUI( New_Port_Addr ), &addr ) ) return; WndRowDirty( wnd, io->num_rows ); IOAddNewAddr( wnd, &addr, MENU_IO_FIRST_TYPE ); WndScrollBottom( wnd ); break; case MENU_IO_MODIFY: if( row >= io->num_rows || row < 0 ) break; if( piece == PIECE_VALUE ) { old_radix = NewCurrRadix( IOData.info[curr->type].piece_radix ); item.ud = curr->value_known ? curr->value.ud : 0; ok = DlgMadTypeExpr( TxtBuff, &item, IOData.info[curr->type].mth ); if( ok ) { curr->value = item; curr->value_known = true; } NewCurrRadix( old_radix ); } else { addr = curr->addr; if( !DlgGivenAddr( LIT_DUI( New_Port_Addr ), &addr ) ) return; curr->addr = addr; curr->value_known = false; } WndRowDirty( wnd, row ); break; case MENU_IO_READ: curr->value_known = true; if( ItemGetMAD( &curr->addr, &curr->value, IT_IO, IOData.info[curr->type].mth ) == IT_NIL ) { curr->value_known = false; } WndPieceDirty( wnd, row, PIECE_VALUE ); break; case MENU_IO_WRITE: if( curr->value_known ) { ItemPutMAD( &curr->addr, &curr->value, IT_IO, IOData.info[curr->type].mth ); } break; default: curr->type = PIECE_TYPE( id ); WndZapped( wnd ); break; } }