void TMediaTabView::MessageReceived(BMessage* message) { // Check for messages to switch the view bool buttonMsg = false; EChildID newView; switch (message->what) { case MEDIA_TAB_LIST_VIEW_MSG: newView = kElementsView; buttonMsg = true; break; case MEDIA_TAB_THUMBNAIL_VIEW_MSG: newView = kThumbnailView; buttonMsg = true; break; case MEDIA_TAB_ICON_VIEW_MSG: newView = kIconView; buttonMsg = true; break; } if (buttonMsg) { if (newView != fCurrentView) { // Protect this section of code. Looper()->Lock(); DeactivateView(fCurrentView); fCurrentView = newView; ActivateView(fCurrentView); Looper()->Unlock(); } return; } // Accept messages from the sorter object switch (message->what) { case SORTER_SELECT_MSG: case SORTER_INVOKE_MSG: if (fCurrentView == kElementsView) ChildAt(fCurrentView)->MessageReceived(message); return; // Some cue is adding an entry_ref to our browser // TODO: include the other two views in this. They can // have a new REF as well. case ADD_REF_MSG: if (fCurrentView == kElementsView) ChildAt(fCurrentView)->MessageReceived(message); return; } // Default handler BView::MessageReceived(message); }
void TMediaTabView::Init() { // NOTE: the order of these need to be kept in sync with the EChildID // enum // Create List View button BBitmap* up = GetIcon16FromResource("ListViewUp"); BBitmap* down = GetIcon16FromResource("ListViewDown"); // Make sure the button is a square, the same width as the scroll bar, // is high. It's top is one scroll bar height away from the bottom BRect buttBounds(0, 0, kScrollHeight, kScrollHeight); fbuttons[0] = new TRadioBitmapButton(buttBounds, "ListViewButton", up, down, this, new BMessage(MEDIA_TAB_LIST_VIEW_MSG), B_FOLLOW_LEFT + B_FOLLOW_BOTTOM); // This button is on by default fbuttons[0]->SetValue(1); // The Thumbnail button goes right next door up = GetIcon16FromResource("ThumbnailUp"); down = GetIcon16FromResource("ThumbnailDown"); buttBounds.left = buttBounds.right; buttBounds.right = buttBounds.left + kScrollHeight; fbuttons[1] = new TRadioBitmapButton(buttBounds, "ThumbnailButton", up, down, this, new BMessage(MEDIA_TAB_THUMBNAIL_VIEW_MSG), B_FOLLOW_LEFT + B_FOLLOW_BOTTOM); // With the icon view button next up = GetIcon16FromResource("IconViewUp"); down = GetIcon16FromResource("IconViewDown"); buttBounds.left = buttBounds.right; buttBounds.right = buttBounds.left + kScrollHeight; fbuttons[2] = new TRadioBitmapButton(buttBounds, "IconViewButton", up, down, this, new BMessage(MEDIA_TAB_ICON_VIEW_MSG), B_FOLLOW_LEFT + B_FOLLOW_BOTTOM); // create the views needed to support list, thumbnail and icon view. // Tell it to make room for the buttons. Hide the non-default views TElementsView* e = new TElementsView(Bounds()); AddChild(e); // move the horizontal scroll bar to make room for our buttons. NOTE: add // in one. The bitmap buttons are allowed to overlap so there is just one // black pixel shared between them. But the scroll bar changes color. It // needs to not share the space. e->MakeRoomForButtons(3 * kScrollHeight + 1); // Default view is list view ActivateView(kElementsView); // Do the other two views BView* sizeScroll = AddSizeScrollChild(new TThumbnailView(Bounds())); sizeScroll->Hide(); sizeScroll = AddSizeScrollChild(new TIconView(Bounds())); sizeScroll->Hide(); }
void wxFrameManager::Init( wxWindow* pMainFrame, const wxString& settingsFile ) { mSettingsFile = settingsFile; mpFrameWnd = pMainFrame; wxObjectList::compatibility_iterator pNode = mViews.GetFirst(); while ( pNode ) { wxFrameView* pView = (wxFrameView*)pNode->GetData(); pView->OnInit(); pView->OnInitMenus(); pNode = pNode->GetNext(); } if ( !ReloadViews() ) { // if loading of settings file failed (e.g. was not found), // do recreation of items in each view pNode = mViews.GetFirst(); while ( pNode ) { wxFrameView* pView = (wxFrameView*)pNode->GetData(); pView->OnRecreate(); pNode = pNode->GetNext(); } } if ( mActiveViewNo >= (int)mViews.GetCount() ) mActiveViewNo = -1; ActivateView( GetView( ( mActiveViewNo == -1 ) ? 0 : mActiveViewNo ) ); SyncAllMenus(); }
void CModelViewRender::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView) { CView::OnActivateView(bActivate, pActivateView, pDeactiveView); CGuiMDIFrame *mainWnd = DYNAMIC_DOWNCAST(CGuiMDIFrame, AfxGetMainWnd()); if (bActivate) { if (!m_bActivated) { SetActiveScene(); ActivateView(); mainWnd->LoadDocumentBars(_T("ModelView")); m_bActivated = true; } } else if (m_bActivated) { DeactivateView(); mainWnd->SaveDocumentBars(_T("ModelView")); m_bActivated = false; } }
long CDebugger::OnCommand(unsigned short nID, unsigned short nMsg, HWND hFrom) { switch(nID) { case ID_VM_STEP: StepCPU(); break; case ID_VM_RESUME: Resume(); break; case ID_VM_DUMPINTCHANDLERS: m_virtualMachine.DumpEEIntcHandlers(); break; case ID_VM_DUMPDMACHANDLERS: m_virtualMachine.DumpEEDmacHandlers(); break; case ID_VM_ASMJAL: AssembleJAL(); break; case ID_VM_REANALYZE_EE: ReanalyzeEe(); break; case ID_VM_FINDEEFUNCTIONS: FindEeFunctions(); break; case ID_VM_FINDVALUE: FindValue(); break; case ID_VIEW_MEMORY: GetMemoryViewWindow()->Show(SW_SHOW); GetMemoryViewWindow()->SetFocus(); return FALSE; break; case ID_VIEW_CALLSTACK: GetCallStackWindow()->Show(SW_SHOW); GetCallStackWindow()->SetFocus(); return FALSE; break; case ID_VIEW_FUNCTIONS: m_pFunctionsView->Show(SW_SHOW); m_pFunctionsView->SetFocus(); return FALSE; break; case ID_VIEW_ELF: m_pELFView->Show(SW_SHOW); m_pELFView->SetFocus(); return FALSE; break; case ID_VIEW_THREADS: m_threadsView->Show(SW_SHOW); m_threadsView->SetFocus(); return FALSE; break; case ID_VIEW_DISASSEMBLY: GetDisassemblyWindow()->Show(SW_SHOW); GetDisassemblyWindow()->SetFocus(); return FALSE; break; case ID_VIEW_EEVIEW: ActivateView(DEBUGVIEW_EE); break; case ID_VIEW_VU0VIEW: ActivateView(DEBUGVIEW_VU0); break; case ID_VIEW_VU1VIEW: ActivateView(DEBUGVIEW_VU1); break; case ID_VIEW_IOPVIEW: ActivateView(DEBUGVIEW_IOP); break; case ID_WINDOW_CASCAD: m_pMDIClient->Cascade(); return FALSE; break; case ID_WINDOW_TILEHORIZONTAL: m_pMDIClient->TileHorizontal(); return FALSE; break; case ID_WINDOW_TILEVERTICAL: m_pMDIClient->TileVertical(); return FALSE; break; case ID_WINDOW_LAYOUT1024: Layout1024(); return FALSE; break; case ID_WINDOW_LAYOUT1280: Layout1280(); return FALSE; break; case ID_WINDOW_LAYOUT1600: Layout1600(); return FALSE; break; } return TRUE; }
CDebugger::CDebugger(CPS2VM& virtualMachine) : m_virtualMachine(virtualMachine) { RegisterPreferences(); if(!DoesWindowClassExist(CLSNAME)) { WNDCLASSEX wc; memset(&wc, 0, sizeof(WNDCLASSEX)); wc.cbSize = sizeof(WNDCLASSEX); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH); wc.hInstance = GetModuleHandle(NULL); wc.lpszClassName = CLSNAME; wc.lpfnWndProc = CWindow::WndProc; RegisterClassEx(&wc); } Create(NULL, CLSNAME, _T(""), WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, Framework::Win32::CRect(0, 0, 640, 480), NULL, NULL); SetClassPtr(); SetMenu(LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_DEBUGGER))); CreateClient(NULL); //Show(SW_MAXIMIZE); //ELF View Initialization m_pELFView = new CELFView(m_pMDIClient->m_hWnd); m_pELFView->Show(SW_HIDE); //Functions View Initialization m_pFunctionsView = new CFunctionsView(m_pMDIClient->m_hWnd); m_pFunctionsView->Show(SW_HIDE); m_pFunctionsView->OnFunctionDblClick.connect(boost::bind(&CDebugger::OnFunctionsViewFunctionDblClick, this, _1)); m_pFunctionsView->OnFunctionsStateChange.connect(boost::bind(&CDebugger::OnFunctionsViewFunctionsStateChange, this)); //Threads View Initialization m_threadsView = new CThreadsViewWnd(m_pMDIClient->m_hWnd, m_virtualMachine); m_threadsView->Show(SW_HIDE); m_threadsView->OnGotoAddress.connect(boost::bind(&CDebugger::OnThreadsViewAddressDblClick, this, _1)); //Find Callers View Initialization m_findCallersView = new CFindCallersViewWnd(m_pMDIClient->m_hWnd); m_findCallersView->Show(SW_HIDE); m_findCallersView->AddressSelected.connect([&] (uint32 address) { OnFindCallersAddressDblClick(address); }); //Debug Views Initialization m_nCurrentView = -1; memset(m_pView, 0, sizeof(m_pView)); m_pView[DEBUGVIEW_EE] = new CDebugView(m_pMDIClient->m_hWnd, m_virtualMachine, &m_virtualMachine.m_ee->m_EE, std::bind(&CPS2VM::StepEe, &m_virtualMachine), m_virtualMachine.m_ee->m_os, "EmotionEngine"); m_pView[DEBUGVIEW_VU0] = new CDebugView(m_pMDIClient->m_hWnd, m_virtualMachine, &m_virtualMachine.m_ee->m_VU0, std::bind(&CPS2VM::StepVu0, &m_virtualMachine), nullptr, "Vector Unit 0", CDisAsmWnd::DISASM_VU); m_pView[DEBUGVIEW_VU1] = new CDebugView(m_pMDIClient->m_hWnd, m_virtualMachine, &m_virtualMachine.m_ee->m_VU1, std::bind(&CPS2VM::StepVu1, &m_virtualMachine), nullptr, "Vector Unit 1", CDisAsmWnd::DISASM_VU); m_pView[DEBUGVIEW_IOP] = new CDebugView(m_pMDIClient->m_hWnd, m_virtualMachine, &m_virtualMachine.m_iop->m_cpu, std::bind(&CPS2VM::StepIop, &m_virtualMachine), m_virtualMachine.m_iopOs.get(), "IO Processor"); m_virtualMachine.m_ee->m_os->OnExecutableChange.connect(boost::bind(&CDebugger::OnExecutableChange, this)); m_virtualMachine.m_ee->m_os->OnExecutableUnloading.connect(boost::bind(&CDebugger::OnExecutableUnloading, this)); ActivateView(DEBUGVIEW_EE); LoadSettings(); if(GetDisassemblyWindow()->IsVisible()) { GetDisassemblyWindow()->SetFocus(); } CreateAccelerators(); }
void wxFrameManager::ActivateView( int viewNo ) { ActivateView( GetView( viewNo ) ); }