MCPcopy Create free account
hub / github.com/TASEmulators/fceux / contextMenuEvent

Method contextMenuEvent

src/drivers/Qt/ConsoleDebugger.cpp:6311–6415  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

6309}
6310//----------------------------------------------------------------------------
6311void QAsmView::contextMenuEvent(QContextMenuEvent *event)
6312{
6313 int line;
6314 QAction *act;
6315 QMenu menu(this);
6316 QPoint c = convPixToCursor( event->pos() );
6317 bool enableRunToCursor = false;
6318 char stmp[128];
6319
6320 if ( parent == NULL )
6321 {
6322 return;
6323 }
6324 line = lineOffset + c.y();
6325
6326 ctxMenuAddr = -1;
6327
6328 if ( static_cast<size_t>(line) < asmEntry.size() )
6329 {
6330 int addr, romAddr, bank = -1;
6331
6332 if ( selAddrValue < 0 )
6333 {
6334 ctxMenuAddr = addr = asmEntry[line]->addr;
6335 ctxMenuAddrType = 0;
6336 ctxMenuLine = line;;
6337
6338 enableRunToCursor = true;
6339 }
6340 else
6341 {
6342 ctxMenuAddr = addr = selAddrValue;
6343 ctxMenuAddrType = selAddrType;
6344 ctxMenuLine = selAddrLine;
6345
6346 enableRunToCursor = (selAddrValue == asmEntry[line]->addr);
6347 }
6348 romAddr = GetNesFileAddress(addr);
6349
6350 if ( enableRunToCursor )
6351 {
6352 act = new QAction(tr("Run To &Cursor"), &menu);
6353 menu.addAction(act);
6354 //act->setShortcut( QKeySequence(tr("Ctrl+F10")));
6355 connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuRunToCursor(void)) );
6356 }
6357
6358 if ( ctxMenuAddrType == 0 )
6359 {
6360 sprintf( stmp, "Go to $%04X\tDouble+Click", ctxMenuAddr );
6361 act = new QAction(tr(stmp), &menu);
6362 menu.addAction(act);
6363 //act->setShortcut( QKeySequence(tr("Ctrl+F10")));
6364 connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuGoTo(void)) );
6365 }
6366
6367 if ( isBreakpointAtAddr( addr, romAddr ) >= 0 )
6368 {

Callers

nothing calls this directly

Calls 8

GetNesFileAddressFunction · 0.85
getBankFunction · 0.85
getSymbolAtBankOffsetMethod · 0.80
execMethod · 0.80
buildContextMenuMethod · 0.80
trFunction · 0.50
sizeMethod · 0.45
getAddrMethod · 0.45

Tested by

no test coverage detected