1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 07:40:23 +02:00

Round 5 of wx3 changes

FileDialog now complete on Linux.  Needs some fine tuning on
Windows and OSX.
Builds with wx3 and gtk2 or gtk3.
Still more effect work to do.
This commit is contained in:
Leland Lucius 2015-07-14 23:33:53 -05:00
parent 2f760c4bac
commit 9b9c8cc073
43 changed files with 3271 additions and 5352 deletions

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -16,7 +16,17 @@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -80,19 +90,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) $(dist_doc_DATA) \
$(dist_pkgdata_DATA) $(nobase_dist_pkgdata_DATA) ABOUT-NLS \
autotools/ar-lib autotools/compile autotools/config.guess \
autotools/config.rpath autotools/config.sub autotools/depcomp \
autotools/install-sh autotools/missing autotools/ltmain.sh \
$(top_srcdir)/autotools/ar-lib $(top_srcdir)/autotools/compile \
$(top_srcdir)/autotools/config.guess \
$(top_srcdir)/autotools/config.rpath \
$(top_srcdir)/autotools/config.sub \
$(top_srcdir)/autotools/install-sh \
$(top_srcdir)/autotools/ltmain.sh \
$(top_srcdir)/autotools/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
@ -133,6 +130,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(dist_doc_DATA) $(dist_pkgdata_DATA) \
$(nobase_dist_pkgdata_DATA) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@ -228,6 +228,17 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/autotools/ar-lib \
$(top_srcdir)/autotools/compile \
$(top_srcdir)/autotools/config.guess \
$(top_srcdir)/autotools/config.rpath \
$(top_srcdir)/autotools/config.sub \
$(top_srcdir)/autotools/install-sh \
$(top_srcdir)/autotools/ltmain.sh \
$(top_srcdir)/autotools/missing ABOUT-NLS autotools/ar-lib \
autotools/compile autotools/config.guess \
autotools/config.rpath autotools/config.sub autotools/depcomp \
autotools/install-sh autotools/ltmain.sh autotools/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@ -576,7 +587,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@ -892,15 +902,15 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@ -936,17 +946,17 @@ distcheck: dist
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@ -1132,6 +1142,8 @@ uninstall-am: uninstall-binSCRIPTS uninstall-dist_docDATA \
uninstall-dist_docDATA uninstall-dist_pkgdataDATA \
uninstall-nobase_dist_pkgdataDATA
.PRECIOUS: Makefile
audacity$(EXEEXT): src/audacity$(EXEEXT)
rm -f audacity$(EXEEXT)

34
configure vendored
View File

@ -1702,7 +1702,7 @@ Optional Packages:
(or the compiler's sysroot if not specified).
--with-lib-preference whether to use local and/or system libraries, in
order of preference (default="system local")
--with-wx-version select wxWidgets version (if both installed) [2.8,]
--with-wx-version select wxWidgets version (if both installed) [3.0,]
--with-expat which expat to use for XML file support:
[system,local]
--with-ffmpeg use ffmpeg for import and export support
@ -2889,7 +2889,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
am__api_version='1.14'
am__api_version='1.15'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@ -3061,8 +3061,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
@ -3081,7 +3081,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@ -3409,8 +3409,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@ -3584,6 +3584,7 @@ END
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
@ -19774,8 +19775,10 @@ _ACEOF
# Extract the first word of "wx-config", so it can be a program name with args.
set dummy wx-config; ac_word=$2
for ac_prog in wx-config wx-config-3.0
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_WX_CONFIG+:} false; then :
@ -19802,7 +19805,6 @@ done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_WX_CONFIG" && ac_cv_path_WX_CONFIG="no"
;;
esac
fi
@ -19816,6 +19818,10 @@ $as_echo "no" >&6; }
fi
test -n "$WX_CONFIG" && break
done
test -n "$WX_CONFIG" || WX_CONFIG="no"
if [ "$WX_CONFIG" = "no" ] ; then
as_fn_error $? "Could not find wx-config: is wxWidgets installed? is wx-config in your path?" "$LINENO" 5
fi
@ -19829,16 +19835,16 @@ fi
wxconfigargs="$static_wx_preference $unicode_preference $wxconfigargs $wx_preference"
wx_version=`${WX_CONFIG} $wxconfigargs --version`
{ $as_echo "$as_me:${as_lineno-$LINENO}: Checking that the chosen version of wxWidgets is 2.8.x" >&5
$as_echo "$as_me: Checking that the chosen version of wxWidgets is 2.8.x" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: Checking that the chosen version of wxWidgets is 3.0.x" >&5
$as_echo "$as_me: Checking that the chosen version of wxWidgets is 3.0.x" >&6;}
case "${wx_version}" in
2.8.* | 3.0.*)
3.0.*)
echo "Great, you're using wxWidgets ${wx_version}!"
;;
*)
wx_list=`${WX_CONFIG} --list`
as_fn_error $? "Unable to locate a suitable configuration of wxWidgets v2.8.x or higher.
as_fn_error $? "Unable to locate a suitable configuration of wxWidgets v3.0.x or higher.
The currently available configurations are listed below. If necessary, either
install the package for your distribution or download the latest version of
wxWidgets

View File

@ -188,11 +188,9 @@ AC_ARG_ENABLE(gtk3, [AS_HELP_STRING([--enable-gtk3],[enable use of GTK+-3.0 (def
AC_ARG_WITH(wx-version,
[AS_HELP_STRING([--with-wx-version],
[select wxWidgets version (if both installed) [2.8,]])],
[select wxWidgets version (if both installed) [3.0,]])],
wx_preference="--version=$withval",
wx_preference="")
dnl At the moment we only support wx2.8. If we start supporting 3.0 when it
dnl comes out, we'll want it back again.
dnl ----------------------------------------------------
dnl If user asked for debug, put debug in compiler flags
@ -274,7 +272,7 @@ dnl there isn't a way to turn them off.
dnl-------------------------------------------------------------
dnl wxWidgets -- we assume that if wx-config is found, wxWidgets is successfully installed.
AC_PATH_PROG(WX_CONFIG, wx-config, no, $PATH:/usr/local/bin )
AC_PATH_PROGS(WX_CONFIG, wx-config wx-config-3.0, no, $PATH:/usr/local/bin )
if [[ "$WX_CONFIG" = "no" ]] ; then
AC_MSG_ERROR([Could not find wx-config: is wxWidgets installed? is wx-config in your path?])
fi
@ -291,15 +289,15 @@ dnl more things we always pass to wx-config
wxconfigargs="$static_wx_preference $unicode_preference $wxconfigargs $wx_preference"
wx_version=`${WX_CONFIG} $wxconfigargs --version`
AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x])
AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 3.0.x])
case "${wx_version}" in
2.8.* | 3.0.*)
3.0.*)
echo "Great, you're using wxWidgets ${wx_version}!"
;;
*)
wx_list=`${WX_CONFIG} --list`
AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x or higher.
AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v3.0.x or higher.
The currently available configurations are listed below. If necessary, either
install the package for your distribution or download the latest version of
wxWidgets

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -15,7 +15,17 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -79,8 +89,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = help
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(dist_man_MANS) $(dist_appdata_DATA)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
@ -121,6 +129,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_appdata_DATA) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/configwin.h \
$(top_builddir)/src/configunix.h
@ -178,6 +188,7 @@ NROFF = nroff
MANS = $(dist_man_MANS)
DATA = $(dist_appdata_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -401,7 +412,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign help/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign help/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@ -647,6 +657,8 @@ uninstall-man: uninstall-man1
tags-am uninstall uninstall-am uninstall-dist_appdataDATA \
uninstall-man uninstall-man1
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -15,7 +15,17 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -79,10 +89,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = images
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(dist_icons16_DATA) $(dist_icons22_DATA) $(dist_icons24_DATA) \
$(dist_icons32_DATA) $(dist_icons48_DATA) \
$(dist_iconsscalable_DATA) $(dist_pixmap_DATA)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
@ -123,6 +129,10 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_icons16_DATA) \
$(dist_icons22_DATA) $(dist_icons24_DATA) $(dist_icons32_DATA) \
$(dist_icons48_DATA) $(dist_iconsscalable_DATA) \
$(dist_pixmap_DATA) $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/configwin.h \
$(top_builddir)/src/configunix.h
@ -182,6 +192,7 @@ DATA = $(dist_icons16_DATA) $(dist_icons22_DATA) $(dist_icons24_DATA) \
$(dist_icons32_DATA) $(dist_icons48_DATA) \
$(dist_iconsscalable_DATA) $(dist_pixmap_DATA) $(pixmap_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -483,7 +494,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign images/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign images/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@ -843,6 +853,8 @@ uninstall-am: uninstall-dist_icons16DATA uninstall-dist_icons22DATA \
uninstall-dist_iconsscalableDATA uninstall-dist_pixmapDATA \
uninstall-pixmapDATA
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -16,28 +16,10 @@ custom controls.
#include "FileDialog.h"
/////////////////////////////////////////////////////////////////////////////
// Name: common/fldlgcmn.cpp
// Purpose: wxFileDialog common functions
// Author: John Labenski
// Modified by: Leland Lucius
// Created: 14.06.03 (extracted from src/*/filedlg.cpp)
// RCS-ID: $Id: FileDialog.cpp,v 1.8 2008-10-05 14:48:59 richardash1981 Exp $
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
//
// Modified for Audacity to support an additional button on Save dialogs
//
/////////////////////////////////////////////////////////////////////////////
DEFINE_EVENT_TYPE(EVT_FILEDIALOG_SELECTION_CHANGED);
DEFINE_EVENT_TYPE(EVT_FILEDIALOG_FILTER_CHANGED);
DEFINE_EVENT_TYPE(EVT_FILEDIALOG_ADD_CONTROLS);
FileDialogBase::FileDialogBase()
{
m_creator = NULL;
m_userdata = NULL;
m_userdata = 0;
}
bool FileDialogBase::HasUserPaneCreator() const
@ -63,17 +45,28 @@ void FileDialogBase::CreateUserPane(wxWindow *parent)
// FileDialog convenience functions
//----------------------------------------------------------------------------
wxString FileSelector(const wxString & title,
const wxString & defaultDir,
const wxString & defaultFileName,
const wxString & defaultExtension,
const wxString & filter,
/////////////////////////////////////////////////////////////////////////////
// Name: src/common/fldlgcmn.cpp
// Purpose: wxFileDialog common functions
// Author: John Labenski
// Modified by: Leland Lucius for use with Audacity
// Created: 14.06.03 (extracted from src/*/filedlg.cpp)
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxString FileSelector(const wxString& title,
const wxString& defaultDir,
const wxString& defaultFileName,
const wxString& defaultExtension,
const wxString& filter,
int flags,
wxWindow *parent)
wxWindow *parent,
int x, int y)
{
// The defaultExtension, if non-empty, is
// appended to the filename if the user fails to type an extension. The new
// implementation (taken from wxFileSelectorEx) appends the extension
// implementation (taken from FileSelectorEx) appends the extension
// automatically, by looking at the filter specification. In fact this
// should be better than the native Microsoft implementation because
// Windows only allows *one* default extension, whereas here we do the
@ -83,29 +76,28 @@ wxString FileSelector(const wxString & title,
// suitable filter.
wxString filter2;
if (!defaultExtension.empty() && filter.empty())
if ( !defaultExtension.empty() && filter.empty() )
filter2 = wxString(wxT("*.")) + defaultExtension;
else if (!filter.empty())
else if ( !filter.empty() )
filter2 = filter;
FileDialog fileDialog(parent, title, defaultDir,
defaultFileName, filter2,
flags);
flags, wxPoint(x, y));
// if filter is of form "All files (*)|*|..." set correct filter index
if (!defaultExtension.empty() && filter2.find(wxT('|')) != wxString::npos)
if ( !defaultExtension.empty() && filter2.find(wxT('|')) != wxString::npos )
{
int filterIndex = 0;
wxArrayString descriptions, filters;
// don't care about errors, handled already by FileDialog
(void)wxParseCommonDialogsFilter(filter2, descriptions, filters);
for (size_t n=0; n<filters.GetCount(); n++)
{
if (filters[n].Contains(defaultExtension))
{
filterIndex = (int)n; // Convert to int to avoid compiler warning, because we probably do not need many tens of thousands of filters.
filterIndex = n;
break;
}
}
@ -115,10 +107,45 @@ wxString FileSelector(const wxString & title,
}
wxString filename;
if (fileDialog.ShowModal() == wxID_OK)
if ( fileDialog.ShowModal() == wxID_OK )
{
filename = fileDialog.GetPath();
}
return filename;
}
//----------------------------------------------------------------------------
// FileSelectorEx
//----------------------------------------------------------------------------
wxString FileSelectorEx(const wxString& title,
const wxString& defaultDir,
const wxString& defaultFileName,
int* defaultFilterIndex,
const wxString& filter,
int flags,
wxWindow* parent,
int x,
int y)
{
FileDialog fileDialog(parent,
title,
defaultDir,
defaultFileName,
filter,
flags, wxPoint(x, y));
wxString filename;
if ( fileDialog.ShowModal() == wxID_OK )
{
if ( defaultFilterIndex )
*defaultFilterIndex = fileDialog.GetFilterIndex();
filename = fileDialog.GetPath();
}
return filename;
}

View File

@ -14,29 +14,13 @@ custom controls.
*//*******************************************************************/
#ifndef _FILE_DIALOG_H_
#define _FILE_DIALOG_H_
#ifndef _FILEDIALOG_H_
#define _FILEDIALOG_H_
#include <wx/defs.h>
#include <wx/filectrl.h>
#include <wx/filedlg.h>
typedef void (*fdCallback)(void *, int);
/////////////////////////////////////////////////////////////////////////////
// Name: filedlg.h
// Purpose: wxFileDialog base header
// Author: Robert Roebling
// Modified by: Leland Lucius
// Created: 8/17/99
// Copyright: (c) Robert Roebling
// RCS-ID: $Id: FileDialog.h,v 1.9 2008-05-24 02:57:39 llucius Exp $
// Licence: wxWindows licence
//
// Modified for Audacity to support an additional button on Save dialogs
//
/////////////////////////////////////////////////////////////////////////////
#define FD_NO_ADD_EXTENSION 0x0400
class FileDialogBase : public wxFileDialogBase
@ -57,34 +41,51 @@ protected:
UserPaneCreatorFunction m_creator;
wxUIntPtr m_userdata;
wxString m_buttonlabel;
fdCallback m_callback;
void *m_cbdata;
};
#if defined(__WXGTK__)
#include "gtk/FileDialog.h"
#include "gtk/FileDialogPrivate.h"
#elif defined(__WXMAC__)
#include "mac/FileDialog.h"
#include "mac/FileDialogPrivate.h"
#elif defined(__WXMSW__)
#include "win/FileDialogPrivate.h"
#else
#error Unknown implementation
#endif
/////////////////////////////////////////////////////////////////////////////
// Name: wx/filedlg.h
// Purpose: wxFileDialog base header
// Author: Robert Roebling
// Modified by: Leland Lucius for use by Audacity
// Created: 8/17/99
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------
// FileDialog convenience functions
//----------------------------------------------------------------------------
wxString
FileSelector(const wxString & message = wxFileSelectorPromptStr,
const wxString & default_path = wxEmptyString,
const wxString & default_filename = wxEmptyString,
const wxString & default_extension = wxEmptyString,
const wxString & wildcard = wxFileSelectorDefaultWildcardStr,
FileSelector(const wxString& message = wxFileSelectorPromptStr,
const wxString& default_path = wxEmptyString,
const wxString& default_filename = wxEmptyString,
const wxString& default_extension = wxEmptyString,
const wxString& wildcard = wxFileSelectorDefaultWildcardStr,
int flags = 0,
wxWindow *parent = NULL);
wxWindow *parent = NULL,
int x = wxDefaultCoord, int y = wxDefaultCoord);
// An extended version of FileSelector
wxString
FileSelectorEx(const wxString& message = wxFileSelectorPromptStr,
const wxString& default_path = wxEmptyString,
const wxString& default_filename = wxEmptyString,
int *indexDefaultExtension = NULL,
const wxString& wildcard = wxFileSelectorDefaultWildcardStr,
int flags = 0,
wxWindow *parent = NULL,
int x = wxDefaultCoord, int y = wxDefaultCoord);
#endif

View File

@ -1,34 +1,28 @@
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = FileDialog.vcproj FileDialogPrivate.h.in
lib_LTLIBRARIES = libFileDialog.la
libFileDialog_la_CPPFLAGS = $(WX_CXXFLAGS)
libFileDialog_la_LIBADD = $(WX_LIBS)
libFileDialog_la_SOURCES = FileDialog.cpp FileDialog.h
if GENERIC
libFileDialog_la_SOURCES += \
generic/FileDialogPrivate.cpp \
generic/FileDialogPrivate.h \
$(NULL)
endif
if GTK
libFileDialog_la_CPPFLAGS += $(GTK_CFLAGS)
libFileDialog_la_LIBADD += $(GTK_LIBS)
libFileDialog_la_SOURCES += \
gtk/FileDialogPrivate.cpp \
gtk/FileDialogPrivate.h \
gtk/private.h \
$(NULL)
endif
if MAC
libFileDialog_la_SOURCES += mac/FileDialogPrivate.cpp mac/FileDialogPrivate.h
libFileDialog_la_SOURCES += mac/FileDialogPrivate.mm \
mac/FileDialogPrivate.h \
$(NULL)
endif
if WINDOWS
libFileDialog_la_SOURCES += win/FileDialogPrivate.cpp win/FileDialogPrivate.h
libFileDialog_la_SOURCES += win/FileDialogPrivate.cpp \
win/FileDialogPrivate.h \
$(NULL)
endif

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -15,7 +15,17 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -78,34 +88,17 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@GENERIC_TRUE@am__append_1 = \
@GENERIC_TRUE@ generic/FileDialogPrivate.cpp \
@GENERIC_TRUE@ generic/FileDialogPrivate.h \
@GENERIC_TRUE@ $(NULL)
@GTK_TRUE@am__append_2 = $(GTK_CFLAGS)
@GTK_TRUE@am__append_3 = $(GTK_LIBS)
@GTK_TRUE@am__append_4 = \
@GTK_TRUE@am__append_1 = $(GTK_CFLAGS)
@GTK_TRUE@am__append_2 = $(GTK_LIBS)
@GTK_TRUE@am__append_3 = \
@GTK_TRUE@ gtk/FileDialogPrivate.cpp \
@GTK_TRUE@ gtk/FileDialogPrivate.h \
@GTK_TRUE@ gtk/private.h \
@GTK_TRUE@ $(NULL)
@MAC_TRUE@am__append_5 = mac/FileDialogPrivate.cpp mac/FileDialogPrivate.h
@WINDOWS_TRUE@am__append_6 = win/FileDialogPrivate.cpp win/FileDialogPrivate.h
@MAC_TRUE@am__append_4 = mac/FileDialogPrivate.cpp mac/FileDialogPrivate.h
@WINDOWS_TRUE@am__append_5 = win/FileDialogPrivate.cpp win/FileDialogPrivate.h
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(top_srcdir)/autotools/depcomp autotools/ar-lib \
autotools/compile autotools/config.guess autotools/config.sub \
autotools/depcomp autotools/install-sh autotools/missing \
autotools/ltmain.sh $(top_srcdir)/autotools/ar-lib \
$(top_srcdir)/autotools/compile \
$(top_srcdir)/autotools/config.guess \
$(top_srcdir)/autotools/config.sub \
$(top_srcdir)/autotools/install-sh \
$(top_srcdir)/autotools/ltmain.sh \
$(top_srcdir)/autotools/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@ -113,6 +106,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@ -152,21 +147,17 @@ am__DEPENDENCIES_1 =
libFileDialog_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2)
am__libFileDialog_la_SOURCES_DIST = FileDialog.cpp FileDialog.h \
generic/FileDialogPrivate.cpp generic/FileDialogPrivate.h \
gtk/FileDialogPrivate.cpp gtk/FileDialogPrivate.h \
gtk/private.h mac/FileDialogPrivate.cpp \
mac/FileDialogPrivate.h win/FileDialogPrivate.cpp \
win/FileDialogPrivate.h
am__dirstamp = $(am__leading_dot)dirstamp
@GENERIC_TRUE@am__objects_1 = \
@GENERIC_TRUE@ generic/libFileDialog_la-FileDialogPrivate.lo
@GTK_TRUE@am__objects_2 = gtk/libFileDialog_la-FileDialogPrivate.lo
@MAC_TRUE@am__objects_3 = mac/libFileDialog_la-FileDialogPrivate.lo
@WINDOWS_TRUE@am__objects_4 = \
@GTK_TRUE@am__objects_1 = gtk/libFileDialog_la-FileDialogPrivate.lo
@MAC_TRUE@am__objects_2 = mac/libFileDialog_la-FileDialogPrivate.lo
@WINDOWS_TRUE@am__objects_3 = \
@WINDOWS_TRUE@ win/libFileDialog_la-FileDialogPrivate.lo
am_libFileDialog_la_OBJECTS = libFileDialog_la-FileDialog.lo \
$(am__objects_1) $(am__objects_2) $(am__objects_3) \
$(am__objects_4)
$(am__objects_1) $(am__objects_2) $(am__objects_3)
libFileDialog_la_OBJECTS = $(am_libFileDialog_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@ -252,6 +243,17 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
AM_RECURSIVE_TARGETS = cscope
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/autotools/ar-lib \
$(top_srcdir)/autotools/compile \
$(top_srcdir)/autotools/config.guess \
$(top_srcdir)/autotools/config.sub \
$(top_srcdir)/autotools/depcomp \
$(top_srcdir)/autotools/install-sh \
$(top_srcdir)/autotools/ltmain.sh \
$(top_srcdir)/autotools/missing autotools/ar-lib \
autotools/compile autotools/config.guess autotools/config.sub \
autotools/depcomp autotools/install-sh autotools/ltmain.sh \
autotools/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@ -401,10 +403,10 @@ top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = FileDialog.vcproj FileDialogPrivate.h.in
lib_LTLIBRARIES = libFileDialog.la
libFileDialog_la_CPPFLAGS = $(WX_CXXFLAGS) $(am__append_2)
libFileDialog_la_LIBADD = $(WX_LIBS) $(am__append_3)
libFileDialog_la_SOURCES = FileDialog.cpp FileDialog.h $(am__append_1) \
$(am__append_4) $(am__append_5) $(am__append_6)
libFileDialog_la_CPPFLAGS = $(WX_CXXFLAGS) $(am__append_1)
libFileDialog_la_LIBADD = $(WX_LIBS) $(am__append_2)
libFileDialog_la_SOURCES = FileDialog.cpp FileDialog.h $(am__append_3) \
$(am__append_4) $(am__append_5)
all: all-am
.SUFFIXES:
@ -424,7 +426,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@ -478,14 +479,6 @@ clean-libLTLIBRARIES:
echo rm -f $${locs}; \
rm -f $${locs}; \
}
generic/$(am__dirstamp):
@$(MKDIR_P) generic
@: > generic/$(am__dirstamp)
generic/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) generic/$(DEPDIR)
@: > generic/$(DEPDIR)/$(am__dirstamp)
generic/libFileDialog_la-FileDialogPrivate.lo: \
generic/$(am__dirstamp) generic/$(DEPDIR)/$(am__dirstamp)
gtk/$(am__dirstamp):
@$(MKDIR_P) gtk
@: > gtk/$(am__dirstamp)
@ -516,8 +509,6 @@ libFileDialog.la: $(libFileDialog_la_OBJECTS) $(libFileDialog_la_DEPENDENCIES) $
mostlyclean-compile:
-rm -f *.$(OBJEXT)
-rm -f generic/*.$(OBJEXT)
-rm -f generic/*.lo
-rm -f gtk/*.$(OBJEXT)
-rm -f gtk/*.lo
-rm -f mac/*.$(OBJEXT)
@ -529,7 +520,6 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libFileDialog_la-FileDialog.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@generic/$(DEPDIR)/libFileDialog_la-FileDialogPrivate.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gtk/$(DEPDIR)/libFileDialog_la-FileDialogPrivate.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@mac/$(DEPDIR)/libFileDialog_la-FileDialogPrivate.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@win/$(DEPDIR)/libFileDialog_la-FileDialogPrivate.Plo@am__quote@
@ -565,13 +555,6 @@ libFileDialog_la-FileDialog.lo: FileDialog.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libFileDialog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libFileDialog_la-FileDialog.lo `test -f 'FileDialog.cpp' || echo '$(srcdir)/'`FileDialog.cpp
generic/libFileDialog_la-FileDialogPrivate.lo: generic/FileDialogPrivate.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libFileDialog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT generic/libFileDialog_la-FileDialogPrivate.lo -MD -MP -MF generic/$(DEPDIR)/libFileDialog_la-FileDialogPrivate.Tpo -c -o generic/libFileDialog_la-FileDialogPrivate.lo `test -f 'generic/FileDialogPrivate.cpp' || echo '$(srcdir)/'`generic/FileDialogPrivate.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) generic/$(DEPDIR)/libFileDialog_la-FileDialogPrivate.Tpo generic/$(DEPDIR)/libFileDialog_la-FileDialogPrivate.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='generic/FileDialogPrivate.cpp' object='generic/libFileDialog_la-FileDialogPrivate.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libFileDialog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o generic/libFileDialog_la-FileDialogPrivate.lo `test -f 'generic/FileDialogPrivate.cpp' || echo '$(srcdir)/'`generic/FileDialogPrivate.cpp
gtk/libFileDialog_la-FileDialogPrivate.lo: gtk/FileDialogPrivate.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libFileDialog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gtk/libFileDialog_la-FileDialogPrivate.lo -MD -MP -MF gtk/$(DEPDIR)/libFileDialog_la-FileDialogPrivate.Tpo -c -o gtk/libFileDialog_la-FileDialogPrivate.lo `test -f 'gtk/FileDialogPrivate.cpp' || echo '$(srcdir)/'`gtk/FileDialogPrivate.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gtk/$(DEPDIR)/libFileDialog_la-FileDialogPrivate.Tpo gtk/$(DEPDIR)/libFileDialog_la-FileDialogPrivate.Plo
@ -598,7 +581,6 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-rm -rf generic/.libs generic/_libs
-rm -rf gtk/.libs gtk/_libs
-rm -rf mac/.libs mac/_libs
-rm -rf win/.libs win/_libs
@ -720,15 +702,15 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@ -764,17 +746,17 @@ distcheck: dist
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@ -860,8 +842,6 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f generic/$(DEPDIR)/$(am__dirstamp)
-rm -f generic/$(am__dirstamp)
-rm -f gtk/$(DEPDIR)/$(am__dirstamp)
-rm -f gtk/$(am__dirstamp)
-rm -f mac/$(DEPDIR)/$(am__dirstamp)
@ -879,7 +859,7 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR) generic/$(DEPDIR) gtk/$(DEPDIR) mac/$(DEPDIR) win/$(DEPDIR)
-rm -rf ./$(DEPDIR) gtk/$(DEPDIR) mac/$(DEPDIR) win/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
@ -927,7 +907,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR) generic/$(DEPDIR) gtk/$(DEPDIR) mac/$(DEPDIR) win/$(DEPDIR)
-rm -rf ./$(DEPDIR) gtk/$(DEPDIR) mac/$(DEPDIR) win/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -965,6 +945,8 @@ uninstall-am: uninstall-libLTLIBRARIES
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -641,8 +641,6 @@ MAC_FALSE
MAC_TRUE
GTK_FALSE
GTK_TRUE
GENERIC_FALSE
GENERIC_TRUE
GTK_LIBS
GTK_CFLAGS
PKG_CONFIG_LIBDIR
@ -2324,7 +2322,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
am__api_version='1.14'
am__api_version='1.15'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@ -2496,8 +2494,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
@ -2516,7 +2514,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@ -2844,8 +2842,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@ -2903,6 +2901,7 @@ END
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
@ -15486,8 +15485,10 @@ else
fi
# Extract the first word of "wx-config", so it can be a program name with args.
set dummy wx-config; ac_word=$2
for ac_prog in wx-config wx-config-3.0
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_WX_CONFIG+:} false; then :
@ -15514,7 +15515,6 @@ done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_WX_CONFIG" && ac_cv_path_WX_CONFIG="no"
;;
esac
fi
@ -15528,6 +15528,10 @@ $as_echo "no" >&6; }
fi
test -n "$WX_CONFIG" && break
done
test -n "$WX_CONFIG" || WX_CONFIG="no"
if [ "$WX_CONFIG" = "no" ] ; then
as_fn_error $? "\"Could not find wx-config: is wxWidgets installed? is wx-config in your path?\"" "$LINENO" 5
fi
@ -15740,7 +15744,7 @@ fi
IMPLEMENTATION="generic"
IMPLEMENTATION=""
case "${host_os}" in
darwin*)
IMPLEMENTATION="mac"
@ -15763,14 +15767,6 @@ $as_echo "#define HAVE_GTK 1" >>confdefs.h
;;
esac
if test "$IMPLEMENTATION" = "generic"; then
GENERIC_TRUE=
GENERIC_FALSE='#'
else
GENERIC_TRUE='#'
GENERIC_FALSE=
fi
if test "$IMPLEMENTATION" = "gtk"; then
GTK_TRUE=
GTK_FALSE='#'
@ -15981,10 +15977,6 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${GENERIC_TRUE}" && test -z "${GENERIC_FALSE}"; then
as_fn_error $? "conditional \"GENERIC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${GTK_TRUE}" && test -z "${GTK_FALSE}"; then
as_fn_error $? "conditional \"GTK\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View File

@ -57,7 +57,7 @@ AC_ARG_WITH(wx-config,
wx_config="")
dnl wxWidgets -- we assume that if wx-config is found, wxWidgets is successfully installed.
AC_PATH_PROG(WX_CONFIG, wx-config, no, $PATH:/usr/local/bin )
AC_PATH_PROGS(WX_CONFIG, wx-config wx-config-3.0, no, $PATH:/usr/local/bin )
if [[ "$WX_CONFIG" = "no" ]] ; then
AC_MSG_ERROR("Could not find wx-config: is wxWidgets installed? is wx-config in your path?")
fi
@ -82,7 +82,7 @@ dnl OS-specific configuration
AC_CANONICAL_HOST
IMPLEMENTATION="generic"
IMPLEMENTATION=""
case "${host_os}" in
darwin*)
dnl Mac OS X configuration
@ -105,7 +105,6 @@ case "${host_os}" in
;;
esac
AM_CONDITIONAL([GENERIC], test "$IMPLEMENTATION" = "generic")
AM_CONDITIONAL([GTK], test "$IMPLEMENTATION" = "gtk")
AM_CONDITIONAL([MAC], test "$IMPLEMENTATION" = "mac")
AM_CONDITIONAL([WINDOWS], test "$IMPLEMENTATION" = "win")

File diff suppressed because it is too large Load Diff

View File

@ -1,304 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: filedlgg.h
// Purpose: wxGenericFileDialog
// Author: Robert Roebling
// Modified by: Leland Lucius
// Created: 8/17/99
// Copyright: (c) Robert Roebling
// RCS-ID: $Id: FileDialogPrivate.h,v 1.2 2008-05-24 02:57:39 llucius Exp $
// Licence: wxWindows licence
//
// Modified for Audacity to support an additional button on Save dialogs
//
/////////////////////////////////////////////////////////////////////////////
#ifndef _FILEDIALOGGENERICH_
#define _FILEDIALOGGENERICH_
#include "wx/listctrl.h"
#include "wx/datetime.h"
#include "wx/sizer.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxBitmapButton;
class wxCheckBox;
class wxChoice;
class wxFileData;
class FileCtrl;
class wxListEvent;
class wxListItem;
class wxStaticText;
class wxTextCtrl;
//-------------------------------------------------------------------------
// FileDialog
//-------------------------------------------------------------------------
#if defined(GENERIC_FILEDIALOG)
#define FILEDIALOG GenericFileDialog
#else
#define FILEDIALOG FileDialog
#endif
class FILEDIALOG: public wxFileDialogBase
{
public:
FILEDIALOG() : wxFileDialogBase() { Init(); }
FILEDIALOG(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = 0,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr,
bool bypassGenericImpl = false );
bool Create( wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = 0,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr,
bool bypassGenericImpl = false );
virtual ~FILEDIALOG();
virtual void SetMessage(const wxString& message) { SetTitle(message); }
virtual void SetPath(const wxString& path);
virtual void SetFilterIndex(int filterIndex);
virtual void SetWildcard(const wxString& wildCard);
// for multiple file selection
virtual void GetPaths(wxArrayString& paths) const;
virtual void GetFilenames(wxArrayString& files) const;
#if !defined(GENERIC_FILEDIALOG)
virtual void EnableButton(wxString label, fdCallback cb, void *cbdata);
virtual void ClickButton(int index);
#endif
// implementation only from now on
// -------------------------------
virtual int ShowModal();
virtual bool Show( bool show = true );
void OnSelected( wxListEvent &event );
void OnActivated( wxListEvent &event );
void OnList( wxCommandEvent &event );
void OnReport( wxCommandEvent &event );
void OnUp( wxCommandEvent &event );
void OnHome( wxCommandEvent &event );
void OnListOk( wxCommandEvent &event );
void OnNew( wxCommandEvent &event );
void OnChoiceFilter( wxCommandEvent &event );
void OnTextEnter( wxCommandEvent &event );
void OnTextChange( wxCommandEvent &event );
void OnCheck( wxCommandEvent &event );
void OnExtra( wxCommandEvent &event );
virtual void HandleAction( const wxString &fn );
virtual void UpdateControls();
private:
// Don't use this implementation at all :-)
bool m_bypassGenericImpl;
protected:
// use the filter with the given index
void DoSetFilterIndex(int filterindex);
wxString m_filterExtension;
wxChoice *m_choice;
wxTextCtrl *m_text;
FileCtrl *m_list;
wxCheckBox *m_check;
wxStaticText *m_static;
wxBitmapButton *m_upDirButton;
wxBitmapButton *m_newDirButton;
private:
void Init();
DECLARE_DYNAMIC_CLASS(FILEDIALOG)
DECLARE_EVENT_TABLE()
// these variables are preserved between FileDialog calls
static long ms_lastViewStyle; // list or report?
static bool ms_lastShowHidden; // did we show hidden files?
long m_dialogStyle;
wxBoxSizer *m_choicesizer;
wxString m_buttonlabel;
fdCallback m_callback;
void *m_cbdata;
};
//-----------------------------------------------------------------------------
// FileData - a class to hold the file info for the FileCtrl
//-----------------------------------------------------------------------------
class FileData
{
public:
enum fileType
{
is_file = 0x0000,
is_dir = 0x0001,
is_link = 0x0002,
is_exe = 0x0004,
is_drive = 0x0008
};
FileData() { Init(); }
// Full copy constructor
FileData( const FileData& fileData ) { Copy(fileData); }
// Create a filedata from this information
FileData( const wxString &filePath, const wxString &fileName,
fileType type, int image_id );
// make a full copy of the other FileData
void Copy( const FileData &other );
// (re)read the extra data about the file from the system
void ReadData();
// get the name of the file, dir, drive
wxString GetFileName() const { return m_fileName; }
// get the full path + name of the file, dir, path
wxString GetFilePath() const { return m_filePath; }
// Set the path + name and name of the item
void SetNewName( const wxString &filePath, const wxString &fileName );
// Get the size of the file in bytes
long GetSize() const { return m_size; }
// Get the type of file, either file extension or <DIR>, <LINK>, <DRIVE>
wxString GetFileType() const;
// get the last modification time
wxDateTime GetDateTime() const { return m_dateTime; }
// Get the time as a formatted string
wxString GetModificationTime() const;
// in UNIX get rwx for file, in MSW get attributes ARHS
wxString GetPermissions() const { return m_permissions; }
// Get the id of the image used in a wxImageList
int GetImageId() const { return m_image; }
bool IsFile() const { return !IsDir() && !IsLink() && !IsDrive(); }
bool IsDir() const { return (m_type & is_dir ) != 0; }
bool IsLink() const { return (m_type & is_link ) != 0; }
bool IsExe() const { return (m_type & is_exe ) != 0; }
bool IsDrive() const { return (m_type & is_drive) != 0; }
// Get/Set the type of file, file/dir/drive/link
int GetType() const { return m_type; }
// the FileCtrl fields in report view
enum fileListFieldType
{
FileList_Name,
FileList_Size,
FileList_Type,
FileList_Time,
#if defined(__UNIX__) || defined(__WIN32__)
FileList_Perm,
#endif // defined(__UNIX__) || defined(__WIN32__)
FileList_Max
};
// Get the entry for report view of FileCtrl
wxString GetEntry( fileListFieldType num ) const;
// Get a string representation of the file info
wxString GetHint() const;
// initialize a wxListItem attributes
void MakeItem( wxListItem &item );
// operators
FileData& operator = (const FileData& fd) { Copy(fd); return *this; }
protected:
wxString m_fileName;
wxString m_filePath;
long m_size;
wxDateTime m_dateTime;
wxString m_permissions;
int m_type;
int m_image;
private:
void Init();
};
//-----------------------------------------------------------------------------
// FileCtrl
//-----------------------------------------------------------------------------
class FileCtrl : public wxListCtrl
{
public:
FileCtrl();
FileCtrl( wxWindow *win,
wxWindowID id,
const wxString &wild,
bool showHidden,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLC_LIST,
const wxValidator &validator = wxDefaultValidator,
const wxString &name = wxT("filelist") );
virtual ~FileCtrl();
virtual void ChangeToListMode();
virtual void ChangeToReportMode();
virtual void ChangeToSmallIconMode();
virtual void ShowHidden( bool show = true );
bool GetShowHidden() const { return m_showHidden; }
virtual long Add( FileData *fd, wxListItem &item );
virtual void UpdateItem(const wxListItem &item);
virtual void UpdateFiles();
virtual void MakeDir();
virtual void GoToParentDir();
virtual void GoToHomeDir();
virtual void GoToDir( const wxString &dir );
virtual void SetWild( const wxString &wild );
wxString GetWild() const { return m_wild; }
wxString GetDir() const { return m_dirName; }
void OnListDeleteItem( wxListEvent &event );
void OnListDeleteAllItems( wxListEvent &event );
void OnListEndLabelEdit( wxListEvent &event );
void OnListColClick( wxListEvent &event );
virtual void SortItems(FileData::fileListFieldType field, bool foward);
bool GetSortDirection() const { return m_sort_foward; }
FileData::fileListFieldType GetSortField() const { return m_sort_field; }
protected:
void FreeItemData(wxListItem& item);
void FreeAllItemsData();
wxString m_dirName;
bool m_showHidden;
wxString m_wild;
bool m_sort_foward;
FileData::fileListFieldType m_sort_field;
private:
DECLARE_DYNAMIC_CLASS(FileCtrl)
DECLARE_EVENT_TABLE()
};
#endif // _FILEDIALOGGENERICH_

View File

@ -1,86 +1,70 @@
//
// Copied from wxWidgets 3.0.2 and modified for Audacity
//
/////////////////////////////////////////////////////////////////////////////
// Name: gtk/filedlg.cpp
// Purpose: native implementation of FileDialog
// Name: src/gtk/filedlg.cpp
// Purpose: native implementation of wxFileDialog
// Author: Robert Roebling, Zbigniew Zagorski, Mart Raudsepp
// Id: $Id: FileDialogPrivate.cpp,v 1.7 2009-05-25 11:10:00 llucius Exp $
// Copyright: (c) 1998 Robert Roebling, 2004 Zbigniew Zagorski, 2005 Mart Raudsepp
// Licence: wxWindows licence
//
// Modified for Audacity to support an additional button on Save dialogs
//
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// Include setup.h to get wxUSE flags for compilers that do not support precompilation of headers
#include "wx/setup.h"
#include "../FileDialog.h"
#include <gtk/gtk.h>
#include "private.h"
#include <unistd.h> // chdir
#include "wx/intl.h"
#include "wx/filename.h" // wxFilename
#include "wx/tokenzr.h" // wxStringTokenizer
#include "wx/filefn.h" // ::wxGetCwd
#include "wx/msgdlg.h" // wxMessageDialog
#include "wx/version.h"
#include "wx/msgdlg.h"
//-----------------------------------------------------------------------------
// Pull in generic file dialog
//-----------------------------------------------------------------------------
#include <gtk/gtk.h>
#include "../generic/FileDialogPrivate.cpp"
#ifdef __UNIX__
#include <unistd.h> // chdir
#endif
//-----------------------------------------------------------------------------
// idle system
//-----------------------------------------------------------------------------
#include <wx/filename.h> // wxFilename
#include <wx/tokenzr.h> // wxStringTokenizer
#include <wx/filefn.h> // ::wxGetCwd
#include <wx/modalhook.h>
#include <wx/sizer.h>
extern void wxapp_install_idle_handler();
#define wxGTK_CONV(s) (s).utf8_str()
#define wxGTK_CONV_FN(s) (s).fn_str()
//-----------------------------------------------------------------------------
// Open expanders on the dialog (really only the "Browser for other folders")
//-----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Convenience class for g_freeing a gchar* on scope exit automatically
// ----------------------------------------------------------------------------
extern "C" {
static void SetExpanded(GtkWidget *widget, gpointer data)
{
if (GTK_IS_EXPANDER(widget))
{
gtk_expander_set_expanded(GTK_EXPANDER(widget), true);
}
else if (GTK_IS_CONTAINER(widget))
{
gtk_container_forall(GTK_CONTAINER(widget), SetExpanded, data);
}
class wxGtkString
{
public:
explicit wxGtkString(gchar *s) : m_str(s) { }
~wxGtkString() { g_free(m_str); }
return;
}
const gchar *c_str() const { return m_str; }
static void gtk_filedialog_show_callback(GtkWidget *widget, FileDialog *dialog)
{
gtk_container_forall(GTK_CONTAINER(widget), SetExpanded, NULL);
}
}
operator gchar *() const { return m_str; }
private:
gchar *m_str;
wxDECLARE_NO_COPY_CLASS(wxGtkString);
};
//-----------------------------------------------------------------------------
// "clicked" for OK-button
//-----------------------------------------------------------------------------
extern "C" {
static void gtk_filedialog_ok_callback(GtkWidget *widget, FileDialog *dialog)
{
static void gtk_filedialog_ok_callback(GtkWidget *widget, FileDialog *dialog)
{
int style = dialog->GetWindowStyle();
gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget));
wxGtkString filename(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget)));
// gtk version numbers must be identical with the one in ctor (that calls set_do_overwrite_confirmation)
#ifndef __WXGTK3__
#if GTK_CHECK_VERSION(2,7,3)
if(gtk_check_version(2,7,3) != NULL)
if (gtk_check_version(2, 7, 3) != NULL)
#endif
{
if ((style & wxFD_SAVE) && (style & wxFD_OVERWRITE_PROMPT))
{
if ( g_file_test(filename, G_FILE_TEST_EXISTS) )
@ -89,7 +73,7 @@ extern "C" {
msg.Printf(
_("File '%s' already exists, do you really want to overwrite it?"),
wxString(wxConvFileName->cMB2WX(filename)).c_str());
wxString::FromUTF8(filename));
wxMessageDialog dlg(dialog, msg, _("Confirm"),
wxYES_NO | wxICON_QUESTION);
@ -97,105 +81,209 @@ extern "C" {
return;
}
}
}
#endif
if (style & wxFD_FILE_MUST_EXIST)
{
if ( !g_file_test(filename, G_FILE_TEST_EXISTS) )
{
wxMessageDialog dlg( dialog, _("Please choose an existing file."),
_("Error"), wxOK| wxICON_ERROR);
dlg.ShowModal();
return;
}
}
// change to the directory where the user went if asked
if (style & wxFD_CHANGE_DIR)
{
// Use chdir to not care about filename encodings
gchar* folder = g_path_get_dirname(filename);
wxGtkString folder(g_path_get_dirname(filename));
chdir(folder);
g_free(folder);
}
g_free(filename);
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
wxCommandEvent event(wxEVT_BUTTON, wxID_OK);
event.SetEventObject(dialog);
dialog->GetEventHandler()->ProcessEvent(event);
}
dialog->HandleWindowEvent(event);
}
}
//-----------------------------------------------------------------------------
// "clicked" for Cancel-button
//-----------------------------------------------------------------------------
extern "C" {
static void gtk_filedialog_cancel_callback(GtkWidget *WXUNUSED(w),
FileDialog *dialog)
{
extern "C"
{
static void
gtk_filedialog_cancel_callback(GtkWidget * WXUNUSED(w), FileDialog *dialog)
{
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
event.SetEventObject(dialog);
dialog->GetEventHandler()->ProcessEvent(event);
}
dialog->HandleWindowEvent(event);
}
extern "C" {
static void gtk_filedialog_response_callback(GtkWidget *w,
static void gtk_filedialog_response_callback(GtkWidget *w,
gint response,
FileDialog *dialog)
{
#if !wxCHECK_VERSION(3, 0, 0)
wxapp_install_idle_handler();
#endif
{
if (response == GTK_RESPONSE_ACCEPT)
gtk_filedialog_ok_callback(w, dialog);
else if (response == GTK_RESPONSE_CANCEL)
else // GTK_RESPONSE_CANCEL or GTK_RESPONSE_NONE
gtk_filedialog_cancel_callback(w, dialog);
else // "delete"
{
gtk_filedialog_cancel_callback(w, dialog);
dialog->m_destroyed_by_delete = true;
}
}
}
//-----------------------------------------------------------------------------
// "clicked" for extra-button
//-----------------------------------------------------------------------------
extern "C" {
static void gtk_filedialog_extra_callback(GtkWidget *WXUNUSED(w),
static void gtk_filedialog_selchanged_callback(GtkFileChooser *chooser,
FileDialog *dialog)
{
wxGtkString filename(gtk_file_chooser_get_preview_filename(chooser));
dialog->GTKSelectionChanged(wxString::FromUTF8(filename));
}
static void gtk_filedialog_update_preview_callback(GtkFileChooser *chooser,
gpointer user_data)
{
GtkWidget *preview = GTK_WIDGET(user_data);
wxGtkString filename(gtk_file_chooser_get_preview_filename(chooser));
if ( !filename )
return;
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file_at_size(filename, 128, 128, NULL);
gboolean have_preview = pixbuf != NULL;
gtk_image_set_from_pixbuf(GTK_IMAGE(preview), pixbuf);
if ( pixbuf )
g_object_unref (pixbuf);
gtk_file_chooser_set_preview_widget_active(chooser, have_preview);
}
static void gtk_filedialog_folderchanged_callback(GtkFileChooser *chooser,
FileDialog *dialog)
{
dialog->GTKFolderChanged();
}
static void gtk_filedialog_filterchanged_callback(GtkFileChooser *chooser,
GParamSpec *pspec,
FileDialog *dialog)
{
dialog->GTKFilterChanged();
}
static GtkWidget* find_widget(GtkWidget* parent, const gchar* name, int depth)
{
// printf("%*.*c%s\n", depth, depth, ' ', gtk_widget_get_name(parent));
GtkWidget *widget = NULL;
if (g_strcasecmp(gtk_widget_get_name(parent), name) == 0)
{
dialog->ClickButton(dialog->GetFilterIndex());
return parent;
}
if (GTK_IS_BIN(parent))
{
return find_widget(gtk_bin_get_child(GTK_BIN(parent)), name, depth + 1);
}
if (GTK_IS_CONTAINER(parent))
{
GList *list = gtk_container_get_children(GTK_CONTAINER(parent));
for (GList *node = list; node; node = node->next)
{
widget = find_widget(GTK_WIDGET(node->data), name, depth + 1);
if (widget)
{
break;
}
}
g_list_free(list);
}
return widget;
}
} // extern "C"
void FileDialog::AddChildGTK(wxWindowGTK* child)
{
// allow dialog to be resized smaller horizontally
gtk_widget_set_size_request(
child->m_widget, child->GetMinWidth(), child->m_height);
// In GTK 3+, adding our container as the extra widget can cause the
// the filter combo to grow to the same height as our container. This
// makes for a very odd looking filter combo. So, we manually add our
// container below the action bar.
#if GTK_CHECK_VERSION(3,0,0)
GtkWidget *actionbar = find_widget(m_widget, "GtkActionBar", 0);
if (actionbar)
{
GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add(GTK_CONTAINER(vbox), child->m_widget);
gtk_box_set_child_packing(GTK_BOX(vbox), child->m_widget, TRUE, TRUE, 0, GTK_PACK_START);
gtk_widget_show(vbox);
GtkWidget *abparent = gtk_widget_get_parent(actionbar);
gtk_container_add(GTK_CONTAINER(abparent), vbox);
gtk_box_set_child_packing(GTK_BOX(abparent), vbox, FALSE, FALSE, 0, GTK_PACK_END);
gtk_box_reorder_child(GTK_BOX(abparent), actionbar, -2);
}
#else
gtk_file_chooser_set_extra_widget(
GTK_FILE_CHOOSER(m_widget), child->m_widget);
#endif
}
//-----------------------------------------------------------------------------
// FileDialog
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(FileDialog, GenericFileDialog)
IMPLEMENT_DYNAMIC_CLASS(FileDialog,FileDialogBase)
BEGIN_EVENT_TABLE(FileDialog, GenericFileDialog)
EVT_BUTTON(wxID_OK, FileDialog::OnFakeOk)
BEGIN_EVENT_TABLE(FileDialog,FileDialogBase)
EVT_BUTTON(wxID_OK, FileDialog::OnFakeOk)
EVT_SIZE(FileDialog::OnSize)
END_EVENT_TABLE()
FileDialog::FileDialog(wxWindow *parent, const wxString& message,
const wxString& defaultDir,
const wxString& defaultFileName,
const wxString& wildCard,
long style, const wxPoint& pos)
: GenericFileDialog(parent, message, defaultDir, defaultFileName,
wildCard, style, pos,
wxDefaultSize,
wxFileDialogNameStr,
true )
long style, const wxPoint& pos,
const wxSize& sz,
const wxString& name)
: FileDialogBase()
{
wxASSERT_MSG( !( (style & wxFD_SAVE) && (style & wxFD_MULTIPLE) ), wxT("FileDialog - wxFD_MULTIPLE used on a save dialog" ) );
Create(parent, message, defaultDir, defaultFileName, wildCard, style, pos, sz, name);
}
#if !wxCHECK_VERSION(3, 0, 0)
m_needParent = false;
#endif
m_destroyed_by_delete = false;
bool FileDialog::Create(wxWindow *parent, const wxString& message,
const wxString& defaultDir,
const wxString& defaultFileName,
const wxString& wildCard,
long style, const wxPoint& pos,
const wxSize& sz,
const wxString& name)
{
parent = GetParentForModalDialog(parent, style);
if (!FileDialogBase::Create(parent, message, defaultDir, defaultFileName,
wildCard, style, pos, sz, name))
{
return false;
}
if (!PreCreation(parent, pos, wxDefaultSize) ||
!CreateBase(parent, wxID_ANY, pos, wxDefaultSize, style,
wxDefaultValidator, wxT("filedialog")))
{
wxFAIL_MSG( wxT("FileDialog creation failed") );
return;
return false;
}
GtkFileChooserAction gtk_action;
@ -222,163 +310,190 @@ FileDialog::FileDialog(wxWindow *parent, const wxString& message,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
ok_btn_stock, GTK_RESPONSE_ACCEPT,
NULL);
g_object_ref(m_widget);
GtkFileChooser* file_chooser = GTK_FILE_CHOOSER(m_widget);
m_fc.SetWidget(file_chooser);
// Allow pressing "Enter" key for default action
gtk_dialog_set_default_response(GTK_DIALOG(m_widget), GTK_RESPONSE_ACCEPT);
if ( style & wxFD_MULTIPLE )
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(m_widget), true);
gtk_file_chooser_set_select_multiple(file_chooser, true);
// local-only property could be set to false to allow non-local files to be loaded.
// In that case get/set_uri(s) should be used instead of get/set_filename(s) everywhere
// and the GtkFileChooserDialog should probably also be created with a backend,
// e.g "gnome-vfs", "default", ... (gtk_file_chooser_dialog_new_with_backend).
// Currently local-only is kept as the default - true:
// local-only property could be set to false to allow non-local files to be
// loaded. In that case get/set_uri(s) should be used instead of
// get/set_filename(s) everywhere and the GtkFileChooserDialog should
// probably also be created with a backend, e.g. "gnome-vfs", "default", ...
// (gtk_file_chooser_dialog_new_with_backend). Currently local-only is kept
// as the default - true:
// gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(m_widget), true);
g_signal_connect(G_OBJECT(m_widget), "response",
G_CALLBACK(gtk_filedialog_response_callback), (gpointer)this);
g_signal_connect(G_OBJECT(m_widget), "show",
G_CALLBACK(gtk_filedialog_show_callback), (gpointer)this);
g_signal_connect (m_widget, "response",
G_CALLBACK (gtk_filedialog_response_callback), this);
g_signal_connect (m_widget, "selection-changed",
G_CALLBACK (gtk_filedialog_selchanged_callback), this);
g_signal_connect (m_widget, "current-folder-changed",
G_CALLBACK (gtk_filedialog_folderchanged_callback), this);
g_signal_connect (m_widget, "notify::filter",
G_CALLBACK (gtk_filedialog_filterchanged_callback), this);
// deal with extensions/filters
SetWildcard(wildCard);
wxString defaultFileNameWithExt = defaultFileName;
if ( !wildCard.empty() && !defaultFileName.empty() &&
!wxFileName(defaultFileName).HasExt() )
{
// append the default extension, if any, to the initial file name: GTK
// won't do it for us by default (unlike e.g. MSW)
const wxFileName fnWC(m_fc.GetCurrentWildCard());
if ( fnWC.HasExt() )
{
// Notice that we shouldn't append the extension if it's a wildcard
// because this is not useful: the user would need to change it to use
// some fixed extension anyhow.
const wxString& ext = fnWC.GetExt();
if ( ext.find_first_of("?*") == wxString::npos )
defaultFileNameWithExt << "." << ext;
}
}
// if defaultDir is specified it should contain the directory and
// defaultFileName should contain the default name of the file, however if
// directory is not given, defaultFileName contains both
wxFileName fn;
if ( defaultDir.empty() )
fn.Assign(defaultFileNameWithExt);
else if ( !defaultFileNameWithExt.empty() )
fn.Assign(defaultDir, defaultFileNameWithExt);
else
fn.AssignDir(defaultDir);
// set the initial file name and/or directory
fn.MakeAbsolute(); // GTK+ needs absolute path
const wxString dir = fn.GetPath();
if ( !dir.empty() )
{
gtk_file_chooser_set_current_folder(file_chooser, wxGTK_CONV_FN(dir));
}
const wxString fname = fn.GetFullName();
if ( style & wxFD_SAVE )
{
if ( !defaultDir.empty() )
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir));
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultFileName));
if ( !fname.empty() )
{
gtk_file_chooser_set_current_name(file_chooser, wxGTK_CONV_FN(fname));
}
#if GTK_CHECK_VERSION(2,7,3)
if (!gtk_check_version(2,7,3))
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(m_widget), FALSE);
if ((style & wxFD_OVERWRITE_PROMPT)
#ifndef __WXGTK3__
&& gtk_check_version(2,7,3) == NULL
#endif
)
{
gtk_file_chooser_set_do_overwrite_confirmation(file_chooser, true);
}
#endif
}
else
else // wxFD_OPEN
{
if ( !defaultFileName.empty() )
if ( !fname.empty() )
{
wxString dir;
if ( defaultDir.empty() )
dir = ::wxGetCwd();
else
dir = defaultDir;
gtk_file_chooser_set_filename(file_chooser,
wxGTK_CONV_FN(fn.GetFullPath()));
}
}
gtk_file_chooser_set_filename(
GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB( wxFileName(dir, defaultFileName).GetFullPath() ) );
}
else if ( !defaultDir.empty() )
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir) );
if ( style & wxFD_PREVIEW )
{
GtkWidget *previewImage = gtk_image_new();
gtk_file_chooser_set_preview_widget(file_chooser, previewImage);
g_signal_connect(m_widget, "update-preview",
G_CALLBACK(gtk_filedialog_update_preview_callback),
previewImage);
}
return true;
}
FileDialog::~FileDialog()
{
if (m_destroyed_by_delete)
m_widget = NULL;
if (m_extraControl)
{
// get chooser to drop its reference right now, allowing wxWindow dtor
// to verify that ref count drops to zero
gtk_file_chooser_set_extra_widget(
GTK_FILE_CHOOSER(m_widget), NULL);
}
}
void FileDialog::OnFakeOk( wxCommandEvent &event )
void FileDialog::OnFakeOk(wxCommandEvent& WXUNUSED(event))
{
if (Validate() && TransferDataFromWindow())
EndModal(wxID_OK);
// Update the current directory from here, accessing it later may not work
// due to the strange way GtkFileChooser works.
wxGtkString
str(gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(m_widget)));
m_dir = wxString::FromUTF8(str);
EndDialog(wxID_OK);
}
int FileDialog::ShowModal()
{
if ( !m_buttonlabel.IsEmpty() )
WX_HOOK_MODAL_DIALOG();
// Create the root window
wxBoxSizer *verticalSizer = new wxBoxSizer(wxVERTICAL);
wxPanel *root = new wxPanel(this, wxID_ANY);
if (HasUserPaneCreator())
{
GtkWidget *widget;
wxString label = m_buttonlabel;
wxPanel *userpane = new wxPanel(root, wxID_ANY);
CreateUserPane(userpane);
label.Replace(wxT("&"), wxT("_"));
widget = gtk_button_new_with_mnemonic(wxGTK_CONV(label));
gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(m_widget), widget);
g_signal_connect(G_OBJECT(widget), "clicked",
G_CALLBACK(gtk_filedialog_extra_callback), (gpointer)this);
wxBoxSizer *horizontalSizer = new wxBoxSizer(wxHORIZONTAL);
horizontalSizer->Add(userpane, 1, wxEXPAND, 0);
verticalSizer->Add(horizontalSizer, 1, wxEXPAND|wxALL, 0);
}
root->SetSizer(verticalSizer);
root->Layout();
verticalSizer->SetSizeHints(root);
return wxDialog::ShowModal();
}
bool FileDialog::Show( bool show )
void FileDialog::DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(width), int WXUNUSED(height),
int WXUNUSED(sizeFlags))
{
return wxDialog::Show( show );
}
void FileDialog::DoSetSize(int x, int y, int width, int height, int sizeFlags )
void FileDialog::OnSize(wxSizeEvent&)
{
if (!m_wxwindow)
return;
else
GenericFileDialog::DoSetSize( x, y, width, height, sizeFlags );
// avoid calling DoLayout(), which will set the (wrong) size of
// m_extraControl, its size is managed by GtkFileChooser
}
wxString FileDialog::GetPath() const
{
char *f = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(m_widget));
wxFileName path(wxConvFileName->cMB2WX(f));
g_free(f);
if (!path.HasExt())
{
if (!(m_dialogStyle & FD_NO_ADD_EXTENSION))
{
int filterIndex = GetFilterIndex();
if (filterIndex != -1)
{
wxStringTokenizer tokenizer(m_patterns[filterIndex], wxT(";"));
if (tokenizer.HasMoreTokens())
{
wxString extension = tokenizer.GetNextToken().AfterFirst(wxT('.'));
if (extension.Right(2) == wxT("*"))
{
extension = wxEmptyString;
}
path.SetExt(extension);
}
}
}
}
return path.GetFullPath();
return m_fc.GetPath();
}
void FileDialog::GetFilenames(wxArrayString& files) const
{
GetPaths(files);
for (size_t n = 0; n < files.GetCount(); ++n )
{
wxFileName file(files[n]);
files[n] = file.GetFullName();
}
m_fc.GetFilenames( files );
}
void FileDialog::GetPaths(wxArrayString& paths) const
{
paths.Empty();
if (gtk_file_chooser_get_select_multiple(GTK_FILE_CHOOSER(m_widget)))
{
GSList *gpathsi = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(m_widget));
GSList *gpaths = gpathsi;
while (gpathsi)
{
wxString file(wxConvFileName->cMB2WX((gchar*) gpathsi->data));
paths.Add(file);
g_free(gpathsi->data);
gpathsi = gpathsi->next;
}
g_slist_free(gpaths);
}
else
paths.Add(GetPath());
m_fc.GetPaths( paths );
}
void FileDialog::SetMessage(const wxString& message)
@ -389,119 +504,108 @@ void FileDialog::SetMessage(const wxString& message)
void FileDialog::SetPath(const wxString& path)
{
if (path.empty()) return;
FileDialogBase::SetPath(path);
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(path));
// Don't do anything if no path is specified, in particular don't set the
// path to m_dir below as this would result in opening the dialog in the
// parent directory of this one instead of m_dir itself.
if ( path.empty() )
return;
// we need an absolute path for GTK native chooser so ensure that we have
// it: use the initial directory if it was set or just CWD otherwise (this
// is the default behaviour if m_dir is empty)
wxFileName fn(path);
fn.MakeAbsolute(m_dir);
m_fc.SetPath(fn.GetFullPath());
}
void FileDialog::SetDirectory(const wxString& dir)
{
if (wxDirExists(dir))
{
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(dir));
}
}
FileDialogBase::SetDirectory(dir);
wxString FileDialog::GetDirectory() const
{
return wxConvFileName->cMB2WX(gtk_file_chooser_get_current_folder( GTK_FILE_CHOOSER(m_widget) ) );
m_fc.SetDirectory(dir);
}
void FileDialog::SetFilename(const wxString& name)
{
if (GetWindowStyle() & wxFD_SAVE)
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(name));
FileDialogBase::SetFilename(name);
if (HasFdFlag(wxFD_SAVE))
{
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget), wxGTK_CONV(name));
}
else
SetPath(wxFileName(GetDirectory(), name).GetFullPath());
{
wxString path( GetDirectory() );
if (path.empty())
{
// SetPath() fires an assert if fed other than filepaths
return;
}
SetPath(wxFileName(path, name).GetFullPath());
}
}
wxString FileDialog::GetFilename() const
{
wxFileName name = GetPath();
return name.GetFullName();
wxString currentFilename( m_fc.GetFilename() );
if (currentFilename.empty())
{
// m_fc.GetFilename() will return empty until the dialog has been shown
// in which case use any previously provided value
currentFilename = m_fileName;
}
return currentFilename;
}
void FileDialog::SetWildcard(const wxString& wildCard)
{
// parse filters
wxArrayString wildDescriptions, wildFilters;
if (!wxParseCommonDialogsFilter(wildCard, wildDescriptions, wildFilters))
{
wxFAIL_MSG( wxT("FileDialog::SetWildCard - bad wildcard string") );
}
else
{
// Parsing went fine. Set m_wildCard to be returned by FileDialogBase::GetWildcard
m_wildCard = wildCard;
GtkFileChooser* chooser = GTK_FILE_CHOOSER(m_widget);
// empty current filter list:
GSList* ifilters = gtk_file_chooser_list_filters(chooser);
GSList* filters = ifilters;
while (ifilters)
{
gtk_file_chooser_remove_filter(chooser,GTK_FILE_FILTER(ifilters->data));
ifilters = ifilters->next;
}
g_slist_free(filters);
// add parsed to GtkChooser
for (size_t n = 0; n < wildFilters.GetCount(); ++n)
{
GtkFileFilter* filter = gtk_file_filter_new();
gtk_file_filter_set_name(filter, wxGTK_CONV(wildDescriptions[n]));
m_patterns.Add(wildFilters[n]);
wxStringTokenizer exttok(wildFilters[n], wxT(";"));
while (exttok.HasMoreTokens())
{
wxString token = exttok.GetNextToken();
gtk_file_filter_add_pattern(filter, wxGTK_CONV(token));
}
gtk_file_chooser_add_filter(chooser, filter);
}
// Reset the filter index
SetFilterIndex(0);
}
FileDialogBase::SetWildcard(wildCard);
m_fc.SetWildcard( GetWildcard() );
}
void FileDialog::SetFilterIndex(int filterIndex)
{
gpointer filter;
GtkFileChooser *chooser = GTK_FILE_CHOOSER(m_widget);
GSList *filters = gtk_file_chooser_list_filters(chooser);
filter = g_slist_nth_data(filters, filterIndex);
if (filter != NULL)
{
gtk_file_chooser_set_filter(chooser, GTK_FILE_FILTER(filter));
}
else
{
wxFAIL_MSG( wxT("FileDialog::SetFilterIndex - bad filter index") );
}
g_slist_free(filters);
m_fc.SetFilterIndex( filterIndex);
}
int FileDialog::GetFilterIndex() const
{
GtkFileChooser *chooser = GTK_FILE_CHOOSER(m_widget);
GtkFileFilter *filter = gtk_file_chooser_get_filter(chooser);
GSList *filters = gtk_file_chooser_list_filters(chooser);
gint index = g_slist_index(filters, filter);
g_slist_free(filters);
if (index == -1)
{
wxFAIL_MSG( wxT("FileDialog::GetFilterIndex - bad filter index returned by gtk+") );
return 0;
}
else
return index;
return m_fc.GetFilterIndex();
}
void FileDialog::GTKSelectionChanged(const wxString& filename)
{
m_currentlySelectedFilename = filename;
wxFileCtrlEvent event(wxEVT_FILECTRL_SELECTIONCHANGED, this, GetId());
wxArrayString filenames;
GetFilenames(filenames);
event.SetDirectory(GetDirectory());
event.SetFiles(filenames);
GetEventHandler()->ProcessEvent(event);
}
void FileDialog::GTKFolderChanged()
{
wxFileCtrlEvent event(wxEVT_FILECTRL_FOLDERCHANGED, this, GetId());
event.SetDirectory(GetDirectory());
GetEventHandler()->ProcessEvent(event);
}
void FileDialog::GTKFilterChanged()
{
wxFileCtrlEvent event(wxEVT_FILECTRL_FILTERCHANGED, this, GetId());
event.SetFilterIndex(GetFilterIndex());
GetEventHandler()->ProcessEvent(event);
}

View File

@ -1,29 +1,25 @@
//
// Copied from wxWidgets 3.0.2 and modified for Audacity
//
/////////////////////////////////////////////////////////////////////////////
// Name: filedlg.h
// Name: wx/gtk/filedlg.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: FileDialogPrivate.h,v 1.2 2008-05-24 02:57:39 llucius Exp $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
//
// Modified for Audacity to support an additional button on Save dialogs
//
/////////////////////////////////////////////////////////////////////////////
#ifndef _GTK_FILEDIALOGPRIVATE_H_
#define _GTK_FILEDIALOGPRIVATE_H_
#ifndef __FILEDIALOGGTKH__
#define __FILEDIALOGGTKH__
#include "wx/defs.h"
#define GENERIC_FILEDIALOG 1
#include "../generic/FileDialogPrivate.h"
#include <wx/gtk/filectrl.h> // for wxGtkFileChooser
#include <wx/panel.h>
//-------------------------------------------------------------------------
// FileDialog
//-------------------------------------------------------------------------
class FileDialog: public GenericFileDialog
class WXDLLIMPEXP_CORE FileDialog: public FileDialogBase
{
public:
FileDialog() { }
@ -33,14 +29,23 @@ public:
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = 0,
const wxPoint& pos = wxDefaultPosition);
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr);
bool Create(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr);
virtual ~FileDialog();
virtual wxString GetPath() const;
virtual void GetPaths(wxArrayString& paths) const;
virtual wxString GetDirectory() const;
virtual wxString GetFilename() const;
virtual void GetFilenames(wxArrayString& files) const;
virtual int GetFilterIndex() const;
@ -53,29 +58,32 @@ public:
virtual void SetFilterIndex(int filterIndex);
virtual int ShowModal();
virtual bool Show( bool show = true );
//private:
bool m_destroyed_by_delete;
virtual bool SupportsExtraControl() const { return true; }
// Implementation only.
void GTKSelectionChanged(const wxString& filename);
void GTKFolderChanged();
void GTKFilterChanged();
protected:
// override this from wxTLW since the native
// form doesn't have any m_wxwindow
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
virtual void EnableButton(wxString label, fdCallback cb, void *cbdata);
virtual void ClickButton(int index);
private:
void OnFakeOk( wxCommandEvent &event );
void OnSize(wxSizeEvent&);
virtual void AddChildGTK(wxWindowGTK* child);
wxGtkFileChooser m_fc;
DECLARE_DYNAMIC_CLASS(FileDialog)
DECLARE_EVENT_TABLE()
void OnFakeOk( wxCommandEvent &event );
wxString m_buttonlabel;
fdCallback m_callback;
void *m_cbdata;
wxArrayString m_patterns;
};
#endif

View File

@ -1,156 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/private.h
// Purpose: wxGTK private macros, functions &c
// Author: Vadim Zeitlin
// Modified by: Leland Lucius
// Created: 12.03.02
// RCS-ID: $Id: private.h,v 1.3 2008-05-24 02:57:39 llucius Exp $
// Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
//
// Modified for Audacity to support an additional button on Save dialogs
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_PRIVATE_H_
#define _WX_GTK_PRIVATE_H_
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include "wx/event.h"
// fail all version tests if the GTK+ version is so ancient that it doesn't
// even have GTK_CHECK_VERSION
#ifndef GTK_CHECK_VERSION
#define GTK_CHECK_VERSION(a, b, c) 0
#endif
#if defined(__WXGTK20__)
#if wxUSE_UNICODE
#define wxGTK_CONV(s) wxConvUTF8.cWX2MB(s)
#define wxGTK_CONV_BACK(s) wxConvUTF8.cMB2WX(s)
#else
#define wxGTK_CONV(s) wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC(s) )
#define wxGTK_CONV_BACK(s) wxConvLocal.cWC2WX( (wxConvUTF8.cMB2WC( s ) ) )
#endif
#else
#define wxGTK_CONV(s) s.c_str()
#define wxGTK_CONV_BACK(s) s
#endif
// GTK+ 2.0 compatibility define is broken when used from C++ as it
// casts enum to int implicitly
#ifdef __WXGTK20__
#undef gtk_signal_disconnect_by_func
#define gtk_signal_disconnect_by_func(object,func,data) \
gtk_signal_compat_matched((object), (func), (data), \
(GSignalMatchType)(G_SIGNAL_MATCH_FUNC | \
G_SIGNAL_MATCH_DATA), 0)
#endif
// child is not a member of GTK_BUTTON() any more in GTK+ 2.0
#ifdef __WXGTK20__
#define BUTTON_CHILD(w) GTK_BIN((w))->child
#else
#define BUTTON_CHILD(w) GTK_BUTTON((w))->child
#endif
// event_window has disappeared from GtkToggleButton in GTK+ 2.0
#ifdef __WXGTK20__
#define TOGGLE_BUTTON_EVENT_WIN(w) GTK_BUTTON((w))->event_window
#else
#define TOGGLE_BUTTON_EVENT_WIN(w) GTK_TOGGLE_BUTTON((w))->event_window
#endif
// gtk_editable_{copy|cut|paste}_clipboard() had an extra argument under
// previous GTK+ versions but no more
#if defined(__WXGTK20__) || (GTK_MINOR_VERSION > 0)
#define DUMMY_CLIPBOARD_ARG
#else
#define DUMMY_CLIPBOARD_ARG ,0
#endif
// _GtkEditable is now private
#ifdef __WXGTK20__
#define GET_EDITABLE_POS(w) gtk_editable_get_position(GTK_EDITABLE(w))
#define SET_EDITABLE_POS(w, pos) \
gtk_editable_set_position(GTK_EDITABLE(w), (pos))
#else
#define GET_EDITABLE_POS(w) GTK_EDITABLE((w))->current_pos
#define SET_EDITABLE_POS(w, pos) \
GTK_EDITABLE((w))->current_pos = (pos)
#endif
// this GtkNotebook struct field has been renamed
#ifdef __WXGTK20__
#define NOTEBOOK_PANEL(nb) GTK_NOTEBOOK(nb)->event_window
#else
#define NOTEBOOK_PANEL(nb) GTK_NOTEBOOK(nb)->panel
#endif
#ifdef __WXGTK20__
#define SCROLLBAR_CBACK_ARG
#define GET_SCROLL_TYPE(w) GTK_SCROLL_JUMP
#else
#define SCROLLBAR_CBACK_ARG
#define GET_SCROLL_TYPE(w) GTK_RANGE((w))->scroll_type
#endif
// translate a GTK+ scroll type to a wxEventType
inline wxEventType GtkScrollTypeToWx(guint scrollType)
{
wxEventType command;
switch ( scrollType )
{
case GTK_SCROLL_STEP_BACKWARD:
command = wxEVT_SCROLL_LINEUP;
break;
case GTK_SCROLL_STEP_FORWARD:
command = wxEVT_SCROLL_LINEDOWN;
break;
case GTK_SCROLL_PAGE_BACKWARD:
command = wxEVT_SCROLL_PAGEUP;
break;
case GTK_SCROLL_PAGE_FORWARD:
command = wxEVT_SCROLL_PAGEDOWN;
break;
default:
command = wxEVT_SCROLL_THUMBTRACK;
}
return command;
}
inline wxEventType GtkScrollWinTypeToWx(guint scrollType)
{
// GtkScrollTypeToWx() returns SCROLL_XXX, not SCROLLWIN_XXX as we need
return GtkScrollTypeToWx(scrollType) +
wxEVT_SCROLLWIN_TOP - wxEVT_SCROLL_TOP;
}
// Needed for implementing e.g. combobox on wxGTK within a modal dialog.
void wxAddGrab(wxWindow* window);
void wxRemoveGrab(wxWindow* window);
#ifdef __WXGTK20__
// Escapes string so that it is valid Pango markup XML string:
wxString wxEscapeStringForPangoMarkup(const wxString& str);
#endif
// The declaration for gtk_icon_size_lookup was accidentally ifdefed out in
// GTK+ 2.1.0 which Sun seem to have shipped with some versions of JDS
// for Solaris 9 x86.
#ifdef NEED_GTK_ICON_SIZE_LOOKUP
extern "C" gboolean gtk_icon_size_lookup (GtkIconSize size,
gint *width,
gint *height);
#endif
#endif // _WX_GTK_PRIVATE_H_

View File

@ -12,8 +12,8 @@
//
/////////////////////////////////////////////////////////////////////////////
#ifndef _FILEDIALOGMSW_H_
#define _FILEDIALOGMSW_H_
#ifndef _WIN_FILEDIALOGPRIVATE_H_
#define _WIN_FILEDIALOGPRIVATE_H_
#include <windows.h>
@ -90,9 +90,6 @@ private:
wxChar *m_NameBuf;
int m_NameBufLen;
fdCallback m_callback;
void *m_cbdata;
HWND mParentDlg;
HWND mChildDlg;
WNDPROC mParentProc;

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -14,7 +14,17 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -77,9 +87,6 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(srcdir)/dist-libsoxr.mk $(srcdir)/dist-libvamp.mk \
$(srcdir)/dist-portaudio.mk $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am
@USE_LOCAL_EXPAT_TRUE@am__append_1 = expat
@USE_LOCAL_LIBID3TAG_TRUE@am__append_2 = libid3tag
@USE_LOCAL_LIBMAD_TRUE@am__append_3 = libmad
@ -139,6 +146,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/configwin.h \
$(top_builddir)/src/configunix.h
@ -198,6 +206,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/dist-libsoxr.mk \
$(srcdir)/dist-libvamp.mk $(srcdir)/dist-portaudio.mk
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@ -963,7 +973,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/di
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib-src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign lib-src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@ -972,7 +981,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(srcdir)/dist-libsoxr.mk $(srcdir)/dist-libvamp.mk $(srcdir)/dist-portaudio.mk:
$(srcdir)/dist-libsoxr.mk $(srcdir)/dist-libvamp.mk $(srcdir)/dist-portaudio.mk $(am__empty):
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@ -1240,6 +1249,8 @@ uninstall-am:
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Overwrite install* targets from automake. We do not want to install anything
# from the lib-src libraries, because we statically link these libraries.

View File

@ -2347,7 +2347,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
am__api_version='1.14'
am__api_version='1.15'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@ -2519,8 +2519,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
@ -2539,7 +2539,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@ -2867,8 +2867,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@ -2926,6 +2926,7 @@ END
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
@ -16566,8 +16567,10 @@ if test "x$cpp_does_wall" = "xyes" ; then
fi
# Extract the first word of "wx-config", so it can be a program name with args.
set dummy wx-config; ac_word=$2
for ac_prog in wx-config wx-config-3.0
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_WX_CONFIG+:} false; then :
@ -16594,7 +16597,6 @@ done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_WX_CONFIG" && ac_cv_path_WX_CONFIG="no"
;;
esac
fi
@ -16608,6 +16610,10 @@ $as_echo "no" >&6; }
fi
test -n "$WX_CONFIG" && break
done
test -n "$WX_CONFIG" || WX_CONFIG="no"
if [ "$WX_CONFIG" = "no" ] ; then
as_fn_error $? "\"Could not find wx-config: is wxWidgets installed? is wx-config in your path?\"" "$LINENO" 5
fi

View File

@ -108,7 +108,7 @@ fi
dnl --- check for required libraries ---
dnl wxWidgets -- we assume that if wx-config is found, wxWidgets is successfully installed.
AC_PATH_PROG(WX_CONFIG, wx-config, no, $PATH:/usr/local/bin )
AC_PATH_PROGS(WX_CONFIG, wx-config wx-config-3.0, no, $PATH:/usr/local/bin )
if [[ "$WX_CONFIG" = "no" ]] ; then
AC_MSG_ERROR("Could not find wx-config: is wxWidgets installed? is wx-config in your path?")
fi

View File

@ -2296,7 +2296,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
am__api_version='1.14'
am__api_version='1.15'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@ -2468,8 +2468,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
@ -2488,7 +2488,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@ -2816,8 +2816,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@ -2875,6 +2875,7 @@ END
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
@ -15454,8 +15455,10 @@ else
fi
# Extract the first word of "wx-config", so it can be a program name with args.
set dummy wx-config; ac_word=$2
for ac_prog in wx-config wx-config-3.0
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_WX_CONFIG+:} false; then :
@ -15482,7 +15485,6 @@ done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_WX_CONFIG" && ac_cv_path_WX_CONFIG="no"
;;
esac
fi
@ -15496,6 +15498,10 @@ $as_echo "no" >&6; }
fi
test -n "$WX_CONFIG" && break
done
test -n "$WX_CONFIG" || WX_CONFIG="no"
if [ "$WX_CONFIG" = "no" ] ; then
as_fn_error $? "\"Could not find wx-config: is wxWidgets installed? is wx-config in your path?\"" "$LINENO" 5
fi

View File

@ -53,7 +53,7 @@ AC_ARG_WITH(wx-config,
wx_config="")
dnl wxWidgets -- we assume that if wx-config is found, wxWidgets is successfully installed.
AC_PATH_PROG(WX_CONFIG, wx-config, no, $PATH:/usr/local/bin )
AC_PATH_PROGS(WX_CONFIG, wx-config wx-config-3.0, no, $PATH:/usr/local/bin )
if [[ "$WX_CONFIG" = "no" ]] ; then
AC_MSG_ERROR("Could not find wx-config: is wxWidgets installed? is wx-config in your path?")
fi

View File

@ -431,7 +431,7 @@
2800FE370FF32566005CA9E5 /* MidiIOPrefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2800FE350FF32566005CA9E5 /* MidiIOPrefs.cpp */; };
2801127B1943EE0E00D98A16 /* HelpSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 280112791943EE0E00D98A16 /* HelpSystem.cpp */; };
2801A6460BF9268700648258 /* ImportQT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2801A6430BF9268700648258 /* ImportQT.cpp */; };
2806EF7A1B32532A00D1AB9A /* FileDialog.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2806EF791B32532A00D1AB9A /* FileDialog.mm */; };
2806EF7A1B32532A00D1AB9A /* FileDialogPrivate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2806EF791B32532A00D1AB9A /* FileDialogPrivate.mm */; };
280828550A75E0D0000002EF /* LabelDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 280828530A75E0D0000002EF /* LabelDialog.cpp */; };
2808285A0A75E0EA000002EF /* Grid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 280828580A75E0EA000002EF /* Grid.cpp */; };
2809C4B80BCB7E560006010F /* FileIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2809C4B60BCB7E560006010F /* FileIO.cpp */; };
@ -2044,8 +2044,8 @@
2803C8B519F35AA000278526 /* PluginManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginManager.h; sourceTree = "<group>"; };
2803C8B619F35AA000278526 /* TrackPanelListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackPanelListener.h; sourceTree = "<group>"; };
2803C8BB19F35B4900278526 /* SelectionBarListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionBarListener.h; sourceTree = "<group>"; };
2806EF781B32532A00D1AB9A /* FileDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileDialog.h; sourceTree = "<group>"; };
2806EF791B32532A00D1AB9A /* FileDialog.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileDialog.mm; sourceTree = "<group>"; };
2806EF781B32532A00D1AB9A /* FileDialogPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileDialogPrivate.h; sourceTree = "<group>"; };
2806EF791B32532A00D1AB9A /* FileDialogPrivate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileDialogPrivate.mm; sourceTree = "<group>"; };
2808025C0F32C11F0021001D /* dspprims.lsp */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = dspprims.lsp; path = ../nyquist/dspprims.lsp; sourceTree = SOURCE_ROOT; };
2808025D0F32C11F0021001D /* envelopes.lsp */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = envelopes.lsp; path = ../nyquist/envelopes.lsp; sourceTree = SOURCE_ROOT; };
2808025E0F32C11F0021001D /* equalizer.lsp */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = equalizer.lsp; path = ../nyquist/equalizer.lsp; sourceTree = SOURCE_ROOT; };
@ -5485,8 +5485,8 @@
28F8BBDA0BC5FA6600CDF16E /* mac */ = {
isa = PBXGroup;
children = (
2806EF781B32532A00D1AB9A /* FileDialog.h */,
2806EF791B32532A00D1AB9A /* FileDialog.mm */,
2806EF781B32532A00D1AB9A /* FileDialogPrivate.h */,
2806EF791B32532A00D1AB9A /* FileDialogPrivate.mm */,
);
path = mac;
sourceTree = "<group>";
@ -7385,7 +7385,7 @@
1790B18109883BFD008A330A /* DirectoriesPrefs.cpp in Sources */,
1790B18309883BFD008A330A /* GUIPrefs.cpp in Sources */,
1790B18409883BFD008A330A /* KeyConfigPrefs.cpp in Sources */,
2806EF7A1B32532A00D1AB9A /* FileDialog.mm in Sources */,
2806EF7A1B32532A00D1AB9A /* FileDialogPrivate.mm in Sources */,
1790B18509883BFD008A330A /* MousePrefs.cpp in Sources */,
1790B18609883BFD008A330A /* PrefsDialog.cpp in Sources */,
1790B18709883BFD008A330A /* QualityPrefs.cpp in Sources */,

View File

@ -247,7 +247,12 @@ void BenchmarkDialog::OnSave( wxCommandEvent & WXUNUSED(event))
wxString fName = wxT("benchmark.txt");
fName = FileSelector(wxT("Export Benchmark Data As:"),
wxEmptyString, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
wxEmptyString,
fName,
wxT("txt"),
wxT("*.txt"),
wxFD_SAVE | wxRESIZE_BORDER,
this);
if (fName == wxT(""))
return;

View File

@ -1,105 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
Audacity(R) is copyright (c) 1999-2008 Audacity Team.
License: GPL v2. See License.txt.
CaptureEvents.h
Created by Al Dimond, Oct. 2009 (from code by someone else)
******************************************************************//**
\class CaptureEvents
\brief RAII-style class to work around a bug in wxGTK 2.8.9-?
*//*******************************************************************/
#include <wx/version.h>
#include "Audacity.h"
#include "CaptureEvents.h"
#if defined(__WXGTK__) && defined(HAVE_GTK) && !wxCHECK_VERSION(3, 0, 0)
// As of wxGTK 2.8.9, there is a problem in the wxClipboard class that
// allows recursive event processing. This problem has been corrected
// by wxWidgets 2.9+. However, this han't made it into a release yet,
// so we have to work around it.
//
// This is done by pulling/merging in some code from wx29 and creating
// the following class to capture events while accessing the clipboard
// to prevent the asynchronous clipboard access from causing recursive
// event processing.
#include <wx/app.h>
#include <wx/dynarray.h>
#include <wx/log.h>
#include <gtk/gtk.h>
extern GtkWidget *wxGetRootWindow();
static void main_do_event(GdkEvent *event, wxArrayPtrVoid *queue)
{
switch (event->type)
{
case GDK_NOTHING:
// Ignore it
break;
case GDK_SELECTION_REQUEST:
case GDK_SELECTION_NOTIFY:
case GDK_SELECTION_CLEAR:
#if GTK_CHECK_VERSION(2,6,0)
case GDK_OWNER_CHANGE:
#endif
// process it now
gtk_main_do_event(event);
break;
default:
// process it later (but make a copy; the caller will free the event pointer)
queue->Add(gdk_event_copy(event));
break;
}
// don't allow idle callbacks while we're active
wxTheApp->SuspendIdleCallback();
return;
}
CaptureEvents::CaptureEvents()
{
#if wxUSE_LOG
// disable log flushing from here because a call to wxTheApp->Yield() shouldn't
// normally result in message boxes popping up &c
wxLog::Suspend();
#endif
// temporarily replace the global GDK event handler with our function
gdk_event_handler_set((GdkEventFunc)main_do_event, &queue, NULL);
// temporarily suspend idle callbacks
wxTheApp->SuspendIdleCallback();
}
CaptureEvents::~CaptureEvents()
{
gdk_event_handler_set((GdkEventFunc)gtk_main_do_event, NULL, NULL);
// put all unprocessed GDK events back in the queue
GdkDisplay* disp = gtk_widget_get_display(wxGetRootWindow());
size_t cnt = queue.GetCount();
for (size_t i = 0; i < cnt; i++) {
GdkEvent* event = (GdkEvent*)queue[i];
// NOTE: gdk_display_put_event makes a copy of the event passed to it
gdk_display_put_event(disp, event);
gdk_event_free(event);
}
#if wxUSE_LOG
// let the logs be flashed again
wxLog::Resume();
#endif
}
#endif

View File

@ -1,45 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
Audacity(R) is copyright (c) 1999-2008 Audacity Team.
License: GPL v2. See License.txt.
CaptureEvents.h
Created by Al Dimond, Oct. 2009 (from code by someone else)
******************************************************************//**
\class CaptureEvents
\brief RAII-style class to work around a bug in wxGTK 2.8.9-?
*//*******************************************************************/
#ifndef _AUDACITY_CAPTURE_EVENTS_
#define _AUDACITY_CAPTURE_EVENTS_
#if defined(__WXGTK__) && defined(HAVE_GTK)
// As of wxGTK 2.8.9, there is a problem in the wxClipboard class that
// allows recursive event processing. This problem has been corrected
// by wxWidgets 2.9+. However, this han't made it into a release yet,
// so we have to work around it.
//
// This is done by pulling/merging in some code from wx29 and creating
// the following class to capture events while accessing the clipboard
// to prevent the asynchronous clipboard access from causing recursive
// event processing.
#include <wx/dynarray.h>
class CaptureEvents
{
public:
CaptureEvents();
virtual ~CaptureEvents();
private:
wxArrayPtrVoid queue;
};
#endif
#endif

View File

@ -42,15 +42,6 @@ and in the spectrogram spectral selection.
#include "Audacity.h"
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include <wx/brush.h>
#include <wx/button.h>
#include <wx/choice.h>
@ -84,10 +75,10 @@ and in the spectrogram spectral selection.
#include "FileDialog.h"
#if defined(__WXGTK__)
#define GSocket GSocketHack
#include <gtk/gtk.h>
#endif
//#if defined(__WXGTK__)
//#define GSocket GSocketHack
//#include <gtk/gtk.h>
//#endif
DEFINE_EVENT_TYPE(EVT_FREQWINDOW_RECALC);
@ -516,7 +507,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
//
// I guess the only way round it would be to handle key actions
// ourselves, but we'll leave that for a future date.
gtk_widget_set_can_focus(mPanScroller->m_widget, true);
// gtk_widget_set_can_focus(mPanScroller->m_widget, true);
#endif
}

View File

@ -29,7 +29,6 @@
#include <wx/statusbr.h>
#include <wx/textctrl.h>
#include <wx/utils.h>
#include "widgets/Ruler.h"
class wxStatusBar;

View File

@ -59,7 +59,6 @@ for drawing different aspects of the label and its text box.
#include "TrackArtist.h"
#include "commands/CommandManager.h"
#include "CaptureEvents.h"
#include "effects/TimeWarper.h"
wxFont LabelTrack::msFont;
@ -974,9 +973,6 @@ bool LabelTrack::CutSelectedText()
// copy data onto clipboard
if (wxTheClipboard->Open()) {
#if defined(__WXGTK__) && defined(HAVE_GTK) && !wxCHECK_VERSION(3, 0, 0)
CaptureEvents capture;
#endif
wxTheClipboard->SetData(new wxTextDataObject(data));
wxTheClipboard->Close();
}
@ -1009,9 +1005,6 @@ bool LabelTrack::CopySelectedText()
// copy the data on clipboard
if (wxTheClipboard->Open()) {
#if defined(__WXGTK__) && defined(HAVE_GTK) && !wxCHECK_VERSION(3, 0, 0)
CaptureEvents capture;
#endif
wxTheClipboard->SetData(new wxTextDataObject(data));
wxTheClipboard->Close();
}
@ -1035,9 +1028,6 @@ bool LabelTrack::PasteSelectedText(double sel0, double sel1)
// if text data is available
if (IsTextClipSupported()) {
if (wxTheClipboard->Open()) {
#if defined(__WXGTK__) && defined(HAVE_GTK) && !wxCHECK_VERSION(3, 0, 0)
CaptureEvents capture;
#endif
wxTextDataObject data;
wxTheClipboard->GetData(data);
wxTheClipboard->Close();
@ -1092,10 +1082,6 @@ bool LabelTrack::PasteSelectedText(double sel0, double sel1)
/// @return true if the text data is available in the clipboard, false otherwise
bool LabelTrack::IsTextClipSupported()
{
#if defined(__WXGTK__) && defined(HAVE_GTK) && !wxCHECK_VERSION(3, 0, 0)
CaptureEvents capture;
#endif
#if defined(__WXGTK__)
// AWD: work-around for bug 154: do not call wxClipboard::IsSupported()
// when handling a keyboard event

View File

@ -114,8 +114,6 @@ audacity_SOURCES = \
BatchProcessDialog.h \
Benchmark.cpp \
Benchmark.h \
CaptureEvents.cpp \
CaptureEvents.h \
Dependencies.cpp \
Dependencies.h \
DeviceChange.cpp \

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -16,7 +16,17 @@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -186,9 +196,6 @@ bin_PROGRAMS = audacity$(EXEEXT)
@USE_VST_TRUE@ $(NULL)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/configtemplate.h $(srcdir)/audacity.desktop.in \
$(top_srcdir)/autotools/depcomp $(dist_mime_DATA)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
@ -229,6 +236,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_mime_DATA) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = configwin.h configunix.h
CONFIG_CLEAN_FILES = audacity.desktop
@ -277,13 +286,12 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
AutoRecovery.cpp AutoRecovery.h BatchCommandDialog.cpp \
BatchCommandDialog.h BatchCommands.cpp BatchCommands.h \
BatchProcessDialog.cpp BatchProcessDialog.h Benchmark.cpp \
Benchmark.h CaptureEvents.cpp CaptureEvents.h Dependencies.cpp \
Dependencies.h DeviceChange.cpp DeviceChange.h \
DeviceManager.cpp DeviceManager.h Diags.cpp Diags.h \
Envelope.cpp Envelope.h Experimental.h FFmpeg.cpp FFmpeg.h \
FFT.cpp FFT.h FileIO.cpp FileIO.h FileNames.cpp FileNames.h \
float_cast.h FreqWindow.cpp FreqWindow.h HelpText.cpp \
HelpText.h HistoryWindow.cpp HistoryWindow.h \
Benchmark.h Dependencies.cpp Dependencies.h DeviceChange.cpp \
DeviceChange.h DeviceManager.cpp DeviceManager.h Diags.cpp \
Diags.h Envelope.cpp Envelope.h Experimental.h FFmpeg.cpp \
FFmpeg.h FFT.cpp FFT.h FileIO.cpp FileIO.h FileNames.cpp \
FileNames.h float_cast.h FreqWindow.cpp FreqWindow.h \
HelpText.cpp HelpText.h HistoryWindow.cpp HistoryWindow.h \
ImageManipulation.cpp ImageManipulation.h InterpolateAudio.cpp \
InterpolateAudio.h LabelDialog.cpp LabelDialog.h \
LabelTrack.cpp LabelTrack.h LangChoice.cpp LangChoice.h \
@ -513,8 +521,7 @@ am_audacity_OBJECTS = $(am__objects_1) audacity-AboutDialog.$(OBJEXT) \
audacity-BatchCommandDialog.$(OBJEXT) \
audacity-BatchCommands.$(OBJEXT) \
audacity-BatchProcessDialog.$(OBJEXT) \
audacity-Benchmark.$(OBJEXT) audacity-CaptureEvents.$(OBJEXT) \
audacity-Dependencies.$(OBJEXT) \
audacity-Benchmark.$(OBJEXT) audacity-Dependencies.$(OBJEXT) \
audacity-DeviceChange.$(OBJEXT) \
audacity-DeviceManager.$(OBJEXT) audacity-Diags.$(OBJEXT) \
audacity-Envelope.$(OBJEXT) audacity-FFmpeg.$(OBJEXT) \
@ -845,6 +852,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/audacity.desktop.in \
$(srcdir)/configtemplate.h $(top_srcdir)/autotools/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -1138,13 +1147,12 @@ audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.cpp \
AutoRecovery.cpp AutoRecovery.h BatchCommandDialog.cpp \
BatchCommandDialog.h BatchCommands.cpp BatchCommands.h \
BatchProcessDialog.cpp BatchProcessDialog.h Benchmark.cpp \
Benchmark.h CaptureEvents.cpp CaptureEvents.h Dependencies.cpp \
Dependencies.h DeviceChange.cpp DeviceChange.h \
DeviceManager.cpp DeviceManager.h Diags.cpp Diags.h \
Envelope.cpp Envelope.h Experimental.h FFmpeg.cpp FFmpeg.h \
FFT.cpp FFT.h FileIO.cpp FileIO.h FileNames.cpp FileNames.h \
float_cast.h FreqWindow.cpp FreqWindow.h HelpText.cpp \
HelpText.h HistoryWindow.cpp HistoryWindow.h \
Benchmark.h Dependencies.cpp Dependencies.h DeviceChange.cpp \
DeviceChange.h DeviceManager.cpp DeviceManager.h Diags.cpp \
Diags.h Envelope.cpp Envelope.h Experimental.h FFmpeg.cpp \
FFmpeg.h FFT.cpp FFT.h FileIO.cpp FileIO.h FileNames.cpp \
FileNames.h float_cast.h FreqWindow.cpp FreqWindow.h \
HelpText.cpp HelpText.h HistoryWindow.cpp HistoryWindow.h \
ImageManipulation.cpp ImageManipulation.h InterpolateAudio.cpp \
InterpolateAudio.h LabelDialog.cpp LabelDialog.h \
LabelTrack.cpp LabelTrack.h LangChoice.cpp LangChoice.h \
@ -1346,7 +1354,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@ -1964,7 +1971,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-BatchProcessDialog.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-Benchmark.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-BlockFile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-CaptureEvents.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-Dependencies.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-DeviceChange.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-DeviceManager.Po@am__quote@
@ -2728,20 +2734,6 @@ audacity-Benchmark.obj: Benchmark.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-Benchmark.obj `if test -f 'Benchmark.cpp'; then $(CYGPATH_W) 'Benchmark.cpp'; else $(CYGPATH_W) '$(srcdir)/Benchmark.cpp'; fi`
audacity-CaptureEvents.o: CaptureEvents.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-CaptureEvents.o -MD -MP -MF $(DEPDIR)/audacity-CaptureEvents.Tpo -c -o audacity-CaptureEvents.o `test -f 'CaptureEvents.cpp' || echo '$(srcdir)/'`CaptureEvents.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-CaptureEvents.Tpo $(DEPDIR)/audacity-CaptureEvents.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CaptureEvents.cpp' object='audacity-CaptureEvents.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-CaptureEvents.o `test -f 'CaptureEvents.cpp' || echo '$(srcdir)/'`CaptureEvents.cpp
audacity-CaptureEvents.obj: CaptureEvents.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-CaptureEvents.obj -MD -MP -MF $(DEPDIR)/audacity-CaptureEvents.Tpo -c -o audacity-CaptureEvents.obj `if test -f 'CaptureEvents.cpp'; then $(CYGPATH_W) 'CaptureEvents.cpp'; else $(CYGPATH_W) '$(srcdir)/CaptureEvents.cpp'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-CaptureEvents.Tpo $(DEPDIR)/audacity-CaptureEvents.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CaptureEvents.cpp' object='audacity-CaptureEvents.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-CaptureEvents.obj `if test -f 'CaptureEvents.cpp'; then $(CYGPATH_W) 'CaptureEvents.cpp'; else $(CYGPATH_W) '$(srcdir)/CaptureEvents.cpp'; fi`
audacity-Dependencies.o: Dependencies.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-Dependencies.o -MD -MP -MF $(DEPDIR)/audacity-Dependencies.Tpo -c -o audacity-Dependencies.o `test -f 'Dependencies.cpp' || echo '$(srcdir)/'`Dependencies.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-Dependencies.Tpo $(DEPDIR)/audacity-Dependencies.Po
@ -6269,6 +6261,8 @@ uninstall-am: uninstall-binPROGRAMS uninstall-desktopDATA \
tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-desktopDATA uninstall-dist_mimeDATA
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -117,7 +117,6 @@ simplifies construction of menu items.
#include "widgets/HelpSystem.h"
#include "DeviceManager.h"
#include "CaptureEvents.h"
#include "Snap.h"
#if defined(EXPERIMENTAL_CRASH_REPORT)

View File

@ -160,8 +160,6 @@ scroll information. It also has some status flags.
#include "commands/Command.h"
#include "commands/CommandType.h"
#include "CaptureEvents.h"
#include "../images/AudacityLogoAlpha.xpm"
TrackList *AudacityProject::msClipboard = new TrackList();

View File

@ -2561,7 +2561,7 @@ constSamplePtr WaveTrackCache::Get(sampleFormat format,
const sampleCount len0 = mPTrack->GetBestBlockSize(start0);
wxASSERT(len0 <= mBufferSize);
if (!mPTrack->Get(samplePtr(mBuffers[0].data), floatSample, start0, len0))
return false;
return 0;
mBuffers[0].start = start0;
mBuffers[0].len = len0;
if (!fillSecond &&
@ -2587,7 +2587,7 @@ constSamplePtr WaveTrackCache::Get(sampleFormat format,
const sampleCount len1 = mPTrack->GetBestBlockSize(start1);
wxASSERT(len1 <= mBufferSize);
if (!mPTrack->Get(samplePtr(mBuffers[1].data), floatSample, start1, len1))
return false;
return 0;
mBuffers[1].start = start1;
mBuffers[1].len = len1;
mNValidBuffers = 2;
@ -2637,7 +2637,7 @@ constSamplePtr WaveTrackCache::Get(sampleFormat format,
// Very big request!
// Fall back to direct fetch
if (!mPTrack->Get(buffer, format, start, remaining))
return false;
return 0;
}
return mOverlapBuffer.ptr();

View File

@ -464,7 +464,12 @@ void ContrastDialog::OnExport(wxCommandEvent & WXUNUSED(event))
wxString fName = wxT("contrast.txt");
fName = FileSelector(_("Export Contrast Result As:"),
wxEmptyString, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
wxEmptyString,
fName,
wxT("txt"),
wxT("*.txt"),
wxFD_SAVE | wxRESIZE_BORDER,
this);
if (fName == wxT(""))
return;

View File

@ -220,7 +220,7 @@ sampleCount EffectReverb::ProcessBlock(float **inBlock, float **outBlock, sample
while (remaining)
{
size_t len = min((size_t) remaining, (size_t) BLOCK);
sampleCount len = wxMin(remaining, BLOCK);
for (int c = 0; c < mNumChans; c++)
{
// Write the input samples to the reverb fifo. Returned value is the address of the
@ -311,7 +311,7 @@ wxArrayString EffectReverb::GetFactoryPresets()
{
wxArrayString names;
for (int i = 0; i < WXSIZEOF(FactoryPresets); i++)
for (size_t i = 0; i < WXSIZEOF(FactoryPresets); i++)
{
names.Add(wxGetTranslation(FactoryPresets[i].name));
}

View File

@ -46,13 +46,8 @@
#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
#if defined(__WXGTK__)
#if wxCHECK_VERSION(3, 0, 0)
#include <gtk/gtk.h>
#include "win_gtk.h"
#else
#include <wx/gtk/win_gtk.h>
#include <gtk/gtk.h>
#endif
#endif
#if defined(__WXMSW__)
@ -1489,7 +1484,7 @@ bool LV2Effect::BuildFancy()
//wxWindow *mContainer = mParent;
#if defined(__WXGTK__)
// Make sure the parent has a window
if (!GTK_WIDGET(mContainer->m_wxwindow)->window)
if (!gtk_widget_get_window(GTK_WIDGET(mContainer->m_wxwindow)))
{
gtk_widget_realize(GTK_WIDGET(mContainer->m_wxwindow));
}
@ -1545,7 +1540,6 @@ bool LV2Effect::BuildFancy()
gtk_widget_set_size_request(widget, 1, 1);
gtk_widget_set_size_request(widget, sz.width, sz.height);
#if wxCHECK_VERSION(3, 0, 0)
wxPizza *pizza = WX_PIZZA(mContainer->m_wxwindow);
pizza->put(widget,
0, //gtk_pizza_get_xoffset(pizza),
@ -1553,16 +1547,6 @@ bool LV2Effect::BuildFancy()
sz.width,
sz.height);
gtk_widget_show_all(GTK_WIDGET(pizza));
#else
GtkPizza *pizza = GTK_PIZZA(mContainer->m_wxwindow);
gtk_pizza_put(pizza,
widget,
0, //gtk_pizza_get_xoffset(pizza),
0, //gtk_pizza_get_yoffset(pizza),
sz.width,
sz.height);
gtk_widget_show_all(GTK_WIDGET(pizza));
#endif
si->SetMinSize(wxSize(sz.width, sz.height));
#elif defined(__WXMSW__)
HWND widget = (HWND) suil_instance_get_widget(mSuilInstance);

View File

@ -28,13 +28,6 @@
*//********************************************************************/
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/window.h>
#endif
#include <wx/dynarray.h>
#include <wx/file.h>
#include <wx/filename.h>
@ -48,6 +41,7 @@
#include <wx/textctrl.h>
#include <wx/timer.h>
#include <wx/dcmemory.h>
#include <wx/window.h>
#include "Export.h"
#include "ExportPCM.h"
@ -932,6 +926,11 @@ void Exporter::CreateUserPane(wxWindow *parent)
void Exporter::OnFilterChanged(wxFileCtrlEvent & evt)
{
int index = evt.GetFilterIndex();
printf("index = %d\n", index);
if (index < 0 || index >= (int) mPages.GetCount())
{
return;
}
if (mActivePage)
{

View File

@ -75,8 +75,8 @@ END_EVENT_TABLE()
KeyConfigPrefs::KeyConfigPrefs(wxWindow * parent)
: PrefsPanel(parent, _("Keyboard")),
mView(NULL),
mFilter(NULL),
mKey(NULL),
mFilter(NULL),
mFilterTimer(this, FilterTimerID),
mFilterPending(false)
{

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -14,7 +14,17 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@ -79,9 +89,6 @@ build_triplet = @build@
host_triplet = @host@
check_PROGRAMS = SequenceTest$(EXEEXT) SimpleBlockFileTest$(EXEEXT)
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/autotools/depcomp \
$(top_srcdir)/autotools/test-driver
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
@ -122,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/configwin.h \
$(top_builddir)/src/configunix.h
@ -405,6 +413,9 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/autotools/test-driver
TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/autotools/depcomp \
$(top_srcdir)/autotools/test-driver
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -645,7 +656,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign tests/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@ -830,7 +840,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
if test -n "$$am__remaking_logs"; then \
echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
"recursion detected" >&2; \
else \
elif test -n "$$redo_logs"; then \
am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
fi; \
if $(am__make_dryrun); then :; else \
@ -1126,6 +1136,8 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
recheck tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.