Exemplo n.º 1
0
void MyFrame::OnShowAnswer(wxCommandEvent& WXUNUSED(event)) {
	if(m_keyword->IsShown()) {
		HideAnswer();
	} else {
		ShowAnswer();
	}
}
Exemplo n.º 2
0
void DialogCard::OnButtonNo(wxCommandEvent& event)
{
    GetActiveCard()->ScheduleReview(GRADE_TYPE_FORGET);
    HideAnswer();
    if (!AdvanceCard())
    {
        EndModal(0);
    }
}
Exemplo n.º 3
0
void MyFrame::AnswerCard(int ease) {
	m_app->AnswerCard(ease);

	HideStory();
	HideAnswer();
}
Exemplo n.º 4
0
DialogCard::DialogCard(wxWindow* parent, unsigned controls, const CardDeck& cards, const FlashCardOptions& options) :
        m_cards(cards),
        m_cardIndex(0),
        m_panelConceal(NULL),
        m_panelAnswer(NULL),
        m_htmlQuestion(NULL),
        m_htmlAnswer(NULL),
        m_buttonYes(NULL),
        m_buttonPartially(NULL),
        m_buttonNo(NULL),
        m_buttonNext(NULL),
        m_buttonPrevious(NULL),
        m_checkboxLearned(NULL),
        m_checkboxEnabled(NULL),
        m_staticRemember(NULL)
{
    wxXmlResource::Get()->LoadDialog(this, parent, wxT("DialogCard"));

    m_panelConceal      = XRCCTRL(*this, "panelConceal", wxPanel);
    m_panelAnswer       = XRCCTRL(*this, "panelAnswer", wxPanel);
    m_htmlQuestion      = XRCCTRL(*this, "htmlQuestion", wxHtmlWindow);
    m_htmlAnswer        = XRCCTRL(*this, "htmlAnswer", wxHtmlWindow);
    m_buttonYes         = XRCCTRL(*this, "buttonYes", wxButton);
    m_buttonPartially   = XRCCTRL(*this, "buttonPartially", wxButton);
    m_buttonNo          = XRCCTRL(*this, "buttonNo", wxButton);
    m_buttonNext        = XRCCTRL(*this, "buttonNext", wxButton);
    m_buttonPrevious    = XRCCTRL(*this, "buttonPrevious", wxButton);
    m_checkboxLearned   = XRCCTRL(*this, "checkboxLearned", wxCheckBox);
    m_checkboxEnabled   = XRCCTRL(*this, "checkboxEnabled", wxCheckBox);
    m_staticRemember    = XRCCTRL(*this, "staticRemember", wxStaticText);

    m_htmlQuestion->SetFonts(options.fontNameNormal, options.fontNameFixed, options.fontSizes);
    m_htmlQuestion->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(DialogCard::OnHtmlQuestionDblClick), NULL, this);
    m_htmlAnswer->SetFonts(options.fontNameNormal, options.fontNameFixed, options.fontSizes);
    m_htmlAnswer->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(DialogCard::OnHtmlAnswerDblClick), NULL, this);

    if (IS_TRUE(controls & BIT(CARD_CTRL_LEARNED)))
    {
        m_checkboxLearned->Show();
    }
    if (IS_TRUE(controls & BIT(CARD_CTRL_ENABLED)))
    {
        m_checkboxEnabled->Show();
    }
    if (IS_TRUE(controls & BIT(CARD_CTRL_NAVIGATE)))
    {
        m_buttonPrevious->Show();
        m_buttonNext->Show();
    }
    if (IS_TRUE(controls & BIT(CARD_CTRL_QUIZ)))
    {
        m_staticRemember->Show();
        m_buttonYes->Show();
        m_buttonPartially->Show();
        m_buttonNo->Show();
        HideAnswer();
    }

    UpdateCard();
    SetSize(640, 480);
}