projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use single BeforeLast() call in wxConfigPathChanger ctor.
[wxWidgets.git]
/
src
/
x11
/
toplevel.cpp
diff --git
a/src/x11/toplevel.cpp
b/src/x11/toplevel.cpp
index 89d0f13189e4931f4c4f06a53ce4026a69b61442..0cf59dd5dcc75b494d641f12579156fba45c0c13 100644
(file)
--- a/
src/x11/toplevel.cpp
+++ b/
src/x11/toplevel.cpp
@@
-6,7
+6,7
@@
// Created: 24.09.01
// RCS-ID: $Id$
// Copyright: (c) 2002 Julian Smart
// Created: 24.09.01
// RCS-ID: $Id$
// Copyright: (c) 2002 Julian Smart
-// Licen
s
e: wxWindows licence
+// Licen
c
e: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
@@
-24,18
+24,19
@@
#pragma hdrstop
#endif
#pragma hdrstop
#endif
+#include "wx/toplevel.h"
+
#ifndef WX_PRECOMP
#include "wx/app.h"
#ifndef WX_PRECOMP
#include "wx/app.h"
- #include "wx/toplevel.h"
#include "wx/string.h"
#include "wx/log.h"
#include "wx/intl.h"
#include "wx/frame.h"
#include "wx/menu.h"
#include "wx/statusbr.h"
#include "wx/string.h"
#include "wx/log.h"
#include "wx/intl.h"
#include "wx/frame.h"
#include "wx/menu.h"
#include "wx/statusbr.h"
+ #include "wx/settings.h"
#endif //WX_PRECOMP
#endif //WX_PRECOMP
-#include "wx/settings.h"
#include "wx/x11/private.h"
#include "X11/Xutil.h"
#include "wx/x11/private.h"
#include "X11/Xutil.h"
@@
-197,9
+198,9
@@
bool wxTopLevelWindowX11::Create(wxWindow *parent,
{
if (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)
{
{
if (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)
{
- if (GetParent() && GetParent()->GetMainWindow())
+ if (GetParent() && GetParent()->
X11
GetMainWindow())
{
{
- Window xparentwindow = (Window) GetParent()->GetMainWindow();
+ Window xparentwindow = (Window) GetParent()->
X11
GetMainWindow();
XSetTransientForHint( xdisplay, xwindow, xparentwindow );
}
}
XSetTransientForHint( xdisplay, xwindow, xparentwindow );
}
}
@@
-219,7
+220,7
@@
bool wxTopLevelWindowX11::Create(wxWindow *parent,
if (GetParent())
{
wm_hints.flags |= WindowGroupHint;
if (GetParent())
{
wm_hints.flags |= WindowGroupHint;
- wm_hints.window_group = (Window) GetParent()->GetMainWindow();
+ wm_hints.window_group = (Window) GetParent()->
X11
GetMainWindow();
}
wm_hints.input = True;
wm_hints.initial_state = NormalState;
}
wm_hints.input = True;
wm_hints.initial_state = NormalState;
@@
-267,7
+268,7
@@
void wxTopLevelWindowX11::OnInternalIdle()
{
wxSizeEvent event( GetClientSize(), GetId() );
event.SetEventObject( this );
{
wxSizeEvent event( GetClientSize(), GetId() );
event.SetEventObject( this );
-
GetEventHandler()->Process
Event( event );
+
HandleWindow
Event( event );
m_needResizeInIdle = false;
}
m_needResizeInIdle = false;
}
@@
-284,7
+285,7
@@
bool wxTopLevelWindowX11::Show(bool show)
wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this);
wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this);
-
GetEventHandler()->Process
Event(event);
+
HandleWindow
Event(event);
m_needResizeInIdle = false;
}
m_needResizeInIdle = false;
}
@@
-298,7
+299,7
@@
bool wxTopLevelWindowX11::Show(bool show)
// wxTopLevelWindowX11 maximize/minimize
// ----------------------------------------------------------------------------
// wxTopLevelWindowX11 maximize/minimize
// ----------------------------------------------------------------------------
-void wxTopLevelWindowX11::Maximize(bool
maximize
)
+void wxTopLevelWindowX11::Maximize(bool
WXUNUSED(maximize)
)
{
// TODO
}
{
// TODO
}
@@
-311,10
+312,16
@@
bool wxTopLevelWindowX11::IsMaximized() const
void wxTopLevelWindowX11::Iconize(bool iconize)
{
void wxTopLevelWindowX11::Iconize(bool iconize)
{
- if (!m_iconized && GetMainWindow())
+ if ( !iconize )
+ {
+ Restore();
+ return;
+ }
+
+ if (!m_iconized && X11GetMainWindow())
{
if (XIconifyWindow(wxGlobalDisplay(),
{
if (XIconifyWindow(wxGlobalDisplay(),
- (Window) GetMainWindow(), DefaultScreen(wxGlobalDisplay())) != 0)
+ (Window)
X11
GetMainWindow(), DefaultScreen(wxGlobalDisplay())) != 0)
m_iconized = true;
}
}
m_iconized = true;
}
}
@@
-327,9
+334,9
@@
bool wxTopLevelWindowX11::IsIconized() const
void wxTopLevelWindowX11::Restore()
{
// This is the way to deiconify the window, according to the X FAQ
void wxTopLevelWindowX11::Restore()
{
// This is the way to deiconify the window, according to the X FAQ
- if (m_iconized && GetMainWindow())
+ if (m_iconized &&
X11
GetMainWindow())
{
{
- XMapWindow(wxGlobalDisplay(), (Window) GetMainWindow());
+ XMapWindow(wxGlobalDisplay(), (Window)
X11
GetMainWindow());
m_iconized = false;
}
}
m_iconized = false;
}
}
@@
-370,10
+377,9
@@
bool wxTopLevelWindowX11::ShowFullScreen(bool show, long style)
void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon)
{
void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon)
{
- if (icon.Ok() && GetMainWindow())
+ if (icon.Ok() &&
X11
GetMainWindow())
{
{
-#if wxUSE_NANOX
-#else
+#if !wxUSE_NANOX
XWMHints *wmHints = XAllocWMHints();
wmHints->icon_pixmap = (Pixmap) icon.GetPixmap();
XWMHints *wmHints = XAllocWMHints();
wmHints->icon_pixmap = (Pixmap) icon.GetPixmap();
@@
-385,7
+391,7
@@
void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon)
wmHints->icon_mask = (Pixmap) icon.GetMask()->GetBitmap();
}
wmHints->icon_mask = (Pixmap) icon.GetMask()->GetBitmap();
}
- XSetWMHints(wxGlobalDisplay(), (Window) GetMainWindow(), wmHints);
+ XSetWMHints(wxGlobalDisplay(), (Window)
X11
GetMainWindow(), wmHints);
XFree(wmHints);
#endif
}
XFree(wmHints);
#endif
}
@@
-397,13
+403,13
@@
void wxTopLevelWindowX11::SetIcons(const wxIconBundle& icons )
wxTopLevelWindowBase::SetIcons( icons );
DoSetIcon( icons.GetIcon( -1 ) );
wxTopLevelWindowBase::SetIcons( icons );
DoSetIcon( icons.GetIcon( -1 ) );
- wxSetIconsX11( wxGlobalDisplay(), GetMainWindow(), icons );
+ wxSetIconsX11( wxGlobalDisplay(),
X11
GetMainWindow(), icons );
}
bool wxTopLevelWindowX11::SetShape(const wxRegion& region)
{
return wxDoSetShape( wxGlobalDisplay(),
}
bool wxTopLevelWindowX11::SetShape(const wxRegion& region)
{
return wxDoSetShape( wxGlobalDisplay(),
- (Window)GetMainWindow(),
+ (Window)
X11
GetMainWindow(),
region );
}
region );
}
@@
-411,18
+417,18
@@
void wxTopLevelWindowX11::SetTitle(const wxString& title)
{
m_title = title;
{
m_title = title;
- if (GetMainWindow())
+ if (
X11
GetMainWindow())
{
#if wxUSE_UNICODE
// I wonder of e.g. Metacity takes UTF-8 here
{
#if wxUSE_UNICODE
// I wonder of e.g. Metacity takes UTF-8 here
- XStoreName(wxGlobalDisplay(), (Window) GetMainWindow(),
+ XStoreName(wxGlobalDisplay(), (Window)
X11
GetMainWindow(),
(const char*) title.ToAscii() );
(const char*) title.ToAscii() );
- XSetIconName(wxGlobalDisplay(), (Window) GetMainWindow(),
+ XSetIconName(wxGlobalDisplay(), (Window)
X11
GetMainWindow(),
(const char*) title.ToAscii() );
#else
(const char*) title.ToAscii() );
#else
- XStoreName(wxGlobalDisplay(), (Window) GetMainWindow(),
+ XStoreName(wxGlobalDisplay(), (Window)
X11
GetMainWindow(),
(const char*) title);
(const char*) title);
- XSetIconName(wxGlobalDisplay(), (Window) GetMainWindow(),
+ XSetIconName(wxGlobalDisplay(), (Window)
X11
GetMainWindow(),
(const char*) title);
#endif
}
(const char*) title);
#endif
}
@@
-478,7
+484,7
@@
void wxTopLevelWindowX11::DoSetClientSize(int width, int height)
size_hints.flags = PSize;
size_hints.width = width;
size_hints.height = height;
size_hints.flags = PSize;
size_hints.width = width;
size_hints.height = height;
- XSetWMNormalHints( wxGlobalDisplay(), (Window) GetMainWindow(), &size_hints );
+ XSetWMNormalHints( wxGlobalDisplay(), (Window)
X11
GetMainWindow(), &size_hints );
#endif
wxWindowX11::DoSetClientSize(width, height);
#endif
wxWindowX11::DoSetClientSize(width, height);
@@
-517,7
+523,7
@@
void wxTopLevelWindowX11::DoSetSize(int x, int y, int width, int height, int siz
size_hints.y = m_y;
size_hints.width = m_width;
size_hints.height = m_height;
size_hints.y = m_y;
size_hints.width = m_width;
size_hints.height = m_height;
- XSetWMNormalHints( wxGlobalDisplay(), (Window) GetMainWindow(), &size_hints);
+ XSetWMNormalHints( wxGlobalDisplay(), (Window)
X11
GetMainWindow(), &size_hints);
#endif
wxWindowX11::DoSetSize(x, y, width, height, sizeFlags);
#endif
wxWindowX11::DoSetSize(x, y, width, height, sizeFlags);
@@
-687,8
+693,7
@@
bool wxSetWMDecorations(Window w, long style)
}
if ((style & wxCAPTION) ||
}
if ((style & wxCAPTION) ||
- (style & wxTINY_CAPTION_HORIZ) ||
- (style & wxTINY_CAPTION_VERT))
+ (style & wxTINY_CAPTION))
{
wmProp.props |= GR_WM_PROPS_CAPTION ;
wmProp.flags |= GR_WM_FLAGS_PROPS ;
{
wmProp.props |= GR_WM_PROPS_CAPTION ;
wmProp.flags |= GR_WM_FLAGS_PROPS ;