purpose is to be similar in appearance and functionality to a dialog, but with the flexibility of
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}
\helpref{wxWindow}{wxwindow}\\
// Redirect events to active child first
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:
// randomize();
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
TheMainWindow->SetIcon(Icon("wxpoem"));
#endif
- TheMainWindow->canvas = new MyCanvas(TheMainWindow, -1, wxDefaultPosition, wxDefaultSize);
+ TheMainWindow->canvas = new MyCanvas(TheMainWindow, 501, wxDefaultPosition, wxDefaultSize);
popupMenu = new wxMenu("", (wxFunction)PopupFunction);
popupMenu->Append(POEM_NEXT, "Next poem/page");
canvas->OnChar(event);
}
-BEGIN_EVENT_TABLE(MyCanvas, wxPanel)
+BEGIN_EVENT_TABLE(MyCanvas, wxWindow)
EVT_MOUSE_EVENTS(MyCanvas::OnMouseEvent)
EVT_CHAR(MyCanvas::OnChar)
EVT_PAINT(MyCanvas::OnPaint)
// Define a constructor for my canvas
MyCanvas::MyCanvas(wxFrame *frame, wxWindowID id, const wxPoint& pos, const wxSize& size):
- wxPanel(frame, id, pos, size)
+ wxWindow(frame, id, pos, size)
{
}
DECLARE_APP(MyApp)
// Define a new canvas which can receive some events
-class MyCanvas: public wxPanel
+class MyCanvas: public wxWindow
{
public:
MyCanvas(wxFrame *frame, wxWindowID id, const wxPoint& pos, const wxSize& size);
void wxMDIParentFrame::GetClientSize(int *width, int *height) const
{
- return wxWindow::GetClientSize(width. height);
+ wxWindow::GetClientSize(width, height);
}
void wxMDIParentFrame::OnActivate(wxActivateEvent& event)
int width, int height,
int sizeFlags)
{
- return wxWindow::DoSetSize(x, y, width, height, sizeFlags);
+ wxWindow::DoSetSize(x, y, width, height, sizeFlags);
}
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.
/* 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 ;-)
* --- 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);
#else
wait3((int *) NULL, 0, (rusage *) NULL);
wxWindow::wxWindow()
{
// Generic
+ m_isWindow = TRUE; // An optimization
m_windowId = 0;
m_windowStyle = 0;
m_windowParent = NULL;
const wxString& name)
{
// Generic
+ m_isWindow = TRUE; // An optimization
m_windowId = 0;
m_windowStyle = 0;
m_windowParent = NULL;
DUMMYOBJ=$D\dummy.obj
!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
-# 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
PERIPH_LIBS=
<<
# If taking wxWindows from CVS, setup.h doesn't exist yet.
-$(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
+# Actually the 'if not exist setup.h' test doesn't work
+# (copies the file anyway)
+# we'll have to comment this rule out.
+
+#$(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
cl @<<
case VK_DOWN:
case VK_UP:
{
-/*
-// if ( ::GetKeyState(VK_CONTROL) & 0x100 ) // Don't understand purpose of this test
- if (!MSWOnChar((WORD)wParam, lParam))
- return Default();
-*/
- break;
+ return Default();
+ break;
}
default:
if (!MSWOnChar((WORD)wParam, lParam))
wxWindow::wxWindow()
{
// Generic
+ m_isWindow = TRUE; // An optimization
m_windowId = 0;
m_windowStyle = 0;
m_windowParent = NULL;
const wxString& name)
{
// Generic
+ m_isWindow = TRUE; // An optimization
m_windowId = 0;
m_windowStyle = 0;
m_windowParent = NULL;