initial commit

Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
2025-10-31 23:37:30 +01:00
commit 7228269764
9653 changed files with 4034514 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
all:
cd src; $(MAKE)
clean:
cd src; $(MAKE) clean

View File

@@ -0,0 +1,51 @@
wxWidgets Controls Screenshot Generator
=======================================
Author: Utensil Candel (Email: UtensilCandel at GMail dot com)
Licence: wxWindows licence
Thanks: Francesco Montorsi, Bryan Petty, Auria, Jorg and wxForum
This utility is developed to automatically generate screenshots of the wxWidgets
controls for use in wxWidgets documentation.
The main part of the GUI (guiframe.h/guiframe.cpp) was generated with wxFormBuilder
(http://wxformbuilder.org/), a powerful cross-platform open-source RAD tool. Now its
trace is removed so we can maintain the code without using it.
===User Guide: How To Use==
The screenshots will be generated under sub-directory "screenshots" silently.
Please monitor this folder before taking screenshots using "File->Open screenshots folder".
1) The menu "Capture->Full screen" can take a screeshot for the fullscreen. It's designed
for testing purpose only.
2) The menu "Capture->Regions<Begin>" and "Capture->Regions<End>" was the semi-auto part,
and now it's deprecated and will be removed soon.
3) Finally the full-auto mode: "Capture->Capture All" or Ctrl+Alt+A, follow the instructions
and all the screenshots will be generated correctly under the subdirectory "screenshots".
==Developer Guide: How To Add More Controls==
(Coming soon)
==To-do List==
1) Remove wxAuiNoteBook related lagacy codes, which is no longer useful;
2) Refactor the GUI code, which was generated by wxFormBuilder, but it's messy for human to
maintain;
3) Remove the class CtrlMaskOut since semi-auto part of this utility is no longer needed.
4) Clearify the interface of class AutoCaptureMechanism and document how to add a new control
that needs to take screenshots, and how to adjust it to avoid bugs in wxRTTI system and
wxWindow::GetScreenRect();
5) Make this utility easier to configure;
6) Add test functionality to confirm bugs in wxRTTI system and wxWindow::GetScreenRect().

View File

@@ -0,0 +1,272 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.13 (http://www.bakefile.org)
# Do not modify, all changes will be overwritten!
# =========================================================================
@MAKE_SET@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
INSTALL = @INSTALL@
EXEEXT = @EXEEXT@
WINDRES = @WINDRES@
STRIP = @STRIP@
NM = @NM@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DIR = @INSTALL_DIR@
BK_DEPS = @BK_DEPS@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
bindir = @bindir@
LIBS = @LIBS@
LDFLAGS_GUI = @LDFLAGS_GUI@
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
USE_DPI_AWARE_MANIFEST = @USE_DPI_AWARE_MANIFEST@
WX_LIB_FLAVOUR = @WX_LIB_FLAVOUR@
TOOLKIT = @TOOLKIT@
TOOLKIT_LOWERCASE = @TOOLKIT_LOWERCASE@
TOOLKIT_VERSION = @TOOLKIT_VERSION@
TOOLCHAIN_FULLNAME = @TOOLCHAIN_FULLNAME@
EXTRALIBS = @EXTRALIBS@
EXTRALIBS_XML = @EXTRALIBS_XML@
EXTRALIBS_HTML = @EXTRALIBS_HTML@
EXTRALIBS_GUI = @EXTRALIBS_GUI@
WX_CPPFLAGS = @WX_CPPFLAGS@
WX_CXXFLAGS = @WX_CXXFLAGS@
WX_LDFLAGS = @WX_LDFLAGS@
HOST_SUFFIX = @HOST_SUFFIX@
DYLIB_RPATH_FLAG = @DYLIB_RPATH_FLAG@
HEADER_PAD_OPTION = @HEADER_PAD_OPTION@
wx_top_builddir = @wx_top_builddir@
### Variables: ###
DESTDIR =
WX_RELEASE = 3.3
WX_VERSION = $(WX_RELEASE).1
LIBDIRNAME = $(wx_top_builddir)/lib
SCREENSHOTGEN_CXXFLAGS = $(WX_CPPFLAGS) -D__WX$(TOOLKIT)__ \
$(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \
$(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) -I$(srcdir) $(__DLLFLAG_p) \
-I$(srcdir)/../../../samples $(WX_CXXFLAGS) $(CPPFLAGS) $(CXXFLAGS)
SCREENSHOTGEN_OBJECTS = \
screenshotgen_screenshot_app.o \
screenshotgen_screenshot_main.o \
screenshotgen_guiframe.o \
screenshotgen_customcombo.o \
screenshotgen_autocapture.o \
$(__screenshotgen___win32rc)
### Conditionally set variables: ###
@COND_DEPS_TRACKING_0@CXXC = $(CXX)
@COND_DEPS_TRACKING_1@CXXC = $(BK_DEPS) $(CXX)
@COND_USE_GUI_0@PORTNAME = base
@COND_USE_GUI_1@PORTNAME = $(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION)
@COND_TOOLKIT_MAC@WXBASEPORT = _carbon
@COND_BUILD_debug@WXDEBUGFLAG = d
@COND_WXUNIV_1@WXUNIVNAME = univ
@COND_MONOLITHIC_0@EXTRALIBS_FOR_BASE = $(EXTRALIBS)
@COND_MONOLITHIC_1@EXTRALIBS_FOR_BASE = $(EXTRALIBS) \
@COND_MONOLITHIC_1@ $(EXTRALIBS_XML) $(EXTRALIBS_GUI)
@COND_MONOLITHIC_0@EXTRALIBS_FOR_GUI = $(EXTRALIBS_GUI)
@COND_MONOLITHIC_1@EXTRALIBS_FOR_GUI =
@COND_WXUNIV_1@__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
@COND_WXUNIV_1@__WXUNIV_DEFINE_p_1 = --define __WXUNIVERSAL__
@COND_DEBUG_FLAG_0@__DEBUG_DEFINE_p = -DwxDEBUG_LEVEL=0
@COND_DEBUG_FLAG_0@__DEBUG_DEFINE_p_1 = --define wxDEBUG_LEVEL=0
@COND_USE_EXCEPTIONS_0@__EXCEPTIONS_DEFINE_p = -DwxNO_EXCEPTIONS
@COND_USE_EXCEPTIONS_0@__EXCEPTIONS_DEFINE_p_1 = --define wxNO_EXCEPTIONS
@COND_USE_RTTI_0@__RTTI_DEFINE_p = -DwxNO_RTTI
@COND_USE_RTTI_0@__RTTI_DEFINE_p_1 = --define wxNO_RTTI
@COND_USE_THREADS_0@__THREAD_DEFINE_p = -DwxNO_THREADS
@COND_USE_THREADS_0@__THREAD_DEFINE_p_1 = --define wxNO_THREADS
@COND_SHARED_1@__DLLFLAG_p = -DWXUSINGDLL
@COND_SHARED_1@__DLLFLAG_p_1 = --define WXUSINGDLL
@COND_PLATFORM_WIN32_1@__WIN32_DPI_MANIFEST_p = \
@COND_PLATFORM_WIN32_1@ --define \
@COND_PLATFORM_WIN32_1@ wxUSE_DPI_AWARE_MANIFEST=$(USE_DPI_AWARE_MANIFEST)
COND_PLATFORM_OS2_1___screenshotgen___os2_emxbindcmd = $(NM) \
screenshotgen$(EXEEXT) | if grep -q pmwin.763 ; then emxbind -ep \
screenshotgen$(EXEEXT) ; fi
@COND_PLATFORM_OS2_1@__screenshotgen___os2_emxbindcmd = $(COND_PLATFORM_OS2_1___screenshotgen___os2_emxbindcmd)
@COND_TOOLKIT_MSW@__RCDEFDIR_p = --include-dir \
@COND_TOOLKIT_MSW@ $(LIBDIRNAME)/wx/include/$(TOOLCHAIN_FULLNAME)
@COND_PLATFORM_MACOSX_1@__screenshotgen_app_Contents_PkgInfo___depname \
@COND_PLATFORM_MACOSX_1@ = screenshotgen.app/Contents/PkgInfo
@COND_PLATFORM_MACOSX_1@__screenshotgen_bundle___depname \
@COND_PLATFORM_MACOSX_1@ = screenshotgen_bundle
@COND_TOOLKIT_MAC@____screenshotgen_BUNDLE_TGT_REF_DEP = \
@COND_TOOLKIT_MAC@ $(__screenshotgen_app_Contents_PkgInfo___depname)
@COND_TOOLKIT_OSX_CARBON@____screenshotgen_BUNDLE_TGT_REF_DEP \
@COND_TOOLKIT_OSX_CARBON@ = \
@COND_TOOLKIT_OSX_CARBON@ $(__screenshotgen_app_Contents_PkgInfo___depname)
@COND_TOOLKIT_OSX_COCOA@____screenshotgen_BUNDLE_TGT_REF_DEP \
@COND_TOOLKIT_OSX_COCOA@ = \
@COND_TOOLKIT_OSX_COCOA@ $(__screenshotgen_app_Contents_PkgInfo___depname)
@COND_TOOLKIT_OSX_IPHONE@____screenshotgen_BUNDLE_TGT_REF_DEP \
@COND_TOOLKIT_OSX_IPHONE@ = \
@COND_TOOLKIT_OSX_IPHONE@ $(__screenshotgen_app_Contents_PkgInfo___depname)
@COND_TOOLKIT_COCOA@____screenshotgen_BUNDLE_TGT_REF_DEP \
@COND_TOOLKIT_COCOA@ = $(__screenshotgen_app_Contents_PkgInfo___depname)
COND_MONOLITHIC_0___WXLIB_AUI_p = \
-lwx_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_aui-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_MONOLITHIC_0@__WXLIB_AUI_p = $(COND_MONOLITHIC_0___WXLIB_AUI_p)
COND_MONOLITHIC_0___WXLIB_RICHTEXT_p = \
-lwx_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_richtext-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_MONOLITHIC_0@__WXLIB_RICHTEXT_p = $(COND_MONOLITHIC_0___WXLIB_RICHTEXT_p)
COND_MONOLITHIC_0___WXLIB_HTML_p = \
-lwx_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_html-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_MONOLITHIC_0@__WXLIB_HTML_p = $(COND_MONOLITHIC_0___WXLIB_HTML_p)
COND_MONOLITHIC_0___WXLIB_XML_p = \
-lwx_base$(WXBASEPORT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_xml-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_MONOLITHIC_0@__WXLIB_XML_p = $(COND_MONOLITHIC_0___WXLIB_XML_p)
COND_MONOLITHIC_0___WXLIB_CORE_p = \
-lwx_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_MONOLITHIC_0@__WXLIB_CORE_p = $(COND_MONOLITHIC_0___WXLIB_CORE_p)
COND_MONOLITHIC_0___WXLIB_BASE_p = \
-lwx_base$(WXBASEPORT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_MONOLITHIC_0@__WXLIB_BASE_p = $(COND_MONOLITHIC_0___WXLIB_BASE_p)
@COND_PLATFORM_WIN32_1@__screenshotgen___win32rc = \
@COND_PLATFORM_WIN32_1@ screenshotgen_screenshotgen_rc.o
COND_MONOLITHIC_1___WXLIB_MONO_p = \
-lwx_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_MONOLITHIC_1@__WXLIB_MONO_p = $(COND_MONOLITHIC_1___WXLIB_MONO_p)
@COND_MONOLITHIC_1_USE_STC_1@__LIB_SCINTILLA_IF_MONO_p \
@COND_MONOLITHIC_1_USE_STC_1@ = $(__LIB_SCINTILLA_p)
@COND_USE_STC_1@__LIB_SCINTILLA_p = \
@COND_USE_STC_1@ -lwxscintilla$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_MONOLITHIC_1_USE_STC_1@__LIB_LEXILLA_IF_MONO_p = $(__LIB_LEXILLA_p)
@COND_USE_STC_1@__LIB_LEXILLA_p = \
@COND_USE_STC_1@ -lwxlexilla$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_USE_GUI_1_wxUSE_LIBTIFF_builtin@__LIB_TIFF_p \
@COND_USE_GUI_1_wxUSE_LIBTIFF_builtin@ = \
@COND_USE_GUI_1_wxUSE_LIBTIFF_builtin@ -lwxtiff$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_USE_GUI_1_wxUSE_LIBJPEG_builtin@__LIB_JPEG_p \
@COND_USE_GUI_1_wxUSE_LIBJPEG_builtin@ = \
@COND_USE_GUI_1_wxUSE_LIBJPEG_builtin@ -lwxjpeg$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_USE_GUI_1_wxUSE_LIBPNG_builtin@__LIB_PNG_p \
@COND_USE_GUI_1_wxUSE_LIBPNG_builtin@ = \
@COND_USE_GUI_1_wxUSE_LIBPNG_builtin@ -lwxpng$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_USE_GUI_1_wxUSE_LIBWEBP_builtin@__LIB_WEBP_p \
@COND_USE_GUI_1_wxUSE_LIBWEBP_builtin@ = \
@COND_USE_GUI_1_wxUSE_LIBWEBP_builtin@ -lwxwebp$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_wxUSE_ZLIB_builtin@__LIB_ZLIB_p = \
@COND_wxUSE_ZLIB_builtin@ -lwxzlib$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_wxUSE_REGEX_builtin@__LIB_REGEX_p = \
@COND_wxUSE_REGEX_builtin@ -lwxregexu$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
@COND_wxUSE_EXPAT_builtin@__LIB_EXPAT_p = \
@COND_wxUSE_EXPAT_builtin@ -lwxexpat$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
### Targets: ###
all: screenshotgen$(EXEEXT) $(__screenshotgen_bundle___depname) bitmaps xml
install: install_screenshotgen
uninstall: uninstall_screenshotgen
install-strip: install
$(STRIP) $(DESTDIR)$(bindir)/screenshotgen$(EXEEXT)
clean:
rm -rf ./.deps ./.pch
rm -f ./*.o
rm -f screenshotgen$(EXEEXT)
rm -rf screenshotgen.app
distclean: clean
rm -f config.cache config.log config.status bk-deps bk-make-pch Makefile
screenshotgen$(EXEEXT): $(SCREENSHOTGEN_OBJECTS) $(__screenshotgen___win32rc)
$(CXX) -o $@ $(SCREENSHOTGEN_OBJECTS) -L$(LIBDIRNAME) $(DYLIB_RPATH_FLAG) $(LDFLAGS_GUI) $(HEADER_PAD_OPTION) $(LDFLAGS) $(WX_LDFLAGS) $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_HTML_p) $(EXTRALIBS_HTML) $(__WXLIB_XML_p) $(EXTRALIBS_XML) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_LEXILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_WEBP_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS)
$(__screenshotgen___os2_emxbindcmd)
@COND_PLATFORM_MACOSX_1@screenshotgen.app/Contents/PkgInfo: screenshotgen$(EXEEXT) $(top_srcdir)/src/osx/carbon/Info.plist.in $(top_srcdir)/src/osx/carbon/wxmac.icns
@COND_PLATFORM_MACOSX_1@ mkdir -p screenshotgen.app/Contents
@COND_PLATFORM_MACOSX_1@ mkdir -p screenshotgen.app/Contents/MacOS
@COND_PLATFORM_MACOSX_1@ mkdir -p screenshotgen.app/Contents/Resources
@COND_PLATFORM_MACOSX_1@
@COND_PLATFORM_MACOSX_1@
@COND_PLATFORM_MACOSX_1@ sed -e "s/\$${MACOSX_BUNDLE_GUI_IDENTIFIER}/org.wxwidgets.screenshotgen/" \
@COND_PLATFORM_MACOSX_1@ -e "s/\$${MACOSX_BUNDLE_EXECUTABLE_NAME}/screenshotgen/" \
@COND_PLATFORM_MACOSX_1@ -e "s/\$${MACOSX_BUNDLE_BUNDLE_NAME}/screenshotgen/" \
@COND_PLATFORM_MACOSX_1@ -e "s/\$${MACOSX_BUNDLE_COPYRIGHT}/Copyright 2002-2025 wxWidgets/" \
@COND_PLATFORM_MACOSX_1@ -e "s/\$${MACOSX_BUNDLE_BUNDLE_VERSION}/$(WX_VERSION)/" \
@COND_PLATFORM_MACOSX_1@ -e "s/\$${MACOSX_BUNDLE_INFO_STRING}/screenshotgen version $(WX_VERSION), (c) 2002-2025 wxWidgets/" \
@COND_PLATFORM_MACOSX_1@ -e "s/\$${MACOSX_BUNDLE_LONG_VERSION_STRING}/$(WX_VERSION), (c) 2002-2025 wxWidgets/" \
@COND_PLATFORM_MACOSX_1@ -e "s/\$${MACOSX_BUNDLE_SHORT_VERSION_STRING}/$(WX_RELEASE)/" \
@COND_PLATFORM_MACOSX_1@ $(top_srcdir)/src/osx/carbon/Info.plist.in >screenshotgen.app/Contents/Info.plist
@COND_PLATFORM_MACOSX_1@
@COND_PLATFORM_MACOSX_1@
@COND_PLATFORM_MACOSX_1@ /bin/echo "APPL????" >screenshotgen.app/Contents/PkgInfo
@COND_PLATFORM_MACOSX_1@
@COND_PLATFORM_MACOSX_1@
@COND_PLATFORM_MACOSX_1@ ln -f screenshotgen$(EXEEXT) screenshotgen.app/Contents/MacOS/screenshotgen
@COND_PLATFORM_MACOSX_1@
@COND_PLATFORM_MACOSX_1@
@COND_PLATFORM_MACOSX_1@ cp -f $(top_srcdir)/src/osx/carbon/wxmac.icns screenshotgen.app/Contents/Resources/wxmac.icns
@COND_PLATFORM_MACOSX_1@screenshotgen_bundle: $(____screenshotgen_BUNDLE_TGT_REF_DEP)
install_screenshotgen: screenshotgen$(EXEEXT)
$(INSTALL_DIR) $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) screenshotgen$(EXEEXT) $(DESTDIR)$(bindir)
uninstall_screenshotgen:
rm -f $(DESTDIR)$(bindir)/screenshotgen$(EXEEXT)
bitmaps:
@mkdir -p ./bitmaps
@for f in wxwin32x32.png bell.png sound.png dropbuth.png dropbutn.png dropbutp.png throbber.gif; do \
if test ! -f ./bitmaps/$$f -a ! -d ./bitmaps/$$f ; \
then x=yep ; \
else x=`find $(srcdir)/bitmaps/$$f -newer ./bitmaps/$$f -print` ; \
fi; \
case "$$x" in ?*) \
cp -pRf $(srcdir)/bitmaps/$$f ./bitmaps ;; \
esac; \
done
xml:
@mkdir -p .
@for f in richtext.xml; do \
if test ! -f ./$$f -a ! -d ./$$f ; \
then x=yep ; \
else x=`find $(srcdir)/$$f -newer ./$$f -print` ; \
fi; \
case "$$x" in ?*) \
cp -pRf $(srcdir)/$$f . ;; \
esac; \
done
screenshotgen_screenshot_app.o: $(srcdir)/screenshot_app.cpp
$(CXXC) -c -o $@ $(SCREENSHOTGEN_CXXFLAGS) $(srcdir)/screenshot_app.cpp
screenshotgen_screenshot_main.o: $(srcdir)/screenshot_main.cpp
$(CXXC) -c -o $@ $(SCREENSHOTGEN_CXXFLAGS) $(srcdir)/screenshot_main.cpp
screenshotgen_guiframe.o: $(srcdir)/guiframe.cpp
$(CXXC) -c -o $@ $(SCREENSHOTGEN_CXXFLAGS) $(srcdir)/guiframe.cpp
screenshotgen_customcombo.o: $(srcdir)/customcombo.cpp
$(CXXC) -c -o $@ $(SCREENSHOTGEN_CXXFLAGS) $(srcdir)/customcombo.cpp
screenshotgen_autocapture.o: $(srcdir)/autocapture.cpp
$(CXXC) -c -o $@ $(SCREENSHOTGEN_CXXFLAGS) $(srcdir)/autocapture.cpp
screenshotgen_screenshotgen_rc.o: $(srcdir)/screenshotgen.rc
$(WINDRES) -i$< -o$@ --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) --include-dir $(srcdir) $(__DLLFLAG_p_1) $(__WIN32_DPI_MANIFEST_p) --include-dir $(srcdir)/../../../samples $(__RCDEFDIR_p) --include-dir $(top_srcdir)/include
# Include dependency info, if present:
@IF_GNU_MAKE@-include ./.deps/*.d
.PHONY: all install uninstall clean distclean screenshotgen_bundle \
install_screenshotgen uninstall_screenshotgen bitmaps xml

View File

@@ -0,0 +1,359 @@
/////////////////////////////////////////////////////////////////////////////
// Name: autocapture.cpp
// Purpose: Implement wxCtrlMaskOut class
// Author: Utensil Candel (UtensilCandel@@gmail.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#include "autocapture.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/bitmap.h"
#include "wx/filename.h"
#include "wx/notebook.h"
#include <ctime>
#ifdef __WXMAC__
#include <cstring>
#endif
// ----------------------------------------------------------------------------
// AutoCaptureMechanism
// ----------------------------------------------------------------------------
AutoCaptureMechanism::AutoCaptureMechanism(wxNotebook *notebook,
int flag, int margin)
: m_notebook(notebook),
m_flag(flag),
m_margin(margin),
m_grid(nullptr)
{
}
/* static */
wxString AutoCaptureMechanism::default_dir = wxT("screenshots");
/* static */
wxString AutoCaptureMechanism::GetDefaultDirectoryAbsPath()
{
return wxFileName::DirName(GetDefaultDirectory()).GetAbsolutePath();
}
/* static */
void AutoCaptureMechanism::Delay(int seconds)
{
// TODO: Switch this to use wxTimer.
// Wait for 3 seconds
clock_t start = clock();
while ( clock() - start < (clock_t)CLOCKS_PER_SEC * seconds)
wxYieldIfNeeded();
}
/* static */
bool AutoCaptureMechanism::Capture(wxBitmap* bitmap, int x, int y,
int width, int height, int delay)
{
// Somehow wxScreenDC.Blit() doesn't work under Mac for now. Here is a trick.
#ifdef __WXMAC__
// wxExecute(wxT("screencapture -x ") + tempfile, wxEXEC_SYNC);
char captureCommand[80] =""; // a reasonable max size is 80
sprintf(captureCommand, "sleep %d;%s", delay, "screencapture -x /tmp/wx_screen_capture.png");
system(captureCommand);
if(delay) Delay(delay);
wxBitmap fullscreen;
do
{
fullscreen = wxBitmap(wxT("/tmp/wx_screen_capture.png"), wxBITMAP_TYPE_PNG);
}
while(!fullscreen.IsOk());
*bitmap = fullscreen.GetSubBitmap(wxRect(x, y, width, height));
// to prevent loading the old screenshot next time
system("rm /tmp/wx_screen_capture.png");
return true;
#else // Under other paltforms, take a real screenshot
if(delay) Delay(delay);
// Create a DC for the whole screen area
wxScreenDC dcScreen;
bitmap->Create(width, height);
// Create a memory DC that will be used for actually taking the screenshot
wxMemoryDC memDC;
memDC.SelectObject((*bitmap));
memDC.Clear();
// Blit (in this case copy) the actual screen on the memory DC
// and thus the Bitmap
memDC.Blit( 0, // Copy to this X coordinate
0, // Copy to this Y coordinate
width, // Copy this width
height, // Copy this height
&dcScreen, // From where do we copy?
x, // What's the X offset in the original DC?
y // What's the Y offset in the original DC?
);
// Select the Bitmap out of the memory DC by selecting a new
// uninitialized Bitmap
memDC.SelectObject(wxNullBitmap);
#endif // #ifdef __WXMAC__
return true;
}
/* static */
bool AutoCaptureMechanism::Capture(wxBitmap* bitmap, wxRect rect, int delay)
{
wxPoint origin = rect.GetPosition();
return Capture(bitmap, origin.x, origin.y, rect.GetWidth(), rect.GetHeight(), delay);
}
/* static */
void AutoCaptureMechanism::Save(wxBitmap* screenshot, const wxString& fileName)
{
// make sure default_dir exists
if (!wxDirExists(default_dir))
wxMkdir(default_dir);
wxFileName fullFileName(default_dir, "appear-" + fileName +
"-" + wxPlatformInfo::Get().GetPortIdShortName() + ".png");
// do not overwrite already existing files with this name
while (fullFileName.FileExists())
fullFileName.SetName(fullFileName.GetName() + "_");
// save the screenshot as a PNG
screenshot->SaveFile(fullFileName.GetFullPath(), wxBITMAP_TYPE_PNG);
}
void AutoCaptureMechanism::CaptureAll()
{
// start from the first page
m_notebook->SetSelection(0);
wxYield();
for (ControlList::iterator it = m_controlList.begin();
it != m_controlList.end();
++it)
{
Control &ctrl = *it;
if (ctrl.flag == AJ_TurnPage) // Turn to next page
{
m_notebook->SetSelection(m_notebook->GetSelection() + 1);
wxYield();
continue;
}
// create the screenshot
wxBitmap screenshot(1, 1);
Capture(&screenshot, ctrl);
if(ctrl.flag & AJ_Union)
{
// union screenshots until AJ_UnionEnd
do
{
++it;
it->name = ctrl.name; //preserving the name
wxBitmap screenshot2(1, 1);
Capture(&screenshot2, *it);
wxBitmap combined(1, 1);
Union(&screenshot, &screenshot2, &combined);
screenshot = combined;
}
while(!(it->flag & AJ_UnionEnd));
}
// and save it
Save(&screenshot, ctrl.name);
}
}
bool AutoCaptureMechanism::Capture(wxBitmap* bitmap, Control& ctrl)
{
// no manual specification for the control name
// or name adjustment is disabled globally
if (ctrl.name == wxT("") || m_flag & AJ_DisableNameAdjust)
{
// Get its name from wxRTTI
ctrl.name = ctrl.ctrl->GetClassInfo()->GetClassName();
}
int choice = wxNO;
wxRect rect = GetRect(ctrl.ctrl, ctrl.flag);
if (ctrl.flag & AJ_Dropdown && !(m_flag & AJ_DisableDropdown))
{
// for drop-down controls we need the help of the user
wxString caption = _("Drop-down screenshot...");
wxString msg =
wxString::Format(_("Do you wish to capture the drop-down list of '%s' ?\n\n If YES, please drop down the list of '%s' in 5 seconds after closing this message box.\n If NO, the screenshot for this control won't contain its drop-down list."),
ctrl.name, ctrl.name);
choice = wxMessageBox(msg, caption, wxYES_NO, m_notebook);
if (choice == wxYES)
{
//A little hint
ctrl.ctrl->SetCursor(wxCursor(wxCURSOR_HAND));
// Do some rect adjust so it can include the dropdown list
// This adjust isn't pretty, but it works fine on all three paltforms.
// Looking forward to a better solution
int h = rect.GetHeight();
rect.SetHeight(h * 4);
}
}
// cut off "wx" and change the name into lowercase.
// e.g. wxButton will have a name of "button" at the end
ctrl.name.StartsWith(wxT("wx"), &(ctrl.name));
ctrl.name.MakeLower();
// take the screenshot
Capture(bitmap, rect, (choice == wxYES)?5:0);
if (choice == wxYES) ctrl.ctrl->SetCursor(wxNullCursor);
if (ctrl.flag & AJ_RegionAdjust)
PutBack(ctrl.ctrl);
return true;
}
/* static */
bool AutoCaptureMechanism::Union(wxBitmap* top, wxBitmap* bottom, wxBitmap* result)
{
int w1, w2, h1, h2, w, h;
w1 = top->GetWidth();
w2 = bottom->GetWidth();
h1 = top->GetHeight();
h2 = bottom->GetHeight();
const int gap_between = 20;
w = (w1 >= w2) ? w1 : w2;
h = h1 + h2 + gap_between;
result->Create(w, h);
wxMemoryDC dstDC;
dstDC.SelectObject((*result));
dstDC.SetBrush(*wxWHITE_BRUSH);
dstDC.Clear();
dstDC.DrawBitmap((*top), 0, 0);
dstDC.DrawBitmap((*bottom), 0, h1 + gap_between);
dstDC.SelectObject(wxNullBitmap);
return true;
}
wxRect AutoCaptureMechanism::GetRect(wxWindow* ctrl, int flag)
{
if( (!(m_flag & AJ_DisableRegionAdjust) && (flag & AJ_RegionAdjust))
|| (m_flag & AJ_AlwaysRegionAdjust) )
{
wxWindow * parent = ctrl->GetParent();
wxSizer * sizer = parent->GetSizer();
//The assertion won't fail if controls are still managed by wxSizer, and it's unlikely to
//change in the future.
wxASSERT_MSG(sizer,
"The GUI that AutoCaptureMechanism working with doesn't manage controls with wxSizer");
sizer->Detach(ctrl);
/*
+---------+-----------+---------+
| 0 | label | 1 |
+---------+-----------+---------+
| label | ctrl | label |
+---------+-----------+---------+
| 2 | label | 3 |
+---------+-----------+---------+
*/
m_grid = new wxFlexGridSizer(3, 3, m_margin, m_margin);
wxStaticText* l[4];
for (int i = 0; i < 4; ++i)
l[i] = new wxStaticText(parent, wxID_ANY, wxT(" "));
m_grid->Add(l[0]);
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[1]);
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(ctrl, 1, wxEXPAND);
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[2]);
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[3]);
sizer->Add(m_grid);
parent->SetSizer(sizer);
parent->Layout();
parent->Refresh();
wxYield();
return wxRect(l[0]->GetScreenRect().GetBottomRight(),
l[3]->GetScreenRect().GetTopLeft());
}
else
{
return ctrl->GetScreenRect().Inflate(m_margin);
}
}
void AutoCaptureMechanism::PutBack(wxWindow * ctrl)
{
if(!m_grid) return;
m_grid->Detach(ctrl);
wxSizerItemList children = m_grid->GetChildren();
for (wxSizerItemList::iterator it = children.begin(); it != children.end(); ++it)
{
wxSizerItem* item = *it;
if (item->IsWindow()) delete (*it)->GetWindow();
}
wxSizer * sizer = ctrl->GetParent()->GetSizer();
//The assertion won't fail if controls are still managed by wxSizer, and it's unlikely to
//change in the future.
wxASSERT_MSG(sizer,
"The GUI that AutoCaptureMechanism working with doesn't manage controls with wxSizer");
sizer->Detach(m_grid);
delete m_grid;
m_grid = nullptr;
sizer->Add(ctrl);
}

View File

@@ -0,0 +1,435 @@
/////////////////////////////////////////////////////////////////////////////
// Name: autocapture.h
// Purpose: Defines the AutoCaptureMechanism class
// Author: Utensil Candel (UtensilCandel@@gmail.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _AUTOCAPTURE_H_
#define _AUTOCAPTURE_H_
#include "wx/beforestd.h"
#include <vector>
#include "wx/afterstd.h"
#include "wx/gdicmn.h"
class wxBitmap;
class wxFlexGridSizer;
class wxWindow;
class wxNotebook;
/**
GlobalAdjustFlags works with AutoCaptureMechanism's constructor, to
configure auto-adjustments of all controls.
They are used to make AutoCaptureMechanism more configurable and provide a
fallback to detect the bugs that the adjustments intended to avoid.
@see AdjustFlags
*/
enum GlobalAdjustFlags
{
/**
This is the default. All adjustments instructed in
AutoCaptureMechanism::RegisterControl() will be performed.
*/
AJ_NormalAll = 0,
/**
Disable region adjustment for all controls.
*/
AJ_DisableRegionAdjust = 1 << 0,
/**
Enable region adjustment for all controls.
If AJ_DisableRegionAdjust and AJ_AlwaysRegionAdjust are both specified,
current implementation will ignore AJ_DisableRegionAdjust.
*/
AJ_AlwaysRegionAdjust = 1 << 1,
/**
Disable name adjustment for all controls.
*/
AJ_DisableNameAdjust = 1 << 2,
/**
For all the "Drop-down Controls", e.g. wxChoice, do not prompt the user
about whether to capture their drop-down state, and always capture only
its non-drop-down state.
*/
AJ_DisableDropdown = 1 << 3
};
/**
AdjustFlags works with AutoCaptureMechanism::RegisterControl() to specify
how to adjust the screenshot of the current control.
They are used to avoid bugs, look better or interact with user etc.
@see GlobalAdjustFlags
*/
enum AdjustFlags
{
/**
This is the default. Perform no adjustment for this control.
*/
AJ_Normal = 0,
/**
Perform region adjustment for this control.
On some platforms and for some controls, wxWindow::GetScreenRect() will
return a smaller or deflected region. In these cases, the screenshots
we get are incomplete. It's recommended for everyone to fix the
controls' code, yet this flag provides a workaround to get a guaranteed
correct region without using wxWindow::GetScreenRect().
This workaround ("label trick") is inspired by (or say stolen from)
Auria's work.
*/
AJ_RegionAdjust = 1 << 0,
/**
This flag provides a way to capture the drop-down state of "Drop-down
Controls", e.g. wxChoice.
For all the "Drop-down Controls", prompt the user about whether to
capture their drop-down state, if the user chooses YES, he should drop
down the control in about 3 seconds and wait util it's captured in that
state.
*/
AJ_Dropdown = 1 << 1,
/**
This flag is used internally by RegisterPageTurn(). Don't use it
directly unless you know what you are doing.
*/
AJ_TurnPage = 1 << 2,
/**
This flag provides a functionality to union screenshots of different
modes/states of a control into one image. e.g. the single-line /
multi-line modes of a wxTextCtrl.
For a series of controls to be unioned, you should specify AJ_Union for
the first, and AJ_UnionEnd for the last. For the controls between them,
you can either specify AJ_Union or not.
The filename of the generated screenshot is the name of the first
control in the series.
*/
AJ_Union = 1 << 3,
/**
@see AJ_Union.
*/
AJ_UnionEnd = 1 << 4
};
/**
@class AutoCaptureMechanism
AutoCaptureMechanism provides an easy-to-use and adjustable facility to
take the screenshots for all controls fully automatically and correctly. It
also provides an advanced feature to union screenshots of different
states/modes of a control.
@section tag_filename_convention Screenshot File Name Convention
All screenshots are generated as PNG files. For a control named wxName, its
screenshot file name would be "name.png", e.g. "button.png" for wxButton.
This is the protocol with the doxygen document of wxWidgets.
By default, screenshots are generated under the subdirectory "screenshots"
of current working directory. During updating or adding new screenshots,
first make sure screenshots are generated correctly, and then copy them to
the "docs/doxygen/images" folder directly.
@section tag_gui_assumption The Assumption of GUI
Unfortunately, this class have an assumption about the structure of GUI: It
must have the following top-down structure:
wxNotebook->wxPanel->wxSizer->wxControl
That means, in the wxNotebook associated with this class, controls that
needs to be taken screenshots are placed on different panels(for grouping)
and laid out by wxSizers.
@section tag_tutorial Tutorial
In the construction, you should associate a wxNotebook with this class, in
that wxNotebook, controls that needs to be captured are placed on different
panels(for grouping).
When you register controls, you should do it in order: Register the
controls on the first panel(using RegisterControl()), and then register a
page turn(using RegisterPageTurn()), so this class can turn a page of the
wxNotebook to present the second page. And then you register the controls
on the second panel, then a page turn, and so on.
When you are done, simply call CaptureAll(), then screenshots of all
controls will be automatically generated.
@section tag_autoadjust Make Use of Auto Adjustments
First take a look at the document of RegisterControl(), enum AdjustFlags
and GlobalAdjustFlags.
And then, ScreenshotFrame::OnCaptureAllControls() is a good example of
making use of auto adjustment. Taking a look at it will get you started.
@section tag_developer_note Notes for Developers
@subsection tag_cnc CaptureAll() and Capture()
The implementation of Auto Adjustments is in CaptureAll() and Capture(),
the code is short, quite readable and well commented, please read the codes
before any modification.
If you need the class to do something special for you, consider introducing
a new flag and implement it in them. For an operation performed on multiple
controls, implement its logic in CaptureAll(), otherwise in the private
member Capture().
@subsection tag_yield_issue wxYield Issues
Not quite a good habit, but this class made a lot of use of wxYield() /
wxYieldIfNeeded(). They are used to ensure the update of GUI (e.g. the
page turn of wxNotebook) is done before any further screenshot-taking, or
to do the timing(in Delay()). Without their use, there would be subtle
bugs.
I've read documents about wxYield() and understand the down side of it
before using it. But I didn't find a better approach to do those things,
and I used them carefully. So please DO NOT remove any of these wxYield()s
unless you're sure that it won't cause problems on all of MS Windows
XP/Vista, Linux(Ubuntu/Fedora), Mac OS Tiger/Leopard. And please help me
to find a better approach, thank you :)
*/
class AutoCaptureMechanism
{
public:
/**
Constructor.
@param notebook
The wxNotebook associated with this class. Please see
@ref tag_gui_assumption and @ref tag_tutorial.
@param flag
It's one of or a combination of GlobalAdjustFlags, to disable /
enable some auto-adjustment for all controls.
@param margin
It's the margin around every control in the screenshots.
*/
AutoCaptureMechanism(wxNotebook *notebook,
int flag = AJ_NormalAll,
int margin = 5);
~AutoCaptureMechanism() { }
/**
Register a control and perform specified auto adjustments.
@param ctrl
The pointer to the control to be taken a screenshot.
@param name
If you find out that the screenshot for this control was generated
under an incorrect file name, specify @a name. e.g. for wxButton,
"wxButton" or "button" are both OK.
@param flag
If you end up with an a smaller or deflected screenshot, use
AJ_RegionAdjust.
If you want to capture the "drop-down" state of a "drop-down"
control, use AJ_Dropdown.
If you want to present different states of a control in one
screenshot, use AJ_Union and AJ_UnionEnd.
Please read the document of enum AdjustFlags, and notice that this
flag could be enabled / disabled by global flag GlobalAdjustFlags.
*/
void RegisterControl(wxWindow* ctrl,
wxString name = wxT(""),
int flag = AJ_Normal)
{
m_controlList.push_back(Control(ctrl, name, flag));
}
/**
Register a control and perform specifid auto adjustments.
This calls RegisterControl(wxWindow* ctrl, wxString name, int flag)
with an empty name. This is useful when you only want to auto-adjust
something other than name adjustment.
*/
void RegisterControl(wxWindow* ctrl, int flag)
{
RegisterControl(ctrl, wxT(""), flag);
}
/**
Register a page turn.
When you finished registering the controls on a panel, remember to
call it to turn the wxNotebook to the next panel.
*/
void RegisterPageTurn()
{
m_controlList.push_back(Control(0, wxT(""), AJ_TurnPage));
}
/**
Capture all registered controls of the associated wxNotebook.
*/
void CaptureAll();
/*
Static Members
*/
/**
Take a screenshot for the given region.
@param bitmap
Bitmap to save the screenshot to.
@param rect
Given rectangular region.
@param delay
Only useful for Mac, for fixing a delay bug. It seems that it
didn't fix the bug, so it might be removed soon.
*/
static bool Capture(wxBitmap* bitmap, wxRect rect, int delay = 0);
/**
Take a screenshot for the given region.
@see Capture(wxBitmap*,wxRect,int)
*/
static bool Capture(wxBitmap* bitmap,
int x, int y, int width, int height,
int delay = 0);
/**
Save the screenshot as the name of @a fileName in the default
directory.
@a fileName should be without ".png".
*/
static void Save(wxBitmap* screenshot, const wxString& fileName);
/**
Set the default directory where the screenshots will be generated.
*/
static void SetDefaultDirectory(const wxString& dir) { default_dir = dir; }
/**
Get the default directory where the screenshots will be generated.
*/
static wxString GetDefaultDirectory() { return default_dir; }
/**
Get the absolute path of the default directory where the screenshots
will be generated.
*/
static wxString GetDefaultDirectoryAbsPath();
private:
/*
Internal Data Structures
They might go public in future to provide reuse of ControlList.
*/
struct Control
{
Control() {}
Control(wxWindow * _ctrl, wxString _name, int _flag)
: ctrl(_ctrl), name(_name), flag(_flag) {}
wxWindow * ctrl;
wxString name;
int flag;
};
typedef std::vector<Control> ControlList;
/*
Internal Functions
They are only used to clearify the logic of some public functions and
it's nonsense to call them elsewhere.
*/
/*
Capture and auto adjust the control. Used by CaptureAll().
*/
bool Capture(wxBitmap* bitmap, Control& ctrl);
/*
Get the correct rectangular region that the control occupies. Used by
Capture(Control & ctrl).
If AJ_RegionAdjust is specified, it will use the "label trick" to
perform region auto adjustment.
The "label trick" is to reattach the control to a wxFlexGridSizer
m_grid, surround the control with labels and get the control's region
by label's positions. Just like this:
+---------+-----------+---------+
| 0 | label | 1 |
+---------+-----------+---------+
| label | ctrl | label |
+---------+-----------+---------+
| 2 | label | 3 |
+---------+-----------+---------+
So, there will be a side effect: the control is moved to a new
position. So after taking the screenshot, Capture(Control & ctrl)
should call PutBack(wxWindow * ctrl) to put it back.
If AJ_RegionAdjust isn't specified, it will simply call
wxWindow::GetScreenRect().
*/
wxRect GetRect(wxWindow* ctrl, int flag);
/*
Put the control back after the label trick used in GetRect(). Used by
Capture(Control & ctrl).
*/
void PutBack(wxWindow * ctrl);
/*
Union two screenshots in the vertical direction, and leave a gap
between the screenshots. Used by CaptureAll().
The gap is 20 pixels by default. Currently it isn't configurable.
*/
static bool Union(wxBitmap* top, wxBitmap* bottom, wxBitmap* result);
/*
Delay a few seconds without blocking GUI.
*/
static void Delay(int seconds);
/*
Data Members
*/
ControlList m_controlList;
wxNotebook* m_notebook;
int m_flag;
int m_margin;
wxFlexGridSizer* m_grid;
static wxString default_dir;
};
#endif // _AUTOCAPTURE_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,187 @@
/////////////////////////////////////////////////////////////////////////////
// Name: customcombo.cpp
// Purpose: Implement some custom wxComboCtrls
// Author: Utensil Candel (UtensilCandel@@gmail.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
// for all others, include the necessary headers
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#if !wxUSE_COMBOCTRL
#error "Please set wxUSE_COMBOCTRL to 1 and rebuild the library."
#endif
#include "customcombo.h"
wxBEGIN_EVENT_TABLE(ListViewComboPopup, wxListView)
EVT_MOTION(ListViewComboPopup::OnMouseMove)
// NOTE: Left down event is used instead of left up right now
// since MSW wxListCtrl doesn't seem to emit left ups
// consistently.
EVT_LEFT_DOWN(ListViewComboPopup::OnMouseClick)
wxEND_EVENT_TABLE()
wxBEGIN_EVENT_TABLE(TreeCtrlComboPopup, wxTreeCtrl)
EVT_MOTION(TreeCtrlComboPopup::OnMouseMove)
// NOTE: Left down event is used instead of left up right now
// since MSW wxTreeCtrl doesn't seem to emit left ups
// consistently.
EVT_LEFT_DOWN(TreeCtrlComboPopup::OnMouseClick)
wxEND_EVENT_TABLE()
// ----------------------------------------------------------------------------
// PenStyleComboBox
// ----------------------------------------------------------------------------
void PenStyleComboBox::OnDrawItem( wxDC& dc,
const wxRect& rect,
int item,
int flags ) const
{
if ( item == wxNOT_FOUND )
return;
wxRect r(rect);
r.Deflate(3);
r.height -= 2;
wxPenStyle penStyle = wxPENSTYLE_SOLID;
// if ( item == 1 )
// penStyle = wxPENSTYLE_TRANSPARENT;
// else if ( item == 2 )
// penStyle = wxPENSTYLE_DOT;
// else if ( item == 3 )
// penStyle = wxPENSTYLE_LONG_DASH;
// else if ( item == 4 )
// penStyle = wxPENSTYLE_SHORT_DASH;
if ( item == 0 )
penStyle = wxPENSTYLE_DOT_DASH;
else if ( item == 1 )
penStyle = wxPENSTYLE_BDIAGONAL_HATCH;
else if ( item == 2 )
penStyle = wxPENSTYLE_CROSSDIAG_HATCH;
// else if ( item == 8 )
// penStyle = wxPENSTYLE_FDIAGONAL_HATCH;
// else if ( item == 9 )
// penStyle = wxPENSTYLE_CROSS_HATCH;
// else if ( item == 10 )
// penStyle = wxPENSTYLE_HORIZONTAL_HATCH;
// else if ( item == 11 )
// penStyle = wxPENSTYLE_VERTICAL_HATCH;
wxPen pen( dc.GetTextForeground(), 3, penStyle );
// Get text colour as pen colour
dc.SetPen( pen );
if ( !(flags & wxODCB_PAINTING_CONTROL) )
{
dc.DrawText(GetString( item ),
r.x + 3,
(r.y + 0) + ( (r.height/2) - dc.GetCharHeight() )/2
);
dc.DrawLine( r.x+5, r.y+((r.height/4)*3), r.x+r.width - 5, r.y+((r.height/4)*3) );
}
else
{
dc.DrawLine( r.x+5, r.y+r.height/2, r.x+r.width - 5, r.y+r.height/2 );
}
}
void PenStyleComboBox::OnDrawBackground( wxDC& dc, const wxRect& rect,
int item, int flags ) const
{
// If item is selected or even, or we are painting the
// combo control itself, use the default rendering.
if ( (flags & (wxODCB_PAINTING_CONTROL|wxODCB_PAINTING_SELECTED)) ||
(item & 1) == 0 )
{
wxOwnerDrawnComboBox::OnDrawBackground(dc,rect,item,flags);
return;
}
// Otherwise, draw every other background with different colour.
wxColour bgCol(240,240,250);
dc.SetBrush(wxBrush(bgCol));
dc.SetPen(wxPen(bgCol));
dc.DrawRectangle(rect);
}
inline wxCoord PenStyleComboBox::OnMeasureItem( size_t item ) const
{
// Simply demonstrate the ability to have variable-height items
if ( item & 1 )
return 36;
else
return 24;
}
inline wxCoord PenStyleComboBox::OnMeasureItemWidth( size_t WXUNUSED(item) ) const
{
return -1; // default - will be measured from text width
}
PenStyleComboBox * PenStyleComboBox::CreateSample(wxWindow* parent)
{
PenStyleComboBox* odc;
// Common list of items for all dialogs.
wxArrayString arrItems;
// Create common strings array
// arrItems.Add( wxT("Solid") );
// arrItems.Add( wxT("Transparent") );
// arrItems.Add( wxT("Dot") );
// arrItems.Add( wxT("Long Dash") );
// arrItems.Add( wxT("Short Dash") );
// Comment the following since we don't need too long a drop list
arrItems.Add( wxT("Dot Dash") );
arrItems.Add( wxT("Backward Diagonal Hatch") );
arrItems.Add( wxT("Cross-diagonal Hatch") );
// arrItems.Add( wxT("Forward Diagonal Hatch") );
// arrItems.Add( wxT("Cross Hatch") );
// arrItems.Add( wxT("Horizontal Hatch") );
// arrItems.Add( wxT("Vertical Hatch") );
// When defining derivative class for callbacks, we need
// to use two-stage creation (or redefine the common wx
// constructor).
odc = new PenStyleComboBox();
odc->Create(parent,wxID_ANY,wxEmptyString,
wxDefaultPosition, wxDefaultSize,
arrItems,
wxCB_READONLY //wxNO_BORDER | wxCB_READONLY
);
odc->SetSelection(0);
// Load images from disk
wxImage imgNormal(wxT("bitmaps/dropbutn.png"));
wxImage imgPressed(wxT("bitmaps/dropbutp.png"));
wxImage imgHover(wxT("bitmaps/dropbuth.png"));
if ( imgNormal.IsOk() && imgPressed.IsOk() && imgHover.IsOk() )
{
wxBitmap bmpNormal(imgNormal);
wxBitmap bmpPressed(imgPressed);
wxBitmap bmpHover(imgHover);
odc->SetButtonBitmaps(bmpNormal,false,bmpPressed,bmpHover);
}
else
wxLogError(wxT("Dropbutton images not found"));
return odc;
}

View File

@@ -0,0 +1,248 @@
/////////////////////////////////////////////////////////////////////////////
// Name: custom_combo.h
// Purpose: Define some custom wxComboCtrls
// Author: Utensil Candel (UtensilCandel@@gmail.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef WX_CUSTOM_COMBO_H
#define WX_CUSTOM_COMBO_H
// ----------------------------------------------------------------------------
// class PenStyleComboBox
// This class is a modified version of the one from samples/combo.cpp
// ----------------------------------------------------------------------------
#include <wx/odcombo.h>
class PenStyleComboBox : public wxOwnerDrawnComboBox
{
public:
virtual void OnDrawItem( wxDC& dc,
const wxRect& rect,
int item,
int flags ) const;
virtual void OnDrawBackground( wxDC& dc, const wxRect& rect,
int item, int flags ) const;
virtual wxCoord OnMeasureItem( size_t item ) const;
virtual wxCoord OnMeasureItemWidth( size_t WXUNUSED(item) ) const;
static PenStyleComboBox* CreateSample(wxWindow* parent);
};
// ----------------------------------------------------------------------------
// wxListView Custom popup interface
// This class is a modified version of the one from samples/combo.cpp
// ----------------------------------------------------------------------------
#include <wx/listctrl.h>
class ListViewComboPopup : public wxListView, public wxComboPopup
{
public:
virtual void Init()
{
m_value = -1;
m_itemHere = -1; // hot item in list
}
virtual bool Create( wxWindow* parent )
{
return wxListView::Create(parent,1,
wxPoint(0,0),wxDefaultSize,
wxLC_LIST|wxLC_VRULES|wxBORDER_THEME);
}
virtual wxWindow *GetControl()
{ return this; }
virtual void SetStringValue( const wxString& s )
{
int n = wxListView::FindItem(-1,s);
if ( n >= 0 && n < GetItemCount() )
wxListView::Select(n);
}
virtual wxString GetStringValue() const
{
if ( m_value >= 0 )
return wxListView::GetItemText(m_value);
return wxEmptyString;
}
//
// Popup event handlers
//
// Mouse hot-tracking
void OnMouseMove(wxMouseEvent& event)
{
// Move selection to cursor if it is inside the popup
int resFlags;
int itemHere = HitTest(event.GetPosition(),resFlags);
if ( itemHere >= 0 )
{
wxListView::Select(itemHere,true);
m_itemHere = itemHere;
}
event.Skip();
}
// On mouse left, set the value and close the popup
void OnMouseClick(wxMouseEvent& WXUNUSED(event))
{
m_value = m_itemHere;
// TODO: Send event
Dismiss();
}
//
// Utilies for item manipulation
//
void AddSelection( const wxString& selstr )
{
wxListView::InsertItem(GetItemCount(),selstr);
}
protected:
int m_value; // current item index
int m_itemHere; // hot item in popup
private:
wxDECLARE_EVENT_TABLE();
};
// ----------------------------------------------------------------------------
// wxTreeCtrl Custom popup interface
// This class is a modified version of the one from samples/combo.cpp
// ----------------------------------------------------------------------------
#include <wx/treectrl.h>
class TreeCtrlComboPopup : public wxTreeCtrl, public wxComboPopup
{
public:
virtual void Init()
{
}
virtual bool Create( wxWindow* parent )
{
return wxTreeCtrl::Create(parent,1,
wxPoint(0,0),wxDefaultSize,
wxTR_HAS_BUTTONS|wxTR_SINGLE|
wxTR_LINES_AT_ROOT|wxBORDER_THEME);
}
virtual void OnShow()
{
// make sure selected item is visible
if ( m_value.IsOk() )
EnsureVisible(m_value);
}
virtual wxSize GetAdjustedSize( int minWidth,
int WXUNUSED(prefHeight),
int maxHeight )
{
return wxSize(minWidth, wxMin(80, maxHeight));
}
virtual wxWindow *GetControl()
{ return this; }
// Needed by SetStringValue
wxTreeItemId FindItemByText( wxTreeItemId parent, const wxString& text )
{
wxTreeItemIdValue cookie;
wxTreeItemId child = GetFirstChild(parent,cookie);
while ( child.IsOk() )
{
if ( GetItemText(child) == text )
{
return child;
}
if ( ItemHasChildren(child) )
{
wxTreeItemId found = FindItemByText(child,text);
if ( found.IsOk() )
return found;
}
child = GetNextChild(parent,cookie);
}
return wxTreeItemId();
}
virtual void SetStringValue( const wxString& s )
{
wxTreeItemId root = GetRootItem();
if ( !root.IsOk() )
return;
wxTreeItemId found = FindItemByText(root,s);
if ( found.IsOk() )
{
m_value = m_itemHere = found;
wxTreeCtrl::SelectItem(found);
}
}
virtual wxString GetStringValue() const
{
if ( m_value.IsOk() )
return wxTreeCtrl::GetItemText(m_value);
return wxEmptyString;
}
//
// Popup event handlers
//
// Mouse hot-tracking
void OnMouseMove(wxMouseEvent& event)
{
int resFlags;
wxTreeItemId itemHere = HitTest(event.GetPosition(),resFlags);
if ( itemHere.IsOk() && (resFlags & wxTREE_HITTEST_ONITEMLABEL) )
{
wxTreeCtrl::SelectItem(itemHere,true);
m_itemHere = itemHere;
}
event.Skip();
}
// On mouse left, set the value and close the popup
void OnMouseClick(wxMouseEvent& event)
{
int resFlags;
wxTreeItemId itemHere = HitTest(event.GetPosition(),resFlags);
if ( itemHere.IsOk() && (resFlags & wxTREE_HITTEST_ONITEMLABEL) )
{
m_itemHere = itemHere;
m_value = itemHere;
Dismiss();
// TODO: Send event
}
event.Skip();
}
protected:
wxTreeItemId m_value; // current item index
wxTreeItemId m_itemHere; // hot item in popup
private:
wxDECLARE_EVENT_TABLE();
};
#endif // WX_CUSTOM_COMBO_H

View File

@@ -0,0 +1,498 @@
/////////////////////////////////////////////////////////////////////////////
// Name: guiframe.cpp
// Purpose: Implement the Application Frame
// Author: Utensil Candel (UtensilCandel@@gmail.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
// for all others, include the necessary headers wxWidgets headers)
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "guiframe.h"
///////////////////////////////////////////////////////////////////////////
GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
AddMenuBar();
wxBoxSizer* bSizer0;
bSizer0 = new wxBoxSizer( wxVERTICAL );
m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_commonExpandFlags = wxSizerFlags(1).Expand().Border(wxALL, FromDIP(20));
//Add panels into m_notebook1
//Tiny Controls
AddPanel_1();
//Multiple choice Controls
AddPanel_2();
//[Rich]Text Controls
AddPanel_3();
//Picker Controls
AddPanel_4();
//Drop-down Controls
AddPanel_5();
m_notebook1->ChangeSelection(0);
bSizer0->Add( m_notebook1, 1, wxEXPAND | wxALL, 0 );
this->SetSizer( bSizer0 );
this->Layout();
bSizer0->Fit( this );
statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
// Connect Events
Bind(wxEVT_CLOSE_WINDOW, &GUIFrame::OnClose, this);
}
void GUIFrame::AddMenuBar()
{
mbar = new wxMenuBar( 0 );
//File Menu
fileMenu = new wxMenu();
wxMenuItem* m_menuSeeScr;
m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&Open screenshots folder...") ) + wxT('\t') + wxT("Ctrl+O"), _("Opens the directory where the screenshots are saved."), wxITEM_NORMAL );
fileMenu->Append( m_menuSeeScr );
fileMenu->AppendSeparator();
wxMenuItem* m_menuFileQuit;
m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("Alt+F4"), _("Quits the application."), wxITEM_NORMAL );
fileMenu->Append( m_menuFileQuit );
mbar->Append( fileMenu, _("&File") );
//Capture Menu
captureMenu = new wxMenu();
wxMenuItem* m_menuCapFullScreen;
m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + wxT('\t') + wxT("Ctrl+Alt+F"), _("Takes a screenshot of the entire screen."), wxITEM_NORMAL );
captureMenu->Append( m_menuCapFullScreen );
wxMenuItem* m_menuCapAll;
m_menuCapAll = new wxMenuItem( captureMenu, idMenuCapAll, wxString( _("Capture All") ) + wxT('\t') + wxT("Ctrl+Alt+A"), _("Takes screenshots for all controls automatically."), wxITEM_NORMAL );
captureMenu->Append( m_menuCapAll );
mbar->Append( captureMenu, _("&Capture") );
//Help Menu
helpMenu = new wxMenu();
wxMenuItem* m_menuHelpAbout;
m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About") ) + wxT('\t') + wxT("F1"), _("Shows info about this application."), wxITEM_NORMAL );
helpMenu->Append( m_menuHelpAbout );
mbar->Append( helpMenu, _("&Help") );
this->SetMenuBar( mbar );
// Connect Events
Bind(wxEVT_MENU, &GUIFrame::OnSeeScreenshots, this, m_menuSeeScr->GetId());
Bind(wxEVT_MENU, &GUIFrame::OnQuit, this, m_menuFileQuit->GetId());
Bind(wxEVT_MENU, &GUIFrame::OnCaptureFullScreen, this, m_menuCapFullScreen->GetId());
Bind(wxEVT_MENU, &GUIFrame::OnCaptureAllControls, this, m_menuCapAll->GetId());
Bind(wxEVT_MENU, &GUIFrame::OnAbout, this, m_menuHelpAbout->GetId());
}
void GUIFrame::AddPanel_1()
{
m_panel1 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE );
m_button1 = new wxButton( m_panel1, wxID_ANY, _("wxButton"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer1->Add( m_button1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_staticText1 = new wxStaticText( m_panel1, wxID_ANY, _("wxStaticText"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
fgSizer1->Add( m_staticText1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_checkBox1 = new wxCheckBox( m_panel1, wxID_ANY, _("Checked"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBox1->SetValue(true);
m_checkBox1->SetToolTip( _("wxCheckBox") );
fgSizer1->Add( m_checkBox1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_checkBox2 = new wxCheckBox( m_panel1, wxID_ANY, _("Unchecked"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBox2->SetToolTip( _("wxCheckBox") );
fgSizer1->Add( m_checkBox2, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 );
/*
NB: under wxGTK for the radio button "unchecked" to be unchecked, it's
important to put the wxRB_GROUP style on the first wxRadioButton
(the one "checked") and no flags on the second one.
*/
m_radioBtn1 = new wxRadioButton( m_panel1, wxID_ANY, _("Checked"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
m_radioBtn1->SetValue( true );
m_radioBtn1->SetToolTip( _("wxRadioButton") );
fgSizer1->Add( m_radioBtn1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_radioBtn2 = new wxRadioButton( m_panel1, wxID_ANY, _("Unchecked"), wxDefaultPosition, wxDefaultSize, 0 );
m_radioBtn2->SetToolTip( _("wxRadioButton") );
fgSizer1->Add( m_radioBtn2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_bpButton1 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 );
m_bpButton1->SetToolTip( _("wxBitmapButton") );
m_bpButton1->SetToolTip( _("wxBitmapButton") );
fgSizer1->Add( m_bpButton1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_bitmap1 = new wxStaticBitmap( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 );
m_bitmap1->SetToolTip( _("wxStaticBitmap") );
fgSizer1->Add( m_bitmap1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_gauge1 = new wxGauge( m_panel1, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL, wxDefaultValidator, wxT("_Gauge") );
m_gauge1->SetValue( 50 );
m_gauge1->SetToolTip( _("wxGauge") );
fgSizer1->Add(m_gauge1, m_commonExpandFlags);
m_slider1 = new wxSlider( m_panel1, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
m_slider1->SetToolTip( _("wxSlider") );
fgSizer1->Add(m_slider1, m_commonExpandFlags);
m_toggleBtn1 = new wxToggleButton( m_panel1, wxID_ANY, _("Untoggled"), wxDefaultPosition, wxDefaultSize, 0 );
m_toggleBtn1->SetToolTip( _("wxToggleButton") );
fgSizer1->Add( m_toggleBtn1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_toggleBtn2 = new wxToggleButton( m_panel1, wxID_ANY, _("Toggled"), wxDefaultPosition, wxDefaultSize, 0 );
m_toggleBtn2->SetValue( true );
m_toggleBtn2->SetToolTip( _("wxToggleButton") );
fgSizer1->Add( m_toggleBtn2, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 );
m_hyperlink1 = new wxHyperlinkCtrl( m_panel1, wxID_ANY, _("www.wxwidgets.org"), wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_hyperlink1->SetToolTip( _("wxHyperlinkCtrl") );
fgSizer1->Add( m_hyperlink1, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 );
m_spinCtrl1 = new wxSpinCtrl( m_panel1, wxID_ANY, wxT("5"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 );
m_spinCtrl1->SetToolTip( _("wxSpinCtrl") );
fgSizer1->Add( m_spinCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_spinBtn1 = new wxSpinButton( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_spinBtn1->SetToolTip( _("wxSpinButton") );
fgSizer1->Add( m_spinBtn1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_scrollBar1 = new wxScrollBar( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL );
m_scrollBar1->SetScrollbar(50, 1, 100, 1);
m_scrollBar1->SetToolTip( _("wxScrollBar") );
fgSizer1->Add(m_scrollBar1, m_commonExpandFlags);
m_panel1->SetSizer( fgSizer1 );
m_panel1->Layout();
fgSizer1->Fit( m_panel1 );
m_notebook1->AddPage( m_panel1, _("Tiny Controls"), true );
}
void GUIFrame::AddPanel_2()
{
m_panel2 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer2;
fgSizer2 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer2->SetFlexibleDirection( wxBOTH );
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxString m_checkList1Choices[] = { _("wxCheckListBox"), _("Item1"), _("Item2") };
int m_checkList1NChoices = sizeof( m_checkList1Choices ) / sizeof( wxString );
m_checkList1 = new wxCheckListBox( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_checkList1NChoices, m_checkList1Choices, 0 );
m_checkList1->Check(0);
fgSizer2->Add(m_checkList1, m_commonExpandFlags);
m_listBox1 = new wxListBox( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, 0 );
m_listBox1->Append( _("wxListBox") );
m_listBox1->Append( _("Item1") );
m_listBox1->Append( _("Item2") );
fgSizer2->Add(m_listBox1, m_commonExpandFlags);
wxString m_radioBox1Choices[] = { _("Item1"), _("Item2") };
int m_radioBox1NChoices = sizeof( m_radioBox1Choices ) / sizeof( wxString );
m_radioBox1 = new wxRadioBox( m_panel2, wxID_ANY, _("wxRadioBox"), wxDefaultPosition, wxDefaultSize, m_radioBox1NChoices, m_radioBox1Choices, 1, wxRA_SPECIFY_COLS );
m_radioBox1->SetSelection( 0 );
fgSizer2->Add( m_radioBox1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_staticBox1 = new wxStaticBox(m_panel2,wxID_ANY, _("wxStaticBox"), wxDefaultPosition, wxDefaultSize, 0, _("_StaticBox"));
fgSizer2->Add(m_staticBox1, m_commonExpandFlags);
m_treeCtrl1 = new wxTreeCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER );
wxTreeItemId root = m_treeCtrl1->AddRoot(_("wxTreeCtrl"));
m_treeCtrl1->AppendItem(root, _("Node1"));
wxTreeItemId node2 = m_treeCtrl1->AppendItem(root, _("Node2"));
m_treeCtrl1->AppendItem(node2, _("Node3"));
m_treeCtrl1->ExpandAll();
fgSizer2->Add( m_treeCtrl1, m_commonExpandFlags);
m_listCtrl1 = new wxListCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxSize(220,120), wxLC_REPORT|wxSUNKEN_BORDER );
m_listCtrl1->InsertColumn(0, "Names");
m_listCtrl1->InsertColumn(1, "Values");
for(long index = 0; index < 5; index++) {
m_listCtrl1->InsertItem( index, wxString::Format(_("Item%ld"),index));
m_listCtrl1->SetItem(index, 1, wxString::Format("%ld", index));
}
m_listCtrl1->SetToolTip( _("wxListCtrl") );
fgSizer2->Add( m_listCtrl1, m_commonExpandFlags);
m_animationCtrl1 = new wxAnimationCtrl(m_panel2, wxID_ANY);
m_animationCtrl1->SetToolTip(_("wxAnimationCtrl"));
if (m_animationCtrl1->LoadFile(wxT("bitmaps/throbber.gif")))
m_animationCtrl1->Play();
fgSizer2->Add( m_animationCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
//wxCollapsiblePane 1
m_collPane1 = new wxCollapsiblePane(m_panel2, -1, wxT("Collapsed"));
wxWindow *win = m_collPane1->GetPane();
m_collPane1->SetToolTip(_("wxCollapsiblePane"));
wxBoxSizer * collbSizer = new wxBoxSizer(wxVERTICAL);
wxStaticText* m_collSText = new wxStaticText(win, -1, wxT("You can place"));
wxButton* m_collBut = new wxButton(win, -1, wxT("anything"));
wxTextCtrl* m_collText = new wxTextCtrl(win, -1, wxT("inside a wxCollapsiblePane"));
collbSizer->Add( m_collSText, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer->Add( m_collBut, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer->Add( m_collText, wxSizerFlags().Expand() );
win->SetSizer(collbSizer);
fgSizer2->Add( m_collPane1, wxSizerFlags().Expand().Border(wxALL) );
//wxCollapsiblePane 2
m_collPane2 = new wxCollapsiblePane(m_panel2, -1, wxT("Expanded"));
wxWindow *win2 = m_collPane2->GetPane();
m_collPane2->SetToolTip(_("wxCollapsiblePane"));
wxBoxSizer * collbSizer2 = new wxBoxSizer(wxVERTICAL);
wxStaticText* m_collSText2 = new wxStaticText(win2, -1, wxT("You can place"));
wxButton* m_collBut2 = new wxButton(win2, -1, wxT("anything"));
wxTextCtrl* m_collText2 = new wxTextCtrl(win2, -1, wxT("inside a wxCollapsiblePane"));
collbSizer2->Add( m_collSText2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer2->Add( m_collBut2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer2->Add( m_collText2, wxSizerFlags().Expand() );
win2->SetSizer(collbSizer2);
m_collPane2->Expand();
fgSizer2->Add( m_collPane2, wxSizerFlags().Expand().Border(wxALL) );
m_panel2->SetSizer( fgSizer2 );
m_panel2->Layout();
fgSizer2->Fit( m_panel2 );
m_notebook1->AddPage( m_panel2, _("Multiple choice Controls"), false );
}
void GUIFrame::AddPanel_3()
{
m_panel3 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer( wxVERTICAL );
m_textCtrl1 = new wxTextCtrl( m_panel3, wxID_ANY, _("Single-line"), wxDefaultPosition, wxDefaultSize, 0 );
m_textCtrl1->SetToolTip( _("wxTextCtrl") );
bSizer2->Add( m_textCtrl1, 0, wxTOP|wxRIGHT|wxLEFT, 20 );
bSizer2->Add( 0, 10, 0, 0, 5 );
m_textCtrl2 = new wxTextCtrl( m_panel3, wxID_ANY, _("Multi-line\nLine1\nLine2\n"), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_textCtrl2->SetToolTip( _("wxTextCtrl") );
bSizer2->Add( m_textCtrl2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 20 );
m_richText1 = new wxRichTextCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0|wxVSCROLL|wxHSCROLL|wxNO_BORDER|wxWANTS_CHARS );
m_richText1->LoadFile(wxT("richtext.xml"));
m_richText1->SetToolTip( _("wxRichTextCtrl") );
m_richText1->SetMinSize( wxSize( 200,200 ) );
bSizer2->Add( m_richText1, 0, wxALL, 20 );
m_panel3->SetSizer( bSizer2 );
m_panel3->Layout();
bSizer2->Fit( m_panel3 );
m_notebook1->AddPage( m_panel3, _("[Rich]Text Controls"), false );
}
void GUIFrame::AddPanel_4()
{
m_panel4 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer5;
fgSizer5 = new wxFlexGridSizer( 0, 2, 10, 10 );
fgSizer5->SetFlexibleDirection( wxBOTH );
fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_colourPicker1 = new wxColourPickerCtrl( m_panel4, wxID_ANY, *wxBLACK, wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE );
m_colourPicker1->SetToolTip( _("wxColourPickerCtrl") );
fgSizer5->Add( m_colourPicker1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_fontPicker1 = new wxFontPickerCtrl( m_panel4, wxID_ANY, wxNullFont, wxDefaultPosition, wxDefaultSize, wxFNTP_DEFAULT_STYLE );
m_fontPicker1->SetMaxPointSize( 100 );
m_fontPicker1->SetToolTip( _("wxFontPickerCtrl") );
fgSizer5->Add( m_fontPicker1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 20 );
m_filePicker1 = new wxFilePickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE, wxDefaultValidator, wxT("_FilePickerCtrl") );
#if defined(__WXMSW__)
const wxString a_file = "C:\\Windows\\explorer.exe";
#else
const wxString a_file = "/bin/bash";
#endif
m_filePicker1->SetPath(a_file);
m_filePicker1->SetToolTip( _("wxFilePickerCtrl") );
fgSizer5->Add( m_filePicker1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 20 );
fgSizer5->Add( 0, 0, 1, wxEXPAND, 5 );
m_calendar1 = new wxCalendarCtrl( m_panel4, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxCAL_SHOW_HOLIDAYS );
m_calendar1->SetToolTip( _("wxCalendarCtrl") );
fgSizer5->Add( m_calendar1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_datePicker1 = new wxDatePickerCtrl( m_panel4, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT );
m_datePicker1->SetToolTip( _("wxDatePickerCtrl") );
fgSizer5->Add( m_datePicker1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_genericDirCtrl1 = new wxGenericDirCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, wxEmptyString, 0, wxT("_GenericDirCtrl") );
m_genericDirCtrl1->ShowHidden( false );
m_genericDirCtrl1->SetToolTip( _("wxGenericDirCtrl") );
m_genericDirCtrl1->SetMinSize( wxSize( -1,150 ) );
fgSizer5->Add(m_genericDirCtrl1, m_commonExpandFlags);
m_dirPicker1 = new wxDirPickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE, wxDefaultValidator, wxT("_DirPickerCtrl") );
#if defined(__WXMSW__)
const wxString a_dir = "C:\\Windows";
#else
const wxString a_dir = "/home";
#endif
m_dirPicker1->SetPath(a_dir);
m_dirPicker1->SetToolTip( _("wxDirPickerCtrl") );
fgSizer5->Add( m_dirPicker1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_panel4->SetSizer( fgSizer5 );
m_panel4->Layout();
fgSizer5->Fit( m_panel4 );
m_notebook1->AddPage( m_panel4, _("Picker Controls"), false );
}
void GUIFrame::AddPanel_5()
{
m_panel5 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer4;
fgSizer4 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer4->SetFlexibleDirection( wxBOTH );
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxString m_choice1Choices[] = { _("wxChoice"), _("Item1"), _("Item2"), _("Item3"), _("Item4") };
int m_choice1NChoices = sizeof( m_choice1Choices ) / sizeof( wxString );
m_choice1 = new wxChoice( m_panel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choice1NChoices, m_choice1Choices, 0 );
m_choice1->SetSelection( 0 );
fgSizer4->Add( m_choice1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_comboBox1 = new wxComboBox( m_panel5, wxID_ANY, _("wxComboBox"), wxDefaultPosition, wxDefaultSize, 0, nullptr, 0 );
m_comboBox1->Append( _("wxComboBox") );
m_comboBox1->Append( _("Item1") );
m_comboBox1->Append( _("Item2") );
m_comboBox1->Append( _("Item3") );
m_comboBox1->Append( _("Item4") );
m_comboBox1->Select(0);
// To look better under gtk
#ifdef __WXGTK__
m_comboBox1->Delete(4);
#endif
fgSizer4->Add( m_comboBox1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
fgSizer4->Add( 0, 120, 1, wxEXPAND, 5 );
fgSizer4->Add( 0, 120, 1, wxEXPAND, 5 );
/*
Create the wxBitmapComboBox control with wxCB_READONLY to ensure
it shows a bitmap next to the edit field which is more suitable
for a screenshot.
*/
m_bmpComboBox1 = new wxBitmapComboBox(m_panel5, wxID_ANY,_("Item1"),
wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
m_bmpComboBox1->Append(_("Item1"), wxBitmap(wxT("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item2"), wxBitmap(wxT("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item3"), wxBitmap(wxT("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item4"), wxBitmap(wxT("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->SetToolTip(_("wxBitmapComboBox"));
m_bmpComboBox1->SetSelection(0);
fgSizer4->Add(m_bmpComboBox1, m_commonExpandFlags);
m_ownerDrawnComboBox1 = PenStyleComboBox::CreateSample(m_panel5);
m_ownerDrawnComboBox1->SetToolTip(_("wxOwnerDrawnComboBox"));
fgSizer4->Add(m_ownerDrawnComboBox1, m_commonExpandFlags);
fgSizer4->Add( 0, 90, 1, wxEXPAND, 5 );
fgSizer4->Add( 0, 90, 1, wxEXPAND, 5 );
//wxComboCtrl 1
m_comboCtrl1 = new wxComboCtrl(m_panel5,wxID_ANY,wxEmptyString);
// first of all, set the popup control!
ListViewComboPopup* popupList = new ListViewComboPopup();
m_comboCtrl1->SetPopupControl(popupList);
m_comboCtrl1->SetPopupMaxHeight(80);
m_comboCtrl1->SetText(wxT("wxComboCtrl"));
m_comboCtrl1->SetToolTip(_("wxComboCtrl"));
// Populate using wxListView methods
popupList->InsertItem(popupList->GetItemCount(),wxT("wxComboCtrl"));
popupList->InsertItem(popupList->GetItemCount(),wxT("with"));
popupList->InsertItem(popupList->GetItemCount(),wxT("wxListView"));
popupList->InsertItem(popupList->GetItemCount(),wxT("popup"));
popupList->InsertItem(popupList->GetItemCount(),wxT("Item1"));
popupList->InsertItem(popupList->GetItemCount(),wxT("Item2"));
popupList->InsertItem(popupList->GetItemCount(),wxT("Item3"));
popupList->Select(0, true);
fgSizer4->Add(m_comboCtrl1, m_commonExpandFlags);
//wxComboCtrl 2
m_comboCtrl2 = new wxComboCtrl(m_panel5,wxID_ANY,wxEmptyString);
// first of all, set the popup control!
TreeCtrlComboPopup* popupTree = new TreeCtrlComboPopup();
m_comboCtrl2->SetPopupControl(popupTree);
m_comboCtrl2->SetPopupMaxHeight(80);
m_comboCtrl2->SetText(wxT("wxComboCtrl"));
m_comboCtrl2->SetToolTip(_("wxComboCtrl"));
//Add a root and some nodes using wxTreeCtrl methods
wxTreeItemId root = popupTree->AddRoot(_("wxComboCtrl"));
popupTree->AppendItem(root, _("with"));
popupTree->AppendItem(root, _("wxTreeCtrl"));
wxTreeItemId node2 = popupTree->AppendItem(root, _("popout"));
popupTree->AppendItem(node2, _("Node1"));
popupTree->AppendItem(node2, _("Node2"));
popupTree->ExpandAll();
fgSizer4->Add(m_comboCtrl2, m_commonExpandFlags);
m_panel5->SetSizer( fgSizer4 );
m_panel5->Layout();
fgSizer4->Fit( m_panel5 );
m_notebook1->AddPage( m_panel5, _("Drop-down Controls"), false );
}
GUIFrame::~GUIFrame()
{
// Disconnect Events
Unbind(wxEVT_CLOSE_WINDOW, &GUIFrame::OnClose, this);
Unbind(wxEVT_MENU, &GUIFrame::OnSeeScreenshots, this);
Unbind(wxEVT_MENU, &GUIFrame::OnQuit, this);
Unbind(wxEVT_MENU, &GUIFrame::OnCaptureFullScreen, this);
Unbind(wxEVT_MENU, &GUIFrame::OnCaptureAllControls, this);
Unbind(wxEVT_MENU, &GUIFrame::OnAbout, this);
}

View File

@@ -0,0 +1,126 @@
/////////////////////////////////////////////////////////////////////////////
// Name: guiframe.h
// Purpose: Defines the window containing all controls.
// Author: Utensil Candel (UtensilCandel@@gmail.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _GUIFRAME_H_
#define _GUIFRAME_H_
#include "wx/animate.h"
#include "wx/bmpcbox.h"
#include "wx/calctrl.h"
#include "wx/clrpicker.h"
#include "wx/collpane.h"
#include "wx/datectrl.h"
#include "wx/dirctrl.h"
#include "wx/filepicker.h"
#include "wx/fontpicker.h"
#include "wx/hyperlink.h"
#include "wx/listctrl.h"
#include "wx/notebook.h"
#include "wx/richtext/richtextctrl.h"
#include "wx/spinbutt.h"
#include "wx/spinctrl.h"
#include "wx/tglbtn.h"
#include "wx/treectrl.h"
#include "customcombo.h"
class GUIFrame : public wxFrame
{
public:
GUIFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("wxWidgets Control Screenshot Generator"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
~GUIFrame();
protected:
enum
{
idMenuCapFullScreen = 1000,
idMenuCapAll
};
wxMenuBar* mbar;
wxMenu* fileMenu;
wxMenu* captureMenu;
wxMenu* helpMenu;
wxStatusBar* statusBar;
wxNotebook* m_notebook1;
wxPanel* m_panel1;
wxButton* m_button1;
wxStaticText* m_staticText1;
wxCheckBox* m_checkBox1;
wxCheckBox* m_checkBox2;
wxRadioButton* m_radioBtn1;
wxRadioButton* m_radioBtn2;
wxBitmapButton* m_bpButton1;
wxStaticBitmap* m_bitmap1;
wxGauge* m_gauge1;
wxSlider* m_slider1;
wxToggleButton* m_toggleBtn1;
wxToggleButton* m_toggleBtn2;
wxHyperlinkCtrl* m_hyperlink1;
wxSpinCtrl* m_spinCtrl1;
wxSpinButton* m_spinBtn1;
wxScrollBar* m_scrollBar1;
wxPanel* m_panel2;
wxCheckListBox* m_checkList1;
wxListBox* m_listBox1;
wxRadioBox* m_radioBox1;
wxStaticBox * m_staticBox1;
wxTreeCtrl* m_treeCtrl1;
wxListCtrl* m_listCtrl1;
wxAnimationCtrl * m_animationCtrl1;
wxCollapsiblePane *m_collPane1;
wxCollapsiblePane *m_collPane2;
wxPanel* m_panel3;
wxTextCtrl* m_textCtrl1;
wxTextCtrl* m_textCtrl2;
wxRichTextCtrl* m_richText1;
wxPanel* m_panel4;
wxColourPickerCtrl* m_colourPicker1;
wxFontPickerCtrl* m_fontPicker1;
wxFilePickerCtrl* m_filePicker1;
wxCalendarCtrl* m_calendar1;
wxDatePickerCtrl* m_datePicker1;
wxGenericDirCtrl* m_genericDirCtrl1;
wxDirPickerCtrl* m_dirPicker1;
wxPanel* m_panel5;
wxChoice* m_choice1;
wxComboBox* m_comboBox1;
wxBitmapComboBox * m_bmpComboBox1;
PenStyleComboBox * m_ownerDrawnComboBox1;
wxComboCtrl * m_comboCtrl1;
wxComboCtrl * m_comboCtrl2;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnSeeScreenshots( wxCommandEvent& event ){ event.Skip(); }
virtual void OnQuit( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCaptureFullScreen( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCaptureAllControls( wxCommandEvent& event ){ event.Skip(); }
virtual void OnAbout( wxCommandEvent& event ){ event.Skip(); }
private:
void AddMenuBar();
void AddPanel_1();
void AddPanel_2();
void AddPanel_3();
void AddPanel_4();
void AddPanel_5();
wxSizerFlags m_commonExpandFlags;
};
#endif //_GUIFRAME_H_

View File

@@ -0,0 +1,268 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.13 (http://www.bakefile.org)
# Do not modify, all changes will be overwritten!
# =========================================================================
include ../../../build/msw/config.gcc
# -------------------------------------------------------------------------
# Do not modify the rest of this file!
# -------------------------------------------------------------------------
### Variables: ###
CPPDEPS = -MT$@ -MF$@.d -MD -MP
WX_RELEASE_NODOT = 33
COMPILER_PREFIX = gcc
OBJS = \
$(COMPILER_PREFIX)$(COMPILER_VERSION)_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
LIBDIRNAME = \
.\..\..\..\lib\$(COMPILER_PREFIX)$(COMPILER_VERSION)_$(LIBTYPE_SUFFIX)$(CFG)
SETUPHDIR = $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)
SCREENSHOTGEN_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG_2) $(__THREADSFLAG) \
-D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) \
$(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \
-I$(SETUPHDIR) -I.\..\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_p) -W \
-Wall -I. $(__DLLFLAG_p) -I.\..\..\..\samples -DNOPCH $(__RTTIFLAG_5) \
$(__EXCEPTIONSFLAG_6) -Wno-ctor-dtor-privacy $(CPPFLAGS) $(CXXFLAGS)
SCREENSHOTGEN_OBJECTS = \
$(OBJS)\screenshotgen_screenshot_app.o \
$(OBJS)\screenshotgen_screenshot_main.o \
$(OBJS)\screenshotgen_guiframe.o \
$(OBJS)\screenshotgen_customcombo.o \
$(OBJS)\screenshotgen_autocapture.o \
$(OBJS)\screenshotgen_screenshotgen_rc.o
### Conditionally set variables: ###
ifeq ($(USE_GUI),0)
PORTNAME = base
endif
ifeq ($(USE_GUI),1)
PORTNAME = msw$(TOOLKIT_VERSION)
endif
ifeq ($(OFFICIAL_BUILD),1)
COMPILER_VERSION = ERROR-COMPILER-VERSION-MUST-BE-SET-FOR-OFFICIAL-BUILD
endif
ifeq ($(BUILD),debug)
WXDEBUGFLAG = d
endif
ifeq ($(WXUNIV),1)
WXUNIVNAME = univ
endif
ifeq ($(SHARED),1)
WXDLLFLAG = dll
endif
ifeq ($(SHARED),0)
LIBTYPE_SUFFIX = lib
endif
ifeq ($(SHARED),1)
LIBTYPE_SUFFIX = dll
endif
ifeq ($(MONOLITHIC),0)
EXTRALIBS_FOR_BASE =
endif
ifeq ($(MONOLITHIC),1)
EXTRALIBS_FOR_BASE =
endif
ifeq ($(BUILD),debug)
__OPTIMIZEFLAG_2 = -O0
endif
ifeq ($(BUILD),release)
__OPTIMIZEFLAG_2 = -O2
endif
ifeq ($(USE_RTTI),0)
__RTTIFLAG_5 = -fno-rtti
endif
ifeq ($(USE_RTTI),1)
__RTTIFLAG_5 =
endif
ifeq ($(USE_EXCEPTIONS),0)
__EXCEPTIONSFLAG_6 = -fno-exceptions
endif
ifeq ($(USE_EXCEPTIONS),1)
__EXCEPTIONSFLAG_6 =
endif
ifeq ($(WXUNIV),1)
__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
endif
ifeq ($(WXUNIV),1)
__WXUNIV_DEFINE_p_1 = --define __WXUNIVERSAL__
endif
ifeq ($(DEBUG_FLAG),0)
__DEBUG_DEFINE_p = -DwxDEBUG_LEVEL=0
endif
ifeq ($(DEBUG_FLAG),0)
__DEBUG_DEFINE_p_1 = --define wxDEBUG_LEVEL=0
endif
ifeq ($(BUILD),release)
__NDEBUG_DEFINE_p = -DNDEBUG
endif
ifeq ($(BUILD),release)
__NDEBUG_DEFINE_p_1 = --define NDEBUG
endif
ifeq ($(USE_EXCEPTIONS),0)
__EXCEPTIONS_DEFINE_p = -DwxNO_EXCEPTIONS
endif
ifeq ($(USE_EXCEPTIONS),0)
__EXCEPTIONS_DEFINE_p_1 = --define wxNO_EXCEPTIONS
endif
ifeq ($(USE_RTTI),0)
__RTTI_DEFINE_p = -DwxNO_RTTI
endif
ifeq ($(USE_RTTI),0)
__RTTI_DEFINE_p_1 = --define wxNO_RTTI
endif
ifeq ($(USE_THREADS),0)
__THREAD_DEFINE_p = -DwxNO_THREADS
endif
ifeq ($(USE_THREADS),0)
__THREAD_DEFINE_p_1 = --define wxNO_THREADS
endif
ifeq ($(USE_CAIRO),1)
____CAIRO_INCLUDEDIR_FILENAMES_p = -I$(CAIRO_ROOT)\include\cairo
endif
ifeq ($(USE_CAIRO),1)
__CAIRO_INCLUDEDIR_p = --include-dir $(CAIRO_ROOT)/include/cairo
endif
ifeq ($(SHARED),1)
__DLLFLAG_p = -DWXUSINGDLL
endif
ifeq ($(SHARED),1)
__DLLFLAG_p_1 = --define WXUSINGDLL
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_AUI_p = \
-lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_aui
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_RICHTEXT_p = \
-lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_richtext
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_HTML_p = \
-lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_html
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_XML_p = \
-lwxbase$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_xml
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_CORE_p = \
-lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_BASE_p = -lwxbase$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)
endif
ifeq ($(MONOLITHIC),1)
__WXLIB_MONO_p = \
-lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)
endif
ifeq ($(MONOLITHIC),1)
ifeq ($(USE_STC),1)
__LIB_SCINTILLA_IF_MONO_p = -lwxscintilla$(WXDEBUGFLAG)
endif
endif
ifeq ($(MONOLITHIC),1)
ifeq ($(USE_STC),1)
__LIB_LEXILLA_IF_MONO_p = $(__LIB_LEXILLA_p)
endif
endif
ifeq ($(USE_STC),1)
__LIB_LEXILLA_p = -lwxlexilla$(WXDEBUGFLAG)
endif
ifeq ($(USE_GUI),1)
__LIB_TIFF_p = -lwxtiff$(WXDEBUGFLAG)
endif
ifeq ($(USE_GUI),1)
__LIB_JPEG_p = -lwxjpeg$(WXDEBUGFLAG)
endif
ifeq ($(USE_GUI),1)
__LIB_PNG_p = -lwxpng$(WXDEBUGFLAG)
endif
ifeq ($(USE_GUI),1)
__LIB_WEBP_p = -lwxwebp$(WXDEBUGFLAG)
endif
ifeq ($(USE_CAIRO),1)
__CAIRO_LIB_p = -lcairo
endif
ifeq ($(USE_CAIRO),1)
____CAIRO_LIBDIR_FILENAMES_p = -L$(CAIRO_ROOT)\lib
endif
ifeq ($(BUILD),debug)
ifeq ($(DEBUG_INFO),default)
__DEBUGINFO = -g
endif
endif
ifeq ($(BUILD),release)
ifeq ($(DEBUG_INFO),default)
__DEBUGINFO =
endif
endif
ifeq ($(DEBUG_INFO),0)
__DEBUGINFO =
endif
ifeq ($(DEBUG_INFO),1)
__DEBUGINFO = -g
endif
ifeq ($(USE_THREADS),0)
__THREADSFLAG =
endif
ifeq ($(USE_THREADS),1)
__THREADSFLAG = -mthreads
endif
all: $(OBJS)
$(OBJS):
-if not exist $(OBJS) mkdir $(OBJS)
### Targets: ###
all: $(OBJS)\screenshotgen.exe bitmaps xml
clean:
-if exist $(OBJS)\*.o del $(OBJS)\*.o
-if exist $(OBJS)\*.d del $(OBJS)\*.d
-if exist $(OBJS)\screenshotgen.exe del $(OBJS)\screenshotgen.exe
$(OBJS)\screenshotgen.exe: $(SCREENSHOTGEN_OBJECTS) $(OBJS)\screenshotgen_screenshotgen_rc.o
$(foreach f,$(subst \,/,$(SCREENSHOTGEN_OBJECTS)),$(shell echo $f >> $(subst \,/,$@).rsp.tmp))
@move /y $@.rsp.tmp $@.rsp >nul
$(CXX) -o $@ @$@.rsp $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--subsystem,windows -mwindows $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_HTML_p) $(__WXLIB_XML_p) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_LEXILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_WEBP_p) -lwxzlib$(WXDEBUGFLAG) -lwxregexu$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lgdiplus -lmsimg32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lws2_32 -lwininet -loleacc -luxtheme
@-del $@.rsp
bitmaps:
if not exist $(OBJS)\bitmaps mkdir $(OBJS)\bitmaps
for %%f in (wxwin32x32.png bell.png sound.png dropbuth.png dropbutn.png dropbutp.png throbber.gif) do if not exist $(OBJS)\bitmaps\%%f copy .\bitmaps\%%f $(OBJS)\bitmaps
xml:
if not exist $(OBJS) mkdir $(OBJS)
for %%f in (richtext.xml) do if not exist $(OBJS)\%%f copy .\%%f $(OBJS)
$(OBJS)\screenshotgen_screenshot_app.o: ./screenshot_app.cpp
$(CXX) -c -o $@ $(SCREENSHOTGEN_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\screenshotgen_screenshot_main.o: ./screenshot_main.cpp
$(CXX) -c -o $@ $(SCREENSHOTGEN_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\screenshotgen_guiframe.o: ./guiframe.cpp
$(CXX) -c -o $@ $(SCREENSHOTGEN_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\screenshotgen_customcombo.o: ./customcombo.cpp
$(CXX) -c -o $@ $(SCREENSHOTGEN_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\screenshotgen_autocapture.o: ./autocapture.cpp
$(CXX) -c -o $@ $(SCREENSHOTGEN_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\screenshotgen_screenshotgen_rc.o: ./screenshotgen.rc
$(WINDRES) -i$< -o$@ --define __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) --include-dir $(SETUPHDIR) --include-dir ./../../../include $(__CAIRO_INCLUDEDIR_p) --include-dir . $(__DLLFLAG_p_1) --define wxUSE_DPI_AWARE_MANIFEST=$(USE_DPI_AWARE_MANIFEST) --include-dir ./../../../samples --define NOPCH
.PHONY: all clean bitmaps xml
SHELL := $(COMSPEC)
# Dependencies tracking:
-include $(OBJS)/*.d

View File

@@ -0,0 +1,481 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.13 (http://www.bakefile.org)
# Do not modify, all changes will be overwritten!
# =========================================================================
!include <../../../build/msw/config.vc>
# -------------------------------------------------------------------------
# Do not modify the rest of this file!
# -------------------------------------------------------------------------
### Variables: ###
WX_RELEASE_NODOT = 33
COMPILER_PREFIX = vc
OBJS = \
$(COMPILER_PREFIX)$(COMPILER_VERSION)$(ARCH_SUFFIX)_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
LIBDIRNAME = \
.\..\..\..\lib\$(COMPILER_PREFIX)$(COMPILER_VERSION)$(ARCH_SUFFIX)_$(LIBTYPE_SUFFIX)$(CFG)
SETUPHDIR = $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)
SCREENSHOTGEN_CXXFLAGS = /M$(__RUNTIME_LIBS_10)$(__DEBUGRUNTIME_4) /DWIN32 \
$(__DEBUGINFO_0) /Fd$(OBJS)\screenshotgen.pdb $(____DEBUGRUNTIME_3_p) \
$(__OPTIMIZEFLAG_6) /D_CRT_SECURE_NO_DEPRECATE=1 \
/D_CRT_NON_CONFORMING_SWPRINTFS=1 /D_SCL_SECURE_NO_WARNINGS=1 \
$(__NO_VC_CRTDBG_p) $(__TARGET_CPU_COMPFLAG_p) /D__WXMSW__ \
$(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) \
$(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \
/I$(SETUPHDIR) /I.\..\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_p) /W4 \
/I. $(__DLLFLAG_p) /D_WINDOWS /I.\..\..\..\samples /DNOPCH $(__RTTIFLAG_11) \
$(__EXCEPTIONSFLAG_12) $(CPPFLAGS) $(CXXFLAGS)
SCREENSHOTGEN_OBJECTS = \
$(OBJS)\screenshotgen_screenshot_app.obj \
$(OBJS)\screenshotgen_screenshot_main.obj \
$(OBJS)\screenshotgen_guiframe.obj \
$(OBJS)\screenshotgen_customcombo.obj \
$(OBJS)\screenshotgen_autocapture.obj
SCREENSHOTGEN_RESOURCES = \
$(OBJS)\screenshotgen_screenshotgen.res
### Conditionally set variables: ###
!if "$(TARGET_CPU)" == "AMD64"
ARCH_SUFFIX = _x64
!endif
!if "$(TARGET_CPU)" == "ARM"
ARCH_SUFFIX = _arm
!endif
!if "$(TARGET_CPU)" == "ARM64"
ARCH_SUFFIX = _arm64
!endif
!if "$(TARGET_CPU)" == "IA64"
ARCH_SUFFIX = _ia64
!endif
!if "$(TARGET_CPU)" == "X64"
ARCH_SUFFIX = _x64
!endif
!if "$(TARGET_CPU)" == "" && "$(VISUALSTUDIOPLATFORM)" == "X64"
ARCH_SUFFIX = _x64
!endif
!if "$(TARGET_CPU)" == "" && "$(VISUALSTUDIOPLATFORM)" == "x64"
ARCH_SUFFIX = _x64
!endif
!if "$(TARGET_CPU)" == "amd64"
ARCH_SUFFIX = _x64
!endif
!if "$(TARGET_CPU)" == "arm"
ARCH_SUFFIX = _arm
!endif
!if "$(TARGET_CPU)" == "arm64"
ARCH_SUFFIX = _arm64
!endif
!if "$(TARGET_CPU)" == "ia64"
ARCH_SUFFIX = _ia64
!endif
!if "$(TARGET_CPU)" == "x64"
ARCH_SUFFIX = _x64
!endif
!if "$(USE_GUI)" == "0"
PORTNAME = base
!endif
!if "$(USE_GUI)" == "1"
PORTNAME = msw$(TOOLKIT_VERSION)
!endif
!if "$(OFFICIAL_BUILD)" == "1"
COMPILER_VERSION = ERROR-COMPILER-VERSION-MUST-BE-SET-FOR-OFFICIAL-BUILD
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default"
WXDEBUGFLAG = d
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "1"
WXDEBUGFLAG = d
!endif
!if "$(WXUNIV)" == "1"
WXUNIVNAME = univ
!endif
!if "$(SHARED)" == "1"
WXDLLFLAG = dll
!endif
!if "$(SHARED)" == "0"
LIBTYPE_SUFFIX = lib
!endif
!if "$(SHARED)" == "1"
LIBTYPE_SUFFIX = dll
!endif
!if "$(TARGET_CPU)" == "AMD64"
LINK_TARGET_CPU = /MACHINE:X64
!endif
!if "$(TARGET_CPU)" == "ARM"
LINK_TARGET_CPU = /MACHINE:ARM
!endif
!if "$(TARGET_CPU)" == "ARM64"
LINK_TARGET_CPU = /MACHINE:ARM64
!endif
!if "$(TARGET_CPU)" == "IA64"
LINK_TARGET_CPU = /MACHINE:IA64
!endif
!if "$(TARGET_CPU)" == "X64"
LINK_TARGET_CPU = /MACHINE:X64
!endif
!if "$(TARGET_CPU)" == "" && "$(VISUALSTUDIOPLATFORM)" == "X64"
LINK_TARGET_CPU = /MACHINE:X64
!endif
!if "$(TARGET_CPU)" == "" && "$(VISUALSTUDIOPLATFORM)" == "x64"
LINK_TARGET_CPU = /MACHINE:X64
!endif
!if "$(TARGET_CPU)" == "amd64"
LINK_TARGET_CPU = /MACHINE:X64
!endif
!if "$(TARGET_CPU)" == "arm"
LINK_TARGET_CPU = /MACHINE:ARM
!endif
!if "$(TARGET_CPU)" == "arm64"
LINK_TARGET_CPU = /MACHINE:ARM64
!endif
!if "$(TARGET_CPU)" == "ia64"
LINK_TARGET_CPU = /MACHINE:IA64
!endif
!if "$(TARGET_CPU)" == "x64"
LINK_TARGET_CPU = /MACHINE:X64
!endif
!if "$(USE_DPI_AWARE_MANIFEST)" == "1" && "$(VISUALSTUDIOVERSION)" == "14.0"
WIN32_DPI_LINKFLAG = /MANIFEST:EMBED \
/MANIFESTINPUT:./../../../include/wx/msw/wx_dpi_aware.manifest
!endif
!if "$(USE_DPI_AWARE_MANIFEST)" == "1" && "$(VISUALSTUDIOVERSION)" == "15.0"
WIN32_DPI_LINKFLAG = /MANIFEST:EMBED \
/MANIFESTINPUT:./../../../include/wx/msw/wx_dpi_aware.manifest
!endif
!if "$(USE_DPI_AWARE_MANIFEST)" == "1" && "$(VISUALSTUDIOVERSION)" == "16.0"
WIN32_DPI_LINKFLAG = /MANIFEST:EMBED \
/MANIFESTINPUT:./../../../include/wx/msw/wx_dpi_aware.manifest
!endif
!if "$(USE_DPI_AWARE_MANIFEST)" == "1" && "$(VISUALSTUDIOVERSION)" == "17.0"
WIN32_DPI_LINKFLAG = /MANIFEST:EMBED \
/MANIFESTINPUT:./../../../include/wx/msw/wx_dpi_aware.manifest
!endif
!if "$(USE_DPI_AWARE_MANIFEST)" == "2" && "$(VISUALSTUDIOVERSION)" == "14.0"
WIN32_DPI_LINKFLAG = /MANIFEST:EMBED \
/MANIFESTINPUT:./../../../include/wx/msw/wx_dpi_aware_pmv2.manifest
!endif
!if "$(USE_DPI_AWARE_MANIFEST)" == "2" && "$(VISUALSTUDIOVERSION)" == "15.0"
WIN32_DPI_LINKFLAG = /MANIFEST:EMBED \
/MANIFESTINPUT:./../../../include/wx/msw/wx_dpi_aware_pmv2.manifest
!endif
!if "$(USE_DPI_AWARE_MANIFEST)" == "2" && "$(VISUALSTUDIOVERSION)" == "16.0"
WIN32_DPI_LINKFLAG = /MANIFEST:EMBED \
/MANIFESTINPUT:./../../../include/wx/msw/wx_dpi_aware_pmv2.manifest
!endif
!if "$(USE_DPI_AWARE_MANIFEST)" == "2" && "$(VISUALSTUDIOVERSION)" == "17.0"
WIN32_DPI_LINKFLAG = /MANIFEST:EMBED \
/MANIFESTINPUT:./../../../include/wx/msw/wx_dpi_aware_pmv2.manifest
!endif
!if "$(MONOLITHIC)" == "0"
EXTRALIBS_FOR_BASE =
!endif
!if "$(MONOLITHIC)" == "1"
EXTRALIBS_FOR_BASE =
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO_0 = /Zi
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO_0 =
!endif
!if "$(DEBUG_INFO)" == "0"
__DEBUGINFO_0 =
!endif
!if "$(DEBUG_INFO)" == "1"
__DEBUGINFO_0 = /Zi
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO_1 = /DEBUG
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO_1 =
!endif
!if "$(DEBUG_INFO)" == "0"
__DEBUGINFO_1 =
!endif
!if "$(DEBUG_INFO)" == "1"
__DEBUGINFO_1 = /DEBUG
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO_2 = $(__DEBUGRUNTIME_5)
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO_2 =
!endif
!if "$(DEBUG_INFO)" == "0"
__DEBUGINFO_2 =
!endif
!if "$(DEBUG_INFO)" == "1"
__DEBUGINFO_2 = $(__DEBUGRUNTIME_5)
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default"
____DEBUGRUNTIME_3_p = /D_DEBUG
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default"
____DEBUGRUNTIME_3_p =
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "0"
____DEBUGRUNTIME_3_p =
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "1"
____DEBUGRUNTIME_3_p = /D_DEBUG
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default"
____DEBUGRUNTIME_3_p_1 = /d _DEBUG
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default"
____DEBUGRUNTIME_3_p_1 =
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "0"
____DEBUGRUNTIME_3_p_1 =
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "1"
____DEBUGRUNTIME_3_p_1 = /d _DEBUG
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default"
__DEBUGRUNTIME_4 = d
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default"
__DEBUGRUNTIME_4 =
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "0"
__DEBUGRUNTIME_4 =
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "1"
__DEBUGRUNTIME_4 = d
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default"
__DEBUGRUNTIME_5 =
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default"
__DEBUGRUNTIME_5 = /opt:ref /opt:icf
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "0"
__DEBUGRUNTIME_5 = /opt:ref /opt:icf
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "1"
__DEBUGRUNTIME_5 =
!endif
!if "$(BUILD)" == "debug"
__OPTIMIZEFLAG_6 = /Od
!endif
!if "$(BUILD)" == "release"
__OPTIMIZEFLAG_6 = /O2
!endif
!if "$(USE_THREADS)" == "0"
__THREADSFLAG_9 = L
!endif
!if "$(USE_THREADS)" == "1"
__THREADSFLAG_9 = T
!endif
!if "$(RUNTIME_LIBS)" == "dynamic"
__RUNTIME_LIBS_10 = D
!endif
!if "$(RUNTIME_LIBS)" == "static"
__RUNTIME_LIBS_10 = $(__THREADSFLAG_9)
!endif
!if "$(USE_RTTI)" == "0"
__RTTIFLAG_11 = /GR-
!endif
!if "$(USE_RTTI)" == "1"
__RTTIFLAG_11 = /GR
!endif
!if "$(USE_EXCEPTIONS)" == "0"
__EXCEPTIONSFLAG_12 =
!endif
!if "$(USE_EXCEPTIONS)" == "1"
__EXCEPTIONSFLAG_12 = /EHsc
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "0"
__NO_VC_CRTDBG_p = /D__NO_VC_CRTDBG__
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_FLAG)" == "1"
__NO_VC_CRTDBG_p = /D__NO_VC_CRTDBG__
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "0"
__NO_VC_CRTDBG_p_1 = /d __NO_VC_CRTDBG__
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_FLAG)" == "1"
__NO_VC_CRTDBG_p_1 = /d __NO_VC_CRTDBG__
!endif
!if "$(TARGET_CPU)" == ""
__TARGET_CPU_COMPFLAG_p = /DTARGET_CPU_COMPFLAG=0
!endif
!if "$(TARGET_CPU)" == "" && "$(VISUALSTUDIOPLATFORM)" == "X64"
__TARGET_CPU_COMPFLAG_p =
!endif
!if "$(TARGET_CPU)" == "" && "$(VISUALSTUDIOPLATFORM)" == "x64"
__TARGET_CPU_COMPFLAG_p =
!endif
!if "$(TARGET_CPU)" == ""
__TARGET_CPU_COMPFLAG_p_1 = /d TARGET_CPU_COMPFLAG=0
!endif
!if "$(TARGET_CPU)" == "" && "$(VISUALSTUDIOPLATFORM)" == "X64"
__TARGET_CPU_COMPFLAG_p_1 =
!endif
!if "$(TARGET_CPU)" == "" && "$(VISUALSTUDIOPLATFORM)" == "x64"
__TARGET_CPU_COMPFLAG_p_1 =
!endif
!if "$(WXUNIV)" == "1"
__WXUNIV_DEFINE_p = /D__WXUNIVERSAL__
!endif
!if "$(WXUNIV)" == "1"
__WXUNIV_DEFINE_p_1 = /d __WXUNIVERSAL__
!endif
!if "$(DEBUG_FLAG)" == "0"
__DEBUG_DEFINE_p = /DwxDEBUG_LEVEL=0
!endif
!if "$(DEBUG_FLAG)" == "0"
__DEBUG_DEFINE_p_1 = /d wxDEBUG_LEVEL=0
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default"
__NDEBUG_DEFINE_p = /DNDEBUG
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "0"
__NDEBUG_DEFINE_p = /DNDEBUG
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default"
__NDEBUG_DEFINE_p_1 = /d NDEBUG
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "0"
__NDEBUG_DEFINE_p_1 = /d NDEBUG
!endif
!if "$(USE_EXCEPTIONS)" == "0"
__EXCEPTIONS_DEFINE_p = /DwxNO_EXCEPTIONS
!endif
!if "$(USE_EXCEPTIONS)" == "0"
__EXCEPTIONS_DEFINE_p_1 = /d wxNO_EXCEPTIONS
!endif
!if "$(USE_RTTI)" == "0"
__RTTI_DEFINE_p = /DwxNO_RTTI
!endif
!if "$(USE_RTTI)" == "0"
__RTTI_DEFINE_p_1 = /d wxNO_RTTI
!endif
!if "$(USE_THREADS)" == "0"
__THREAD_DEFINE_p = /DwxNO_THREADS
!endif
!if "$(USE_THREADS)" == "0"
__THREAD_DEFINE_p_1 = /d wxNO_THREADS
!endif
!if "$(USE_CAIRO)" == "1"
____CAIRO_INCLUDEDIR_FILENAMES_p = /I$(CAIRO_ROOT)\include\cairo
!endif
!if "$(USE_CAIRO)" == "1"
____CAIRO_INCLUDEDIR_FILENAMES_1_p = /i $(CAIRO_ROOT)\include\cairo
!endif
!if "$(SHARED)" == "1"
__DLLFLAG_p = /DWXUSINGDLL
!endif
!if "$(SHARED)" == "1"
__DLLFLAG_p_1 = /d WXUSINGDLL
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_AUI_p = \
wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_aui.lib
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_RICHTEXT_p = \
wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_richtext.lib
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_HTML_p = \
wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_html.lib
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_XML_p = \
wxbase$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_xml.lib
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_CORE_p = \
wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core.lib
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_BASE_p = \
wxbase$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).lib
!endif
!if "$(MONOLITHIC)" == "1"
__WXLIB_MONO_p = \
wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).lib
!endif
!if "$(MONOLITHIC)" == "1" && "$(USE_STC)" == "1"
__LIB_SCINTILLA_IF_MONO_p = wxscintilla$(WXDEBUGFLAG).lib
!endif
!if "$(MONOLITHIC)" == "1" && "$(USE_STC)" == "1"
__LIB_LEXILLA_IF_MONO_p = $(__LIB_LEXILLA_p)
!endif
!if "$(USE_STC)" == "1"
__LIB_LEXILLA_p = wxlexilla$(WXDEBUGFLAG).lib
!endif
!if "$(USE_GUI)" == "1"
__LIB_TIFF_p = wxtiff$(WXDEBUGFLAG).lib
!endif
!if "$(USE_GUI)" == "1"
__LIB_JPEG_p = wxjpeg$(WXDEBUGFLAG).lib
!endif
!if "$(USE_GUI)" == "1"
__LIB_PNG_p = wxpng$(WXDEBUGFLAG).lib
!endif
!if "$(USE_GUI)" == "1"
__LIB_WEBP_p = wxwebp$(WXDEBUGFLAG).lib
!endif
!if "$(USE_CAIRO)" == "1"
__CAIRO_LIB_p = cairo.lib
!endif
!if "$(USE_CAIRO)" == "1"
____CAIRO_LIBDIR_FILENAMES_p = /LIBPATH:$(CAIRO_ROOT)\lib
!endif
all: $(OBJS)
$(OBJS):
-if not exist $(OBJS) mkdir $(OBJS)
### Targets: ###
all: $(OBJS)\screenshotgen.exe bitmaps xml
clean:
-if exist $(OBJS)\*.obj del $(OBJS)\*.obj
-if exist $(OBJS)\*.res del $(OBJS)\*.res
-if exist $(OBJS)\*.pch del $(OBJS)\*.pch
-if exist $(OBJS)\screenshotgen.exe del $(OBJS)\screenshotgen.exe
-if exist $(OBJS)\screenshotgen.ilk del $(OBJS)\screenshotgen.ilk
-if exist $(OBJS)\screenshotgen.pdb del $(OBJS)\screenshotgen.pdb
$(OBJS)\screenshotgen.exe: $(SCREENSHOTGEN_OBJECTS) $(OBJS)\screenshotgen_screenshotgen.res
link /NOLOGO /OUT:$@ $(__DEBUGINFO_1) /pdb:"$(OBJS)\screenshotgen.pdb" $(__DEBUGINFO_2) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) $(WIN32_DPI_LINKFLAG) /SUBSYSTEM:WINDOWS $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) @<<
$(SCREENSHOTGEN_OBJECTS) $(SCREENSHOTGEN_RESOURCES) $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_HTML_p) $(__WXLIB_XML_p) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_LEXILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_WEBP_p) wxzlib$(WXDEBUGFLAG).lib wxregexu$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib gdiplus.lib msimg32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib ws2_32.lib wininet.lib
<<
bitmaps:
if not exist $(OBJS)\bitmaps mkdir $(OBJS)\bitmaps
for %f in (wxwin32x32.png bell.png sound.png dropbuth.png dropbutn.png dropbutp.png throbber.gif) do if not exist $(OBJS)\bitmaps\%f copy .\bitmaps\%f $(OBJS)\bitmaps
xml:
if not exist $(OBJS) mkdir $(OBJS)
for %f in (richtext.xml) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
$(OBJS)\screenshotgen_screenshot_app.obj: .\screenshot_app.cpp
$(CXX) /c /nologo /TP /Fo$@ $(SCREENSHOTGEN_CXXFLAGS) .\screenshot_app.cpp
$(OBJS)\screenshotgen_screenshot_main.obj: .\screenshot_main.cpp
$(CXX) /c /nologo /TP /Fo$@ $(SCREENSHOTGEN_CXXFLAGS) .\screenshot_main.cpp
$(OBJS)\screenshotgen_guiframe.obj: .\guiframe.cpp
$(CXX) /c /nologo /TP /Fo$@ $(SCREENSHOTGEN_CXXFLAGS) .\guiframe.cpp
$(OBJS)\screenshotgen_customcombo.obj: .\customcombo.cpp
$(CXX) /c /nologo /TP /Fo$@ $(SCREENSHOTGEN_CXXFLAGS) .\customcombo.cpp
$(OBJS)\screenshotgen_autocapture.obj: .\autocapture.cpp
$(CXX) /c /nologo /TP /Fo$@ $(SCREENSHOTGEN_CXXFLAGS) .\autocapture.cpp
$(OBJS)\screenshotgen_screenshotgen.res: .\screenshotgen.rc
rc /fo$@ /d WIN32 $(____DEBUGRUNTIME_3_p_1) /d _CRT_SECURE_NO_DEPRECATE=1 /d _CRT_NON_CONFORMING_SWPRINTFS=1 /d _SCL_SECURE_NO_WARNINGS=1 $(__NO_VC_CRTDBG_p_1) $(__TARGET_CPU_COMPFLAG_p_1) /d __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) /i $(SETUPHDIR) /i .\..\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_1_p) /i . $(__DLLFLAG_p_1) /d _WINDOWS /i .\..\..\..\samples /d NOPCH .\screenshotgen.rc

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<richtext version="1.0.0.0" xmlns="http://www.wxwidgets.org">
<paragraphlayout textcolor="#000000" fontsize="12" fontstyle="90" fontweight="90" fontunderlined="0" fontface="serif" alignment="1" parspacingafter="10" parspacingbefore="0" linespacing="10">
<paragraph fontweight="92" alignment="2" parspacingafter="20" parspacingbefore="0">
<text fontsize="14" fontweight="92">wxRichTextCtrl</text>
<text fontsize="14"></text>
</paragraph>
<paragraph parspacingafter="20" parspacingbefore="0">
<text fontsize="14">"What can you do with this control?"</text>
<image imagetype="15">
<data>89504E470D0A1A0A0000000D4948445200000020000000200806000000737A7AF40000000473424954080808087C0864880000013A494441545885ED57D116C2200845D787EDD3F763450FC622075E3477D643BC5483EEBD03454C292F74A5DD46FEC48F3BD7CF525ED2A90234291FE889527AFB7BC424540221B6487DD0B8908CC899FBC8894A3CB35DAADACC0C8CBCB54FF0FA74B2E1666006B9E0B4B271102069B72C818A223F1480C8997D12E4F7B2D05C8435B800D524C8DF12B10BF0DE5E836B20F43B5A0E98010DDEB306A28B385482332D13B5179F361413C5D0EBE03732F01780ACB7C3F5C467A2725044B6D8B41875308507924D0110D9FD4162D62868548074B6CD10A28985BC6F7851F300EA0722C2B308F97009883E7BBC16B22A7F0F7979564D44D1AED8DBF72D7222631B467684908ECC8B50C02E6468CAB771BCB72FFEC6581E2D47931C8CE6CD4E28E518E98411F2121BBC1BE29B91FA3EF36684C48C907E2D60A65D7E1C3F01DF3DAE9FE1B576060000000049454E44AE426082</data>
</image>
<text>" You can change "</text>
<text textcolor="#FF0000">"text foreground colour "</text>
<text>"and "</text>
<text textcolor="#0000FF" bgcolor="#00FF00">"text background colour."</text>
<text>" Naturally you can make things "</text>
<text fontweight="92">"bold, "</text>
<text fontstyle="93">"italic "</text>
<text fontunderlined="1">or underlined.</text>
<text fontsize="14">" Different font sizes on the same line is allowed, too."</text>
</paragraph>
</paragraphlayout>
</richtext>

View File

@@ -0,0 +1,40 @@
/////////////////////////////////////////////////////////////////////////////
// Name: screenshot_app.cpp
// Purpose: Implement Application Class
// Author: Utensil Candel (UtensilCandel@@gmail.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
// for all others, include the necessary headers wxWidgets headers)
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/richtext/richtextxml.h"
#include "screenshot_app.h"
#include "screenshot_main.h"
// ----------------------------------------------------------------------------
// ScreenshotApp
// ----------------------------------------------------------------------------
wxIMPLEMENT_APP(ScreenshotApp);
bool ScreenshotApp::OnInit()
{
// Init all Image handlers
wxInitAllImageHandlers();
// Add richtext extra handlers (plain text is automatically added)
wxRichTextBuffer::AddHandler(new wxRichTextXMLHandler);
ScreenshotFrame* frame = new ScreenshotFrame(0L);
frame->Show();
return true;
}

View File

@@ -0,0 +1,19 @@
/////////////////////////////////////////////////////////////////////////////
// Name: screenshot_app.h
// Purpose: Defines the Application Class
// Author: Utensil Candel (UtensilCandel@@gmail.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _SCREENSHOT_APP_H_
#define _SCREENSHOT_APP_H_
#include "wx/app.h"
class ScreenshotApp : public wxApp
{
public:
virtual bool OnInit();
};
#endif // _SCREENSHOT_APP_H_

View File

@@ -0,0 +1,186 @@
/////////////////////////////////////////////////////////////////////////////
// Name: screenshot_main.cpp
// Purpose: Implements the window containing all controls.
// Author: Utensil Candel (UtensilCandel@@gmail.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
// for all others, include the necessary headers wxWidgets headers)
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/aboutdlg.h"
#include "wx/dir.h"
#include "screenshot_main.h"
#include "autocapture.h"
// ----------------------------------------------------------------------------
// ScreenshotFrame
// ----------------------------------------------------------------------------
ScreenshotFrame::ScreenshotFrame(wxFrame *frame) : GUIFrame(frame)
{
#if wxUSE_STATUSBAR
statusBar->SetStatusText(_("Welcome to the Automatic Screenshot Generator!"), 0);
#endif
// set minimum size hints
GetSizer()->SetSizeHints(this);
}
// ----------------------------------------------------------------------------
// ScreenshotFrame - event handlers
// ----------------------------------------------------------------------------
void ScreenshotFrame::OnClose(wxCloseEvent& WXUNUSED(event))
{
Destroy();
}
void ScreenshotFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Destroy();
}
void ScreenshotFrame::OnSeeScreenshots(wxCommandEvent& WXUNUSED(event))
{
wxString defaultDir = AutoCaptureMechanism::GetDefaultDirectoryAbsPath();
if (wxFileName::DirExists(defaultDir))
wxLaunchDefaultBrowser(defaultDir);
else
wxMessageBox(_("There isn't any screenshots yet."));
}
void ScreenshotFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxAboutDialogInfo info;
info.SetName(_("Automatic Screenshot Generator"));
info.SetVersion(_("1.0"));
info.SetDescription(_("This utility automatically creates screenshots of wxWidgets controls for use in wxWidgets documentation."));
info.SetCopyright(wxT("(C) 2008 Utensil Candel"));
wxAboutBox(info);
}
void ScreenshotFrame::OnCaptureFullScreen(wxCommandEvent& WXUNUSED(event))
{
// Create a DC for the whole screen area
wxScreenDC dcScreen;
// Get the size of the screenDC
wxCoord screenWidth, screenHeight;
dcScreen.GetSize(&screenWidth, &screenHeight);
wxBitmap fullscreen(1, 1);
AutoCaptureMechanism::Capture(&fullscreen, 0, 0, screenWidth, screenHeight);
AutoCaptureMechanism::Save(&fullscreen, wxT("fullscreen"));
wxMessageBox(_("A screenshot of the entire screen was saved as:\n\n ")
+ AutoCaptureMechanism::GetDefaultDirectoryAbsPath() + wxT("fullscreen.png"),
_("Full screen capture"), wxICON_INFORMATION|wxOK, this);
}
void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
{
wxString dir = AutoCaptureMechanism::GetDefaultDirectoryAbsPath();
// check if there are other screenshots taken before
if (wxFileName::DirExists(dir))
{
int choice = wxMessageBox(
_("It seems that you have already generated some screenshots.\n\nClick YES to delete them all (recommended) or NO to preserve them.\nClick CANCEL to cancel this auto-capture operation."),
_("Delete existing screenshots?"),
wxYES_NO | wxCANCEL | wxICON_QUESTION, this);
switch(choice)
{
case wxYES:
{
wxArrayString files;
wxDir::GetAllFiles(dir, &files, wxT("*.png"), wxDIR_FILES);
// remove all PNG files from the screenshots folder
int n = files.GetCount();
for (int i = 0; i < n; ++i)
wxRemoveFile(files[i]);
}
break;
case wxNO: break;
case wxCANCEL: return;
}
}
// proceed with the automatic screenshot capture
this->Maximize();
AutoCaptureMechanism auto_cap(m_notebook1);
auto_cap.RegisterControl(m_button1);
auto_cap.RegisterControl(m_staticText1);
auto_cap.RegisterControl(m_checkBox1, AJ_Union);
auto_cap.RegisterControl(m_checkBox2, AJ_UnionEnd);
auto_cap.RegisterControl(m_radioBtn1, AJ_Union);
auto_cap.RegisterControl(m_radioBtn2, AJ_UnionEnd);
auto_cap.RegisterControl(m_bpButton1);
auto_cap.RegisterControl(m_bitmap1);
auto_cap.RegisterControl(m_gauge1, wxT("wxGauge"));
auto_cap.RegisterControl(m_slider1);
auto_cap.RegisterControl(m_toggleBtn1, AJ_Union);
auto_cap.RegisterControl(m_toggleBtn2, AJ_UnionEnd);
auto_cap.RegisterControl(m_hyperlink1, wxT("wxHyperlinkCtrl"));
auto_cap.RegisterControl(m_spinCtrl1, AJ_RegionAdjust);
auto_cap.RegisterControl(m_spinBtn1);
auto_cap.RegisterControl(m_scrollBar1);
auto_cap.RegisterPageTurn();
auto_cap.RegisterControl(m_checkList1);
auto_cap.RegisterControl(m_listBox1);
auto_cap.RegisterControl(m_radioBox1);
auto_cap.RegisterControl(m_staticBox1);
auto_cap.RegisterControl(m_treeCtrl1);
auto_cap.RegisterControl(m_listCtrl1, wxT("wxListCtrl"));
auto_cap.RegisterControl(m_animationCtrl1);
auto_cap.RegisterControl(m_collPane1, wxT("wxCollapsiblePane"), AJ_Union);
auto_cap.RegisterControl(m_collPane2, AJ_UnionEnd);
auto_cap.RegisterPageTurn();
auto_cap.RegisterControl(m_textCtrl1, AJ_Union);
auto_cap.RegisterControl(m_textCtrl2, AJ_UnionEnd);
auto_cap.RegisterControl(m_richText1);
auto_cap.RegisterPageTurn();
auto_cap.RegisterControl(m_colourPicker1, wxT("wxColourPickerCtrl"));
auto_cap.RegisterControl(m_fontPicker1, wxT("wxFontPickerCtrl"));
auto_cap.RegisterControl(m_filePicker1, wxT("wxFilePickerCtrl"), AJ_RegionAdjust);
auto_cap.RegisterControl(m_calendar1, wxT("wxCalendarCtrl"), AJ_RegionAdjust);
auto_cap.RegisterControl(m_datePicker1, wxT("wxDatePickerCtrl"));
auto_cap.RegisterControl(m_genericDirCtrl1, wxT("wxGenericDirCtrl"));
auto_cap.RegisterControl(m_dirPicker1, wxT("wxDirPickerCtrl"), AJ_RegionAdjust);
auto_cap.RegisterPageTurn();
auto_cap.RegisterControl(m_choice1, AJ_Dropdown);
auto_cap.RegisterControl(m_comboBox1, AJ_Dropdown);
auto_cap.RegisterControl(m_bmpComboBox1, AJ_Dropdown);
auto_cap.RegisterControl(m_ownerDrawnComboBox1, AJ_Dropdown);
auto_cap.RegisterControl(m_comboCtrl1, AJ_Dropdown|AJ_Union);
auto_cap.RegisterControl(m_comboCtrl2, AJ_Dropdown|AJ_UnionEnd);
auto_cap.CaptureAll();
wxMessageBox(_("All screenshots were generated successfully in the folder:\n ") + dir,
_("Success"), wxOK|wxICON_INFORMATION, this);
}

View File

@@ -0,0 +1,30 @@
/////////////////////////////////////////////////////////////////////////////
// Name: screenshot_main.h
// Purpose: Defines the Application Frame
// Author: Utensil Candel (UtensilCandel@@gmail.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _SCREENSHOT_MAIN_H_
#define _SCREENSHOT_MAIN_H_
#include "guiframe.h"
class ScreenshotFrame : public GUIFrame
{
public:
ScreenshotFrame(wxFrame *frame);
~ScreenshotFrame() {}
protected: // event handlers
virtual void OnClose(wxCloseEvent& event);
virtual void OnQuit(wxCommandEvent& event);
virtual void OnAbout(wxCommandEvent& event);
virtual void OnSeeScreenshots( wxCommandEvent& event);
virtual void OnCaptureFullScreen( wxCommandEvent& event );
virtual void OnCaptureAllControls( wxCommandEvent& event );
};
#endif // _SCREENSHOT_MAIN_H_

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" ?>
<makefile>
<include file="../../../build/bakefiles/common_samples.bkl"/>
<exe id="screenshotgen" template="wx_util" template_append="wx_append">
<if cond="FORMAT=='autoconf'">
<!-- we need this for correct install_name_tool operations on Mac: -->
<ldflags>$(HEADER_PAD_OPTION)</ldflags>
<wx-mac-app-bundle/>
</if>
<sources>
screenshot_app.cpp
screenshot_main.cpp
guiframe.cpp
customcombo.cpp
autocapture.cpp
</sources>
<headers>
screenshot_app.h
screenshot_main.h
guiframe.h
customcombo.h
autocapture.h
</headers>
<wx-lib>aui</wx-lib>
<wx-lib>richtext</wx-lib>
<wx-lib>html</wx-lib>
<wx-lib>xml</wx-lib>
<wx-lib>core</wx-lib>
<wx-lib>base</wx-lib>
<win32-res>screenshotgen.rc</win32-res>
<install-to>$(BINDIR)</install-to>
</exe>
<wx-data id="bitmaps">
<dstdir>$(BUILDDIR)/bitmaps</dstdir>
<srcdir>$(SRCDIR)/bitmaps</srcdir>
<files>
wxwin32x32.png
bell.png
sound.png
dropbuth.png
dropbutn.png
dropbutp.png
throbber.gif
</files>
</wx-data>
<wx-data id="xml">
<files>
richtext.xml
</files>
</wx-data>
</makefile>

View File

@@ -0,0 +1 @@
#include "wx/msw/wx.rc"