Exemplo n.º 1
0
void ParameterControlsHelper::OnParameterBtClick(wxCommandEvent& event)
{
    wxWindow * control = dynamic_cast<wxWindow*>(event.GetEventObject());
    if (!control) return;

    std::size_t i = gd::String(control->GetName()).To<std::size_t>();
    if (i >= paramMetadata.size() || i >= paramEdits.size()) return;
    if (!editionCallback || !editionCallbackProject || !editionCallbackLayout) return;

    const ParameterMetadata & metadata = paramMetadata[i];
    editionCallback(window, *editionCallbackProject, *editionCallbackLayout, metadata, paramEdits, i);
}
Exemplo n.º 2
0
void SimpleTransientPopup::OnButton(wxCommandEvent& event)
{
    wxLogMessage( "%p SimpleTransientPopup::OnButton ID %d", this, event.GetId());

    wxButton *button = wxDynamicCast(event.GetEventObject(), wxButton);
    if (button->GetLabel() == wxT("Press Me"))
        button->SetLabel(wxT("Pressed"));
    else
        button->SetLabel(wxT("Press Me"));

    event.Skip();
}
Exemplo n.º 3
0
//------------------------------------------------------------------------------
// void OnCheckBoxChange(wxCommandEvent& event)
//------------------------------------------------------------------------------
void GroundTrackPlotPanel::OnCheckBoxChange(wxCommandEvent& event)
{
   if (event.GetEventObject() == mShowPlotCheckBox)
   {
      mHasDataOptionChanged = true;
   }
   else
   {
   }
   
   EnableUpdate(true);
}
Exemplo n.º 4
0
void CodeFormatterDlg::OnCheckBox( wxCommandEvent& event )
{
    size_t flag(0);
    wxObject *obj = event.GetEventObject();
    if (obj == m_checkBoxFormatBreakBlocks) {
        flag = AS_BREAK_BLOCKS;
    } else if (obj == m_checkBoxFormatBreakBlocksAll) {
        flag = AS_BREAK_BLOCKS_ALL;
    } else if (obj == m_checkBoxFormatBreakElseif) {
        flag = AS_BREAK_ELSEIF;
    } else if (obj == m_checkBoxFormatFillEmptyLines) {
        flag = AS_FILL_EMPTY_LINES;
    } else if (obj == m_checkBoxFormatOneLineKeepBlocks) {
        flag = AS_ONE_LINE_KEEP_BLOCKS;
    } else if (obj == m_checkBoxFormatOneLineKeepStmnt) {
        flag = AS_ONE_LINE_KEEP_STATEMENT;
    } else if (obj == m_checkBoxFormatPadOperators) {
        flag = AS_PAD_OPER;
    } else if (obj == m_checkBoxFormatPadParenth) {
        flag = AS_PAD_PARENTHESIS;
    } else if (obj == m_checkBoxFormatPadParentIn) {
        flag = AS_PAD_PARENTHESIS_IN;
    } else if (obj == m_checkBoxFormatPadParentOut) {
        flag = AS_PAD_PARENTHESIS_OUT;
    } else if (obj == m_checkBoxFormatUnPadParent) {
        flag = AS_UNPAD_PARENTHESIS;
    } else if (obj == m_checkBoxIndentBrackets) {
        flag = AS_INDENT_BRACKETS;
    } else if (obj == m_checkBoxIndentLabels) {
        flag = AS_INDENT_LABELS;
    } else if (obj == m_checkBoxIndentMaxInst) {
        flag = AS_MAX_INSTATEMENT_INDENT;
    } else if (obj == m_checkBoxIndentMinCond) {
        flag = AS_MIN_COND_INDENT;
    } else if (obj == m_checkBoxIndentNamespaces) {
        flag = AS_INDENT_NAMESPACES;
    } else if (obj == m_checkBoxIndentPreprocessors) {
        flag = AS_INDENT_PREPROCESSORS;
    } else if (obj == m_checkBoxIndetBlocks) {
        flag = AS_INDENT_BLOCKS;
    } else if (obj == m_checkBoxIndetCase) {
        flag = AS_INDENT_CASE;
    } else if (obj == m_checkBoxIndetClass) {
        flag = AS_INDENT_CLASS;
    } else if (obj == m_checkBoxIndetSwitch) {
        flag = AS_INDENT_SWITCHES;
    }

    size_t options = m_options.GetOptions();
    EnableFlag(options, flag, event.IsChecked());
    m_options.SetOption(options);
    UpdatePreview();
}
Exemplo n.º 5
0
void 
hoxChesscapePlayer::OnConnectionResponse_PlayerData( wxCommandEvent& event )
{
    const hoxResponse_APtr apResponse( wxDynamicCast(event.GetEventObject(), hoxResponse) );

    /* Handle error-code. */

    if ( apResponse->code != hoxRC_OK )
    {
        wxLogDebug("%s: *INFO* Received response-code [%s].", 
            __FUNCTION__, hoxUtil::ResultToStr(apResponse->code));

        /* Close the connection and logout.
         */
        this->LeaveAllTables();
        this->DisconnectFromServer();
        m_site->OnShutdownReadyFromLocalPlayer();
        wxLogDebug("%s: END (exception).", __FUNCTION__);
        return;  // *** Exit immediately.
    }

	/* Parse for the command */

	wxString command;
	wxString paramsStr;

	if ( ! _ParseIncomingCommand( apResponse->data, command, paramsStr ) ) // failed?
	{
		wxLogWarning("%s: Failed to parse incoming command.", __FUNCTION__);
		return;  // *** Exit immediately.
	}

	/* Processing the command... */
    wxLogDebug("%s: +++ command = [%s]...", __FUNCTION__, command.c_str());

    if      ( command == "login" )         _HandleCmd_Login( apResponse, paramsStr );
    else if ( command == "code" )          _HandleCmd_Code( apResponse, paramsStr );
    else if ( command == "logout" )        _HandleCmd_Logout( paramsStr );
    else if ( command == "clients" )       _HandleCmd_Clients( paramsStr );
	else if ( command == "show" )          _HandleCmd_Show( paramsStr );
	else if ( command == "unshow" )        _HandleCmd_Unshow( paramsStr );
	else if ( command == "update" )        _HandleCmd_Update( paramsStr );
	else if ( command == "updateRating" )  _HandleCmd_UpdateRating( paramsStr );
    else if ( command == "updateStatus" )  _HandleCmd_UpdateStatus( paramsStr );
    else if ( command == "playerInfo" )    _HandleCmd_PlayerInfo( paramsStr );
	else if ( command == "tCmd" )	       _HandleTableCmd( paramsStr );
	else if ( command == "tMsg" )	       _HandleMsg( paramsStr, true /* Public message */ );
    else if ( command == "iMsg" )	       _HandleMsg( paramsStr, false /* Instant message */ );
	else
	{
		wxLogDebug("%s: *INFO* Ignore command = [%s].", __FUNCTION__, command.c_str());
	}
}
Exemplo n.º 6
0
/**
 * Button event, called when a button is clicked
*/
void GamepadConfiguration::OnButtonClicked(wxCommandEvent &event)
{
    // Affichage d'un message à chaque clic sur le bouton
    wxButton *bt_tmp = (wxButton *)event.GetEventObject(); // get the button object
    int bt_id = bt_tmp->GetId();                           // get the real ID
    if (bt_id == m_bt_ok->GetId()) {                       // If the button ID is equals to the Ok button ID
        Close();                                           // Close the window
    } else if (bt_id == m_bt_cancel->GetId()) {            // If the button ID is equals to the cancel button ID
        reset();                                           // reinitialize the value of each parameters
        Close();                                           // Close the window
    }
}
Exemplo n.º 7
0
void CatheterFrame::OnButton(wxCommandEvent& e) {
    //wxMessageBox("CatheterFrame::OnButton");
    switch (e.GetId()) {
        case ID_LOAD_PLAYFILE_BUTTON:
        case ID_SAVE_PLAYFILE_BUTTON:
        case ID_LOGFILE_BUTTON:
            CatheterFrame::AddPath(e.GetId());
            break;
        case ID_CLEARPACKET_BUTTON:
            CatheterFrame::ClearPacketWindow();
            break;
        case ID_CLEARALLPACKETS_BUTTON:
            CatheterFrame::ClearAllPacketWindows();
            break;
        case ID_PREVPACKET_BUTTON:
            CatheterFrame::SwitchPacketView(-1);
            break;
        case ID_NEXTPACKET_BUTTON:
            CatheterFrame::SwitchPacketView(1);
            break;
        case ID_ADDPACKET_BUTTON:
            CatheterFrame::AddPacket();
            break;
        case ID_PREVIEWPACKETS_BUTTON:
            CatheterFrame::PreviewPackets();
            break;
        case ID_CONNECT_BUTTON:
            ((wxButton*)(e.GetEventObject()))->SetLabel(wxString("Connected"));
            gui_serial_connect();
            break;
        case ID_SENDPACKETS_BUTTON:
            CatheterFrame::SendPackets();
            break;
        case ID_GLOBALRESET_BUTTON:
            CatheterFrame::SendGlobalResetPacket();
            break;
        case ID_SOURCEPLAYFILE:
            sourceIsPlayfile=true;
            break;
        case ID_SOURCEWINDOW:
            sourceIsPlayfile=false;
            break;
        case ID_CURRENT_BUTTON1:
        case ID_CURRENT_BUTTON2:
        case ID_CURRENT_BUTTON3:
        case ID_CURRENT_BUTTON4:
        case ID_CURRENT_BUTTON5:
        case ID_CURRENT_BUTTON6:
            CatheterFrame::OnApplyCurrent(e.GetId());
            break;
    }
}
Exemplo n.º 8
0
void ParameterControlsHelper::OnOptionalCheckboxClick(wxCommandEvent& event)
{
    wxWindow * control = dynamic_cast<wxWindow*>(event.GetEventObject());
    if (!control) return;

    std::size_t i = gd::String(control->GetName()).To<std::size_t>();
    if (i >= paramCheckboxes.size()) return;

    bool enable = paramCheckboxes.at(i)->GetValue();
    paramBmpBts.at(i)->Enable(enable);
    paramTexts.at(i)->Enable(enable);
    paramEdits.at(i)->Enable(enable);
}
Exemplo n.º 9
0
void manual_entry_f::num_btnClick( wxCommandEvent& event )
{
	// TODO: Implement num_btnClick
	wxTextCtrl* ed = dynamic_cast<wxTextCtrl*>(active_);
	if (ed == 0) return;
	wxButton* btn = dynamic_cast<wxButton*>(event.GetEventObject());
	if (btn == 0) return;
	ed->SetValue(ed->GetValue() + btn->GetLabel());
	if (card_num_ed->GetValue() != _("") && exp_month_ed->GetValue() != _("") && exp_year_ed->GetValue() != _("") && cvv2_ed->GetValue() != _(""))
		ok_btn->Enable(true);
	else
		ok_btn->Enable(false);
}
Exemplo n.º 10
0
/// React to style type choice
void wxRichTextStyleListCtrl::OnChooseType(wxCommandEvent& event)
{
    if (event.GetEventObject() != m_styleChoice)
        event.Skip();
    else
    {
        if (m_dontUpdate)
            return;

        wxRichTextStyleListBox::wxRichTextStyleType styleType = StyleIndexToType(event.GetSelection());
        m_styleListBox->SetStyleType(styleType);
    }
}
Exemplo n.º 11
0
void MainFrame::OnConfigChanged(wxCommandEvent &event){

	event.StopPropagation();
	wxObject *obj = event.GetEventObject();
	if (obj == NULL){
		wxLogMessage("null event object");
		return;
	}

	event.Skip(false);
	ConfigModified();
	NotifyConfigChanged();
}
Exemplo n.º 12
0
void text_f::space_btnClick( wxCommandEvent& event )
{
	// TODO: Implement space_btnClick
	wxButton* btn = dynamic_cast<wxButton*>(event.GetEventObject());
	if (btn == 0) return;
	if (active_ == text_ed) {
		text_ed->WriteText(_(" "));
	}
	if (passwd_) {
		vkbdEvent throw_event(_(" "), WXK_RETURN);
		GetParent()->GetEventHandler()->ProcessEvent(throw_event);
	}
}
Exemplo n.º 13
0
/*****
Respond to the has-symmetry check box.
*****/
void tmwxTreePanel::OnCheckBox(wxCommandEvent& event)
{
  wxObject* theCheckBox = event.GetEventObject();
  if (theCheckBox == mHasSymmetry) {
    SetSymEnable(mHasSymmetry->GetValue());
    mTree->SetHasSymmetry(mHasSymmetry->GetValue());
  }
  else
    TMFAIL("unknown checkbox");
  
  gDocManager->GetCurrentDocumentLocal()->
    SubmitCommand(wxT("Edit Tree"));
}
Exemplo n.º 14
0
/* MainApp::onMenu
 * Called when a menu item is selected in the application
 *******************************************************************/
void MainApp::onMenu(wxCommandEvent& e)
{
	// Find applicable action
	string action = "";
	SAction* s_action = NULL;
	for (unsigned a = 0; a < actions.size(); a++)
	{
		if (actions[a]->getWxId() == e.GetId())
		{
			action = actions[a]->getId();
			s_action = actions[a];
			break;
		}
	}

	// If action is valid, send to all action handlers
	bool handled = false;
	if (!action.IsEmpty())
	{
		current_action = action;
		handled = doAction(action);

		// Check if triggering object is a menu item
		if (s_action && s_action->type == SAction::CHECK)
		{
			if (e.GetEventObject() && e.GetEventObject()->IsKindOf(wxCLASSINFO(wxMenuItem)))
			{
				wxMenuItem* item = (wxMenuItem*)e.GetEventObject();
				item->Check(s_action->toggled);
			}
		}

		current_action = "";
	}

	// If not handled, let something else handle it
	if (!handled)
		e.Skip();
}
Exemplo n.º 15
0
void DisassemblyDialog::onDebuggerEvent(wxCommandEvent& evt)
{
	wxEventType type = evt.GetEventType();
	if (type == debEVT_SETSTATUSBARTEXT)
	{
		CtrlDisassemblyView* view = reinterpret_cast<CtrlDisassemblyView*>(evt.GetEventObject());
		if (view != NULL && view == currentCpu->getDisassembly())
			GetStatusBar()->SetLabel(evt.GetString());
	} else if (type == debEVT_UPDATELAYOUT)
	{
		if (currentCpu != NULL)
			currentCpu->GetSizer()->Layout();
		topSizer->Layout();
		update();
	} else if (type == debEVT_GOTOINMEMORYVIEW)
	{
		if (currentCpu != NULL)
		{
			currentCpu->showMemoryView();
			currentCpu->getMemoryView()->gotoAddress(evt.GetInt());
			currentCpu->getDisassembly()->SetFocus();
		}
	} else if (type == debEVT_RUNTOPOS)
	{
		// todo: breakpoints for iop
		if (currentCpu != eeTab)
			return;
		CBreakPoints::AddBreakPoint(evt.GetInt(),true);
		currentCpu->getCpu()->resumeCpu();
	} else if (type == debEVT_GOTOINDISASM)
	{
		if (currentCpu != NULL)
		{
			currentCpu->getDisassembly()->gotoAddress(r5900Debug.getPC());
			currentCpu->getDisassembly()->SetFocus();
			update();
		}
	} else if (type == debEVT_STEPOVER)
	{
		if (currentCpu != NULL)
			stepOver();
	} else if (type == debEVT_STEPINTO)
	{
		if (currentCpu != NULL)
			stepInto();
	} else if (type == debEVT_UPDATE)
	{
		update();
	}
}
Exemplo n.º 16
0
void DialogCropVolume::OnSpinBoundText( wxCommandEvent& event )
{
  for ( int i = 0; i < 6; i++ )
  {
    if ( event.GetEventObject() == m_spinRange[i] )
    {
      long nValue = -1;
      event.GetString().ToLong( &nValue );
      if ( nValue <= m_spinRange[i]->GetMax() && nValue >=  m_spinRange[i]->GetMin() )
        MainWindow::GetMainWindowPointer()->GetVolumeCropper()->SetExtent( i, nValue );
      break;
    }
  }
}
Exemplo n.º 17
0
/**
 * Checkbox event, called when the value of the checkbox change
*/
void GamepadConfiguration::OnCheckboxChange(wxCommandEvent &event)
{
    wxCheckBox *cb_tmp = (wxCheckBox *)event.GetEventObject(); // get the slider object
    int cb_id = cb_tmp->GetId();
    if (cb_id == m_cb_rumble->GetId()) {
        g_conf.pad_options[m_pad_id].forcefeedback = (m_cb_rumble->GetValue()) ? (u32)1 : (u32)0;
        if (m_cb_rumble->GetValue()) {
            s_vgamePad[m_pad_id]->TestForce();
            m_sl_rumble_intensity->Enable();
        } else {
            m_sl_rumble_intensity->Disable();
        }
    }
}
Exemplo n.º 18
0
//-----------------------------------------------------------------------------
void TerrainBrushPanel::OnSliderUpdate (wxCommandEvent &event)
{
	if (event.GetEventObject() == mSize)
	{
		int value = mSize->GetValue();
		if (value > 0)
		{
			float size = ((float)value/10.0f) * SIZE_ADJUST;
			EditSystem::GetSingleton().GetTerrainEdit()->GetBrush()->SetSize(
				size);
		}
	}
	else if (event.GetEventObject() == mStrength)
	{
		int value = mStrength->GetValue();
		if (value > 0)
		{
			float strength = ((float)value/100.0f) * STENGTH_ADJUST;
			EditSystem::GetSingleton().GetTerrainEdit()->GetBrush()
				->SetStrength(strength);
		}
	}
}
Exemplo n.º 19
0
void EffectRack::OnDown(wxCommandEvent & evt)
{
   wxBitmapButton *btn =  static_cast<wxBitmapButton *>(evt.GetEventObject());

   evt.Skip();

   size_t index = GetEffectIndex(btn);
   if (index < 0 || index == (mMainSizer->GetChildren().GetCount() / NUMCOLS) - 1)
   {
      return;
   }

   MoveRowUp(index + 1);
}
Exemplo n.º 20
0
void EffectRack::OnEditor(wxCommandEvent & evt)
{
   wxBitmapButton *btn =  static_cast<wxBitmapButton *>(evt.GetEventObject());

   evt.Skip();

   int index = GetEffectIndex(btn);
   if (index < 0)
   {
      return;
   }

   mEffects[index]->PromptUser(GetParent());
}
Exemplo n.º 21
0
void EffectRack::OnUp(wxCommandEvent & evt)
{
   wxBitmapButton *btn =  static_cast<wxBitmapButton *>(evt.GetEventObject());

   evt.Skip();

   int index = GetEffectIndex(btn);
   if (index <= 0)
   {
      return;
   }

   MoveRowUp(index);
}
Exemplo n.º 22
0
Arquivo: view.cpp Projeto: EdgarTx/wx
// TODO: must find out how to intercept the Return key, rather than
// every key stroke. But for now, do every key stroke.
void csDiagramView::OnPointSizeComboText(wxCommandEvent& event)
{
    wxComboBox* combo = (wxComboBox*) event.GetEventObject();
    wxASSERT( combo != NULL );

    wxString str(combo->GetValue());
    long newPointSize;
    str.ToLong( &newPointSize );

    if (newPointSize < 2)
        return;

    ApplyPointSize(newPointSize);
}
Exemplo n.º 23
0
//---------------------------------------------------------
void CSG_3DView_Dialog::On_Update_Control(wxCommandEvent &event)
{
//	CHECKBOX_UPDATE(m_pBox   , "DRAW_BOX");
//	CHECKBOX_UPDATE(m_pStereo, "STEREO"  );

	if( event.GetEventObject() == m_pRotate_X )
	{
		m_pPanel->Get_Projector().Set_xRotation(m_pRotate_X->Get_Value() * M_DEG_TO_RAD);
		m_pPanel->Update_View();
	}

	if( event.GetEventObject() == m_pRotate_Z )
	{	
		m_pPanel->Get_Projector().Set_zRotation(m_pRotate_Z->Get_Value() * M_DEG_TO_RAD);
		m_pPanel->Update_View();
	}

	if( event.GetEventObject() == m_pCentral )
	{	
		m_pPanel->m_Parameters("CENTRAL_DIST")->Set_Value(m_pCentral->Get_Value());
		m_pPanel->Update_View();
	}
}
Exemplo n.º 24
0
void wxGenericCollapsiblePane::OnButton(wxCommandEvent& event)
{
    if ( event.GetEventObject() != m_pButton )
    {
        event.Skip();
        return;
    }

    Collapse(!IsCollapsed());

    // this change was generated by the user - send the event
    wxCollapsiblePaneEvent ev(this, GetId(), IsCollapsed());
    GetEventHandler()->ProcessEvent(ev);
}
void GenericSliderProperties::OnButton(wxCommandEvent& event)
{
	int id = event.GetId();
	wxObject *obj = event.GetEventObject();
	if(isDecimal)incr = 0.01;
	else incr = 1;
	if(id == ID_INCRUP)
	{
		if(obj == min_up)setMin(min+incr);
		if(obj == max_up)setMax(max+incr);
		if(obj == tick_up)setTick(tick+1);
	}
	if(id == ID_INCRDOWN)
	{
		if(obj == min_down)setMin(min-incr);
		if(obj == max_down)setMax(max-incr);
		if(obj == tick_down)setTick(tick-1);
	}
	if(id == ID_ACCEPT2)
	{
		winSlider->setCurrentMinMax(min,max);
		winSlider->setTicks(tick);
		winSlider->Refresh(false);
		Close(true);
	}
	if(id == ID_CANCEL2)
	{
		winSlider->setCurrentMinMax(minOld,maxOld);
		winSlider->setTicks(tickOld);
		winSlider->getValueText()->SetBackgroundColour(colorPanelOld);
		winSlider->Refresh(false);
		Close(true);
	}
	if(id == ID_APPLY)
	{
		winSlider->setCurrentMinMax(min,max);
		winSlider->setTicks(tick);
		winSlider->Refresh(false);
	}
	if(id == ID_COLOR2)
	{
		wxColourDialog dial(this);
		dial.SetTitle(wxT("Color Picker"));
		if(dial.ShowModal()!= wxID_OK)return;
		colorPanel = dial.GetColourData().GetColour();
		winSlider->getValueText()->SetBackgroundColour(colorPanel);
		winSlider->Refresh(false);
	}
	event.Skip();
}
Exemplo n.º 26
0
void ParameterPanel::OnTextEnter(wxCommandEvent &event)
{
    int n = find_in_rows(event.GetEventObject());
    wxTextCtrl *tc = rows_[n].text;
    if (tc->GetValue() == double2wxstr(values_[n]))
        return;
    double t;
    bool ok = tc->GetValue().ToDouble(&t);
    if (ok) {
        values_[n] = t;
        observer_->on_parameter_changed(n);
    } else
        tc->ChangeValue(double2wxstr(values_[n]));
}
Exemplo n.º 27
0
void wxWizardEx::OnBackOrNext(wxCommandEvent& event)
{
    wxASSERT_MSG( (event.GetEventObject() == m_btnNext) ||
                  (event.GetEventObject() == m_btnPrev),
                  wxT("unknown button") );

    wxCHECK_RET( m_page, _T("should have a valid current page") );

    // ask the current page first: notice that we do it before calling
    // GetNext/Prev() because the data transfered from the controls of the page
    // may change the value returned by these methods
    if (event.GetEventObject() == m_btnNext)
    {
        if ( !m_page->Validate() || !m_page->TransferDataFromWindow() )
        {
            // the page data is incorrect, don't do anything
            return;
        }
    }

    bool forward = event.GetEventObject() == m_btnNext;

    wxWizardPageEx *page;
    if ( forward )
    {
        page = m_page->GetNext();
    }
    else // back
    {
        page = m_page->GetPrev();

        wxASSERT_MSG( page, wxT("\"<Back\" button should have been disabled") );
    }

    // just pass to the new page (or maybe not - but we don't care here)
    (void)ShowPage(page, forward);
}
Exemplo n.º 28
0
//------------------------------------------------------------------------------
// void FunctionSetupPanel::OnButton(wxCommandEvent& event)
//------------------------------------------------------------------------------
void FunctionSetupPanel::OnButton(wxCommandEvent& event)
{
   // This is Save button which was renamed from OK button
   if (event.GetEventObject() == theOkButton)
   {
      #ifdef DEBUG_FUNCTIONPANEL_BUTTON
      MessageInterface::ShowMessage
         (wxT("FunctionSetupPanel::OnButton() entered, it is Save Button\n"));
      #endif
      
      if (mIsNewFunction)
         OnSaveAs(event);
      else
         SaveData();
   }
   // This is SaveAs button which was renamed from Apply button
   else if (event.GetEventObject() == theApplyButton)
   {
      #ifdef DEBUG_FUNCTIONPANEL_BUTTON
      MessageInterface::ShowMessage
         (wxT("FunctionSetupPanel::OnButton() entered, it is SaveAs Button\n"));
      #endif
      
      OnSaveAs(event);
   }
   // This is Close button which was renamed from Cancel button
   else if (event.GetEventObject() == theCancelButton)
   {
      #ifdef DEBUG_FUNCTIONPANEL_BUTTON
      MessageInterface::ShowMessage
         (wxT("FunctionSetupPanel::OnButton() entered, it is Close Button, canClose=%d\n"),
          canClose);
      #endif
      
      GmatAppData::Instance()->GetMainFrame()->CloseActiveChild();
   }
}
Exemplo n.º 29
0
void CFilterDialog::OnFilterSelect(wxCommandEvent& event)
{
	wxCheckListBox* pLocal = XRCCTRL(*this, "ID_LOCALFILTERS", wxCheckListBox);
	wxCheckListBox* pRemote = XRCCTRL(*this, "ID_REMOTEFILTERS", wxCheckListBox);

	int item = event.GetSelection();

	const CFilter& filter = m_filters[item];
	const bool localOnly = filter.IsLocalFilter();
	if (localOnly && event.GetEventObject() != pLocal) {
		pRemote->Check(item, false);
		wxMessageBoxEx(_("Selected filter only works for local files."), _("Cannot select filter"), wxICON_INFORMATION);
		return;
	}


	if (m_shiftClick) {
		if (event.GetEventObject() == pLocal) {
			if (!localOnly)
				pRemote->Check(item, pLocal->IsChecked(event.GetSelection()));
		}
		else
			pLocal->Check(item, pRemote->IsChecked(event.GetSelection()));
	}

	if (m_currentFilterSet) {
		m_filterSets[0] = m_filterSets[m_currentFilterSet];
		m_currentFilterSet = 0;
		wxChoice* pChoice = XRCCTRL(*this, "ID_SETS", wxChoice);
		pChoice->SetSelection(0);
	}

	bool localChecked = pLocal->IsChecked(event.GetSelection());
	bool remoteChecked = pRemote->IsChecked(event.GetSelection());
	m_filterSets[0].local[item] = localChecked;
	m_filterSets[0].remote[item] = remoteChecked;
}
Exemplo n.º 30
0
//------------------------------------------------------------------------------
// void OnButtonClick(wxCommandEvent& event)
//------------------------------------------------------------------------------
void MultiPathSetupPanel::OnButtonClick(wxCommandEvent& event)
{
   wxString pathname = mFileTextCtrl->GetValue();
   int selected = mPathListBox->GetSelection();
   wxString pathSelected = mPathListBox->GetString(selected);
   
   // check if directory exist
   if (!wxDir::Exists(pathname))
   {
      wxMessageBox(wxT("The directory \"" + pathname + "\" does not exist.\n"),
                   wxT("Directory Error"));
      return;
   }
   
   pathname = pathname.Strip(wxString::both);
   if (!pathname.EndsWith("/"))
      pathname = pathname + "/";
   
   if (event.GetEventObject() == mAddButton)
   {
      if (pathname != "" && mPathListBox->FindString(pathname) == wxNOT_FOUND)
      {
         // Add to top of the list (loj: 2008.10.20)
         //mPathListBox->Append(pathname);
         mPathListBox->Insert(pathname, 0);
         mPathListBox->SetStringSelection(pathname);
      }
   }
   else if (event.GetEventObject() == mReplaceButton)
   {
      if (pathSelected != "")
         mPathListBox->SetString(selected, pathname);
   }
   
   mFileTextCtrl->SetValue("");
   mHasDataChanged = true;
}