Various wxMotif fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
43bb528818
commit
9806a47c30
@ -587,6 +587,16 @@
|
||||
# endif
|
||||
#endif /* wxGTK && !wxUniv */
|
||||
|
||||
/* wxMotif-specific dependencies */
|
||||
#if defined(__WXMOTIF__) && wxUSE_NOTEBOOK && !wxUSE_TAB_DIALOG
|
||||
# undef wxUSE_TAB_DIALOG
|
||||
# define wxUSE_TAB_DIALOG 1
|
||||
#endif
|
||||
#if defined(__WXMOTIF__) && wxUSE_TOGGLEBTN
|
||||
# undef wxUSE_TOGGLEBTN
|
||||
# define wxUSE_TOGGLEBTN 0
|
||||
#endif
|
||||
|
||||
/* generic controls dependencies */
|
||||
#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
|
||||
# if wxUSE_FONTDLG || wxUSE_FILEDLG || wxUSE_CHOICEDLG
|
||||
|
@ -42,7 +42,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
|
||||
class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel,
|
||||
public wxScrollHelper
|
||||
{
|
||||
public:
|
||||
public:
|
||||
wxGenericScrolledWindow() : wxScrollHelper(this) { }
|
||||
wxGenericScrolledWindow(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
|
@ -203,11 +203,14 @@ protected:
|
||||
bool CanAddEventHandler() const { return m_canAddEventHandler; }
|
||||
void SetCanAddEventHandler(bool flag) { m_canAddEventHandler = flag; }
|
||||
|
||||
public:
|
||||
WXPixmap GetBackingPixmap() const { return m_backingPixmap; }
|
||||
void SetBackingPixmap(WXPixmap pixmap) { m_backingPixmap = pixmap; }
|
||||
int GetPixmapWidth() const { return m_pixmapWidth; }
|
||||
int GetPixmapHeight() const { return m_pixmapHeight; }
|
||||
void SetPixmapWidth(int w) { m_pixmapWidth = w; }
|
||||
void SetPixmapHeight(int h) { m_pixmapHeight = h; }
|
||||
|
||||
public:
|
||||
// Change properties
|
||||
virtual void ChangeFont(bool keepOriginalSize = TRUE); // Change to the current font (often overridden)
|
||||
|
||||
|
@ -58,6 +58,8 @@ protected:
|
||||
#include "wx/os2/spinctrl.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/spinctrl.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/generic/spinctlg.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/generic/spinctlg.h"
|
||||
#else // Win16 || !Win
|
||||
|
@ -214,6 +214,24 @@ bool wxNotebook::SetPageImage(int nPage, int nImage)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// set the size (the same for all pages)
|
||||
void wxNotebook::SetPageSize(const wxSize& size)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// set the padding between tabs (in pixels)
|
||||
void wxNotebook::SetPadding(const wxSize& padding)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// set the size of the tabs for wxNB_FIXEDWIDTH controls
|
||||
void wxNotebook::SetTabSize(const wxSize& sz)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook operations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -319,22 +319,22 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX,
|
||||
|
||||
int totalPixelWidth = m_xScrollLines * m_xScrollPixelsPerLine;
|
||||
int totalPixelHeight = m_yScrollLines * m_yScrollPixelsPerLine;
|
||||
if (m_targetWindow->m_backingPixmap &&
|
||||
!((m_targetWindow->m_pixmapWidth == totalPixelWidth) &&
|
||||
(m_targetWindow->m_pixmapHeight == totalPixelHeight)))
|
||||
if (m_targetWindow->GetBackingPixmap() &&
|
||||
!((m_targetWindow->GetPixmapWidth() == totalPixelWidth) &&
|
||||
(m_targetWindow->GetPixmapHeight() == totalPixelHeight)))
|
||||
{
|
||||
XFreePixmap (dpy, (Pixmap) m_targetWindow->m_backingPixmap);
|
||||
m_targetWindow->m_backingPixmap = (WXPixmap) 0;
|
||||
XFreePixmap (dpy, (Pixmap) m_targetWindow->GetBackingPixmap());
|
||||
m_targetWindow->SetBackingPixmap((WXPixmap) 0);
|
||||
}
|
||||
|
||||
if (!m_targetWindow->m_backingPixmap &&
|
||||
if (!m_targetWindow->GetBackingPixmap() &&
|
||||
(noUnitsX != 0) && (noUnitsY != 0))
|
||||
{
|
||||
int depth = wxDisplayDepth();
|
||||
m_pixmapWidth = totalPixelWidth;
|
||||
m_pixmapHeight = totalPixelHeight;
|
||||
m_backingPixmap = (WXPixmap) XCreatePixmap (dpy, RootWindow (dpy, DefaultScreen (dpy)),
|
||||
m_pixmapWidth, m_pixmapHeight, depth);
|
||||
m_targetWindow->SetPixmapWidth(totalPixelWidth);
|
||||
m_targetWindow->SetPixmapHeight(totalPixelHeight);
|
||||
m_targetWindow->SetBackingPixmap((WXPixmap) XCreatePixmap (dpy, RootWindow (dpy, DefaultScreen (dpy)),
|
||||
m_targetWindow->GetPixmapWidth(), m_targetWindow->GetPixmapHeight(), depth));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -76,6 +76,10 @@
|
||||
// what is considered "small index"?
|
||||
#define INDEX_IS_SMALL 100
|
||||
|
||||
/* Motif defines this as a macro */
|
||||
#ifdef Below
|
||||
#undef Below
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// wxHtmlHelpTreeItemData (private)
|
||||
|
@ -286,7 +286,7 @@ bool wxMenuBar::Append(wxMenu * menu, const wxString& title)
|
||||
menu->SetButtonWidget(w);
|
||||
}
|
||||
|
||||
menu->SetMenuBar(this);
|
||||
//menu->SetMenuBar(this);
|
||||
|
||||
m_titles.Add(title);
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
// put wxSpinCtrl here too because it doesn't have a separate file for it in
|
||||
// wxMotif (yet)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent)
|
||||
|
||||
bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size),
|
||||
|
@ -80,6 +80,8 @@ static const int SCROLL_MARGIN = 4;
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
extern wxHashTable *wxWidgetHashTable;
|
||||
static wxWindow* g_captureWindow = NULL;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private functions
|
||||
@ -383,6 +385,9 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
||||
// Destructor
|
||||
wxWindow::~wxWindow()
|
||||
{
|
||||
if (g_captureWindow == this)
|
||||
g_captureWindow = NULL;
|
||||
|
||||
m_isBeingDeleted = TRUE;
|
||||
|
||||
// Motif-specific actions first
|
||||
@ -710,6 +715,7 @@ wxString wxWindow::GetTitle() const
|
||||
|
||||
void wxWindow::CaptureMouse()
|
||||
{
|
||||
g_captureWindow = this;
|
||||
if ( m_winCaptured )
|
||||
return;
|
||||
|
||||
@ -722,6 +728,7 @@ void wxWindow::CaptureMouse()
|
||||
|
||||
void wxWindow::ReleaseMouse()
|
||||
{
|
||||
g_captureWindow = NULL;
|
||||
if ( !m_winCaptured )
|
||||
return;
|
||||
|
||||
@ -2977,6 +2984,13 @@ wxWindow *wxGetActiveWindow()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* static */
|
||||
wxWindow *wxWindowBase::GetCapture()
|
||||
{
|
||||
return (wxWindow *)g_captureWindow;
|
||||
}
|
||||
|
||||
|
||||
// Find the wxWindow at the current mouse position, returning the mouse
|
||||
// position.
|
||||
wxWindow* wxFindWindowAtPointer(wxPoint& pt)
|
||||
@ -3001,12 +3015,10 @@ wxPoint wxGetMousePosition()
|
||||
return wxPoint(rootX, rootY);
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNoOptimize: switch off size optimization
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxNoOptimize::ms_count = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user