2004-03-23 12:35:05 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2005-11-07 09:37:19 -05:00
|
|
|
// Name: wx/mac/carbon/toplevel.h
|
2004-03-23 12:35:05 -05:00
|
|
|
// Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 20.09.01
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2001 Stefan Csomor
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2004-03-23 12:35:05 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_MSW_TOPLEVEL_H_
|
|
|
|
#define _WX_MSW_TOPLEVEL_H_
|
|
|
|
|
|
|
|
#if wxUSE_SYSTEM_OPTIONS
|
|
|
|
#define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition")
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxTopLevelWindowMac
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxTopLevelWindowMac : public wxTopLevelWindowBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// constructors and such
|
|
|
|
wxTopLevelWindowMac() { Init(); }
|
|
|
|
|
|
|
|
wxTopLevelWindowMac(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
(void)Create(parent, id, title, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr);
|
|
|
|
|
|
|
|
virtual ~wxTopLevelWindowMac();
|
|
|
|
|
2004-03-27 02:15:02 -05:00
|
|
|
virtual wxPoint GetClientAreaOrigin() const;
|
|
|
|
|
2004-12-29 05:10:14 -05:00
|
|
|
// Attracts the users attention to this window if the application is
|
|
|
|
// inactive (should be called when a background event occurs)
|
|
|
|
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
// implement base class pure virtuals
|
2005-11-07 09:37:19 -05:00
|
|
|
virtual void Maximize(bool maximize = true);
|
2004-03-23 12:35:05 -05:00
|
|
|
virtual bool IsMaximized() const;
|
2005-11-07 09:37:19 -05:00
|
|
|
virtual void Iconize(bool iconize = true);
|
2004-03-23 12:35:05 -05:00
|
|
|
virtual bool IsIconized() const;
|
|
|
|
virtual void SetIcon(const wxIcon& icon);
|
|
|
|
virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
|
|
|
|
virtual void Restore();
|
|
|
|
|
|
|
|
virtual bool SetShape(const wxRegion& region);
|
|
|
|
|
2004-07-21 05:51:52 -04:00
|
|
|
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) ;
|
|
|
|
virtual bool IsFullScreen() const ;
|
2004-03-23 12:35:05 -05:00
|
|
|
|
2006-07-17 17:30:08 -04:00
|
|
|
virtual bool SetTransparent(wxByte alpha);
|
|
|
|
virtual bool CanSetTransparent();
|
2006-07-15 23:28:23 -04:00
|
|
|
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
|
|
|
static void MacDelayedDeactivation(long timestamp);
|
|
|
|
virtual void MacCreateRealWindow( const wxString& title,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
long style,
|
|
|
|
const wxString& name ) ;
|
|
|
|
virtual void ClearBackground() ;
|
2004-03-27 02:15:02 -05:00
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
WXWindow MacGetWindowRef() { return m_macWindow ; }
|
|
|
|
virtual void MacActivate( long timestamp , bool inIsActivating ) ;
|
2005-03-30 00:42:49 -05:00
|
|
|
virtual void MacPerformUpdates() ;
|
2004-03-27 02:15:02 -05:00
|
|
|
|
2005-11-07 09:37:19 -05:00
|
|
|
virtual void SetTitle( const wxString& title);
|
|
|
|
virtual wxString GetTitle() const;
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
virtual void Raise();
|
|
|
|
virtual void Lower();
|
2005-11-07 09:37:19 -05:00
|
|
|
virtual bool Show( bool show = true );
|
2004-03-27 02:15:02 -05:00
|
|
|
|
2005-11-09 04:45:58 -05:00
|
|
|
virtual void SetExtraStyle(long exStyle) ;
|
|
|
|
|
2004-03-27 02:15:02 -05:00
|
|
|
virtual void MacSetBackgroundBrush( const wxBrush &brush ) ;
|
|
|
|
|
2004-03-28 12:47:01 -05:00
|
|
|
virtual void MacInstallTopLevelWindowEventHandler() ;
|
2004-03-23 12:35:05 -05:00
|
|
|
|
2004-03-29 01:43:37 -05:00
|
|
|
bool MacGetMetalAppearance() const ;
|
2004-03-27 02:15:02 -05:00
|
|
|
|
|
|
|
void MacChangeWindowAttributes( wxUint32 attributesToSet , wxUint32 attributesToClear ) ;
|
|
|
|
wxUint32 MacGetWindowAttributes() const ;
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; }
|
2004-03-27 02:15:02 -05:00
|
|
|
|
2004-04-03 09:41:34 -05:00
|
|
|
virtual void MacGetContentAreaInset( int &left , int &top , int &right , int &bottom ) ;
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
protected:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2004-03-27 02:15:02 -05:00
|
|
|
virtual void DoGetPosition( int *x, int *y ) const;
|
|
|
|
virtual void DoGetSize( int *width, int *height ) const;
|
|
|
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
|
|
|
virtual void DoGetClientSize(int *width, int *height) const;
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
// is the frame currently iconized?
|
|
|
|
bool m_iconized;
|
|
|
|
|
|
|
|
// should the frame be maximized when it will be shown? set by Maximize()
|
|
|
|
// when it is called while the frame is hidden
|
|
|
|
bool m_maximizeOnShow;
|
2006-08-11 00:01:55 -04:00
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
WXWindow m_macWindow ;
|
2004-03-27 02:15:02 -05:00
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
wxWindowMac* m_macFocus ;
|
2004-07-21 05:51:52 -04:00
|
|
|
void *m_macFullScreenData ;
|
2004-03-23 12:35:05 -05:00
|
|
|
|
|
|
|
static wxTopLevelWindowMac *s_macDeactivateWindow;
|
|
|
|
private :
|
2006-02-27 20:33:54 -05:00
|
|
|
// KH: We cannot let this be called directly since the metal appearance is now managed by an
|
|
|
|
// extra style. Calling this function directly can result in blank white window backgrounds.
|
|
|
|
// This is because the ExtraStyle flags get out of sync with the metal appearance and the metal
|
|
|
|
// logic & checks cease to work as expected. To set the metal appearance, use SetExtraStyle.
|
|
|
|
void MacSetMetalAppearance( bool on ) ;
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
WXEVENTHANDLERREF m_macEventHandler ;
|
2004-03-27 02:15:02 -05:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2004-03-23 12:35:05 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
// list of all frames and modeless dialogs
|
|
|
|
extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows;
|
|
|
|
|
|
|
|
#endif // _WX_MSW_TOPLEVEL_H_
|