fixed animate in Unicode mode and removed use of deprecated methods
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21765 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,24 +1,113 @@
|
||||
#
|
||||
# File: makefile.unx
|
||||
# Author: Julian Smart
|
||||
# Created: 1998
|
||||
# Updated:
|
||||
# Copyright: (c) 1998 Julian Smart
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile for anitest example (UNIX).
|
||||
# =========================================================================
|
||||
# This makefile was generated by
|
||||
# Bakefile 0.1.1 (http://bakefile.sourceforge.net)
|
||||
# Do not modify, all changes will be overwritten!
|
||||
# =========================================================================
|
||||
|
||||
top_srcdir = @top_srcdir@/..
|
||||
top_builddir = ../../..
|
||||
program_dir = contrib/samples/animate
|
||||
|
||||
PROGRAM=anitest
|
||||
@MAKE_SET@
|
||||
|
||||
OBJECTS=$(PROGRAM).o
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
INSTALL = @INSTALL@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXTRALIBS = @EXTRALIBS@
|
||||
EXTRALIBS_GUI = @EXTRALIBS_GUI@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LDFLAGS_GUI = @LDFLAGS_GUI@
|
||||
RESCOMP = @RESCOMP@
|
||||
SAMPLES_RPATH_FLAG = @SAMPLES_RPATH_FLAG@
|
||||
SETFILE = @SETFILE@
|
||||
TOOLKIT = @TOOLKIT@
|
||||
TOOLKIT_LOWERCASE = @TOOLKIT_LOWERCASE@
|
||||
TOOLKIT_VERSION = @TOOLKIT_VERSION@
|
||||
srcdir = @srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
APPEXTRALIBS=$(top_builddir)/lib/lib@WX_LIBRARY_BASENAME@_anim-@WX_RELEASE@.@WX_TARGET_LIBRARY_TYPE@
|
||||
APPEXTRADEFS=-I$(top_srcdir)/contrib/include
|
||||
### Variables: ###
|
||||
|
||||
include $(top_builddir)/src/makeprog.env
|
||||
ANITEST_CXXFLAGS = $(CPPFLAGS) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) -I$(top_srcdir)/include $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) $(__INC_ODBC_p) $(__INC_REGEX_p) -I$(srcdir) $(__DLLFLAG_p) -I$(srcdir)/../../include $(CXXFLAGS)
|
||||
|
||||
### Conditionally set variables: ###
|
||||
|
||||
@COND_DEPS_TRACKING_0@CXXC = $(CXX)
|
||||
@COND_DEPS_TRACKING_1@CXXC = $(top_builddir)./bk-deps $(CXX)
|
||||
@COND_USE_GUI_0@PORTNAME = base
|
||||
@COND_USE_GUI_1@PORTNAME = $(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION)
|
||||
@COND_TOOLKIT_MAC@WXBASEPORT = _carbon
|
||||
@COND_BUILD_DEBUG@WXDEBUGFLAG = d
|
||||
@COND_UNICODE_1@WXUNICODEFLAG = u
|
||||
@COND_WXUNIV_1@WXUNIVNAME = univ
|
||||
@COND_SHARED_1@__DLLFLAG_p = -DWXUSINGDLL
|
||||
@COND_SHARED_1@__DLLFLAG_p_1 = -d WXUSINGDLL
|
||||
@COND_WXUSE_LIBJPEG_BUILTIN@__INC_JPEG_p = -I$(top_srcdir)/src/jpeg
|
||||
@COND_WXUSE_LIBJPEG_BUILTIN@__INC_JPEG_p_1 = -i $(top_srcdir)/src/jpeg
|
||||
@COND_WXUSE_ODBC_BUILTIN@__INC_ODBC_p = -I$(top_srcdir)/src/odbc
|
||||
@COND_WXUSE_ODBC_BUILTIN@__INC_ODBC_p_1 = -i $(top_srcdir)/src/odbc
|
||||
@COND_WXUSE_LIBPNG_BUILTIN@__INC_PNG_p = -I$(top_srcdir)/src/png
|
||||
@COND_WXUSE_LIBPNG_BUILTIN@__INC_PNG_p_1 = -i $(top_srcdir)/src/png
|
||||
@COND_WXUSE_REGEX_BUILTIN@__INC_REGEX_p = -I$(top_srcdir)/src/regex
|
||||
@COND_WXUSE_REGEX_BUILTIN@__INC_REGEX_p_1 = -i $(top_srcdir)/src/regex
|
||||
@COND_WXUSE_LIBTIFF_BUILTIN@__INC_TIFF_p = -I$(top_srcdir)/src/tiff
|
||||
@COND_WXUSE_LIBTIFF_BUILTIN@__INC_TIFF_p_1 = -i $(top_srcdir)/src/tiff
|
||||
@COND_WXUSE_ZLIB_BUILTIN@__INC_ZLIB_p = -I$(top_srcdir)/src/zlib
|
||||
@COND_WXUSE_ZLIB_BUILTIN@__INC_ZLIB_p_1 = -i $(top_srcdir)/src/zlib
|
||||
@COND_WXUSE_LIBJPEG_BUILTIN@__LIB_JPEG_p = -lwxjpeg$(WXDEBUGFLAG)
|
||||
@COND_WXUSE_ODBC_BUILTIN@__LIB_ODBC_p = -lwxodbc$(WXDEBUGFLAG)
|
||||
@COND_WXUSE_LIBPNG_BUILTIN@__LIB_PNG_p = -lwxpng$(WXDEBUGFLAG)
|
||||
@COND_WXUSE_REGEX_BUILTIN@__LIB_REGEX_p = -lwxregex$(WXDEBUGFLAG)
|
||||
@COND_WXUSE_LIBTIFF_BUILTIN@__LIB_TIFF_p = -lwxtiff$(WXDEBUGFLAG)
|
||||
@COND_WXUSE_ZLIB_BUILTIN@__LIB_ZLIB_p = -lwxzlib$(WXDEBUGFLAG)
|
||||
@COND_TOOLKIT_MAC@__MACOSX_RESOURCES_p_1 = $(RESCOMP) -d __DARWIN__ -t APPL -d __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_1) -i $(top_srcdir)/include $(__INC_TIFF_p_1) $(__INC_JPEG_p_1) $(__INC_PNG_p_1) $(__INC_ZLIB_p_1) $(__INC_ODBC_p_1) $(__INC_REGEX_p_1) -i $(srcdir) $(__DLLFLAG_p_1) -i $(srcdir)/../../include -o anitest$(EXEEXT) Carbon.r $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5.0.r
|
||||
@COND_MONOLITHIC_0@__WXLIB_BASE_p = -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5
|
||||
@COND_MONOLITHIC_0@__WXLIB_CORE_p = -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_core-2.5
|
||||
@COND_MONOLITHIC_1@__WXLIB_MONO_p = -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5
|
||||
@COND_WXUNIV_1@__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
|
||||
@COND_WXUNIV_1@__WXUNIV_DEFINE_p_1 = -d __WXUNIVERSAL__
|
||||
@COND_PLATFORM_MAC_1@__anitest___mac_rezcmd = $(__MACOSX_RESOURCES_p_1)
|
||||
@COND_PLATFORM_MAC_1@__anitest___mac_setfilecmd = $(SETFILE) -a C anitest$(EXEEXT)
|
||||
|
||||
### Targets: ###
|
||||
|
||||
all: anitest$(EXEEXT) data
|
||||
|
||||
anitest$(EXEEXT): anitest_anitest.o
|
||||
$(CXX) -o $@ anitest_anitest.o $(LDFLAGS) -L$(top_builddir)lib $(SAMPLES_RPATH_FLAG) $(LDFLAGS_GUI) $(__WXLIB_MONO_p) -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_animate-2.5 $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(EXTRALIBS) $(EXTRALIBS_GUI)
|
||||
$(__anitest___mac_rezcmd)
|
||||
$(__anitest___mac_setfilecmd)
|
||||
|
||||
anitest_anitest.o: $(srcdir)/anitest.cpp
|
||||
$(CXXC) -c -o $@ $(ANITEST_CXXFLAGS) $<
|
||||
|
||||
clean:
|
||||
rm -rf ./.deps
|
||||
rm -f -f ./*.o
|
||||
rm -f anitest$(EXEEXT)
|
||||
|
||||
data:
|
||||
@mkdir -p .
|
||||
@for f in bttrfly.gif hooked.gif tbttrfly.gif mondrian.ico; do \
|
||||
if test \( ! -s ./$$f \) -o \( $(srcdir)/$$f -nt ./$$f \) ; then \
|
||||
cp -pRf $(srcdir)/$$f . ; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
distclean: clean
|
||||
rm -f configure config.cache config.log config.status
|
||||
rm -f bk-deps shared-ld-sh
|
||||
|
||||
install: all
|
||||
|
||||
install-strip: install
|
||||
|
||||
uninstall:
|
||||
|
||||
|
||||
# Include dependency info, if present:
|
||||
@IF_GNU_MAKE@-include .deps/*.d
|
||||
|
||||
.PHONY: all clean distclean install uninstall
|
||||
|
@@ -65,7 +65,7 @@ bool MyApp::OnInit()
|
||||
{
|
||||
// Create the main frame window
|
||||
|
||||
MyFrame* frame = new MyFrame((wxFrame *)NULL, -1, "Animation Demo",
|
||||
MyFrame* frame = new MyFrame((wxFrame *)NULL, -1, _T("Animation Demo"),
|
||||
wxPoint(-1, -1), wxSize(500, 400),
|
||||
wxDEFAULT_FRAME_STYLE);
|
||||
|
||||
@@ -79,16 +79,16 @@ bool MyApp::OnInit()
|
||||
// Make a menubar
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
|
||||
file_menu->Append(ANITEST_OPEN, "&Open Animation...\tCtrl+O", "Open a GIF animation");
|
||||
file_menu->Append(ANITEST_QUIT, "&Exit\tAlt+X", "Quit the program");
|
||||
file_menu->Append(ANITEST_OPEN, _T("&Open Animation...\tCtrl+O"), _T("Open a GIF animation"));
|
||||
file_menu->Append(ANITEST_QUIT, _T("&Exit\tAlt+X"), _T("Quit the program"));
|
||||
|
||||
wxMenu *help_menu = new wxMenu;
|
||||
help_menu->Append(ANITEST_ABOUT, "&About\tF1");
|
||||
help_menu->Append(ANITEST_ABOUT, _T("&About\tF1"));
|
||||
|
||||
wxMenuBar *menu_bar = new wxMenuBar;
|
||||
|
||||
menu_bar->Append(file_menu, "&File");
|
||||
menu_bar->Append(help_menu, "&Help");
|
||||
menu_bar->Append(file_menu, _T("&File"));
|
||||
menu_bar->Append(help_menu, _T("&Help"));
|
||||
|
||||
// Associate the menu bar with the frame
|
||||
frame->SetMenuBar(menu_bar);
|
||||
@@ -139,14 +139,14 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
(void)wxMessageBox("wxWindows 2 Animation Demo\n"
|
||||
"Author: Julian Smart (c) 2001\n",
|
||||
"About Animation Demo");
|
||||
(void)wxMessageBox(_T("wxWindows 2 Animation Demo\n")
|
||||
_T("Author: Julian Smart (c) 2001\n"),
|
||||
_T("About Animation Demo"));
|
||||
}
|
||||
|
||||
void MyFrame::OnOpen(wxCommandEvent& event)
|
||||
{
|
||||
wxFileDialog dialog(this, wxT("Please choose an animated GIF"),
|
||||
wxFileDialog dialog(this, _T("Please choose an animated GIF"),
|
||||
wxEmptyString, wxEmptyString, wxT("*.gif"), wxOPEN);
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
@@ -159,7 +159,7 @@ void MyFrame::OnOpen(wxCommandEvent& event)
|
||||
}
|
||||
else
|
||||
{
|
||||
wxMessageBox("Sorry, this animation was not a valid animated GIF.");
|
||||
wxMessageBox(_T("Sorry, this animation was not a valid animated GIF."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
44
contrib/samples/animate/mondrian.xpm
Normal file
44
contrib/samples/animate/mondrian.xpm
Normal file
@@ -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 ++++ ",
|
||||
" "
|
||||
};
|
Reference in New Issue
Block a user