Beispiel #1
0
void AGIPane::calcagain(double x,double y){
	_new[0] = ensmall(x);
     _new[1] = ensmall(y);
     int n = data->num;
     if(data->isPCA && nowindex >= n){
     	_new[0] = _new[0]/ coodrate;
     	_new[1] = _new[1]/ coodrate;
     }
     ag->refine(_pre, _new, nowindex) ;
     int atr = data->atr;
     
     double** v = new double*[atr];
     if(data->isPCA){
     		//PCAのときはePをvに入れる
     		for(int i = 0;i< atr;i++){
     			v[i] = new double[2];
     			v[i][0] = ag->getV(i,0);
     			v[i][1] = ag->getV(i,1);
     		}
     	}
     	else{
     		for(int i = 0 ; i< atr; i++){
     			v[i] = new double[2];
   				v[i][0] = ag->getB(n + i, 0);
    			v[i][1] = ag->getB(n + i, 1);
     		}
     	}
     	pcp->refine(v); 
     	if(nowindex < n)
     		md->setText(nowindex);
     	auto parent = GetGrandParent();
     	parent-> Refresh();
    
}
Beispiel #2
0
void VideoDisplay::UpdateSize() {
	auto provider = con->project->VideoProvider();
	if (!provider || !IsShownOnScreen()) return;

	videoSize.Set(provider->GetWidth(), provider->GetHeight());
	videoSize *= zoomValue;
	if (con->videoController->GetAspectRatioType() != AspectRatio::Default)
		videoSize.SetWidth(videoSize.GetHeight() * con->videoController->GetAspectRatioValue());

	wxEventBlocker blocker(this);
	if (freeSize) {
		wxWindow *top = GetParent();
		while (!top->IsTopLevel()) top = top->GetParent();

		wxSize cs = GetClientSize();
		wxSize oldSize = top->GetSize();
		top->SetSize(top->GetSize() + videoSize / scale_factor - cs);
		SetClientSize(cs + top->GetSize() - oldSize);
	}
	else {
		SetMinClientSize(videoSize / scale_factor);
		SetMaxClientSize(videoSize / scale_factor);

		GetGrandParent()->Layout();
	}

	PositionVideo();
}
Beispiel #3
0
void AGIPane::keyPressed(wxKeyEvent& event){
	   std::cerr << "keyPressed" << std::endl; 
	   if(logmode && logid < logvector.size()){
	   	//nodeを読み込み計算する	
	   	auto nodelog = logvector.at(logid);
	   	if(logid %2 == 0){
	   		nowindex = nodelog.index;
	   		_pre[0] = nodelog.x;
	   		_pre[1] = nodelog.y;
	   		if(nowindex < data->num)
	   			data->setSIndex(nowindex);
	   		auto parent = GetGrandParent();
	   		parent->Refresh();
	   	}
	   	else {
	   		_new[0] = nodelog.x;
	   		_new[1] = nodelog.y;
	   		calcagain(nodelog.x*xyrate + getWidth()/2, nodelog.y *xyrate + getWidth()/2);

	   	}
	   	logid++;
	   	if(logid == logvector.size()){
	   	 std::cerr << " DONE ALL" << std::endl; 
	   	logmode = false;
	   }
	   }
	   
}
Beispiel #4
0
void VideoDisplay::UpdateSize() {
	if (!con->videoController->IsLoaded() || !IsShownOnScreen()) return;

	videoSize.Set(con->videoController->GetWidth(), con->videoController->GetHeight());
	videoSize *= zoomValue;
	if (con->videoController->GetAspectRatioType() != 0)
		videoSize.SetWidth(videoSize.GetHeight() * con->videoController->GetAspectRatioValue());

	wxEventBlocker blocker(this);
	if (freeSize) {
		wxWindow *top = GetParent();
		while (!top->IsTopLevel()) top = top->GetParent();

		wxSize cs = GetClientSize();
		wxSize oldSize = top->GetSize();
		top->SetSize(top->GetSize() + videoSize - cs);
		SetClientSize(cs + top->GetSize() - oldSize);
	}
	else {
		SetMinClientSize(videoSize);
		SetMaxClientSize(videoSize);

		GetGrandParent()->Layout();
	}

	PositionVideo();
}
void CScrolledTextBox::OnEraseBackground(wxEraseEvent& event) {
    wxDC *dc = event.GetDC();
    wxPoint p = GetParent()->GetPosition();
    wxRect r = GetRect();
    r.Offset(p);
    wxBitmap backgroundBitmap = ((CSimpleTaskPanel*)GetGrandParent())->GetBackgroundBmp().GetSubBitmap(r);
    dc->DrawBitmap(backgroundBitmap, 0, 0);
}
Beispiel #6
0
void JoystickPanelImpl::onEnabled(wxCommandEvent& event)
{
	if (m_Enabled->IsChecked()) {
		m_AxesPanel->Show();
	} else {
		m_AxesPanel->Hide();
	}
	GetGrandParent()->Layout();
}
Beispiel #7
0
void CMemoryView::OnPopupMenu(wxCommandEvent& event)
{
	CFrame* main_frame = static_cast<CFrame*>(GetGrandParent()->GetParent());
	CCodeWindow* code_window = main_frame->g_pCodeWindow;
	CWatchWindow* watch_window = code_window->m_WatchWindow;

#if wxUSE_CLIPBOARD
	wxTheClipboard->Open();
#endif

	switch (event.GetId())
	{
#if wxUSE_CLIPBOARD
		case IDM_COPYADDRESS:
			wxTheClipboard->SetData(new wxTextDataObject(wxString::Format("%08x", selection)));
			break;

		case IDM_COPYHEX:
			{
			std::string temp = StringFromFormat("%08x", debugger->ReadExtraMemory(memory, selection));
			wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
			}
			break;
#endif

		case IDM_WATCHADDRESS:
			debugger->AddWatch(selection);
			if (watch_window)
				watch_window->NotifyUpdate();
			Refresh();
			break;

		case IDM_TOGGLEMEMORY:
			memory ^= 1;
			Refresh();
			break;

		case IDM_VIEWASFP:
			viewAsType = VIEWAS_FP;
			Refresh();
			break;

		case IDM_VIEWASASCII:
			viewAsType = VIEWAS_ASCII;
			Refresh();
			break;
		case IDM_VIEWASHEX:
			viewAsType = VIEWAS_HEX;
			Refresh();
			break;
	}

#if wxUSE_CLIPBOARD
	wxTheClipboard->Close();
#endif
	event.Skip();
}
Beispiel #8
0
void CRegisterView::OnPopupMenu(wxCommandEvent& event)
{
  CFrame* main_frame = static_cast<CFrame*>(GetGrandParent()->GetParent());
  CCodeWindow* code_window = main_frame->g_pCodeWindow;
  CWatchWindow* watch_window = code_window->m_WatchWindow;
  CMemoryWindow* memory_window = code_window->m_MemoryWindow;

  switch (event.GetId())
  {
  case IDM_WATCHADDRESS:
    PowerPC::watches.Add(m_selectedAddress);
    if (watch_window)
      watch_window->NotifyUpdate();
    Refresh();
    break;
  case IDM_VIEWMEMORY:
    if (memory_window)
      memory_window->JumpToAddress(m_selectedAddress);
    Refresh();
    break;
  case IDM_VIEWCODE:
    code_window->JumpToAddress(m_selectedAddress);
    Refresh();
    break;
  case IDM_VIEW_HEX8:
    m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::Hex8);
    Refresh();
    break;
  case IDM_VIEW_HEX16:
    m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::Hex16);
    Refresh();
    break;
  case IDM_VIEW_INT:
    m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::Int);
    Refresh();
    break;
  case IDM_VIEW_UINT:
    m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::UInt);
    Refresh();
    break;
  case IDM_VIEW_FLOAT:
    m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::Float);
    Refresh();
    break;
  case IDM_VIEW_DOUBLE:
    m_register_table->SetRegisterFormat(m_selectedColumn, m_selectedRow, FormatSpecifier::Double);
    Refresh();
    break;
  }
  event.Skip();
}
Beispiel #9
0
void CWatchView::OnPopupMenu(wxCommandEvent& event)
{
  CFrame* main_frame = static_cast<CFrame*>(GetGrandParent()->GetParent());
  CCodeWindow* code_window = main_frame->g_pCodeWindow;
  CWatchWindow* watch_window = code_window->m_WatchWindow;
  CMemoryWindow* memory_window = code_window->m_MemoryWindow;
  CBreakPointWindow* breakpoint_window = code_window->m_BreakpointWindow;

  wxString strNewVal;
  TMemCheck MemCheck;

  switch (event.GetId())
  {
  case IDM_DELETEWATCH:
    strNewVal = GetValueByRowCol(m_selectedRow, 1);
    if (TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress))
    {
      PowerPC::watches.Remove(m_selectedAddress);
      if (watch_window)
        watch_window->NotifyUpdate();
      Refresh();
    }
    break;
  case IDM_ADDMEMCHECK:
    MemCheck.StartAddress = m_selectedAddress;
    MemCheck.EndAddress = m_selectedAddress;
    MemCheck.bRange = false;
    MemCheck.OnRead = true;
    MemCheck.OnWrite = true;
    MemCheck.Log = true;
    MemCheck.Break = true;
    PowerPC::memchecks.Add(MemCheck);

    if (breakpoint_window)
      breakpoint_window->NotifyUpdate();
    Refresh();
    break;
  case IDM_VIEWMEMORY:
    if (memory_window)
      memory_window->JumpToAddress(m_selectedAddress);
    Refresh();
    break;
  }
  event.Skip();
}
Beispiel #10
0
void CScrolledTextBox::SetValue(const wxString& s) {
    int lineHeight, totalLines, availableWidth;
    wxString t = s;

    // Delete sizer & its children (CTransparentStaticText objects)
    m_TextSizer->Clear(true);

    // Change all occurrences of "<sup>n</sup>" to "^n"
    t.Replace(wxT("<sup>"), wxT("^"), true);
    t.Replace(wxT("</sup>"), wxT(""), true);

    wxSize taskPanelSize = GetGrandParent()->GetSize();
    availableWidth = taskPanelSize.GetWidth() - (2*SIDEMARGINS);
    totalLines = Wrap(t, availableWidth - SCROLLBARWIDTH, &lineHeight);
    
    m_TextSizer->FitInside(this);
    SetScrollRate(1, lineHeight);
}
Beispiel #11
0
void VideoDisplay::SetTool(std::unique_ptr<VisualToolBase> new_tool) {
	toolBar->ClearTools();
	toolBar->Realize();
	toolBar->Show(false);

	tool = std::move(new_tool);
	tool->SetToolbar(toolBar);

	// Update size as the new typesetting tool may have changed the subtoolbar size
	if (!freeSize)
		UpdateSize();
	else {
		// UpdateSize fits the window to the video, which we don't want to do
		GetGrandParent()->Layout();
		tool->SetDisplayArea(viewport_left / scale_factor, viewport_top / scale_factor,
		                     viewport_width / scale_factor, viewport_height / scale_factor);
	}
}
Beispiel #12
0
// Define a constructor
PianoWin::PianoWin(wxFrame *frame):
      wxWindow(frame, wxID_ANY, wxPoint(20,20), wxSize(5,5), wxSIMPLE_BORDER)
{
    m_index_last = -1;
    m_iactive = -1;

    m_hover_icon_last = -1;
    m_hover_last = -1;
    m_brounded = false;

    gparent = (MyFrame *)GetGrandParent();

    m_nRegions = 0;

    SetBackgroundStyle(wxBG_STYLE_CUSTOM);  // on WXMSW, this prevents flashing on color scheme change

    m_pVizIconBmp = NULL;
    m_pInVizIconBmp = NULL;

 }
Beispiel #13
0
void t_File::UpdateDisplay(int)
{
  char tmp[256];

  // write Filename
  myString name=myProject.GetTSFileName();
  if (name=="")
    {
      name=TIME_NODATA;
    }
  DataFile->SetValue(name.chars());

  // write selected points
  UpdateSelected();
  
  // write total Points
  sprintf(tmp,"%i",myProject.GetTotalPoints());
  Total->SetLabel(tmp);

  // check Reverse scale
  ReverseScale->SetValue(myProject.GetReverseScale());

  // 
  wxMenuBar *menu=((wxFrame*)GetGrandParent())->GetMenuBar();
  menu->Check(M_TIMESTRING_NAME_WEIGHT,myProject.GetUseNameWeight());
  menu->Check(M_TIMESTRING_POINT_WEIGHT,myProject.GetUsePointWeight());

  // now set the lists
  int i;
  for (i=0;i<4;i++)
    {
      // fill the lists
      FillList(Lists[i],i);
      // set the label
      Label[i]->SetLabel(myProject.NameSet(i).chars());
    }

}
Beispiel #14
0
 // And we need to force the focus back when being destroyed
 ~wxSTCListBox() {
     GetGrandParent()->SetFocus();
 }
Beispiel #15
0
 void OnChar(wxKeyEvent& event) {
     GetGrandParent()->GetEventHandler()->ProcessEvent(event);
 }
Beispiel #16
0
//~~ std::list<AdePackage*> getNamespacePackages() [AdeClass] ~~

std::list<AdePackage*> list;
AdeModelElement* anElement = GetGrandParent();

while (anElement && ((anElement->GetType() & ITEM_TYPE_MASK) == ITEM_IS_PACKAGE))
{
	AdePackage* aPackage = dynamic_cast<AdePackage*>(anElement);
	AdeModelElement* helper = anElement;
	anElement = anElement->GetParent();
	if (aPackage->isNamespace())
		list.push_back(aPackage);
	else
		delete helper;
}

delete anElement;

return list;