X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e320a79f187558effb04d92020b470372bbe456..de6019fb157459e7e7610e3ff813ad8c4a3225cf:/include/wx/os2/window.h diff --git a/include/wx/os2/window.h b/include/wx/os2/window.h index e7e3812265..706b3a399c 100644 --- a/include/wx/os2/window.h +++ b/include/wx/os2/window.h @@ -1,33 +1,27 @@ ///////////////////////////////////////////////////////////////////////////// // Name: window.h // Purpose: wxWindow class -// Author: Julian Smart +// Author: David Webster // Modified by: -// Created: 01/02/97 +// Created: 10/12/99 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem +// Copyright: (c) David Webster // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_WINDOW_H_ #define _WX_WINDOW_H_ +#define wxUSE_MOUSEEVENT_HACK 0 + // --------------------------------------------------------------------------- // headers // --------------------------------------------------------------------------- +#define INCL_DOS +#define INCL_PM +#define INCL_GPI +#include -#ifdef __GNUG__ - #pragma interface "window.h" -#endif - -// #include "wx/msw/winundef.h" - -// VZ: apparently some version of Windows send extra mouse move messages after -// a mouse click. My tests under NT 4.0 and 95 didn't show it so I'm -// tempted to think that it was just an effect of a poor mouse and so the -// code to work around this is currently disabled - just define this as 1 -// to reenable it -#define wxUSE_MOUSEEVENT_HACK 0 // --------------------------------------------------------------------------- // forward declarations @@ -47,8 +41,9 @@ enum }; // --------------------------------------------------------------------------- -// wxWindow declaration for MSW +// wxWindow declaration for OS/2 PM // --------------------------------------------------------------------------- + class WXDLLEXPORT wxWindow : public wxWindowBase { DECLARE_DYNAMIC_CLASS(wxWindow); @@ -110,8 +105,6 @@ public: const wxFont *theFont = (const wxFont *) NULL) const; - virtual bool PopupMenu( wxMenu *menu, int x, int y ); - virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); virtual void SetScrollbar( int orient, int pos, int thumbVisible, @@ -196,22 +189,23 @@ public: void SubclassWin(WXHWND hWnd); void UnsubclassWin(); - WXFARPROC MSWGetOldWndProc() const { return m_oldWndProc; } - void MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; } + WXFARPROC OS2GetOldWndProc() const { return m_oldWndProc; } + void OS2SetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; } - wxWindow *FindItem(int id) const; + wxWindow *FindItem(long id) const; wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const; // Make a Windows extended style from the given wxWindows window style - virtual WXDWORD MakeExtendedStyle(long style, bool eliminateBorders = TRUE); + static WXDWORD MakeExtendedStyle(long style, + bool eliminateBorders = TRUE); // Determine whether 3D effects are wanted - virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D); + WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) const; // MSW only: TRUE if this control is part of the main control virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; }; // returns TRUE if the window has been created - bool MSWCreate(int id, + bool OS2Create(int id, wxWindow *parent, const wxChar *wclass, wxWindow *wx_win, @@ -220,11 +214,11 @@ public: WXDWORD style, const wxChar *dialog_template = NULL, WXDWORD exendedStyle = 0); - virtual bool MSWCommand(WXUINT param, WXWORD id); + virtual bool OS2Command(WXUINT param, WXWORD id); #if WXWIN_COMPATIBILITY wxObject *GetChild(int number) const; - virtual void MSWDeviceToLogical(float *x, float *y) const; + virtual void OS2DeviceToLogical(float *x, float *y) const; #endif // WXWIN_COMPATIBILITY // Create an appropriate wxWindow from a HWND @@ -266,17 +260,14 @@ public: // MSWWindowProc() directly. // scroll event (both horizontal and vertical) - virtual bool MSWOnScroll(int orientation, WXWORD nSBCode, + virtual bool OS2OnScroll(int orientation, WXWORD nSBCode, WXWORD pos, WXHWND control); - // child control notifications -#ifdef __WIN95__ - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); -#endif // __WIN95__ + virtual bool OS2OnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); // owner-drawn controls need to process these messages - virtual bool MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *item); - virtual bool MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *item); + virtual bool OS2OnDrawItem(int id, WXDRAWITEMSTRUCT *item); + virtual bool OS2OnMeasureItem(int id, WXMEASUREITEMSTRUCT *item); // the rest are not virtual bool HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate); @@ -329,16 +320,16 @@ public: bool HandleSetCursor(WXHWND hWnd, short nHitTest, int mouseMsg); // Window procedure - virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); + virtual MRESULT OS2WindowProc(HWND hwnd, 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(); + virtual MRESULT OS2DefWindowProc(HWND hwnd, WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); + virtual bool OS2ProcessMessage(WXMSG* pMsg); + virtual bool OS2TranslateMessage(WXMSG* pMsg); + virtual void OS2DestroyWindow(); // Detach "Window" menu from menu bar so it doesn't get deleted - void MSWDetachWindowMenu(); + void OS2DetachWindowMenu(); // this function should return the brush to paint the window background // with or 0 for the default brush @@ -405,6 +396,12 @@ protected: // will be the width and height of the text virtual wxSize DoGetBestSize(); + // move the window to the specified location and resize it: this is called + // from both DoSetSize() and DoSetClientSize() and would usually just call + // ::MoveWindow() except for composite controls which will want to arrange + // themselves inside the given rectangle + virtual void DoMoveWindow(int x, int y, int width, int height); + #if wxUSE_TOOLTIPS virtual void DoSetToolTip( wxToolTip *tip ); #endif // wxUSE_TOOLTIPS @@ -417,11 +414,13 @@ private: bool HandleMove(int x, int y); bool HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags); + bool HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); DECLARE_NO_COPY_CLASS(wxWindow); DECLARE_EVENT_TABLE() - // Supress virtual function hiding warning - virtual bool Reparent( wxWindowBase *newParent ) - {return(wxWindowBase::Reparent(newParent));} +private: + // Virtual function hiding supression + inline virtual bool Reparent( wxWindowBase *newParent ) + { return(wxWindowBase::Reparent(newParent));}; }; // --------------------------------------------------------------------------- @@ -429,8 +428,7 @@ private: // --------------------------------------------------------------------------- // kbd code translation -WXDLLEXPORT int wxCharCodeMSWToWX(int keySym); -WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual); - +WXDLLEXPORT int wxCharCodeOS2ToWX(int keySym); +WXDLLEXPORT int wxCharCodeWXToOS2(int id, bool *IsVirtual); #endif // _WX_WINDOW_H_