2001-09-15 22:13:08 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/gtk/toplevel.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2001-09-15 22:13:08 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-09-07 16:06:47 +00:00
|
|
|
#ifndef _WX_GTK_TOPLEVEL_H_
|
|
|
|
#define _WX_GTK_TOPLEVEL_H_
|
2001-09-15 22:13:08 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxTopLevelWindowGTK
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 22:58:06 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxTopLevelWindowGTK : public wxTopLevelWindowBase
|
2001-09-15 22:13:08 +00: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 11:11:22 +00:00
|
|
|
virtual void Maximize(bool maximize = true);
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual bool IsMaximized() const;
|
2005-11-04 11:11:22 +00:00
|
|
|
virtual void Iconize(bool iconize = true);
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual bool IsIconized() const;
|
2002-03-26 21:54:23 +00:00
|
|
|
virtual void SetIcons(const wxIconBundle& icons);
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual void Restore();
|
|
|
|
|
2006-10-27 08:18:26 +00:00
|
|
|
virtual bool EnableCloseButton(bool enable = true);
|
|
|
|
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
|
|
|
|
virtual bool IsFullScreen() const { return m_fsIsShowing; };
|
|
|
|
|
2003-03-28 23:05:05 +00:00
|
|
|
virtual bool SetShape(const wxRegion& region);
|
|
|
|
|
2005-07-28 23:32:42 +00:00
|
|
|
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
|
|
|
|
2005-11-07 20:00:50 +00:00
|
|
|
virtual void SetWindowStyleFlag( long style );
|
|
|
|
|
2005-11-04 11:11:22 +00:00
|
|
|
virtual bool Show(bool show = true);
|
2001-09-15 22:13:08 +00:00
|
|
|
|
2005-02-11 23:00:31 +00:00
|
|
|
virtual void Raise();
|
|
|
|
|
2004-09-26 14:32:09 +00:00
|
|
|
virtual bool IsActive();
|
2004-09-26 14:17:23 +00:00
|
|
|
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual void SetTitle( const wxString &title );
|
|
|
|
virtual wxString GetTitle() const { return m_title; }
|
|
|
|
|
2006-07-19 17:18:12 +00:00
|
|
|
virtual bool SetTransparent(wxByte alpha);
|
|
|
|
virtual bool CanSetTransparent();
|
|
|
|
|
2002-06-18 21:46:42 +00: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 22:13:08 +00:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
|
|
|
// GTK callbacks
|
2006-09-07 16:06:47 +00:00
|
|
|
virtual void GtkOnSize();
|
2001-09-15 22:13:08 +00: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 17:54:31 +00:00
|
|
|
long m_fsSaveGdkFunc, m_fsSaveGdkDecor;
|
2001-09-15 22:13:08 +00:00
|
|
|
wxRect m_fsSaveFrame;
|
2002-04-20 13:53:11 +00:00
|
|
|
|
|
|
|
// m_windowStyle translated to GDK's terms
|
|
|
|
long m_gdkFunc,
|
|
|
|
m_gdkDecor;
|
2001-09-15 22:13:08 +00:00
|
|
|
|
2007-05-19 18:25:15 +00:00
|
|
|
bool m_sizeSet;
|
|
|
|
|
2005-09-21 07:04:58 +00: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 05:50:54 +00: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 12:38:55 +00:00
|
|
|
// return the full size of the window without WM decorations
|
|
|
|
void GTKDoGetSize(int *width, int *height) const;
|
|
|
|
|
2007-05-19 18:25:15 +00:00
|
|
|
void GtkUpdateSize() { m_sizeSet = false; }
|
|
|
|
|
2001-09-15 22:13:08 +00:00
|
|
|
protected:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2007-05-19 17:34:42 +00:00
|
|
|
// move the window to the specified location and resize it
|
2006-02-08 21:47:09 +00:00
|
|
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
|
|
|
|
2007-02-10 23:44:52 +00:00
|
|
|
// take into account WM decorations here
|
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
2007-02-10 23:44:52 +00: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 17:34:42 +00:00
|
|
|
// decorations
|
2007-02-10 23:44:52 +00:00
|
|
|
void GTKDoSetSize(int width, int height);
|
2001-09-15 22:13:08 +00:00
|
|
|
|
2007-02-10 23:44:52 +00:00
|
|
|
|
|
|
|
// string shown in the title bar
|
|
|
|
wxString m_title;
|
2005-11-04 11:11:22 +00:00
|
|
|
|
2001-09-15 22:13:08 +00:00
|
|
|
// is the frame currently iconized?
|
|
|
|
bool m_isIconized;
|
2007-02-10 23:44:52 +00:00
|
|
|
|
|
|
|
// is the frame currently grabbed explicitly by the application?
|
2002-06-18 21:46:42 +00:00
|
|
|
bool m_grabbed;
|
2001-09-15 22:13:08 +00:00
|
|
|
};
|
|
|
|
|
2006-09-07 16:06:47 +00:00
|
|
|
#endif // _WX_GTK_TOPLEVEL_H_
|