#include "wx/event.h"
#include "wx/string.h"
#include "wx/list.h"
+#include "wx/region.h"
#define wxKEY_SHIFT 1
#define wxKEY_CTRL 2
// Accept files for dragging
virtual void DragAcceptFiles(bool accept);
+ // Update region access
+ virtual wxRegion GetUpdateRegion() const;
+ virtual bool IsExposed(int x, int y, int w, int h) const;
+ virtual bool IsExposed(const wxPoint& pt) const;
+ virtual bool IsExposed(const wxRect& rect) const;
+
// Set/get the window title
virtual inline void SetTitle(const wxString& WXUNUSED(title)) {};
inline virtual wxString GetTitle(void) const { return wxString(""); };
// Do Update UI processing for controls
void UpdateWindowUI(void);
- void OnSize(wxSizeEvent& event);
void OnEraseBackground(wxEraseEvent& event);
void OnChar(wxKeyEvent& event);
void OnPaint(wxPaintEvent& event);
void OnIdle(wxIdleEvent& event);
-// virtual void OnChangeFocus(wxControl *from, wxControl *to);
-// virtual bool OnFunctionKey(wxKeyEvent &event);
-
-/*
-#if WXWIN_COMPATIBILITY
- virtual void OldOnMenuSelect(int WXUNUSED(cmd));
- virtual void OldOnInitMenuPopup(int WXUNUSED(pos));
- virtual void OldOnScroll(wxCommandEvent& WXUNUSED(event));
- virtual void OldOnPaint(void); // Called when needs painting
- virtual void OldOnSize(int width, int height); // Called on resize
- virtual void OldOnMouseEvent(wxMouseEvent& event); // Called on mouse event
- virtual void OldOnChar(wxKeyEvent& event); // Called on character event
- virtual void OldOnMenuCommand(int cmd); // Dealt with properly in wxFrame
- inline virtual void OldOnMove(int WXUNUSED(x), int WXUNUSED(y)); // Called on move
- inline virtual void OldOnActivate(bool WXUNUSED(active)); // Called on window activation (MSW)
- virtual void OldOnSetFocus(void); // Called on setting focus
- virtual void OldOnKillFocus(void); // Called on killing focus
-#endif
-*/
+ // Does this window want to accept keyboard focus?
+ virtual bool AcceptsFocus() const;
public:
////////////////////////////////////////////////////////////////////////
//// IMPLEMENTATION
+ // For implementation purposes - sometimes decorations make the client area
+ // smaller
+ virtual wxPoint GetClientAreaOrigin() const;
+
+ // Makes an adjustment to the window position (for example, a frame that has
+ // a toolbar that it manages itself).
+ virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
+
// Windows subclassing
void SubclassWin(WXHWND hWnd);
void UnsubclassWin(void);
virtual WXHBRUSH MSWOnCtlColor(WXHDC dc, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWOnColorChange(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+ virtual long MSWOnPaletteChanged(WXHWND hWndPalChange);
+ virtual long MSWOnQueryNewPalette();
virtual bool MSWOnEraseBkgnd(WXHDC pDC);
virtual void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
virtual void MSWOnInitMenuPopup(WXHMENU menu, int pos, bool isSystem);
virtual void MSWOnJoyMove(int joystick, int x, int y, WXUINT flags);
virtual void MSWOnJoyZMove(int joystick, int z, WXUINT flags);
+ virtual long MSWGetDlgCode();
+
// Window procedure
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
// Calls an appropriate default window procedure
virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWProcessMessage(WXMSG* pMsg);
+ virtual bool MSWTranslateMessage(WXMSG* pMsg);
virtual void MSWDestroyWindow(void);
// Detach "Window" menu from menu bar so it doesn't get deleted
int m_caretHeight;
bool m_caretEnabled;
bool m_caretShown;
-
- // Device context being stored whilst drawing is done
-// WXHDC m_tempHDC;
- // Temporary device context stored during an OnPaint
-// WXHDC m_paintHDC;
wxFont m_windowFont; // Window's font
bool m_isShown;
bool m_doubleClickAllowed ;
bool m_backgroundTransparent;
-// wxDC * m_windowDC; // The canvas's device context
-
int m_xThumbSize;
int m_yThumbSize;
WXUINT m_lastMsg;
WXWPARAM m_lastWParam;
WXLPARAM m_lastLParam;
+
+ wxRegion m_updateRegion;
+/*
wxRectangle m_updateRect; // Bounding box for screen damage area
#ifdef __WIN32__
WXHRGN m_updateRgn; // NT allows access to the rectangle list
#endif
- WXHANDLE m_acceleratorTable;
+*/
+
+// WXHANDLE m_acceleratorTable;
WXHMENU m_hMenu; // Menu, if any
wxList * m_children; // Window's children
int m_returnCode;
inline wxButton *wxWindow::GetDefaultItem(void) const { return m_defaultItem; }
inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; }
-// inline wxDC *wxWindow::GetDC(void) const { return m_windowDC; }
inline bool wxWindow::IsRetained(void) const { return ((m_windowStyle & wxRETAINED) == wxRETAINED); }
-/*
-#if WXWIN_COMPATIBILITY
-inline void wxWindow::OldOnMenuSelect(int WXUNUSED(cmd)) { Default(); };
-inline void wxWindow::OldOnInitMenuPopup(int WXUNUSED(pos)) { Default(); };
-inline void wxWindow::OldOnScroll(wxCommandEvent& WXUNUSED(event)) { Default(); };
-inline void wxWindow::OldOnMenuCommand(int WXUNUSED(cmd)) { Default(); } // Dealt with properly in wxFrame
-inline void wxWindow::OldOnMove(int WXUNUSED(x), int WXUNUSED(y)) { Default(); }; // Called on move
-inline void wxWindow::OldOnActivate(bool WXUNUSED(active)) { Default(); }; // Called on window activation (MSW)
-#endif
-*/
-
inline void wxWindow::SetShowing(bool show) { m_isShown = show; }
inline wxList *wxWindow::GetConstraintsInvolvedIn(void) const { return m_constraintsInvolvedIn; }
inline wxSizer *wxWindow::GetSizer(void) const { return m_windowSizer; }
// Window specific (so far)
wxWindow* WXDLLEXPORT wxGetActiveWindow(void);
+// OBSOLETE
+#if 0
// Allows iteration through damaged rectangles in OnPaint
class WXDLLEXPORT wxUpdateIterator
{
int GetW();
int GetH();
};
+#endif
WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows;