Esempio n. 1
0
void PathConfigPane::OnRemoveISOPath(wxCommandEvent& event)
{
  AddPendingEvent(wxCommandEvent(wxDOLPHIN_CFG_REFRESH_LIST));
  m_iso_paths_listbox->Delete(m_iso_paths_listbox->GetSelection());

// This seems to not be activated on Windows when it should be. wxw bug?
#ifdef _WIN32
  OnISOPathSelectionChanged(wxCommandEvent());
#endif

  SaveISOPathChanges();
}
Esempio n. 2
0
void InterpreterDisAsmFrame::OnKeyDown(wxKeyEvent& event)
{
	if(wxGetActiveWindow() != wxGetTopLevelParent(this))
	{
		event.Skip();
		return;
	}

	if(event.ControlDown())
	{
		if(event.GetKeyCode() == WXK_SPACE)
		{
			DoStep(wxCommandEvent());
			return;
		}
	}
	else
	{
		switch(event.GetKeyCode())
		{
		case WXK_PAGEUP:	ShowAddr( PC - (m_item_count * 2) * 4 ); return;
		case WXK_PAGEDOWN:	ShowAddr( PC ); return;
		case WXK_UP:		ShowAddr( PC - (m_item_count + 1) * 4 ); return;
		case WXK_DOWN:		ShowAddr( PC - (m_item_count - 1) * 4 ); return;
		}
	}

	event.Skip();
}
//destructor
CatheterWindow::~CatheterWindow() {
    OnSafeExit(wxCommandEvent());
    delete safeExitButton;
    delete editPanel;
    delete statusPanel;
    delete controlPanel;
}
Esempio n. 4
0
void TextureLumpArea::onNewTexture(wxCommandEvent &event)
{
	string name = wxGetTextFromUser(_T("Enter name for new texture:"), _T("New Texture"));

	if (name == _T(""))
		return;

	name.UpperCase();
	name.Truncate(8);

	texture_t tex;
	tex.width = 64;
	tex.height = 128;
	tex.name = name;
	tex.flags = 0;
	tex.x_scale = 0;
	tex.y_scale = 0;

	textures.push_back(tex);
	list_textures->Append(name);
	list_textures->Select(list_textures->GetCount() - 1);

	ta_texture->setTexture(NULL);
	onTextureListChange(wxCommandEvent());
	change = true;
}
/*virtual*/ void BFBackupTree::ValueChanged (Subject* pSender)
{
    if ( pSender != &(BFProject::Instance()) )
        return;

    this->AddPendingEvent(wxCommandEvent(wxEVT_COMMAND_MENU_SELECTED, BF_BACKUPTREE_REBUILD));
}
void VectorPanel::Reset()
{
	SimulationPanel::Reset();

	wxCommandEvent evt = wxCommandEvent();
	ClearVectorsClick(evt);
}
void CoulombPanel::Reset()
{
	TimedSimulationPanel::Reset();

	wxCommandEvent evt = wxCommandEvent();
	ClearObjectsClick(evt);
}
Esempio n. 8
0
void ProgressIndicator::mouseDown(wxMouseEvent &event)
{
	this->value = (float)event.GetPosition().x / (float)width;
	// Repaint directly - gives a nicer feedback to the user
	paintNow();

	wxCommandEvent pressEvent = wxCommandEvent(PI_SCROLL_CHANGED);
	
	QueueEvent(pressEvent.Clone());
}
Esempio n. 9
0
void TextureLumpArea::removePatch(int index)
{
	texture_t *tex = &textures[list_textures->GetSelection()];
	tex->patches.erase(tex->patches.begin() + index);

	ta_texture->setTexture(NULL);
	onTextureListChange(wxCommandEvent());

	change = true;
}
Esempio n. 10
0
void GUI::ReadConfig(){
	// Set editor files
	this->lua_editor->LoadFile(*Config::LuaInput());
	this->ass_editor->LoadFile(*Config::ASSInput());
	// Set output fields
	this->output_panel->out_file->SetValue(*Config::ASSOutput());
	this->output_panel->out_file->SetInsertionPointEnd();
	this->output_panel->cmd->SetValue(*Config::Command());
	this->output_panel->cmd->SetInsertionPointEnd();
	// Run immediately?
	if(Config::AutoRun())
		this->output_panel->GetEventHandler()->ProcessEvent( wxCommandEvent(wxEVT_COMMAND_BUTTON_CLICKED, this->output_panel->gencanc->GetId()) );
}
Esempio n. 11
0
void EventHandler::displayMenu(ChromiumDLL::ChromiumMenuInfoI* menuInfo, gcMenu *menu, int32 x, int32 y)
{
	setupLastMenuUrl(menuInfo);

	int res = 0;

	{
		HookHwnd hook((HWND)menuInfo->getHWND());
		res = TrackPopupMenu((HMENU)menu->GetHMenu(), TPM_LEFTALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD|TPM_RECURSE|TPM_NONOTIFY, x, y, 0, (HWND)menuInfo->getHWND(), nullptr);
	}

	m_pParent->AddPendingEvent(wxCommandEvent(wxEVT_COMMAND_MENU_SELECTED, res));
}
Esempio n. 12
0
void TextureLumpArea::addPatch(int index)
{
	patch_info_t p;
	p.xoff = 0;
	p.yoff = 0;
	if (index < pnames.size()) p.patch = pnames[index];
	p.patch_index = index;
	textures[list_textures->GetSelection()].patches.push_back(p);

	ta_texture->setTexture(NULL);
	onTextureListChange(wxCommandEvent());

	change = true;
}
Esempio n. 13
0
LayersMgrWidget::LayersMgrWidget(wxWindow* parent, wxWindow* stage)
	: wxPanel(parent)
	, m_stage(stage)
	, m_editedLayer(NULL)
	, m_layersSizer(NULL)
	, m_btnAdd(NULL), m_btnDel(NULL)
	, m_btnUp(NULL), m_btnDown(NULL)
{
	initLayout();
	onAddLayer(wxCommandEvent());

	m_btnDel->Enable(false);
	m_btnDown->Enable(false);
	m_btnUp->Enable(false);
}
Esempio n. 14
0
void TextureLumpArea::onDelTexture(wxCommandEvent &event)
{
	int sel = list_textures->GetSelection();

	if (sel == -1)
		return;

	textures.erase(textures.begin() + sel);
	list_textures->Delete(sel);
	list_textures->Select(sel);

	ta_texture->setTexture(NULL);
	onTextureListChange(wxCommandEvent());
	change = true;
}
void ControlPanel::OnNewPlayfile(wxCommandEvent& event) {
    if (!playfileSaved) {
        if (wxMessageBox(wxT("Current content has not been saved!"), wxT("Proceed?"),
            wxICON_QUESTION | wxYES_NO, this) == wxNO) {
            OnSavePlayfile(wxCommandEvent());
            return;
        }
    }
    //clear edit panel
    this->editPanel.resetEditPanel();

    playfileSaved = false;
    playfilePath = wxEmptyString;

    setStatusPanelText(wxT("Editing New Playfile\n"));
}
Esempio n. 16
0
HRPosToolBar::HRPosToolBar(wxWindow *parent)
: wxToolBar(parent, wxID_ANY, wxPoint(20,20)/*DefaultPosition*/,
	wxSize(parent->GetSize().GetWidth(), 30), wxBORDER_NONE|wxTB_HORIZONTAL|wxTB_NODIVIDER|wxTB_FLAT|wxTB_TEXT|wxTAB_TRAVERSAL )
{
  try
  {
	SetToolBitmapSize(wxSize(30, 30));
	AddTool(1, local->get("HR_f", "add_pos", "Add"), HR_tool(2));  //BITMAP_TYPE_BMP
	AddTool(3, local->get("HR_f", "edit_pos", "Edit"), HR_tool(1));  //BITMAP_TYPE_BMP
	AddTool(2, local->get("HR_f", "del_pos", "Delete"), HR_tool(0));

	AddSeparator();
	
	if (!(users->user().administrator())) 
	{
		EnableTool(1, false);
		EnableTool(2, false);
		EnableTool(3, false);
	}

	if (!positionrole->loaded()) positionrole->load_positionrole();
	wxString pposition [1000];
	for ( int i=0; i< positionrole->size(); i++) pposition[i] = to_uc(positionrole->get_name(i));
	lb_position = new HRListBox(parent, positionrole->size(), pposition);
	wxCommandEvent evt = wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED, 0);  
	lb_position->OnClickPos(evt);
	lb_position->Select(0);
	pos = 0;

	Realize();
  }
  catch(exception_t &e)
  {
	wxMessageBox(to_uc(e.message()));
  }
  catch(std::exception &e)
  {
	wxMessageBox(to_uc(e.what()));
  }
  catch(...)
  {
	exception_t e(5022, "unexpected error", "HRPosToolBar::HRPosToolBar");
	wxMessageBox(to_uc(e.message()));
  }
}
Esempio n. 17
0
void ScriptEditorPane::OnExecute(wxCommandEvent &event)
{
  wxASSERT(db != NULL);
  wxASSERT(execution == NULL);

  wxCommandEvent beginEvt = wxCommandEvent(PQWX_ScriptExecutionBeginning);
  beginEvt.SetEventObject(this);
  ProcessEvent(beginEvt);
  ShowScriptInProgressStatus();
  statusUpdateTimer.Start(1000);

  if (resultsBook != NULL) resultsBook->Reset();

  int length;
  wxCharBuffer source = editor->GetRegion(&length);
  execution = new ScriptExecution(this, source, length);
  execution->Proceed();
}
Esempio n. 18
0
/**
 *	Check if there is "promote" event and notify user if needed
 */
void ChatPanel::CheckForPromotion(const wxString& /*who*/, const wxString& action)
{
	if (m_reactOnPromoteEvents == false) { //If this feature disabled in options do nothing
		return;
	}

	//TODO: Make promote templates be user-configurable and uses regexp
	const wxString promoteMessageTemplate = _T(" player(s) needed for battle \"");
	const wxString promoteMessageTemplate2 = _T("). Come play and enjoy !");

	//Detect event and notify user
	//TODO: Rework for using array of regexps, not shit crap
	if (action.Contains(promoteMessageTemplate) || action.Contains(promoteMessageTemplate2)) {
		wxCommandEvent promoteEvent = wxCommandEvent(GlobalEventManager::GamePromotedEvent);
		promoteEvent.SetString(action); //Send action string with that should be shown
		GlobalEventManager::Instance()->Send(promoteEvent);
	}
}
Esempio n. 19
0
bool ToolbarPanel::DropTarget::
OnDropText(wxCoord x, wxCoord y, const wxString& data)
{
	wxString sType = data.substr(0, data.find(","));
	wxString sIndex = data.substr(data.find(",") + 1);

	long index;
	sIndex.ToLong(&index);

	auto sym = m_library->GetSymbol(index);
	if (sym)
	{
		m_toolbar->OnAddChild(wxCommandEvent(), sym);
		m_stage->m_ps->Start();
	}

	return true;
}
void ControlPanel::OnSelectPlayfile(wxCommandEvent& event) {
    if (!playfileSaved) {
        if (wxMessageBox(wxT("Current content has not been saved!"), wxT("Proceed?"),
            wxICON_QUESTION | wxYES_NO, this) == wxNO) {
            OnSavePlayfile(wxCommandEvent());
            return;
        }
    }

    wxString path = openFileDialog(wxT("Select an Existing Playfile"), playfile_wildcard);

    if (!path.IsEmpty()) {
        playfileSaved = false;
        playfilePath = path;
        loadPlayfile(playfilePath);
        setStatusPanelText(wxString::Format(wxT("Editing Existing Playfile %s\n"), playfilePath));
    }
}
Esempio n. 21
0
void CreateCodeDialog::PressOK(wxCommandEvent& ev)
{
	const wxString code_name = m_textctrl_name->GetValue();
	if (code_name.empty())
	{
		WxUtils::ShowErrorDialog(_("You must enter a name."));
		return;
	}

	long code_value;
	int base = m_checkbox_use_hex->IsChecked() ? 16 : 10;
	if (!m_textctrl_value->GetValue().ToLong(&code_value, base))
	{
		WxUtils::ShowErrorDialog(_("Invalid value."));
		return;
	}

	//wxString full_code = textctrl_code->GetValue();
	//full_code += ' ';
	//full_code += wxString::Format("0x%08x", code_value);

	// create the new code
	ActionReplay::ARCode new_cheat;
	new_cheat.active = false;
	new_cheat.name = WxStrToStr(code_name);
	const ActionReplay::AREntry new_entry(m_code_address, code_value);
	new_cheat.ops.push_back(new_entry);

	// pretty hacky - add the code to the gameini
	{
	CISOProperties isoprops(SConfig::GetInstance().m_LastFilename, this);
	// add the code to the isoproperties arcode list
	arCodes.push_back(new_cheat);
	// save the gameini
	isoprops.SaveGameConfig();
	isoprops.ActionReplayList_Load(); // loads the new arcodes
	//ActionReplay::UpdateActiveList();
	}

	// Propagate back to the parent frame to update the cheat list.
	GetEventHandler()->AddPendingEvent(wxCommandEvent(UPDATE_CHEAT_LIST_EVENT));

	Close();
}
Esempio n. 22
0
void Frame::OnClose(wxCloseEvent& event)
{
	ConfirmDialog dlg(this);
	int val = dlg.ShowModal();
	if (val == wxID_YES) 
	{
		std::string filepath = EditedFileStack::Instance()->GetBottom();
		if (!filepath.empty()) {
			m_task->Store(filepath.c_str());
		} else {
			OnSaveAs(wxCommandEvent());
		}
		Destroy();
	} 
	else if (val == wxID_NO) 
	{
		Destroy();
	}
}
Esempio n. 23
0
void PathConfigPane::OnAddISOPath(wxCommandEvent& event)
{
  wxDirDialog dialog(this, _("Choose a directory to add"), wxGetHomeDir(),
                     wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);

  if (dialog.ShowModal() == wxID_OK)
  {
    if (m_iso_paths_listbox->FindString(dialog.GetPath()) != wxNOT_FOUND)
    {
      WxUtils::ShowErrorDialog(_("The chosen directory is already in the list."));
    }
    else
    {
      AddPendingEvent(wxCommandEvent(wxDOLPHIN_CFG_RESCAN_LIST));
      m_iso_paths_listbox->Append(dialog.GetPath());
    }
  }

  SaveISOPathChanges();
}
void ControlPanel::OnSafeExit() {
    // save current Playfile
    if (!playfileSaved) {
        if (wxMessageBox(wxT("Current content has not been saved!"), wxT("Proceed?"),
            wxICON_QUESTION | wxYES_NO, this) == wxNO) {
            OnSavePlayfile(wxCommandEvent());
            return;
        }
    }

    // send Reset Command
    setStatusPanelText(wxT("Sending Reset Command..."));
    sendResetCommand();

    // close serial connection
    if (serialConnected) {
        //disconnect serial
        setStatusPanelText(wxString::Format(wxT("Closing Serial Connection on port %s\n"), portName));
        serialConnected = false;
    }
}
Esempio n. 25
0
void wxGridCellEditorEvtHandler::OnKillFocus(wxFocusEvent& event)
{
    // We must let the native control have this event so in any case don't mark
    // it as handled, otherwise various weird problems can happen (see #11681).
    event.Skip();

    // Don't disable the cell if we're just starting to edit it
    if (m_inSetFocus)
        return;

    // Tell the grid to dismiss the control but don't do it immediately as it
    // could result in the editor being destroyed right now and a crash in the
    // code searching for the next event handler, so post an event asking the
    // grid to do it slightly later instead.

    // FIXME-VC6: Once we drop support for VC6, we should use a simpler
    //            m_grid->CallAfter(&wxGrid::DisableCellEditControl) and get
    //            rid of wxEVT_GRID_HIDE_EDITOR entirely.
    m_grid->GetEventHandler()->
        AddPendingEvent(wxCommandEvent(wxEVT_GRID_HIDE_EDITOR));
}
Esempio n. 26
0
void TextureLumpArea::orderPatch(int index, bool up)
{
	texture_t *tex = &textures[list_textures->GetSelection()];
	int nindex = -1;

	if (up && index > 0)
		nindex = index - 1;
	else if (!up && index < tex->patches.size() - 1)
		nindex = index + 1;
	else
		return;

	patch_info_t p = tex->patches[index];
	tex->patches[index] = tex->patches[nindex];
	tex->patches[nindex] = p;

	ta_texture->setTexture(NULL);
	onTextureListChange(wxCommandEvent());
	ta_texture->selPatch(nindex);

	change = true;
}
Esempio n. 27
0
void CConfigMain::AddRemoveISOPaths(wxCommandEvent& event)
{
	if (event.GetId() == ID_ADDISOPATH)
	{
		wxDirDialog dialog(this, _("Choose a directory to add"), wxGetHomeDir(),
				wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);

		if (dialog.ShowModal() == wxID_OK)
		{
			if (ISOPaths->FindString(dialog.GetPath()) != -1)
			{
				wxMessageBox(_("The chosen directory is already in the list"), _("Error"), wxOK);
			}
			else
			{
				bRefreshList = true;
				ISOPaths->Append(dialog.GetPath());
			}
		}
	}
	else
	{
		bRefreshList = true;
		ISOPaths->Delete(ISOPaths->GetSelection());

		// This seems to not be activated on Windows when it should be. wxw bug?
#ifdef _WIN32
		ISOPathsSelectionChanged(wxCommandEvent());
#endif
	}

	// Save changes right away
	SConfig::GetInstance().m_ISOFolder.clear();

	for (unsigned int i = 0; i < ISOPaths->GetCount(); i++)
		SConfig::GetInstance().m_ISOFolder.push_back(WxStrToStr(ISOPaths->GetStrings()[i]));
}
void CenterOfMassAddDialog::BeforeShowing()
{
	wxCommandEvent evt = wxCommandEvent();
	ReferenceObjectComboBoxSelected(evt);
}
Esempio n. 29
0
void PathConfigPane::OnRecursiveISOCheckBoxChanged(wxCommandEvent& event)
{
  SConfig::GetInstance().m_RecursiveISOFolder = m_recursive_iso_paths_checkbox->IsChecked();

  AddPendingEvent(wxCommandEvent(wxDOLPHIN_CFG_RESCAN_LIST));
}
Esempio n. 30
0
void InterpreterDisAsmFrame::DoUpdate()
{
	Show_PC(wxCommandEvent());
	WriteRegs();
}