Ejemplo n.º 1
0
CRegViewWnd::CRegViewWnd(HWND parentWnd, CVirtualMachine& virtualMachine, CMIPS* ctx)
{
	auto windowRect = Framework::Win32::CRect(0, 0, 320, 240);

	Create(NULL, Framework::Win32::CDefaultWndClass::GetName(), _T("Registers"), WND_STYLE, windowRect, parentWnd, NULL);
	SetClassPtr();

	m_tabs = Framework::Win32::CTab(m_hWnd, windowRect, TCS_BOTTOM);
	m_tabs.InsertTab(_T("General"));
	m_tabs.InsertTab(_T("SCU"));
	m_tabs.InsertTab(_T("FPU"));
	m_tabs.InsertTab(_T("VU"));

	m_regView[0] = new CRegViewGeneral(m_hWnd, windowRect, virtualMachine, ctx);
	m_regView[1] = new CRegViewSCU(m_hWnd, windowRect, virtualMachine, ctx);
	m_regView[2] = new CRegViewFPU(m_hWnd, windowRect, virtualMachine, ctx);
	m_regView[3] = new CRegViewVU(m_hWnd, windowRect, virtualMachine, ctx);

	for(unsigned int i = 0; i < MAXTABS; i++)
	{
		m_regView[i]->Enable(false);
		m_regView[i]->Show(SW_HIDE);
	}

	SelectTab(0);

	RefreshLayout();
}
Ejemplo n.º 2
0
LRESULT CResizableSheetEx::OnResizeSupport(WPARAM wParam, LPARAM lParam)
{
	switch (wParam)
	{
	case RSZSUP_SHEETPAGEEXHACK:
		{
			// a window object must be still associated to the page handle
			// but MFC subclassing has been turned off to allow the system
			// to subclass it first, so we can catch all the messages
			CWnd* pWnd = CWnd::FromHandlePermanent((HWND)lParam);
			if (pWnd == NULL)
				return 0;

			// suclass the window again and refresh page and sheet
			pWnd->SubclassWindow(pWnd->Detach());
			RefreshLayout();
			pWnd->SendMessage(WM_SIZE);
			Invalidate();
			UnlockWindowUpdate();

			if (pWnd->IsWindowVisible())
			{
				// send lost PSN_SETACTIVE notification message
				CPropertyPage* pPage = DYNAMIC_DOWNCAST(CPropertyPage, pWnd);
				if (pPage != NULL)
					SetActivePage(pPage);
			}
		}
		break;

	default:
		return FALSE;
	}
	return TRUE;
}
BOOL CDlgWingspanAdjacancyConstraints::OnInitDialog()
{
	CDialog::OnInitDialog();
	SetWindowText(_T("Wingspan Adjacency Constraints"));

	// TODO:  Add extra initialization here
	GetDlgItem(IDC_BUTTON_SAVE)->EnableWindow(FALSE);
	//list
	DWORD dwStyle = m_wndListCtrl.GetExtendedStyle();
	dwStyle |= LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_GRIDLINES;
	m_wndListCtrl.SetExtendedStyle(dwStyle);

	//load data for taxiway adjacency
	m_vData.LoadData(m_nProjID);
	// set the layout of child controls
	RefreshLayout();

	// init the list control
	InitListControl();

	// set the toolbar button state
	UpdateToolBarState();

	GetAllTaxiway();

	FillListControl();

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
Ejemplo n.º 4
0
void DockCont::TabSelected()
{
	int ix = tabbar.GetCursor();
	if (ix >= 0) {
		DockableCtrl *dc = Get0(ix);
		if (!dc) return;
		Ctrl *ctrl = GetCtrl(ix);
		Ctrl *first = &handle;

		for (Ctrl *c = first->GetNext(); c; c = c->GetNext())
			if (c != ctrl) c->Hide();
		ctrl->Show();
		Icon(dc->GetIcon()).Title(dc->GetTitle());

		handle.dc = dc;
		SyncButtons(*dc);

		if (IsTabbed()) {
			DockCont *c = static_cast<DockCont *>(GetParent());
			c->tabbar.SyncRepos();
			c->TabSelected();
			c->RefreshFrame();
		}
		else
			RefreshLayout();
	}
}
Ejemplo n.º 5
0
void DockWindow::LoadLayout(int ix)
{
	ASSERT(ix >= 0 && ix < layouts.GetCount());
	StringStream s((String)layouts[ix]);
	SerializeLayout(s, false);
	RefreshLayout();
}
void CDlgWingspanAdjacancyConstraints::OnSize(UINT nType, int cx, int cy)
{
	CDialog::OnSize(nType, cx, cy);

	// TODO: Add your message handler code here
	RefreshLayout(cx, cy);
}
Ejemplo n.º 7
0
TopWindow& TopWindow::SetStyle(const TopWindow::TopStyle& s)
{
	st = &s;
	RefreshLayout();
	RefreshFrame();
	return *this;
}
Ejemplo n.º 8
0
CCallStackWnd::CCallStackWnd(HWND hParent, CVirtualMachine& virtualMachine, CMIPS* context, CBiosDebugInfoProvider* biosDebugInfoProvider)
: m_virtualMachine(virtualMachine)
, m_context(context)
, m_list(nullptr)
, m_biosDebugInfoProvider(biosDebugInfoProvider)
{
	if(!DoesWindowClassExist(CLSNAME))
	{
		WNDCLASSEX wc;
		memset(&wc, 0, sizeof(WNDCLASSEX));
		wc.cbSize			= sizeof(WNDCLASSEX);
		wc.hCursor			= LoadCursor(NULL, IDC_ARROW);
		wc.hbrBackground	= (HBRUSH)(COLOR_WINDOW); 
		wc.hInstance		= GetModuleHandle(NULL);
		wc.lpszClassName	= CLSNAME;
		wc.lpfnWndProc		= CWindow::WndProc;
		RegisterClassEx(&wc);
	}
	
	Create(NULL, CLSNAME, _T("Call Stack"), WS_CLIPCHILDREN | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_CHILD | WS_MAXIMIZEBOX, Framework::Win32::CRect(0, 0, 320, 240), hParent, NULL);
	SetClassPtr();

	m_list = new Framework::Win32::CListView(m_hWnd, Framework::Win32::CRect(0, 0, 1, 1), LVS_REPORT);
	m_list->SetExtendedListViewStyle(m_list->GetExtendedListViewStyle() | LVS_EX_FULLROWSELECT);

	m_virtualMachine.OnMachineStateChange.connect(boost::bind(&CCallStackWnd::Update, this));
	m_virtualMachine.OnRunningStateChange.connect(boost::bind(&CCallStackWnd::Update, this));

	CreateColumns();

	RefreshLayout();
	Update();
}
Ejemplo n.º 9
0
void
GridView::MoveFocus(Direction direction)
{
  signed focusPos = GetIndexOfItemInFocus();

  if (focusPos == -1)
    // We are on a page without enabled items.
    // We should show the next page if exists
    ShowNextPage(direction);
  else {
    signed newFocusPos = GetNextItemIndex(focusPos, direction);

    if (newFocusPos != -1) {
      // we are on the same page
      items[newFocusPos]->SetFocus();
      if (!items[newFocusPos]->HasFocus()) {
        /* unable to set the focus, let's try simple Tab/Shift-Tab
           behavior instead */
        newFocusPos = GetNextEnabledItemIndex(focusPos, direction);
        if (newFocusPos != -1)
          items[newFocusPos]->SetFocus();
      }
      RefreshLayout();
    } else
      ShowNextPage(direction);
  }
}
Ejemplo n.º 10
0
long CMainWindow::OnSize(unsigned int, unsigned int, unsigned int)
{
	if(m_outputWnd && m_statusBar)
	{
		RefreshLayout();
	}
	return TRUE;
}
Ejemplo n.º 11
0
CSpuRegViewPanel::CSpuRegViewPanel(HWND parentWnd, const TCHAR* title)
: Framework::Win32::CDialog(MAKEINTRESOURCE(IDD_SPUREGVIEW), parentWnd)
{
    SetClassPtr();

	m_regView = new CSpuRegView(m_hWnd, title);

	RefreshLayout();
}
Ejemplo n.º 12
0
void DockCont::TabClosed(Value v)
{
	CtrlCast(v)->Remove();
	if (IsDockCont(v)) base->CloseContainer(*ContCast(v));
	waitsync = true;
	Layout();
	if (tabbar.GetCount() == 1)
		RefreshLayout();
}
Ejemplo n.º 13
0
SplitterFrame& SplitterFrame::SetStyle(const Splitter::Style& s)
{
	if(style != &s) {
		style = &s;
		RefreshLayout();
		Refresh();
	}
	return *this;
}
Ejemplo n.º 14
0
ScrollBar& ScrollBar::SetStyle(const Style& s)
{
	if(style != &s) {
		style = &s;
		RefreshLayout();
		Refresh();
	}
	return *this;
}
Ejemplo n.º 15
0
CFindCallersViewWnd::CFindCallersViewWnd(HWND parentWnd)
{
	auto windowRect = Framework::Win32::PointsToPixels(Framework::Win32::CRect(0, 0, 700, 400));

	Create(NULL, Framework::Win32::CDefaultWndClass().GetName(), _T(""), WND_STYLE, windowRect, parentWnd, NULL);
	SetClassPtr();

	m_callersList = Framework::Win32::CListBox(m_hWnd, Framework::Win32::CRect(0, 0, 10, 10), WS_VSCROLL | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT);

	RefreshLayout();
}
Ejemplo n.º 16
0
CELFProgramView::CELFProgramView(HWND hParent, CELF* pELF)
: CDialog(MAKEINTRESOURCE(IDD_ELFVIEW_PROGRAMVIEW), hParent)
, m_nProgram(-1)
, m_pELF(pELF)
{
	SetClassPtr();

	m_pType		= new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_TYPE_EDIT));
	m_pOffset	= new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_OFFSET_EDIT));
	m_pVAddr	= new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_VADDR_EDIT));
	m_pPAddr	= new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_PADDR_EDIT));
	m_pFileSize	= new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_FILESIZE_EDIT));
	m_pMemSize	= new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_MEMSIZE_EDIT));
	m_pFlags	= new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_FLAGS_EDIT));
	m_pAlign	= new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_ALIGN_EDIT));

	RECT columnEditBoxSize;
	SetRect(&columnEditBoxSize, 0, 0, 70, 12);
	MapDialogRect(m_hWnd, &columnEditBoxSize);
	unsigned int columnEditBoxWidth = columnEditBoxSize.right - columnEditBoxSize.left;
	unsigned int columnEditBoxHeight = columnEditBoxSize.bottom - columnEditBoxSize.top;

	RECT columnLabelSize;
	SetRect(&columnLabelSize, 0, 0, 70, 8);
	MapDialogRect(m_hWnd, &columnLabelSize);
	unsigned int columnLabelWidth = columnLabelSize.right - columnLabelSize.left;
	unsigned int columnLabelHeight = columnLabelSize.bottom - columnLabelSize.top;

	m_pLayout = Framework::CGridLayout::Create(2, 9);

	m_pLayout->SetObject(0, 0, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_TYPE_LABEL))));
	m_pLayout->SetObject(0, 1, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_OFFSET_LABEL))));
	m_pLayout->SetObject(0, 2, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_VADDR_LABEL))));
	m_pLayout->SetObject(0, 3, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_PADDR_LABEL))));
	m_pLayout->SetObject(0, 4, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_FILESIZE_LABEL))));
	m_pLayout->SetObject(0, 5, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_MEMSIZE_LABEL))));
	m_pLayout->SetObject(0, 6, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_FLAGS_LABEL))));
	m_pLayout->SetObject(0, 7, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_ALIGN_LABEL))));

	m_pLayout->SetObject(1, 0, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pType));
	m_pLayout->SetObject(1, 1, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pOffset));
	m_pLayout->SetObject(1, 2, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pVAddr));
	m_pLayout->SetObject(1, 3, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pPAddr));
	m_pLayout->SetObject(1, 4, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pFileSize));
	m_pLayout->SetObject(1, 5, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pMemSize));
	m_pLayout->SetObject(1, 6, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pFlags));
	m_pLayout->SetObject(1, 7, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pAlign));
	m_pLayout->SetObject(1, 8, Framework::CLayoutStretch::Create());

	RefreshLayout();
}
Ejemplo n.º 17
0
CFunctionsView::CFunctionsView(HWND hParent) 
: m_context(nullptr)
, m_biosDebugInfoProvider(nullptr)
{
	if(!DoesWindowClassExist(CLSNAME))
	{
		WNDCLASSEX wc;
		memset(&wc, 0, sizeof(WNDCLASSEX));
		wc.cbSize			= sizeof(WNDCLASSEX);
		wc.hCursor			= LoadCursor(NULL, IDC_ARROW);
		wc.hbrBackground	= (HBRUSH)(COLOR_WINDOW); 
		wc.hInstance		= GetModuleHandle(NULL);
		wc.lpszClassName	= CLSNAME;
		wc.lpfnWndProc		= CWindow::WndProc;
		RegisterClassEx(&wc);
	}

	unsigned long windowStyle = WS_CLIPCHILDREN | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_MAXIMIZEBOX;
#ifndef FUNCTIONSVIEW_STANDALONE
	windowStyle |= WS_CHILD;
#endif
	int ydpi = GetDeviceCaps(GetDC(NULL), LOGPIXELSY);
	Create(NULL, CLSNAME, _T("Functions"), windowStyle, Framework::Win32::CRect(0, 0, SCALE(320), SCALE(240)), hParent, NULL);
	SetClassPtr();

	m_pList = new Framework::Win32::CListView(m_hWnd, Framework::Win32::CRect(0, 0, 0, 0), LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | LVS_SHOWSELALWAYS);
	m_pList->SetExtendedListViewStyle(m_pList->GetExtendedListViewStyle() | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);

	CreateListColumns();

	m_pNew		= new Framework::Win32::CButton(_T("New..."), m_hWnd, Framework::Win32::CRect(0, 0, 0, 0));
	m_pRename	= new Framework::Win32::CButton(_T("Rename..."), m_hWnd, Framework::Win32::CRect(0, 0, 0, 0));
	m_pDelete	= new Framework::Win32::CButton(_T("Delete"), m_hWnd, Framework::Win32::CRect(0, 0, 0, 0));
	m_pImport	= new Framework::Win32::CButton(_T("Load ELF symbols"), m_hWnd, Framework::Win32::CRect(0, 0, 0, 0));

	Framework::FlatLayoutPtr pSubLayout0 = Framework::CHorizontalLayout::Create();
	pSubLayout0->InsertObject(Framework::CLayoutStretch::Create());
	pSubLayout0->InsertObject(Framework::Win32::CLayoutWindow::CreateButtonBehavior(SCALE(100), SCALE(23), m_pNew));
	pSubLayout0->InsertObject(Framework::Win32::CLayoutWindow::CreateButtonBehavior(SCALE(100), SCALE(23), m_pRename));
	pSubLayout0->InsertObject(Framework::Win32::CLayoutWindow::CreateButtonBehavior(SCALE(100), SCALE(23), m_pDelete));
	pSubLayout0->InsertObject(Framework::Win32::CLayoutWindow::CreateButtonBehavior(SCALE(100), SCALE(23), m_pImport));

	m_pLayout = Framework::CVerticalLayout::Create();
	m_pLayout->InsertObject(Framework::Win32::CLayoutWindow::CreateCustomBehavior(1, 1, 1, 1, m_pList));
	m_pLayout->InsertObject(pSubLayout0);

	SetSize(SCALE(469), SCALE(612));

	RefreshLayout();
}
Ejemplo n.º 18
0
CMemoryViewMIPSWnd::CMemoryViewMIPSWnd(HWND parentWnd, CVirtualMachine& virtualMachine, CMIPS* ctx)
{
	auto wndRect = Framework::Win32::PointsToPixels(Framework::Win32::CRect(0, 0, 320, 240));

	Create(NULL, Framework::Win32::CDefaultWndClass::GetName(), _T("Memory"), WNDSTYLE, wndRect, parentWnd, NULL);
	SetClassPtr();

	m_addressEdit = new Framework::Win32::CEdit(m_hWnd, wndRect, _T(""), ES_READONLY);

	m_memoryView = new CMemoryViewMIPS(m_hWnd, wndRect, virtualMachine, ctx);
	m_memoryView->OnSelectionChange.connect(boost::bind(&CMemoryViewMIPSWnd::OnMemoryViewSelectionChange, this, _1));

	UpdateStatusBar();
	RefreshLayout();
}
Ejemplo n.º 19
0
void CRegViewWnd::SelectTab(unsigned int viewIndex)
{
	assert(m_current == nullptr);

	m_current = m_regView[viewIndex];

	if(m_current != nullptr)
	{
		m_current->Enable(true);
		m_current->Show(SW_SHOW);
		m_current->SetFocus();
	}

	RefreshLayout();
}
Ejemplo n.º 20
0
CCdromSelectionWnd::CCdromSelectionWnd(HWND hParent, const TCHAR* sTitle, CDROMBINDING* pInitBinding)
: CModalWindow(hParent)
{
	if(pInitBinding != NULL)
	{
		m_nType				= pInitBinding->nType;
		m_sImagePath		= pInitBinding->sImagePath;
		m_nPhysicalDevice	= pInitBinding->nPhysicalDevice;
	}

	Create(WNDSTYLEEX, Framework::Win32::CDefaultWndClass::GetName(), sTitle, WNDSTYLE, Framework::Win32::CRect(0, 0, 300, 170), hParent, NULL);
	SetClassPtr();

	m_pOk			= new Framework::Win32::CButton(_T("OK"), m_hWnd, Framework::Win32::CRect(0, 0, 1, 1));
	m_pCancel		= new Framework::Win32::CButton(_T("Cancel"), m_hWnd, Framework::Win32::CRect(0, 0, 1, 1));

	m_pImageRadio	= new Framework::Win32::CButton(_T("ISO9660 Disk Image"), m_hWnd, Framework::Win32::CRect(0, 0, 1, 1), BS_RADIOBUTTON);
	m_pDeviceRadio	= new Framework::Win32::CButton(_T("Physical CD/DVD Reader Device"), m_hWnd, Framework::Win32::CRect(0, 0, 1, 1), BS_RADIOBUTTON);

	m_pImageEdit	= new Framework::Win32::CEdit(m_hWnd, Framework::Win32::CRect(0, 0, 1, 1), _T(""), ES_READONLY);
	m_pImageBrowse	= new Framework::Win32::CButton(_T("..."), m_hWnd, Framework::Win32::CRect(0, 0, 1, 1));
	m_pDeviceCombo	= new Framework::Win32::CComboBox(m_hWnd, Framework::Win32::CRect(0, 0, 1, 1), CBS_DROPDOWNLIST | WS_VSCROLL);

	PopulateDeviceList();

	m_pLayout =
		Framework::VerticalLayoutContainer(
			Framework::LayoutExpression(Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(100, 15, m_pImageRadio)) +
			Framework::HorizontalLayoutContainer(
				Framework::LayoutExpression(Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(100, 21, m_pImageEdit)) +
				Framework::LayoutExpression(Framework::Win32::CLayoutWindow::CreateButtonBehavior(20, 21, m_pImageBrowse))
			) +
			Framework::LayoutExpression(Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(100, 15, m_pDeviceRadio)) +
			Framework::LayoutExpression(Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(100, 20, m_pDeviceCombo)) +
			Framework::LayoutExpression(Framework::CLayoutStretch::Create()) +
			Framework::HorizontalLayoutContainer(
				Framework::LayoutExpression(Framework::CLayoutStretch::Create()) +
				Framework::LayoutExpression(Framework::Win32::CLayoutWindow::CreateButtonBehavior(100, 23, m_pOk)) +
				Framework::LayoutExpression(Framework::Win32::CLayoutWindow::CreateButtonBehavior(100, 23, m_pCancel))
			)
		);

	UpdateControls();

	RefreshLayout();
	m_pDeviceCombo->FixHeight(100);
}
Ejemplo n.º 21
0
	void CPlot::RefreshPlot(CDC* pDC)
	{	
		// 更新布局
		RefreshLayout();
		// 绘制背景
		DrawBackground(pDC);
		// 绘制坐标轴
		DrawAxises(pDC);
		// 绘制网格
		DrawGrids(pDC);
		// 绘制图例
		DrawLegend(pDC,m_rectLegend);
		// 绘制标题
		DrawTile(pDC,m_rectTitle);
		// 绘制曲线
		DrawLines(pDC);
	}
Ejemplo n.º 22
0
void DockCont::Layout()
{
	if (waitsync) {
		waitsync = false;
		if (GetCount() == 1) {
			Value v = tabbar.Get(0);
			if (IsDockCont(v)) {
				DockCont *dc = ContCast(v);
				AddFrom(*dc);
				base->CloseContainer(*dc);
				RefreshLayout();
			}
		}
		if (!tabbar.GetCount())
			base->CloseContainer(*this);
		TabSelected();
	}
}
Ejemplo n.º 23
0
void DockCont::ChildAdded(Ctrl *child)
{
	if (child->GetParent() != this)
		return;
	else if (DockableCtrl *dc = dynamic_cast<DockableCtrl *>(child)) {
		Value v = ValueCast(dc);
		tabbar.Insert(0, v, dc->GetGroup(), true);
	}
	else if (DockCont *dc = dynamic_cast<DockCont *>(child)) {
		Value v = ValueCast(dc);
		tabbar.Insert(0, v, Null, true);
	}
	else
		return;
	child->SizePos();
	TabSelected();
	if (GetCount() >= 2) RefreshLayout();
}
Ejemplo n.º 24
0
void DockCont::TabDragged(int ix)
{
	if (ix >= 0) {
		// Special code needed
		Value v = tabbar.Get(ix);
		if (IsDockCont(v)) {
			DockCont *c = ContCast(v);
			c->Remove();
			base->FloatFromTab(*this, *c);
		}
		else {
			DockableCtrl *c = DockCast(v);
			c->Remove();
			base->FloatFromTab(*this, *c);
		}
		if (tabbar.IsAutoHide())
			RefreshLayout();
	}
}
Ejemplo n.º 25
0
void VLogoOverlay::Init()
{
#if defined(SHOW_LOGO)
  Vision::Callbacks.OnVideoChanged += this;

#if defined( HK_ANARCHY )
  m_spLogoOverlay = new VisScreenMask_cl("Textures/Anarchy_Logo_128x128.dds");
#else
  m_spLogoOverlay = new VisScreenMask_cl("Textures/Havok_Logo_128x64.dds");
#endif
  m_spLogoOverlay->SetDepthWrite(FALSE);
  m_spLogoOverlay->SetTransparency (VIS_TRANSP_ALPHA);
  m_spLogoOverlay->SetFiltering(FALSE);

  RefreshLayout();

  m_spLogoOverlay->SetColor(VColorRef(255, 255, 255, 255));
  m_spLogoOverlay->GetTextureObject()->SetResourceFlag(VRESOURCEFLAG_AUTODELETE); 
#endif
}
Ejemplo n.º 26
0
	void CPlot::ScaleProcess()
	{
		CRect rect;	// 鼠标移动的区域
		if(m_startPoint.x>m_endPoint.x){
			rect.left	= m_endPoint.x;
			rect.right	= m_startPoint.x;
		}else{
			rect.left	= m_startPoint.x;
			rect.right	= m_endPoint.x;
		}
		if (m_startPoint.y>m_endPoint.y)
		{
			rect.top	= m_endPoint.y;
			rect.bottom	= m_startPoint.y;
		}else{
			rect.top	= m_startPoint.y;
			rect.bottom	= m_endPoint.y;
		}
		// rect 与 m_rectPlot的交集
		CRect rectScale = IntersectionRect(rect,m_rectPlot);

		// 选择区域过小,不进行缩放
		if(rectScale.Width()<10||rectScale.Height()<10){
			return;
		}
		// 缩放处理
		float newXAxisLwLmt,newXAxisUpLmt;
		float newYAxisLwLmt,newYAxisUpLmt;
		newXAxisLwLmt = m_axisX.GetRangeLowerLimit()
						+(rectScale.left-m_rectPlot.left)*m_axisX.GetAxisRange()/m_rectPlot.Width();
		newXAxisUpLmt = m_axisX.GetRangeLowerLimit()
						+(rectScale.right-m_rectPlot.left)*m_axisX.GetAxisRange()/m_rectPlot.Width();
		newYAxisLwLmt = m_axisY.GetRangeLowerLimit()
						+(m_rectPlot.bottom-rectScale.bottom)*m_axisY.GetAxisRange()/m_rectPlot.Height();
		newYAxisUpLmt = m_axisY.GetRangeLowerLimit()
						+(m_rectPlot.bottom-rectScale.top)*m_axisY.GetAxisRange()/m_rectPlot.Height();
		m_axisX.SetAxisRange(newXAxisLwLmt,newXAxisUpLmt);
		m_axisY.SetAxisRange(newYAxisLwLmt,newYAxisUpLmt);
		RefreshLayout();
		m_bAdjustable = FALSE;
	}
Ejemplo n.º 27
0
CDisAsmWnd::CDisAsmWnd(HWND parentWnd, CVirtualMachine& virtualMachine, CMIPS* ctx, DISASM_TYPE disAsmType)
{
	Create(NULL, Framework::Win32::CDefaultWndClass::GetName(), _T("Disassembly"), WNDSTYLE,
	       Framework::Win32::CRect(0, 0, 320, 240), parentWnd, NULL);

	SetClassPtr();

	switch(disAsmType)
	{
	case DISASM_STANDARD:
		m_disAsm = new CDisAsm(m_hWnd, Framework::Win32::CRect(0, 0, 320, 240), virtualMachine, ctx);
		break;
	case DISASM_VU:
		m_disAsm = new CDisAsmVu(m_hWnd, Framework::Win32::CRect(0, 0, 320, 240), virtualMachine, ctx);
		break;
	default:
		assert(0);
		break;
	}

	RefreshLayout();
}
Ejemplo n.º 28
0
long CMemoryViewMIPSWnd::OnSize(unsigned int nType, unsigned int nCX, unsigned int nCY)
{
	RefreshLayout();
	return TRUE;
}
Ejemplo n.º 29
0
void DockWindow::SerializeLayout(Stream &s, bool withsavedlayouts)
{
	StopHighlight(false);
	int cnt = 0;

	s.Magic();

	// Groups
	ArrayMap<String, Vector<int> > groups;
	if (s.IsStoring())
		for (int i = 0; i < dockers.GetCount(); i++) {
			String g = dockers[i]->GetGroup();
			if (!g.IsEmpty()) {
				int ix = groups.Find(g);
				if (ix < 0) {
					groups.Add(dockers[i]->GetGroup(), Vector<int>());
					ix = groups.GetCount() - 1;
				}
				groups[ix].Add(i);
			}
		}
	s % groups;
	if (s.IsLoading()) {
		ClearLayout();

		for (int i = 0; i < dockers.GetCount(); i++)
			dockers[i]->SetGroup(Null);
		for (int i = 0; i < groups.GetCount(); i++) {
			Vector<int> &v = groups[i];
			const String &g = groups.GetKey(i);
			for (int j = 0; j < v.GetCount(); j++) {
				int ix = v[j];
				if (ix >= 0 && ix < dockers.GetCount())
					dockers[ix]->SetGroup(g);
			}
		}
	}

	if (s.IsStoring()) {
		// Write docked
		for (int i = 0; i < 4; i++) {
			DockPane &pane = dockpane[i];
			int fsz = dockframe[i].IsShown() ? dockframe[i].GetSize() : 0;

			s / fsz % pane;
			DockCont *dc = dynamic_cast<DockCont *>(pane.GetFirstChild());
			for (int j = 0; dc && j < pane.GetCount(); j++) {
				s % *dc;
				dc = dynamic_cast<DockCont *>(dc->GetNext());
			}
		}
		cnt = 0;
		// Count Floating
		for (int i = 0; i < conts.GetCount(); i++)
			if (conts[i].IsFloating()) cnt++;
		// Write Floating
		s / cnt;
		for (int i = 0; i < conts.GetCount(); i++) {
			if (conts[i].IsFloating()) {
				conts[i].Serialize(s);
				conts[i].SerializePlacement(s, false);
			}
		}
		// Write Autohidden
		for (int i = 0; i < 4; i++) {
			cnt = hideframe[i].GetCount();
			s / cnt;
			for (int j = 0; j < hideframe[i].GetCount(); j++) {
				int ix = FindDocker(&hideframe[i].GetCtrl(j)->Get(0));
				if (ix >= 0)
					s / ix;
			}
		}
	}
	else {
		// Read docked
		for (int i = 0; i < 4; i++) {
			DockPane &pane = dockpane[i];
			dockframe[i].Hide();
			int fsz;
			s / fsz % pane;

			for (int j = 0; j < pane.GetCount(); j++) {
				DockCont *dc = CreateContainer();
				s % *dc;
				dc->StateDocked(*this);
				pane << *dc;
			}
			if (fsz && pane.GetCount()) {
				dockframe[i].SetSize(fsz);
				dockframe[i].Show();
			}
			else
				dockframe[i].SetSize(0);
		}
		// Read floating
		s / cnt;
		for (int i = 0; i < cnt; i++) {
			DockCont *dc = CreateContainer();
			dc->Serialize(s);
			FloatContainer(*dc);
			dc->SerializePlacement(s, false);
		}
		// Read Autohidden
		for (int i = 0; i < 4; i++) {
			s / cnt;
			for (int j = 0; j < cnt; j++) {
				int ix;
				s / ix;
				if (ix >= 0 && ix < dockers.GetCount())
					AutoHide(i, *dockers[ix]);
			}
		}
		// Clear empty containers
		for (int i = conts.GetCount()-1; i >= 0; i--) {
			if (!conts.GetCount()) CloseContainer(conts[i]);
		}
		RefreshLayout();
	}
	bool haslay = withsavedlayouts;
	s % haslay;
	if (withsavedlayouts && (s.IsStoring() || haslay))
		s % layouts;

	s.Magic();
}
Ejemplo n.º 30
0
void StatusScreen::Refresh()
{
    RefreshLayout();
    RefreshData();
}