Exemple #1
0
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;
        }
    }
}
Exemple #2
0
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();
        }
    }
}
Exemple #3
0
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;
}
Exemple #4
0
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();
    }
}
Exemple #5
0
/// OK button click event handler.
void xFarDicLeitner::OnOK(wxCommandEvent& WXUNUSED(event))
{
    SubmitChanges();
    Close(TRUE);
}