\wxheading{See also}
\helpref{wxOutputStream}{wxoutputstream}
+
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.
- 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
-----------
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.
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)
- * Last change: JS 8 Sep 98 9:19 pm
NAME SashTest
DESCRIPTION 'wxSashWindow Demo'
EXETYPE WINDOWS
wxPanel::wxPanel()
{
- m_lastFocus = NULL;
+ m_lastFocus = 0;
}
bool wxPanel::Create(wxWindow *parent, wxWindowID id,
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();
}
-# 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 #################################
########################## 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 #################################
# Compiler or system-specific include paths
-COMPPATHS =
+COMPPATHS =
XINCLUDE = -I/usr/include/X11 -I/usr/include/Xm \
-I/usr/include/X11/Xm -I/usr/include
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
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)
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\
#include <Xm/AtomMgr.h>
#include <Xm/LabelG.h>
#include <Xm/Frame.h>
+#include <Xm/DrawingA.h>
#if XmVersion > 1000
#include <Xm/Protocols.h>
#endif
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;
// 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);
{
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();
#include <Xm/CascadeBG.h>
#include <Xm/Text.h>
#include <Xm/PushBG.h>
+#include <Xm/DrawingA.h>
#include <Xm/AtomMgr.h>
#include <Xm/Protocols.h>
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
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);
wxMDIChildFrame::~wxMDIChildFrame()
{
+ XtRemoveCallback ((Widget) m_mainWidget, XmNexposeCallback, (XtCallbackProc) wxCanvasRepaintProc, (XtPointer) this);
+
if (GetMDIParentFrame())
{
wxMDIParentFrame* parentFrame = GetMDIParentFrame();
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;
}
printf ("wxWindows: could not execute '%s'\n", *argv);
_exit (-1);
}
- if (!sync)
- return pid;
-
+
wxLocalProcessData *process_data = new wxLocalProcessData;
process_data->end_process = 0;
(XtInputCallbackProc) xt_notify_end_process,
(XtPointer) process_data);
- while (!process_data->end_process)
- XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
-
- if (WIFEXITED(process_data->end_process) != 0)
+ if (sync)
{
- delete process_data;
- return WEXITSTATUS(process_data->end_process);
+ while (!process_data->end_process)
+ XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
+
+ if (WIFEXITED(process_data->end_process) != 0)
+ {
+// delete process_data; // Double deletion
+ return WEXITSTATUS(process_data->end_process);
+ }
}
-
delete process_data;
return pid;
// 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
wxWindow *parent = GetParent();
if ( parent && parent->IsKindOf(CLASSINFO(wxPanel)) )
{
- ((wxPanel *)parent)->SetLastFocus(this);
+ ((wxPanel *)parent)->SetLastFocus(GetId());
}
wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId);
long wxWindow::MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam)
{
- switch (wParam && 0xFFFFFFF0)
+ switch (wParam & 0xFFFFFFF0)
{
case SC_MAXIMIZE:
{