From: Robert Roebling Date: Mon, 11 Jun 2001 20:03:00 +0000 (+0000) Subject: Applied wxImage::Scale() patch, X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/33611ebbd99217ef90f1178eed37e30385c121de Applied wxImage::Scale() patch, Added testing code for wxSplitterWindow bug. Added testing code for OnEraseBackground things. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/configure b/samples/configure index c5e4d1bb65..0d029ca065 100755 --- a/samples/configure +++ b/samples/configure @@ -663,6 +663,7 @@ trap 'rm -fr `echo " dragimag/Makefile drawing/Makefile dynamic/Makefile + erase/Makefile event/Makefile exec/Makefile font/Makefile @@ -808,6 +809,7 @@ CONFIG_FILES=\${CONFIG_FILES-"Makefile dragimag/Makefile drawing/Makefile dynamic/Makefile + erase/Makefile event/Makefile exec/Makefile font/Makefile diff --git a/samples/configure.in b/samples/configure.in index 191f945f1e..5d888d3a3d 100644 --- a/samples/configure.in +++ b/samples/configure.in @@ -31,6 +31,7 @@ AC_OUTPUT([ dragimag/Makefile drawing/Makefile dynamic/Makefile + erase/Makefile event/Makefile exec/Makefile font/Makefile diff --git a/samples/erase/Erase.icc b/samples/erase/Erase.icc new file mode 100644 index 0000000000..8d2e7c0500 --- /dev/null +++ b/samples/erase/Erase.icc @@ -0,0 +1,17 @@ +option ProjectOptions = gen(arch, "pentium2"), gen(manglelinkagekeywordonlyfuncs, "no"), lang(longlong, "yes"), lang(allowtypedefasclassname, "yes"), + lang(compatmath, "yes"), lang(nokeyword, "const_cast"), lang(nokeyword, "explicit"), lang(nokeyword, "export"), lang(nokeyword, "false"), + lang(nokeyword, "mutable"), lang(nokeyword, "true"), lang(nokeyword, "typename"), lang(templatedefimpls, "dontparse"), + lang(trailingenumcommas, "no"), lang(universalcharacternames, "no"), link(debug, "yes"), link(linkwithmultithreadlib, "yes"), + link(linkwithsharedlib, "yes"), link(defaultlibs, "yes"), link(defaultlibsname, "..\\..\\LIB\\wx40.lib"), + link(defaultlibsname, "..\\..\\LIB\\os2png.lib"), link(defaultlibsname, "..\\..\\LIB\\os2zlib.lib"), + link(defaultlibsname, "NETAPI32.LIB"), link(defaultlibsname, "UPM32.LIB"), link(defaultlibsname, "..\\..\\LIB\\dummy.obj"), + link(extdictionary, "no"), opt(inline, "yes"), opt(tune, "pentium2"), define("__WXPM__", ), define("__VISAGECPP__", ), + incl(searchpath, "..\\..\\src\\png"), incl(searchpath, "..\\..\\src\\jpeg"), incl(searchpath, "..\\..\\src\\xpm"), + incl(searchpath, "..\\..\\src\\zlib"), incl(searchpath, "..\\..\\Include"), macros(redefine, "yes") +{ + target "Erase.exe" + { + source type(cpp) "ERASE.CPP" + source type(rc) "ERASE.RCO" + } +} diff --git a/samples/erase/EraseVC.dsp b/samples/erase/EraseVC.dsp new file mode 100644 index 0000000000..9a438f061b --- /dev/null +++ b/samples/erase/EraseVC.dsp @@ -0,0 +1,175 @@ +# Microsoft Developer Studio Project File - Name="EraseVC" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=EraseVC - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "EraseVC.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "EraseVC.mak" CFG="EraseVC - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "EraseVC - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "EraseVC - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE "EraseVC - Win32 Debug DLL" (based on "Win32 (x86) Application") +!MESSAGE "EraseVC - Win32 Release DLL" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "EraseVC - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../include" /I "../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"Release/erase.exe" /libpath:"../../lib" /libpath:"../../contrib/lib" + +!ELSEIF "$(CFG)" == "EraseVC - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"Debug/erase.exe" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib" + +!ELSEIF "$(CFG)" == "EraseVC - Win32 Debug DLL" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "DebugDLL" +# PROP BASE Intermediate_Dir "DebugDLL" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "DebugDLL" +# PROP Intermediate_Dir "DebugDLL" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D WXUSINGDLL=1 /Yu"wx/wxprec.h" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx23_1d.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /out:"DebugDLL/erase.exe" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib" + +!ELSEIF "$(CFG)" == "EraseVC - Win32 Release DLL" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ReleaseDLL" +# PROP BASE Intermediate_Dir "ReleaseDLL" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ReleaseDLL" +# PROP Intermediate_Dir "ReleaseDLL" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../include" /I "../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D WXUSINGDLL=1 /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx23_1.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /out:"ReleaseDLL/erase.exe" /libpath:"../../lib" /libpath:"../../contrib/lib" + +!ENDIF + +# Begin Target + +# Name "EraseVC - Win32 Release" +# Name "EraseVC - Win32 Debug" +# Name "EraseVC - Win32 Debug DLL" +# Name "EraseVC - Win32 Release DLL" +# Begin Source File + +SOURCE=.\minimal.cpp + +!IF "$(CFG)" == "EraseVC - Win32 Release" + +!ELSEIF "$(CFG)" == "EraseVC - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "EraseVC - Win32 Debug DLL" + +# SUBTRACT BASE CPP /YX /Yc /Yu +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "EraseVC - Win32 Release DLL" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\erase.rc +# ADD BASE RSC /l 0x809 +# ADD RSC /l 0x809 /i "../../include" /i "../../contrib/include" +# End Source File +# End Target +# End Project diff --git a/samples/erase/EraseVC.dsw b/samples/erase/EraseVC.dsw new file mode 100644 index 0000000000..2c6467806e --- /dev/null +++ b/samples/erase/EraseVC.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "EraseVC"=.\EraseVC.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/samples/erase/Makefile.in b/samples/erase/Makefile.in new file mode 100644 index 0000000000..0d9ee554b0 --- /dev/null +++ b/samples/erase/Makefile.in @@ -0,0 +1,21 @@ +# +# File: makefile.unx +# Author: Julian Smart +# Created: 1998 +# Updated: +# Copyright: (c) 1998 Julian Smart +# +# "%W% %G%" +# +# Makefile for minimal example (UNIX). + +top_srcdir = @top_srcdir@/.. +top_builddir = ../.. +program_dir = samples/erase + +PROGRAM=erase + +OBJECTS=$(PROGRAM).o + +include ../../src/makeprog.env + diff --git a/samples/erase/descrip.mms b/samples/erase/descrip.mms new file mode 100644 index 0000000000..5175f4952c --- /dev/null +++ b/samples/erase/descrip.mms @@ -0,0 +1,47 @@ +#***************************************************************************** +# * +# Make file for VMS * +# Author : J.Jansen (joukj@hrem.stm.tudelft.nl) * +# Date : 10 November 1999 * +# * +#***************************************************************************** +.first + define wx [--.include.wx] + +.ifdef __WXMOTIF__ +CXX_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short)\ + /assume=(nostdnew,noglobal_array_new) +.else +.ifdef __WXGTK__ +CXX_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm\ + /assume=(nostdnew,noglobal_array_new) +.else +CXX_DEFINE = +.endif +.endif + +.suffixes : .cpp + +.cpp.obj : + cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp + +all : +.ifdef __WXMOTIF__ + $(MMS)$(MMSQUALIFIERS) minimal.exe +.else +.ifdef __WXGTK__ + $(MMS)$(MMSQUALIFIERS) minimal_gtk.exe +.endif +.endif + +.ifdef __WXMOTIF__ +minimal.exe : minimal.obj + cxxlink minimal,[--.lib]vms/opt +.else +.ifdef __WXGTK__ +minimal_gtk.exe : minimal.obj + cxxlink/exec=minimal_gtk.exe minimal,[--.lib]vms_gtk/opt +.endif +.endif + +minimal.obj : minimal.cpp diff --git a/samples/erase/erase.cpp b/samples/erase/erase.cpp new file mode 100644 index 0000000000..8162f96f6f --- /dev/null +++ b/samples/erase/erase.cpp @@ -0,0 +1,192 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: erase.cpp +// Purpose: Erase wxWindows sample +// Author: Robert Roebling +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Robert Roebling +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#ifdef __GNUG__ + #pragma implementation "minimal.cpp" + #pragma interface "minimal.cpp" +#endif + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +// for all others, include the necessary headers (this file is usually all you +// need because it includes almost all "standard" wxWindows headers) +#ifndef WX_PRECOMP + #include "wx/wx.h" +#endif + +// ---------------------------------------------------------------------------- +// resources +// ---------------------------------------------------------------------------- +// the application icon +#if defined(__WXGTK__) || defined(__WXMOTIF__) + #include "mondrian.xpm" +#endif + +// ---------------------------------------------------------------------------- +// private classes +// ---------------------------------------------------------------------------- + +class MyApp : public wxApp +{ +public: + virtual bool OnInit(); +}; + + +class MyFrame : public wxFrame +{ +public: + MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); + + void OnQuit(wxCommandEvent& event); + void OnAbout(wxCommandEvent& event); + +private: + DECLARE_EVENT_TABLE() +}; + + +class MyCanvas : public wxScrolledWindow +{ +public: + MyCanvas( MyFrame *parent ); + + void OnPaint( wxPaintEvent &event ); + void OnEraseBackground( wxEraseEvent &event ); + +private: + DECLARE_EVENT_TABLE() +}; + +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + +enum +{ + // menu items + Minimal_Quit = 1, + Minimal_About +}; + + +// ---------------------------------------------------------------------------- +// the application class +// ---------------------------------------------------------------------------- + +IMPLEMENT_APP(MyApp) + +bool MyApp::OnInit() +{ + MyFrame *frame = new MyFrame("Minimal wxWindows App", + wxPoint(50, 50), wxSize(450, 340)); + + frame->Show(TRUE); + + return TRUE; +} + +// ---------------------------------------------------------------------------- +// main frame +// ---------------------------------------------------------------------------- + +BEGIN_EVENT_TABLE(MyFrame, wxFrame) + EVT_MENU(Minimal_Quit, MyFrame::OnQuit) + EVT_MENU(Minimal_About, MyFrame::OnAbout) +END_EVENT_TABLE() + +// frame constructor +MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) + : wxFrame((wxFrame *)NULL, -1, title, pos, size) +{ +#ifdef __WXMAC__ + wxApp::s_macAboutMenuItemId = Minimal_About; +#endif + + SetIcon(wxICON(mondrian)); + + wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF); + + wxMenu *helpMenu = new wxMenu; + helpMenu->Append(Minimal_About, "&About...\tCtrl-A", "Show about dialog"); + + menuFile->Append(Minimal_Quit, "E&xit\tAlt-X", "Quit this program"); + + wxMenuBar *menuBar = new wxMenuBar(); + menuBar->Append(menuFile, "&File"); + menuBar->Append(helpMenu, "&Help"); + + SetMenuBar(menuBar); + +#if wxUSE_STATUSBAR + // create a status bar just for fun (by default with 1 pane only) + CreateStatusBar(2); + SetStatusText("Welcome to wxWindows!"); +#endif // wxUSE_STATUSBAR + + (void)new MyCanvas( this ); +} + + +void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) +{ + Close(TRUE); +} + +void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) +{ + wxString msg; + msg.Printf( _T("This is the about dialog of minimal sample.\n") + _T("Welcome to %s"), wxVERSION_STRING); + + wxMessageBox(msg, "About Minimal", wxOK | wxICON_INFORMATION, this); +} + + +BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow) + EVT_PAINT( MyCanvas::OnPaint) + EVT_ERASE_BACKGROUND( MyCanvas::OnEraseBackground) +END_EVENT_TABLE() + +MyCanvas::MyCanvas( MyFrame *parent ) + : wxScrolledWindow( parent, -1, wxDefaultPosition, wxDefaultSize, + wxScrolledWindowStyle|wxNO_FULL_REPAINT_ON_RESIZE ) +{ + SetScrollbars( 10, 10, 40, 100, 0, 0 ); +} + +void MyCanvas::OnPaint( wxPaintEvent &event ) +{ + wxPaintDC dc(this); + PrepareDC( dc ); + + dc.SetBrush( *wxRED_BRUSH ); + dc.DrawRectangle( 100, 100, 300, 500 ); +} + +void MyCanvas::OnEraseBackground( wxEraseEvent &event ) +{ + event.Skip( TRUE ); +} + diff --git a/samples/erase/erase.rc b/samples/erase/erase.rc new file mode 100644 index 0000000000..3bf71d6da0 --- /dev/null +++ b/samples/erase/erase.rc @@ -0,0 +1,6 @@ +mondrian ICON "mondrian.ico" +#include "wx/msw/wx.rc" + +#define MINIMAL_QUIT 1 +#define MINIMAL_ABOUT 102 + diff --git a/samples/erase/erase.rc0 b/samples/erase/erase.rc0 new file mode 100644 index 0000000000..42078bed50 --- /dev/null +++ b/samples/erase/erase.rc0 @@ -0,0 +1,6 @@ +ICON 1 PRELOAD "mondros2.ico" +#include "..\\..\\include\wx\os2\wx.rc" + +#define MINIMAL_QUIT 1 +#define MINIMAL_ABOUT 102 + diff --git a/samples/erase/erase.rc4 b/samples/erase/erase.rc4 new file mode 100644 index 0000000000..695f7b0f76 --- /dev/null +++ b/samples/erase/erase.rc4 @@ -0,0 +1,6 @@ +ICON 1 PRELOAD "..\\samples\\erase\\mondros2.ico" +#include "H:\DEV\WX22\WXWINDOWS\include\wx\os2\wx.rc" + +#define MINIMAL_QUIT 1 +#define MINIMAL_ABOUT 102 + diff --git a/samples/erase/make_cw.mcp b/samples/erase/make_cw.mcp new file mode 100644 index 0000000000..9d75e55c23 Binary files /dev/null and b/samples/erase/make_cw.mcp differ diff --git a/samples/erase/makefile.b32 b/samples/erase/makefile.b32 new file mode 100644 index 0000000000..54575af255 --- /dev/null +++ b/samples/erase/makefile.b32 @@ -0,0 +1,16 @@ +# +# File: makefile.b32 +# Author: Julian Smart +# Created: 1999 +# Updated: +# Copyright: +# +# Makefile : Builds sample for 32-bit BC++ + +WXDIR = $(WXWIN) + +TARGET=erase +OBJECTS = $(TARGET).obj + +!include $(WXDIR)\src\makeprog.b32 + diff --git a/samples/erase/makefile.bcc b/samples/erase/makefile.bcc new file mode 100644 index 0000000000..bf0a3bb171 --- /dev/null +++ b/samples/erase/makefile.bcc @@ -0,0 +1,19 @@ +# +# File: makefile.bcc +# Author: Julian Smart +# Created: 1998 +# Updated: +# +# Builds a BC++ 16-bit sample + +!if "$(WXWIN)" == "" +!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx +!endif + +WXDIR = $(WXWIN) + +TARGET=erase +OBJECTS=$(TARGET).obj + +!include $(WXDIR)\src\makeprog.bcc + diff --git a/samples/erase/makefile.dos b/samples/erase/makefile.dos new file mode 100644 index 0000000000..795741a98e --- /dev/null +++ b/samples/erase/makefile.dos @@ -0,0 +1,17 @@ +# +# File: makefile.dos +# Author: Julian Smart +# Created: 1998 +# Updated: +# +# Makefile : Builds 16-bit sample, VC++ 1.5 +# Use FINAL=1 argument to nmake to build final version with no debugging +# info + +WXDIR = $(WXWIN) + +TARGET=erase +OBJECTS=$(TARGET).obj + +!include $(WXDIR)\src\makeprog.msc + diff --git a/samples/erase/makefile.g95 b/samples/erase/makefile.g95 new file mode 100644 index 0000000000..e2857f2d4d --- /dev/null +++ b/samples/erase/makefile.g95 @@ -0,0 +1,16 @@ +# +# File: makefile.g95 +# Author: Julian Smart +# Created: 1999 +# Updated: +# Copyright: (c) Julian Smart, 1999 +# +# Makefile for wxWindows sample (Cygwin/Mingw32). + +WXDIR = ../.. + +TARGET=erase +OBJECTS = $(TARGET).o + +include $(WXDIR)/src/makeprog.g95 + diff --git a/samples/erase/makefile.sc b/samples/erase/makefile.sc new file mode 100644 index 0000000000..031c3eeac6 --- /dev/null +++ b/samples/erase/makefile.sc @@ -0,0 +1,36 @@ +# Symantec C++ makefile + +WXDIR = $(WXWIN) +WXLIB = $(WXDIR)\lib\wx.lib +INCDIR = $(WXDIR)\include +INCLUDE=$(INCDIR) +TARGET=erase + +include $(WXDIR)\src\makesc.env + +minimal.exe: minimal.obj $(DEFFILE) minimal.res + *$(CC) $(LDFLAGS) -o$@ $** $(LIBS) + *$(RC) -k minimal.res + +sc32.def: + echo EXETYPE NT > sc32.def + echo SUBSYSTEM WINDOWS >> sc32.def + +sc16.def: + echo NAME $(TARGET) > sc16.def + echo EXETYPE WINDOWS >> sc16.def + echo STUB 'WINSTUB.EXE' >> sc16.def + echo CODE PRELOAD MOVEABLE DISCARDABLE >> sc16.def + echo DATA PRELOAD MOVEABLE MULTIPLE >> sc16.def + echo HEAPSIZE 1024 >> sc16.def + echo STACKSIZE 8192 >> sc16.def + +clean: + -del *.obj + -del *.exe + -del *.res + -del *.map + -del *.rws + -del sc32.def + -del sc16.def + diff --git a/samples/erase/makefile.sl b/samples/erase/makefile.sl new file mode 100644 index 0000000000..207941a5aa --- /dev/null +++ b/samples/erase/makefile.sl @@ -0,0 +1,18 @@ +# +# File: makefile.sl +# Author: Julian Smart +# Created: 1998 +# +# Makefile : Builds a wxWindows sample for Salford C++, WIN32 + +PROGRAM = erase +OBJECTS = $(PROGRAM).obj + +include ..\..\src\makeprog.sl + +all: wx $(TARGET) + +wx: + cd $(WXDIR)\src\msw ^ mk32 -f makefile.sl all + cd $(WXDIR)\samples\minimal + diff --git a/samples/erase/makefile.twn b/samples/erase/makefile.twn new file mode 100644 index 0000000000..70cf377fe5 --- /dev/null +++ b/samples/erase/makefile.twn @@ -0,0 +1,43 @@ +# +# File: makefile.unx +# Author: Julian Smart +# Created: 1993 +# Updated: +# Copyright: (c) 1993, AIAI, University of Edinburgh +# +# "%W% %G%" +# +# Makefile for minimal example (UNIX). + +WXDIR = ../.. + +# All common UNIX compiler flags and options are now in +# this central makefile. +include $(WXDIR)/src/maketwin.env + +OBJECTS = $(OBJDIR)/minimal.$(OBJSUFF) $(OBJDIR)/minimal_resources.$(OBJSUFF) + +all: $(OBJDIR) minimal$(GUISUFFIX)$(EXESUFF) + +wx: + +$(OBJDIR): + mkdir $(OBJDIR) + +minimal$(GUISUFFIX)$(EXESUFF): $(OBJECTS) $(WXLIB) + $(CC) $(LDFLAGS) -o minimal$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS) + +$(OBJDIR)/minimal.$(OBJSUFF): minimal.$(SRCSUFF) + $(CC) -c $(CPPFLAGS) -o $@ minimal.$(SRCSUFF) + +minimal_resources.c: minimal.rc + $(RESCOMP) $(RCINPUTSWITCH) minimal.rc $(RCOUTPUTSWITCH) minimal_resources.c $(RESFLAGS) + +$(OBJDIR)/minimal_resources.$(OBJSUFF): minimal_resources.c + $(CC) -c $(CPPFLAGS) -o $@ minimal_resources.c + +#$(OBJDIR)/minimal_resources.o: minimal.rc +# $(RESCOMP) $(RCINPUTSWITCH) minimal.rc $(RCOUTPUTSWITCH) $(OBJDIR)/minimal_resources.o $(RESFLAGS) + +clean: + rm -f $(OBJECTS) minimal$(GUISUFFIX).exe core *.rsc *.res diff --git a/samples/erase/makefile.unx b/samples/erase/makefile.unx new file mode 100644 index 0000000000..1e82bd01d4 --- /dev/null +++ b/samples/erase/makefile.unx @@ -0,0 +1,35 @@ +# +# File: Makefile for samples +# Author: Robert Roebling +# Created: 1999 +# Updated: +# Copyright: (c) 1998 Robert Roebling +# +# This makefile requires a Unix version of wxWindows +# to be installed on your system. This is most often +# done typing "make install" when using the complete +# sources of wxWindows or by installing the two +# RPM packages wxGTK.XXX.rpm and wxGTK-devel.XXX.rpm +# under Linux. +# + +CC = gcc + +PROGRAM = erase + +OBJECTS = $(PROGRAM).o + +# implementation + +.SUFFIXES: .o .cpp + +.cpp.o : + $(CC) -c `wx-config --cflags` -o $@ $< + +all: $(PROGRAM) + +$(PROGRAM): $(OBJECTS) + $(CC) -o $(PROGRAM) $(OBJECTS) `wx-config --libs` + +clean: + rm -f *.o $(PROGRAM) diff --git a/samples/erase/makefile.va b/samples/erase/makefile.va new file mode 100644 index 0000000000..dd88cb018d --- /dev/null +++ b/samples/erase/makefile.va @@ -0,0 +1,44 @@ +# +# File: makefile.va +# Author: David Webster +# Created: 1999 +# Updated: +# Copyright: (c) David Webster +# +# Makefile : Builds sample (VisualAgeC++ V3.0, OS/2 PM) +# Use FINAL=1 argument to nmake to build final version with no debug info. + +# Set WXDIR for your system +WXDIR=$(WXWIN) + +!include $(WXDIR)\src\makeva.env + +# +# Define which program this is and what it's path is and where to output to +# +PROGRAM=erase +THISDIR=$(WXWIN)\samples\$(PROGRAM) +OPATH=$(THISDIR)\$D + +# +# Make sure output directory is available +# +!if [md $(OPATH)] +!endif + +# +# Standard definitions +# +PROGRC=$(THISDIR)\$(PROGRAM).rcO +OBJECTS=$(OPATH)\$(PROGRAM).obj +PROGRES=$(OPATH)\$(PROGRAM).res +PROGTARGET=$(OPATH)\$(PROGRAM).exe + +.cpp{$OPATH}.obj: + @echo $< + icc @<< +$(CPPFLAGS) /Fo$@ /Tp $< +<< + +!include $(WXDIR)\src\makeprog.va + diff --git a/samples/erase/makefile.vc b/samples/erase/makefile.vc new file mode 100644 index 0000000000..d1a994d9db --- /dev/null +++ b/samples/erase/makefile.vc @@ -0,0 +1,24 @@ +# +# File: makefile.vc +# Author: Julian Smart +# Created: 1999 +# Updated: +# Copyright: (c) Julian Smart +# +# Makefile : Builds sample (VC++, WIN32) +# Use FINAL=1 argument to nmake to build final version with no debug info. + +# Set WXDIR for your system +WXDIR = $(WXWIN) + +PROGRAM=erase +OBJECTS = $(PROGRAM).obj + +!include $(WXDIR)\src\makeprog.vc + +# For broken VC++ 4 +noopt: + cl @<< +$(CPPFLAGS2) /Od /c /Tp $(PROGRAM).cpp +<< + diff --git a/samples/erase/makefile.wat b/samples/erase/makefile.wat new file mode 100644 index 0000000000..4a36a715be --- /dev/null +++ b/samples/erase/makefile.wat @@ -0,0 +1,15 @@ +# +# Makefile for WATCOM +# +# Created by Julian Smart, January 1999 +# +# + +WXDIR = $(%WXWIN) + +PROGRAM = erase +OBJECTS = $(PROGRAM).obj + +!include $(WXDIR)\src\makeprog.wat + + diff --git a/samples/erase/makemac.mcp b/samples/erase/makemac.mcp new file mode 100644 index 0000000000..8e171fb099 Binary files /dev/null and b/samples/erase/makemac.mcp differ diff --git a/samples/erase/makemac6.mcp b/samples/erase/makemac6.mcp new file mode 100644 index 0000000000..c4469090af Binary files /dev/null and b/samples/erase/makemac6.mcp differ diff --git a/samples/erase/minimal.def b/samples/erase/minimal.def new file mode 100644 index 0000000000..df6a795efc --- /dev/null +++ b/samples/erase/minimal.def @@ -0,0 +1,7 @@ +NAME Erase +DESCRIPTION 'Erase wxWindows application' +EXETYPE WINDOWS +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE +HEAPSIZE 4048 +STACKSIZE 16000 diff --git a/samples/erase/mondrian.ico b/samples/erase/mondrian.ico new file mode 100644 index 0000000000..2310c5d275 Binary files /dev/null and b/samples/erase/mondrian.ico differ diff --git a/samples/erase/mondrian.xpm b/samples/erase/mondrian.xpm new file mode 100644 index 0000000000..409f27a843 --- /dev/null +++ b/samples/erase/mondrian.xpm @@ -0,0 +1,44 @@ +/* XPM */ +static char *mondrian_xpm[] = { +/* columns rows colors chars-per-pixel */ +"32 32 6 1", +" c Black", +". c Blue", +"X c #00bf00", +"o c Red", +"O c Yellow", +"+ c Gray100", +/* pixels */ +" ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" ", +" ++++++ ++++++++++++++++++ .... ", +" ++++++ ++++++++++++++++++ .... ", +" ++++++ ++++++++++++++++++ .... ", +" ++++++ ++++++++++++++++++ .... ", +" ++++++ ++++++++++++++++++ .... ", +" ++++++ ++++++++++++++++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" " +}; diff --git a/samples/erase/mondros2.ico b/samples/erase/mondros2.ico new file mode 100644 index 0000000000..8b0e58c0d7 Binary files /dev/null and b/samples/erase/mondros2.ico differ diff --git a/samples/splitter/splitter.cpp b/samples/splitter/splitter.cpp index c28422a5a8..a4f8497aad 100644 --- a/samples/splitter/splitter.cpp +++ b/samples/splitter/splitter.cpp @@ -90,8 +90,8 @@ DECLARE_EVENT_TABLE() class MyCanvas: public wxScrolledWindow { public: - MyCanvas(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& name = ""); - virtual ~MyCanvas(); + MyCanvas(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& name = ""); + virtual ~MyCanvas(); virtual void OnDraw(wxDC& dc); @@ -146,7 +146,7 @@ END_EVENT_TABLE() // My frame constructor MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, const wxSize& size): - wxFrame(frame, SPLITTER_FRAME, title, pos, size) + wxFrame(frame, SPLITTER_FRAME, title, pos, size) { CreateStatusBar(2); @@ -168,7 +168,7 @@ MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, cons m_splitter = new MySplitterWindow(this, SPLITTER_WINDOW); wxSize sz( m_splitter->GetSize() ); - wxLogMessage( "Initial splitter size: %d %d\n", (int)sz.x, (int)sz.y ); +// wxLogMessage( "Initial splitter size: %d %d\n", (int)sz.x, (int)sz.y ); m_leftCanvas = new MyCanvas(m_splitter, CANVAS1, wxPoint(0, 0), wxSize(400, 400), "Test1" ); m_leftCanvas->SetBackgroundColour(*wxRED); @@ -178,9 +178,10 @@ MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, cons m_rightCanvas = new MyCanvas(m_splitter, CANVAS2, wxPoint(0, 0), wxSize(400, 400), "Test2" ); m_rightCanvas->SetBackgroundColour(*wxCYAN); m_rightCanvas->SetScrollbars(20, 20, 50, 50); - m_rightCanvas->Show(FALSE); +// m_rightCanvas->Show(FALSE); - m_splitter->Initialize(m_leftCanvas); + m_splitter->SplitVertically(m_leftCanvas,m_rightCanvas, 40 ); +// m_splitter->Initialize(m_leftCanvas); SetStatusText("Min pane size = 0", 1); } @@ -257,7 +258,7 @@ void MyFrame::UpdatePosition() } MyCanvas::MyCanvas(wxWindow* parent, wxWindowID id, const wxPoint& point, const wxSize& size, const wxString &name ) : - wxScrolledWindow(parent, id, point, size, 0, name ) + wxScrolledWindow(parent, id, point, size, 0, name ) { } diff --git a/src/common/image.cpp b/src/common/image.cpp index fbf84266bb..d1767d1d04 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -229,12 +229,12 @@ wxImage wxImage::Scale( int width, int height ) const for (long j = 0; j < height; j++) { - long y_offset = (j * old_height / height) * old_width; + long y_offset = (j * (old_height-1) / (height-1)) * old_width; for (long i = 0; i < width; i++) { memcpy( target_data, - source_data + 3*(y_offset + ((i * old_width )/ width)), + source_data + 3*(y_offset + ((i * (old_width-1) )/ (width-1))), 3 ); target_data += 3; } @@ -1144,7 +1144,7 @@ unsigned long wxImage::CountColours( unsigned long stopafter ) wxHashTable h; wxObject dummy; unsigned char r, g, b; - unsigned char *p; + unsigned char *p; unsigned long size, nentries, key; p = GetData(); @@ -1179,7 +1179,7 @@ unsigned long wxImage::CountColours( unsigned long stopafter ) unsigned long wxImage::ComputeHistogram( wxHashTable &h ) { unsigned char r, g, b; - unsigned char *p; + unsigned char *p; unsigned long size, nentries, key; wxHNode *hnode; diff --git a/src/gtk/win_gtk.c b/src/gtk/win_gtk.c index 2e69c20eef..96358744c4 100644 --- a/src/gtk/win_gtk.c +++ b/src/gtk/win_gtk.c @@ -582,6 +582,11 @@ gtk_pizza_realize (GtkWidget *widget) widget->style = gtk_style_attach (widget->style, widget->window); gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); gtk_style_set_background (widget->style, pizza->bin_window, GTK_STATE_NORMAL ); + +/* + gdk_window_set_back_pixmap( widget->window, NULL, FALSE ); + gdk_window_set_back_pixmap( pizza->bin_window, NULL, FALSE ); +*/ /* add filters for intercepting visibility and expose events */ gdk_window_add_filter (widget->window, gtk_pizza_main_filter, pizza); diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 0e2f089cf7..1e58a816c7 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -19,6 +19,7 @@ #include "wx/defs.h" #include "wx/window.h" #include "wx/dc.h" +#include "wx/dcclient.h" #include "wx/frame.h" #include "wx/app.h" #include "wx/layout.h" @@ -550,11 +551,11 @@ static long map_to_unmodified_wx_keysym( GdkEventKey *event ) case GDK_F12: key_code = WXK_F12; break; default: { - if (event->length == 1) - { - key_code = toupper( (unsigned char)*event->string ); - } - else if ((keysym & 0xFF) == keysym) + if (event->length == 1) + { + key_code = toupper( (unsigned char)*event->string ); + } + else if ((keysym & 0xFF) == keysym) { guint upper = gdk_keyval_to_upper( (guint)keysym ); keysym = (upper != 0 ? upper : keysym ); /* to be MSW compatible */ @@ -654,11 +655,11 @@ static long map_to_wx_keysym( GdkEventKey *event ) case GDK_F12: key_code = WXK_F12; break; default: { - if (event->length == 1) - { - key_code = (unsigned char)*event->string; - } - else if ((keysym & 0xFF) == keysym) + if (event->length == 1) + { + key_code = (unsigned char)*event->string; + } + else if ((keysym & 0xFF) == keysym) { key_code = (guint)keysym; } @@ -732,7 +733,23 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev wxEraseEvent eevent( win->GetId() ); eevent.SetEventObject( win ); +#if 1 win->GetEventHandler()->ProcessEvent(eevent); +#else + if (!win->GetEventHandler()->ProcessEvent(eevent)) + { + wxClientDC dc( win ); + dc.SetBrush( wxBrush( win->GetBackgroundColour(), wxSOLID ) ); + dc.SetPen( *wxTRANSPARENT_PEN ); + + wxRegionIterator upd( win->GetUpdateRegion() ); + while (upd) + { + dc.DrawRectangle( upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() ); + upd ++; + } + } +#endif wxPaintEvent event( win->GetId() ); event.SetEventObject( win ); @@ -853,7 +870,27 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW wxEraseEvent eevent( win->GetId() ); eevent.SetEventObject( win ); + +#if 1 win->GetEventHandler()->ProcessEvent(eevent); +#else + if (!win->GetEventHandler()->ProcessEvent(eevent)) + { + if (!win->GetEventHandler()->ProcessEvent(eevent)) + { + wxClientDC dc( win ); + dc.SetBrush( wxBrush( win->GetBackgroundColour(), wxSOLID ) ); + dc.SetPen( *wxTRANSPARENT_PEN ); + + wxRegionIterator upd( win->GetUpdateRegion() ); + while (upd) + { + dc.DrawRectangle( upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() ); + upd ++; + } + } + } +#endif wxPaintEvent event( win->GetId() ); event.SetEventObject( win ); @@ -2578,6 +2615,10 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") ); wxASSERT_MSG( (m_parent != NULL), wxT("wxWindow::SetSize requires parent.\n") ); +/* + printf( "name %s, x,y,w,h: %d,%d,%d,%d \n", GetName().c_str(), x,y,width,height ); +*/ + if (m_resizing) return; /* I don't like recursions */ m_resizing = TRUE; diff --git a/src/gtk1/win_gtk.c b/src/gtk1/win_gtk.c index 2e69c20eef..96358744c4 100644 --- a/src/gtk1/win_gtk.c +++ b/src/gtk1/win_gtk.c @@ -582,6 +582,11 @@ gtk_pizza_realize (GtkWidget *widget) widget->style = gtk_style_attach (widget->style, widget->window); gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); gtk_style_set_background (widget->style, pizza->bin_window, GTK_STATE_NORMAL ); + +/* + gdk_window_set_back_pixmap( widget->window, NULL, FALSE ); + gdk_window_set_back_pixmap( pizza->bin_window, NULL, FALSE ); +*/ /* add filters for intercepting visibility and expose events */ gdk_window_add_filter (widget->window, gtk_pizza_main_filter, pizza); diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 0e2f089cf7..1e58a816c7 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -19,6 +19,7 @@ #include "wx/defs.h" #include "wx/window.h" #include "wx/dc.h" +#include "wx/dcclient.h" #include "wx/frame.h" #include "wx/app.h" #include "wx/layout.h" @@ -550,11 +551,11 @@ static long map_to_unmodified_wx_keysym( GdkEventKey *event ) case GDK_F12: key_code = WXK_F12; break; default: { - if (event->length == 1) - { - key_code = toupper( (unsigned char)*event->string ); - } - else if ((keysym & 0xFF) == keysym) + if (event->length == 1) + { + key_code = toupper( (unsigned char)*event->string ); + } + else if ((keysym & 0xFF) == keysym) { guint upper = gdk_keyval_to_upper( (guint)keysym ); keysym = (upper != 0 ? upper : keysym ); /* to be MSW compatible */ @@ -654,11 +655,11 @@ static long map_to_wx_keysym( GdkEventKey *event ) case GDK_F12: key_code = WXK_F12; break; default: { - if (event->length == 1) - { - key_code = (unsigned char)*event->string; - } - else if ((keysym & 0xFF) == keysym) + if (event->length == 1) + { + key_code = (unsigned char)*event->string; + } + else if ((keysym & 0xFF) == keysym) { key_code = (guint)keysym; } @@ -732,7 +733,23 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev wxEraseEvent eevent( win->GetId() ); eevent.SetEventObject( win ); +#if 1 win->GetEventHandler()->ProcessEvent(eevent); +#else + if (!win->GetEventHandler()->ProcessEvent(eevent)) + { + wxClientDC dc( win ); + dc.SetBrush( wxBrush( win->GetBackgroundColour(), wxSOLID ) ); + dc.SetPen( *wxTRANSPARENT_PEN ); + + wxRegionIterator upd( win->GetUpdateRegion() ); + while (upd) + { + dc.DrawRectangle( upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() ); + upd ++; + } + } +#endif wxPaintEvent event( win->GetId() ); event.SetEventObject( win ); @@ -853,7 +870,27 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW wxEraseEvent eevent( win->GetId() ); eevent.SetEventObject( win ); + +#if 1 win->GetEventHandler()->ProcessEvent(eevent); +#else + if (!win->GetEventHandler()->ProcessEvent(eevent)) + { + if (!win->GetEventHandler()->ProcessEvent(eevent)) + { + wxClientDC dc( win ); + dc.SetBrush( wxBrush( win->GetBackgroundColour(), wxSOLID ) ); + dc.SetPen( *wxTRANSPARENT_PEN ); + + wxRegionIterator upd( win->GetUpdateRegion() ); + while (upd) + { + dc.DrawRectangle( upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() ); + upd ++; + } + } + } +#endif wxPaintEvent event( win->GetId() ); event.SetEventObject( win ); @@ -2578,6 +2615,10 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") ); wxASSERT_MSG( (m_parent != NULL), wxT("wxWindow::SetSize requires parent.\n") ); +/* + printf( "name %s, x,y,w,h: %d,%d,%d,%d \n", GetName().c_str(), x,y,width,height ); +*/ + if (m_resizing) return; /* I don't like recursions */ m_resizing = TRUE;