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:
Julian Smart
2001-07-09 13:14:28 +00:00
parent 43bb528818
commit 9806a47c30
10 changed files with 65 additions and 17 deletions

View File

@@ -587,6 +587,16 @@
# endif # endif
#endif /* wxGTK && !wxUniv */ #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 */ /* generic controls dependencies */
#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__) #if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
# if wxUSE_FONTDLG || wxUSE_FILEDLG || wxUSE_CHOICEDLG # if wxUSE_FONTDLG || wxUSE_FILEDLG || wxUSE_CHOICEDLG

View File

@@ -42,7 +42,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel, class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel,
public wxScrollHelper public wxScrollHelper
{ {
public: public:
wxGenericScrolledWindow() : wxScrollHelper(this) { } wxGenericScrolledWindow() : wxScrollHelper(this) { }
wxGenericScrolledWindow(wxWindow *parent, wxGenericScrolledWindow(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = -1,

View File

@@ -203,11 +203,14 @@ protected:
bool CanAddEventHandler() const { return m_canAddEventHandler; } bool CanAddEventHandler() const { return m_canAddEventHandler; }
void SetCanAddEventHandler(bool flag) { m_canAddEventHandler = flag; } void SetCanAddEventHandler(bool flag) { m_canAddEventHandler = flag; }
public:
WXPixmap GetBackingPixmap() const { return m_backingPixmap; } WXPixmap GetBackingPixmap() const { return m_backingPixmap; }
void SetBackingPixmap(WXPixmap pixmap) { m_backingPixmap = pixmap; }
int GetPixmapWidth() const { return m_pixmapWidth; } int GetPixmapWidth() const { return m_pixmapWidth; }
int GetPixmapHeight() const { return m_pixmapHeight; } int GetPixmapHeight() const { return m_pixmapHeight; }
void SetPixmapWidth(int w) { m_pixmapWidth = w; }
void SetPixmapHeight(int h) { m_pixmapHeight = h; }
public:
// Change properties // Change properties
virtual void ChangeFont(bool keepOriginalSize = TRUE); // Change to the current font (often overridden) virtual void ChangeFont(bool keepOriginalSize = TRUE); // Change to the current font (often overridden)

View File

@@ -58,6 +58,8 @@ protected:
#include "wx/os2/spinctrl.h" #include "wx/os2/spinctrl.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/spinctrl.h" #include "wx/gtk/spinctrl.h"
#elif defined(__WXMOTIF__)
#include "wx/generic/spinctlg.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/generic/spinctlg.h" #include "wx/generic/spinctlg.h"
#else // Win16 || !Win #else // Win16 || !Win

View File

@@ -214,6 +214,24 @@ bool wxNotebook::SetPageImage(int nPage, int nImage)
return FALSE; 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 // wxNotebook operations
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -319,22 +319,22 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX,
int totalPixelWidth = m_xScrollLines * m_xScrollPixelsPerLine; int totalPixelWidth = m_xScrollLines * m_xScrollPixelsPerLine;
int totalPixelHeight = m_yScrollLines * m_yScrollPixelsPerLine; int totalPixelHeight = m_yScrollLines * m_yScrollPixelsPerLine;
if (m_targetWindow->m_backingPixmap && if (m_targetWindow->GetBackingPixmap() &&
!((m_targetWindow->m_pixmapWidth == totalPixelWidth) && !((m_targetWindow->GetPixmapWidth() == totalPixelWidth) &&
(m_targetWindow->m_pixmapHeight == totalPixelHeight))) (m_targetWindow->GetPixmapHeight() == totalPixelHeight)))
{ {
XFreePixmap (dpy, (Pixmap) m_targetWindow->m_backingPixmap); XFreePixmap (dpy, (Pixmap) m_targetWindow->GetBackingPixmap());
m_targetWindow->m_backingPixmap = (WXPixmap) 0; m_targetWindow->SetBackingPixmap((WXPixmap) 0);
} }
if (!m_targetWindow->m_backingPixmap && if (!m_targetWindow->GetBackingPixmap() &&
(noUnitsX != 0) && (noUnitsY != 0)) (noUnitsX != 0) && (noUnitsY != 0))
{ {
int depth = wxDisplayDepth(); int depth = wxDisplayDepth();
m_pixmapWidth = totalPixelWidth; m_targetWindow->SetPixmapWidth(totalPixelWidth);
m_pixmapHeight = totalPixelHeight; m_targetWindow->SetPixmapHeight(totalPixelHeight);
m_backingPixmap = (WXPixmap) XCreatePixmap (dpy, RootWindow (dpy, DefaultScreen (dpy)), m_targetWindow->SetBackingPixmap((WXPixmap) XCreatePixmap (dpy, RootWindow (dpy, DefaultScreen (dpy)),
m_pixmapWidth, m_pixmapHeight, depth); m_targetWindow->GetPixmapWidth(), m_targetWindow->GetPixmapHeight(), depth));
} }
} }

View File

@@ -76,6 +76,10 @@
// what is considered "small index"? // what is considered "small index"?
#define INDEX_IS_SMALL 100 #define INDEX_IS_SMALL 100
/* Motif defines this as a macro */
#ifdef Below
#undef Below
#endif
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// wxHtmlHelpTreeItemData (private) // wxHtmlHelpTreeItemData (private)

View File

@@ -286,7 +286,7 @@ bool wxMenuBar::Append(wxMenu * menu, const wxString& title)
menu->SetButtonWidget(w); menu->SetButtonWidget(w);
} }
menu->SetMenuBar(this); //menu->SetMenuBar(this);
m_titles.Add(title); m_titles.Add(title);

View File

@@ -20,7 +20,6 @@
// put wxSpinCtrl here too because it doesn't have a separate file for it in // put wxSpinCtrl here too because it doesn't have a separate file for it in
// wxMotif (yet) // wxMotif (yet)
IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent) IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent)
bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size),

View File

@@ -80,6 +80,8 @@ static const int SCROLL_MARGIN = 4;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern wxHashTable *wxWidgetHashTable; extern wxHashTable *wxWidgetHashTable;
static wxWindow* g_captureWindow = NULL;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// private functions // private functions
@@ -383,6 +385,9 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
// Destructor // Destructor
wxWindow::~wxWindow() wxWindow::~wxWindow()
{ {
if (g_captureWindow == this)
g_captureWindow = NULL;
m_isBeingDeleted = TRUE; m_isBeingDeleted = TRUE;
// Motif-specific actions first // Motif-specific actions first
@@ -710,6 +715,7 @@ wxString wxWindow::GetTitle() const
void wxWindow::CaptureMouse() void wxWindow::CaptureMouse()
{ {
g_captureWindow = this;
if ( m_winCaptured ) if ( m_winCaptured )
return; return;
@@ -722,6 +728,7 @@ void wxWindow::CaptureMouse()
void wxWindow::ReleaseMouse() void wxWindow::ReleaseMouse()
{ {
g_captureWindow = NULL;
if ( !m_winCaptured ) if ( !m_winCaptured )
return; return;
@@ -2977,6 +2984,13 @@ wxWindow *wxGetActiveWindow()
return NULL; return NULL;
} }
/* static */
wxWindow *wxWindowBase::GetCapture()
{
return (wxWindow *)g_captureWindow;
}
// Find the wxWindow at the current mouse position, returning the mouse // Find the wxWindow at the current mouse position, returning the mouse
// position. // position.
wxWindow* wxFindWindowAtPointer(wxPoint& pt) wxWindow* wxFindWindowAtPointer(wxPoint& pt)
@@ -3001,12 +3015,10 @@ wxPoint wxGetMousePosition()
return wxPoint(rootX, rootY); return wxPoint(rootX, rootY);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxNoOptimize: switch off size optimization // wxNoOptimize: switch off size optimization
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
int wxNoOptimize::ms_count = 0; int wxNoOptimize::ms_count = 0;