2004-03-23 12:35:05 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/mac/toplevel.h
|
|
|
|
// 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 defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
|
|
|
#pragma interface "toplevel.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#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
|
|
|
|
virtual void Maximize(bool maximize = TRUE);
|
|
|
|
virtual bool IsMaximized() const;
|
|
|
|
virtual void Iconize(bool iconize = TRUE);
|
|
|
|
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
|
|
|
|
|
|
|
// 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 ) ;
|
2004-03-27 02:15:02 -05:00
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
virtual void Raise();
|
|
|
|
virtual void Lower();
|
|
|
|
virtual void SetTitle( const wxString& title);
|
|
|
|
virtual bool Show( bool show = TRUE );
|
2004-03-27 02:15:02 -05:00
|
|
|
|
|
|
|
virtual void MacSetBackgroundBrush( const wxBrush &brush ) ;
|
|
|
|
|
2004-03-23 12:35:05 -05:00
|
|
|
bool MacUsesCompositing() { return m_macUsesCompositing; }
|
2004-03-28 12:47:01 -05:00
|
|
|
virtual void MacInstallTopLevelWindowEventHandler() ;
|
2004-03-23 12:35:05 -05:00
|
|
|
|
2004-03-27 02:15:02 -05:00
|
|
|
void MacSetMetalAppearance( bool on ) ;
|
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;
|
|
|
|
bool m_macUsesCompositing ;
|
|
|
|
|
|
|
|
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 :
|
|
|
|
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_
|
|
|
|
|