Cured last focus bug (I hope); some wxMotif mods
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1724 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -101,3 +101,4 @@ An initialized write-only stream.
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxOutputStream}{wxoutputstream}
|
||||
|
||||
|
@@ -118,9 +118,9 @@ Troubleshooting
|
||||
functions, try putting the gcc fixinclude file paths early in the
|
||||
include path.
|
||||
|
||||
- If you get strange memory problems (for example in deletion
|
||||
of string arrays), set wxUSE_GLOBAL_MEMORY_OPERATORS to 0 in
|
||||
setup.h, and recompile.
|
||||
- If you operator-related compile errors or strange memory problems
|
||||
(for example in deletion of string arrays), set wxUSE_GLOBAL_MEMORY_OPERATORS
|
||||
and wxUSE_MEMORY_TRACING to 0 in setup.h, and recompile.
|
||||
|
||||
- If you get an internal compiler error in gcc, turn off
|
||||
optimisations.
|
||||
@@ -128,7 +128,8 @@ Troubleshooting
|
||||
- Problems with XtDestroyWidget crashing in ~wxWindow have been
|
||||
reported on SGI IRIX 6.4. This has not yet been resolved, so
|
||||
any advice here would be very welcome. See bugs.txt for a
|
||||
possible temporary workaround.
|
||||
possible temporary workaround (comment out the final
|
||||
XtDestroyWidget from ~wxWindow in window.cpp).
|
||||
|
||||
Other Notes
|
||||
-----------
|
||||
|
@@ -19,7 +19,7 @@ Update manual.
|
||||
Functions
|
||||
|
||||
Makefiles and/or IDE files for other compilers: Symantec C++,
|
||||
Salford C++. IDE files for BC++.
|
||||
Salford C++.
|
||||
|
||||
Check TODO entries in source and manual.
|
||||
|
||||
|
@@ -69,12 +69,12 @@ public:
|
||||
void OnFocus(wxFocusEvent& event);
|
||||
|
||||
// called by wxWindow whenever it gets focus
|
||||
void SetLastFocus(wxWindow *focus) { m_lastFocus = focus; }
|
||||
wxWindow* GetLastFocus() const { return m_lastFocus; }
|
||||
void SetLastFocus(long focus) { m_lastFocus = focus; }
|
||||
long GetLastFocus() const { return m_lastFocus; }
|
||||
|
||||
protected:
|
||||
// the child which had the focus last time this panel was activated
|
||||
wxWindow *m_lastFocus;
|
||||
long m_lastFocus;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPanel)
|
||||
|
@@ -1,4 +1,3 @@
|
||||
* Last change: JS 8 Sep 98 9:19 pm
|
||||
NAME SashTest
|
||||
DESCRIPTION 'wxSashWindow Demo'
|
||||
EXETYPE WINDOWS
|
||||
|
@@ -42,7 +42,7 @@ END_EVENT_TABLE()
|
||||
|
||||
wxPanel::wxPanel()
|
||||
{
|
||||
m_lastFocus = NULL;
|
||||
m_lastFocus = 0;
|
||||
}
|
||||
|
||||
bool wxPanel::Create(wxWindow *parent, wxWindowID id,
|
||||
@@ -145,8 +145,12 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event )
|
||||
|
||||
void wxPanel::OnFocus(wxFocusEvent& event)
|
||||
{
|
||||
if ( m_lastFocus )
|
||||
m_lastFocus->SetFocus();
|
||||
if (m_lastFocus != 0)
|
||||
{
|
||||
wxWindow* child = FindWindow(m_lastFocus);
|
||||
if (child)
|
||||
child->SetFocus();
|
||||
}
|
||||
else
|
||||
event.Skip();
|
||||
}
|
||||
|
@@ -1,29 +1,31 @@
|
||||
# generic.env
|
||||
# Linux/generic
|
||||
# sgi.env
|
||||
# SGI
|
||||
#
|
||||
# Common makefile settings for wxWindows programs
|
||||
# This file is included by all the other makefiles, thus changes
|
||||
# made here take effect everywhere (except where overriden).
|
||||
# RCS-ID: $Id$
|
||||
#
|
||||
########################### Programs #################################
|
||||
|
||||
# Replace this with your own path if necessary
|
||||
WXDIR = /home/mon/src/wx20
|
||||
WXWIN = /home/jds/wx2
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
# C++ compiler
|
||||
CC = CC -n32 -D__SGI__ -D__SGI_CC__
|
||||
CC = CC
|
||||
|
||||
# C compiler
|
||||
CCC = cc -n32 -Xcpluscomm -D__SGI__ -D__SGI_CC__
|
||||
CCC = cc
|
||||
|
||||
# Compiler for lex/yacc .c programs
|
||||
CCLEX = $(CCC)
|
||||
|
||||
LEX = flex
|
||||
LEX = lex
|
||||
YACC = yacc
|
||||
MAKE = make
|
||||
AROPTIONS = ruv
|
||||
RANLIB = echo ranlib not required on SGI
|
||||
RANLIB = echo
|
||||
|
||||
############################ Switches #################################
|
||||
|
||||
@@ -35,13 +37,13 @@ GUISUFFIX = _stubs
|
||||
########################## Compiler flags #############################
|
||||
|
||||
# Misc options
|
||||
OPTIONS = -D__WXDEBUG__ # -DDEBUG='$(DEBUG)' # -DWXDEBUG
|
||||
COPTIONS =
|
||||
DEBUGFLAGS = -g
|
||||
OPTIONS = -32 -D__WXDEBUG__ -D__SGI__ -D__SGI_CC__
|
||||
COPTIONS = -32 -Xcpluscomm -D__SGI__ -D__SGI_CC__
|
||||
DEBUGFLAGS = -g3
|
||||
INCLUDE =
|
||||
WARN =
|
||||
CWARN =
|
||||
OPT = # -O2
|
||||
WARN = -w
|
||||
CWARN = -w
|
||||
OPT =
|
||||
|
||||
############################ Includes #################################
|
||||
|
||||
@@ -53,14 +55,13 @@ XLIB = -L/usr/local/X11/lib -L/usr/X11/lib -L/usr/X11R6/lib
|
||||
|
||||
############################ Libraries ################################
|
||||
|
||||
COMPLIBS = #-lstdc++
|
||||
COMPLIBS =
|
||||
#COMPLIBS = -lstdc++
|
||||
#COMPLIBS = -lPW
|
||||
GUILDLIBS = -lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lXpm -lX11 -lm
|
||||
|
||||
############################# Suffixes ################################
|
||||
|
||||
# Change cpp to c if you want to use main.c instead of main.cpp.
|
||||
# Edit wx_setup.h accordingly (USE_C_MAIN=1)
|
||||
|
||||
OBJSUFF =o
|
||||
SRCSUFF =cpp
|
||||
MAINSUFF =cpp
|
||||
@@ -111,9 +112,6 @@ cleanstubs:
|
||||
cleanmotif:
|
||||
make -f makefile.unx clean GUI='-D__WXMOTIF__ -D__UNIX__' GUISUFFIX='_motif' GUILDLIBS='-lwx_motif $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm'
|
||||
|
||||
cleangtk:
|
||||
make -f makefile.unx clean GUI='-D__WXGTK__ -D__UNIX__' GUISUFFIX='_gtk'
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir $(OBJDIR)
|
||||
|
||||
|
@@ -30,7 +30,8 @@ OBJSUFF=obj
|
||||
SRCSUFF=cpp
|
||||
|
||||
# If you set wxUSE_IOSTREAMH to 0, remove -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally
|
||||
WINFLAGS=-c -W3 -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION)
|
||||
#WINFLAGS=-c -W3 -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION)
|
||||
WINFLAGS=-c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION)
|
||||
#WINLINKFLAGS=/NODEFAULTLIB /INCREMENTAL:NO /NOLOGO -align:0x1000 -machine:$(CPU) -subsystem:windows,$(APPVER)
|
||||
WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -machine:$(CPU) -subsystem:windows,$(APPVER)
|
||||
#WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib libc.lib oldnames.lib\
|
||||
|
@@ -44,6 +44,7 @@
|
||||
#include <Xm/AtomMgr.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/Frame.h>
|
||||
#include <Xm/DrawingA.h>
|
||||
#if XmVersion > 1000
|
||||
#include <Xm/Protocols.h>
|
||||
#endif
|
||||
@@ -56,6 +57,10 @@ void wxFrameFocusProc(Widget workArea, XtPointer clientData,
|
||||
static void wxFrameMapProc(Widget frameShell, XtPointer clientData,
|
||||
XCrossingEvent * event);
|
||||
|
||||
// From wxWindow
|
||||
extern void wxCanvasRepaintProc (Widget, XtPointer, XmDrawingAreaCallbackStruct * cbs);
|
||||
extern void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallbackStruct * cbs);
|
||||
|
||||
extern wxList wxModelessWindows;
|
||||
extern wxList wxPendingDelete;
|
||||
|
||||
@@ -190,11 +195,13 @@ bool wxFrame::Create(wxWindow *parent,
|
||||
// XmNresizePolicy, XmRESIZE_ANY,
|
||||
NULL);
|
||||
|
||||
XtAddCallback ((Widget) m_clientArea, XmNexposeCallback, (XtCallbackProc) wxCanvasRepaintProc, (XtPointer) this);
|
||||
XtAddCallback ((Widget) m_clientArea, XmNinputCallback, (XtCallbackProc) wxCanvasInputEvent, (XtPointer) this);
|
||||
|
||||
XtVaSetValues((Widget) m_frameWidget,
|
||||
XmNworkWindow, (Widget) m_workArea,
|
||||
NULL);
|
||||
|
||||
|
||||
XtManageChild((Widget) m_clientArea);
|
||||
XtManageChild((Widget) m_workArea);
|
||||
|
||||
@@ -290,6 +297,9 @@ wxFrame::~wxFrame()
|
||||
if (GetMainWidget())
|
||||
Show(FALSE);
|
||||
|
||||
XtRemoveCallback ((Widget) m_clientArea, XmNexposeCallback, (XtCallbackProc) wxCanvasRepaintProc, (XtPointer) this);
|
||||
XtRemoveCallback ((Widget) m_clientArea, XmNinputCallback, (XtCallbackProc) wxCanvasInputEvent, (XtPointer) this);
|
||||
|
||||
if (m_frameMenuBar)
|
||||
{
|
||||
m_frameMenuBar->DestroyMenuBar();
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include <Xm/CascadeBG.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/DrawingA.h>
|
||||
#include <Xm/AtomMgr.h>
|
||||
#include <Xm/Protocols.h>
|
||||
|
||||
@@ -36,6 +37,10 @@ extern wxList wxModelessWindows;
|
||||
extern void wxFrameFocusProc(Widget workArea, XtPointer clientData,
|
||||
XmAnyCallbackStruct *cbs);
|
||||
|
||||
// From wxWindow
|
||||
extern void wxCanvasRepaintProc (Widget, XtPointer, XmDrawingAreaCallbackStruct * cbs);
|
||||
extern void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallbackStruct * cbs);
|
||||
|
||||
#define wxID_NOTEBOOK_CLIENT_AREA wxID_HIGHEST + 100
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
@@ -341,6 +346,8 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
||||
XmNresizePolicy, XmRESIZE_NONE,
|
||||
NULL);
|
||||
|
||||
XtAddCallback ((Widget) m_mainWidget, XmNexposeCallback, (XtCallbackProc) wxCanvasRepaintProc, (XtPointer) this);
|
||||
|
||||
SetCanAddEventHandler(TRUE);
|
||||
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
|
||||
|
||||
@@ -363,6 +370,8 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
||||
|
||||
wxMDIChildFrame::~wxMDIChildFrame()
|
||||
{
|
||||
XtRemoveCallback ((Widget) m_mainWidget, XmNexposeCallback, (XtCallbackProc) wxCanvasRepaintProc, (XtPointer) this);
|
||||
|
||||
if (GetMDIParentFrame())
|
||||
{
|
||||
wxMDIParentFrame* parentFrame = GetMDIParentFrame();
|
||||
|
@@ -110,11 +110,9 @@ void xt_notify_end_process(XtPointer client, int *fid,
|
||||
|
||||
process_data->end_process = TRUE;
|
||||
|
||||
/* double deletion!
|
||||
if (process_data->pid > 0)
|
||||
if (process_data->pid > 0) // synchronous
|
||||
delete process_data;
|
||||
else
|
||||
*/
|
||||
process_data->pid = 0;
|
||||
}
|
||||
|
||||
@@ -165,8 +163,6 @@ long wxExecute(char **argv, bool sync, wxProcess *handler)
|
||||
printf ("wxWindows: could not execute '%s'\n", *argv);
|
||||
_exit (-1);
|
||||
}
|
||||
if (!sync)
|
||||
return pid;
|
||||
|
||||
wxLocalProcessData *process_data = new wxLocalProcessData;
|
||||
|
||||
@@ -180,15 +176,17 @@ long wxExecute(char **argv, bool sync, wxProcess *handler)
|
||||
(XtInputCallbackProc) xt_notify_end_process,
|
||||
(XtPointer) process_data);
|
||||
|
||||
if (sync)
|
||||
{
|
||||
while (!process_data->end_process)
|
||||
XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
|
||||
|
||||
if (WIFEXITED(process_data->end_process) != 0)
|
||||
{
|
||||
delete process_data;
|
||||
// delete process_data; // Double deletion
|
||||
return WEXITSTATUS(process_data->end_process);
|
||||
}
|
||||
|
||||
}
|
||||
delete process_data;
|
||||
|
||||
return pid;
|
||||
|
@@ -308,14 +308,6 @@ wxWindow::wxWindow()
|
||||
// Destructor
|
||||
wxWindow::~wxWindow()
|
||||
{
|
||||
// Remove potential dangling pointer
|
||||
if (GetParent() && GetParent()->IsKindOf(CLASSINFO(wxPanel)))
|
||||
{
|
||||
wxPanel* panel = (wxPanel*) GetParent();
|
||||
if (panel->GetLastFocus() == this)
|
||||
panel->SetLastFocus((wxWindow*) NULL);
|
||||
}
|
||||
|
||||
m_isBeingDeleted = TRUE;
|
||||
|
||||
// first of all, delete the things on which nothing else depends
|
||||
@@ -1763,7 +1755,7 @@ bool wxWindow::MSWOnSetFocus(WXHWND WXUNUSED(hwnd))
|
||||
wxWindow *parent = GetParent();
|
||||
if ( parent && parent->IsKindOf(CLASSINFO(wxPanel)) )
|
||||
{
|
||||
((wxPanel *)parent)->SetLastFocus(this);
|
||||
((wxPanel *)parent)->SetLastFocus(GetId());
|
||||
}
|
||||
|
||||
wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId);
|
||||
@@ -2201,7 +2193,7 @@ bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
|
||||
|
||||
long wxWindow::MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
switch (wParam && 0xFFFFFFF0)
|
||||
switch (wParam & 0xFFFFFFF0)
|
||||
{
|
||||
case SC_MAXIMIZE:
|
||||
{
|
||||
|
Reference in New Issue
Block a user