1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-06-26 20:59:19 +00:00
|
|
|
// Name: wx/msw/window.h
|
2005-11-03 16:47:29 +00:00
|
|
|
// Purpose: wxWindowMSW class
|
1998-05-20 14:12:05 +00:00
|
|
|
// Author: Julian Smart
|
2001-06-26 20:59:19 +00:00
|
|
|
// Modified by: Vadim Zeitlin on 13.05.99: complete refont of message handling,
|
|
|
|
// elimination of Default(), ...
|
1998-05-20 14:12:05 +00:00
|
|
|
// Created: 01/02/97
|
2003-03-17 10:34:04 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_WINDOW_H_
|
|
|
|
#define _WX_WINDOW_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2009-12-26 16:36:32 +00:00
|
|
|
#include "wx/settings.h" // solely for wxSystemColour
|
2009-12-19 14:47:37 +00:00
|
|
|
|
2009-05-01 21:48:10 +00:00
|
|
|
// if this is set to 1, we use deferred window sizing to reduce flicker when
|
|
|
|
// resizing complicated window hierarchies, but this can in theory result in
|
|
|
|
// different behaviour than the old code so we keep the possibility to use it
|
|
|
|
// by setting this to 0 (in the future this should be removed completely)
|
|
|
|
#ifdef __WXWINCE__
|
|
|
|
#define wxUSE_DEFERRED_SIZING 0
|
|
|
|
#else
|
|
|
|
#define wxUSE_DEFERRED_SIZING 1
|
|
|
|
#endif
|
1998-12-20 23:49:21 +00:00
|
|
|
|
1999-05-10 00:42:57 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// wxWindow declaration for MSW
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-10-10 23:28:07 +00:00
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxWindowMSW : public wxWindowBase
|
1998-12-20 23:49:21 +00:00
|
|
|
{
|
2005-04-28 14:45:09 +00:00
|
|
|
friend class wxSpinCtrl;
|
|
|
|
friend class wxSlider;
|
|
|
|
friend class wxRadioBox;
|
1998-05-20 14:12:05 +00:00
|
|
|
public:
|
2004-01-15 13:49:22 +00:00
|
|
|
wxWindowMSW() { Init(); }
|
2001-06-26 20:59:19 +00:00
|
|
|
|
|
|
|
wxWindowMSW(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
2004-01-15 13:49:22 +00:00
|
|
|
const wxString& name = wxPanelNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
virtual ~wxWindowMSW();
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-05-10 00:42:57 +00:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxPanelNameStr);
|
1999-02-22 11:01:13 +00:00
|
|
|
|
1999-05-10 00:42:57 +00:00
|
|
|
// implement base class pure virtuals
|
2005-11-03 16:47:29 +00:00
|
|
|
virtual void SetLabel(const wxString& label);
|
|
|
|
virtual wxString GetLabel() const;
|
1999-05-19 00:53:27 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void Raise();
|
|
|
|
virtual void Lower();
|
|
|
|
|
2013-05-31 23:21:03 +00:00
|
|
|
virtual bool BeginRepositioningChildren();
|
|
|
|
virtual void EndRepositioningChildren();
|
|
|
|
|
2007-11-24 16:15:08 +00:00
|
|
|
virtual bool Show(bool show = true);
|
|
|
|
virtual bool ShowWithEffect(wxShowEffect effect,
|
2008-05-08 21:56:26 +00:00
|
|
|
unsigned timeout = 0)
|
2007-11-24 16:15:08 +00:00
|
|
|
{
|
2008-05-08 21:56:26 +00:00
|
|
|
return MSWShowWithEffect(true, effect, timeout);
|
2007-11-24 16:15:08 +00:00
|
|
|
}
|
|
|
|
virtual bool HideWithEffect(wxShowEffect effect,
|
2008-05-08 21:56:26 +00:00
|
|
|
unsigned timeout = 0)
|
2007-11-24 16:15:08 +00:00
|
|
|
{
|
2008-05-08 21:56:26 +00:00
|
|
|
return MSWShowWithEffect(false, effect, timeout);
|
2007-11-24 16:15:08 +00:00
|
|
|
}
|
1999-02-22 11:01:13 +00:00
|
|
|
|
1999-05-10 00:42:57 +00:00
|
|
|
virtual void SetFocus();
|
2002-04-21 00:32:14 +00:00
|
|
|
virtual void SetFocusFromKbd();
|
1999-02-22 11:01:13 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
virtual bool Reparent(wxWindowBase *newParent);
|
1999-02-22 11:01:13 +00:00
|
|
|
|
1999-05-10 00:42:57 +00:00
|
|
|
virtual void WarpPointer(int x, int y);
|
1999-02-22 11:01:13 +00:00
|
|
|
|
2004-09-07 11:11:05 +00:00
|
|
|
virtual void Refresh( bool eraseBackground = true,
|
1999-05-10 00:42:57 +00:00
|
|
|
const wxRect *rect = (const wxRect *) NULL );
|
2001-06-26 20:59:19 +00:00
|
|
|
virtual void Update();
|
1999-02-22 11:01:13 +00:00
|
|
|
|
2006-06-11 22:44:53 +00:00
|
|
|
virtual void SetWindowStyleFlag(long style);
|
|
|
|
virtual void SetExtraStyle(long exStyle);
|
1999-05-10 00:42:57 +00:00
|
|
|
virtual bool SetCursor( const wxCursor &cursor );
|
|
|
|
virtual bool SetFont( const wxFont &font );
|
1999-02-22 11:01:13 +00:00
|
|
|
|
|
|
|
virtual int GetCharHeight() const;
|
|
|
|
virtual int GetCharWidth() const;
|
1999-05-10 00:42:57 +00:00
|
|
|
|
|
|
|
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
2004-09-07 11:11:05 +00:00
|
|
|
int range, bool refresh = true );
|
|
|
|
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
|
1999-05-10 00:42:57 +00:00
|
|
|
virtual int GetScrollPos( int orient ) const;
|
|
|
|
virtual int GetScrollThumb( int orient ) const;
|
|
|
|
virtual int GetScrollRange( int orient ) const;
|
|
|
|
virtual void ScrollWindow( int dx, int dy,
|
2009-01-19 13:55:27 +00:00
|
|
|
const wxRect* rect = NULL );
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2001-07-30 15:22:38 +00:00
|
|
|
virtual bool ScrollLines(int lines);
|
|
|
|
virtual bool ScrollPages(int pages);
|
2001-07-29 22:47:40 +00:00
|
|
|
|
2006-09-04 13:35:13 +00:00
|
|
|
virtual void SetLayoutDirection(wxLayoutDirection dir);
|
|
|
|
virtual wxLayoutDirection GetLayoutDirection() const;
|
|
|
|
virtual wxCoord AdjustForLayoutDirection(wxCoord x,
|
|
|
|
wxCoord width,
|
|
|
|
wxCoord widthTotal) const;
|
|
|
|
|
2014-06-09 00:54:12 +00:00
|
|
|
virtual void SetId(wxWindowID winid);
|
|
|
|
|
1998-09-25 13:28:52 +00:00
|
|
|
#if wxUSE_DRAG_AND_DROP
|
1999-05-10 00:42:57 +00:00
|
|
|
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
|
|
|
#endif // wxUSE_DRAG_AND_DROP
|
1999-02-01 00:05:03 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
// Accept files for dragging
|
|
|
|
virtual void DragAcceptFiles(bool accept);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#ifndef __WXUNIVERSAL__
|
1999-05-10 00:42:57 +00:00
|
|
|
// Native resource loading (implemented in src/msw/nativdlg.cpp)
|
|
|
|
// FIXME: should they really be all virtual?
|
2014-01-20 14:45:19 +00:00
|
|
|
virtual bool LoadNativeDialog(wxWindow* parent, wxWindowID id);
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual bool LoadNativeDialog(wxWindow* parent, const wxString& name);
|
1999-05-19 00:53:27 +00:00
|
|
|
wxWindow* GetWindowChild1(wxWindowID id);
|
|
|
|
wxWindow* GetWindowChild(wxWindowID id);
|
2001-06-26 20:59:19 +00:00
|
|
|
#endif // __WXUNIVERSAL__
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2003-07-10 09:56:47 +00:00
|
|
|
#if wxUSE_HOTKEY
|
2003-07-10 09:16:00 +00:00
|
|
|
// install and deinstall a system wide hotkey
|
2003-07-10 09:56:47 +00:00
|
|
|
virtual bool RegisterHotKey(int hotkeyId, int modifiers, int keycode);
|
2003-07-10 09:16:00 +00:00
|
|
|
virtual bool UnregisterHotKey(int hotkeyId);
|
2003-07-10 09:56:47 +00:00
|
|
|
#endif // wxUSE_HOTKEY
|
2003-07-10 09:16:00 +00:00
|
|
|
|
2006-02-28 13:37:23 +00:00
|
|
|
#ifdef __POCKETPC__
|
|
|
|
bool IsContextMenuEnabled() const { return m_contextMenuEnabled; }
|
|
|
|
void EnableContextMenu(bool enable = true) { m_contextMenuEnabled = enable; }
|
|
|
|
#endif
|
|
|
|
|
2004-09-11 22:17:22 +00:00
|
|
|
// window handle stuff
|
|
|
|
// -------------------
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-05-10 22:29:23 +00:00
|
|
|
WXHWND GetHWND() const { return m_hWnd; }
|
|
|
|
void SetHWND(WXHWND hWnd) { m_hWnd = hWnd; }
|
|
|
|
virtual WXWidget GetHandle() const { return GetHWND(); }
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2004-09-11 22:17:22 +00:00
|
|
|
void AssociateHandle(WXWidget handle);
|
|
|
|
void DissociateHandle();
|
|
|
|
|
2005-08-28 16:19:45 +00:00
|
|
|
// does this window have deferred position and/or size?
|
|
|
|
bool IsSizeDeferred() const;
|
|
|
|
|
2007-04-01 12:07:00 +00:00
|
|
|
// these functions allow to register a global handler for the given Windows
|
|
|
|
// message: it will be called from MSWWindowProc() of any window which gets
|
|
|
|
// this event if it's not processed before (i.e. unlike a hook procedure it
|
|
|
|
// does not override the normal processing)
|
|
|
|
//
|
|
|
|
// notice that if you want to process a message for a given window only you
|
|
|
|
// should override its MSWWindowProc() instead
|
|
|
|
|
|
|
|
// type of the handler: it is called with the message parameters (except
|
|
|
|
// that the window object is passed instead of window handle) and should
|
|
|
|
// return true if it handled the message or false if it should be passed to
|
|
|
|
// DefWindowProc()
|
2007-04-01 15:05:31 +00:00
|
|
|
typedef bool (*MSWMessageHandler)(wxWindowMSW *win,
|
2007-04-01 12:07:00 +00:00
|
|
|
WXUINT nMsg,
|
|
|
|
WXWPARAM wParam,
|
|
|
|
WXLPARAM lParam);
|
|
|
|
|
|
|
|
// install a handler, shouldn't be called more than one for the same message
|
|
|
|
static bool MSWRegisterMessageHandler(int msg, MSWMessageHandler handler);
|
|
|
|
|
|
|
|
// unregister a previously registered handler
|
|
|
|
static void MSWUnregisterMessageHandler(int msg, MSWMessageHandler handler);
|
|
|
|
|
2004-09-11 22:17:22 +00:00
|
|
|
|
|
|
|
// implementation from now on
|
|
|
|
// ==========================
|
|
|
|
|
1999-05-10 00:42:57 +00:00
|
|
|
// event handlers
|
|
|
|
// --------------
|
2000-01-22 01:44:16 +00:00
|
|
|
|
2000-08-03 16:11:51 +00:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
2004-07-28 19:34:19 +00:00
|
|
|
#ifdef __WXWINCE__
|
2004-11-15 18:10:48 +00:00
|
|
|
void OnInitDialog(wxInitDialogEvent& event);
|
2004-07-28 19:34:19 +00:00
|
|
|
#endif
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
public:
|
1999-02-22 11:01:13 +00:00
|
|
|
// Windows subclassing
|
|
|
|
void SubclassWin(WXHWND hWnd);
|
|
|
|
void UnsubclassWin();
|
|
|
|
|
1999-05-13 21:21:04 +00:00
|
|
|
WXFARPROC MSWGetOldWndProc() const { return m_oldWndProc; }
|
|
|
|
void MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; }
|
1999-02-22 11:01:13 +00:00
|
|
|
|
2004-09-07 11:11:05 +00:00
|
|
|
// return true if the window is of a standard (i.e. not wxWidgets') class
|
2002-06-15 15:32:20 +00:00
|
|
|
//
|
|
|
|
// to understand why does it work, look at SubclassWin() code and comments
|
|
|
|
bool IsOfStandardClass() const { return m_oldWndProc != NULL; }
|
|
|
|
|
2013-11-12 18:06:37 +00:00
|
|
|
wxWindow *FindItem(long id, WXHWND hWnd = NULL) const;
|
2004-09-07 11:11:05 +00:00
|
|
|
wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = false) const;
|
1999-02-22 11:01:13 +00:00
|
|
|
|
2004-09-07 11:11:05 +00:00
|
|
|
// MSW only: true if this control is part of the main control
|
2007-04-14 09:58:37 +00:00
|
|
|
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return false; }
|
1999-02-22 11:01:13 +00:00
|
|
|
|
2006-05-04 16:07:15 +00:00
|
|
|
#if wxUSE_TOOLTIPS
|
|
|
|
// MSW only: true if this window or any of its children have a tooltip
|
|
|
|
virtual bool HasToolTips() const { return GetToolTip() != NULL; }
|
|
|
|
#endif // wxUSE_TOOLTIPS
|
|
|
|
|
2004-05-23 14:56:36 +00:00
|
|
|
// translate wxWidgets style flags for this control into the Windows style
|
2002-02-17 22:43:43 +00:00
|
|
|
// and optional extended style for the corresponding native control
|
|
|
|
//
|
|
|
|
// this is the function that should be overridden in the derived classes,
|
|
|
|
// but you will mostly use MSWGetCreateWindowFlags() below
|
2003-05-06 21:57:32 +00:00
|
|
|
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const ;
|
2002-02-17 22:43:43 +00:00
|
|
|
|
2004-05-23 14:56:36 +00:00
|
|
|
// get the MSW window flags corresponding to wxWidgets ones
|
2002-02-17 22:43:43 +00:00
|
|
|
//
|
|
|
|
// the functions returns the flags (WS_XXX) directly and puts the ext
|
|
|
|
// (WS_EX_XXX) flags into the provided pointer if not NULL
|
|
|
|
WXDWORD MSWGetCreateWindowFlags(WXDWORD *exflags = NULL) const
|
|
|
|
{ return MSWGetStyle(GetWindowStyle(), exflags); }
|
|
|
|
|
2006-06-11 22:44:53 +00:00
|
|
|
// update the real underlying window style flags to correspond to the
|
|
|
|
// current wxWindow object style (safe to call even if window isn't fully
|
|
|
|
// created yet)
|
|
|
|
void MSWUpdateStyle(long flagsOld, long exflagsOld);
|
|
|
|
|
2002-05-25 17:11:19 +00:00
|
|
|
// get the HWND to be used as parent of this window with CreateWindow()
|
|
|
|
virtual WXHWND MSWGetParent() const;
|
|
|
|
|
2008-11-29 22:19:55 +00:00
|
|
|
// get the Win32 window class name used by all wxWindow objects by default
|
|
|
|
static const wxChar *MSWGetRegisteredClassName();
|
|
|
|
|
2001-10-07 22:17:24 +00:00
|
|
|
// creates the window of specified Windows class with given style, extended
|
|
|
|
// style, title and geometry (default values
|
|
|
|
//
|
2004-09-07 11:11:05 +00:00
|
|
|
// returns true if the window has been created, false if creation failed
|
2001-10-07 22:17:24 +00:00
|
|
|
bool MSWCreate(const wxChar *wclass,
|
|
|
|
const wxChar *title = NULL,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
WXDWORD style = 0,
|
1999-05-13 21:21:04 +00:00
|
|
|
WXDWORD exendedStyle = 0);
|
2001-10-07 22:17:24 +00:00
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
1999-02-22 11:01:13 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#ifndef __WXUNIVERSAL__
|
1999-02-22 11:01:13 +00:00
|
|
|
// Create an appropriate wxWindow from a HWND
|
|
|
|
virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd);
|
|
|
|
|
|
|
|
// Make sure the window style reflects the HWND style (roughly)
|
|
|
|
virtual void AdoptAttributesFromHWND();
|
2001-06-26 20:59:19 +00:00
|
|
|
#endif // __WXUNIVERSAL__
|
1999-02-22 11:01:13 +00:00
|
|
|
|
|
|
|
// Setup background and foreground colours correctly
|
|
|
|
virtual void SetupColours();
|
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// helpers for message handlers: these perform the same function as the
|
|
|
|
// message crackers from <windowsx.h> - they unpack WPARAM and LPARAM into
|
|
|
|
// the correct parameters
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void UnpackCommand(WXWPARAM wParam, WXLPARAM lParam,
|
|
|
|
WXWORD *id, WXHWND *hwnd, WXWORD *cmd);
|
|
|
|
void UnpackActivate(WXWPARAM wParam, WXLPARAM lParam,
|
|
|
|
WXWORD *state, WXWORD *minimized, WXHWND *hwnd);
|
|
|
|
void UnpackScroll(WXWPARAM wParam, WXLPARAM lParam,
|
|
|
|
WXWORD *code, WXWORD *pos, WXHWND *hwnd);
|
|
|
|
void UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
|
2004-11-19 18:37:42 +00:00
|
|
|
WXHDC *hdc, WXHWND *hwnd);
|
1999-05-19 00:53:27 +00:00
|
|
|
void UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam,
|
|
|
|
WXWORD *item, WXWORD *flags, WXHMENU *hmenu);
|
|
|
|
|
1999-05-13 21:21:04 +00:00
|
|
|
// ------------------------------------------------------------------------
|
2001-03-31 18:43:54 +00:00
|
|
|
// internal handlers for MSW messages: all handlers return a boolean value:
|
2004-09-07 11:11:05 +00:00
|
|
|
// true means that the handler processed the event and false that it didn't
|
1999-05-13 21:21:04 +00:00
|
|
|
// ------------------------------------------------------------------------
|
1999-02-22 11:01:13 +00:00
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
// there are several cases where we have virtual functions for Windows
|
|
|
|
// message processing: this is because these messages often require to be
|
|
|
|
// processed in a different manner in the derived classes. For all other
|
|
|
|
// messages, however, we do *not* have corresponding MSWOnXXX() function
|
|
|
|
// and if the derived class wants to process them, it should override
|
|
|
|
// MSWWindowProc() directly.
|
1999-05-13 21:21:04 +00:00
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
// scroll event (both horizontal and vertical)
|
1999-05-13 21:21:04 +00:00
|
|
|
virtual bool MSWOnScroll(int orientation, WXWORD nSBCode,
|
|
|
|
WXWORD pos, WXHWND control);
|
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
// child control notifications
|
1999-05-13 21:21:04 +00:00
|
|
|
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
// owner-drawn controls need to process these messages
|
|
|
|
virtual bool MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *item);
|
|
|
|
virtual bool MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *item);
|
|
|
|
|
|
|
|
// the rest are not virtual
|
|
|
|
bool HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate);
|
|
|
|
bool HandleInitDialog(WXHWND hWndFocus);
|
|
|
|
bool HandleDestroy();
|
|
|
|
|
|
|
|
bool HandlePaint();
|
2005-04-11 14:41:36 +00:00
|
|
|
bool HandlePrintClient(WXHDC hDC);
|
|
|
|
bool HandleEraseBkgnd(WXHDC hDC);
|
1999-05-19 00:53:27 +00:00
|
|
|
|
|
|
|
bool HandleMinimize();
|
|
|
|
bool HandleMaximize();
|
|
|
|
bool HandleSize(int x, int y, WXUINT flag);
|
2003-06-01 14:37:28 +00:00
|
|
|
bool HandleSizing(wxRect& rect);
|
1999-05-19 00:53:27 +00:00
|
|
|
bool HandleGetMinMaxInfo(void *mmInfo);
|
2007-08-01 15:34:48 +00:00
|
|
|
bool HandleEnterSizeMove();
|
|
|
|
bool HandleExitSizeMove();
|
1999-05-19 00:53:27 +00:00
|
|
|
|
|
|
|
bool HandleShow(bool show, int status);
|
|
|
|
bool HandleActivate(int flag, bool minimized, WXHWND activate);
|
|
|
|
|
|
|
|
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
|
|
|
|
2004-11-19 19:40:31 +00:00
|
|
|
bool HandleCtlColor(WXHBRUSH *hBrush, WXHDC hdc, WXHWND hWnd);
|
1999-05-13 21:21:04 +00:00
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
bool HandlePaletteChanged(WXHWND hWndPalChange);
|
|
|
|
bool HandleQueryNewPalette();
|
|
|
|
bool HandleSysColorChange();
|
2002-02-07 18:46:31 +00:00
|
|
|
bool HandleDisplayChange();
|
2002-04-12 20:26:43 +00:00
|
|
|
bool HandleCaptureChanged(WXHWND gainedCapture);
|
2006-02-25 23:11:26 +00:00
|
|
|
virtual bool HandleSettingChange(WXWPARAM wParam, WXLPARAM lParam);
|
1999-05-13 21:21:04 +00:00
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
bool HandleQueryEndSession(long logOff, bool *mayEnd);
|
|
|
|
bool HandleEndSession(bool endSession, long logOff);
|
1999-05-13 21:21:04 +00:00
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
bool HandleSetFocus(WXHWND wnd);
|
|
|
|
bool HandleKillFocus(WXHWND wnd);
|
1999-02-22 11:01:13 +00:00
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
bool HandleDropFiles(WXWPARAM wParam);
|
1999-02-22 11:01:13 +00:00
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
bool HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags);
|
|
|
|
bool HandleMouseMove(int x, int y, WXUINT flags);
|
2012-03-22 00:27:02 +00:00
|
|
|
bool HandleMouseWheel(wxMouseWheelAxis axis,
|
|
|
|
WXWPARAM wParam, WXLPARAM lParam);
|
1999-02-22 11:01:13 +00:00
|
|
|
|
2010-09-11 10:18:47 +00:00
|
|
|
bool HandleChar(WXWPARAM wParam, WXLPARAM lParam);
|
2001-05-02 19:48:15 +00:00
|
|
|
bool HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
bool HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam);
|
2013-05-08 11:21:37 +00:00
|
|
|
#if wxUSE_HOTKEY
|
2003-07-10 09:16:00 +00:00
|
|
|
bool HandleHotKey(WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
#endif
|
2002-12-21 15:01:21 +00:00
|
|
|
#ifdef __WIN32__
|
|
|
|
int HandleMenuChar(int chAccel, WXLPARAM lParam);
|
|
|
|
#endif
|
2006-05-12 15:21:41 +00:00
|
|
|
// Create and process a clipboard event specified by type.
|
|
|
|
bool HandleClipboardEvent( WXUINT nMsg );
|
1999-02-22 11:01:13 +00:00
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
bool HandleQueryDragIcon(WXHICON *hIcon);
|
|
|
|
|
|
|
|
bool HandleSetCursor(WXHWND hWnd, short nHitTest, int mouseMsg);
|
1999-02-22 11:01:13 +00:00
|
|
|
|
2006-05-27 14:09:40 +00:00
|
|
|
bool HandlePower(WXWPARAM wParam, WXLPARAM lParam, bool *vetoed);
|
|
|
|
|
|
|
|
|
2011-07-22 12:49:22 +00:00
|
|
|
// The main body of common window proc for all wxWindow objects. It tries
|
|
|
|
// to handle the given message and returns true if it was handled (the
|
|
|
|
// appropriate return value is then put in result, which must be non-NULL)
|
|
|
|
// or false if it wasn't.
|
|
|
|
//
|
|
|
|
// This function should be overridden in any new code instead of
|
|
|
|
// MSWWindowProc() even if currently most of the code overrides
|
|
|
|
// MSWWindowProc() as it had been written before this function was added.
|
|
|
|
virtual bool MSWHandleMessage(WXLRESULT *result,
|
|
|
|
WXUINT message,
|
|
|
|
WXWPARAM wParam,
|
|
|
|
WXLPARAM lParam);
|
|
|
|
|
|
|
|
// Common Window procedure for all wxWindow objects: forwards to
|
|
|
|
// MSWHandleMessage() and MSWDefWindowProc() if the message wasn't handled.
|
2004-02-25 10:45:02 +00:00
|
|
|
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
1999-02-22 11:01:13 +00:00
|
|
|
|
|
|
|
// Calls an appropriate default window procedure
|
2004-02-25 10:45:02 +00:00
|
|
|
virtual WXLRESULT MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
2001-08-05 15:07:28 +00:00
|
|
|
|
|
|
|
// message processing helpers
|
|
|
|
|
2004-09-07 11:11:05 +00:00
|
|
|
// return false if the message shouldn't be translated/preprocessed but
|
2001-08-05 15:07:28 +00:00
|
|
|
// dispatched normally
|
|
|
|
virtual bool MSWShouldPreProcessMessage(WXMSG* pMsg);
|
|
|
|
|
2004-09-07 11:11:05 +00:00
|
|
|
// return true if the message was preprocessed and shouldn't be dispatched
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual bool MSWProcessMessage(WXMSG* pMsg);
|
2001-08-05 15:07:28 +00:00
|
|
|
|
2004-09-07 11:11:05 +00:00
|
|
|
// return true if the message was translated and shouldn't be dispatched
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual bool MSWTranslateMessage(WXMSG* pMsg);
|
2001-08-05 15:07:28 +00:00
|
|
|
|
|
|
|
// called when the window is about to be destroyed
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void MSWDestroyWindow();
|
|
|
|
|
2004-11-19 18:37:42 +00:00
|
|
|
|
2011-03-20 00:00:29 +00:00
|
|
|
// Functions dealing with painting the window background. The derived
|
|
|
|
// classes should normally only need to reimplement MSWGetBgBrush() if they
|
|
|
|
// need to use a non-solid brush for erasing their background. This
|
|
|
|
// function is called by MSWGetBgBrushForChild() which only exists for the
|
|
|
|
// weird wxToolBar case and MSWGetBgBrushForChild() itself is used by
|
|
|
|
// MSWGetBgBrush() to actually find the right brush to use.
|
|
|
|
|
2013-02-10 16:14:03 +00:00
|
|
|
// Adjust the origin for the brush returned by MSWGetBgBrushForChild().
|
|
|
|
//
|
|
|
|
// This needs to be overridden for scrolled windows to ensure that the
|
|
|
|
// scrolling of their associated DC is taken into account.
|
|
|
|
//
|
|
|
|
// Both parameters must be non-NULL.
|
|
|
|
virtual void MSWAdjustBrushOrg(int* WXUNUSED(xOrg),
|
|
|
|
int* WXUNUSED(yOrg)) const
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-03-20 00:00:29 +00:00
|
|
|
// The brush returned from here must remain valid at least until the next
|
|
|
|
// event loop iteration. Returning 0, as is done by default, indicates
|
|
|
|
// there is no custom background brush.
|
|
|
|
virtual WXHBRUSH MSWGetCustomBgBrush() { return 0; }
|
|
|
|
|
2004-12-13 00:09:54 +00:00
|
|
|
// this function should return the brush to paint the children controls
|
|
|
|
// background or 0 if this window doesn't impose any particular background
|
|
|
|
// on its children
|
|
|
|
//
|
2009-12-18 20:49:23 +00:00
|
|
|
// the hDC parameter is the DC background will be drawn on, it can be used
|
|
|
|
// to call SetBrushOrgEx() on it if the returned brush is a bitmap one
|
|
|
|
//
|
2010-05-21 12:51:20 +00:00
|
|
|
// child parameter is never NULL, it can be this window itself or one of
|
|
|
|
// its (grand)children
|
2009-12-18 20:49:23 +00:00
|
|
|
//
|
2005-04-10 15:23:08 +00:00
|
|
|
// the base class version returns a solid brush if we have a non default
|
|
|
|
// background colour or 0 otherwise
|
2009-12-18 20:49:23 +00:00
|
|
|
virtual WXHBRUSH MSWGetBgBrushForChild(WXHDC hDC, wxWindowMSW *child);
|
2004-12-13 00:09:54 +00:00
|
|
|
|
2005-04-10 15:23:08 +00:00
|
|
|
// return the background brush to use for painting the given window by
|
2010-05-21 12:51:20 +00:00
|
|
|
// querying the parent windows via MSWGetBgBrushForChild() recursively
|
|
|
|
WXHBRUSH MSWGetBgBrush(WXHDC hDC);
|
2005-04-10 15:23:08 +00:00
|
|
|
|
2009-12-19 14:47:37 +00:00
|
|
|
enum MSWThemeColour
|
|
|
|
{
|
|
|
|
ThemeColourText = 0,
|
|
|
|
ThemeColourBackground,
|
|
|
|
ThemeColourBorder
|
|
|
|
};
|
|
|
|
|
|
|
|
// returns a specific theme colour, or if that is not possible then
|
|
|
|
// wxSystemSettings::GetColour(fallback)
|
|
|
|
wxColour MSWGetThemeColour(const wchar_t *themeName,
|
|
|
|
int themePart,
|
|
|
|
int themeState,
|
|
|
|
MSWThemeColour themeColour,
|
2010-01-26 09:00:55 +00:00
|
|
|
wxSystemColour fallback) const;
|
2009-12-19 14:47:37 +00:00
|
|
|
|
2005-04-10 15:23:08 +00:00
|
|
|
// gives the parent the possibility to draw its children background, e.g.
|
|
|
|
// this is used by wxNotebook to do it using DrawThemeBackground()
|
2005-02-19 20:49:50 +00:00
|
|
|
//
|
2005-04-10 15:23:08 +00:00
|
|
|
// return true if background was drawn, false otherwise
|
|
|
|
virtual bool MSWPrintChild(WXHDC WXUNUSED(hDC), wxWindow * WXUNUSED(child))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2005-02-19 20:49:50 +00:00
|
|
|
|
2005-06-16 15:36:48 +00:00
|
|
|
// some controls (e.g. wxListBox) need to set the return value themselves
|
|
|
|
//
|
|
|
|
// return true to let parent handle it if we don't, false otherwise
|
|
|
|
virtual bool MSWShouldPropagatePrintChild()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-08-10 21:48:17 +00:00
|
|
|
// This should be overridden to return true for the controls which have
|
|
|
|
// themed background that should through their children. Currently only
|
|
|
|
// wxNotebook uses this.
|
2011-10-09 22:01:57 +00:00
|
|
|
//
|
|
|
|
// The base class version already returns true if we have a solid
|
|
|
|
// background colour that should be propagated to our children.
|
|
|
|
virtual bool MSWHasInheritableBackground() const
|
|
|
|
{
|
|
|
|
return InheritsBackgroundColour();
|
|
|
|
}
|
2010-08-10 21:48:17 +00:00
|
|
|
|
2009-12-22 15:37:43 +00:00
|
|
|
#if !defined(__WXWINCE__) && !defined(__WXUNIVERSAL__)
|
|
|
|
#define wxHAS_MSW_BACKGROUND_ERASE_HOOK
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef wxHAS_MSW_BACKGROUND_ERASE_HOOK
|
|
|
|
// allows the child to hook into its parent WM_ERASEBKGND processing: call
|
|
|
|
// MSWSetEraseBgHook() with a non-NULL window to make parent call
|
|
|
|
// MSWEraseBgHook() on this window (don't forget to reset it to NULL
|
|
|
|
// afterwards)
|
|
|
|
//
|
|
|
|
// this hack is used by wxToolBar, see comments there
|
|
|
|
void MSWSetEraseBgHook(wxWindow *child);
|
|
|
|
|
|
|
|
// return true if WM_ERASEBKGND is currently hooked
|
|
|
|
bool MSWHasEraseBgHook() const;
|
|
|
|
|
|
|
|
// called when the window on which MSWSetEraseBgHook() had been called
|
|
|
|
// receives WM_ERASEBKGND
|
|
|
|
virtual bool MSWEraseBgHook(WXHDC WXUNUSED(hDC)) { return false; }
|
|
|
|
#endif // wxHAS_MSW_BACKGROUND_ERASE_HOOK
|
|
|
|
|
2007-11-24 16:15:08 +00:00
|
|
|
// common part of Show/HideWithEffect()
|
|
|
|
bool MSWShowWithEffect(bool show,
|
|
|
|
wxShowEffect effect,
|
2008-05-08 21:56:26 +00:00
|
|
|
unsigned timeout);
|
2005-02-19 20:49:50 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
// Responds to colour changes: passes event on to children.
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
|
|
|
|
1999-05-13 21:21:04 +00:00
|
|
|
// initialize various fields of wxMouseEvent (common part of MSWOnMouseXXX)
|
|
|
|
void InitMouseEvent(wxMouseEvent& event, int x, int y, WXUINT flags);
|
1999-02-22 11:01:13 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
// check if mouse is in the window
|
|
|
|
bool IsMouseInWindow() const;
|
2006-10-09 16:39:34 +00:00
|
|
|
|
|
|
|
// check if a native double-buffering applies for this window
|
|
|
|
virtual bool IsDoubleBuffered() const;
|
2009-08-21 10:41:26 +00:00
|
|
|
|
2008-06-02 18:30:13 +00:00
|
|
|
void SetDoubleBuffered(bool on);
|
2009-08-21 10:41:26 +00:00
|
|
|
|
2005-01-19 02:31:09 +00:00
|
|
|
// synthesize a wxEVT_LEAVE_WINDOW event and set m_mouseInWindow to false
|
|
|
|
void GenerateMouseLeave();
|
|
|
|
|
2003-07-09 10:15:21 +00:00
|
|
|
// virtual function for implementing internal idle
|
|
|
|
// behaviour
|
2005-04-10 15:23:08 +00:00
|
|
|
virtual void OnInternalIdle();
|
2003-07-09 10:15:21 +00:00
|
|
|
|
2014-06-18 12:51:39 +00:00
|
|
|
#if wxUSE_MENUS && !defined(__WXUNIVERSAL__)
|
|
|
|
virtual bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu);
|
|
|
|
|
|
|
|
// handle WM_(UN)INITMENUPOPUP message to generate wxEVT_MENU_OPEN/CLOSE
|
|
|
|
bool HandleMenuPopup(wxEventType evtType, WXHMENU hMenu);
|
|
|
|
|
|
|
|
// Command part of HandleMenuPopup() and HandleExitMenuLoop().
|
|
|
|
virtual bool DoSendMenuOpenCloseEvent(wxEventType evtType, wxMenu* menu, bool popup);
|
|
|
|
|
|
|
|
// Find the menu corresponding to the given handle.
|
|
|
|
virtual wxMenu* MSWFindMenuFromHMENU(WXHMENU hMenu);
|
|
|
|
#endif // wxUSE_MENUS && !__WXUNIVERSAL__
|
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
protected:
|
2007-10-26 06:20:23 +00:00
|
|
|
// this allows you to implement standard control borders without
|
|
|
|
// repeating the code in different classes that are not derived from
|
|
|
|
// wxControl
|
|
|
|
virtual wxBorder GetDefaultBorderForControl() const;
|
|
|
|
|
|
|
|
// choose the default border for this window
|
|
|
|
virtual wxBorder GetDefaultBorder() const;
|
2006-02-08 21:47:09 +00:00
|
|
|
|
2007-11-13 12:10:34 +00:00
|
|
|
// Translate wxBORDER_THEME (and other border styles if necessary to the value
|
|
|
|
// that makes most sense for this Windows environment
|
|
|
|
virtual wxBorder TranslateBorder(wxBorder border) const;
|
|
|
|
|
2006-02-08 21:47:09 +00:00
|
|
|
#if wxUSE_MENUS_NATIVE
|
|
|
|
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
|
|
|
#endif // wxUSE_MENUS_NATIVE
|
|
|
|
|
1999-05-10 22:29:23 +00:00
|
|
|
// the window handle
|
|
|
|
WXHWND m_hWnd;
|
|
|
|
|
1999-05-10 00:42:57 +00:00
|
|
|
// the old window proc (we subclass all windows)
|
1999-02-22 11:01:13 +00:00
|
|
|
WXFARPROC m_oldWndProc;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-05-10 00:42:57 +00:00
|
|
|
// additional (MSW specific) flags
|
|
|
|
bool m_mouseInWindow:1;
|
2002-04-02 00:36:29 +00:00
|
|
|
bool m_lastKeydownProcessed:1;
|
1999-02-22 11:01:13 +00:00
|
|
|
|
1999-05-10 00:42:57 +00:00
|
|
|
// the size of one page for scrolling
|
1999-02-22 11:01:13 +00:00
|
|
|
int m_xThumbSize;
|
|
|
|
int m_yThumbSize;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-05-10 00:42:57 +00:00
|
|
|
// implement the base class pure virtuals
|
2009-06-10 16:41:41 +00:00
|
|
|
virtual void DoGetTextExtent(const wxString& string,
|
|
|
|
int *x, int *y,
|
|
|
|
int *descent = NULL,
|
|
|
|
int *externalLeading = NULL,
|
|
|
|
const wxFont *font = NULL) const;
|
1999-05-19 01:00:57 +00:00
|
|
|
virtual void DoClientToScreen( int *x, int *y ) const;
|
|
|
|
virtual void DoScreenToClient( int *x, int *y ) const;
|
1999-05-10 00:42:57 +00:00
|
|
|
virtual void DoGetPosition( int *x, int *y ) const;
|
|
|
|
virtual void DoGetSize( int *width, int *height ) const;
|
|
|
|
virtual void DoGetClientSize( int *width, int *height ) const;
|
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void DoSetClientSize(int width, int height);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2009-06-22 20:36:13 +00:00
|
|
|
virtual wxSize DoGetBorderSize() const;
|
|
|
|
|
2002-01-19 19:31:19 +00:00
|
|
|
virtual void DoCaptureMouse();
|
|
|
|
virtual void DoReleaseMouse();
|
2002-04-02 00:36:29 +00:00
|
|
|
|
2007-10-26 06:20:23 +00:00
|
|
|
virtual void DoEnable(bool enable);
|
|
|
|
|
2008-01-05 00:21:31 +00:00
|
|
|
virtual void DoFreeze();
|
|
|
|
virtual void DoThaw();
|
|
|
|
|
2005-07-30 00:01:51 +00:00
|
|
|
// this simply moves/resizes the given HWND which is supposed to be our
|
|
|
|
// sibling (this is useful for controls which are composite at MSW level
|
|
|
|
// and for which DoMoveWindow() is not enough)
|
2005-08-05 17:35:38 +00:00
|
|
|
//
|
|
|
|
// returns true if the window move was deferred, false if it was moved
|
|
|
|
// immediately (no error return)
|
|
|
|
bool DoMoveSibling(WXHWND hwnd, int x, int y, int width, int height);
|
2005-07-30 00:01:51 +00:00
|
|
|
|
1999-10-10 23:28:07 +00:00
|
|
|
// 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);
|
|
|
|
|
1999-05-10 00:42:57 +00:00
|
|
|
#if wxUSE_TOOLTIPS
|
|
|
|
virtual void DoSetToolTip( wxToolTip *tip );
|
2002-06-20 14:49:19 +00:00
|
|
|
|
|
|
|
// process TTN_NEEDTEXT message properly (i.e. fixing the bugs in
|
|
|
|
// comctl32.dll in our code -- see the function body for more info)
|
|
|
|
bool HandleTooltipNotify(WXUINT code,
|
|
|
|
WXLPARAM lParam,
|
|
|
|
const wxString& ttip);
|
1999-05-10 00:42:57 +00:00
|
|
|
#endif // wxUSE_TOOLTIPS
|
|
|
|
|
2010-09-11 10:18:47 +00:00
|
|
|
// This is used by CreateKeyEvent() and also for wxEVT_CHAR[_HOOK] event
|
|
|
|
// creation. Notice that this method doesn't initialize wxKeyEvent
|
|
|
|
// m_keyCode and m_uniChar fields.
|
|
|
|
void InitAnyKeyEvent(wxKeyEvent& event,
|
|
|
|
WXWPARAM wParam,
|
|
|
|
WXLPARAM lParam) const;
|
|
|
|
|
|
|
|
// Helper functions used by HandleKeyXXX() methods and some derived
|
|
|
|
// classes, wParam and lParam have the same meaning as in WM_KEY{DOWN,UP}.
|
|
|
|
//
|
|
|
|
// NB: evType here must be wxEVT_KEY_{DOWN,UP} as wParam here contains the
|
|
|
|
// virtual key code, not character!
|
|
|
|
wxKeyEvent CreateKeyEvent(wxEventType evType,
|
|
|
|
WXWPARAM wParam,
|
|
|
|
WXLPARAM lParam = 0) const;
|
2001-09-24 16:39:49 +00:00
|
|
|
|
2011-04-16 17:27:21 +00:00
|
|
|
// Another helper for creating wxKeyEvent for wxEVT_CHAR and related types.
|
|
|
|
//
|
|
|
|
// The wParam and lParam here must come from WM_CHAR event parameters, i.e.
|
|
|
|
// wParam must be a character and not a virtual code.
|
|
|
|
wxKeyEvent CreateCharEvent(wxEventType evType,
|
|
|
|
WXWPARAM wParam,
|
|
|
|
WXLPARAM lParam) const;
|
|
|
|
|
2005-01-05 22:46:32 +00:00
|
|
|
|
|
|
|
// default OnEraseBackground() implementation, return true if we did erase
|
2005-04-10 15:23:08 +00:00
|
|
|
// the background, false otherwise (i.e. the system should erase it)
|
|
|
|
bool DoEraseBackground(WXHDC hDC);
|
2005-01-05 22:46:32 +00:00
|
|
|
|
2005-10-23 10:53:16 +00:00
|
|
|
// generate WM_CHANGEUISTATE if it's needed for the OS we're running under
|
2005-09-27 11:08:42 +00:00
|
|
|
//
|
2005-10-23 10:53:16 +00:00
|
|
|
// action should be one of the UIS_XXX constants
|
|
|
|
// state should be one or more of the UISF_XXX constants
|
|
|
|
// if action == UIS_INITIALIZE then it doesn't seem to matter what we use
|
|
|
|
// for state as the system will decide for us what needs to be set
|
|
|
|
void MSWUpdateUIState(int action, int state = 0);
|
2005-09-03 23:00:22 +00:00
|
|
|
|
2010-04-22 11:21:21 +00:00
|
|
|
// translate wxWidgets coords into Windows ones suitable to be passed to
|
|
|
|
// ::CreateWindow(), called from MSWCreate()
|
|
|
|
virtual void MSWGetCreateWindowCoords(const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
int& x, int& y,
|
|
|
|
int& w, int& h) const;
|
|
|
|
|
2010-08-01 10:11:53 +00:00
|
|
|
bool MSWEnableHWND(WXHWND hWnd, bool enable);
|
|
|
|
|
2013-11-12 18:06:37 +00:00
|
|
|
// Return the pointer to this window or one of its sub-controls if this ID
|
|
|
|
// and HWND combination belongs to one of them.
|
|
|
|
//
|
|
|
|
// This is used by FindItem() and is overridden in wxControl, see there.
|
|
|
|
virtual wxWindow* MSWFindItem(long WXUNUSED(id), WXHWND WXUNUSED(hWnd)) const
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1998-11-24 23:30:50 +00:00
|
|
|
private:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
1999-05-13 21:21:04 +00:00
|
|
|
// the (non-virtual) handlers for the events
|
|
|
|
bool HandleMove(int x, int y);
|
2003-06-01 14:37:28 +00:00
|
|
|
bool HandleMoving(wxRect& rect);
|
1999-05-13 21:21:04 +00:00
|
|
|
bool HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags);
|
|
|
|
bool HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
|
|
|
|
2014-08-14 16:05:32 +00:00
|
|
|
#ifndef __WXUNIVERSAL__
|
|
|
|
// Call ::IsDialogMessage() if it is safe to do it (i.e. if it's not going
|
|
|
|
// to hang or do something else stupid) with the given message, return true
|
|
|
|
// if the message was handled by it.
|
|
|
|
bool MSWSafeIsDialogMessage(WXMSG* msg);
|
|
|
|
#endif // __WXUNIVERSAL__
|
|
|
|
|
2009-05-01 21:48:10 +00:00
|
|
|
#if wxUSE_DEFERRED_SIZING
|
|
|
|
protected:
|
|
|
|
// this function is called after the window was resized to its new size
|
|
|
|
virtual void MSWEndDeferWindowPos()
|
|
|
|
{
|
|
|
|
m_pendingPosition = wxDefaultPosition;
|
|
|
|
m_pendingSize = wxDefaultSize;
|
|
|
|
}
|
2002-08-30 00:34:08 +00:00
|
|
|
|
2005-01-04 18:57:41 +00:00
|
|
|
// current defer window position operation handle (may be NULL)
|
2005-01-05 22:46:32 +00:00
|
|
|
WXHANDLE m_hDWP;
|
2005-01-04 18:57:41 +00:00
|
|
|
|
2005-05-19 22:17:01 +00:00
|
|
|
// When deferred positioning is done these hold the pending changes, and
|
|
|
|
// are used for the default values if another size/pos changes is done on
|
|
|
|
// this window before the group of deferred changes is completed.
|
|
|
|
wxPoint m_pendingPosition;
|
|
|
|
wxSize m_pendingSize;
|
2009-05-01 21:48:10 +00:00
|
|
|
#endif // wxUSE_DEFERRED_SIZING
|
2005-01-04 18:57:41 +00:00
|
|
|
|
2006-06-14 13:11:53 +00:00
|
|
|
private:
|
2006-02-28 13:37:23 +00:00
|
|
|
#ifdef __POCKETPC__
|
|
|
|
bool m_contextMenuEnabled;
|
|
|
|
#endif
|
|
|
|
|
2001-08-12 21:45:41 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxWindowMSW)
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxWindowMSW);
|
1998-11-24 23:30:50 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
2001-10-07 22:17:24 +00:00
|
|
|
// window creation helper class: before creating a new HWND, instantiate an
|
|
|
|
// object of this class on stack - this allows to process the messages sent to
|
|
|
|
// the window even before CreateWindow() returns
|
|
|
|
class wxWindowCreationHook
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxWindowCreationHook(wxWindowMSW *winBeingCreated);
|
|
|
|
~wxWindowCreationHook();
|
|
|
|
};
|
|
|
|
|
2005-11-03 16:47:29 +00:00
|
|
|
#endif // _WX_WINDOW_H_
|