コード例 #1
0
ファイル: LLEModulesManager.cpp プロジェクト: Aaahh/rpcs3
LLEModulesManagerFrame::LLEModulesManagerFrame(wxWindow* parent)
	: wxDialog(parent, wxID_ANY, "LLEModulesManagerFrame", wxDefaultPosition, wxSize(480, 640))
{
	wxBoxSizer *s_panel = new wxBoxSizer(wxVERTICAL);
	wxBoxSizer *s_p_panel = new wxBoxSizer(wxVERTICAL);
	wxPanel *p_main = new wxPanel(this);
	m_check_list = new wxCheckListBox(p_main, wxID_ANY);

	// select / unselect
	wxStaticBoxSizer* s_selection = new wxStaticBoxSizer(wxHORIZONTAL, p_main);
	wxButton* b_select = new wxButton(p_main, wxID_ANY, "Select All", wxDefaultPosition, wxSize(80, -1));
	wxButton* b_unselect = new wxButton(p_main, wxID_ANY, "Unselect All", wxDefaultPosition, wxSize(80, -1));
	s_selection->Add(b_select);
	s_selection->Add(b_unselect);

	s_p_panel->Add(s_selection);
	s_p_panel->Add(m_check_list, 1, wxEXPAND | wxALL, 5);
	p_main->SetSizerAndFit(s_p_panel);

	s_panel->Add(p_main, 1, wxEXPAND | wxALL, 5);
	SetSizerAndFit(s_panel);
	Refresh();
	SetSize(350, 500);

	b_select->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event) { OnSelectAll(event, true); event.Skip(); });
	b_unselect->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event) { OnSelectAll(event, false); event.Skip(); });
	Bind(wxEVT_CHECKLISTBOX, [this](wxCommandEvent& event) { UpdateSelection(event.GetInt()); event.Skip(); });
	Bind(wxEVT_SIZE, [p_main, this](wxSizeEvent& event) { p_main->SetSize(GetClientSize()); m_check_list->SetSize(p_main->GetClientSize() - wxSize(10, 50)); event.Skip(); });
}
コード例 #2
0
LRESULT CPlayList::OnLvnKeydownLsv1(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& bHandled)
{
	LPNMLVKEYDOWN pLVKeyDow = reinterpret_cast<LPNMLVKEYDOWN>(pNMHDR);
	// TODO: Add your control notification handler code here
	if (pLVKeyDow->wVKey == VK_DELETE) {
		OnBnClickedBtnRemove(0, 0, m_hWnd, bHandled);
	} else if (pLVKeyDow->wVKey == VK_ADD) {
		OnSelectAll(0, 0, 0, bHandled);
	} else if (pLVKeyDow->wVKey == VK_SPACE) {
		OnNMDblclkLsv(0, 0, bHandled);
	}
	return 0;
}