2001-09-15 18:13:08 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/gtk/toplevel.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2001-09-15 18:13:08 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-09-07 12:06:47 -04:00
|
|
|
#ifndef _WX_GTK_TOPLEVEL_H_
|
|
|
|
#define _WX_GTK_TOPLEVEL_H_
|
2001-09-15 18:13:08 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxTopLevelWindowGTK
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxTopLevelWindowGTK : public wxTopLevelWindowBase
|
2001-09-15 18:13:08 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// construction
|
|
|
|
wxTopLevelWindowGTK() { Init(); }
|
|
|
|
wxTopLevelWindowGTK(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();
|
|
|
|
|
|
|
|
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 ~wxTopLevelWindowGTK();
|
|
|
|
|
|
|
|
// implement base class pure virtuals
|
2005-11-04 06:11:22 -05:00
|
|
|
virtual void Maximize(bool maximize = true);
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual bool IsMaximized() const;
|
2005-11-04 06:11:22 -05:00
|
|
|
virtual void Iconize(bool iconize = true);
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual bool IsIconized() const;
|
2002-03-26 16:54:23 -05:00
|
|
|
virtual void SetIcons(const wxIconBundle& icons);
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual void Restore();
|
|
|
|
|
2006-10-27 04:18:26 -04:00
|
|
|
virtual bool EnableCloseButton(bool enable = true);
|
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
|
|
|
|
virtual bool IsFullScreen() const { return m_fsIsShowing; };
|
|
|
|
|
2003-03-28 18:05:05 -05:00
|
|
|
virtual bool SetShape(const wxRegion& region);
|
|
|
|
|
2005-07-28 19:32:42 -04:00
|
|
|
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
|
|
|
|
2005-11-07 15:00:50 -05:00
|
|
|
virtual void SetWindowStyleFlag( long style );
|
|
|
|
|
2005-11-04 06:11:22 -05:00
|
|
|
virtual bool Show(bool show = true);
|
2001-09-15 18:13:08 -04:00
|
|
|
|
2005-02-11 18:00:31 -05:00
|
|
|
virtual void Raise();
|
|
|
|
|
2004-09-26 10:32:09 -04:00
|
|
|
virtual bool IsActive();
|
2004-09-26 10:17:23 -04:00
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual void SetTitle( const wxString &title );
|
|
|
|
virtual wxString GetTitle() const { return m_title; }
|
|
|
|
|
2006-07-19 13:18:12 -04:00
|
|
|
virtual bool SetTransparent(wxByte alpha);
|
|
|
|
virtual bool CanSetTransparent();
|
|
|
|
|
2002-06-18 17:46:42 -04:00
|
|
|
// Experimental, to allow help windows to be
|
|
|
|
// viewable from within modal dialogs
|
|
|
|
virtual void AddGrab();
|
|
|
|
virtual void RemoveGrab();
|
|
|
|
virtual bool IsGrabbed() const { return m_grabbed; }
|
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
|
|
|
// GTK callbacks
|
2006-09-07 12:06:47 -04:00
|
|
|
virtual void GtkOnSize();
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual void OnInternalIdle();
|
|
|
|
|
|
|
|
// do *not* call this to iconize the frame, this is a private function!
|
|
|
|
void SetIconizeState(bool iconic);
|
|
|
|
|
|
|
|
int m_miniEdge,
|
|
|
|
m_miniTitle;
|
|
|
|
GtkWidget *m_mainWidget;
|
|
|
|
|
|
|
|
bool m_fsIsShowing; /* full screen */
|
2001-09-28 13:54:31 -04:00
|
|
|
long m_fsSaveGdkFunc, m_fsSaveGdkDecor;
|
2001-09-15 18:13:08 -04:00
|
|
|
wxRect m_fsSaveFrame;
|
2002-04-20 09:53:11 -04:00
|
|
|
|
|
|
|
// m_windowStyle translated to GDK's terms
|
|
|
|
long m_gdkFunc,
|
|
|
|
m_gdkDecor;
|
2001-09-15 18:13:08 -04:00
|
|
|
|
2007-05-19 14:25:15 -04:00
|
|
|
bool m_sizeSet;
|
|
|
|
|
2005-09-21 03:04:58 -04:00
|
|
|
// private gtk_timeout_add result for mimicing wxUSER_ATTENTION_INFO and
|
|
|
|
// wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle.
|
|
|
|
int m_urgency_hint;
|
|
|
|
|
2006-12-07 00:50:54 -05:00
|
|
|
// give hints to the Window Manager for how the size
|
|
|
|
// of the TLW can be changed by dragging
|
|
|
|
virtual void DoSetSizeHints( int minW, int minH,
|
|
|
|
int maxW = wxDefaultCoord, int maxH = wxDefaultCoord,
|
|
|
|
int incW = wxDefaultCoord, int incH = wxDefaultCoord );
|
|
|
|
|
2007-02-15 07:38:55 -05:00
|
|
|
// return the full size of the window without WM decorations
|
|
|
|
void GTKDoGetSize(int *width, int *height) const;
|
|
|
|
|
2007-05-19 14:25:15 -04:00
|
|
|
void GtkUpdateSize() { m_sizeSet = false; }
|
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
protected:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2007-05-19 13:34:42 -04:00
|
|
|
// move the window to the specified location and resize it
|
2006-02-08 16:47:09 -05:00
|
|
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
|
|
|
|
2007-02-10 18:44:52 -05:00
|
|
|
// take into account WM decorations here
|
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
2007-02-10 18:44:52 -05:00
|
|
|
|
|
|
|
// override these methods to take into account tool/menu/statusbars
|
|
|
|
virtual void DoGetClientSize(int *width, int *height) const;
|
|
|
|
|
|
|
|
// this method takes the size of the window not taking account of
|
2007-05-19 13:34:42 -04:00
|
|
|
// decorations
|
2007-02-10 18:44:52 -05:00
|
|
|
void GTKDoSetSize(int width, int height);
|
2001-09-15 18:13:08 -04:00
|
|
|
|
2007-02-10 18:44:52 -05:00
|
|
|
|
|
|
|
// string shown in the title bar
|
|
|
|
wxString m_title;
|
2005-11-04 06:11:22 -05:00
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
// is the frame currently iconized?
|
|
|
|
bool m_isIconized;
|
2007-02-10 18:44:52 -05:00
|
|
|
|
|
|
|
// is the frame currently grabbed explicitly by the application?
|
2002-06-18 17:46:42 -04:00
|
|
|
bool m_grabbed;
|
2001-09-15 18:13:08 -04:00
|
|
|
};
|
|
|
|
|
2006-09-07 12:06:47 -04:00
|
|
|
#endif // _WX_GTK_TOPLEVEL_H_
|