** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: views.cpp,v 1.88 2001/01/29 23:11:32 kevin Exp $
+** $Id: views.cpp,v 1.89 2001/01/30 01:21:37 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
BEGIN_EVENT_TABLE(ImageFileCanvas, wxScrolledWindow)
EVT_MOUSE_EVENTS(ImageFileCanvas::OnMouseEvent)
+EVT_CHAR(ImageFileCanvas::OnChar)
END_EVENT_TABLE()
}
}
+void
+ImageFileCanvas::OnChar (wxKeyEvent& event)
+{
+ if (event.GetKeyCode() == WXK_ESCAPE) {
+ m_xCursor = -1;
+ m_yCursor = -1;
+ if (m_pView)
+ m_pView->OnUpdate (NULL);
+ } else
+ wxScrolledWindow::OnChar (event);
+}
+
wxSize
ImageFileCanvas::GetBestSize() const
{
return false;
if (m_pCanvas) {
- //m_pCanvas->Show(false);
m_pCanvas->setView(NULL);
m_pCanvas = NULL;
}
- //m_pFrame->Show(false);
wxString s(theApp->GetAppName());
if (m_pFrame)
m_pFrame->SetTitle(s);
Activate(false);
if (deleteWindow) {
- //delete m_pFrame;
m_pFrame->Destroy();
m_pFrame = NULL;
}
return false;
if (m_pCanvas) {
- m_pCanvas->Show(false);
m_pCanvas->setView(NULL);
m_pCanvas = NULL;
}
- m_pFrame->Show(false);
wxString s(wxTheApp->GetAppName());
if (m_pFrame)
m_pFrame->SetTitle(s);
Activate(false);
if (deleteWindow) {
- //delete m_pFrame;
m_pFrame->Destroy();
m_pFrame = NULL;
}
return false;
if (m_pCanvas) {
- m_pCanvas->Show(false);
- m_pCanvas->setView(NULL);
+ m_pCanvas->setView(NULL);
m_pCanvas = NULL;
}
- m_pFrame->Show(false);
wxString s(wxTheApp->GetAppName());
if (m_pFrame)
m_pFrame->SetTitle(s);
Activate(false);
if (deleteWindow) {
-// delete m_pFrame;
m_pFrame->Destroy();
m_pFrame = NULL;
}
return false;
if (m_pCanvas) {
- //m_pCanvas->Show(false);
m_pCanvas->setView (NULL);
m_pCanvas = NULL;
}
- //m_pFrame->Show(false);
wxString s(wxTheApp->GetAppName());
if (m_pFrame)
m_pFrame->SetTitle(s);
Activate(false);
- m_pFrame->SetView(NULL);
SetFrame(NULL);
if (deleteWindow) {
- //delete m_pFrame;
m_pFrame->Destroy();
m_pFrame = NULL;
}
if (! GetDocument() || ! GetDocument()->Close())
return false;
- //m_pCanvas->Show(false);
- //m_pFrame->Show(false);
Activate(false);
SetFrame(NULL);
- m_pFrame->SetView(NULL);
if (deleteWindow) {
- //delete m_pFrame;
m_pFrame->Destroy();
m_pFrame = NULL;