Lots of wxMotif fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -834,6 +834,7 @@ void wxSocketBase::SetupCallbacks()
|
||||
m_internal->sock_inputid = XtAppAddInput (wxAPP_CONTEXT, m_fd,
|
||||
(XtPointer *) XtInputReadMask,
|
||||
(XtInputCallbackProc) wx_socket_read,
|
||||
(XtPointer) this);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -1024,7 +1024,7 @@ void wxGenericGrid::AdjustScrollbars(void)
|
||||
if (m_hScrollBar && !m_hScrollBar->IsShown())
|
||||
horizScrollBarHeight = 0;
|
||||
|
||||
if (m_hScrollBar)
|
||||
if (m_hScrollBar && m_hScrollBar->IsShown())
|
||||
{
|
||||
int nCols = GetCols();
|
||||
m_hScrollBar->SetScrollbar(m_hScrollBar->GetThumbPosition(), wxMax(noHorizSteps, 1), (noHorizSteps == 0) ? 1 : nCols, wxMax(noHorizSteps, 1));
|
||||
@@ -1038,7 +1038,7 @@ void wxGenericGrid::AdjustScrollbars(void)
|
||||
|
||||
}
|
||||
|
||||
if (m_vScrollBar)
|
||||
if (m_vScrollBar && m_vScrollBar->IsShown())
|
||||
{
|
||||
int nRows = GetRows();
|
||||
|
||||
|
@@ -115,13 +115,21 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
|
||||
{
|
||||
if ( sashHit != wxSASH_NONE )
|
||||
{
|
||||
CaptureMouse();
|
||||
CaptureMouse();
|
||||
|
||||
// Required for X to specify that
|
||||
// that we wish to draw on top of all windows
|
||||
// - and we optimise by specifying the area
|
||||
// for creating the overlap window.
|
||||
wxScreenDC::StartDrawingOnTop(this);
|
||||
// that we wish to draw on top of all windows
|
||||
// - and we optimise by specifying the area
|
||||
// for creating the overlap window.
|
||||
// Find the first frame or dialog and use this to specify
|
||||
// the area to draw on.
|
||||
wxWindow* parent = this;
|
||||
|
||||
while (parent && !parent->IsKindOf(CLASSINFO(wxDialog)) &&
|
||||
!parent->IsKindOf(CLASSINFO(wxFrame)))
|
||||
parent = parent->GetParent();
|
||||
|
||||
wxScreenDC::StartDrawingOnTop(parent);
|
||||
|
||||
// We don't say we're dragging yet; we leave that
|
||||
// decision for the Dragging() branch, to ensure
|
||||
|
@@ -29,7 +29,7 @@ RANLIB = ranlib
|
||||
############################ Switches #################################
|
||||
|
||||
# Debug/trace mode. 1 or more for debugging.
|
||||
DEBUG = 0
|
||||
DEBUG = 1
|
||||
GUI = -D__WXSTUBS__ -D__LINUX__ -D__UNIX__
|
||||
GUISUFFIX = _stubs
|
||||
|
||||
@@ -38,7 +38,7 @@ GUISUFFIX = _stubs
|
||||
# Misc options
|
||||
OPTIONS = -D__WXDEBUG__
|
||||
COPTIONS =
|
||||
DEBUGFLAGS =
|
||||
DEBUGFLAGS = -ggdb
|
||||
INCLUDE =
|
||||
WARN = -Wall -Wno-unused # -w
|
||||
CWARN = -Wall -Wno-unused # -w
|
||||
|
@@ -28,7 +28,10 @@
|
||||
#include "wx/log.h"
|
||||
#include "wx/module.h"
|
||||
#include "wx/memory.h"
|
||||
|
||||
#if wxUSE_THREADS
|
||||
#include "wx/thread.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_WX_RESOURCES
|
||||
#include "wx/resource.h"
|
||||
@@ -299,9 +302,12 @@ int wxApp::MainLoop()
|
||||
{
|
||||
if (!ProcessIdle())
|
||||
{
|
||||
// TODO: Robert, what's this for?
|
||||
#if wxUSE_THREADS
|
||||
wxMutexGuiLeave();
|
||||
usleep(20);
|
||||
wxMutexGuiEnter();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -148,6 +148,7 @@ wxChoice::~wxChoice()
|
||||
if (GetMainWidget())
|
||||
{
|
||||
DetachWidget(GetMainWidget()); // Removes event handlers
|
||||
DetachWidget(m_formWidget);
|
||||
|
||||
XtDestroyWidget((Widget) m_formWidget);
|
||||
m_formWidget = (WXWidget) 0;
|
||||
|
@@ -66,7 +66,8 @@ bool wxScreenDC::StartDrawingOnTop(wxWindow* window)
|
||||
wxRect rect;
|
||||
int x, y, width, height;
|
||||
window->GetPosition(& x, & y);
|
||||
window->ClientToScreen(& x, & y);
|
||||
if (window->GetParent())
|
||||
window->GetParent()->ClientToScreen(& x, & y);
|
||||
window->GetSize(& width, & height);
|
||||
rect.x = x; rect.y = y;
|
||||
rect.width = width; rect.height = height;
|
||||
|
@@ -286,6 +286,9 @@ wxDialog::~wxDialog()
|
||||
// Note that this might need to be done for wxFrame also.
|
||||
DestroyChildren();
|
||||
|
||||
// This causes a crash in e.g. the resource sample when closing
|
||||
// the example dialog. TODO: Probably not necessary (?)
|
||||
#if 0
|
||||
// Now process all events, because otherwise
|
||||
// this might remain on the screen.
|
||||
Display* display;
|
||||
@@ -301,6 +304,7 @@ wxDialog::~wxDialog()
|
||||
XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event);
|
||||
XtDispatchEvent(&event);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// By default, pressing escape cancels the dialog
|
||||
|
@@ -688,7 +688,7 @@ void wxListBoxCallback (Widget w, XtPointer clientData,
|
||||
if (item->InSetValue())
|
||||
return;
|
||||
|
||||
wxCommandEvent event (wxEVT_COMMAND_LISTBOX_SELECTED);
|
||||
wxCommandEvent event (wxEVT_COMMAND_LISTBOX_SELECTED, item->GetId());
|
||||
switch (cbs->reason)
|
||||
{
|
||||
case XmCR_MULTIPLE_SELECT:
|
||||
|
@@ -98,7 +98,6 @@ LIB_CPP_SRC=\
|
||||
frame.cpp \
|
||||
gauge.cpp \
|
||||
gdiobj.cpp \
|
||||
helpxxxx.cpp \
|
||||
icon.cpp \
|
||||
listbox.cpp \
|
||||
joystick.cpp \
|
||||
|
@@ -70,6 +70,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id,
|
||||
m_pSubMenu = pSubMenu;
|
||||
m_idItem = id;
|
||||
m_bEnabled = TRUE;
|
||||
m_bChecked = FALSE;
|
||||
|
||||
//// Motif-specific
|
||||
m_menuBar = NULL;
|
||||
@@ -310,6 +311,7 @@ void wxMenuItemCallback (Widget w, XtPointer clientData,
|
||||
{
|
||||
wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, item->GetId());
|
||||
commandEvent.SetEventObject(item->GetMenuBar()->GetMenuBarFrame());
|
||||
commandEvent.SetInt( item->GetId() );
|
||||
|
||||
item->GetMenuBar()->GetMenuBarFrame()->GetEventHandler()->ProcessEvent(commandEvent);
|
||||
}
|
||||
@@ -317,6 +319,8 @@ void wxMenuItemCallback (Widget w, XtPointer clientData,
|
||||
{
|
||||
wxCommandEvent event (wxEVT_COMMAND_MENU_SELECTED, item->GetId());
|
||||
event.SetEventObject(item->GetTopMenu());
|
||||
event.SetInt( item->GetId() );
|
||||
|
||||
item->GetTopMenu()->ProcessCommand (event);
|
||||
}
|
||||
}
|
||||
|
@@ -181,6 +181,7 @@ wxRadioBox::~wxRadioBox()
|
||||
{
|
||||
delete[] m_radioButtonLabels;
|
||||
delete[] m_radioButtons;
|
||||
DetachWidget(m_formWidget);
|
||||
}
|
||||
|
||||
wxString wxRadioBox::GetLabel(int item) const
|
||||
|
@@ -87,7 +87,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
|
||||
XtManageChild (radioButtonWidget);
|
||||
|
||||
SetCanAddEventHandler(TRUE);
|
||||
AttachWidget (parent, m_mainWidget, NULL, pos.x, pos.y, size.x, size.y);
|
||||
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
|
||||
|
||||
ChangeBackgroundColour();
|
||||
|
||||
|
@@ -155,16 +155,17 @@ void wxScrollBar::Command(wxCommandEvent& event)
|
||||
void wxScrollBar::ChangeFont(bool keepOriginalSize)
|
||||
{
|
||||
// TODO
|
||||
// Do anything for a scrollbar? A font will never be seen.
|
||||
}
|
||||
|
||||
void wxScrollBar::ChangeBackgroundColour()
|
||||
{
|
||||
// TODO
|
||||
wxWindow::ChangeBackgroundColour();
|
||||
}
|
||||
|
||||
void wxScrollBar::ChangeForegroundColour()
|
||||
{
|
||||
// TODO
|
||||
wxWindow::ChangeForegroundColour();
|
||||
}
|
||||
|
||||
static void wxScrollBarCallback(Widget widget, XtPointer clientData,
|
||||
|
@@ -124,6 +124,11 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxStaticBox::~wxStaticBox()
|
||||
{
|
||||
DetachWidget(m_formWidget);
|
||||
}
|
||||
|
||||
void wxStaticBox::SetLabel(const wxString& label)
|
||||
{
|
||||
if (!m_labelWidget)
|
||||
@@ -194,10 +199,14 @@ void wxStaticBox::ChangeFont(bool keepOriginalSize)
|
||||
void wxStaticBox::ChangeBackgroundColour()
|
||||
{
|
||||
wxWindow::ChangeBackgroundColour();
|
||||
if (m_labelWidget)
|
||||
DoChangeBackgroundColour(m_labelWidget, m_backgroundColour);
|
||||
}
|
||||
|
||||
void wxStaticBox::ChangeForegroundColour()
|
||||
{
|
||||
wxWindow::ChangeForegroundColour();
|
||||
if (m_labelWidget)
|
||||
DoChangeForegroundColour(m_labelWidget, m_foregroundColour);
|
||||
}
|
||||
|
||||
|
@@ -13,15 +13,20 @@
|
||||
#pragma implementation "thread.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_THREADS
|
||||
|
||||
#include "wx/module.h"
|
||||
#include "wx/thread.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -434,4 +439,5 @@ public:
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
|
||||
|
||||
|
||||
#endif
|
||||
// wxUSE_THREADS
|
||||
|
@@ -2259,12 +2259,7 @@ bool wxAddWindowToTable(Widget w, wxWindow *win)
|
||||
// printf("Adding widget %ld, name = %s\n", w, win->GetClassInfo()->GetClassName());
|
||||
if ((oldItem = (wxWindow *)wxWidgetHashTable->Get ((long) w)))
|
||||
{
|
||||
char buf[300];
|
||||
sprintf(buf, "Widget table clash: new widget is %ld, %s", (long)w, win->GetClassInfo()->GetClassName());
|
||||
wxError (buf);
|
||||
fflush(stderr);
|
||||
sprintf(buf, "Old widget was %s", oldItem->GetClassInfo()->GetClassName());
|
||||
wxError (buf);
|
||||
wxLogError("Widget table clash: new widget is %ld, %s", (long)w, win->GetClassInfo()->GetClassName());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -3266,8 +3261,23 @@ void wxWindow::ChangeBackgroundColour()
|
||||
{
|
||||
if (GetMainWidget())
|
||||
DoChangeBackgroundColour(GetMainWidget(), m_backgroundColour);
|
||||
|
||||
// This not necessary
|
||||
#if 0
|
||||
|
||||
if (m_scrolledWindow && (GetMainWidget() != m_scrolledWindow))
|
||||
{
|
||||
DoChangeBackgroundColour(m_scrolledWindow, m_backgroundColour);
|
||||
// Have to set the scrollbar colours back since
|
||||
// the scrolled window seemed to change them
|
||||
wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ;
|
||||
|
||||
if (m_hScrollBar)
|
||||
DoChangeBackgroundColour(m_hScrollBar, backgroundColour);
|
||||
if (m_vScrollBar)
|
||||
DoChangeBackgroundColour(m_vScrollBar, backgroundColour);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxWindow::ChangeForegroundColour()
|
||||
|
Reference in New Issue
Block a user