Example #1
0
void wxPropertyList::OnCellChange( wxGridEvent& event )
{
    int row = event.GetRow();

    wxPropertyItem *pItem = GetPropertyItemFromRow(row);
    if(pItem && row != wxNOT_FOUND)
    {
        // write propery back, and set as new
        pItem->SetNewValue(true);
        
        // write back bool
        if(pItem->GetItemType() == CHECKBOX)
        {
            if(GetCellValue(row, 1).IsSameAs("1"))
                pItem->SetCurValue("ON");
            else
                pItem->SetCurValue("OFF");
        }
        else
            pItem->SetCurValue(GetCellValue(row, 1));
    
        UpdatePropertyItem(pItem, row);
        event.Skip();
    }
}
//--------------------------------------------------------------------------------
void DialogResourceGroups::OnCellEdit( wxGridEvent& event )
{
    wxString groupName = m_groupsGrid->GetCellValue( event.GetRow(), 0 );

    // did we edit the name?
    if ( event.GetCol() == 0 )
    {
        // has the name actually changed?
        if ( m_oldGroupName.Cmp( groupName ) != 0 )
        {
            if ( renameResourceGroup( m_oldGroupName, groupName ) )
                m_oldGroupName = groupName;
            else
                m_groupsGrid->SetCellValue( event.GetRow(), 0, m_oldGroupName );
        }
    }
    // update the directory value instead
    else
    {
        setGroupDirectory(
            groupName,
            m_groupsGrid->GetCellValue( event.GetRow(), 1 ) );
    }

    event.Skip();
}
Example #3
0
void CManagePasswordPolicies::OnSelectCell( wxGridEvent& evt )
{
  if (evt.GetEventObject() == m_PolicyNames) {
    m_curPolRow = evt.GetRow();
    UpdateDetails();
  }
}
Example #4
0
/// Intercept cell data change event.
void ctPropertyEditor::OnChangeCell(wxGridEvent& event)
{
    int row = event.GetRow();
    int col = event.GetCol();

    ApplyCellValueToProperty(row, col);
}
Example #5
0
void CWatchView::OnMouseDownR(wxGridEvent& event)
{
  // popup menu
  int row = event.GetRow();
  int col = event.GetCol();

  m_selectedRow = row;

  if (col == 1 || col == 2)
  {
    wxString strNewVal = GetValueByRowCol(row, col);
    TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress);
  }

  wxMenu menu;
  if (row != 0 && row != static_cast<int>(PowerPC::debug_interface.GetWatches().size() + 1))
  {
    // i18n: This kind of "watch" is used for watching emulated memory.
    // It's not related to timekeeping devices.
    menu.Append(IDM_DELETEWATCH, _("&Delete watch"));
  }

  if (row != 0 && row != static_cast<int>(PowerPC::debug_interface.GetWatches().size() + 1) &&
      (col == 1 || col == 2))
  {
    menu.Append(IDM_ADDMEMCHECK, _("Add memory &breakpoint"));
    menu.Append(IDM_VIEWMEMORY, _("View &memory"));
  }
  PopupMenu(&menu);
}
Example #6
0
void MultiViewerMain::OnTableDBGridLeftClick( wxGridEvent& event )
{
	if(eGridAdding != m_eGridState) {
		event.Skip();
		return;
	}


	if(m_nAddRow == event.GetRow())
	{
		if(	AddSQLRow() == false) 
			return;
	}
	else if(m_nCancelRow == event.GetRow())
	{
		int nTotalRow = m_pTableDBDataGrid->GetNumberRows();
		m_pTableDBDataGrid->DeleteRows(m_nEditRow, m_nEditRowCount + GridAddingModeRowCount);
		m_nEditRow = -1;
		m_nAddRow = -1;
		m_nCancelRow = -1;
	}
	else
	{
		event.Skip();
		return;
	}

	m_eGridState = eGridCommon;
}
Example #7
0
//------------------------------------------------------------------------------
void ForPanel::OnCellRightClick(wxGridEvent& event)
{
   Integer row = event.GetRow();
   Integer col = event.GetCol();

   GetNewValue(row, col);
}     
Example #8
0
void nwxGrid::OnEditorEnd(wxGridEvent &e)
{
  if(m_nEditorOn)
  {
    m_nEditorOn--;

    int nRow = e.GetRow();
    int nCol = e.GetCol();
    // memory leak on following line
    wxGridCellEditor *pEdit = GetCellEditor(nRow, nCol);
    wxControl *pControl = (pEdit == NULL) ? NULL : pEdit->GetControl();
    wxTextCtrl *pText = 
      (pControl == NULL)
      ? NULL
      : wxDynamicCast(pControl,wxTextCtrl);
    if(pText != NULL)
    {
      wxString s;
      s = pText->GetValue();
      if(s == m_sEditorStartValue || s != m_sValue)
      {
        // value hasn't changed but we still want to force a 
        // CELL_CHANGED event
        wxGridEvent ee(e);
        ee.SetEventType(wxEVT_GRID_CELL_CHANGED);
        AddPendingEvent(ee);
      }
      if(pEdit != NULL)
      {
        pEdit->DecRef();
      }
    }
  }
  e.Skip();
}
void NetBuilderProperties_frame::OnCellClick( wxGridEvent& event )
{
  MainFrame *myparent=(MainFrame *) GetParent();
  int error=0;
  wxChar *endptr;
  char rest[100];
  if (event.GetRow()==3){
	pop_selected=event.GetCol();
	int total_fdomains_value= (int) wxStrtol(Properties_grid->GetCellValue(2,pop_selected),&endptr,10);
	strcpy(rest,wxString(endptr).mb_str());
	rest[100-1]='\0';
	if (total_fdomains_value > 0 && strcmp(rest,"")==0){
	  if (total_fdomains_value!=population[pop_selected].total_fdomains)
	    Initialize_Fdomains(pop_selected,total_fdomains_value);
	}
	else{
	  myparent->text_status->SetForegroundColour( wxColour( 247, 22, 10 ) );
	  wxLogMessage(wxT(">> WARNING: fdomains of population ") + int2wxStr(pop_selected) + wxT(" must be an integer greater than 0."));
	  myparent->text_status->SetForegroundColour( wxColour( 0, 0, 0 ) );
	  error=-1;
	}
	if (error==0) {
	  population[pop_selected].total_fdomains=wxAtoi(Properties_grid->GetCellValue(2,pop_selected));
	  this->Enable(false);
	  NetBuilderDynamics_frame *Dynamics_frame=new NetBuilderDynamics_frame(this);
	  Dynamics_frame->Show();
	}
  }
  event.Skip();
}
Example #10
0
void SubModelsDialog::OnNodesGridLabelLeftClick(wxGridEvent& event)
{
    SelectRow(event.GetRow());
    if (event.GetRow() != -1) {
        NodesGrid->GoToCell(event.GetRow(), 0);
    }
}
void LibraryDialog::OnClick(wxGridEvent& event)
{
	int row = event.GetRow();
	switch(event.GetId())
	{
	case IDG_DEVICES:
		p_proj_item = (projectoritem*) storage::storage_item_for_row(&storage::list_projectoritem,row);

		grid_channels->set_list(NULL);
		grid_states->set_list(NULL);
		grid_values->set_list(NULL);

		if(p_proj_item != NULL)
		{
			grid_channels->set_list(&p_proj_item->list_projectorchannelitem,new_projectorchannelitem,p_proj_item);
			grid_states->set_list(&p_proj_item->list_stateitem);
		}
		break;
	case IDG_CHANNELS:
		if(p_proj_item != NULL)
		{
			p_proj_chn_item = (projectorchannelitem*) storage::storage_item_for_row(&p_proj_item->list_projectorchannelitem,row);
			grid_values->set_list(NULL);
			
			if(p_proj_chn_item->get_type() == projectorchannelitem::T_VALUE)
				grid_values->set_list(&p_proj_chn_item->list_valueitem,new_valueitem,p_proj_chn_item);
		}
		break;
	}
	event.Skip();
}
Example #12
0
void GridFrame::OnCellBeginDrag( wxGridEvent& ev )
{
    wxLogMessage(_T("Got request to drag cell at row %d, col %d"),
                 ev.GetRow(), ev.GetCol());

    ev.Skip();
}
Example #13
0
void CRegisterView::OnMouseDownR(wxGridEvent& event)
{
  // popup menu
  m_selectedRow = event.GetRow();
  m_selectedColumn = event.GetCol();

  wxString strNewVal = m_register_table->GetValue(m_selectedRow, m_selectedColumn);
  TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress);

  wxMenu menu;
  menu.Append(IDM_WATCHADDRESS, _("Add to &watch"));
  menu.Append(IDM_VIEWMEMORY, _("View &memory"));
  menu.Append(IDM_VIEWCODE, _("View &code"));
  if (m_selectedRow < 32 &&
      (m_selectedColumn == 1 || m_selectedColumn == 3 || m_selectedColumn == 4))
  {
    menu.AppendSeparator();
    if (m_selectedColumn == 1)
    {
      menu.Append(IDM_VIEW_HEX8, _("View as hexadecimal"));
      menu.Append(IDM_VIEW_INT, _("View as signed integer"));
      menu.Append(IDM_VIEW_UINT, _("View as unsigned integer"));
      menu.Append(IDM_VIEW_FLOAT, _("View as float"));
    }
    else
    {
      menu.Append(IDM_VIEW_HEX16, _("View as hexadecimal"));
      menu.Append(IDM_VIEW_DOUBLE, _("View as double"));
    }
  }
  PopupMenu(&menu);
}
Example #14
0
void HueConfDlg::onLightCellChange( wxGridEvent& event ) {
  m_Row = event.GetRow();
  m_Col = event.GetCol();
  TraceOp.trc( "hueconf", TRCLEVEL_INFO, __LINE__, 9999, "cell changed: %d,%d", m_Row, m_Col );
  m_labChangedLight->SetLabel( m_LightsGrid->GetCellValue(m_Row, 0) + wxT(": ") + m_LightsGrid->GetCellValue(m_Row, 1) );
  m_SetLight->Enable(true);
}
Example #15
0
void TagsEditor::OnChange(wxGridEvent & event)
{
   static bool ischanging = false;

   // Prevent recursion
   if (ischanging) {
      return;
   }

   event.Skip();

   if (event.GetCol() != 0) {
      return;
   }

   wxString n = mGrid->GetCellValue(event.GetRow(), 0);
   for (size_t i = 0; i < STATICCNT; i++) {
      if (n.CmpNoCase(labelmap[i].label) == 0) {
         ischanging = true;
         wxBell();
         mGrid->SetGridCursor(i, 0);
         event.Veto();
         ischanging = false;
         break;
      }
   }

   return;
}
Example #16
0
void CWatchView::OnMouseDownR(wxGridEvent& event)
{
  // popup menu
  int row = event.GetRow();
  int col = event.GetCol();

  m_selectedRow = row;

  if (col == 1 || col == 2)
  {
    wxString strNewVal = GetValueByRowCol(row, col);
    TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress);
  }

  wxMenu menu;
  if (row != 0 && row != (int)(PowerPC::watches.GetWatches().size() + 1))
    menu.Append(IDM_DELETEWATCH, _("&Delete watch"));

  if (row != 0 && row != (int)(PowerPC::watches.GetWatches().size() + 1) && (col == 1 || col == 2))
  {
    menu.Append(IDM_ADDMEMCHECK, _("Add memory &breakpoint"));
    menu.Append(IDM_VIEWMEMORY, _("View &memory"));
  }
  PopupMenu(&menu);
}
Example #17
0
void wxGISTableView::OnSelectCell(wxGridEvent& event)
{
    event.Skip();
	m_position->Clear();
	(*m_position) << event.GetRow() + 1;

}
void CEditLanguageDialog::OnGridDataChanged(wxGridEvent& event)
{
    std::map<TString, std::map<ELanguageType, TString> >& languageMap = CLanguageManager::GetInstance()->GetLanguageMap();
    std::map<TString, TString>& languageTagMap = CLanguageManager::GetInstance()->GetLanguageTagMap();
    int nRow = event.GetRow();
    int nCol = event.GetCol();
    wxString strValue = m_pLanguageGrid->GetCellValue(nRow, nCol);
    TString strEnumStr = m_pLanguageGrid->GetRowLabelValue(nRow);
    auto languageIter = languageMap.find(strEnumStr);
    BEATS_ASSERT(languageIter != languageMap.end());
    if (nCol == eLT_Count)
    {
        if (strValue.empty())
        {
            languageTagMap.erase(strEnumStr);
        }
        else
        {
            languageTagMap[strEnumStr] = strValue.ToUTF8();
        }
    }
    else
    {
        languageIter->second[(ELanguageType)nCol] = strValue.ToUTF8();
    }
}
void ExtImportPrefs::OnRuleTableEdit (wxGridEvent& event)
{
    int row = event.GetRow();
    int col = event.GetCol();
    ExtImportItems *items = Importer::Get().GetImportItems();
    ExtImportItem *item = &(*items)[row];
    RuleTable->SaveEditControlValue();

    wxString val = RuleTable->GetCellValue (row, col);
    int fixSpaces = wxNO;
    bool askedAboutSpaces = false;
    wxArrayString vals;
    wxString delims(wxT(":"));
    Importer::Get().StringToList (val, delims, vals);
    switch (col)
    {
    case 0:
        item->extensions.Clear();
        break;
    case 1:
        item->mime_types.Clear();
        break;
    }

    for (size_t i = 0; i < vals.Count(); i++)
    {

        wxString trimmed = vals[i];
        trimmed.Trim().Trim(false);
        if (trimmed.Cmp(vals[i]) != 0)
        {
            if (!askedAboutSpaces)
            {
                fixSpaces = wxMessageBox(_(
                                             "There are space characters (spaces, newlines, tabs or linefeeds) in one of \
the items. They are likely to break the pattern matching. Unless you know \
what you are doing, it is recommended to trim spaces. Do you want \
Audacity to trim spaces for you?"
                                         ),_("Spaces detected"), wxYES_NO);
                askedAboutSpaces = true;
            }
            if (fixSpaces != wxYES)
            {
                trimmed = vals[i];
            }
            else
            {
                vals[i] = trimmed;
            }
        }
        switch (col)
        {
        case 0:
            item->extensions.Add (trimmed);
            break;
        case 1:
            item->mime_types.Add (trimmed);
            break;
        }
    }
Example #20
0
void wxGridCtrl::OnLabelLeftClick(wxGridEvent& event)
{
    event.Skip();
    if (event.GetRow() != wxNOT_FOUND)
	{
        SetGridCursor(event.GetRow(),0);
    }
}
Example #21
0
/// Intercept selection event.
void ctPropertyEditor::OnSelectCell(wxGridEvent& event)
{
    int row = event.GetRow();

    UpdateDescription(row);

    event.Skip();
}
Example #22
0
void PropGrid::OnCellSelected( wxGridEvent& ev )
{
	currentSelection.TopRow=ev.GetRow();
	currentSelection.LeftCol=ev.GetCol();
	currentSelection.BottomRow=ev.GetRow();
	currentSelection.RightCol=ev.GetCol();
    ev.Skip();
}
Example #23
0
void DIALOG_FOOTPRINT_WIZARD_LIST::OnCellFpGeneratorClick( wxGridEvent& event )
{
    int click_row = event.GetRow();
    m_footprintWizard = FOOTPRINT_WIZARDS::GetWizard( click_row );
    m_footprintGeneratorsGrid->SelectRow( event.GetRow(), false );
    // Move the grid cursor to the active line, mainly for aesthetic reasons:
    m_footprintGeneratorsGrid->GoToCell( event.GetRow(), FP_GEN_ROW_NUMBER );
}
Example #24
0
void wxGridCtrl::OnLabelLeftClick(wxGridEvent& event)
{
    if (event.GetRow() != -1)
    {
        SetGridCursor(event.GetRow(),0);
    }
    event.Skip();
}
void mxDesktopTestGrid::OnCellRightClick (wxGridEvent & event) {
	wxGrid::SetGridCursor(event.GetRow(),event.GetCol());
	wxMenu menu;
	menu.Append(mxID_DESKTOP_LIST_COPY_ONE,"Copiar esta celda");
	menu.Append(mxID_DESKTOP_LIST_COPY_ALL,"Copiar toda la tabla");
	menu.Append(mxID_DESKTOP_LIST_GOTO_LINE,"Marcar esta linea en el algoritmo");
	PopupMenu(&menu);
}
void GLIDebugVariableGrid::OnCellSelect(wxGridEvent &gridEvent)
{
  //Select the row when a cell has been selected
  SelectRow(gridEvent.GetRow());

  //Allow other processing
  gridEvent.Skip();
}
Example #27
0
void Grid::OnSelectCell(wxGridEvent &event)
{
    event.Skip();

#if wxUSE_ACCESSIBILITY
    mAx->SetCurrentCell(event.GetRow(), event.GetCol());
#endif
}
void CGridAlerts::OnCellChange(wxGridEvent &e)
{
  if( !(m_nInCellChangeEvent || IsTableReadOnly()) )
  {
    CIncrementer x(m_nInCellChangeEvent);
    nwxGridBatch xxxx(this);
    int nRow = e.GetRow();
    int nCol = e.GetCol();
    COARmessage *pMsg = m_pMsgEdit->GetMessage((size_t) nRow);
    int nCols = GetNumberCols();
    const wxString &sName(pMsg->GetMessageName());
    if(nCol == (nCols - 1))
    {
      UpdateTextFromRow(nRow,pMsg);
    }
    else if(nCol == (nCols - 2))
    {
      UpdateDisabledFromRow(nRow,pMsg);
      if((!sName.IsEmpty()) && GetBoolValue(nRow,nCol))
      {
        // a row has been enabled
        // check for mutually exclusive rows
        // that are enabled and disable them

        set<wxString> ss;
        const COARmsgExportMap *pMsgExp = m_pMsgEdit->GetMsgExport();
        if(pMsgExp->GetGroupsByMsgName(sName,&ss))
        {
          // we found group names
          size_t nCount = m_pMsgEdit->GetMessageCount();
          size_t iRow;
          for(iRow = 0; iRow < nCount; iRow++)
          {
            if(iRow == (size_t)nRow)
            {}
            else if(!GetBoolValue(iRow,nCol))
            {} // already unchecked, fuhgeddaboudit.
            else
            {
              COARmessage *pMsgA = m_pMsgEdit->GetMessage(iRow);
              const wxString &sNameA(pMsgA->GetMessageName());
              if(sNameA.IsEmpty())
              {}
              else if( (sNameA == sName) ||
                  (pMsgExp->HasGroupByMsgName(sNameA,ss)) )
              {
                // need to uncheck message
                SetBoolValue(iRow,nCol,false);
                UpdateDisabledFromRow(iRow,pMsgA);
              }
            }
          }
        }
      }
    }
  }
  e.Skip(true);
}
Example #29
0
void TableFrame::OnColMoveEvent( wxGridEvent& ev )
{
    LOG_MSG("Entering TableFrame::OnColMoveEvent");
    LOG(ev.GetCol());
    LOG(ev.GetPosition().x);
    LOG(ev.GetPosition().y);
    table_base->notifyColMove();
    LOG_MSG("Exiting TableFrame::OnColMoveEvent");
}
void LMSImportChannelMapDialog::OnChannelMapGridCellChange(wxGridEvent& event)
{
    int row = event.GetRow();
    int col = event.GetCol();
    std::string s = ChannelMapGrid->GetCellValue(row, col).ToStdString();
    ChannelMapGrid->SetCellBackgroundColour(row, 4, channelColors[s].asWxColor());
    MapByStrand->Enable(false);
    ChannelMapGrid->Refresh();
}