Fixed wxMSW arrow key bug, changed wxPoem window to a wxWindow
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1801 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -5,6 +5,10 @@ It contains minimal extra functionality over and above its parent class wxWindow
|
|||||||
purpose is to be similar in appearance and functionality to a dialog, but with the flexibility of
|
purpose is to be similar in appearance and functionality to a dialog, but with the flexibility of
|
||||||
having any window as a parent.
|
having any window as a parent.
|
||||||
|
|
||||||
|
{\it Note:} if not all characters are being intercepted by your OnKeyDown or OnChar handler,
|
||||||
|
it may be because you are using the wxTAB\_TRAVERSAL style, which grabs some keypresses for use
|
||||||
|
by child controls.
|
||||||
|
|
||||||
\wxheading{Derived from}
|
\wxheading{Derived from}
|
||||||
|
|
||||||
\helpref{wxWindow}{wxwindow}\\
|
\helpref{wxWindow}{wxwindow}\\
|
||||||
|
@@ -104,6 +104,12 @@ public:
|
|||||||
// Redirect events to active child first
|
// Redirect events to active child first
|
||||||
virtual bool ProcessEvent(wxEvent& event);
|
virtual bool ProcessEvent(wxEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DoSetSize(int x, int y,
|
||||||
|
int width, int height,
|
||||||
|
int sizeFlags = wxSIZE_AUTO);
|
||||||
|
virtual void DoSetClientSize(int width, int height);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@@ -606,13 +606,13 @@ bool MyApp::OnInit()
|
|||||||
// randomize();
|
// randomize();
|
||||||
pages[0] = 0;
|
pages[0] = 0;
|
||||||
|
|
||||||
TheMainWindow = new MainWindow(NULL, -1, "wxPoem", wxPoint(XPos, YPos), wxSize(100, 100), wxCAPTION|wxMINIMIZE_BOX|wxSYSTEM_MENU);
|
TheMainWindow = new MainWindow(NULL, 500, "wxPoem", wxPoint(XPos, YPos), wxSize(100, 100), wxCAPTION|wxMINIMIZE_BOX|wxSYSTEM_MENU);
|
||||||
|
|
||||||
#ifdef wx_x
|
#ifdef wx_x
|
||||||
TheMainWindow->SetIcon(Icon("wxpoem"));
|
TheMainWindow->SetIcon(Icon("wxpoem"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TheMainWindow->canvas = new MyCanvas(TheMainWindow, -1, wxDefaultPosition, wxDefaultSize);
|
TheMainWindow->canvas = new MyCanvas(TheMainWindow, 501, wxDefaultPosition, wxDefaultSize);
|
||||||
|
|
||||||
popupMenu = new wxMenu("", (wxFunction)PopupFunction);
|
popupMenu = new wxMenu("", (wxFunction)PopupFunction);
|
||||||
popupMenu->Append(POEM_NEXT, "Next poem/page");
|
popupMenu->Append(POEM_NEXT, "Next poem/page");
|
||||||
@@ -695,7 +695,7 @@ void MainWindow::OnChar(wxKeyEvent& event)
|
|||||||
canvas->OnChar(event);
|
canvas->OnChar(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyCanvas, wxPanel)
|
BEGIN_EVENT_TABLE(MyCanvas, wxWindow)
|
||||||
EVT_MOUSE_EVENTS(MyCanvas::OnMouseEvent)
|
EVT_MOUSE_EVENTS(MyCanvas::OnMouseEvent)
|
||||||
EVT_CHAR(MyCanvas::OnChar)
|
EVT_CHAR(MyCanvas::OnChar)
|
||||||
EVT_PAINT(MyCanvas::OnPaint)
|
EVT_PAINT(MyCanvas::OnPaint)
|
||||||
@@ -703,7 +703,7 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
// Define a constructor for my canvas
|
// Define a constructor for my canvas
|
||||||
MyCanvas::MyCanvas(wxFrame *frame, wxWindowID id, const wxPoint& pos, const wxSize& size):
|
MyCanvas::MyCanvas(wxFrame *frame, wxWindowID id, const wxPoint& pos, const wxSize& size):
|
||||||
wxPanel(frame, id, pos, size)
|
wxWindow(frame, id, pos, size)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ class MyApp: public wxApp
|
|||||||
DECLARE_APP(MyApp)
|
DECLARE_APP(MyApp)
|
||||||
|
|
||||||
// Define a new canvas which can receive some events
|
// Define a new canvas which can receive some events
|
||||||
class MyCanvas: public wxPanel
|
class MyCanvas: public wxWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyCanvas(wxFrame *frame, wxWindowID id, const wxPoint& pos, const wxSize& size);
|
MyCanvas(wxFrame *frame, wxWindowID id, const wxPoint& pos, const wxSize& size);
|
||||||
|
@@ -133,7 +133,7 @@ void wxMDIParentFrame::OnSize(wxSizeEvent& event)
|
|||||||
|
|
||||||
void wxMDIParentFrame::GetClientSize(int *width, int *height) const
|
void wxMDIParentFrame::GetClientSize(int *width, int *height) const
|
||||||
{
|
{
|
||||||
return wxWindow::GetClientSize(width. height);
|
wxWindow::GetClientSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMDIParentFrame::OnActivate(wxActivateEvent& event)
|
void wxMDIParentFrame::OnActivate(wxActivateEvent& event)
|
||||||
@@ -240,12 +240,12 @@ void wxMDIParentFrame::DoSetSize(int x, int y,
|
|||||||
int width, int height,
|
int width, int height,
|
||||||
int sizeFlags)
|
int sizeFlags)
|
||||||
{
|
{
|
||||||
return wxWindow::DoSetSize(x, y, width, height, sizeFlags);
|
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMDIParentFrame::DoSetClientSize(int width, int height)
|
void wxMDIParentFrame::DoSetClientSize(int width, int height)
|
||||||
{
|
{
|
||||||
return wxWindow::DoSetClientSize(width, height);
|
wxWindow::DoSetClientSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Responds to colour changes, and passes event on to children.
|
// Responds to colour changes, and passes event on to children.
|
||||||
|
@@ -98,7 +98,7 @@ void xt_notify_end_process(XtPointer client, int *fid,
|
|||||||
/* wait4 is not part of any standard, use at own risk
|
/* wait4 is not part of any standard, use at own risk
|
||||||
* not sure what wait4 does, but wait3 seems to be closest, whats a digit ;-)
|
* not sure what wait4 does, but wait3 seems to be closest, whats a digit ;-)
|
||||||
* --- offer@sgi.com */
|
* --- offer@sgi.com */
|
||||||
#if !defined(__sgi) && !defined(__SGI__) && !defined(__ALPHA__) && !defined(__SUNCC__)
|
#if !defined(__HPUX__) && !defined(__sgi) && !defined(__SGI__) && !defined(__ALPHA__) && !defined(__SUNCC__)
|
||||||
wait4(process_data->pid, NULL, 0, NULL);
|
wait4(process_data->pid, NULL, 0, NULL);
|
||||||
#else
|
#else
|
||||||
wait3((int *) NULL, 0, (rusage *) NULL);
|
wait3((int *) NULL, 0, (rusage *) NULL);
|
||||||
|
@@ -86,6 +86,7 @@ END_EVENT_TABLE()
|
|||||||
wxWindow::wxWindow()
|
wxWindow::wxWindow()
|
||||||
{
|
{
|
||||||
// Generic
|
// Generic
|
||||||
|
m_isWindow = TRUE; // An optimization
|
||||||
m_windowId = 0;
|
m_windowId = 0;
|
||||||
m_windowStyle = 0;
|
m_windowStyle = 0;
|
||||||
m_windowParent = NULL;
|
m_windowParent = NULL;
|
||||||
@@ -265,6 +266,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
|||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
// Generic
|
// Generic
|
||||||
|
m_isWindow = TRUE; // An optimization
|
||||||
m_windowId = 0;
|
m_windowId = 0;
|
||||||
m_windowStyle = 0;
|
m_windowStyle = 0;
|
||||||
m_windowParent = NULL;
|
m_windowParent = NULL;
|
||||||
|
@@ -25,10 +25,10 @@ LIBTARGET=$(WXLIB)
|
|||||||
DUMMYOBJ=$D\dummy.obj
|
DUMMYOBJ=$D\dummy.obj
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
# Please set these according to the settings in wx_setup.h, so we can include
|
# Please set these according to the settings in setup.h, so we can include
|
||||||
# the appropriate libraries in wx.lib
|
# the appropriate libraries in wx.lib
|
||||||
|
|
||||||
# This one overrides the others, to be consistent with the settings in wx_setup.h
|
# This one overrides the others, to be consistent with the settings in setup.h
|
||||||
MINIMAL_WXWINDOWS_SETUP=0
|
MINIMAL_WXWINDOWS_SETUP=0
|
||||||
|
|
||||||
PERIPH_LIBS=
|
PERIPH_LIBS=
|
||||||
@@ -356,10 +356,14 @@ $(CPPFLAGS) $(MAKEPRECOMP) /Fo$D\dummydll.obj /c /Tp dummydll.cpp
|
|||||||
<<
|
<<
|
||||||
|
|
||||||
# If taking wxWindows from CVS, setup.h doesn't exist yet.
|
# If taking wxWindows from CVS, setup.h doesn't exist yet.
|
||||||
$(WXDIR)\include\wx\msw\setup.h: $(WXDIR)\include\wx\msw\setup0.h
|
# Actually the 'if not exist setup.h' test doesn't work
|
||||||
cd "$(WXDIR)"\include\wx\msw
|
# (copies the file anyway)
|
||||||
if not exist setup.h copy setup0.h setup.h
|
# we'll have to comment this rule out.
|
||||||
cd "$(WXDIR)"\src\msw
|
|
||||||
|
#$(WXDIR)\include\wx\msw\setup.h: $(WXDIR)\include\wx\msw\setup0.h
|
||||||
|
# cd "$(WXDIR)"\include\wx\msw
|
||||||
|
# if not exist setup.h copy setup0.h setup.h
|
||||||
|
# cd "$(WXDIR)"\src\msw
|
||||||
|
|
||||||
..\common\$D\extended.obj: ..\common\extended.c
|
..\common\$D\extended.obj: ..\common\extended.c
|
||||||
cl @<<
|
cl @<<
|
||||||
|
@@ -1254,12 +1254,8 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
case VK_DOWN:
|
case VK_DOWN:
|
||||||
case VK_UP:
|
case VK_UP:
|
||||||
{
|
{
|
||||||
/*
|
return Default();
|
||||||
// if ( ::GetKeyState(VK_CONTROL) & 0x100 ) // Don't understand purpose of this test
|
break;
|
||||||
if (!MSWOnChar((WORD)wParam, lParam))
|
|
||||||
return Default();
|
|
||||||
*/
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if (!MSWOnChar((WORD)wParam, lParam))
|
if (!MSWOnChar((WORD)wParam, lParam))
|
||||||
|
@@ -59,6 +59,7 @@ END_EVENT_TABLE()
|
|||||||
wxWindow::wxWindow()
|
wxWindow::wxWindow()
|
||||||
{
|
{
|
||||||
// Generic
|
// Generic
|
||||||
|
m_isWindow = TRUE; // An optimization
|
||||||
m_windowId = 0;
|
m_windowId = 0;
|
||||||
m_windowStyle = 0;
|
m_windowStyle = 0;
|
||||||
m_windowParent = NULL;
|
m_windowParent = NULL;
|
||||||
@@ -146,6 +147,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
|||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
// Generic
|
// Generic
|
||||||
|
m_isWindow = TRUE; // An optimization
|
||||||
m_windowId = 0;
|
m_windowId = 0;
|
||||||
m_windowStyle = 0;
|
m_windowStyle = 0;
|
||||||
m_windowParent = NULL;
|
m_windowParent = NULL;
|
||||||
|
Reference in New Issue
Block a user