feat(modulo): add Esc handling in textview UI
This commit is contained in:
parent
02ec804604
commit
b2452ecca7
|
@ -43,6 +43,8 @@ class DerivedTextViewFrame : public TextViewFrame
|
||||||
protected:
|
protected:
|
||||||
void on_copy_to_clipboard( wxCommandEvent& event );
|
void on_copy_to_clipboard( wxCommandEvent& event );
|
||||||
|
|
||||||
|
void on_char_event(wxKeyEvent &event);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DerivedTextViewFrame(wxWindow *parent);
|
DerivedTextViewFrame(wxWindow *parent);
|
||||||
};
|
};
|
||||||
|
@ -52,6 +54,16 @@ DerivedTextViewFrame::DerivedTextViewFrame(wxWindow *parent)
|
||||||
{
|
{
|
||||||
this->text_content->SetValue(wxString::FromUTF8(text_view_metadata->content));
|
this->text_content->SetValue(wxString::FromUTF8(text_view_metadata->content));
|
||||||
this->SetTitle(wxString::FromUTF8(text_view_metadata->title));
|
this->SetTitle(wxString::FromUTF8(text_view_metadata->title));
|
||||||
|
|
||||||
|
|
||||||
|
Bind(wxEVT_CHAR_HOOK, &DerivedTextViewFrame::on_char_event, this, wxID_ANY);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DerivedTextViewFrame::on_char_event(wxKeyEvent &event) {
|
||||||
|
if (event.GetKeyCode() == WXK_ESCAPE)
|
||||||
|
{
|
||||||
|
Close(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DerivedTextViewFrame::on_copy_to_clipboard( wxCommandEvent& event ) {
|
void DerivedTextViewFrame::on_copy_to_clipboard( wxCommandEvent& event ) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user