void xFarDicLeitner::OnBackE(wxCommandEvent& event) { wxArrayInt selection; wxString tmpStr, msg; boxe->GetSelections(selection); if (!selection.GetCount() > 0) { msg.Printf( _("Please select a word.\n")); wxMessageBox(msg, _T("xFarDic"), wxOK | wxICON_INFORMATION, this); return; } else { if (boxacontents.GetCount() < bacap) { tmpStr = boxe->GetString(selection[0]); if (boxacontents.Index(tmpStr,FALSE) == wxNOT_FOUND) { boxacontents.Add(tmpStr); } boxecontents.RemoveAt(boxecontents.Index(tmpStr,FALSE),1); UpdateBoxes(); SubmitChanges(); } else { msg.Printf( _("Box A is full.\n")); wxMessageBox(msg, _T("xFarDic"), wxOK | wxICON_INFORMATION, this); return; } } }
void xFarDicLeitner::OnConfirm(wxCommandEvent& event) { wxArrayInt selection; wxString tmpStr, msg; wxMessageDialog *confirm; boxe->GetSelections(selection); if (!selection.GetCount() > 0) { msg.Printf( _("Please select a word.\n")); wxMessageBox(msg, _T("xFarDic"), wxOK | wxICON_INFORMATION, this); return; } else { msg.Printf( _("Are you sure that you have learnt this word?\n")); confirm = new wxMessageDialog(this, msg, _T("xFarDic"), wxYES_NO | wxNO_DEFAULT | wxICON_EXCLAMATION | wxSTAY_ON_TOP); if (confirm->ShowModal() == wxID_YES) { tmpStr = boxe->GetString(selection[0]); boxecontents.RemoveAt(boxecontents.Index(tmpStr,FALSE),1); UpdateBoxes(); SubmitChanges(); } } }
bool ofxTexture::Load(string texture_file) { ilBindImage(m_ImageId); ILboolean loaded = ilLoadImage(texture_file.c_str()); if (loaded == IL_FALSE) { ILenum error = ilGetError(); ofLogError() <<"DevIL failed to load image "<<texture_file.c_str()<<endl<<"error code "<<error; return false; } m_Locked = false; SubmitChanges(); return true; }
void xFarDicLeitner::OnClear(wxCommandEvent& event) { wxString msg; wxMessageDialog *confirm; msg.Printf( _("Are you sure that you want to clear the box contents?\n")); confirm = new wxMessageDialog(this, msg, _T("xFarDic"), wxYES_NO | wxNO_DEFAULT | wxICON_EXCLAMATION | wxSTAY_ON_TOP); if (confirm->ShowModal() == wxID_YES) { boxacontents.Empty(); boxbcontents.Empty(); boxccontents.Empty(); boxdcontents.Empty(); boxecontents.Empty(); UpdateBoxes(); SubmitChanges(); } }
/// OK button click event handler. void xFarDicLeitner::OnOK(wxCommandEvent& WXUNUSED(event)) { SubmitChanges(); Close(TRUE); }