]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/carbon/nonownedwnd.h
deprecate wxStringEq
[wxWidgets.git] / include / wx / osx / carbon / nonownedwnd.h
CommitLineData
5c6eb3a8
SC
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/mac/nonownedwnd.h
3// Purpose: declares wxNonOwnedWindow class
4// Author: Stefan Csomor
5// Modified by:
6// Created: 2008-03-24
7// RCS-ID: $Id: nonownedwnd.h 46993 2007-06-28 08:46:04Z VS $
8// Copyright: (c) 2008 Stefan Csomor
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_MAC_NONOWNEDWND_H_
13#define _WX_MAC_NONOWNEDWND_H_
14
15#include "wx/window.h"
16
17#if wxUSE_SYSTEM_OPTIONS
18 #define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition")
19#endif
20
21//-----------------------------------------------------------------------------
22// wxNonOwnedWindow
23//-----------------------------------------------------------------------------
24
25// This class represents "non-owned" window. A window is owned by another
26// window if it has a parent and is positioned within the parent. For example,
27// wxFrame is non-owned, because even though it can have a parent, it's
28// location is independent of it. This class is for internal use only, it's
29// the base class for wxTopLevelWindow and wxPopupWindow.
30
bcb07ff0
SC
31class wxNonOwnedWindowImpl;
32
5c6eb3a8
SC
33class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxWindow
34{
35public:
36 // constructors and such
37 wxNonOwnedWindow() { Init(); }
38
39 wxNonOwnedWindow(wxWindow *parent,
40 wxWindowID id,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize,
43 long style = 0,
44 const wxString& name = wxPanelNameStr)
45 {
46 Init();
47
48 (void)Create(parent, id, pos, size, style, name);
49 }
50
51 bool Create(wxWindow *parent,
52 wxWindowID id,
53 const wxPoint& pos = wxDefaultPosition,
54 const wxSize& size = wxDefaultSize,
55 long style = 0,
56 const wxString& name = wxPanelNameStr);
57
58 virtual ~wxNonOwnedWindow();
59
60 virtual wxPoint GetClientAreaOrigin() const;
61
62 // implement base class pure virtuals
63
64 virtual bool SetShape(const wxRegion& region);
65
66 virtual bool SetTransparent(wxByte alpha);
67 virtual bool CanSetTransparent();
68
69 virtual bool SetBackgroundStyle(wxBackgroundStyle style);
bcb07ff0
SC
70
71 virtual void Update();
72
73 WXWindow GetWXWindow() const ;
74 static wxNonOwnedWindow* GetFromWXWindow( WXWindow win );
5c6eb3a8
SC
75
76 // implementation from now on
77 // --------------------------
78
bcb07ff0 79 // activation hooks only necessary for MDI Implementation
5c6eb3a8 80 static void MacDelayedDeactivation(long timestamp);
5c6eb3a8 81 virtual void MacActivate( long timestamp , bool inIsActivating ) ;
bcb07ff0 82
5c6eb3a8
SC
83
84 virtual void Raise();
85 virtual void Lower();
86 virtual bool Show( bool show = true );
87
88 virtual bool ShowWithEffect(wxShowEffect effect,
bcb07ff0 89 unsigned timeout = 0) ;
5c6eb3a8
SC
90
91 virtual bool HideWithEffect(wxShowEffect effect,
bcb07ff0 92 unsigned timeout = 0) ;
5c6eb3a8
SC
93
94 virtual void SetExtraStyle(long exStyle) ;
95
96 virtual bool SetBackgroundColour( const wxColour &colour );
97
bcb07ff0
SC
98 wxNonOwnedWindowImpl* GetNonOwnedPeer() const { return m_nowpeer; }
99
524c47aa 100 // osx specific event handling common for all osx-ports
bcb07ff0 101
524c47aa
SC
102 virtual void HandleActivated( double timestampsec, bool didActivate );
103 virtual void HandleResized( double timestampsec );
104 virtual void HandleMoved( double timestampsec );
105 virtual void HandleResizing( double timestampsec, wxRect* rect );
106
5c6eb3a8
SC
107protected:
108 // common part of all ctors
109 void Init();
110
5c6eb3a8
SC
111 virtual void DoGetPosition( int *x, int *y ) const;
112 virtual void DoGetSize( int *width, int *height ) const;
113 virtual void DoMoveWindow(int x, int y, int width, int height);
114 virtual void DoGetClientSize(int *width, int *height) const;
115
bcb07ff0 116 wxNonOwnedWindowImpl* m_nowpeer ;
5c6eb3a8 117
bcb07ff0 118// wxWindowMac* m_macFocus ;
5c6eb3a8
SC
119
120 static wxNonOwnedWindow *s_macDeactivateWindow;
121private :
5c6eb3a8
SC
122};
123
124// list of all frames and modeless dialogs
125extern WXDLLIMPEXP_DATA_CORE(wxWindowList) wxModelessWindows;
126
127
128#endif // _WX_MAC_NONOWNEDWND_H_