]> git.saurik.com Git - wxWidgets.git/commitdiff
Merge of SOC2010_RTC_IMAGES branch.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 30 Sep 2010 10:27:07 +0000 (10:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 30 Sep 2010 10:27:07 +0000 (10:27 +0000)
Added floating images and image property dialog to wxRichTextCtrl, by Mingquan
Yang as part of GSOC 2010. Also changed image block creation to use a memory
stream instead of creating a temporary file.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

25 files changed:
Makefile.in
build/bakefiles/files.bkl
build/msw/makefile.bcc
build/msw/makefile.gcc
build/msw/makefile.vc
build/msw/makefile.wat
build/msw/wx_core.dsp
build/msw/wx_richtext.dsp
build/msw/wx_vc7_core.vcproj
build/msw/wx_vc7_richtext.vcproj
build/msw/wx_vc8_core.vcproj
build/msw/wx_vc8_richtext.vcproj
build/msw/wx_vc9_core.vcproj
build/msw/wx_vc9_richtext.vcproj
include/wx/richtext/richtextbuffer.h
include/wx/richtext/richtextctrl.h
include/wx/richtext/richtextimagedlg.h [new file with mode: 0644]
samples/richtext/richtext.cpp
src/richtext/readme [new file with mode: 0644]
src/richtext/richtextbuffer.cpp
src/richtext/richtextctrl.cpp
src/richtext/richtextdialogs.pjd
src/richtext/richtexthtml.cpp
src/richtext/richtextimagedlg.cpp [new file with mode: 0644]
src/richtext/richtextxml.cpp

index cfffa313f8a8fabe7557295e605890a3daf27e80..e6ca34ef69965ab11741fcf54fa0575c9215bd33 100644 (file)
@@ -1882,7 +1882,8 @@ RICHTEXTDLL_OBJECTS =  \
        richtextdll_richtextformatdlg.o \
        richtextdll_richtextsymboldlg.o \
        richtextdll_richtextstyledlg.o \
-       richtextdll_richtextprint.o
+       richtextdll_richtextprint.o \
+       richtextdll_richtextimagedlg.o
 RICHTEXTDLL_ODEP = $(_____pch_wxprec_richtextdll_wx_wxprec_h_gch___depname)
 RICHTEXTLIB_CXXFLAGS = $(__richtextlib_PCH_INC) -D__WX$(TOOLKIT)__ \
        $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \
@@ -1898,7 +1899,8 @@ RICHTEXTLIB_OBJECTS =  \
        richtextlib_richtextformatdlg.o \
        richtextlib_richtextsymboldlg.o \
        richtextlib_richtextstyledlg.o \
-       richtextlib_richtextprint.o
+       richtextlib_richtextprint.o \
+       richtextlib_richtextimagedlg.o
 RICHTEXTLIB_ODEP = $(_____pch_wxprec_richtextlib_wx_wxprec_h_gch___depname)
 STCDLL_CXXFLAGS = $(__stcdll_PCH_INC) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \
        $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
@@ -4132,6 +4134,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS =  \
        wx/richtext/richtextsymboldlg.h \
        wx/richtext/richtextstyledlg.h \
        wx/richtext/richtextprint.h \
+       wx/richtext/richtextimagedlg.h \
        wx/stc/stc.h
 @COND_USE_GUI_1@ALL_GUI_HEADERS = $(COND_USE_GUI_1_ALL_GUI_HEADERS)
 COND_MONOLITHIC_1_SHARED_1___monodll___depname = \
@@ -4426,6 +4429,7 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS =  \
        monodll_richtextsymboldlg.o \
        monodll_richtextstyledlg.o \
        monodll_richtextprint.o \
+       monodll_richtextimagedlg.o \
        monodll_stc.o \
        monodll_PlatWX.o \
        monodll_ScintillaWX.o
@@ -6299,6 +6303,7 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS_1 =  \
        monolib_richtextsymboldlg.o \
        monolib_richtextstyledlg.o \
        monolib_richtextprint.o \
+       monolib_richtextimagedlg.o \
        monolib_stc.o \
        monolib_PlatWX.o \
        monolib_ScintillaWX.o
@@ -17148,6 +17153,9 @@ monodll_richtextstyledlg.o: $(srcdir)/src/richtext/richtextstyledlg.cpp $(MONODL
 monodll_richtextprint.o: $(srcdir)/src/richtext/richtextprint.cpp $(MONODLL_ODEP)
        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/richtext/richtextprint.cpp
 
+monodll_richtextimagedlg.o: $(srcdir)/src/richtext/richtextimagedlg.cpp $(MONODLL_ODEP)
+       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/richtext/richtextimagedlg.cpp
+
 monodll_stc.o: $(srcdir)/src/stc/stc.cpp $(MONODLL_ODEP)
        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/stc/stc.cpp
 
@@ -22368,6 +22376,9 @@ monolib_richtextstyledlg.o: $(srcdir)/src/richtext/richtextstyledlg.cpp $(MONOLI
 monolib_richtextprint.o: $(srcdir)/src/richtext/richtextprint.cpp $(MONOLIB_ODEP)
        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/richtext/richtextprint.cpp
 
+monolib_richtextimagedlg.o: $(srcdir)/src/richtext/richtextimagedlg.cpp $(MONOLIB_ODEP)
+       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/richtext/richtextimagedlg.cpp
+
 monolib_stc.o: $(srcdir)/src/stc/stc.cpp $(MONOLIB_ODEP)
        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/stc/stc.cpp
 
@@ -36024,6 +36035,9 @@ richtextdll_richtextstyledlg.o: $(srcdir)/src/richtext/richtextstyledlg.cpp $(RI
 richtextdll_richtextprint.o: $(srcdir)/src/richtext/richtextprint.cpp $(RICHTEXTDLL_ODEP)
        $(CXXC) -c -o $@ $(RICHTEXTDLL_CXXFLAGS) $(srcdir)/src/richtext/richtextprint.cpp
 
+richtextdll_richtextimagedlg.o: $(srcdir)/src/richtext/richtextimagedlg.cpp $(RICHTEXTDLL_ODEP)
+       $(CXXC) -c -o $@ $(RICHTEXTDLL_CXXFLAGS) $(srcdir)/src/richtext/richtextimagedlg.cpp
+
 richtextlib_richtextctrl.o: $(srcdir)/src/richtext/richtextctrl.cpp $(RICHTEXTLIB_ODEP)
        $(CXXC) -c -o $@ $(RICHTEXTLIB_CXXFLAGS) $(srcdir)/src/richtext/richtextctrl.cpp
 
@@ -36051,6 +36065,9 @@ richtextlib_richtextstyledlg.o: $(srcdir)/src/richtext/richtextstyledlg.cpp $(RI
 richtextlib_richtextprint.o: $(srcdir)/src/richtext/richtextprint.cpp $(RICHTEXTLIB_ODEP)
        $(CXXC) -c -o $@ $(RICHTEXTLIB_CXXFLAGS) $(srcdir)/src/richtext/richtextprint.cpp
 
+richtextlib_richtextimagedlg.o: $(srcdir)/src/richtext/richtextimagedlg.cpp $(RICHTEXTLIB_ODEP)
+       $(CXXC) -c -o $@ $(RICHTEXTLIB_CXXFLAGS) $(srcdir)/src/richtext/richtextimagedlg.cpp
+
 stcdll_version_rc.o: $(srcdir)/src/msw/version.rc $(STCDLL_ODEP)
        $(WINDRES) -i$< -o$@    --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_63) $(__DEBUG_DEFINE_p_61)  $(__EXCEPTIONS_DEFINE_p_61) $(__RTTI_DEFINE_p_61) $(__THREAD_DEFINE_p_61)   --define WXBUILDING --define WXDLLNAME=$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG) $(__RCDEFDIR_p) --include-dir $(top_srcdir)/include $(__INC_TIFF_BUILD_p_62) $(__INC_TIFF_p_62) $(__INC_JPEG_p_62) $(__INC_PNG_p_61) $(__INC_ZLIB_p_63) $(__INC_REGEX_p_61) $(__INC_EXPAT_p_61) --include-dir $(top_srcdir)/src/stc/scintilla/include --include-dir $(top_srcdir)/src/stc/scintilla/src --define __WX__ --define SCI_LEXER --define LINK_LEXERS --define WXUSINGDLL --define WXMAKINGDLL_STC
 
index 56fb7c0aa8267db0112197778ccd1bf47a7060a7..3b0b289b249fcc4ee327b74850ed999dd333f61f 100644 (file)
@@ -3596,6 +3596,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/richtext/richtextsymboldlg.cpp
     src/richtext/richtextstyledlg.cpp
     src/richtext/richtextprint.cpp
+    src/richtext/richtextimagedlg.cpp
 </set>
 <set var="RICHTEXT_HDR" hints="files">
     wx/richtext/richtextctrl.h
@@ -3607,6 +3608,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     wx/richtext/richtextsymboldlg.h
     wx/richtext/richtextstyledlg.h
     wx/richtext/richtextprint.h
+    wx/richtext/richtextimagedlg.h
 </set>
 
 
index ebaec950f2c27d159f70014e7fed10d4a91cf01b..ba00f19f0792bd6f097d4856e45accbddb231636 100644 (file)
@@ -1399,7 +1399,8 @@ RICHTEXTDLL_OBJECTS =  \
        $(OBJS)\richtextdll_richtextformatdlg.obj \\r
        $(OBJS)\richtextdll_richtextsymboldlg.obj \\r
        $(OBJS)\richtextdll_richtextstyledlg.obj \\r
-       $(OBJS)\richtextdll_richtextprint.obj\r
+       $(OBJS)\richtextdll_richtextprint.obj \\r
+       $(OBJS)\richtextdll_richtextimagedlg.obj\r
 RICHTEXTLIB_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \\r
        $(__OPTIMIZEFLAG) $(__THREADSFLAG) -D__WXMSW__ $(__WXUNIV_DEFINE_p) \\r
        $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \\r
@@ -1419,7 +1420,8 @@ RICHTEXTLIB_OBJECTS =  \
        $(OBJS)\richtextlib_richtextformatdlg.obj \\r
        $(OBJS)\richtextlib_richtextsymboldlg.obj \\r
        $(OBJS)\richtextlib_richtextstyledlg.obj \\r
-       $(OBJS)\richtextlib_richtextprint.obj\r
+       $(OBJS)\richtextlib_richtextprint.obj \\r
+       $(OBJS)\richtextlib_richtextimagedlg.obj\r
 STCDLL_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \\r
        $(__OPTIMIZEFLAG) $(__THREADSFLAG) -D__WXMSW__ $(__WXUNIV_DEFINE_p) \\r
        $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \\r
@@ -1663,6 +1665,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_richtextsymboldlg.obj \\r
        $(OBJS)\monodll_richtextstyledlg.obj \\r
        $(OBJS)\monodll_richtextprint.obj \\r
+       $(OBJS)\monodll_richtextimagedlg.obj \\r
        $(OBJS)\monodll_stc.obj \\r
        $(OBJS)\monodll_PlatWX.obj \\r
        $(OBJS)\monodll_ScintillaWX.obj\r
@@ -2383,6 +2386,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_richtextsymboldlg.obj \\r
        $(OBJS)\monolib_richtextstyledlg.obj \\r
        $(OBJS)\monolib_richtextprint.obj \\r
+       $(OBJS)\monolib_richtextimagedlg.obj \\r
        $(OBJS)\monolib_stc.obj \\r
        $(OBJS)\monolib_PlatWX.obj \\r
        $(OBJS)\monolib_ScintillaWX.obj\r
@@ -6793,6 +6797,9 @@ $(OBJS)\monodll_richtextstyledlg.obj: ..\..\src\richtext\richtextstyledlg.cpp
 $(OBJS)\monodll_richtextprint.obj: ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\richtext\richtextprint.cpp\r
 \r
+$(OBJS)\monodll_richtextimagedlg.obj: ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\richtext\richtextimagedlg.cpp\r
+\r
 $(OBJS)\monodll_stc.obj: ..\..\src\stc\stc.cpp\r
        $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\stc\stc.cpp\r
 \r
@@ -9028,6 +9035,9 @@ $(OBJS)\monolib_richtextstyledlg.obj: ..\..\src\richtext\richtextstyledlg.cpp
 $(OBJS)\monolib_richtextprint.obj: ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\richtext\richtextprint.cpp\r
 \r
+$(OBJS)\monolib_richtextimagedlg.obj: ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\richtext\richtextimagedlg.cpp\r
+\r
 $(OBJS)\monolib_stc.obj: ..\..\src\stc\stc.cpp\r
        $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\stc\stc.cpp\r
 \r
@@ -14633,6 +14643,9 @@ $(OBJS)\richtextdll_richtextstyledlg.obj: ..\..\src\richtext\richtextstyledlg.cp
 $(OBJS)\richtextdll_richtextprint.obj: ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) -q -c -P -o$@ $(RICHTEXTDLL_CXXFLAGS) ..\..\src\richtext\richtextprint.cpp\r
 \r
+$(OBJS)\richtextdll_richtextimagedlg.obj: ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) -q -c -P -o$@ $(RICHTEXTDLL_CXXFLAGS) ..\..\src\richtext\richtextimagedlg.cpp\r
+\r
 $(OBJS)\richtextlib_dummy.obj: ..\..\src\common\dummy.cpp\r
        $(CXX) -q -c -P -o$@ $(RICHTEXTLIB_CXXFLAGS) -H ..\..\src\common\dummy.cpp\r
 \r
@@ -14663,6 +14676,9 @@ $(OBJS)\richtextlib_richtextstyledlg.obj: ..\..\src\richtext\richtextstyledlg.cp
 $(OBJS)\richtextlib_richtextprint.obj: ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) -q -c -P -o$@ $(RICHTEXTLIB_CXXFLAGS) ..\..\src\richtext\richtextprint.cpp\r
 \r
+$(OBJS)\richtextlib_richtextimagedlg.obj: ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) -q -c -P -o$@ $(RICHTEXTLIB_CXXFLAGS) ..\..\src\richtext\richtextimagedlg.cpp\r
+\r
 $(OBJS)\stcdll_dummy.obj: ..\..\src\common\dummy.cpp\r
        $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) -H ..\..\src\common\dummy.cpp\r
 \r
index 0fe7a187a043f9ac59805662e9b73775c23a5df1..e49c3a6292bf1b68411ad60a0819146e5817bc6f 100644 (file)
@@ -1402,7 +1402,8 @@ RICHTEXTDLL_OBJECTS =  \
        $(OBJS)\richtextdll_richtextformatdlg.o \\r
        $(OBJS)\richtextdll_richtextsymboldlg.o \\r
        $(OBJS)\richtextdll_richtextstyledlg.o \\r
-       $(OBJS)\richtextdll_richtextprint.o\r
+       $(OBJS)\richtextdll_richtextprint.o \\r
+       $(OBJS)\richtextdll_richtextimagedlg.o\r
 RICHTEXTLIB_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) \\r
        $(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) \\r
        $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \\r
@@ -1422,7 +1423,8 @@ RICHTEXTLIB_OBJECTS =  \
        $(OBJS)\richtextlib_richtextformatdlg.o \\r
        $(OBJS)\richtextlib_richtextsymboldlg.o \\r
        $(OBJS)\richtextlib_richtextstyledlg.o \\r
-       $(OBJS)\richtextlib_richtextprint.o\r
+       $(OBJS)\richtextlib_richtextprint.o \\r
+       $(OBJS)\richtextlib_richtextimagedlg.o\r
 STCDLL_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) $(GCCFLAGS) \\r
        -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \\r
        $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \\r
@@ -1673,6 +1675,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_richtextsymboldlg.o \\r
        $(OBJS)\monodll_richtextstyledlg.o \\r
        $(OBJS)\monodll_richtextprint.o \\r
+       $(OBJS)\monodll_richtextimagedlg.o \\r
        $(OBJS)\monodll_stc.o \\r
        $(OBJS)\monodll_PlatWX.o \\r
        $(OBJS)\monodll_ScintillaWX.o\r
@@ -2399,6 +2402,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_richtextsymboldlg.o \\r
        $(OBJS)\monolib_richtextstyledlg.o \\r
        $(OBJS)\monolib_richtextprint.o \\r
+       $(OBJS)\monolib_richtextimagedlg.o \\r
        $(OBJS)\monolib_stc.o \\r
        $(OBJS)\monolib_PlatWX.o \\r
        $(OBJS)\monolib_ScintillaWX.o\r
@@ -6943,6 +6947,9 @@ $(OBJS)\monodll_richtextstyledlg.o: ../../src/richtext/richtextstyledlg.cpp
 $(OBJS)\monodll_richtextprint.o: ../../src/richtext/richtextprint.cpp\r
        $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<\r
 \r
+$(OBJS)\monodll_richtextimagedlg.o: ../../src/richtext/richtextimagedlg.cpp\r
+       $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<\r
+\r
 $(OBJS)\monodll_stc.o: ../../src/stc/stc.cpp\r
        $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<\r
 \r
@@ -9178,6 +9185,9 @@ $(OBJS)\monolib_richtextstyledlg.o: ../../src/richtext/richtextstyledlg.cpp
 $(OBJS)\monolib_richtextprint.o: ../../src/richtext/richtextprint.cpp\r
        $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<\r
 \r
+$(OBJS)\monolib_richtextimagedlg.o: ../../src/richtext/richtextimagedlg.cpp\r
+       $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<\r
+\r
 $(OBJS)\monolib_stc.o: ../../src/stc/stc.cpp\r
        $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<\r
 \r
@@ -14783,6 +14793,9 @@ $(OBJS)\richtextdll_richtextstyledlg.o: ../../src/richtext/richtextstyledlg.cpp
 $(OBJS)\richtextdll_richtextprint.o: ../../src/richtext/richtextprint.cpp\r
        $(CXX) -c -o $@ $(RICHTEXTDLL_CXXFLAGS) $(CPPDEPS) $<\r
 \r
+$(OBJS)\richtextdll_richtextimagedlg.o: ../../src/richtext/richtextimagedlg.cpp\r
+       $(CXX) -c -o $@ $(RICHTEXTDLL_CXXFLAGS) $(CPPDEPS) $<\r
+\r
 $(OBJS)\richtextlib_dummy.o: ../../src/common/dummy.cpp\r
        $(CXX) -c -o $@ $(RICHTEXTLIB_CXXFLAGS) $(CPPDEPS) $<\r
 \r
@@ -14813,6 +14826,9 @@ $(OBJS)\richtextlib_richtextstyledlg.o: ../../src/richtext/richtextstyledlg.cpp
 $(OBJS)\richtextlib_richtextprint.o: ../../src/richtext/richtextprint.cpp\r
        $(CXX) -c -o $@ $(RICHTEXTLIB_CXXFLAGS) $(CPPDEPS) $<\r
 \r
+$(OBJS)\richtextlib_richtextimagedlg.o: ../../src/richtext/richtextimagedlg.cpp\r
+       $(CXX) -c -o $@ $(RICHTEXTLIB_CXXFLAGS) $(CPPDEPS) $<\r
+\r
 $(OBJS)\stcdll_dummy.o: ../../src/common/dummy.cpp\r
        $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<\r
 \r
index 46b9031bc925260cca437223aefd32ddcf726d29..af9255f2a185ad518ba8c7c54334d21a94a02d80 100644 (file)
@@ -1502,7 +1502,8 @@ RICHTEXTDLL_OBJECTS =  \
        $(OBJS)\richtextdll_richtextformatdlg.obj \\r
        $(OBJS)\richtextdll_richtextsymboldlg.obj \\r
        $(OBJS)\richtextdll_richtextstyledlg.obj \\r
-       $(OBJS)\richtextdll_richtextprint.obj\r
+       $(OBJS)\richtextdll_richtextprint.obj \\r
+       $(OBJS)\richtextdll_richtextimagedlg.obj\r
 RICHTEXTDLL_RESOURCES =  \\r
        $(OBJS)\richtextdll_version.res\r
 RICHTEXTLIB_CXXFLAGS = /M$(__RUNTIME_LIBS_534)$(__DEBUGRUNTIME) /DWIN32 \\r
@@ -1526,7 +1527,8 @@ RICHTEXTLIB_OBJECTS =  \
        $(OBJS)\richtextlib_richtextformatdlg.obj \\r
        $(OBJS)\richtextlib_richtextsymboldlg.obj \\r
        $(OBJS)\richtextlib_richtextstyledlg.obj \\r
-       $(OBJS)\richtextlib_richtextprint.obj\r
+       $(OBJS)\richtextlib_richtextprint.obj \\r
+       $(OBJS)\richtextlib_richtextimagedlg.obj\r
 STCDLL_CXXFLAGS = /M$(__RUNTIME_LIBS_550)$(__DEBUGRUNTIME) /DWIN32 \\r
        $(__DEBUGINFO) \\r
        /Fd$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_stc_vc$(VENDORTAG).pdb \\r
@@ -1871,6 +1873,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_richtextsymboldlg.obj \\r
        $(OBJS)\monodll_richtextstyledlg.obj \\r
        $(OBJS)\monodll_richtextprint.obj \\r
+       $(OBJS)\monodll_richtextimagedlg.obj \\r
        $(OBJS)\monodll_stc.obj \\r
        $(OBJS)\monodll_PlatWX.obj \\r
        $(OBJS)\monodll_ScintillaWX.obj\r
@@ -2597,6 +2600,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_richtextsymboldlg.obj \\r
        $(OBJS)\monolib_richtextstyledlg.obj \\r
        $(OBJS)\monolib_richtextprint.obj \\r
+       $(OBJS)\monolib_richtextimagedlg.obj \\r
        $(OBJS)\monolib_stc.obj \\r
        $(OBJS)\monolib_PlatWX.obj \\r
        $(OBJS)\monolib_ScintillaWX.obj\r
@@ -7373,6 +7377,9 @@ $(OBJS)\monodll_richtextstyledlg.obj: ..\..\src\richtext\richtextstyledlg.cpp
 $(OBJS)\monodll_richtextprint.obj: ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\richtext\richtextprint.cpp\r
 \r
+$(OBJS)\monodll_richtextimagedlg.obj: ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\richtext\richtextimagedlg.cpp\r
+\r
 $(OBJS)\monodll_stc.obj: ..\..\src\stc\stc.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\stc\stc.cpp\r
 \r
@@ -9608,6 +9615,9 @@ $(OBJS)\monolib_richtextstyledlg.obj: ..\..\src\richtext\richtextstyledlg.cpp
 $(OBJS)\monolib_richtextprint.obj: ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\richtext\richtextprint.cpp\r
 \r
+$(OBJS)\monolib_richtextimagedlg.obj: ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\richtext\richtextimagedlg.cpp\r
+\r
 $(OBJS)\monolib_stc.obj: ..\..\src\stc\stc.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\stc\stc.cpp\r
 \r
@@ -15213,6 +15223,9 @@ $(OBJS)\richtextdll_richtextstyledlg.obj: ..\..\src\richtext\richtextstyledlg.cp
 $(OBJS)\richtextdll_richtextprint.obj: ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(RICHTEXTDLL_CXXFLAGS) ..\..\src\richtext\richtextprint.cpp\r
 \r
+$(OBJS)\richtextdll_richtextimagedlg.obj: ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) /c /nologo /TP /Fo$@ $(RICHTEXTDLL_CXXFLAGS) ..\..\src\richtext\richtextimagedlg.cpp\r
+\r
 $(OBJS)\richtextlib_dummy.obj: ..\..\src\common\dummy.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(RICHTEXTLIB_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp\r
 \r
@@ -15243,6 +15256,9 @@ $(OBJS)\richtextlib_richtextstyledlg.obj: ..\..\src\richtext\richtextstyledlg.cp
 $(OBJS)\richtextlib_richtextprint.obj: ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(RICHTEXTLIB_CXXFLAGS) ..\..\src\richtext\richtextprint.cpp\r
 \r
+$(OBJS)\richtextlib_richtextimagedlg.obj: ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) /c /nologo /TP /Fo$@ $(RICHTEXTLIB_CXXFLAGS) ..\..\src\richtext\richtextimagedlg.cpp\r
+\r
 $(OBJS)\stcdll_dummy.obj: ..\..\src\common\dummy.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp\r
 \r
index b0c2f5deadd38ee7cc4c9f65247cb4e0bb33804a..d7d68c40cac75c9382cf199526015ef9e4de1e11 100644 (file)
@@ -231,6 +231,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS =  &
        $(OBJS)\monodll_richtextsymboldlg.obj &\r
        $(OBJS)\monodll_richtextstyledlg.obj &\r
        $(OBJS)\monodll_richtextprint.obj &\r
+       $(OBJS)\monodll_richtextimagedlg.obj &\r
        $(OBJS)\monodll_stc.obj &\r
        $(OBJS)\monodll_PlatWX.obj &\r
        $(OBJS)\monodll_ScintillaWX.obj\r
@@ -962,6 +963,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS =  &
        $(OBJS)\monolib_richtextsymboldlg.obj &\r
        $(OBJS)\monolib_richtextstyledlg.obj &\r
        $(OBJS)\monolib_richtextprint.obj &\r
+       $(OBJS)\monolib_richtextimagedlg.obj &\r
        $(OBJS)\monolib_stc.obj &\r
        $(OBJS)\monolib_PlatWX.obj &\r
        $(OBJS)\monolib_ScintillaWX.obj\r
@@ -4653,7 +4655,8 @@ RICHTEXTDLL_OBJECTS =  &
        $(OBJS)\richtextdll_richtextformatdlg.obj &\r
        $(OBJS)\richtextdll_richtextsymboldlg.obj &\r
        $(OBJS)\richtextdll_richtextstyledlg.obj &\r
-       $(OBJS)\richtextdll_richtextprint.obj\r
+       $(OBJS)\richtextdll_richtextprint.obj &\r
+       $(OBJS)\richtextdll_richtextimagedlg.obj\r
 RICHTEXTLIB_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) &\r
        $(__RUNTIME_LIBS) -d__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) &\r
        $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) &\r
@@ -4673,7 +4676,8 @@ RICHTEXTLIB_OBJECTS =  &
        $(OBJS)\richtextlib_richtextformatdlg.obj &\r
        $(OBJS)\richtextlib_richtextsymboldlg.obj &\r
        $(OBJS)\richtextlib_richtextstyledlg.obj &\r
-       $(OBJS)\richtextlib_richtextprint.obj\r
+       $(OBJS)\richtextlib_richtextprint.obj &\r
+       $(OBJS)\richtextlib_richtextimagedlg.obj\r
 STCDLL_CXXFLAGS = -bd $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) &\r
        $(__RUNTIME_LIBS) -d__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) &\r
        $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) &\r
@@ -7202,6 +7206,9 @@ $(OBJS)\monodll_richtextstyledlg.obj :  .AUTODEPEND ..\..\src\richtext\richtexts
 $(OBJS)\monodll_richtextprint.obj :  .AUTODEPEND ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<\r
 \r
+$(OBJS)\monodll_richtextimagedlg.obj :  .AUTODEPEND ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<\r
+\r
 $(OBJS)\monodll_stc.obj :  .AUTODEPEND ..\..\src\stc\stc.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<\r
 \r
@@ -9437,6 +9444,9 @@ $(OBJS)\monolib_richtextstyledlg.obj :  .AUTODEPEND ..\..\src\richtext\richtexts
 $(OBJS)\monolib_richtextprint.obj :  .AUTODEPEND ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<\r
 \r
+$(OBJS)\monolib_richtextimagedlg.obj :  .AUTODEPEND ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<\r
+\r
 $(OBJS)\monolib_stc.obj :  .AUTODEPEND ..\..\src\stc\stc.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<\r
 \r
@@ -15042,6 +15052,9 @@ $(OBJS)\richtextdll_richtextstyledlg.obj :  .AUTODEPEND ..\..\src\richtext\richt
 $(OBJS)\richtextdll_richtextprint.obj :  .AUTODEPEND ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(RICHTEXTDLL_CXXFLAGS) $<\r
 \r
+$(OBJS)\richtextdll_richtextimagedlg.obj :  .AUTODEPEND ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) -bt=nt -zq -fo=$^@ $(RICHTEXTDLL_CXXFLAGS) $<\r
+\r
 $(OBJS)\richtextlib_dummy.obj :  .AUTODEPEND ..\..\src\common\dummy.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(RICHTEXTLIB_CXXFLAGS) $<\r
 \r
@@ -15072,6 +15085,9 @@ $(OBJS)\richtextlib_richtextstyledlg.obj :  .AUTODEPEND ..\..\src\richtext\richt
 $(OBJS)\richtextlib_richtextprint.obj :  .AUTODEPEND ..\..\src\richtext\richtextprint.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(RICHTEXTLIB_CXXFLAGS) $<\r
 \r
+$(OBJS)\richtextlib_richtextimagedlg.obj :  .AUTODEPEND ..\..\src\richtext\richtextimagedlg.cpp\r
+       $(CXX) -bt=nt -zq -fo=$^@ $(RICHTEXTLIB_CXXFLAGS) $<\r
+\r
 $(OBJS)\stcdll_dummy.obj :  .AUTODEPEND ..\..\src\common\dummy.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<\r
 \r
index c634d9e470e193e7303c66c49978b21c8886e07e..c928a10c6ddb01b66328ba6b2f251b48a4f3fa6f 100644 (file)
@@ -6529,6 +6529,10 @@ SOURCE=..\..\include\wx\richtext\richtexthtml.h
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=..\..\include\wx\richtext\richtextimagedlg.h\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=..\..\include\wx\richtext\richtextprint.h\r
 # End Source File\r
 # Begin Source File\r
index 3a639cf68a5f1f399195c637a00ffaedaeba53ee..0c111c88d7f0d21f217684eb045c314eee043175 100644 (file)
@@ -546,6 +546,10 @@ SOURCE=..\..\include\wx\richtext\richtexthtml.h
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=..\..\include\wx\richtext\richtextimagedlg.h\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=..\..\include\wx\richtext\richtextprint.h\r
 # End Source File\r
 # Begin Source File\r
@@ -586,6 +590,10 @@ SOURCE=..\..\src\richtext\richtexthtml.cpp
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=..\..\src\richtext\richtextimagedlg.cpp\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=..\..\src\richtext\richtextprint.cpp\r
 # End Source File\r
 # Begin Source File\r
index 9293774b68613195bbe60a934d7964544899463a..ca414ca1a57d30f62c892f1be52cdee44e789b56 100644 (file)
                        <File\r
                                RelativePath="..\..\include\wx\richtext\richtexthtml.h">\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\richtext\richtextimagedlg.h">\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\richtext\richtextprint.h">\r
                        </File>\r
index 238975492817254ddabb8b6895c39addb7770284..cce08cd91bb65af05422f98f5523f8000e36eaae 100644 (file)
                        <File\r
                                RelativePath="..\..\include\wx\richtext\richtexthtml.h">\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\richtext\richtextimagedlg.h">\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\richtext\richtextprint.h">\r
                        </File>\r
                        <File\r
                                RelativePath="..\..\src\richtext\richtexthtml.cpp">\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\richtext\richtextimagedlg.cpp">\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\richtext\richtextprint.cpp">\r
                        </File>\r
index f98f79ee344d6981cfd270eecbe42ed4469eb18d..6546f94c0a89de5835792d34ca0ca876a3162a2f 100644 (file)
                                RelativePath="..\..\include\wx\richtext\richtexthtml.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\richtext\richtextimagedlg.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\richtext\richtextprint.h"\r
                                >\r
index 4c875a347720a7fffa42e5721aade0a5e32c699a..6f017c412f20894880e029063152316d499bdecd 100644 (file)
                                RelativePath="..\..\include\wx\richtext\richtexthtml.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\richtext\richtextimagedlg.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\richtext\richtextprint.h"\r
                                >\r
                                RelativePath="..\..\src\richtext\richtexthtml.cpp"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\richtext\richtextimagedlg.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\richtext\richtextprint.cpp"\r
                                >\r
index a24a454467b0e0386f6215aeecdccd12d06d7465..9d3c2c5e414a491bb6a9fc32fc7193a93e4355d1 100644 (file)
                                RelativePath="..\..\include\wx\richtext\richtexthtml.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\richtext\richtextimagedlg.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\richtext\richtextprint.h"\r
                                >\r
index 600c860691be156a692f6269c60fb06b1dc8d67e..4232ad14a2e5ba741bbadade76651a2ae0497f99 100644 (file)
                                RelativePath="..\..\include\wx\richtext\richtexthtml.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\richtext\richtextimagedlg.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\richtext\richtextprint.h"\r
                                >\r
                                RelativePath="..\..\src\richtext\richtexthtml.cpp"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\richtext\richtextimagedlg.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\richtext\richtextprint.cpp"\r
                                >\r
index c1ba9cb4548c4e9623ede7e678becad00f806321..f81900013590bebf5b8425f845c264078590ae2c 100644 (file)
@@ -113,6 +113,7 @@ enum wxRichTextFileType
 
 class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCtrl;
 class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextObject;
+class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextImage;
 class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCacheObject;
 class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextObjectList;
 class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextLine;
@@ -123,6 +124,8 @@ class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextListStyleDefinition;
 class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextEvent;
 class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextRenderer;
 class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextBuffer;
+class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextAnchoredObject;
+class wxRichTextFloatCollector;
 
 /*!
  * Flags determining the available space, passed to Layout
@@ -232,6 +235,69 @@ enum wxRichTextHitTestFlags
 
 #define wxSCRIPT_MUL_FACTOR             1.5
 
+// Image align/floating
+#define wxRICHTEXT_LEFT     0x00
+#define wxRICHTEXT_CENTRE   0x01
+#define wxRICHTEXT_RIGHT    0x02
+
+#define wxRICHTEXT_FLOAT_NONE   0x00
+#define wxRICHTEXT_FLOAT_LEFT   0x01
+#define wxRICHTEXT_FLOAT_RIGHT  0x02
+
+// Image width/height scale
+#define wxRICHTEXT_PX   0x00
+#define wxRICHTEXT_MM   0x01
+
+/*!
+ * wxRichTextAnchoredObjectAttr class declaration
+ */
+class WXDLLIMPEXP_RICHTEXT wxRichTextAnchoredObjectAttr
+{
+public:
+    wxRichTextAnchoredObjectAttr() { Init(); }
+    wxRichTextAnchoredObjectAttr(const wxRichTextAnchoredObjectAttr& attr) { Copy(attr); }
+    
+    void Init();
+
+    void operator= (const wxRichTextAnchoredObjectAttr& attr) { Copy(attr); }
+    void Copy(const wxRichTextAnchoredObjectAttr& attr);
+    
+    /// Is this anchored? TODO: difference between anchored and floating?
+    bool IsAnchored() const { return m_floating != wxRICHTEXT_FLOAT_NONE; }
+
+    /// Is this floating?
+    bool IsFloating() const { return m_floating != wxRICHTEXT_FLOAT_NONE; }
+    void SetFloatingMode(int floating) { m_floating = floating; }
+    
+    int GetAlignment() const { return m_align; }
+    void SetAlignment(int align) { m_align = align; }
+
+    int GetOffset() const { return m_offset; }
+    void SetOffset(int offset) { m_offset = offset; }
+
+    int GetUnitsOffset() const { return m_unitsOffset; }
+    void SetUnitsOffset(int offset) { m_unitsOffset = offset; }
+
+    int GetUnitsW() const { return m_unitsW; }
+    void SetUnitsW(int u) { m_unitsW = u; }
+
+    int GetUnitsH() const { return m_unitsH; }
+    void SetUnitsH(int u) { m_unitsH = u; }
+
+    int GetWidth() const { return m_width; }
+    void SetWidth(int w) { m_width = w; }
+
+    int GetHeight() const { return m_height; }
+    void SetHeight(int h) { m_height = h; }
+
+    int m_align;
+    int m_floating;
+    int m_offset;
+    int m_unitsOffset;
+    int m_unitsW, m_unitsH;
+    int m_width, m_height;
+};
+
 /*!
  * wxRichTextFontTable
  * Manages quick access to a pool of fonts for rendering rich text
@@ -377,6 +443,18 @@ public:
     /// Returns true if the object is empty
     virtual bool IsEmpty() const { return false; }
 
+    /// Whether this object floatable
+    virtual bool IsFloatable() const { return false; }
+
+    /// Whether this object is currently floating
+    virtual bool IsFloating() const { return false; }
+
+    /// Whether this object is a place holding one
+    // virtual bool IsPlaceHolding() const { return false; }
+
+    /// Floating direction
+    virtual int GetFloatDirection() const { return wxRICHTEXT_FLOAT_NONE; }
+
     /// Get any text in this object for the given range
     virtual wxString GetTextForRange(const wxRichTextRange& WXUNUSED(range)) const { return wxEmptyString; }
 
@@ -389,6 +467,12 @@ public:
 
     /// Dump to output stream for debugging
     virtual void Dump(wxTextOutputStream& stream);
+    
+    /// Can we edit properties via a GUI?
+    virtual bool CanEditProperties() const { return false; }
+
+    /// Edit properties via a GUI
+    virtual bool EditProperties(wxWindow* WXUNUSED(parent), wxRichTextBuffer* WXUNUSED(buffer)) { return false; }
 
 // Accessors
 
@@ -455,7 +539,7 @@ public:
     void Dereference();
 
     /// Convert units in tenths of a millimetre to device units
-    int ConvertTenthsMMToPixels(wxDC& dc, int units);
+    int ConvertTenthsMMToPixels(wxDC& dc, int units) const;
     static int ConvertTenthsMMToPixels(int ppi, int units);
 
 protected:
@@ -617,9 +701,14 @@ public:
 
     wxRichTextParagraphLayoutBox(wxRichTextObject* parent = NULL);
     wxRichTextParagraphLayoutBox(const wxRichTextParagraphLayoutBox& obj): wxRichTextBox() { Init(); Copy(obj); }
+    ~wxRichTextParagraphLayoutBox();
 
 // Overrideables
 
+    /// Hit-testing: returns a flag indicating hit test details, plus
+    /// information about position
+    virtual int HitTest(wxDC& dc, const wxPoint& pt, long& textPosition);
+
     /// Draw the item
     virtual bool Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style);
 
@@ -653,6 +742,11 @@ public:
     virtual wxRichTextStyleSheet* GetStyleSheet() const { return NULL; }
 
 // Operations
+    /// Draw the floats of this buffer
+    void DrawFloats(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style);
+
+    /// Move an anchored object to another paragraph
+    void MoveAnchoredObjectToParagraph(wxRichTextParagraph* from, wxRichTextParagraph* to, wxRichTextAnchoredObject* obj);
 
     /// Initialize the object.
     void Init();
@@ -726,6 +820,9 @@ public:
     /// Set text attributes: character and/or paragraph styles.
     virtual bool SetStyle(const wxRichTextRange& range, const wxTextAttr& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
 
+    /// Set image attribute
+    void SetImageStyle(wxRichTextImage *image, const wxRichTextAnchoredObjectAttr& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
+
     /// Get the conbined text attributes for this position.
     virtual bool GetStyle(long position, wxTextAttr& style);
 
@@ -821,10 +918,18 @@ public:
 
     /// Invalidate the buffer. With no argument, invalidates whole buffer.
     void Invalidate(const wxRichTextRange& invalidRange = wxRICHTEXT_ALL);
+    
+    /// Gather information about floating objects. If untilObj is non-NULL,
+    /// will stop getting information if the current object is this, since we
+    /// will collect the rest later.
+    virtual bool UpdateFloatingObjects(int width, wxRichTextObject* untilObj = NULL);
 
     /// Get invalid range, rounding to entire paragraphs if argument is true.
     wxRichTextRange GetInvalidRange(bool wholeParagraphs = false) const;
 
+    /// Get the wxRichTextFloatCollector of this object
+    wxRichTextFloatCollector* GetFloatCollector() { return m_floatCollector; }
+
 protected:
     wxRichTextCtrl* m_ctrl;
     wxTextAttr  m_defaultAttributes;
@@ -834,6 +939,9 @@ protected:
 
     // Is the last paragraph partial or complete?
     bool            m_partialParagraph;
+
+    // The floating layout state
+    wxRichTextFloatCollector* m_floatCollector;
 };
 
 /*!
@@ -1038,12 +1146,17 @@ public:
     /// Get default tabstop array
     static const wxArrayInt& GetDefaultTabs() { return sm_defaultTabs; }
 
+    /// Layout the floats object
+    void LayoutFloat(wxDC& dc, const wxRect& rect, int style, wxRichTextFloatCollector* floatCollector);
+
 protected:
     /// The lines that make up the wrapped paragraph
     wxRichTextLineList m_cachedLines;
 
     /// Default tabstops
     static wxArrayInt  sm_defaultTabs;
+
+friend class wxRichTextFloatCollector;
 };
 
 /*!
@@ -1151,6 +1264,12 @@ public:
     // Make an image block from the wxImage in the given
     // format.
     virtual bool MakeImageBlock(wxImage& image, wxBitmapType imageType, int quality = 80);
+    
+    // Uses a const wxImage for efficiency, but can't set quality (only relevant for JPEG)
+    virtual bool MakeImageBlockDefaultQuality(const wxImage& image, wxBitmapType imageType);
+
+    // Makes the image block
+    virtual bool DoMakeImageBlock(const wxImage& image, wxBitmapType imageType);
 
     // Write to a file
     bool Write(const wxString& filename);
@@ -1206,22 +1325,58 @@ protected:
     wxBitmapType        m_imageType;
 };
 
+/*!
+ * wxRichTextAnchoredObject class declaration
+ * This object is an abstract one that represent some objects which can floats
+ */
+class WXDLLIMPEXP_RICHTEXT wxRichTextAnchoredObject: public wxRichTextObject
+{
+    DECLARE_CLASS(wxRichTextAnchoredObject)
+public:
+// Constructors
+    wxRichTextAnchoredObject(wxRichTextObject* parent = NULL, const wxRichTextAnchoredObjectAttr& attr = wxRichTextAnchoredObjectAttr());
+    wxRichTextAnchoredObject(const wxRichTextAnchoredObject& obj) : wxRichTextObject(obj) /* , m_ph(NULL) */ { Copy(obj); }
+    ~wxRichTextAnchoredObject();
+
+// Virtuals
+    virtual bool IsFloatable() const { return true; }
+
+    /// Whether this object is currently floating
+    virtual bool IsFloating() const { return m_anchoredAttr.m_floating != wxRICHTEXT_FLOAT_NONE; }
+
+    virtual void SetParent(wxRichTextObject* parent);
+
+// Accessors
+    const wxRichTextAnchoredObjectAttr& GetAnchoredAttr() const { return m_anchoredAttr; }
+    void SetAnchoredAttr(const wxRichTextAnchoredObjectAttr& attr);
+
+    /// The floating direction
+    virtual int GetFloatDirection() const { return m_anchoredAttr.m_floating; }
+
+    void operator=(const wxRichTextAnchoredObject&) { wxASSERT("Nobody can reset this object using ="); }
+
+// Functions
+    void Copy(const wxRichTextAnchoredObject& obj);
+
+protected:
+    wxRichTextAnchoredObjectAttr m_anchoredAttr;
+};
 
 /*!
  * wxRichTextImage class declaration
  * This object represents an image.
  */
 
-class WXDLLIMPEXP_RICHTEXT wxRichTextImage: public wxRichTextObject
+class WXDLLIMPEXP_RICHTEXT wxRichTextImage: public wxRichTextAnchoredObject
 {
     DECLARE_DYNAMIC_CLASS(wxRichTextImage)
 public:
 // Constructors
 
-    wxRichTextImage(wxRichTextObject* parent = NULL): wxRichTextObject(parent) { }
+    wxRichTextImage(wxRichTextObject* parent = NULL): wxRichTextAnchoredObject(parent) { }
     wxRichTextImage(const wxImage& image, wxRichTextObject* parent = NULL, wxTextAttr* charStyle = NULL);
     wxRichTextImage(const wxRichTextImageBlock& imageBlock, wxRichTextObject* parent = NULL, wxTextAttr* charStyle = NULL);
-    wxRichTextImage(const wxRichTextImage& obj): wxRichTextObject() { Copy(obj); }
+    wxRichTextImage(const wxRichTextImage& obj): wxRichTextAnchoredObject(obj) { Copy(obj); }
 
 // Overrideables
 
@@ -1236,15 +1391,24 @@ public:
     virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, int flags, wxPoint position = wxPoint(0,0), wxArrayInt* partialExtents = NULL) const;
 
     /// Returns true if the object is empty
-    virtual bool IsEmpty() const { return !m_image.Ok(); }
+    virtual bool IsEmpty() const { return !m_imageBlock.Ok(); }
+
+    /// Can we edit properties via a GUI?
+    virtual bool CanEditProperties() const { return true; }
+
+    /// Edit properties via a GUI
+    virtual bool EditProperties(wxWindow* parent, wxRichTextBuffer* buffer);
 
 // Accessors
 
-    /// Get the image
-    const wxImage& GetImage() const { return m_image; }
+    /// Get the image cache (scaled bitmap)
+    const wxBitmap& GetImageCache() const { return m_imageCache; }
 
-    /// Set the image
-    void SetImage(const wxImage& image) { m_image = image; }
+    /// Set the image cache
+    void SetImageCache(const wxBitmap& bitmap) { m_imageCache = bitmap; }
+
+    /// Reset the image cache
+    void ResetImageCache() { m_imageCache = wxNullBitmap; }
 
     /// Get the image block containing the raw data
     wxRichTextImageBlock& GetImageBlock() { return m_imageBlock; }
@@ -1257,17 +1421,12 @@ public:
     /// Clone
     virtual wxRichTextObject* Clone() const { return new wxRichTextImage(*this); }
 
-    /// Load wxImage from the block
-    virtual bool LoadFromBlock();
-
-    /// Make block from the wxImage
-    virtual bool MakeBlock();
+    /// Create a cached image at the required size
+    virtual bool LoadImageCache(wxDC& dc, bool resetCache = false);
 
 protected:
-    // TODO: reduce the multiple representations of data
-    wxImage                 m_image;
-    wxBitmap                m_bitmap;
     wxRichTextImageBlock    m_imageBlock;
+    wxBitmap                m_imageCache;
 };
 
 
@@ -1535,7 +1694,10 @@ public:
     bool InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl, int flags = 0);
 
     /// Submit command to insert the given image
-    bool InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock, wxRichTextCtrl* ctrl, int flags = 0);
+    bool InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock, wxRichTextCtrl* ctrl, int flags = 0, const wxRichTextAnchoredObjectAttr& floatAttr = wxRichTextAnchoredObjectAttr());
+
+    /// Submit command to insert an object
+    bool InsertObjectWithUndo(long pos, wxRichTextObject *object, wxRichTextCtrl* ctrl, int flags);
 
     /// Submit command to delete this range
     bool DeleteRangeWithUndo(const wxRichTextRange& range, wxRichTextCtrl* ctrl);
index 9973ba7b813559e7067acfe7b4d42490cc6c5730..abf7f449a979c0231f07ad40f8dd4c79d51ce092 100644 (file)
@@ -184,6 +184,10 @@ public:
     long GetSelectionAnchor() const { return m_selectionAnchor; }
     void SetSelectionAnchor(long anchor) { m_selectionAnchor = anchor; }
 
+    /// The wxRichTextObject object under mouse if any
+    wxRichTextObject* GetCurrentObject() const { return m_currentObject; }
+    void SetCurrentObject(wxRichTextObject* obj) { m_currentObject = obj; }
+
 // Operations
 
     // editing
@@ -222,6 +226,9 @@ public:
     virtual bool SetStyle(const wxRichTextRange& range, const wxTextAttr& style);
     virtual bool GetStyle(long position, wxTextAttr& style);
 
+    // Set an image style
+    void SetImageStyle(wxRichTextImage *image, const wxRichTextAnchoredObjectAttr& style);
+
     // get the common set of styles for the range
     virtual bool GetStyleForRange(const wxRichTextRange& range, wxTextAttr& style);
     // extended style setting operation with flags including:
@@ -309,17 +316,17 @@ public:
 
     /// Write an image at the current insertion point. Supply optional type to use
     /// for internal and file storage of the raw data.
-    virtual bool WriteImage(const wxImage& image, wxBitmapType bitmapType = wxBITMAP_TYPE_PNG);
+    virtual bool WriteImage(const wxImage& image, wxBitmapType bitmapType = wxBITMAP_TYPE_PNG, const wxRichTextAnchoredObjectAttr& attr = wxRichTextAnchoredObjectAttr());
 
     /// Write a bitmap at the current insertion point. Supply optional type to use
     /// for internal and file storage of the raw data.
-    virtual bool WriteImage(const wxBitmap& bitmap, wxBitmapType bitmapType = wxBITMAP_TYPE_PNG);
+    virtual bool WriteImage(const wxBitmap& bitmap, wxBitmapType bitmapType = wxBITMAP_TYPE_PNG, const wxRichTextAnchoredObjectAttr& attr = wxRichTextAnchoredObjectAttr());
 
     /// Load an image from file and write at the current insertion point.
-    virtual bool WriteImage(const wxString& filename, wxBitmapType bitmapType);
+    virtual bool WriteImage(const wxString& filename, wxBitmapType bitmapType, const wxRichTextAnchoredObjectAttr& attr = wxRichTextAnchoredObjectAttr());
 
     /// Write an image block at the current insertion point.
-    virtual bool WriteImage(const wxRichTextImageBlock& imageBlock);
+    virtual bool WriteImage(const wxRichTextImageBlock& imageBlock, const wxRichTextAnchoredObjectAttr& attr = wxRichTextAnchoredObjectAttr());
 
     /// Insert a newline (actually paragraph) at the current insertion point.
     virtual bool Newline();
@@ -621,6 +628,7 @@ public:
     void OnUndo(wxCommandEvent& event);
     void OnRedo(wxCommandEvent& event);
     void OnSelectAll(wxCommandEvent& event);
+    void OnImage(wxCommandEvent& event);
     void OnClear(wxCommandEvent& event);
 
     void OnUpdateCut(wxUpdateUIEvent& event);
@@ -629,6 +637,7 @@ public:
     void OnUpdateUndo(wxUpdateUIEvent& event);
     void OnUpdateRedo(wxUpdateUIEvent& event);
     void OnUpdateSelectAll(wxUpdateUIEvent& event);
+    void OnUpdateImage(wxUpdateUIEvent& event);
     void OnUpdateClear(wxUpdateUIEvent& event);
 
     // Show a context menu for Rich Edit controls (the standard
@@ -883,6 +892,9 @@ private:
     wxCursor                m_urlCursor;
 
     static wxArrayString    sm_availableFontNames;
+    /// The wxRichTextObject object under mouse if any
+    wxRichTextObject*       m_currentObject;
+    long                    m_imagePropertyId;
 };
 
 /*!
diff --git a/include/wx/richtext/richtextimagedlg.h b/include/wx/richtext/richtextimagedlg.h
new file mode 100644 (file)
index 0000000..f2865c0
--- /dev/null
@@ -0,0 +1,142 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        wx/richtext/richtextimagedlg.h\r
+// Purpose:     \r
+// Author:      Mingquan Yang\r
+// Modified by: \r
+// Created:     Wed 02 Jun 2010 11:27:23 CST\r
+// RCS-ID:      \r
+// Copyright:   (c) Mingquan Yang\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef _RICHTEXTIMAGEDLG_H_\r
+#define _RICHTEXTIMAGEDLG_H_\r
+\r
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)\r
+#pragma interface "wx/richtext/richtextimagedlg.h"\r
+#endif\r
+\r
+/*!\r
+ * Includes\r
+ */\r
+#include "wx/richtext/richtextbuffer.h"\r
+////@begin includes\r
+#include "wx/statline.h"\r
+////@end includes\r
+\r
+/*!\r
+ * Forward declarations\r
+ */\r
+\r
+////@begin forward declarations\r
+////@end forward declarations\r
+\r
+/*!\r
+ * Control identifiers\r
+ */\r
+\r
+////@begin control identifiers\r
+#define SYMBOL_WXRICHTEXTIMAGEDIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL\r
+#define SYMBOL_WXRICHTEXTIMAGEDIALOG_TITLE _("Image Properties")\r
+#define SYMBOL_WXRICHTEXTIMAGEDIALOG_IDNAME ID_WXRICHTEXTIMAGEPAGE\r
+#define SYMBOL_WXRICHTEXTIMAGEDIALOG_SIZE wxSize(400, 300)\r
+#define SYMBOL_WXRICHTEXTIMAGEDIALOG_POSITION wxDefaultPosition\r
+////@end control identifiers\r
+\r
+\r
+/*!\r
+ * wxRichTextImageDialog class declaration\r
+ */\r
+\r
+class WXDLLIMPEXP_RICHTEXT wxRichTextImageDialog: public wxDialog\r
+{    \r
+    DECLARE_DYNAMIC_CLASS( wxRichTextImageDialog )\r
+    DECLARE_EVENT_TABLE()\r
+\r
+public:\r
+    /// Constructors\r
+    wxRichTextImageDialog();\r
+    wxRichTextImageDialog( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTIMAGEDIALOG_IDNAME, const wxString& caption = SYMBOL_WXRICHTEXTIMAGEDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTIMAGEDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTIMAGEDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTIMAGEDIALOG_STYLE );\r
+\r
+    /// Creation\r
+    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTIMAGEDIALOG_IDNAME, const wxString& caption = SYMBOL_WXRICHTEXTIMAGEDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTIMAGEDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTIMAGEDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTIMAGEDIALOG_STYLE );\r
+\r
+    /// Destructor\r
+    ~wxRichTextImageDialog();\r
+\r
+    /// Initialises member variables\r
+    void Init();\r
+\r
+    /// Creates the controls and sizers\r
+    void CreateControls();\r
+\r
+////@begin wxRichTextImageDialog event handler declarations\r
+\r
+    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTIMAGEDIALOG_PARA_UP\r
+    void OnRichtextimagedialogParaUpClick( wxCommandEvent& event );\r
+\r
+    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTIMAGEDIALOG_DOWN\r
+    void OnRichtextimagedialogDownClick( wxCommandEvent& event );\r
+\r
+////@end wxRichTextImageDialog event handler declarations\r
+\r
+////@begin wxRichTextImageDialog member function declarations\r
+\r
+    /// Retrieves bitmap resources\r
+    wxBitmap GetBitmapResource( const wxString& name );\r
+\r
+    /// Retrieves icon resources\r
+    wxIcon GetIconResource( const wxString& name );\r
+////@end wxRichTextImageDialog member function declarations\r
+\r
+    /// Should we show tooltips?\r
+    static bool ShowToolTips();\r
+\r
+    /// Set the image attribute\r
+    void SetImageAttr(const wxRichTextAnchoredObjectAttr& attr);\r
+    wxRichTextImage* ApplyImageAttr();\r
+\r
+    /// Set the anchored object\r
+    void SetImageObject(wxRichTextImage *image, wxRichTextBuffer* buffer);\r
+\r
+    virtual bool TransferDataFromWindow();\r
+    virtual bool TransferDataToWindow();\r
+private:\r
+    /// Convert CM to MM\r
+    bool ConvertFromString(const wxString& string, int& ret, int scale);\r
+private:\r
+    wxRichTextAnchoredObjectAttr m_attr;\r
+////@begin wxRichTextImageDialog member variables\r
+    wxComboBox* m_alignment;\r
+    wxComboBox* m_float;\r
+    wxTextCtrl* m_width;\r
+    wxComboBox* m_unitsW;\r
+    wxTextCtrl* m_height;\r
+    wxComboBox* m_unitsH;\r
+    wxTextCtrl* m_offset;\r
+    wxComboBox* m_unitsOffset;\r
+    wxButton* m_saveButton;\r
+    wxButton* m_cancelButton;\r
+    /// Control identifiers\r
+    enum {\r
+        ID_WXRICHTEXTIMAGEPAGE = 10015,\r
+        ID_COMBOBOX_ALIGN = 10016,\r
+        ID_RICHTEXTIMAGEDIALOG_FLOATING_MODE = 10017,\r
+        ID_RICHTEXTIMAGEDIALOG_WIDTH = 10018,\r
+        ID_RICHTEXTIMAGEDIALOG_UNITS_W = 10019,\r
+        ID_RICHTEXTIMAGEDIALOG_HEIGHT = 10020,\r
+        ID_RICHTEXTIMAGEDIALOG_UNITS_H = 10021,\r
+        ID_RICHTEXTIMAGEDIALOG_OFFSET = 10022,\r
+        ID_RICHTEXTIMAGEDIALOG_OFFSET_UNITS = 10023,\r
+        ID_RICHTEXTIMAGEDIALOG_PARA_UP = 10024,\r
+        ID_RICHTEXTIMAGEDIALOG_DOWN = 10025\r
+    };\r
+////@end wxRichTextImageDialog member variables\r
+\r
+    wxRichTextBuffer* m_buffer;\r
+    wxRichTextObject* m_image;\r
+    wxRichTextObject* m_parent;\r
+};\r
+\r
+#endif\r
+    // _RICHTEXTIMAGEDLG_H_\r
index 168a2046f9ee2f1aef8f02d82e93bc41117ba129..58367e0b957674eac77c565cd38fa972e2ab068a 100644 (file)
@@ -78,6 +78,7 @@
 #include "wx/richtext/richtextsymboldlg.h"
 #include "wx/richtext/richtextstyledlg.h"
 #include "wx/richtext/richtextprint.h"
+#include "wx/richtext/richtextimagedlg.h"
 
 // ----------------------------------------------------------------------------
 // resources
@@ -145,6 +146,8 @@ public:
     void OnIndentLess(wxCommandEvent& event);
 
     void OnFont(wxCommandEvent& event);
+    void OnImage(wxCommandEvent& event);
+    void OnUpdateImage(wxUpdateUIEvent& event);
     void OnParagraph(wxCommandEvent& event);
     void OnFormat(wxCommandEvent& event);
     void OnUpdateFormat(wxUpdateUIEvent& event);
@@ -181,6 +184,7 @@ public:
     void OnPreview(wxCommandEvent& event);
     void OnPageSetup(wxCommandEvent& event);
 
+    void OnInsertImage(wxCommandEvent& event);
 protected:
 
     // Forward command events to the current rich text control, if any
@@ -211,6 +215,7 @@ enum
     ID_FORMAT_ITALIC,
     ID_FORMAT_UNDERLINE,
     ID_FORMAT_FONT,
+    ID_FORMAT_IMAGE,
     ID_FORMAT_PARAGRAPH,
     ID_FORMAT_CONTENT,
 
@@ -218,6 +223,7 @@ enum
 
     ID_INSERT_SYMBOL,
     ID_INSERT_URL,
+    ID_INSERT_IMAGE,
 
     ID_FORMAT_ALIGN_LEFT,
     ID_FORMAT_ALIGN_CENTRE,
@@ -286,10 +292,12 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_UPDATE_UI(ID_FORMAT_ALIGN_RIGHT,  MyFrame::OnUpdateAlignRight)
 
     EVT_MENU(ID_FORMAT_FONT,  MyFrame::OnFont)
+    EVT_MENU(ID_FORMAT_IMAGE, MyFrame::OnImage)
     EVT_MENU(ID_FORMAT_PARAGRAPH,  MyFrame::OnParagraph)
     EVT_MENU(ID_FORMAT_CONTENT,  MyFrame::OnFormat)
     EVT_UPDATE_UI(ID_FORMAT_CONTENT,  MyFrame::OnUpdateFormat)
     EVT_UPDATE_UI(ID_FORMAT_FONT,  MyFrame::OnUpdateFormat)
+    EVT_UPDATE_UI(ID_FORMAT_IMAGE, MyFrame::OnUpdateImage)
     EVT_UPDATE_UI(ID_FORMAT_PARAGRAPH,  MyFrame::OnUpdateFormat)
     EVT_MENU(ID_FORMAT_INDENT_MORE,  MyFrame::OnIndentMore)
     EVT_MENU(ID_FORMAT_INDENT_LESS,  MyFrame::OnIndentLess)
@@ -305,6 +313,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
 
     EVT_MENU(ID_INSERT_SYMBOL,  MyFrame::OnInsertSymbol)
     EVT_MENU(ID_INSERT_URL,  MyFrame::OnInsertURL)
+    EVT_MENU(ID_INSERT_IMAGE, MyFrame::OnInsertImage)
 
     EVT_MENU(ID_FORMAT_NUMBER_LIST, MyFrame::OnNumberList)
     EVT_MENU(ID_FORMAT_BULLETS_AND_NUMBERING, MyFrame::OnBulletsAndNumbering)
@@ -621,6 +630,7 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos,
     formatMenu->Append(ID_FORMAT_LINE_SPACING_DOUBLE, _("Double Line Spacing"));
     formatMenu->AppendSeparator();
     formatMenu->Append(ID_FORMAT_FONT, _("&Font..."));
+    formatMenu->Append(ID_FORMAT_IMAGE, _("Image Property"));
     formatMenu->Append(ID_FORMAT_PARAGRAPH, _("&Paragraph..."));
     formatMenu->Append(ID_FORMAT_CONTENT, _("Font and Pa&ragraph...\tShift+Ctrl+F"));
     formatMenu->AppendSeparator();
@@ -640,6 +650,7 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos,
     wxMenu* insertMenu = new wxMenu;
     insertMenu->Append(ID_INSERT_SYMBOL, _("&Symbol...\tCtrl+I"));
     insertMenu->Append(ID_INSERT_URL, _("&URL..."));
+    insertMenu->Append(ID_INSERT_IMAGE, _("&Image..."));
 
     // now append the freshly created menu to the menu bar...
     wxMenuBar *menuBar = new wxMenuBar();
@@ -689,6 +700,7 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos,
     toolBar->AddTool(ID_FORMAT_INDENT_MORE, wxEmptyString, wxBitmap(indentmore_xpm), _("Indent More"));
     toolBar->AddSeparator();
     toolBar->AddTool(ID_FORMAT_FONT, wxEmptyString, wxBitmap(font_xpm), _("Font"));
+    toolBar->AddTool(ID_FORMAT_IMAGE, wxString("Im"), wxBitmap(font_xpm), _("Image Property"));
 
     wxRichTextStyleComboCtrl* combo = new wxRichTextStyleComboCtrl(toolBar, ID_RICHTEXT_STYLE_COMBO, wxDefaultPosition, wxSize(200, -1));
     toolBar->AddControl(combo);
@@ -742,6 +754,8 @@ void MyFrame::WriteInitialText()
 
     r.BeginSuppressUndo();
 
+    r.Freeze();
+
     r.BeginParagraphSpacing(0, 20);
 
     r.BeginAlignment(wxTEXT_ALIGNMENT_CENTRE);
@@ -768,6 +782,18 @@ void MyFrame::WriteInitialText()
 
     r.EndAlignment();
 
+    r.BeginAlignment(wxTEXT_ALIGNMENT_LEFT);
+    wxRichTextAnchoredObjectAttr anchoredAttr;
+    anchoredAttr.m_floating = wxRICHTEXT_FLOAT_LEFT;
+    r.WriteText(wxString(wxT("This is a simple test for a floating left image test. The zebra image should be placed at the left side of the current buffer and all the text should flow around it at the right side. This is a simple test for a floating left image test. The zebra image should be placed at the left side of the current buffer and all the text should flow around it at the right side. This is a simple test for a floating left image test. The zebra image should be placed at the left side of the current buffer and all the text should flow around it at the right side.")));
+    r.WriteImage(wxBitmap(zebra_xpm), wxBITMAP_TYPE_PNG, anchoredAttr);
+    anchoredAttr.m_floating = wxRICHTEXT_FLOAT_RIGHT;
+    anchoredAttr.m_offset = 200;
+    r.WriteImage(wxBitmap(zebra_xpm), wxBITMAP_TYPE_PNG, anchoredAttr);
+    r.WriteText(wxString(wxT("This is a simple test for a floating left image test. The zebra image should be placed at the left side of the current buffer and all the text should flow around it at the right side. This is a simple test for a floating left image test. The zebra image should be placed at the left side of the current buffer and all the text should flow around it at the right side. This is a simple test for a floating left image test. The zebra image should be placed at the left side of the current buffer and all the text should flow around it at the right side.")));
+    r.EndAlignment();
+    r.Newline();
+
     r.WriteText(wxT("What can you do with this thing? "));
 
     r.WriteImage(wxBitmap(smiley_xpm));
@@ -923,6 +949,8 @@ void MyFrame::WriteInitialText()
 
     r.EndParagraphSpacing();
 
+    r.Thaw();
+
     r.EndSuppressUndo();
 }
 
@@ -1154,6 +1182,27 @@ void MyFrame::OnFont(wxCommandEvent& WXUNUSED(event))
 #endif
 }
 
+void MyFrame::OnImage(wxCommandEvent& WXUNUSED(event))
+{
+    wxRichTextRange range;
+    wxASSERT(m_richTextCtrl->HasSelection());
+
+    range = m_richTextCtrl->GetSelectionRange();
+    wxASSERT(range.ToInternal().GetLength() == 1);
+
+    wxRichTextImage* image = wxDynamicCast(m_richTextCtrl->GetBuffer().GetLeafObjectAtPosition(range.GetStart()), wxRichTextImage);
+    if (image)
+    {
+        wxRichTextImageDialog imageDlg(this);
+        imageDlg.SetImageObject(image, &m_richTextCtrl->GetBuffer());
+
+        if (imageDlg.ShowModal() == wxID_OK)
+        {
+            image = imageDlg.ApplyImageAttr();
+        }
+    }
+}
+
 void MyFrame::OnParagraph(wxCommandEvent& WXUNUSED(event))
 {
     wxRichTextRange range;
@@ -1197,6 +1246,25 @@ void MyFrame::OnUpdateFormat(wxUpdateUIEvent& event)
     event.Enable(m_richTextCtrl->HasSelection());
 }
 
+void MyFrame::OnUpdateImage(wxUpdateUIEvent& event)
+{
+    wxRichTextRange range;
+    wxRichTextObject *obj;
+
+    range = m_richTextCtrl->GetSelectionRange();
+    if (range.ToInternal().GetLength() == 1)
+    {
+        obj = m_richTextCtrl->GetBuffer().GetLeafObjectAtPosition(range.GetStart());
+        if (obj && obj->IsKindOf(CLASSINFO(wxRichTextImage)))
+        {
+            event.Enable(true);
+            return;
+        }
+    }
+
+    event.Enable(false);
+}
+
 void MyFrame::OnIndentMore(wxCommandEvent& WXUNUSED(event))
 {
     wxRichTextAttr attr;
@@ -1562,6 +1630,16 @@ void MyFrame::OnInsertURL(wxCommandEvent& WXUNUSED(event))
     }
 }
 
+void MyFrame::OnInsertImage(wxCommandEvent& WXUNUSED(event))
+{
+    wxFileDialog dialog(this, _("Choose an image"), "", "", "BMP and GIF files (*.bmp;*.gif)|*.bmp;*.gif|PNG files (*.png)|*.png");
+    if (dialog.ShowModal() == wxID_OK)
+    {
+        wxString path = dialog.GetPath();
+        m_richTextCtrl->WriteImage(path, wxBITMAP_TYPE_ANY);
+    }
+}
+
 void MyFrame::OnURL(wxTextUrlEvent& event)
 {
     wxMessageBox(event.GetString());
diff --git a/src/richtext/readme b/src/richtext/readme
new file mode 100644 (file)
index 0000000..0354470
--- /dev/null
@@ -0,0 +1,54 @@
+Implement detail of floating layout
+
+1. Data Structure
+
+Mainly, we maintain two floating list data for a wxRichTextBuffer.
+'struct FloatRectMap' is used to represent a floating object's region,
+and 'class wxFloatCollector' is a container of all 'struct FloatRectMap'.
+It maintains all the information of the positions of all the floating
+objects with two list of 'struct FloatRectMap', one for objects floated
+to left and the other for right.
+
+wxRichTextAnchoredObject is introduced to represent a kind of objects
+that can be floated. wxRichTextImage is made to be a child class of
+this one. In future, we may introduce some other floating object type
+like wxRichTextTable. And we also introduce a twin object of this one,
+it is wxRichTextPlaceHoldingObject. When the object is set to be a
+floating one, we will place a 'placing holding' object in its origin
+position, this makes us to record the position of the object correctly
+even if the containing paragraph change its content.
+
+Also, along with wxRichTextAnchoredObject, we also introduce a 
+wxRichTextAnchoredObjectAttr class, which contains the attributes of
+floating direction, floating offset and etc. wxRichTextImageAttr is made
+to be a subclass of this one.
+
+Finally, wxRichTextImageDlg is a image control dialog, in which users can
+set the alignment, floating direction, size, offset of the image, in addition,
+users can also move the image between paragraph with this dialog.
+
+2. Layout Algorithm
+
+With floating objects, when we layout a paragraph, wxFloatCollector will
+firstly collect all the floating objects of the paragraphs before this
+one. And then, layout the floating objects of this paragraph, then layout
+the normal objects using the available rect info according the floating
+objects' state.
+
+Generally, the basic paragraph layout algorithm:
+1. All paragraphs before this one is layout well, so use wxFloatCollector
+   to collect the floating objects state;
+2. Collect all the 'place holding objects' of the paragraph, layout the
+   floating objects with the space available for it;
+3. For other objects left, make line break as:
+   GetAvailableWidth with a <y, h> pair, where y is the vertical position
+   of the line and h is the minimum height of the line.
+   After we get the width, do line break and normal layout.
+
+3. Some Note
+
+If we use floating attributes with list style, it may cause some problems.
+Something like image/text overlap may happen. Since, list style is applied
+to the paragraph after its normal layout, in which phrase, floating layout
+is done, list style will change the position of the paragraph and so may
+cause some overlap.
index 1b3ff5896fdf4ad487d3b17cc0db894ee659cdcc..9acc9bd0f420de0f7fef67419c3d335c68112c51 100644 (file)
 #include "wx/sstream.h"
 #include "wx/textfile.h"
 #include "wx/hashmap.h"
+#include "wx/dynarray.h"
 
 #include "wx/richtext/richtextctrl.h"
 #include "wx/richtext/richtextstyles.h"
+#include "wx/richtext/richtextimagedlg.h"
 
 #include "wx/listimpl.cpp"
 
@@ -53,10 +55,338 @@ WX_DEFINE_LIST(wxRichTextLineList)
 
 const wxChar wxRichTextLineBreakChar = (wxChar) 29;
 
-// Helpers for efficiency
+// Helper classes for floating layout
+struct wxRichTextFloatRectMap
+{
+    wxRichTextFloatRectMap(int sY, int eY, int w, wxRichTextObject* obj)
+    {
+        startY = sY;
+        endY = eY;
+        width = w;
+        anchor = obj;
+    }
+
+    int startY, endY;
+    int width;
+    wxRichTextObject* anchor;
+};
+
+WX_DEFINE_SORTED_ARRAY(wxRichTextFloatRectMap*, wxRichTextFloatRectMapArray);
+
+int wxRichTextFloatRectMapCmp(wxRichTextFloatRectMap* r1, wxRichTextFloatRectMap* r2)
+{
+    return r1->startY - r2->startY;
+}
+
+class wxRichTextFloatCollector
+{
+public:
+    wxRichTextFloatCollector(int width);
+    ~wxRichTextFloatCollector();
+
+    // Collect the floating objects info in the given paragraph
+    void CollectFloat(wxRichTextParagraph* para);
+    void CollectFloat(wxRichTextParagraph* para, wxRichTextObject* floating);
+
+    // Return the last paragraph we collected
+    wxRichTextParagraph* LastParagraph();
+
+    // Given the start y position and the height of the line,
+    // find out how wide the line can be
+    wxRect GetAvailableRect(int startY, int endY);
+
+    // Given a floating box, find its fit position
+    int GetFitPosition(int direction, int start, int height) const;
+    int GetFitPosition(const wxRichTextFloatRectMapArray& array, int start, int height) const;
+
+    // Find the last y position
+    int GetLastRectBottom();
+
+    // Draw the floats inside a rect
+    void Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style);
+
+    // HitTest the floats
+    int HitTest(wxDC& dc, const wxPoint& pt, long& textPosition);
+
+    static int SearchAdjacentRect(const wxRichTextFloatRectMapArray& array, int point);
+
+    static int GetWidthFromFloatRect(const wxRichTextFloatRectMapArray& array, int index, int startY, int endY);
+    
+    static void FreeFloatRectMapArray(wxRichTextFloatRectMapArray& array);
+
+    static void DrawFloat(const wxRichTextFloatRectMapArray& array, wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style);
+
+    static int HitTestFloat(const wxRichTextFloatRectMapArray& array, wxDC& WXUNUSED(dc), const wxPoint& pt, long& textPosition);
+    
+private:
+    wxRichTextFloatRectMapArray m_left;
+    wxRichTextFloatRectMapArray m_right;
+    int m_width;
+    wxRichTextParagraph* m_para;
+};
+
+/*
+ * Binary search helper function
+ * The argument point is the Y coordinate, and this fuction
+ * always return the floating rect that contain this coordinate
+ * or under this coordinate.
+ */
+int wxRichTextFloatCollector::SearchAdjacentRect(const wxRichTextFloatRectMapArray& array, int point)
+{
+    int end = array.GetCount() - 1;
+    int start = 0;
+    int ret = 0;
+
+    wxASSERT(end >= 0);
+
+    while (true)
+    {
+        if (start > end)
+        {
+            break;
+        }
+
+        int mid = (start + end) / 2;
+        if (array[mid]->startY <= point && array[mid]->endY >= point)
+            return mid;
+        else if (array[mid]->startY > point)
+        {
+            end = mid - 1;
+            ret = mid;
+        }
+        else if (array[mid]->endY < point)
+        {
+            start = mid + 1;
+            ret = start;
+        }
+    }
+
+    return ret;
+}
+
+int wxRichTextFloatCollector::GetWidthFromFloatRect(const wxRichTextFloatRectMapArray& array, int index, int startY, int endY)
+{
+    int ret = 0;
+    int len = array.GetCount();
+
+    wxASSERT(index >= 0 && index < len);
+
+    if (array[index]->startY < startY && array[index]->endY > startY)
+        ret = ret < array[index]->width ? array[index]->width : ret;
+    while (index < len && array[index]->startY <= endY)
+    {
+        ret = ret < array[index]->width ? array[index]->width : ret;
+        index++;
+    }
+
+    return ret;
+}
+
+wxRichTextFloatCollector::wxRichTextFloatCollector(int width) : m_left(wxRichTextFloatRectMapCmp), m_right(wxRichTextFloatRectMapCmp)
+{
+    m_width = width;
+    m_para = NULL;
+}
+
+void wxRichTextFloatCollector::FreeFloatRectMapArray(wxRichTextFloatRectMapArray& array)
+{
+    int len = array.GetCount();
+    for (int i = 0; i < len; i++)
+        delete array[i];
+}
+
+wxRichTextFloatCollector::~wxRichTextFloatCollector()
+{
+    FreeFloatRectMapArray(m_left);
+    FreeFloatRectMapArray(m_right);
+}
+
+int wxRichTextFloatCollector::GetFitPosition(const wxRichTextFloatRectMapArray& array, int start, int height) const
+{
+    if (array.GetCount() == 0)
+        return start;
+
+    unsigned int i = SearchAdjacentRect(array, start);
+    int last = start;
+    while (i < array.GetCount())
+    {
+        if (array[i]->startY - last >= height)
+            return last + 1;
+        last = array[i]->endY;
+        i++;
+    }
+
+    return last + 1;
+}
+
+int wxRichTextFloatCollector::GetFitPosition(int direction, int start, int height) const
+{
+    if (direction == wxRICHTEXT_FLOAT_LEFT)
+        return GetFitPosition(m_left, start, height);
+    else if (direction == wxRICHTEXT_FLOAT_RIGHT)
+        return GetFitPosition(m_right, start, height);
+    else
+    {
+        wxASSERT("Never should be here");
+        return start;
+    }
+}
+
+void wxRichTextFloatCollector::CollectFloat(wxRichTextParagraph* para, wxRichTextObject* floating)
+{
+        int direction = floating->GetFloatDirection();
+        wxPoint pos = floating->GetPosition();
+        wxSize size = floating->GetCachedSize();
+        wxRichTextFloatRectMap *map = new wxRichTextFloatRectMap(pos.y, pos.y + size.y, size.x, floating);
+
+        switch (direction)
+        {
+            case wxRICHTEXT_FLOAT_NONE:
+                delete map;
+                break;
+            case wxRICHTEXT_FLOAT_LEFT:
+                // Just a not-enough simple assertion
+                wxASSERT (m_left.Index(map) == wxNOT_FOUND);
+                m_left.Add(map);
+                break;
+            case wxRICHTEXT_FLOAT_RIGHT:
+                wxASSERT (m_right.Index(map) == wxNOT_FOUND);
+                m_right.Add(map);
+                break;
+            default:
+                delete map;
+                wxASSERT("Must some error occurs");
+        }
+
+        m_para = para;
+}
+
+void wxRichTextFloatCollector::CollectFloat(wxRichTextParagraph* para)
+{
+    wxRichTextObjectList::compatibility_iterator node = para->GetChildren().GetFirst();
+    while (node)
+    {
+        wxRichTextObject* floating = node->GetData();
+        
+        if (floating->IsFloating())
+        {
+            wxRichTextAnchoredObject* anchor = wxDynamicCast(floating, wxRichTextAnchoredObject);
+            if (anchor && anchor->GetAnchoredAttr().IsAnchored())
+            {
+                CollectFloat(para, floating);
+            }
+        }
+            
+        node = node->GetNext();
+    }
+
+    m_para = para;
+}
+
+wxRichTextParagraph* wxRichTextFloatCollector::LastParagraph()
+{
+    return m_para;
+}
+
+wxRect wxRichTextFloatCollector::GetAvailableRect(int startY, int endY)
+{
+    int widthLeft = 0, widthRight = 0;
+    if (m_left.GetCount() != 0)
+    {
+        unsigned int i = SearchAdjacentRect(m_left, startY);
+        if (i >= 0 && i < m_left.GetCount())
+            widthLeft = GetWidthFromFloatRect(m_left, i, startY, endY);
+    }
+    if (m_right.GetCount() != 0)
+    {
+        unsigned int j = SearchAdjacentRect(m_right, startY);
+        if (j >= 0 && j < m_right.GetCount())
+            widthRight = GetWidthFromFloatRect(m_right, j, startY, endY);
+    }
+
+    return wxRect(widthLeft, 0, m_width - widthLeft - widthRight, 0);
+}
+
+int wxRichTextFloatCollector::GetLastRectBottom()
+{
+    int ret = 0;
+    int len = m_left.GetCount();
+    if (len) {
+        ret = ret > m_left[len-1]->endY ? ret : m_left[len-1]->endY;
+    }
+    len = m_right.GetCount();
+    if (len) {
+        ret = ret > m_right[len-1]->endY ? ret : m_right[len-1]->endY;
+    }
 
+    return ret;
+}
+
+void wxRichTextFloatCollector::DrawFloat(const wxRichTextFloatRectMapArray& array, wxDC& dc, const wxRichTextRange& WXUNUSED(range), const wxRichTextRange& WXUNUSED(selectionRange), const wxRect& rect, int descent, int style)
+{
+    int start = rect.y;
+    int end = rect.y + rect.height;
+    unsigned int i, j;
+    i = SearchAdjacentRect(array, start);
+    if (i < 0 || i >= array.GetCount())
+        return;
+    j = SearchAdjacentRect(array, end);
+    if (j < 0 || j >= array.GetCount())
+        j = array.GetCount() - 1;
+    while (i <= j)
+    {
+        wxRichTextObject* obj = array[i]->anchor;
+        wxRichTextRange r = obj->GetRange();
+        obj->Draw(dc, r, wxRichTextRange(0, -1), wxRect(obj->GetPosition(), obj->GetCachedSize()), descent, style);
+        i++;
+    }
+}
+
+void wxRichTextFloatCollector::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style)
+{
+    if (m_left.GetCount() > 0)
+        DrawFloat(m_left, dc, range, selectionRange, rect, descent, style);
+    if (m_right.GetCount() > 0)
+        DrawFloat(m_right, dc, range, selectionRange, rect, descent, style);
+}
+
+int wxRichTextFloatCollector::HitTestFloat(const wxRichTextFloatRectMapArray& array, wxDC& WXUNUSED(dc), const wxPoint& pt, long& textPosition)
+{
+    unsigned int i;
+    if (array.GetCount() == 0)
+        return wxRICHTEXT_HITTEST_NONE;
+    i = SearchAdjacentRect(array, pt.y);
+    if (i < 0 || i >= array.GetCount())
+        return wxRICHTEXT_HITTEST_NONE;
+    wxPoint point = array[i]->anchor->GetPosition();
+    wxSize size = array[i]->anchor->GetCachedSize();
+    if (point.x <= pt.x && point.x + size.x >= pt.x
+        && point.y <= pt.y && point.y + size.y >= pt.y)
+    {
+        textPosition = array[i]->anchor->GetRange().GetStart();
+        if (pt.x > (pt.x + pt.x + size.x) / 2)
+            return wxRICHTEXT_HITTEST_BEFORE;
+        else
+            return wxRICHTEXT_HITTEST_AFTER;
+    }
+    
+    return wxRICHTEXT_HITTEST_NONE;
+}
+
+int wxRichTextFloatCollector::HitTest(wxDC& dc, const wxPoint& pt, long& textPosition)
+{
+    int ret = HitTestFloat(m_left, dc, pt, textPosition);
+    if (ret == wxRICHTEXT_HITTEST_NONE)
+    {
+        ret = HitTestFloat(m_right, dc, pt, textPosition);
+    }
+    return ret;
+}
+
+// Helpers for efficiency 
 inline void wxCheckSetFont(wxDC& dc, const wxFont& font)
 {
+    // JACS: did I do this some time ago when testing? Should we re-enable it?
 #if 0
     const wxFont& font1 = dc.GetFont();
     if (font1.IsOk() && font.IsOk())
@@ -99,6 +429,34 @@ inline void wxCheckSetBrush(wxDC& dc, const wxBrush& brush)
     dc.SetBrush(brush);
 }
 
+void wxRichTextAnchoredObjectAttr::Init()
+{
+    m_align = wxRICHTEXT_CENTRE;
+    m_floating = wxRICHTEXT_FLOAT_NONE;
+    m_offset = 0;
+    m_unitsOffset = wxRICHTEXT_PX;
+
+    m_unitsW = wxRICHTEXT_PX;
+    m_unitsH = wxRICHTEXT_PX;
+    
+    // Unspecified to begin with (use actual image size)
+    m_width = -1;
+    m_height = -1;
+}
+
+void wxRichTextAnchoredObjectAttr::Copy(const wxRichTextAnchoredObjectAttr& attr)
+{
+    m_align = attr.m_align;
+    m_floating = attr.m_floating;
+    m_offset = attr.m_offset;
+    m_unitsOffset = attr.m_unitsOffset;
+
+    m_unitsW = attr.m_unitsW;
+    m_unitsH = attr.m_unitsH;
+    m_width = attr.m_width;
+    m_height = attr.m_height;
+}
+
 /*!
  * wxRichTextObject
  * This is the base for drawable objects.
@@ -154,7 +512,7 @@ void wxRichTextObject::SetMargins(int leftMargin, int rightMargin, int topMargin
 }
 
 // Convert units in tenths of a millimetre to device units
-int wxRichTextObject::ConvertTenthsMMToPixels(wxDC& dc, int units)
+int wxRichTextObject::ConvertTenthsMMToPixels(wxDC& dc, int units) const
 {
     int p = ConvertTenthsMMToPixels(dc.GetPPI().x, units);
 
@@ -553,6 +911,15 @@ wxRichTextParagraphLayoutBox::wxRichTextParagraphLayoutBox(wxRichTextObject* par
     Init();
 }
 
+wxRichTextParagraphLayoutBox::~wxRichTextParagraphLayoutBox()
+{
+    if (m_floatCollector)
+    {
+        delete m_floatCollector;
+        m_floatCollector = NULL;
+    }
+}
+
 /// Initialize the object.
 void wxRichTextParagraphLayoutBox::Init()
 {
@@ -567,11 +934,61 @@ void wxRichTextParagraphLayoutBox::Init()
     m_topMargin = 4;
     m_bottomMargin = 4;
     m_partialParagraph = false;
+    m_floatCollector = NULL;
+}
+
+// Gather information about floating objects
+bool wxRichTextParagraphLayoutBox::UpdateFloatingObjects(int width, wxRichTextObject* untilObj)
+{
+    if (m_floatCollector != NULL)
+        delete m_floatCollector;
+    m_floatCollector = new wxRichTextFloatCollector(width);
+    wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst();
+    while (node && node->GetData() != untilObj)
+    {
+        wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph);
+        wxASSERT (child != NULL);
+        if (child)
+            m_floatCollector->CollectFloat(child);
+        node = node->GetNext();
+    }
+    
+    return true;
+}
+
+// HitTest
+int wxRichTextParagraphLayoutBox::HitTest(wxDC& dc, const wxPoint& pt, long& textPosition)
+{
+    int ret = wxRICHTEXT_HITTEST_NONE;
+    if (m_floatCollector)
+        ret = m_floatCollector->HitTest(dc, pt, textPosition);
+        
+    if (ret == wxRICHTEXT_HITTEST_NONE)
+        return wxRichTextCompositeObject::HitTest(dc, pt, textPosition);
+    else
+        return ret;
+}
+
+/// Draw the floating objects
+void wxRichTextParagraphLayoutBox::DrawFloats(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style)
+{
+    if (m_floatCollector)
+        m_floatCollector->Draw(dc, range, selectionRange, rect, descent, style);
+}
+
+void wxRichTextParagraphLayoutBox::MoveAnchoredObjectToParagraph(wxRichTextParagraph* from, wxRichTextParagraph* to, wxRichTextAnchoredObject* obj)
+{
+    if (from == to)
+        return;
+
+    from->RemoveChild(obj);
+    to->AppendChild(obj);
 }
 
 /// Draw the item
 bool wxRichTextParagraphLayoutBox::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style)
 {
+    DrawFloats(dc, range, selectionRange, rect, descent, style);
     wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst();
     while (node)
     {
@@ -675,6 +1092,8 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int styl
         }
     }
 
+    UpdateFloatingObjects(availableSpace.width, node ? node->GetData() : (wxRichTextObject*) NULL);
+
     // A way to force speedy rest-of-buffer layout (the 'else' below)
     bool forceQuickLayout = false;
 
@@ -1886,6 +2305,35 @@ bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const
     return true;
 }
 
+void wxRichTextParagraphLayoutBox::SetImageStyle(wxRichTextImage *image, const wxRichTextAnchoredObjectAttr& attr, int flags)
+{
+    bool withUndo = flags & wxRICHTEXT_SETSTYLE_WITH_UNDO;
+    bool haveControl = (GetRichTextCtrl() != NULL);
+    wxRichTextParagraph* newPara wxDUMMY_INITIALIZE(NULL);
+    wxRichTextParagraph* para = GetParagraphAtPosition(image->GetRange().GetStart());
+    wxRichTextAction *action = NULL;
+    wxRichTextAnchoredObjectAttr oldAttr = image->GetAnchoredAttr();
+
+    if (haveControl && withUndo)
+    {
+        action = new wxRichTextAction(NULL, _("Change Image Style"), wxRICHTEXT_CHANGE_STYLE, & GetRichTextCtrl()->GetBuffer(), GetRichTextCtrl());
+        action->SetRange(image->GetRange().FromInternal());
+        action->SetPosition(GetRichTextCtrl()->GetCaretPosition());
+        image->SetAnchoredAttr(attr);
+        // Set the new attribute
+        newPara = new wxRichTextParagraph(*para);
+        action->GetNewParagraphs().AppendChild(newPara);
+        // Change back to the old one
+        image->SetAnchoredAttr(oldAttr);
+        action->GetOldParagraphs().AppendChild(new wxRichTextParagraph(*para));
+    }
+    else
+        newPara = para;
+
+    if (haveControl && withUndo)
+        GetRichTextCtrl()->GetBuffer().SubmitAction(action);
+}
+
 /// Get the text attributes for this position.
 bool wxRichTextParagraphLayoutBox::GetStyle(long position, wxTextAttr& style)
 {
@@ -2596,11 +3044,10 @@ wxRichTextRange wxRichTextParagraphLayoutBox::GetInvalidRange(bool wholeParagrap
     if (wholeParagraphs)
     {
         wxRichTextParagraph* para1 = GetParagraphAtPosition(range.GetStart());
-        wxRichTextParagraph* para2 = GetParagraphAtPosition(range.GetEnd());
         if (para1)
             range.SetStart(para1->GetRange().GetStart());
-        if (para2)
-            range.SetEnd(para2->GetRange().GetEnd());
+        // floating layout make all child should be relayout
+        range.SetEnd(GetRange().GetEnd());
     }
     return range;
 }
@@ -3183,7 +3630,7 @@ bool wxRichTextParagraph::Draw(wxDC& dc, const wxRichTextRange& range, const wxR
             if (GetChildren().GetCount() > 0)
             {
                 wxRichTextObject* firstObj = (wxRichTextObject*) GetChildren().GetFirst()->GetData();
-                if (firstObj->GetAttributes().HasFont())
+                if (!firstObj->IsFloatable() && firstObj->GetAttributes().HasFont())
                 {
                     wxRichTextApplyStyle(bulletAttr, firstObj->GetAttributes());
                 }
@@ -3262,7 +3709,7 @@ bool wxRichTextParagraph::Draw(wxDC& dc, const wxRichTextRange& range, const wxR
             {
                 wxRichTextObject* child = node2->GetData();
 
-                if (child->GetRange().GetLength() > 0 && !child->GetRange().IsOutside(lineRange) && !lineRange.IsOutside(range))
+                if (!child->IsFloating() && child->GetRange().GetLength() > 0 && !child->GetRange().IsOutside(lineRange) && !lineRange.IsOutside(range))
                 {
                     // Draw this part of the line at the correct position
                     wxRichTextRange objectRange(child->GetRange());
@@ -3324,6 +3771,13 @@ static int wxRichTextGetRangeWidth(const wxRichTextParagraph& para, const wxRich
 /// Lay the item out
 bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style)
 {
+    // Deal with floating objects firstly before the normal layout
+    wxRichTextBuffer* buffer = GetBuffer();
+    wxASSERT(buffer);
+    wxRichTextFloatCollector* collector = buffer->GetFloatCollector();
+    wxASSERT(collector);
+    LayoutFloat(dc, rect, style, collector);
+
     wxTextAttr attr = GetCombinedAttributes();
 
     // ClearLines();
@@ -3344,18 +3798,10 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style)
         lineSpacing = (int) (double(dc.GetCharHeight()) * (double(attr.GetLineSpacing())/10.0 - 1.0));
     }
 
-    // Available space for text on each line differs.
-    int availableTextSpaceFirstLine = rect.GetWidth() - leftIndent - rightIndent;
-
-    // Bullets start the text at the same position as subsequent lines
-    if (attr.GetBulletStyle() != wxTEXT_ATTR_BULLET_STYLE_NONE)
-        availableTextSpaceFirstLine -= leftSubIndent;
-
-    int availableTextSpaceSubsequentLines = rect.GetWidth() - leftIndent - rightIndent - leftSubIndent;
-
     // Start position for each line relative to the paragraph
     int startPositionFirstLine = leftIndent;
     int startPositionSubsequentLines = leftIndent + leftSubIndent;
+    wxRect availableRect;
 
     // If we have a bullet in this paragraph, the start position for the first line's text
     // is actually leftIndent + leftSubIndent.
@@ -3374,6 +3820,8 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style)
     int maxAscent = 0;
     int maxDescent = 0;
     int lineCount = 0;
+    int lineAscent = 0;
+    int lineDescent = 0;
 
     wxRichTextObjectList::compatibility_iterator node;
 
@@ -3411,7 +3859,8 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style)
     {
         wxRichTextObject* child = node->GetData();
 
-        if (child->GetRange().GetLength() == 0)
+        // If floating, ignore. We already laid out floats.
+        if (child->IsFloating() || child->GetRange().GetLength() == 0)
         {
             node = node->GetNext();
             continue;
@@ -3424,11 +3873,6 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style)
         // can't tell the position until the size is determined. So possibly introduce
         // another layout phase.
 
-        // Available width depends on whether we're on the first or subsequent lines
-        int availableSpaceForText = (lineCount == 0 ? availableTextSpaceFirstLine : availableTextSpaceSubsequentLines);
-
-        currentPosition.x = (lineCount == 0 ? startPositionFirstLine : startPositionSubsequentLines);
-
         // We may only be looking at part of a child, if we searched back for wrapping
         // and found a suitable point some way into the child. So get the size for the fragment
         // if necessary.
@@ -3459,19 +3903,36 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style)
 #endif
         }
 
+        // Available width depends on the floating objects and the line height
+        // Note: the floating objects may be placed vertically along the two side of
+        //       buffer, so we may have different available line width with different
+        //       [startY, endY]. So, we should can't determine how wide the available
+        //       space is until we know the exact line height.
+        lineDescent = wxMax(childDescent, maxDescent);
+        lineAscent = wxMax(childSize.y-childDescent, maxAscent);
+        lineHeight = lineDescent + lineAscent;
+        availableRect = collector->GetAvailableRect(rect.y + currentPosition.y, rect.y + currentPosition.y + lineHeight);
+
+        currentPosition.x = (lineCount == 0 ? availableRect.x + startPositionFirstLine : availableRect.x + startPositionSubsequentLines);
+
         // Cases:
         // 1) There was a line break BEFORE the natural break
         // 2) There was a line break AFTER the natural break
         // 3) The child still fits (carry on)
 
-        if ((lineBreakInThisObject && (childSize.x + currentWidth <= availableSpaceForText)) ||
-            (childSize.x + currentWidth > availableSpaceForText))
+        if ((lineBreakInThisObject && (childSize.x + currentWidth <= availableRect.width)) ||
+            (childSize.x + currentWidth > availableRect.width))
         {
             long wrapPosition = 0;
 
+            int indent = lineCount == 0 ? startPositionFirstLine : startPositionSubsequentLines;
+            indent += rightIndent;
             // Find a place to wrap. This may walk back to previous children,
             // for example if a word spans several objects.
-            if (!FindWrapPosition(wxRichTextRange(lastCompletedEndPos+1, child->GetRange().GetEnd()), dc, availableSpaceForText, wrapPosition, & partialExtents))
+            // Note: one object must contains only one wxTextAtrr, so the line height will not
+            //       change inside one object. Thus, we can pass the remain line width to the
+            //       FindWrapPosition function.
+            if (!FindWrapPosition(wxRichTextRange(lastCompletedEndPos+1, child->GetRange().GetEnd()), dc, availableRect.width - indent, wrapPosition, & partialExtents))
             {
                 // If the function failed, just cut it off at the end of this child.
                 wrapPosition = child->GetRange().GetEnd();
@@ -3557,7 +4018,7 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style)
     // Substract -1 because the last position is always the end-paragraph position.
     if (lastCompletedEndPos <= GetRange().GetEnd()-1)
     {
-        currentPosition.x = (lineCount == 0 ? startPositionFirstLine : startPositionSubsequentLines);
+        currentPosition.x = (lineCount == 0 ? availableRect.x + startPositionFirstLine : availableRect.x + startPositionSubsequentLines);
 
         wxRichTextLine* line = AllocateLine(lineCount);
 
@@ -3783,6 +4244,22 @@ bool wxRichTextParagraph::GetRangeSize(const wxRichTextRange& range, wxSize& siz
             wxRichTextObject* child = node->GetData();
             if (!child->GetRange().IsOutside(range))
             {
+                // Floating objects have a zero size within the paragraph.
+                if (child->IsFloating())
+                {
+                    if (partialExtents)
+                    {
+                        int lastSize;
+                        if (partialExtents->GetCount() > 0)
+                            lastSize = (*partialExtents)[partialExtents->GetCount()-1];
+                        else
+                            lastSize = 0;
+
+                        partialExtents->Add(0 /* zero size */ + lastSize);
+                    }
+                }
+                else
+                {
                 wxSize childSize;
 
                 wxRichTextRange rangeToUse = range;
@@ -3827,6 +4304,7 @@ bool wxRichTextParagraph::GetRangeSize(const wxRichTextRange& range, wxSize& siz
                         }
                     }
                 }
+                }
 
                 if (p)
                     p->Clear();
@@ -3862,7 +4340,7 @@ bool wxRichTextParagraph::GetRangeSize(const wxRichTextRange& range, wxSize& siz
                 {
                     wxRichTextObject* child = node2->GetData();
 
-                    if (!child->GetRange().IsOutside(lineRange))
+                    if (!child->IsFloating() && !child->GetRange().IsOutside(lineRange))
                     {
                         wxRichTextRange rangeToUse = lineRange;
                         rangeToUse.LimitTo(child->GetRange());
@@ -4035,7 +4513,7 @@ int wxRichTextParagraph::HitTest(wxDC& dc, const wxPoint& pt, long& textPosition
                         // Let's see if we can be more precise about
                         // which side of the position it's on.
 
-                        int midPoint = (nextX - lastX)/2 + lastX;
+                        int midPoint = (nextX + lastX)/2;
                         if (pt.x >= midPoint)
                             return wxRICHTEXT_HITTEST_AFTER;
                         else
@@ -4066,7 +4544,7 @@ int wxRichTextParagraph::HitTest(wxDC& dc, const wxPoint& pt, long& textPosition
                         // Let's see if we can be more precise about
                         // which side of the position it's on.
 
-                        int midPoint = (nextX - lastX)/2 + lastX;
+                        int midPoint = (nextX + lastX)/2;
                         if (pt.x >= midPoint)
                             return wxRICHTEXT_HITTEST_AFTER;
                         else
@@ -4511,6 +4989,37 @@ void wxRichTextParagraph::ClearDefaultTabs()
     sm_defaultTabs.Clear();
 }
 
+void wxRichTextParagraph::LayoutFloat(wxDC& dc, const wxRect& rect, int style, wxRichTextFloatCollector* floatCollector)
+{
+    wxRichTextObjectList::compatibility_iterator node = GetChildren().GetFirst();
+    while (node)
+    {
+        wxRichTextAnchoredObject* anchored = wxDynamicCast(node->GetData(), wxRichTextAnchoredObject);
+        if (anchored && anchored->IsFloating())
+        {
+            wxSize size;
+            int descent, x = 0;
+            anchored->GetRangeSize(anchored->GetRange(), size, descent, dc, style);
+            wxRichTextAnchoredObjectAttr attr = anchored->GetAnchoredAttr();
+            int pos = floatCollector->GetFitPosition(attr.m_floating, rect.y + attr.m_offset, size.y);
+        
+            /* Update the offset */
+            attr.m_offset = pos - rect.y;
+            anchored->SetAnchoredAttr(attr);
+
+            if (attr.m_floating == wxRICHTEXT_FLOAT_LEFT)
+                x = 0;
+            else if (attr.m_floating == wxRICHTEXT_FLOAT_RIGHT)
+                x = rect.width - size.x;
+            anchored->SetPosition(wxPoint(x, pos));
+            anchored->SetCachedSize(size);
+            floatCollector->CollectFloat(this, anchored);
+        }
+
+        node = node->GetNext();
+    }
+}
+
 /// Get the first position from pos that has a line break character.
 long wxRichTextParagraph::GetFirstLineBreakPosition(long pos)
 {
@@ -5434,7 +5943,7 @@ bool wxRichTextBuffer::InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl, int
 }
 
 /// Submit command to insert the given image
-bool wxRichTextBuffer::InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock, wxRichTextCtrl* ctrl, int flags)
+bool wxRichTextBuffer::InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock, wxRichTextCtrl* ctrl, int flags, const wxRichTextAnchoredObjectAttr& floatAttr)
 {
     wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Image"), wxRICHTEXT_INSERT, this, ctrl, false);
 
@@ -5455,6 +5964,7 @@ bool wxRichTextBuffer::InsertImageWithUndo(long pos, const wxRichTextImageBlock&
 
     wxRichTextImage* imageObject = new wxRichTextImage(imageBlock, newPara);
     newPara->AppendChild(imageObject);
+    imageObject->SetAnchoredAttr(floatAttr);
     action->GetNewParagraphs().AppendChild(newPara);
     action->GetNewParagraphs().UpdateRanges();
 
@@ -5470,6 +5980,41 @@ bool wxRichTextBuffer::InsertImageWithUndo(long pos, const wxRichTextImageBlock&
     return true;
 }
 
+// Insert an object with no change of it
+bool wxRichTextBuffer::InsertObjectWithUndo(long pos, wxRichTextObject *object, wxRichTextCtrl* ctrl, int flags)
+{
+    wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert object"), wxRICHTEXT_INSERT, this, ctrl, false);
+
+    wxTextAttr* p = NULL;
+    wxTextAttr paraAttr;
+    if (flags & wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE)
+    {
+        paraAttr = GetStyleForNewParagraph(pos);
+        if (!paraAttr.IsDefault())
+            p = & paraAttr;
+    }
+
+    wxTextAttr attr(GetDefaultStyle());
+
+    wxRichTextParagraph* newPara = new wxRichTextParagraph(this, & attr);
+    if (p)
+        newPara->SetAttributes(*p);
+
+    newPara->AppendChild(object);
+    action->GetNewParagraphs().AppendChild(newPara);
+    action->GetNewParagraphs().UpdateRanges();
+
+    action->GetNewParagraphs().SetPartialParagraph(true);
+
+    action->SetPosition(pos);
+
+    // Set the range we'll need to delete in Undo
+    action->SetRange(wxRichTextRange(pos, pos));
+
+    SubmitAction(action);
+
+    return true;
+}
 /// Get the style that is appropriate for a new paragraph at this position.
 /// If the previous paragraph has a paragraph style name, look up the next-paragraph
 /// style.
@@ -6880,7 +7425,7 @@ bool wxRichTextAction::Undo()
 }
 
 /// Update the control appearance
-void wxRichTextAction::UpdateAppearance(long caretPosition, bool sendUpdateEvent, wxArrayInt* optimizationLineCharPositions, wxArrayInt* optimizationLineYPositions, bool isDoCmd)
+void wxRichTextAction::UpdateAppearance(long caretPosition, bool sendUpdateEvent, wxArrayInt* WXUNUSED(optimizationLineCharPositions), wxArrayInt* WXUNUSED(optimizationLineYPositions), bool WXUNUSED(isDoCmd))
 {
     if (m_ctrl)
     {
@@ -6888,145 +7433,8 @@ void wxRichTextAction::UpdateAppearance(long caretPosition, bool sendUpdateEvent
         if (!m_ctrl->IsFrozen())
         {
             m_ctrl->LayoutContent();
-
-#if wxRICHTEXT_USE_OPTIMIZED_DRAWING
-            // Find refresh rectangle if we are in a position to optimise refresh
-            if ((m_cmdId == wxRICHTEXT_INSERT || m_cmdId == wxRICHTEXT_DELETE) && optimizationLineCharPositions)
-            {
-                size_t i;
-
-                wxSize clientSize = m_ctrl->GetClientSize();
-                wxPoint firstVisiblePt = m_ctrl->GetFirstVisiblePoint();
-
-                // Start/end positions
-                int firstY = 0;
-                int lastY = firstVisiblePt.y + clientSize.y;
-
-                bool foundEnd = false;
-
-                // position offset - how many characters were inserted
-                int positionOffset = GetRange().GetLength();
-
-                // Determine whether this is Do or Undo, and adjust positionOffset accordingly
-                if ((m_cmdId == wxRICHTEXT_DELETE && isDoCmd) || (m_cmdId == wxRICHTEXT_INSERT && !isDoCmd))
-                    positionOffset = - positionOffset;
-
-                // find the first line which is being drawn at the same position as it was
-                // before. Since we're talking about a simple insertion, we can assume
-                // that the rest of the window does not need to be redrawn.
-
-                wxRichTextParagraph* para = m_buffer->GetParagraphAtPosition(GetPosition());
-                if (para)
-                {
-                    // Find line containing GetPosition().
-                    wxRichTextLine* line = NULL;
-                    wxRichTextLineList::compatibility_iterator node2 = para->GetLines().GetFirst();
-                    while (node2)
-                    {
-                        wxRichTextLine* l = node2->GetData();
-                        wxRichTextRange range = l->GetAbsoluteRange();
-                        if (range.Contains(GetRange().GetStart()-1))
-                        {
-                            line = l;
-                            break;
-                        }
-                        node2 = node2->GetNext();
-                    }
-
-                    if (line)
-                    {
-                        // Step back a couple of lines to where we can be sure of reformatting correctly
-                        wxRichTextLineList::compatibility_iterator lineNode = para->GetLines().Find(line);
-                        if (lineNode)
-                        {
-                            lineNode = lineNode->GetPrevious();
-                            if (lineNode)
-                            {
-                                line = (wxRichTextLine*) lineNode->GetData();
-                                lineNode = lineNode->GetPrevious();
-                                if (lineNode)
-                                    line = (wxRichTextLine*) lineNode->GetData();
-                            }
-                        }
-
-                        firstY = line->GetAbsolutePosition().y;
-                    }
-                }
-
-                wxRichTextObjectList::compatibility_iterator node = m_buffer->GetChildren().Find(para);
-                while (node)
-                {
-                    wxRichTextParagraph* child = (wxRichTextParagraph*) node->GetData();
-                    wxRichTextLineList::compatibility_iterator node2 = child->GetLines().GetFirst();
-                    while (node2)
-                    {
-                        wxRichTextLine* line = node2->GetData();
-                        wxPoint pt = line->GetAbsolutePosition();
-                        wxRichTextRange range = line->GetAbsoluteRange();
-
-                        // we want to find the first line that is in the same position
-                        // as before. This will mean we're at the end of the changed text.
-
-                        if (pt.y > lastY) // going past the end of the window, no more info
-                        {
-                            node2 = wxRichTextLineList::compatibility_iterator();
-                            node = wxRichTextObjectList::compatibility_iterator();
-                        }
-                        // Detect last line in the buffer
-                        else if (!node2->GetNext() && para->GetRange().Contains(m_buffer->GetRange().GetEnd()))
-                        {
-                            // If deleting text, make sure we refresh below as well as above
-                            if (positionOffset >= 0)
-                            {
-                                foundEnd = true;
-                                lastY = pt.y + line->GetSize().y;
-                            }
-
-                            node2 = wxRichTextLineList::compatibility_iterator();
-                            node = wxRichTextObjectList::compatibility_iterator();
-
-                            break;
-                        }
-                        else
-                        {
-                            // search for this line being at the same position as before
-                            for (i = 0; i < optimizationLineCharPositions->GetCount(); i++)
-                            {
-                                if (((*optimizationLineCharPositions)[i] + positionOffset == range.GetStart()) &&
-                                    ((*optimizationLineYPositions)[i] == pt.y))
-                                {
-                                    // Stop, we're now the same as we were
-                                    foundEnd = true;
-
-                                    lastY = pt.y;
-
-                                    node2 = wxRichTextLineList::compatibility_iterator();
-                                    node = wxRichTextObjectList::compatibility_iterator();
-
-                                    break;
-                                }
-                            }
-                        }
-
-                        if (node2)
-                            node2 = node2->GetNext();
-                    }
-
-                    if (node)
-                        node = node->GetNext();
-                }
-
-                firstY = wxMax(firstVisiblePt.y, firstY);
-                if (!foundEnd)
-                    lastY = firstVisiblePt.y + clientSize.y;
-
-                // Convert to device coordinates
-                wxRect rect(m_ctrl->GetPhysicalPoint(wxPoint(firstVisiblePt.x, firstY)), wxSize(clientSize.x, lastY - firstY));
-                m_ctrl->RefreshRect(rect);
-            }
-            else
-#endif
-                m_ctrl->Refresh(false);
+            // TODO Refresh the whole client area now
+            m_ctrl->Refresh(false);
 
 #if wxRICHTEXT_USE_OWN_CARET
             m_ctrl->PositionCaret();
@@ -7087,65 +7495,193 @@ bool wxRichTextRange::LimitTo(const wxRichTextRange& range)
     return true;
 }
 
+#if 0
+/*!
+ * wxRichTextPlaceHoldingObject implementation
+ */
+
+IMPLEMENT_DYNAMIC_CLASS(wxRichTextPlaceHoldingObject, wxRichTextObject)
+
+wxRichTextPlaceHoldingObject::wxRichTextPlaceHoldingObject(wxRichTextObject *parent, wxRichTextAnchoredObject *real)
+                            : wxRichTextObject(parent), m_real(real)
+{
+}
+
+wxRichTextPlaceHoldingObject::~wxRichTextPlaceHoldingObject()
+{
+}
+
+bool wxRichTextPlaceHoldingObject::Draw(wxDC& WXUNUSED(dc), const wxRichTextRange& WXUNUSED(range), const wxRichTextRange& WXUNUSED(selectionrange), const wxRect& WXUNUSED(rect), int WXUNUSED(descent), int WXUNUSED(style))
+{
+    return true;
+}
+
+bool wxRichTextPlaceHoldingObject::Layout(wxDC& WXUNUSED(dc), const wxRect& WXUNUSED(rect), int WXUNUSED(style))
+{
+    SetCachedSize(wxSize(0, 0));
+    return true;
+}
+
+bool wxRichTextPlaceHoldingObject::GetRangeSize(const wxRichTextRange& WXUNUSED(range), wxSize& size, int& WXUNUSED(descent), wxDC& WXUNUSED(dc), int WXUNUSED(flags), wxPoint WXUNUSED(position), wxArrayInt* partialExtents) const
+{
+    size.x = size.y = 0;
+    if (partialExtents)
+        partialExtents->Add(0);
+    return true;
+}
+
+void wxRichTextPlaceHoldingObject::Copy(const wxRichTextPlaceHoldingObject& obj)
+{
+    wxRichTextObject::Copy(obj);
+    wxASSERT (obj.m_real);
+    wxRichTextObject* o = obj.m_real->Clone();
+    wxASSERT (o->IsFloatable());
+    wxRichTextAnchoredObject* anchor = wxDynamicCast(o, wxRichTextAnchoredObject);
+    wxASSERT (anchor);
+    anchor->SetPlaceHoldingObject(this);
+    m_real = anchor;
+}
+
+void wxRichTextPlaceHoldingObject::SetParent(wxRichTextObject* parent)
+{
+    wxRichTextObject::SetParent(parent);
+    if (m_real)
+    {
+        m_real->wxRichTextObject::SetParent(parent);
+    }
+
+}
+
+#endif
+
+/*!
+ * wxRichTextAnchoredObject implementation
+ */
+IMPLEMENT_CLASS(wxRichTextAnchoredObject, wxRichTextObject)
+
+wxRichTextAnchoredObject::wxRichTextAnchoredObject(wxRichTextObject* parent, const wxRichTextAnchoredObjectAttr& attr):
+    wxRichTextObject(parent), m_anchoredAttr(attr)
+{
+}
+
+wxRichTextAnchoredObject::~wxRichTextAnchoredObject()
+{
+}
+
+void wxRichTextAnchoredObject::SetAnchoredAttr(const wxRichTextAnchoredObjectAttr& attr)
+{
+    m_anchoredAttr = attr;
+}
+
+void wxRichTextAnchoredObject::Copy(const wxRichTextAnchoredObject& obj)
+{
+    wxRichTextObject::Copy(obj);
+    m_anchoredAttr = obj.m_anchoredAttr;
+}
+
+void wxRichTextAnchoredObject::SetParent(wxRichTextObject* parent)
+{
+    wxRichTextObject::SetParent(parent);
+}
+
 /*!
  * wxRichTextImage implementation
  * This object represents an image.
  */
 
-IMPLEMENT_DYNAMIC_CLASS(wxRichTextImage, wxRichTextObject)
+IMPLEMENT_DYNAMIC_CLASS(wxRichTextImage, wxRichTextAnchoredObject)
 
 wxRichTextImage::wxRichTextImage(const wxImage& image, wxRichTextObject* parent, wxTextAttr* charStyle):
-    wxRichTextObject(parent)
+    wxRichTextAnchoredObject(parent)
 {
-    m_image = image;
+    m_imageBlock.MakeImageBlockDefaultQuality(image, wxBITMAP_TYPE_PNG);
     if (charStyle)
         SetAttributes(*charStyle);
 }
 
 wxRichTextImage::wxRichTextImage(const wxRichTextImageBlock& imageBlock, wxRichTextObject* parent, wxTextAttr* charStyle):
-    wxRichTextObject(parent)
+    wxRichTextAnchoredObject(parent)
 {
     m_imageBlock = imageBlock;
-    m_imageBlock.Load(m_image);
     if (charStyle)
         SetAttributes(*charStyle);
 }
 
-/// Load wxImage from the block
-bool wxRichTextImage::LoadFromBlock()
+/// Create a cached image at the required size
+bool wxRichTextImage::LoadImageCache(wxDC& dc, bool resetCache)
 {
-    m_imageBlock.Load(m_image);
-    return m_imageBlock.Ok();
-}
+    if (resetCache || !m_imageCache.IsOk() /* || m_imageCache.GetWidth() != size.x || m_imageCache.GetHeight() != size.y */)
+    {
+        if (!m_imageBlock.IsOk())
+            return false;
+            
+        wxImage image;
+        m_imageBlock.Load(image);
+        if (!image.IsOk())
+            return false;
+        
+        int width = image.GetWidth();
+        int height = image.GetHeight();
+        
+        if (m_anchoredAttr.m_width != -1)
+        {
+            // Calculate the user specified length
+            if (m_anchoredAttr.m_unitsW == wxRICHTEXT_MM)
+            {
+                width = ConvertTenthsMMToPixels(dc, m_anchoredAttr.m_width);
+            }
+            else 
+            {
+                width = m_anchoredAttr.m_width;
+            }
+        }
 
-/// Make block from the wxImage
-bool wxRichTextImage::MakeBlock()
-{
-    wxBitmapType type = m_imageBlock.GetImageType();
-    if ( type == wxBITMAP_TYPE_ANY || type == wxBITMAP_TYPE_INVALID )
-        m_imageBlock.SetImageType(type = wxBITMAP_TYPE_PNG);
+        if (m_anchoredAttr.m_height != -1)
+        {
+            if (m_anchoredAttr.m_unitsH == wxRICHTEXT_MM)
+            {
+                height = ConvertTenthsMMToPixels(dc, m_anchoredAttr.m_height);
+            }
+            else
+            {
+                height = m_anchoredAttr.m_height;
+            }
+        }
 
-    m_imageBlock.MakeImageBlock(m_image, type);
-    return m_imageBlock.Ok();
+        if (image.GetWidth() == width && image.GetHeight() == height)
+            m_imageCache = wxBitmap(image);
+        else
+        {
+            // If the original width and height is small, e.g. 400 or below,
+            // scale up and then down to improve image quality. This can make
+            // a big difference, with not much performance hit.
+            int upscaleThreshold = 400;
+            wxImage img;
+            if (image.GetWidth() <= upscaleThreshold || image.GetHeight() <= upscaleThreshold)
+            {
+                img = image.Scale(image.GetWidth()*2, image.GetHeight()*2);
+                img.Rescale(width, height, wxIMAGE_QUALITY_HIGH);
+            }
+            else
+                img = image.Scale(width, height, wxIMAGE_QUALITY_HIGH);
+            m_imageCache = wxBitmap(img);
+        }
+    }
+    
+    return m_imageCache.IsOk();
 }
 
-
 /// Draw the item
 bool wxRichTextImage::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int WXUNUSED(descent), int WXUNUSED(style))
 {
-    if (!m_image.Ok() && m_imageBlock.Ok())
-        LoadFromBlock();
-
-    if (!m_image.Ok())
+    // Don't need cached size AFAIK
+    // wxSize size = GetCachedSize();
+    if (!LoadImageCache(dc))
         return false;
+    
+    int y = rect.y + (rect.height - m_imageCache.GetHeight());
 
-    if (m_image.Ok() && !m_bitmap.Ok())
-        m_bitmap = wxBitmap(m_image);
-
-    int y = rect.y + (rect.height - m_image.GetHeight());
-
-    if (m_bitmap.Ok())
-        dc.DrawBitmap(m_bitmap, rect.x, y, true);
+    dc.DrawBitmap(m_imageCache, rect.x, y, true);
 
     if (selectionRange.Contains(range.GetStart()))
     {
@@ -7160,43 +7696,40 @@ bool wxRichTextImage::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichT
 }
 
 /// Lay the item out
-bool wxRichTextImage::Layout(wxDC& WXUNUSED(dc), const wxRect& rect, int WXUNUSED(style))
+bool wxRichTextImage::Layout(wxDC& dc, const wxRect& rect, int WXUNUSED(style))
 {
-    if (!m_image.Ok())
-        LoadFromBlock();
+    if (!LoadImageCache(dc))
+        return false;
 
-    if (m_image.Ok())
-    {
-        SetCachedSize(wxSize(m_image.GetWidth(), m_image.GetHeight()));
-        SetPosition(rect.GetPosition());
-    }
+    SetCachedSize(wxSize(m_imageCache.GetWidth(), m_imageCache.GetHeight()));
+    SetPosition(rect.GetPosition());
 
     return true;
 }
 
 /// Get/set the object size for the given range. Returns false if the range
 /// is invalid for this object.
-bool wxRichTextImage::GetRangeSize(const wxRichTextRange& range, wxSize& size, int& WXUNUSED(descent), wxDC& WXUNUSED(dc), int WXUNUSED(flags), wxPoint WXUNUSED(position), wxArrayInt* partialExtents) const
+bool wxRichTextImage::GetRangeSize(const wxRichTextRange& range, wxSize& size, int& WXUNUSED(descent), wxDC& dc, int WXUNUSED(flags), wxPoint WXUNUSED(position), wxArrayInt* partialExtents) const
 {
     if (!range.IsWithin(GetRange()))
         return false;
 
-    if (!m_image.Ok())
-        ((wxRichTextImage*) this)->LoadFromBlock();
-
-    if (partialExtents)
+    if (!((wxRichTextImage*)this)->LoadImageCache(dc))
     {
-        if (m_image.Ok())
-            partialExtents->Add(m_image.GetWidth());
-        else
+        size.x = 0; size.y = 0;
+        if (partialExtents)
             partialExtents->Add(0);
+        return false;
     }
+    
+    int width = m_imageCache.GetWidth();
+    int height = m_imageCache.GetHeight();
 
-    if (!m_image.Ok())
-        return false;
+    if (partialExtents)
+        partialExtents->Add(width);
 
-    size.x = m_image.GetWidth();
-    size.y = m_image.GetHeight();
+    size.x = width;
+    size.y = height;
 
     return true;
 }
@@ -7204,12 +7737,26 @@ bool wxRichTextImage::GetRangeSize(const wxRichTextRange& range, wxSize& size, i
 /// Copy
 void wxRichTextImage::Copy(const wxRichTextImage& obj)
 {
-    wxRichTextObject::Copy(obj);
+    wxRichTextAnchoredObject::Copy(obj);
 
-    m_image = obj.m_image;
     m_imageBlock = obj.m_imageBlock;
 }
 
+/// Edit properties via a GUI
+bool wxRichTextImage::EditProperties(wxWindow* parent, wxRichTextBuffer* buffer)
+{
+    wxRichTextImageDialog imageDlg(wxGetTopLevelParent(parent));
+    imageDlg.SetImageObject(this, buffer);
+
+    if (imageDlg.ShowModal() == wxID_OK)
+    {
+        imageDlg.ApplyImageAttr();
+        return true;
+    }
+    else
+        return false;
+}
+
 /*!
  * Utilities
  *
@@ -7503,39 +8050,48 @@ bool wxRichTextImageBlock::MakeImageBlock(const wxString& filename, wxBitmapType
 // format.
 bool wxRichTextImageBlock::MakeImageBlock(wxImage& image, wxBitmapType imageType, int quality)
 {
-    m_imageType = imageType;
     image.SetOption(wxT("quality"), quality);
 
     if (imageType == wxBITMAP_TYPE_INVALID)
         return false; // Could not determine image type
 
-    wxString tempFile = wxFileName::CreateTempFileName(_("image")) ;
-    wxASSERT(!tempFile.IsEmpty());
+    return DoMakeImageBlock(image, imageType);
+}
 
-    if (!image.SaveFile(tempFile, m_imageType))
+// Uses a const wxImage for efficiency, but can't set quality (only relevant for JPEG)
+bool wxRichTextImageBlock::MakeImageBlockDefaultQuality(const wxImage& image, wxBitmapType imageType)
+{
+    if (imageType == wxBITMAP_TYPE_INVALID)
+        return false; // Could not determine image type
+        
+    return DoMakeImageBlock(image, imageType);
+}
+
+// Makes the image block
+bool wxRichTextImageBlock::DoMakeImageBlock(const wxImage& image, wxBitmapType imageType)
+{
+    wxMemoryOutputStream memStream;
+    if (!image.SaveFile(memStream, imageType))
     {
-        if (wxFileExists(tempFile))
-            wxRemoveFile(tempFile);
         return false;
     }
-
-    wxFile file;
-    if (!file.Open(tempFile))
-        return false;
-
-    m_dataSize = (size_t) file.Length();
-    file.Close();
-
+    
+    unsigned char* block = new unsigned char[memStream.GetSize()];
+    if (!block)
+        return NULL;
+        
     if (m_data)
         delete[] m_data;
-    m_data = ReadBlock(tempFile, m_dataSize);
+    m_data = block;
+    
+    m_imageType = imageType;    
+    m_dataSize = memStream.GetSize();
 
-    wxRemoveFile(tempFile);
+    memStream.CopyTo(m_data, m_dataSize);
 
     return (m_data != NULL);
 }
 
-
 // Write to a file
 bool wxRichTextImageBlock::Write(const wxString& filename)
 {
index d46d6c31dd5ffadea2e9c67d270796f09276a871..4ef99e9f6b2f4f0c71b8749b5f33bc3011de55e9 100644 (file)
@@ -300,12 +300,21 @@ bool wxRichTextCtrl::Create( wxWindow* parent, wxWindowID id, const wxString& va
     m_contextMenu->AppendSeparator();
     m_contextMenu->Append(wxID_SELECTALL, _("Select &All"));
 
+    long ids = wxNewId();
+    m_contextMenu->AppendSeparator();
+    m_contextMenu->Append(ids, _("&Properties"));
+
+    Connect(ids, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxRichTextCtrl::OnUpdateImage));
+    Connect(ids, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(wxRichTextCtrl::OnImage));
+    m_imagePropertyId = ids;
     return true;
 }
 
 wxRichTextCtrl::~wxRichTextCtrl()
 {
     GetBuffer().RemoveEventHandler(this);
+    Disconnect(m_imagePropertyId, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(wxRichTextCtrl::OnUpdateImage));
+    Disconnect(m_imagePropertyId, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(wxRichTextCtrl::OnImage));
 
     delete m_contextMenu;
 }
@@ -326,6 +335,7 @@ void wxRichTextCtrl::Init()
     m_fullLayoutSavedPosition = 0;
     m_delayedLayoutThreshold = wxRICHTEXT_DEFAULT_DELAYED_LAYOUT_THRESHOLD;
     m_caretPositionForDefaultStyle = -2;
+    m_currentObject = NULL;
 }
 
 void wxRichTextCtrl::DoThaw()
@@ -2387,34 +2397,34 @@ void wxRichTextCtrl::AppendText(const wxString& text)
 }
 
 /// Write an image at the current insertion point
-bool wxRichTextCtrl::WriteImage(const wxImage& image, wxBitmapType bitmapType)
+bool wxRichTextCtrl::WriteImage(const wxImage& image, wxBitmapType bitmapType, const wxRichTextAnchoredObjectAttr& attr)
 {
     wxRichTextImageBlock imageBlock;
 
     wxImage image2 = image;
     if (imageBlock.MakeImageBlock(image2, bitmapType))
-        return WriteImage(imageBlock);
+        return WriteImage(imageBlock, attr);
 
     return false;
 }
 
-bool wxRichTextCtrl::WriteImage(const wxString& filename, wxBitmapType bitmapType)
+bool wxRichTextCtrl::WriteImage(const wxString& filename, wxBitmapType bitmapType, const wxRichTextAnchoredObjectAttr& attr)
 {
     wxRichTextImageBlock imageBlock;
 
     wxImage image;
     if (imageBlock.MakeImageBlock(filename, bitmapType, image, false))
-        return WriteImage(imageBlock);
+        return WriteImage(imageBlock, attr);
 
     return false;
 }
 
-bool wxRichTextCtrl::WriteImage(const wxRichTextImageBlock& imageBlock)
+bool wxRichTextCtrl::WriteImage(const wxRichTextImageBlock& imageBlock, const wxRichTextAnchoredObjectAttr& attr)
 {
-    return GetBuffer().InsertImageWithUndo(m_caretPosition+1, imageBlock, this);
+    return GetBuffer().InsertImageWithUndo(m_caretPosition+1, imageBlock, this, NULL, attr);
 }
 
-bool wxRichTextCtrl::WriteImage(const wxBitmap& bitmap, wxBitmapType bitmapType)
+bool wxRichTextCtrl::WriteImage(const wxBitmap& bitmap, wxBitmapType bitmapType, const wxRichTextAnchoredObjectAttr& attr)
 {
     if (bitmap.Ok())
     {
@@ -2422,7 +2432,7 @@ bool wxRichTextCtrl::WriteImage(const wxBitmap& bitmap, wxBitmapType bitmapType)
 
         wxImage image = bitmap.ConvertToImage();
         if (image.Ok() && imageBlock.MakeImageBlock(image, bitmapType))
-            return WriteImage(imageBlock);
+            return WriteImage(imageBlock, attr);
     }
 
     return false;
@@ -2824,6 +2834,18 @@ void wxRichTextCtrl::OnUpdateSelectAll(wxUpdateUIEvent& event)
     event.Enable(GetLastPosition() > 0);
 }
 
+void wxRichTextCtrl::OnImage(wxCommandEvent& WXUNUSED(event))
+{
+    if (GetCurrentObject() && GetCurrentObject()->CanEditProperties())
+        GetCurrentObject()->EditProperties(this, & GetBuffer());        
+    SetCurrentObject(NULL);
+}
+
+void wxRichTextCtrl::OnUpdateImage(wxUpdateUIEvent& event)
+{
+    event.Enable(GetCurrentObject() != NULL && GetCurrentObject()->CanEditProperties());
+}
+
 void wxRichTextCtrl::OnContextMenu(wxContextMenuEvent& event)
 {
     if (event.GetEventObject() != this)
@@ -2832,6 +2854,23 @@ void wxRichTextCtrl::OnContextMenu(wxContextMenuEvent& event)
         return;
     }
 
+    wxClientDC dc(this);
+    PrepareDC(dc);
+    dc.SetFont(GetFont());
+
+    long position = 0;
+    wxPoint pt = event.GetPosition();
+    wxPoint logicalPt = GetLogicalPoint(ScreenToClient(pt));
+    int hit = GetBuffer().HitTest(dc, logicalPt, position);
+    if (hit == wxRICHTEXT_HITTEST_ON || hit == wxRICHTEXT_HITTEST_BEFORE || hit == wxRICHTEXT_HITTEST_AFTER)
+    {
+        m_currentObject = GetBuffer().GetLeafObjectAtPosition(position);
+    }
+    else
+    {
+        m_currentObject = NULL;
+    }
+
     if (m_contextMenu)
         PopupMenu(m_contextMenu);
     return;
@@ -2847,6 +2886,11 @@ bool wxRichTextCtrl::SetStyle(const wxRichTextRange& range, const wxTextAttr& st
     return GetBuffer().SetStyle(range.ToInternal(), style);
 }
 
+void wxRichTextCtrl::SetImageStyle(wxRichTextImage *image, const wxRichTextAnchoredObjectAttr& attr)
+{
+    GetBuffer().SetImageStyle(image, attr);
+}
+
 // extended style setting operation with flags including:
 // wxRICHTEXT_SETSTYLE_WITH_UNDO, wxRICHTEXT_SETSTYLE_OPTIMIZE, wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY.
 // see richtextbuffer.h for more details.
index 35faf900d66461ad4d3511b86862256743c4a047..793bbc3a8a0c511c9943e038791db482390c1b40 100644 (file)
         <string name="Use wxPropertyGrid">"Yes"</string>
         <string name="Use wxAUI">"Yes"</string>
         <string name="Use wxSTC">"Yes"</string>
+        <string name="Use wxRegEx">"sys"</string>
         <string name="Use wxRibbonControl">"Yes"</string>
         <string name="Executable name">"%EXECUTABLE%"</string>
         <string name="Program arguments">""</string>
                     <bool name="proxy-wxFIXED_MINSIZE">0</bool>
                     <string name="proxy-Custom arguments">""</string>
                     <string name="proxy-Custom ctor arguments">""</string>
-                    <bool name="proxy-wxTE_LINEWRAP">0</bool>
                   </document>
                   <document>
                     <string name="title">"wxRichTextFontListBox: ID_RICHTEXTFONTPAGE_FACELISTBOX"</string>
                     <bool name="proxy-wxFIXED_MINSIZE">0</bool>
                     <string name="proxy-Custom arguments">""</string>
                     <string name="proxy-Custom ctor arguments">""</string>
-                    <bool name="proxy-wxTE_LINEWRAP">0</bool>
                   </document>
                   <document>
                     <string name="title">"wxListBox: ID_RICHTEXTFONTPAGE_SIZELISTBOX"</string>
                     <bool name="proxy-wxCB_DROPDOWN">0</bool>
                     <bool name="proxy-wxCB_READONLY">1</bool>
                     <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                     <bool name="proxy-wxWANTS_CHARS">0</bool>
                     <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxCB_DROPDOWN">0</bool>
                     <bool name="proxy-wxCB_READONLY">1</bool>
                     <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                     <bool name="proxy-wxWANTS_CHARS">0</bool>
                     <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxCB_DROPDOWN">0</bool>
                     <bool name="proxy-wxCB_READONLY">1</bool>
                     <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                     <bool name="proxy-wxWANTS_CHARS">0</bool>
                     <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
             <string name="proxy-type">"wbBoxSizerProxy"</string>
             <string name="proxy-Orientation">"Vertical"</string>
             <string name="proxy-Member variable name">""</string>
+            <string name="proxy-AlignH">"Centre"</string>
+            <string name="proxy-AlignV">"Centre"</string>
+            <long name="proxy-Stretch factor">0</long>
+            <long name="proxy-Border">5</long>
+            <bool name="proxy-wxLEFT">1</bool>
+            <bool name="proxy-wxRIGHT">1</bool>
+            <bool name="proxy-wxTOP">1</bool>
+            <bool name="proxy-wxBOTTOM">1</bool>
             <bool name="proxy-wxSHAPED">0</bool>
             <bool name="proxy-wxADJUST_MINSIZE">0</bool>
             <bool name="proxy-wxFIXED_MINSIZE">0</bool>
                         <bool name="proxy-wxCB_DROPDOWN">0</bool>
                         <bool name="proxy-wxCB_READONLY">1</bool>
                         <bool name="proxy-wxCB_SORT">0</bool>
+                        <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                         <bool name="proxy-wxWANTS_CHARS">0</bool>
                         <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                         <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                           <bool name="proxy-wxCB_DROPDOWN">0</bool>
                           <bool name="proxy-wxCB_READONLY">1</bool>
                           <bool name="proxy-wxCB_SORT">0</bool>
+                          <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                           <bool name="proxy-wxWANTS_CHARS">0</bool>
                           <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                           <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxCB_DROPDOWN">0</bool>
                     <bool name="proxy-wxCB_READONLY">1</bool>
                     <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                     <bool name="proxy-wxWANTS_CHARS">0</bool>
                     <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                       <bool name="proxy-wxCB_DROPDOWN">1</bool>
                       <bool name="proxy-wxCB_READONLY">0</bool>
                       <bool name="proxy-wxCB_SORT">0</bool>
+                      <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                       <bool name="proxy-wxWANTS_CHARS">0</bool>
                       <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                       <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxCB_DROPDOWN">1</bool>
                     <bool name="proxy-wxCB_READONLY">0</bool>
                     <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                     <bool name="proxy-wxWANTS_CHARS">0</bool>
                     <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxCB_DROPDOWN">1</bool>
                     <bool name="proxy-wxCB_READONLY">0</bool>
                     <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                     <bool name="proxy-wxWANTS_CHARS">0</bool>
                     <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxCB_DROPDOWN">1</bool>
                     <bool name="proxy-wxCB_READONLY">0</bool>
                     <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                     <bool name="proxy-wxWANTS_CHARS">0</bool>
                     <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxCB_DROPDOWN">1</bool>
                     <bool name="proxy-wxCB_READONLY">0</bool>
                     <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                     <bool name="proxy-wxWANTS_CHARS">0</bool>
                     <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxCB_DROPDOWN">0</bool>
                     <bool name="proxy-wxCB_READONLY">1</bool>
                     <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                     <bool name="proxy-wxWANTS_CHARS">0</bool>
                     <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxCB_DROPDOWN">0</bool>
                     <bool name="proxy-wxCB_READONLY">1</bool>
                     <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                     <bool name="proxy-wxWANTS_CHARS">0</bool>
                     <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                     <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                   <bool name="proxy-wxCB_DROPDOWN">0</bool>
                   <bool name="proxy-wxCB_READONLY">1</bool>
                   <bool name="proxy-wxCB_SORT">0</bool>
+                  <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                   <bool name="proxy-wxWANTS_CHARS">0</bool>
                   <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                   <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
           <long name="proxy-Height">300</long>
           <bool name="proxy-AUI manager">0</bool>
           <string name="proxy-Event sources">""</string>
-          <bool name="proxy-wxTHICK_FRAME">0</bool>
           <document>
             <string name="title">"wxBoxSizer V"</string>
             <string name="type">"dialog-control-document"</string>
                           <bool name="proxy-wxCB_DROPDOWN">0</bool>
                           <bool name="proxy-wxCB_READONLY">1</bool>
                           <bool name="proxy-wxCB_SORT">0</bool>
+                          <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                           <bool name="proxy-wxWANTS_CHARS">0</bool>
                           <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                           <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                             <bool name="proxy-wxCB_DROPDOWN">1</bool>
                             <bool name="proxy-wxCB_READONLY">0</bool>
                             <bool name="proxy-wxCB_SORT">0</bool>
+                            <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                             <bool name="proxy-wxWANTS_CHARS">0</bool>
                             <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                             <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                           <bool name="proxy-wxCB_DROPDOWN">1</bool>
                           <bool name="proxy-wxCB_READONLY">0</bool>
                           <bool name="proxy-wxCB_SORT">0</bool>
+                          <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                           <bool name="proxy-wxWANTS_CHARS">0</bool>
                           <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                           <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                           <bool name="proxy-wxCB_DROPDOWN">1</bool>
                           <bool name="proxy-wxCB_READONLY">0</bool>
                           <bool name="proxy-wxCB_SORT">0</bool>
+                          <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                           <bool name="proxy-wxWANTS_CHARS">0</bool>
                           <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                           <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
                                 <bool name="proxy-wxCB_DROPDOWN">0</bool>
                                 <bool name="proxy-wxCB_READONLY">1</bool>
                                 <bool name="proxy-wxCB_SORT">0</bool>
+                                <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
                                 <bool name="proxy-wxWANTS_CHARS">0</bool>
                                 <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
                                 <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
             </document>
           </document>
         </document>
+        <document>
+          <string name="title">"wxRichTextImageDialog"</string>
+          <string name="type">"dialog-document"</string>
+          <string name="filename">""</string>
+          <string name="icon-name">"dialog"</string>
+          <long name="is-transient">0</long>
+          <long name="owns-file">1</long>
+          <long name="title-mode">0</long>
+          <long name="locked">0</long>
+          <string name="proxy-type">"wbDialogProxy"</string>
+          <long name="base-id">10000</long>
+          <bool name="use-id-prefix">0</bool>
+          <string name="id-prefix">""</string>
+          <bool name="use-id-suffix">0</bool>
+          <string name="id-suffix">""</string>
+          <string name="app-kind">"Standard"</string>
+          <long name="use-xrc">0</long>
+          <long name="working-mode">0</long>
+          <string name="proxy-Id name">"ID_WXRICHTEXTIMAGEPAGE"</string>
+          <long name="proxy-Id value">10015</long>
+          <string name="proxy-Class">"wxRichTextImageDialog"</string>
+          <string name="proxy-Base class">"wxDialog"</string>
+          <string name="proxy-Window kind">"wxDialog"</string>
+          <string name="proxy-Implementation filename">"richtextimagedlg.cpp"</string>
+          <string name="proxy-Header filename">"../../include/wx/richtext/richtextimagedlg.h"</string>
+          <string name="proxy-XRC filename">""</string>
+          <string name="proxy-Title">"Image Properties"</string>
+          <bool name="proxy-Centre">1</bool>
+          <string name="proxy-Icon">""</string>
+          <bool name="proxy-Dialog units">0</bool>
+          <string name="proxy-Help text">""</string>
+          <string name="proxy-Tooltip text">""</string>
+          <string name="proxy-Background colour">""</string>
+          <string name="proxy-Foreground colour">""</string>
+          <string name="proxy-Font">""</string>
+          <bool name="proxy-Hidden">0</bool>
+          <bool name="proxy-Enabled">1</bool>
+          <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+          <string name="proxy-Data source">""</string>
+          <string name="proxy-Data class name">""</string>
+          <string name="proxy-Data class implementation filename">""</string>
+          <string name="proxy-Data class header filename">""</string>
+          <string name="proxy-Data class manager window">""</string>
+          <string name="proxy-Texture">""</string>
+          <string name="proxy-Texture style">"Tiled"</string>
+          <bool name="proxy-wxDEFAULT_DIALOG_STYLE">1</bool>
+          <bool name="proxy-wxCAPTION">0</bool>
+          <bool name="proxy-wxRESIZE_BORDER">0</bool>
+          <bool name="proxy-wxSYSTEM_MENU">0</bool>
+          <bool name="proxy-wxSTAY_ON_TOP">0</bool>
+          <bool name="proxy-wxDIALOG_NO_PARENT">0</bool>
+          <bool name="proxy-wxCLOSE_BOX">0</bool>
+          <bool name="proxy-wxMAXIMIZE_BOX">0</bool>
+          <bool name="proxy-wxMINIMIZE_BOX">0</bool>
+          <bool name="proxy-wxDIALOG_MODAL">0</bool>
+          <bool name="proxy-wxNO_BORDER">0</bool>
+          <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+          <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+          <bool name="proxy-wxBORDER_THEME">0</bool>
+          <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+          <bool name="proxy-wxRAISED_BORDER">0</bool>
+          <bool name="proxy-wxSTATIC_BORDER">0</bool>
+          <bool name="proxy-wxWANTS_CHARS">0</bool>
+          <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+          <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+          <bool name="proxy-wxCLIP_CHILDREN">0</bool>
+          <bool name="proxy-wxTAB_TRAVERSAL">1</bool>
+          <bool name="proxy-wxWS_EX_VALIDATE_RECURSIVELY">0</bool>
+          <bool name="proxy-wxWS_EX_BLOCK_EVENTS">0</bool>
+          <bool name="proxy-wxWS_EX_TRANSIENT">0</bool>
+          <string name="proxy-Custom styles">""</string>
+          <bool name="proxy-wxDIALOG_EX_CONTEXTHELP">1</bool>
+          <bool name="proxy-Fit to content">1</bool>
+          <long name="proxy-X">-1</long>
+          <long name="proxy-Y">-1</long>
+          <long name="proxy-Width">400</long>
+          <long name="proxy-Height">300</long>
+          <bool name="proxy-AUI manager">0</bool>
+          <string name="proxy-Event sources">""</string>
+          <document>
+            <string name="title">"wxBoxSizer V"</string>
+            <string name="type">"dialog-control-document"</string>
+            <string name="filename">""</string>
+            <string name="icon-name">"sizer"</string>
+            <long name="is-transient">0</long>
+            <long name="owns-file">1</long>
+            <long name="title-mode">0</long>
+            <long name="locked">0</long>
+            <string name="proxy-type">"wbBoxSizerProxy"</string>
+            <string name="proxy-Orientation">"Vertical"</string>
+            <string name="proxy-Member variable name">""</string>
+            <bool name="proxy-wxSHAPED">0</bool>
+            <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+            <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+            <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+            <document>
+              <string name="title">"wxBoxSizer H"</string>
+              <string name="type">"dialog-control-document"</string>
+              <string name="filename">""</string>
+              <string name="icon-name">"sizer"</string>
+              <long name="is-transient">0</long>
+              <long name="owns-file">1</long>
+              <long name="title-mode">0</long>
+              <long name="locked">0</long>
+              <string name="proxy-type">"wbBoxSizerProxy"</string>
+              <string name="proxy-Orientation">"Horizontal"</string>
+              <string name="proxy-Member variable name">""</string>
+              <string name="proxy-AlignH">"Expand"</string>
+              <string name="proxy-AlignV">"Centre"</string>
+              <long name="proxy-Stretch factor">0</long>
+              <long name="proxy-Border">5</long>
+              <bool name="proxy-wxLEFT">1</bool>
+              <bool name="proxy-wxRIGHT">1</bool>
+              <bool name="proxy-wxTOP">1</bool>
+              <bool name="proxy-wxBOTTOM">1</bool>
+              <bool name="proxy-wxSHAPED">0</bool>
+              <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+              <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+              <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+              <document>
+                <string name="title">"wxFlexGridSizer"</string>
+                <string name="type">"dialog-control-document"</string>
+                <string name="filename">""</string>
+                <string name="icon-name">"sizer"</string>
+                <long name="is-transient">0</long>
+                <long name="owns-file">1</long>
+                <long name="title-mode">0</long>
+                <long name="locked">0</long>
+                <string name="proxy-type">"wbFlexGridSizerProxy"</string>
+                <string name="proxy-GrowableColumns">""</string>
+                <string name="proxy-GrowableRows">""</string>
+                <long name="proxy-Columns">2</long>
+                <long name="proxy-Rows">0</long>
+                <long name="proxy-ColumnSpacing">0</long>
+                <long name="proxy-RowSpacing">0</long>
+                <string name="proxy-Member variable name">""</string>
+                <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                <string name="proxy-AlignH">"Centre"</string>
+                <string name="proxy-AlignV">"Top"</string>
+                <long name="proxy-Stretch factor">0</long>
+                <long name="proxy-Border">5</long>
+                <bool name="proxy-wxLEFT">0</bool>
+                <bool name="proxy-wxRIGHT">1</bool>
+                <bool name="proxy-wxTOP">0</bool>
+                <bool name="proxy-wxBOTTOM">0</bool>
+                <bool name="proxy-wxSHAPED">0</bool>
+                <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                <document>
+                  <string name="title">"wxStaticText: wxID_STATIC"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"statictext"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbStaticTextProxy"</string>
+                  <string name="proxy-Id name">"wxID_STATIC"</string>
+                  <long name="proxy-Id value">5105</long>
+                  <string name="proxy-Name">""</string>
+                  <string name="proxy-Class">"wxStaticText"</string>
+                  <string name="proxy-Base class">"wxStaticText"</string>
+                  <bool name="proxy-External implementation">1</bool>
+                  <bool name="proxy-Separate files">0</bool>
+                  <string name="proxy-Implementation filename">""</string>
+                  <string name="proxy-Header filename">""</string>
+                  <string name="proxy-Member variable name">""</string>
+                  <string name="proxy-Label">"Alignment:"</string>
+                  <long name="proxy-Wrapping width">-1</long>
+                  <string name="proxy-Help text">""</string>
+                  <string name="proxy-Tooltip text">""</string>
+                  <string name="proxy-Background colour">""</string>
+                  <string name="proxy-Foreground colour">""</string>
+                  <string name="proxy-Font">""</string>
+                  <bool name="proxy-Hidden">1</bool>
+                  <bool name="proxy-Enabled">1</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <string name="proxy-Data variable">""</string>
+                  <string name="proxy-Data validator">""</string>
+                  <string name="proxy-Data source">""</string>
+                  <string name="proxy-Data class name">""</string>
+                  <string name="proxy-Data class implementation filename">""</string>
+                  <string name="proxy-Data class header filename">""</string>
+                  <string name="proxy-Data class manager window">""</string>
+                  <bool name="proxy-wxALIGN_LEFT">0</bool>
+                  <bool name="proxy-wxALIGN_RIGHT">0</bool>
+                  <bool name="proxy-wxALIGN_CENTRE">0</bool>
+                  <bool name="proxy-wxST_NO_AUTORESIZE">0</bool>
+                  <bool name="proxy-wxNO_BORDER">0</bool>
+                  <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+                  <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+                  <bool name="proxy-wxBORDER_THEME">0</bool>
+                  <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+                  <bool name="proxy-wxRAISED_BORDER">0</bool>
+                  <bool name="proxy-wxSTATIC_BORDER">0</bool>
+                  <bool name="proxy-wxWANTS_CHARS">0</bool>
+                  <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                  <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                  <string name="proxy-Custom styles">""</string>
+                  <long name="proxy-X">-1</long>
+                  <long name="proxy-Y">-1</long>
+                  <long name="proxy-Width">-1</long>
+                  <long name="proxy-Height">-1</long>
+                  <string name="proxy-AlignH">"Centre"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">0</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">1</bool>
+                  <bool name="proxy-wxRIGHT">1</bool>
+                  <bool name="proxy-wxTOP">1</bool>
+                  <bool name="proxy-wxBOTTOM">1</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Custom arguments">""</string>
+                  <string name="proxy-Custom ctor arguments">""</string>
+                </document>
+                <document>
+                  <string name="title">"wxComboBox: ID_COMBOBOX_ALIGN"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"combobox"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbComboBoxProxy"</string>
+                  <string name="proxy-Id name">"ID_COMBOBOX_ALIGN"</string>
+                  <long name="proxy-Id value">10016</long>
+                  <string name="proxy-Name">""</string>
+                  <string name="proxy-Class">"wxComboBox"</string>
+                  <string name="proxy-Base class">"wxComboBox"</string>
+                  <bool name="proxy-External implementation">1</bool>
+                  <bool name="proxy-Separate files">0</bool>
+                  <string name="proxy-Implementation filename">""</string>
+                  <string name="proxy-Header filename">""</string>
+                  <string name="proxy-Member variable name">"m_alignment"</string>
+                  <string name="proxy-Strings">"Left|Centre|Right"</string>
+                  <string name="proxy-Initial value">"Left"</string>
+                  <string name="proxy-Help text">""</string>
+                  <string name="proxy-Tooltip text">""</string>
+                  <string name="proxy-Background colour">""</string>
+                  <string name="proxy-Foreground colour">""</string>
+                  <string name="proxy-Font">""</string>
+                  <bool name="proxy-Hidden">1</bool>
+                  <bool name="proxy-Enabled">1</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <string name="proxy-Data variable">""</string>
+                  <string name="proxy-Data validator">""</string>
+                  <string name="proxy-Data source">""</string>
+                  <string name="proxy-Data class name">""</string>
+                  <string name="proxy-Data class implementation filename">""</string>
+                  <string name="proxy-Data class header filename">""</string>
+                  <string name="proxy-Data class manager window">""</string>
+                  <bool name="proxy-wxCB_SIMPLE">0</bool>
+                  <bool name="proxy-wxCB_DROPDOWN">0</bool>
+                  <bool name="proxy-wxCB_READONLY">1</bool>
+                  <bool name="proxy-wxCB_SORT">0</bool>
+                  <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
+                  <bool name="proxy-wxWANTS_CHARS">0</bool>
+                  <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                  <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                  <string name="proxy-Custom styles">""</string>
+                  <long name="proxy-X">-1</long>
+                  <long name="proxy-Y">-1</long>
+                  <long name="proxy-Width">80</long>
+                  <long name="proxy-Height">-1</long>
+                  <string name="proxy-AlignH">"Centre"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">0</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">1</bool>
+                  <bool name="proxy-wxRIGHT">1</bool>
+                  <bool name="proxy-wxTOP">1</bool>
+                  <bool name="proxy-wxBOTTOM">1</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Custom arguments">""</string>
+                  <string name="proxy-Custom ctor arguments">""</string>
+                </document>
+                <document>
+                  <string name="title">"wxStaticText: wxID_STATIC"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"statictext"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbStaticTextProxy"</string>
+                  <string name="proxy-Id name">"wxID_STATIC"</string>
+                  <long name="proxy-Id value">5105</long>
+                  <string name="proxy-Name">""</string>
+                  <string name="proxy-Class">"wxStaticText"</string>
+                  <string name="proxy-Base class">"wxStaticText"</string>
+                  <bool name="proxy-External implementation">1</bool>
+                  <bool name="proxy-Separate files">0</bool>
+                  <string name="proxy-Implementation filename">""</string>
+                  <string name="proxy-Header filename">""</string>
+                  <string name="proxy-Member variable name">""</string>
+                  <string name="proxy-Label">"&amp;Floating mode:"</string>
+                  <long name="proxy-Wrapping width">-1</long>
+                  <string name="proxy-Help text">""</string>
+                  <string name="proxy-Tooltip text">""</string>
+                  <string name="proxy-Background colour">""</string>
+                  <string name="proxy-Foreground colour">""</string>
+                  <string name="proxy-Font">""</string>
+                  <bool name="proxy-Hidden">0</bool>
+                  <bool name="proxy-Enabled">1</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <string name="proxy-Data variable">""</string>
+                  <string name="proxy-Data validator">""</string>
+                  <string name="proxy-Data source">""</string>
+                  <string name="proxy-Data class name">""</string>
+                  <string name="proxy-Data class implementation filename">""</string>
+                  <string name="proxy-Data class header filename">""</string>
+                  <string name="proxy-Data class manager window">""</string>
+                  <bool name="proxy-wxALIGN_LEFT">0</bool>
+                  <bool name="proxy-wxALIGN_RIGHT">0</bool>
+                  <bool name="proxy-wxALIGN_CENTRE">0</bool>
+                  <bool name="proxy-wxST_NO_AUTORESIZE">0</bool>
+                  <bool name="proxy-wxNO_BORDER">0</bool>
+                  <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+                  <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+                  <bool name="proxy-wxBORDER_THEME">0</bool>
+                  <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+                  <bool name="proxy-wxRAISED_BORDER">0</bool>
+                  <bool name="proxy-wxSTATIC_BORDER">0</bool>
+                  <bool name="proxy-wxWANTS_CHARS">0</bool>
+                  <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                  <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                  <string name="proxy-Custom styles">""</string>
+                  <long name="proxy-X">-1</long>
+                  <long name="proxy-Y">-1</long>
+                  <long name="proxy-Width">-1</long>
+                  <long name="proxy-Height">-1</long>
+                  <string name="proxy-AlignH">"Right"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">0</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">1</bool>
+                  <bool name="proxy-wxRIGHT">1</bool>
+                  <bool name="proxy-wxTOP">1</bool>
+                  <bool name="proxy-wxBOTTOM">1</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Custom arguments">""</string>
+                  <string name="proxy-Custom ctor arguments">""</string>
+                </document>
+                <document>
+                  <string name="title">"wxComboBox: ID_RICHTEXTIMAGEDIALOG_FLOATING_MODE"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"combobox"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbComboBoxProxy"</string>
+                  <string name="proxy-Id name">"ID_RICHTEXTIMAGEDIALOG_FLOATING_MODE"</string>
+                  <long name="proxy-Id value">10017</long>
+                  <string name="proxy-Name">""</string>
+                  <string name="proxy-Class">"wxComboBox"</string>
+                  <string name="proxy-Base class">"wxComboBox"</string>
+                  <bool name="proxy-External implementation">1</bool>
+                  <bool name="proxy-Separate files">0</bool>
+                  <string name="proxy-Implementation filename">""</string>
+                  <string name="proxy-Header filename">""</string>
+                  <string name="proxy-Member variable name">"m_float"</string>
+                  <string name="proxy-Strings">"None|Left|Right"</string>
+                  <string name="proxy-Initial value">"None"</string>
+                  <string name="proxy-Help text">"How the image will float relative to the text."</string>
+                  <string name="proxy-Tooltip text">""</string>
+                  <string name="proxy-Background colour">""</string>
+                  <string name="proxy-Foreground colour">""</string>
+                  <string name="proxy-Font">""</string>
+                  <bool name="proxy-Hidden">0</bool>
+                  <bool name="proxy-Enabled">1</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <string name="proxy-Data variable">""</string>
+                  <string name="proxy-Data validator">""</string>
+                  <string name="proxy-Data source">""</string>
+                  <string name="proxy-Data class name">""</string>
+                  <string name="proxy-Data class implementation filename">""</string>
+                  <string name="proxy-Data class header filename">""</string>
+                  <string name="proxy-Data class manager window">""</string>
+                  <bool name="proxy-wxCB_SIMPLE">0</bool>
+                  <bool name="proxy-wxCB_DROPDOWN">0</bool>
+                  <bool name="proxy-wxCB_READONLY">1</bool>
+                  <bool name="proxy-wxCB_SORT">0</bool>
+                  <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
+                  <bool name="proxy-wxWANTS_CHARS">0</bool>
+                  <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                  <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                  <string name="proxy-Custom styles">""</string>
+                  <long name="proxy-X">-1</long>
+                  <long name="proxy-Y">-1</long>
+                  <long name="proxy-Width">80</long>
+                  <long name="proxy-Height">-1</long>
+                  <string name="proxy-AlignH">"Left"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">0</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">1</bool>
+                  <bool name="proxy-wxRIGHT">1</bool>
+                  <bool name="proxy-wxTOP">1</bool>
+                  <bool name="proxy-wxBOTTOM">1</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Custom arguments">""</string>
+                  <string name="proxy-Custom ctor arguments">""</string>
+                </document>
+                <document>
+                  <string name="title">"wxStaticText: wxID_STATIC"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"statictext"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbStaticTextProxy"</string>
+                  <string name="proxy-Id name">"wxID_STATIC"</string>
+                  <long name="proxy-Id value">5105</long>
+                  <string name="proxy-Name">""</string>
+                  <string name="proxy-Class">"wxStaticText"</string>
+                  <string name="proxy-Base class">"wxStaticText"</string>
+                  <bool name="proxy-External implementation">1</bool>
+                  <bool name="proxy-Separate files">0</bool>
+                  <string name="proxy-Implementation filename">""</string>
+                  <string name="proxy-Header filename">""</string>
+                  <string name="proxy-Member variable name">""</string>
+                  <string name="proxy-Label">"&amp;Width:"</string>
+                  <long name="proxy-Wrapping width">-1</long>
+                  <string name="proxy-Help text">""</string>
+                  <string name="proxy-Tooltip text">""</string>
+                  <string name="proxy-Background colour">""</string>
+                  <string name="proxy-Foreground colour">""</string>
+                  <string name="proxy-Font">""</string>
+                  <bool name="proxy-Hidden">0</bool>
+                  <bool name="proxy-Enabled">1</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <string name="proxy-Data variable">""</string>
+                  <string name="proxy-Data validator">""</string>
+                  <string name="proxy-Data source">""</string>
+                  <string name="proxy-Data class name">""</string>
+                  <string name="proxy-Data class implementation filename">""</string>
+                  <string name="proxy-Data class header filename">""</string>
+                  <string name="proxy-Data class manager window">""</string>
+                  <bool name="proxy-wxALIGN_LEFT">0</bool>
+                  <bool name="proxy-wxALIGN_RIGHT">0</bool>
+                  <bool name="proxy-wxALIGN_CENTRE">0</bool>
+                  <bool name="proxy-wxST_NO_AUTORESIZE">0</bool>
+                  <bool name="proxy-wxNO_BORDER">0</bool>
+                  <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+                  <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+                  <bool name="proxy-wxBORDER_THEME">0</bool>
+                  <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+                  <bool name="proxy-wxRAISED_BORDER">0</bool>
+                  <bool name="proxy-wxSTATIC_BORDER">0</bool>
+                  <bool name="proxy-wxWANTS_CHARS">0</bool>
+                  <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                  <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                  <string name="proxy-Custom styles">""</string>
+                  <long name="proxy-X">-1</long>
+                  <long name="proxy-Y">-1</long>
+                  <long name="proxy-Width">-1</long>
+                  <long name="proxy-Height">-1</long>
+                  <string name="proxy-AlignH">"Right"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">0</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">1</bool>
+                  <bool name="proxy-wxRIGHT">1</bool>
+                  <bool name="proxy-wxTOP">1</bool>
+                  <bool name="proxy-wxBOTTOM">1</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Custom arguments">""</string>
+                  <string name="proxy-Custom ctor arguments">""</string>
+                </document>
+                <document>
+                  <string name="title">"wxBoxSizer H"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"sizer"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbBoxSizerProxy"</string>
+                  <string name="proxy-Orientation">"Horizontal"</string>
+                  <string name="proxy-Member variable name">""</string>
+                  <string name="proxy-AlignH">"Left"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">0</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">0</bool>
+                  <bool name="proxy-wxRIGHT">0</bool>
+                  <bool name="proxy-wxTOP">0</bool>
+                  <bool name="proxy-wxBOTTOM">0</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <document>
+                    <string name="title">"wxTextCtrl: ID_RICHTEXTIMAGEDIALOG_WIDTH"</string>
+                    <string name="type">"dialog-control-document"</string>
+                    <string name="filename">""</string>
+                    <string name="icon-name">"textctrl"</string>
+                    <long name="is-transient">0</long>
+                    <long name="owns-file">1</long>
+                    <long name="title-mode">0</long>
+                    <long name="locked">0</long>
+                    <string name="proxy-type">"wbTextCtrlProxy"</string>
+                    <string name="proxy-Id name">"ID_RICHTEXTIMAGEDIALOG_WIDTH"</string>
+                    <long name="proxy-Id value">10018</long>
+                    <string name="proxy-Name">""</string>
+                    <string name="proxy-Class">"wxTextCtrl"</string>
+                    <string name="proxy-Base class">"wxTextCtrl"</string>
+                    <bool name="proxy-External implementation">1</bool>
+                    <bool name="proxy-Separate files">0</bool>
+                    <string name="proxy-Implementation filename">""</string>
+                    <string name="proxy-Header filename">""</string>
+                    <string name="proxy-Member variable name">"m_width"</string>
+                    <string name="proxy-Initial value">""</string>
+                    <long name="proxy-Max length">0</long>
+                    <string name="proxy-Help text">"The image width to be shown - does not change the source image width."</string>
+                    <string name="proxy-Tooltip text">""</string>
+                    <string name="proxy-Background colour">""</string>
+                    <string name="proxy-Foreground colour">""</string>
+                    <string name="proxy-Font">""</string>
+                    <bool name="proxy-Hidden">0</bool>
+                    <bool name="proxy-Enabled">1</bool>
+                    <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                    <string name="proxy-Data variable">""</string>
+                    <string name="proxy-Data validator">""</string>
+                    <string name="proxy-Data source">""</string>
+                    <string name="proxy-Data class name">""</string>
+                    <string name="proxy-Data class implementation filename">""</string>
+                    <string name="proxy-Data class header filename">""</string>
+                    <string name="proxy-Data class manager window">""</string>
+                    <bool name="proxy-wxTE_MULTILINE">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_TAB">0</bool>
+                    <bool name="proxy-wxTE_PASSWORD">0</bool>
+                    <bool name="proxy-wxTE_READONLY">0</bool>
+                    <bool name="proxy-wxTE_RICH">0</bool>
+                    <bool name="proxy-wxTE_RICH2">0</bool>
+                    <bool name="proxy-wxTE_AUTO_URL">0</bool>
+                    <bool name="proxy-wxTE_NOHIDESEL">0</bool>
+                    <bool name="proxy-wxTE_LEFT">0</bool>
+                    <bool name="proxy-wxTE_CENTRE">0</bool>
+                    <bool name="proxy-wxTE_RIGHT">0</bool>
+                    <bool name="proxy-wxHSCROLL">0</bool>
+                    <bool name="proxy-wxTE_CHARWRAP">0</bool>
+                    <bool name="proxy-wxTE_WORDWRAP">0</bool>
+                    <bool name="proxy-wxTE_CAPITALIZE">0</bool>
+                    <bool name="proxy-wxNO_BORDER">0</bool>
+                    <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+                    <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+                    <bool name="proxy-wxBORDER_THEME">0</bool>
+                    <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+                    <bool name="proxy-wxRAISED_BORDER">0</bool>
+                    <bool name="proxy-wxSTATIC_BORDER">0</bool>
+                    <bool name="proxy-wxWANTS_CHARS">0</bool>
+                    <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                    <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                    <string name="proxy-Custom styles">""</string>
+                    <long name="proxy-X">-1</long>
+                    <long name="proxy-Y">-1</long>
+                    <long name="proxy-Width">65</long>
+                    <long name="proxy-Height">-1</long>
+                    <string name="proxy-AlignH">"Left"</string>
+                    <string name="proxy-AlignV">"Centre"</string>
+                    <long name="proxy-Stretch factor">0</long>
+                    <long name="proxy-Border">5</long>
+                    <bool name="proxy-wxLEFT">1</bool>
+                    <bool name="proxy-wxRIGHT">1</bool>
+                    <bool name="proxy-wxTOP">1</bool>
+                    <bool name="proxy-wxBOTTOM">1</bool>
+                    <bool name="proxy-wxSHAPED">0</bool>
+                    <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                    <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                    <string name="proxy-Custom arguments">""</string>
+                    <string name="proxy-Custom ctor arguments">""</string>
+                  </document>
+                  <document>
+                    <string name="title">"wxComboBox: ID_RICHTEXTIMAGEDIALOG_UNITS_W"</string>
+                    <string name="type">"dialog-control-document"</string>
+                    <string name="filename">""</string>
+                    <string name="icon-name">"combobox"</string>
+                    <long name="is-transient">0</long>
+                    <long name="owns-file">1</long>
+                    <long name="title-mode">0</long>
+                    <long name="locked">0</long>
+                    <string name="proxy-type">"wbComboBoxProxy"</string>
+                    <string name="proxy-Id name">"ID_RICHTEXTIMAGEDIALOG_UNITS_W"</string>
+                    <long name="proxy-Id value">10019</long>
+                    <string name="proxy-Name">""</string>
+                    <string name="proxy-Class">"wxComboBox"</string>
+                    <string name="proxy-Base class">"wxComboBox"</string>
+                    <bool name="proxy-External implementation">1</bool>
+                    <bool name="proxy-Separate files">0</bool>
+                    <string name="proxy-Implementation filename">""</string>
+                    <string name="proxy-Header filename">""</string>
+                    <string name="proxy-Member variable name">"m_unitsW"</string>
+                    <string name="proxy-Strings">"px|cm"</string>
+                    <string name="proxy-Initial value">"px"</string>
+                    <string name="proxy-Help text">"Units for the image width."</string>
+                    <string name="proxy-Tooltip text">""</string>
+                    <string name="proxy-Background colour">""</string>
+                    <string name="proxy-Foreground colour">""</string>
+                    <string name="proxy-Font">""</string>
+                    <bool name="proxy-Hidden">0</bool>
+                    <bool name="proxy-Enabled">1</bool>
+                    <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                    <string name="proxy-Data variable">""</string>
+                    <string name="proxy-Data validator">""</string>
+                    <string name="proxy-Data source">""</string>
+                    <string name="proxy-Data class name">""</string>
+                    <string name="proxy-Data class implementation filename">""</string>
+                    <string name="proxy-Data class header filename">""</string>
+                    <string name="proxy-Data class manager window">""</string>
+                    <bool name="proxy-wxCB_SIMPLE">0</bool>
+                    <bool name="proxy-wxCB_DROPDOWN">0</bool>
+                    <bool name="proxy-wxCB_READONLY">1</bool>
+                    <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
+                    <bool name="proxy-wxWANTS_CHARS">0</bool>
+                    <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                    <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                    <string name="proxy-Custom styles">""</string>
+                    <long name="proxy-X">-1</long>
+                    <long name="proxy-Y">-1</long>
+                    <long name="proxy-Width">60</long>
+                    <long name="proxy-Height">-1</long>
+                    <string name="proxy-AlignH">"Centre"</string>
+                    <string name="proxy-AlignV">"Centre"</string>
+                    <long name="proxy-Stretch factor">0</long>
+                    <long name="proxy-Border">5</long>
+                    <bool name="proxy-wxLEFT">1</bool>
+                    <bool name="proxy-wxRIGHT">1</bool>
+                    <bool name="proxy-wxTOP">1</bool>
+                    <bool name="proxy-wxBOTTOM">1</bool>
+                    <bool name="proxy-wxSHAPED">0</bool>
+                    <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                    <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                    <string name="proxy-Custom arguments">""</string>
+                    <string name="proxy-Custom ctor arguments">""</string>
+                  </document>
+                </document>
+                <document>
+                  <string name="title">"wxStaticText: wxID_STATIC"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"statictext"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbStaticTextProxy"</string>
+                  <string name="proxy-Id name">"wxID_STATIC"</string>
+                  <long name="proxy-Id value">5105</long>
+                  <string name="proxy-Name">""</string>
+                  <string name="proxy-Class">"wxStaticText"</string>
+                  <string name="proxy-Base class">"wxStaticText"</string>
+                  <bool name="proxy-External implementation">1</bool>
+                  <bool name="proxy-Separate files">0</bool>
+                  <string name="proxy-Implementation filename">""</string>
+                  <string name="proxy-Header filename">""</string>
+                  <string name="proxy-Member variable name">""</string>
+                  <string name="proxy-Label">"&amp;Height:"</string>
+                  <long name="proxy-Wrapping width">-1</long>
+                  <string name="proxy-Help text">""</string>
+                  <string name="proxy-Tooltip text">""</string>
+                  <string name="proxy-Background colour">""</string>
+                  <string name="proxy-Foreground colour">""</string>
+                  <string name="proxy-Font">""</string>
+                  <bool name="proxy-Hidden">0</bool>
+                  <bool name="proxy-Enabled">1</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <string name="proxy-Data variable">""</string>
+                  <string name="proxy-Data validator">""</string>
+                  <string name="proxy-Data source">""</string>
+                  <string name="proxy-Data class name">""</string>
+                  <string name="proxy-Data class implementation filename">""</string>
+                  <string name="proxy-Data class header filename">""</string>
+                  <string name="proxy-Data class manager window">""</string>
+                  <bool name="proxy-wxALIGN_LEFT">0</bool>
+                  <bool name="proxy-wxALIGN_RIGHT">0</bool>
+                  <bool name="proxy-wxALIGN_CENTRE">0</bool>
+                  <bool name="proxy-wxST_NO_AUTORESIZE">0</bool>
+                  <bool name="proxy-wxNO_BORDER">0</bool>
+                  <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+                  <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+                  <bool name="proxy-wxBORDER_THEME">0</bool>
+                  <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+                  <bool name="proxy-wxRAISED_BORDER">0</bool>
+                  <bool name="proxy-wxSTATIC_BORDER">0</bool>
+                  <bool name="proxy-wxWANTS_CHARS">0</bool>
+                  <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                  <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                  <string name="proxy-Custom styles">""</string>
+                  <long name="proxy-X">-1</long>
+                  <long name="proxy-Y">-1</long>
+                  <long name="proxy-Width">-1</long>
+                  <long name="proxy-Height">-1</long>
+                  <string name="proxy-AlignH">"Right"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">0</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">1</bool>
+                  <bool name="proxy-wxRIGHT">1</bool>
+                  <bool name="proxy-wxTOP">1</bool>
+                  <bool name="proxy-wxBOTTOM">1</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Custom arguments">""</string>
+                  <string name="proxy-Custom ctor arguments">""</string>
+                </document>
+                <document>
+                  <string name="title">"wxBoxSizer H"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"sizer"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbBoxSizerProxy"</string>
+                  <string name="proxy-Orientation">"Horizontal"</string>
+                  <string name="proxy-Member variable name">""</string>
+                  <string name="proxy-AlignH">"Left"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">0</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">0</bool>
+                  <bool name="proxy-wxRIGHT">0</bool>
+                  <bool name="proxy-wxTOP">0</bool>
+                  <bool name="proxy-wxBOTTOM">0</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <document>
+                    <string name="title">"wxTextCtrl: ID_RICHTEXTIMAGEDIALOG_HEIGHT"</string>
+                    <string name="type">"dialog-control-document"</string>
+                    <string name="filename">""</string>
+                    <string name="icon-name">"textctrl"</string>
+                    <long name="is-transient">0</long>
+                    <long name="owns-file">1</long>
+                    <long name="title-mode">0</long>
+                    <long name="locked">0</long>
+                    <string name="proxy-type">"wbTextCtrlProxy"</string>
+                    <string name="proxy-Id name">"ID_RICHTEXTIMAGEDIALOG_HEIGHT"</string>
+                    <long name="proxy-Id value">10020</long>
+                    <string name="proxy-Name">""</string>
+                    <string name="proxy-Class">"wxTextCtrl"</string>
+                    <string name="proxy-Base class">"wxTextCtrl"</string>
+                    <bool name="proxy-External implementation">1</bool>
+                    <bool name="proxy-Separate files">0</bool>
+                    <string name="proxy-Implementation filename">""</string>
+                    <string name="proxy-Header filename">""</string>
+                    <string name="proxy-Member variable name">"m_height"</string>
+                    <string name="proxy-Initial value">""</string>
+                    <long name="proxy-Max length">0</long>
+                    <string name="proxy-Help text">"The image height to be shown - does not change the source image height."</string>
+                    <string name="proxy-Tooltip text">""</string>
+                    <string name="proxy-Background colour">""</string>
+                    <string name="proxy-Foreground colour">""</string>
+                    <string name="proxy-Font">""</string>
+                    <bool name="proxy-Hidden">0</bool>
+                    <bool name="proxy-Enabled">1</bool>
+                    <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                    <string name="proxy-Data variable">""</string>
+                    <string name="proxy-Data validator">""</string>
+                    <string name="proxy-Data source">""</string>
+                    <string name="proxy-Data class name">""</string>
+                    <string name="proxy-Data class implementation filename">""</string>
+                    <string name="proxy-Data class header filename">""</string>
+                    <string name="proxy-Data class manager window">""</string>
+                    <bool name="proxy-wxTE_MULTILINE">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_TAB">0</bool>
+                    <bool name="proxy-wxTE_PASSWORD">0</bool>
+                    <bool name="proxy-wxTE_READONLY">0</bool>
+                    <bool name="proxy-wxTE_RICH">0</bool>
+                    <bool name="proxy-wxTE_RICH2">0</bool>
+                    <bool name="proxy-wxTE_AUTO_URL">0</bool>
+                    <bool name="proxy-wxTE_NOHIDESEL">0</bool>
+                    <bool name="proxy-wxTE_LEFT">0</bool>
+                    <bool name="proxy-wxTE_CENTRE">0</bool>
+                    <bool name="proxy-wxTE_RIGHT">0</bool>
+                    <bool name="proxy-wxHSCROLL">0</bool>
+                    <bool name="proxy-wxTE_CHARWRAP">0</bool>
+                    <bool name="proxy-wxTE_WORDWRAP">0</bool>
+                    <bool name="proxy-wxTE_CAPITALIZE">0</bool>
+                    <bool name="proxy-wxNO_BORDER">0</bool>
+                    <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+                    <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+                    <bool name="proxy-wxBORDER_THEME">0</bool>
+                    <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+                    <bool name="proxy-wxRAISED_BORDER">0</bool>
+                    <bool name="proxy-wxSTATIC_BORDER">0</bool>
+                    <bool name="proxy-wxWANTS_CHARS">0</bool>
+                    <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                    <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                    <string name="proxy-Custom styles">""</string>
+                    <long name="proxy-X">-1</long>
+                    <long name="proxy-Y">-1</long>
+                    <long name="proxy-Width">65</long>
+                    <long name="proxy-Height">-1</long>
+                    <string name="proxy-AlignH">"Left"</string>
+                    <string name="proxy-AlignV">"Centre"</string>
+                    <long name="proxy-Stretch factor">0</long>
+                    <long name="proxy-Border">5</long>
+                    <bool name="proxy-wxLEFT">1</bool>
+                    <bool name="proxy-wxRIGHT">1</bool>
+                    <bool name="proxy-wxTOP">1</bool>
+                    <bool name="proxy-wxBOTTOM">1</bool>
+                    <bool name="proxy-wxSHAPED">0</bool>
+                    <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                    <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                    <string name="proxy-Custom arguments">""</string>
+                    <string name="proxy-Custom ctor arguments">""</string>
+                  </document>
+                  <document>
+                    <string name="title">"wxComboBox: ID_RICHTEXTIMAGEDIALOG_UNITS_H"</string>
+                    <string name="type">"dialog-control-document"</string>
+                    <string name="filename">""</string>
+                    <string name="icon-name">"combobox"</string>
+                    <long name="is-transient">0</long>
+                    <long name="owns-file">1</long>
+                    <long name="title-mode">0</long>
+                    <long name="locked">0</long>
+                    <string name="proxy-type">"wbComboBoxProxy"</string>
+                    <string name="proxy-Id name">"ID_RICHTEXTIMAGEDIALOG_UNITS_H"</string>
+                    <long name="proxy-Id value">10021</long>
+                    <string name="proxy-Name">""</string>
+                    <string name="proxy-Class">"wxComboBox"</string>
+                    <string name="proxy-Base class">"wxComboBox"</string>
+                    <bool name="proxy-External implementation">1</bool>
+                    <bool name="proxy-Separate files">0</bool>
+                    <string name="proxy-Implementation filename">""</string>
+                    <string name="proxy-Header filename">""</string>
+                    <string name="proxy-Member variable name">"m_unitsH"</string>
+                    <string name="proxy-Strings">"px|cm"</string>
+                    <string name="proxy-Initial value">"px"</string>
+                    <string name="proxy-Help text">"Units for the image height."</string>
+                    <string name="proxy-Tooltip text">""</string>
+                    <string name="proxy-Background colour">""</string>
+                    <string name="proxy-Foreground colour">""</string>
+                    <string name="proxy-Font">""</string>
+                    <bool name="proxy-Hidden">0</bool>
+                    <bool name="proxy-Enabled">1</bool>
+                    <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                    <string name="proxy-Data variable">""</string>
+                    <string name="proxy-Data validator">""</string>
+                    <string name="proxy-Data source">""</string>
+                    <string name="proxy-Data class name">""</string>
+                    <string name="proxy-Data class implementation filename">""</string>
+                    <string name="proxy-Data class header filename">""</string>
+                    <string name="proxy-Data class manager window">""</string>
+                    <bool name="proxy-wxCB_SIMPLE">0</bool>
+                    <bool name="proxy-wxCB_DROPDOWN">0</bool>
+                    <bool name="proxy-wxCB_READONLY">1</bool>
+                    <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
+                    <bool name="proxy-wxWANTS_CHARS">0</bool>
+                    <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                    <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                    <string name="proxy-Custom styles">""</string>
+                    <long name="proxy-X">-1</long>
+                    <long name="proxy-Y">-1</long>
+                    <long name="proxy-Width">60</long>
+                    <long name="proxy-Height">-1</long>
+                    <string name="proxy-AlignH">"Centre"</string>
+                    <string name="proxy-AlignV">"Centre"</string>
+                    <long name="proxy-Stretch factor">0</long>
+                    <long name="proxy-Border">5</long>
+                    <bool name="proxy-wxLEFT">1</bool>
+                    <bool name="proxy-wxRIGHT">1</bool>
+                    <bool name="proxy-wxTOP">1</bool>
+                    <bool name="proxy-wxBOTTOM">1</bool>
+                    <bool name="proxy-wxSHAPED">0</bool>
+                    <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                    <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                    <string name="proxy-Custom arguments">""</string>
+                    <string name="proxy-Custom ctor arguments">""</string>
+                  </document>
+                </document>
+                <document>
+                  <string name="title">"wxStaticText: wxID_STATIC"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"statictext"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbStaticTextProxy"</string>
+                  <string name="proxy-Id name">"wxID_STATIC"</string>
+                  <long name="proxy-Id value">5105</long>
+                  <string name="proxy-Name">""</string>
+                  <string name="proxy-Class">"wxStaticText"</string>
+                  <string name="proxy-Base class">"wxStaticText"</string>
+                  <bool name="proxy-External implementation">1</bool>
+                  <bool name="proxy-Separate files">0</bool>
+                  <string name="proxy-Implementation filename">""</string>
+                  <string name="proxy-Header filename">""</string>
+                  <string name="proxy-Member variable name">""</string>
+                  <string name="proxy-Label">"Image Vertical &amp;Offset:"</string>
+                  <long name="proxy-Wrapping width">-1</long>
+                  <string name="proxy-Help text">""</string>
+                  <string name="proxy-Tooltip text">""</string>
+                  <string name="proxy-Background colour">""</string>
+                  <string name="proxy-Foreground colour">""</string>
+                  <string name="proxy-Font">""</string>
+                  <bool name="proxy-Hidden">0</bool>
+                  <bool name="proxy-Enabled">1</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <string name="proxy-Data variable">""</string>
+                  <string name="proxy-Data validator">""</string>
+                  <string name="proxy-Data source">""</string>
+                  <string name="proxy-Data class name">""</string>
+                  <string name="proxy-Data class implementation filename">""</string>
+                  <string name="proxy-Data class header filename">""</string>
+                  <string name="proxy-Data class manager window">""</string>
+                  <bool name="proxy-wxALIGN_LEFT">0</bool>
+                  <bool name="proxy-wxALIGN_RIGHT">0</bool>
+                  <bool name="proxy-wxALIGN_CENTRE">0</bool>
+                  <bool name="proxy-wxST_NO_AUTORESIZE">0</bool>
+                  <bool name="proxy-wxNO_BORDER">0</bool>
+                  <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+                  <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+                  <bool name="proxy-wxBORDER_THEME">0</bool>
+                  <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+                  <bool name="proxy-wxRAISED_BORDER">0</bool>
+                  <bool name="proxy-wxSTATIC_BORDER">0</bool>
+                  <bool name="proxy-wxWANTS_CHARS">0</bool>
+                  <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                  <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                  <string name="proxy-Custom styles">""</string>
+                  <long name="proxy-X">-1</long>
+                  <long name="proxy-Y">-1</long>
+                  <long name="proxy-Width">-1</long>
+                  <long name="proxy-Height">-1</long>
+                  <string name="proxy-AlignH">"Right"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">0</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">1</bool>
+                  <bool name="proxy-wxRIGHT">1</bool>
+                  <bool name="proxy-wxTOP">1</bool>
+                  <bool name="proxy-wxBOTTOM">1</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Custom arguments">""</string>
+                  <string name="proxy-Custom ctor arguments">""</string>
+                </document>
+                <document>
+                  <string name="title">"wxBoxSizer H"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"sizer"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbBoxSizerProxy"</string>
+                  <string name="proxy-Orientation">"Horizontal"</string>
+                  <string name="proxy-Member variable name">""</string>
+                  <string name="proxy-AlignH">"Left"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">1</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">0</bool>
+                  <bool name="proxy-wxRIGHT">0</bool>
+                  <bool name="proxy-wxTOP">0</bool>
+                  <bool name="proxy-wxBOTTOM">0</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <document>
+                    <string name="title">"wxTextCtrl: ID_RICHTEXTIMAGEDIALOG_OFFSET"</string>
+                    <string name="type">"dialog-control-document"</string>
+                    <string name="filename">""</string>
+                    <string name="icon-name">"textctrl"</string>
+                    <long name="is-transient">0</long>
+                    <long name="owns-file">1</long>
+                    <long name="title-mode">0</long>
+                    <long name="locked">0</long>
+                    <string name="proxy-type">"wbTextCtrlProxy"</string>
+                    <string name="proxy-Id name">"ID_RICHTEXTIMAGEDIALOG_OFFSET"</string>
+                    <long name="proxy-Id value">10022</long>
+                    <string name="proxy-Name">""</string>
+                    <string name="proxy-Class">"wxTextCtrl"</string>
+                    <string name="proxy-Base class">"wxTextCtrl"</string>
+                    <bool name="proxy-External implementation">1</bool>
+                    <bool name="proxy-Separate files">0</bool>
+                    <string name="proxy-Implementation filename">""</string>
+                    <string name="proxy-Header filename">""</string>
+                    <string name="proxy-Member variable name">"m_offset"</string>
+                    <string name="proxy-Initial value">""</string>
+                    <long name="proxy-Max length">10</long>
+                    <string name="proxy-Help text">"The vertical offset relative to the paragraph."</string>
+                    <string name="proxy-Tooltip text">""</string>
+                    <string name="proxy-Background colour">""</string>
+                    <string name="proxy-Foreground colour">""</string>
+                    <string name="proxy-Font">""</string>
+                    <bool name="proxy-Hidden">0</bool>
+                    <bool name="proxy-Enabled">1</bool>
+                    <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                    <string name="proxy-Data variable">""</string>
+                    <string name="proxy-Data validator">""</string>
+                    <string name="proxy-Data source">""</string>
+                    <string name="proxy-Data class name">""</string>
+                    <string name="proxy-Data class implementation filename">""</string>
+                    <string name="proxy-Data class header filename">""</string>
+                    <string name="proxy-Data class manager window">""</string>
+                    <bool name="proxy-wxTE_MULTILINE">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_TAB">0</bool>
+                    <bool name="proxy-wxTE_PASSWORD">0</bool>
+                    <bool name="proxy-wxTE_READONLY">0</bool>
+                    <bool name="proxy-wxTE_RICH">0</bool>
+                    <bool name="proxy-wxTE_RICH2">0</bool>
+                    <bool name="proxy-wxTE_AUTO_URL">0</bool>
+                    <bool name="proxy-wxTE_NOHIDESEL">0</bool>
+                    <bool name="proxy-wxTE_LEFT">0</bool>
+                    <bool name="proxy-wxTE_CENTRE">0</bool>
+                    <bool name="proxy-wxTE_RIGHT">0</bool>
+                    <bool name="proxy-wxHSCROLL">0</bool>
+                    <bool name="proxy-wxTE_CHARWRAP">0</bool>
+                    <bool name="proxy-wxTE_WORDWRAP">0</bool>
+                    <bool name="proxy-wxTE_CAPITALIZE">0</bool>
+                    <bool name="proxy-wxNO_BORDER">0</bool>
+                    <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+                    <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+                    <bool name="proxy-wxBORDER_THEME">0</bool>
+                    <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+                    <bool name="proxy-wxRAISED_BORDER">0</bool>
+                    <bool name="proxy-wxSTATIC_BORDER">0</bool>
+                    <bool name="proxy-wxWANTS_CHARS">0</bool>
+                    <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                    <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                    <string name="proxy-Custom styles">""</string>
+                    <long name="proxy-X">-1</long>
+                    <long name="proxy-Y">-1</long>
+                    <long name="proxy-Width">65</long>
+                    <long name="proxy-Height">-1</long>
+                    <string name="proxy-AlignH">"Centre"</string>
+                    <string name="proxy-AlignV">"Centre"</string>
+                    <long name="proxy-Stretch factor">0</long>
+                    <long name="proxy-Border">5</long>
+                    <bool name="proxy-wxLEFT">1</bool>
+                    <bool name="proxy-wxRIGHT">1</bool>
+                    <bool name="proxy-wxTOP">1</bool>
+                    <bool name="proxy-wxBOTTOM">1</bool>
+                    <bool name="proxy-wxSHAPED">0</bool>
+                    <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                    <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                    <string name="proxy-Custom arguments">""</string>
+                    <string name="proxy-Custom ctor arguments">""</string>
+                  </document>
+                  <document>
+                    <string name="title">"wxComboBox: ID_RICHTEXTIMAGEDIALOG_OFFSET_UNITS"</string>
+                    <string name="type">"dialog-control-document"</string>
+                    <string name="filename">""</string>
+                    <string name="icon-name">"combobox"</string>
+                    <long name="is-transient">0</long>
+                    <long name="owns-file">1</long>
+                    <long name="title-mode">0</long>
+                    <long name="locked">0</long>
+                    <string name="proxy-type">"wbComboBoxProxy"</string>
+                    <string name="proxy-Id name">"ID_RICHTEXTIMAGEDIALOG_OFFSET_UNITS"</string>
+                    <long name="proxy-Id value">10023</long>
+                    <string name="proxy-Name">""</string>
+                    <string name="proxy-Class">"wxComboBox"</string>
+                    <string name="proxy-Base class">"wxComboBox"</string>
+                    <bool name="proxy-External implementation">1</bool>
+                    <bool name="proxy-Separate files">0</bool>
+                    <string name="proxy-Implementation filename">""</string>
+                    <string name="proxy-Header filename">""</string>
+                    <string name="proxy-Member variable name">"m_unitsOffset"</string>
+                    <string name="proxy-Strings">"px|cm"</string>
+                    <string name="proxy-Initial value">"px"</string>
+                    <string name="proxy-Help text">"Units for the image offset."</string>
+                    <string name="proxy-Tooltip text">""</string>
+                    <string name="proxy-Background colour">""</string>
+                    <string name="proxy-Foreground colour">""</string>
+                    <string name="proxy-Font">""</string>
+                    <bool name="proxy-Hidden">0</bool>
+                    <bool name="proxy-Enabled">1</bool>
+                    <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                    <string name="proxy-Data variable">""</string>
+                    <string name="proxy-Data validator">""</string>
+                    <string name="proxy-Data source">""</string>
+                    <string name="proxy-Data class name">""</string>
+                    <string name="proxy-Data class implementation filename">""</string>
+                    <string name="proxy-Data class header filename">""</string>
+                    <string name="proxy-Data class manager window">""</string>
+                    <bool name="proxy-wxCB_SIMPLE">0</bool>
+                    <bool name="proxy-wxCB_DROPDOWN">0</bool>
+                    <bool name="proxy-wxCB_READONLY">1</bool>
+                    <bool name="proxy-wxCB_SORT">0</bool>
+                    <bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
+                    <bool name="proxy-wxWANTS_CHARS">0</bool>
+                    <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                    <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                    <string name="proxy-Custom styles">""</string>
+                    <long name="proxy-X">-1</long>
+                    <long name="proxy-Y">-1</long>
+                    <long name="proxy-Width">60</long>
+                    <long name="proxy-Height">-1</long>
+                    <string name="proxy-AlignH">"Centre"</string>
+                    <string name="proxy-AlignV">"Centre"</string>
+                    <long name="proxy-Stretch factor">0</long>
+                    <long name="proxy-Border">5</long>
+                    <bool name="proxy-wxLEFT">1</bool>
+                    <bool name="proxy-wxRIGHT">1</bool>
+                    <bool name="proxy-wxTOP">1</bool>
+                    <bool name="proxy-wxBOTTOM">1</bool>
+                    <bool name="proxy-wxSHAPED">0</bool>
+                    <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                    <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                    <string name="proxy-Custom arguments">""</string>
+                    <string name="proxy-Custom ctor arguments">""</string>
+                  </document>
+                </document>
+                <document>
+                  <string name="title">"wxStaticText: wxID_STATIC"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"statictext"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbStaticTextProxy"</string>
+                  <string name="proxy-Id name">"wxID_STATIC"</string>
+                  <long name="proxy-Id value">5105</long>
+                  <string name="proxy-Name">""</string>
+                  <string name="proxy-Class">"wxStaticText"</string>
+                  <string name="proxy-Base class">"wxStaticText"</string>
+                  <bool name="proxy-External implementation">1</bool>
+                  <bool name="proxy-Separate files">0</bool>
+                  <string name="proxy-Implementation filename">""</string>
+                  <string name="proxy-Header filename">""</string>
+                  <string name="proxy-Member variable name">""</string>
+                  <string name="proxy-Label">"&amp;Move the image to:"</string>
+                  <long name="proxy-Wrapping width">-1</long>
+                  <string name="proxy-Help text">""</string>
+                  <string name="proxy-Tooltip text">""</string>
+                  <string name="proxy-Background colour">""</string>
+                  <string name="proxy-Foreground colour">""</string>
+                  <string name="proxy-Font">""</string>
+                  <bool name="proxy-Hidden">0</bool>
+                  <bool name="proxy-Enabled">1</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <string name="proxy-Data variable">""</string>
+                  <string name="proxy-Data validator">""</string>
+                  <string name="proxy-Data source">""</string>
+                  <string name="proxy-Data class name">""</string>
+                  <string name="proxy-Data class implementation filename">""</string>
+                  <string name="proxy-Data class header filename">""</string>
+                  <string name="proxy-Data class manager window">""</string>
+                  <bool name="proxy-wxALIGN_LEFT">0</bool>
+                  <bool name="proxy-wxALIGN_RIGHT">0</bool>
+                  <bool name="proxy-wxALIGN_CENTRE">0</bool>
+                  <bool name="proxy-wxST_NO_AUTORESIZE">0</bool>
+                  <bool name="proxy-wxNO_BORDER">0</bool>
+                  <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+                  <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+                  <bool name="proxy-wxBORDER_THEME">0</bool>
+                  <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+                  <bool name="proxy-wxRAISED_BORDER">0</bool>
+                  <bool name="proxy-wxSTATIC_BORDER">0</bool>
+                  <bool name="proxy-wxWANTS_CHARS">0</bool>
+                  <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                  <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                  <string name="proxy-Custom styles">""</string>
+                  <long name="proxy-X">-1</long>
+                  <long name="proxy-Y">-1</long>
+                  <long name="proxy-Width">-1</long>
+                  <long name="proxy-Height">-1</long>
+                  <string name="proxy-AlignH">"Right"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">0</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">1</bool>
+                  <bool name="proxy-wxRIGHT">1</bool>
+                  <bool name="proxy-wxTOP">1</bool>
+                  <bool name="proxy-wxBOTTOM">1</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Custom arguments">""</string>
+                  <string name="proxy-Custom ctor arguments">""</string>
+                </document>
+                <document>
+                  <string name="title">"wxBoxSizer H"</string>
+                  <string name="type">"dialog-control-document"</string>
+                  <string name="filename">""</string>
+                  <string name="icon-name">"sizer"</string>
+                  <long name="is-transient">0</long>
+                  <long name="owns-file">1</long>
+                  <long name="title-mode">0</long>
+                  <long name="locked">0</long>
+                  <string name="proxy-type">"wbBoxSizerProxy"</string>
+                  <string name="proxy-Orientation">"Horizontal"</string>
+                  <string name="proxy-Member variable name">""</string>
+                  <string name="proxy-AlignH">"Left"</string>
+                  <string name="proxy-AlignV">"Centre"</string>
+                  <long name="proxy-Stretch factor">0</long>
+                  <long name="proxy-Border">5</long>
+                  <bool name="proxy-wxLEFT">0</bool>
+                  <bool name="proxy-wxRIGHT">0</bool>
+                  <bool name="proxy-wxTOP">0</bool>
+                  <bool name="proxy-wxBOTTOM">0</bool>
+                  <bool name="proxy-wxSHAPED">0</bool>
+                  <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                  <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                  <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                  <document>
+                    <string name="title">"wxButton: ID_RICHTEXTIMAGEDIALOG_PARA_UP"</string>
+                    <string name="type">"dialog-control-document"</string>
+                    <string name="filename">""</string>
+                    <string name="icon-name">"dialogcontrol"</string>
+                    <long name="is-transient">0</long>
+                    <long name="owns-file">1</long>
+                    <long name="title-mode">0</long>
+                    <long name="locked">0</long>
+                    <string name="proxy-type">"wbButtonProxy"</string>
+                    <string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnRichtextimagedialogParaUpClick|NONE||wxRichTextImageDialog"</string>
+                    <string name="proxy-Id name">"ID_RICHTEXTIMAGEDIALOG_PARA_UP"</string>
+                    <long name="proxy-Id value">10024</long>
+                    <string name="proxy-Name">""</string>
+                    <string name="proxy-Class">"wxButton"</string>
+                    <string name="proxy-Base class">"wxButton"</string>
+                    <bool name="proxy-External implementation">1</bool>
+                    <bool name="proxy-Separate files">0</bool>
+                    <string name="proxy-Implementation filename">""</string>
+                    <string name="proxy-Header filename">""</string>
+                    <string name="proxy-Member variable name">""</string>
+                    <string name="proxy-Label">"&amp;Previous Paragraph"</string>
+                    <bool name="proxy-Default">0</bool>
+                    <string name="proxy-Help text">"Moves the image to the previous paragraph."</string>
+                    <string name="proxy-Tooltip text">""</string>
+                    <string name="proxy-Data variable">""</string>
+                    <string name="proxy-Data validator">""</string>
+                    <string name="proxy-Data source">""</string>
+                    <string name="proxy-Data class name">""</string>
+                    <string name="proxy-Data class implementation filename">""</string>
+                    <string name="proxy-Data class header filename">""</string>
+                    <string name="proxy-Data class manager window">""</string>
+                    <string name="proxy-Background colour">""</string>
+                    <string name="proxy-Foreground colour">""</string>
+                    <string name="proxy-Font">""</string>
+                    <bool name="proxy-Hidden">0</bool>
+                    <bool name="proxy-Enabled">1</bool>
+                    <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                    <bool name="proxy-wxBU_LEFT">0</bool>
+                    <bool name="proxy-wxBU_RIGHT">0</bool>
+                    <bool name="proxy-wxBU_TOP">0</bool>
+                    <bool name="proxy-wxBU_BOTTOM">0</bool>
+                    <bool name="proxy-wxBU_EXACTFIT">0</bool>
+                    <bool name="proxy-wxNO_BORDER">0</bool>
+                    <bool name="proxy-wxWANTS_CHARS">0</bool>
+                    <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                    <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                    <string name="proxy-Custom styles">""</string>
+                    <long name="proxy-X">-1</long>
+                    <long name="proxy-Y">-1</long>
+                    <long name="proxy-Width">-1</long>
+                    <long name="proxy-Height">-1</long>
+                    <string name="proxy-AlignH">"Centre"</string>
+                    <string name="proxy-AlignV">"Centre"</string>
+                    <long name="proxy-Stretch factor">0</long>
+                    <long name="proxy-Border">5</long>
+                    <bool name="proxy-wxLEFT">1</bool>
+                    <bool name="proxy-wxRIGHT">1</bool>
+                    <bool name="proxy-wxTOP">1</bool>
+                    <bool name="proxy-wxBOTTOM">1</bool>
+                    <bool name="proxy-wxSHAPED">0</bool>
+                    <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                    <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                    <string name="proxy-Custom arguments">""</string>
+                    <string name="proxy-Custom ctor arguments">""</string>
+                  </document>
+                  <document>
+                    <string name="title">"wxButton: ID_RICHTEXTIMAGEDIALOG_DOWN"</string>
+                    <string name="type">"dialog-control-document"</string>
+                    <string name="filename">""</string>
+                    <string name="icon-name">"dialogcontrol"</string>
+                    <long name="is-transient">0</long>
+                    <long name="owns-file">1</long>
+                    <long name="title-mode">0</long>
+                    <long name="locked">0</long>
+                    <string name="proxy-type">"wbButtonProxy"</string>
+                    <string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnRichtextimagedialogDownClick|NONE||wxRichTextImageDialog"</string>
+                    <string name="proxy-Id name">"ID_RICHTEXTIMAGEDIALOG_DOWN"</string>
+                    <long name="proxy-Id value">10025</long>
+                    <string name="proxy-Name">""</string>
+                    <string name="proxy-Class">"wxButton"</string>
+                    <string name="proxy-Base class">"wxButton"</string>
+                    <bool name="proxy-External implementation">1</bool>
+                    <bool name="proxy-Separate files">0</bool>
+                    <string name="proxy-Implementation filename">""</string>
+                    <string name="proxy-Header filename">""</string>
+                    <string name="proxy-Member variable name">""</string>
+                    <string name="proxy-Label">"&amp;Next Paragraph"</string>
+                    <bool name="proxy-Default">0</bool>
+                    <string name="proxy-Help text">"Moves the image to the next paragraph."</string>
+                    <string name="proxy-Tooltip text">""</string>
+                    <string name="proxy-Data variable">""</string>
+                    <string name="proxy-Data validator">""</string>
+                    <string name="proxy-Data source">""</string>
+                    <string name="proxy-Data class name">""</string>
+                    <string name="proxy-Data class implementation filename">""</string>
+                    <string name="proxy-Data class header filename">""</string>
+                    <string name="proxy-Data class manager window">""</string>
+                    <string name="proxy-Background colour">""</string>
+                    <string name="proxy-Foreground colour">""</string>
+                    <string name="proxy-Font">""</string>
+                    <bool name="proxy-Hidden">0</bool>
+                    <bool name="proxy-Enabled">1</bool>
+                    <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                    <bool name="proxy-wxBU_LEFT">0</bool>
+                    <bool name="proxy-wxBU_RIGHT">0</bool>
+                    <bool name="proxy-wxBU_TOP">0</bool>
+                    <bool name="proxy-wxBU_BOTTOM">0</bool>
+                    <bool name="proxy-wxBU_EXACTFIT">0</bool>
+                    <bool name="proxy-wxNO_BORDER">0</bool>
+                    <bool name="proxy-wxWANTS_CHARS">0</bool>
+                    <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                    <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                    <string name="proxy-Custom styles">""</string>
+                    <long name="proxy-X">-1</long>
+                    <long name="proxy-Y">-1</long>
+                    <long name="proxy-Width">-1</long>
+                    <long name="proxy-Height">-1</long>
+                    <string name="proxy-AlignH">"Centre"</string>
+                    <string name="proxy-AlignV">"Centre"</string>
+                    <long name="proxy-Stretch factor">0</long>
+                    <long name="proxy-Border">5</long>
+                    <bool name="proxy-wxLEFT">0</bool>
+                    <bool name="proxy-wxRIGHT">1</bool>
+                    <bool name="proxy-wxTOP">1</bool>
+                    <bool name="proxy-wxBOTTOM">1</bool>
+                    <bool name="proxy-wxSHAPED">0</bool>
+                    <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                    <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                    <string name="proxy-Custom arguments">""</string>
+                    <string name="proxy-Custom ctor arguments">""</string>
+                  </document>
+                </document>
+              </document>
+            </document>
+            <document>
+              <string name="title">"wxStaticLine: wxID_STATIC"</string>
+              <string name="type">"dialog-control-document"</string>
+              <string name="filename">""</string>
+              <string name="icon-name">"staticline"</string>
+              <long name="is-transient">0</long>
+              <long name="owns-file">1</long>
+              <long name="title-mode">0</long>
+              <long name="locked">0</long>
+              <string name="proxy-type">"wbStaticLineProxy"</string>
+              <string name="proxy-Id name">"wxID_STATIC"</string>
+              <long name="proxy-Id value">5105</long>
+              <string name="proxy-Name">""</string>
+              <string name="proxy-Class">"wxStaticLine"</string>
+              <string name="proxy-Base class">"wxStaticLine"</string>
+              <bool name="proxy-External implementation">1</bool>
+              <bool name="proxy-Separate files">0</bool>
+              <string name="proxy-Implementation filename">""</string>
+              <string name="proxy-Header filename">""</string>
+              <string name="proxy-Member variable name">""</string>
+              <string name="proxy-Background colour">""</string>
+              <string name="proxy-Foreground colour">""</string>
+              <string name="proxy-Font">""</string>
+              <bool name="proxy-Hidden">0</bool>
+              <bool name="proxy-Enabled">1</bool>
+              <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+              <bool name="proxy-wxLI_HORIZONTAL">1</bool>
+              <bool name="proxy-wxLI_VERTICAL">0</bool>
+              <bool name="proxy-wxNO_BORDER">0</bool>
+              <bool name="proxy-wxSIMPLE_BORDER">0</bool>
+              <bool name="proxy-wxDOUBLE_BORDER">0</bool>
+              <bool name="proxy-wxBORDER_THEME">0</bool>
+              <bool name="proxy-wxSUNKEN_BORDER">0</bool>
+              <bool name="proxy-wxRAISED_BORDER">0</bool>
+              <bool name="proxy-wxSTATIC_BORDER">0</bool>
+              <bool name="proxy-wxWANTS_CHARS">0</bool>
+              <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+              <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+              <string name="proxy-Custom styles">""</string>
+              <long name="proxy-X">-1</long>
+              <long name="proxy-Y">-1</long>
+              <long name="proxy-Width">-1</long>
+              <long name="proxy-Height">-1</long>
+              <string name="proxy-AlignH">"Expand"</string>
+              <string name="proxy-AlignV">"Centre"</string>
+              <long name="proxy-Stretch factor">0</long>
+              <long name="proxy-Border">5</long>
+              <bool name="proxy-wxLEFT">1</bool>
+              <bool name="proxy-wxRIGHT">1</bool>
+              <bool name="proxy-wxTOP">1</bool>
+              <bool name="proxy-wxBOTTOM">1</bool>
+              <bool name="proxy-wxSHAPED">0</bool>
+              <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+              <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+            </document>
+            <document>
+              <string name="title">"wxStdDialogButtonSizer"</string>
+              <string name="type">"dialog-control-document"</string>
+              <string name="filename">""</string>
+              <string name="icon-name">"sizer"</string>
+              <long name="is-transient">0</long>
+              <long name="owns-file">1</long>
+              <long name="title-mode">0</long>
+              <long name="locked">0</long>
+              <string name="proxy-type">"wbStdDialogButtonSizerProxy"</string>
+              <bool name="proxy-wxID_OK">1</bool>
+              <bool name="proxy-wxID_CANCEL">1</bool>
+              <bool name="proxy-wxID_YES">0</bool>
+              <bool name="proxy-wxID_NO">0</bool>
+              <bool name="proxy-wxID_HELP">0</bool>
+              <bool name="proxy-wxID_APPLY">0</bool>
+              <bool name="proxy-wxID_SAVE">0</bool>
+              <bool name="proxy-wxID_CONTEXT_HELP">0</bool>
+              <string name="proxy-Member variable name">""</string>
+              <string name="proxy-AlignH">"Expand"</string>
+              <string name="proxy-AlignV">"Centre"</string>
+              <long name="proxy-Stretch factor">0</long>
+              <long name="proxy-Border">5</long>
+              <bool name="proxy-wxLEFT">1</bool>
+              <bool name="proxy-wxRIGHT">1</bool>
+              <bool name="proxy-wxTOP">1</bool>
+              <bool name="proxy-wxBOTTOM">1</bool>
+              <bool name="proxy-wxSHAPED">0</bool>
+              <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+              <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+              <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+              <document>
+                <string name="title">"wxButton: wxID_OK"</string>
+                <string name="type">"dialog-control-document"</string>
+                <string name="filename">""</string>
+                <string name="icon-name">"dialogcontrol"</string>
+                <long name="is-transient">0</long>
+                <long name="owns-file">1</long>
+                <long name="title-mode">0</long>
+                <long name="locked">1</long>
+                <string name="proxy-type">"wbButtonProxy"</string>
+                <string name="proxy-Id name">"wxID_OK"</string>
+                <long name="proxy-Id value">5100</long>
+                <string name="proxy-Name">""</string>
+                <string name="proxy-Class">"wxButton"</string>
+                <string name="proxy-Base class">"wxButton"</string>
+                <bool name="proxy-External implementation">1</bool>
+                <bool name="proxy-Separate files">0</bool>
+                <string name="proxy-Implementation filename">""</string>
+                <string name="proxy-Header filename">""</string>
+                <string name="proxy-Member variable name">"m_saveButton"</string>
+                <string name="proxy-Label">"OK"</string>
+                <bool name="proxy-Default">0</bool>
+                <string name="proxy-Help text">"Click to confirm your changes."</string>
+                <string name="proxy-Tooltip text">""</string>
+                <string name="proxy-Data variable">""</string>
+                <string name="proxy-Data validator">""</string>
+                <string name="proxy-Data source">""</string>
+                <string name="proxy-Data class name">""</string>
+                <string name="proxy-Data class implementation filename">""</string>
+                <string name="proxy-Data class header filename">""</string>
+                <string name="proxy-Data class manager window">""</string>
+                <string name="proxy-Background colour">""</string>
+                <string name="proxy-Foreground colour">""</string>
+                <string name="proxy-Font">""</string>
+                <bool name="proxy-Hidden">0</bool>
+                <bool name="proxy-Enabled">1</bool>
+                <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                <bool name="proxy-wxBU_LEFT">0</bool>
+                <bool name="proxy-wxBU_RIGHT">0</bool>
+                <bool name="proxy-wxBU_TOP">0</bool>
+                <bool name="proxy-wxBU_BOTTOM">0</bool>
+                <bool name="proxy-wxBU_EXACTFIT">0</bool>
+                <bool name="proxy-wxNO_BORDER">0</bool>
+                <bool name="proxy-wxWANTS_CHARS">0</bool>
+                <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                <string name="proxy-Custom styles">""</string>
+                <long name="proxy-X">-1</long>
+                <long name="proxy-Y">-1</long>
+                <long name="proxy-Width">-1</long>
+                <long name="proxy-Height">-1</long>
+                <string name="proxy-AlignH">"Centre"</string>
+                <string name="proxy-AlignV">"Centre"</string>
+                <long name="proxy-Stretch factor">0</long>
+                <long name="proxy-Border">5</long>
+                <bool name="proxy-wxLEFT">1</bool>
+                <bool name="proxy-wxRIGHT">1</bool>
+                <bool name="proxy-wxTOP">1</bool>
+                <bool name="proxy-wxBOTTOM">1</bool>
+                <bool name="proxy-wxSHAPED">0</bool>
+                <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                <string name="proxy-Custom arguments">""</string>
+                <string name="proxy-Custom ctor arguments">""</string>
+              </document>
+              <document>
+                <string name="title">"wxButton: wxID_CANCEL"</string>
+                <string name="type">"dialog-control-document"</string>
+                <string name="filename">""</string>
+                <string name="icon-name">"dialogcontrol"</string>
+                <long name="is-transient">0</long>
+                <long name="owns-file">1</long>
+                <long name="title-mode">0</long>
+                <long name="locked">1</long>
+                <string name="proxy-type">"wbButtonProxy"</string>
+                <string name="proxy-Id name">"wxID_CANCEL"</string>
+                <long name="proxy-Id value">5101</long>
+                <string name="proxy-Name">""</string>
+                <string name="proxy-Class">"wxButton"</string>
+                <string name="proxy-Base class">"wxButton"</string>
+                <bool name="proxy-External implementation">1</bool>
+                <bool name="proxy-Separate files">0</bool>
+                <string name="proxy-Implementation filename">""</string>
+                <string name="proxy-Header filename">""</string>
+                <string name="proxy-Member variable name">"m_cancelButton"</string>
+                <string name="proxy-Label">"Cancel"</string>
+                <bool name="proxy-Default">0</bool>
+                <string name="proxy-Help text">"Click to discard your changes."</string>
+                <string name="proxy-Tooltip text">""</string>
+                <string name="proxy-Data variable">""</string>
+                <string name="proxy-Data validator">""</string>
+                <string name="proxy-Data source">""</string>
+                <string name="proxy-Data class name">""</string>
+                <string name="proxy-Data class implementation filename">""</string>
+                <string name="proxy-Data class header filename">""</string>
+                <string name="proxy-Data class manager window">""</string>
+                <string name="proxy-Background colour">""</string>
+                <string name="proxy-Foreground colour">""</string>
+                <string name="proxy-Font">""</string>
+                <bool name="proxy-Hidden">0</bool>
+                <bool name="proxy-Enabled">1</bool>
+                <string name="proxy-Platform">"&lt;Any platform&gt;"</string>
+                <bool name="proxy-wxBU_LEFT">0</bool>
+                <bool name="proxy-wxBU_RIGHT">0</bool>
+                <bool name="proxy-wxBU_TOP">0</bool>
+                <bool name="proxy-wxBU_BOTTOM">0</bool>
+                <bool name="proxy-wxBU_EXACTFIT">0</bool>
+                <bool name="proxy-wxNO_BORDER">0</bool>
+                <bool name="proxy-wxWANTS_CHARS">0</bool>
+                <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
+                <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
+                <string name="proxy-Custom styles">""</string>
+                <long name="proxy-X">-1</long>
+                <long name="proxy-Y">-1</long>
+                <long name="proxy-Width">-1</long>
+                <long name="proxy-Height">-1</long>
+                <string name="proxy-AlignH">"Centre"</string>
+                <string name="proxy-AlignV">"Centre"</string>
+                <long name="proxy-Stretch factor">0</long>
+                <long name="proxy-Border">5</long>
+                <bool name="proxy-wxLEFT">1</bool>
+                <bool name="proxy-wxRIGHT">1</bool>
+                <bool name="proxy-wxTOP">1</bool>
+                <bool name="proxy-wxBOTTOM">1</bool>
+                <bool name="proxy-wxSHAPED">0</bool>
+                <bool name="proxy-wxADJUST_MINSIZE">0</bool>
+                <bool name="proxy-wxFIXED_MINSIZE">0</bool>
+                <string name="proxy-Custom arguments">""</string>
+                <string name="proxy-Custom ctor arguments">""</string>
+              </document>
+            </document>
+          </document>
+        </document>
       </document>
       <document>
         <string name="title">"Sources"</string>
index c5df3087979521a94c9ca22fc0b6890f2319064d..ec723334ca6ac893f3cc332ad6497d1666120b2c 100644 (file)
@@ -470,20 +470,27 @@ void wxRichTextHTMLHandler::WriteImage(wxRichTextImage* image, wxOutputStream& s
 #if wxUSE_FILESYSTEM
     if (GetFlags() & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY)
     {
+#if 0
         if (!image->GetImage().Ok() && image->GetImageBlock().GetData())
             image->LoadFromBlock();
         if (image->GetImage().Ok() && !image->GetImageBlock().GetData())
             image->MakeBlock();
+#endif
 
-        if (image->GetImage().Ok())
+        if (image->GetImageBlock().IsOk())
         {
-            wxString ext(image->GetImageBlock().GetExtension());
-            wxString tempFilename(wxString::Format(wxT("image%d.%s"), sm_fileCounter, ext));
-            wxMemoryFSHandler::AddFile(tempFilename, image->GetImage(), image->GetImageBlock().GetImageType());
+            wxImage img;
+            image->GetImageBlock().Load(img);
+            if (img.IsOk())
+            {
+                wxString ext(image->GetImageBlock().GetExtension());
+                wxString tempFilename(wxString::Format(wxT("image%d.%s"), sm_fileCounter, ext));
+                wxMemoryFSHandler::AddFile(tempFilename, img, image->GetImageBlock().GetImageType());
 
-            m_imageLocations.Add(tempFilename);
+                m_imageLocations.Add(tempFilename);
 
-            str << wxT("memory:") << tempFilename;
+                str << wxT("memory:") << tempFilename;
+            }
         }
         else
             str << wxT("memory:?");
@@ -492,12 +499,14 @@ void wxRichTextHTMLHandler::WriteImage(wxRichTextImage* image, wxOutputStream& s
     }
     else if (GetFlags() & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES)
     {
+#if 0
         if (!image->GetImage().Ok() && image->GetImageBlock().GetData())
             image->LoadFromBlock();
         if (image->GetImage().Ok() && !image->GetImageBlock().GetData())
             image->MakeBlock();
+#endif
 
-        if (image->GetImage().Ok())
+        if (image->GetImageBlock().Ok())
         {
             wxString tempDir(GetTempDir());
             if (tempDir.IsEmpty())
@@ -522,14 +531,17 @@ void wxRichTextHTMLHandler::WriteImage(wxRichTextImage* image, wxOutputStream& s
         str << wxT("data:");
         str << GetMimeType(image->GetImageBlock().GetImageType());
         str << wxT(";base64,");
-
+#if 0
         if (image->GetImage().Ok() && !image->GetImageBlock().GetData())
             image->MakeBlock();
+#endif
+        if (image->GetImageBlock().Ok())
+        {
+            wxChar* data = b64enc( image->GetImageBlock().GetData(), image->GetImageBlock().GetDataSize() );
+            str << data;
 
-        wxChar* data = b64enc( image->GetImageBlock().GetData(), image->GetImageBlock().GetDataSize() );
-        str << data;
-
-        delete[] data;
+            delete[] data;
+        }
     }
 
     str << wxT("\" />");
diff --git a/src/richtext/richtextimagedlg.cpp b/src/richtext/richtextimagedlg.cpp
new file mode 100644 (file)
index 0000000..dc670e1
--- /dev/null
@@ -0,0 +1,554 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/richtext/richtextimagedlg.cpp\r
+// Purpose:     \r
+// Author:      Mingquan Yang\r
+// Modified by: \r
+// Created:     Wed 02 Jun 2010 11:27:23 CST\r
+// RCS-ID:      \r
+// Copyright:   (c) Mingquan Yang\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)\r
+#pragma implementation "wx/richtext/richtextimagedlg.h"\r
+#endif\r
+\r
+// For compilers that support precompilation, includes "wx/wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+#pragma hdrstop\r
+#endif\r
+\r
+#ifndef WX_PRECOMP\r
+#include "wx/wx.h"\r
+#endif\r
+\r
+////@begin includes\r
+////@end includes\r
+\r
+#include "wx/richtext/richtextimagedlg.h"\r
+#include "wx/richtext/richtextctrl.h"\r
+\r
+////@begin XPM images\r
+////@end XPM images\r
+\r
+\r
+/*!\r
+ * wxRichTextImageDialog type definition\r
+ */\r
+\r
+IMPLEMENT_DYNAMIC_CLASS( wxRichTextImageDialog, wxDialog )\r
+\r
+\r
+/*!\r
+ * wxRichTextImageDialog event table definition\r
+ */\r
+\r
+BEGIN_EVENT_TABLE( wxRichTextImageDialog, wxDialog )\r
+\r
+////@begin wxRichTextImageDialog event table entries\r
+    EVT_BUTTON( ID_RICHTEXTIMAGEDIALOG_PARA_UP, wxRichTextImageDialog::OnRichtextimagedialogParaUpClick )\r
+\r
+    EVT_BUTTON( ID_RICHTEXTIMAGEDIALOG_DOWN, wxRichTextImageDialog::OnRichtextimagedialogDownClick )\r
+\r
+////@end wxRichTextImageDialog event table entries\r
+\r
+END_EVENT_TABLE()\r
+\r
+\r
+/*!\r
+ * wxRichTextImageDialog constructors\r
+ */\r
+\r
+wxRichTextImageDialog::wxRichTextImageDialog()\r
+{\r
+    Init();\r
+}\r
+\r
+wxRichTextImageDialog::wxRichTextImageDialog( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )\r
+{\r
+    Init();\r
+    Create(parent, id, caption, pos, size, style);\r
+}\r
+\r
+\r
+/*!\r
+ * wxRichTextImageDlg creator\r
+ */\r
+\r
+bool wxRichTextImageDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )\r
+{\r
+////@begin wxRichTextImageDialog creation\r
+    SetExtraStyle(wxDIALOG_EX_CONTEXTHELP);\r
+    wxDialog::Create( parent, id, caption, pos, size, style );\r
+\r
+    CreateControls();\r
+    if (GetSizer())\r
+    {\r
+        GetSizer()->SetSizeHints(this);\r
+    }\r
+    Centre();\r
+////@end wxRichTextImageDialog creation\r
+    return true;\r
+}\r
+\r
+\r
+/*!\r
+ * wxRichTextImageDialog destructor\r
+ */\r
+\r
+wxRichTextImageDialog::~wxRichTextImageDialog()\r
+{\r
+////@begin wxRichTextImageDialog destruction\r
+////@end wxRichTextImageDialog destruction\r
+}\r
+\r
+\r
+/*!\r
+ * Member initialisation\r
+ */\r
+\r
+void wxRichTextImageDialog::Init()\r
+{\r
+////@begin wxRichTextImageDialog member initialisation\r
+    m_alignment = NULL;\r
+    m_float = NULL;\r
+    m_width = NULL;\r
+    m_unitsW = NULL;\r
+    m_height = NULL;\r
+    m_unitsH = NULL;\r
+    m_offset = NULL;\r
+    m_unitsOffset = NULL;\r
+    m_saveButton = NULL;\r
+    m_cancelButton = NULL;\r
+////@end wxRichTextImageDialog member initialisation\r
+}\r
+\r
+\r
+/*!\r
+ * Control creation for wxRichTextImageDlg\r
+ */\r
+\r
+void wxRichTextImageDialog::CreateControls()\r
+{    \r
+#ifdef __WXMAC__\r
+    SetWindowVariant(wxWINDOW_VARIANT_SMALL);\r
+#endif\r
+\r
+////@begin wxRichTextImageDialog content construction\r
+    wxRichTextImageDialog* itemDialog1 = this;\r
+\r
+    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);\r
+    itemDialog1->SetSizer(itemBoxSizer2);\r
+\r
+    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);\r
+    itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);\r
+\r
+    wxFlexGridSizer* itemFlexGridSizer4 = new wxFlexGridSizer(0, 2, 0, 0);\r
+    itemBoxSizer3->Add(itemFlexGridSizer4, 0, wxALIGN_TOP|wxRIGHT, 5);\r
+\r
+    wxStaticText* itemStaticText5 = new wxStaticText( itemDialog1, wxID_STATIC, _("Alignment:"), wxDefaultPosition, wxDefaultSize, 0 );\r
+    itemStaticText5->Show(false);\r
+    itemFlexGridSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxArrayString m_alignmentStrings;\r
+    m_alignmentStrings.Add(_("Left"));\r
+    m_alignmentStrings.Add(_("Centre"));\r
+    m_alignmentStrings.Add(_("Right"));\r
+    m_alignment = new wxComboBox( itemDialog1, ID_COMBOBOX_ALIGN, _("Left"), wxDefaultPosition, wxSize(80, -1), m_alignmentStrings, wxCB_READONLY );\r
+    m_alignment->SetStringSelection(_("Left"));\r
+    m_alignment->Show(false);\r
+    itemFlexGridSizer4->Add(m_alignment, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxStaticText* itemStaticText7 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Floating mode:"), wxDefaultPosition, wxDefaultSize, 0 );\r
+    itemFlexGridSizer4->Add(itemStaticText7, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxArrayString m_floatStrings;\r
+    m_floatStrings.Add(_("None"));\r
+    m_floatStrings.Add(_("Left"));\r
+    m_floatStrings.Add(_("Right"));\r
+    m_float = new wxComboBox( itemDialog1, ID_RICHTEXTIMAGEDIALOG_FLOATING_MODE, _("None"), wxDefaultPosition, wxSize(80, -1), m_floatStrings, wxCB_READONLY );\r
+    m_float->SetStringSelection(_("None"));\r
+    m_float->SetHelpText(_("How the image will float relative to the text."));\r
+    if (wxRichTextImageDialog::ShowToolTips())\r
+        m_float->SetToolTip(_("How the image will float relative to the text."));\r
+    itemFlexGridSizer4->Add(m_float, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxStaticText* itemStaticText9 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Width:"), wxDefaultPosition, wxDefaultSize, 0 );\r
+    itemFlexGridSizer4->Add(itemStaticText9, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxHORIZONTAL);\r
+    itemFlexGridSizer4->Add(itemBoxSizer10, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);\r
+\r
+    m_width = new wxTextCtrl( itemDialog1, ID_RICHTEXTIMAGEDIALOG_WIDTH, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );\r
+    m_width->SetHelpText(_("The image width to be shown - does not change the source image width."));\r
+    if (wxRichTextImageDialog::ShowToolTips())\r
+        m_width->SetToolTip(_("The image width to be shown - does not change the source image width."));\r
+    itemBoxSizer10->Add(m_width, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxArrayString m_unitsWStrings;\r
+    m_unitsWStrings.Add(_("px"));\r
+    m_unitsWStrings.Add(_("cm"));\r
+    m_unitsW = new wxComboBox( itemDialog1, ID_RICHTEXTIMAGEDIALOG_UNITS_W, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsWStrings, wxCB_READONLY );\r
+    m_unitsW->SetStringSelection(_("px"));\r
+    m_unitsW->SetHelpText(_("Units for the image width."));\r
+    if (wxRichTextImageDialog::ShowToolTips())\r
+        m_unitsW->SetToolTip(_("Units for the image width."));\r
+    itemBoxSizer10->Add(m_unitsW, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxStaticText* itemStaticText13 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Height:"), wxDefaultPosition, wxDefaultSize, 0 );\r
+    itemFlexGridSizer4->Add(itemStaticText13, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxHORIZONTAL);\r
+    itemFlexGridSizer4->Add(itemBoxSizer14, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);\r
+\r
+    m_height = new wxTextCtrl( itemDialog1, ID_RICHTEXTIMAGEDIALOG_HEIGHT, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );\r
+    m_height->SetHelpText(_("The image height to be shown - does not change the source image height."));\r
+    if (wxRichTextImageDialog::ShowToolTips())\r
+        m_height->SetToolTip(_("The image height to be shown - does not change the source image height."));\r
+    itemBoxSizer14->Add(m_height, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxArrayString m_unitsHStrings;\r
+    m_unitsHStrings.Add(_("px"));\r
+    m_unitsHStrings.Add(_("cm"));\r
+    m_unitsH = new wxComboBox( itemDialog1, ID_RICHTEXTIMAGEDIALOG_UNITS_H, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsHStrings, wxCB_READONLY );\r
+    m_unitsH->SetStringSelection(_("px"));\r
+    m_unitsH->SetHelpText(_("Units for the image height."));\r
+    if (wxRichTextImageDialog::ShowToolTips())\r
+        m_unitsH->SetToolTip(_("Units for the image height."));\r
+    itemBoxSizer14->Add(m_unitsH, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxStaticText* itemStaticText17 = new wxStaticText( itemDialog1, wxID_STATIC, _("Image Vertical &Offset:"), wxDefaultPosition, wxDefaultSize, 0 );\r
+    itemFlexGridSizer4->Add(itemStaticText17, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxHORIZONTAL);\r
+    itemFlexGridSizer4->Add(itemBoxSizer18, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);\r
+\r
+    m_offset = new wxTextCtrl( itemDialog1, ID_RICHTEXTIMAGEDIALOG_OFFSET, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );\r
+    m_offset->SetMaxLength(10);\r
+    m_offset->SetHelpText(_("The vertical offset relative to the paragraph."));\r
+    if (wxRichTextImageDialog::ShowToolTips())\r
+        m_offset->SetToolTip(_("The vertical offset relative to the paragraph."));\r
+    itemBoxSizer18->Add(m_offset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxArrayString m_unitsOffsetStrings;\r
+    m_unitsOffsetStrings.Add(_("px"));\r
+    m_unitsOffsetStrings.Add(_("cm"));\r
+    m_unitsOffset = new wxComboBox( itemDialog1, ID_RICHTEXTIMAGEDIALOG_OFFSET_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsOffsetStrings, wxCB_READONLY );\r
+    m_unitsOffset->SetStringSelection(_("px"));\r
+    m_unitsOffset->SetHelpText(_("Units for the image offset."));\r
+    if (wxRichTextImageDialog::ShowToolTips())\r
+        m_unitsOffset->SetToolTip(_("Units for the image offset."));\r
+    itemBoxSizer18->Add(m_unitsOffset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxStaticText* itemStaticText21 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Move the image to:"), wxDefaultPosition, wxDefaultSize, 0 );\r
+    itemFlexGridSizer4->Add(itemStaticText21, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxBoxSizer* itemBoxSizer22 = new wxBoxSizer(wxHORIZONTAL);\r
+    itemFlexGridSizer4->Add(itemBoxSizer22, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);\r
+\r
+    wxButton* itemButton23 = new wxButton( itemDialog1, ID_RICHTEXTIMAGEDIALOG_PARA_UP, _("&Previous Paragraph"), wxDefaultPosition, wxDefaultSize, 0 );\r
+    itemButton23->SetHelpText(_("Moves the image to the previous paragraph."));\r
+    if (wxRichTextImageDialog::ShowToolTips())\r
+        itemButton23->SetToolTip(_("Moves the image to the previous paragraph."));\r
+    itemBoxSizer22->Add(itemButton23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);\r
+\r
+    wxButton* itemButton24 = new wxButton( itemDialog1, ID_RICHTEXTIMAGEDIALOG_DOWN, _("&Next Paragraph"), wxDefaultPosition, wxDefaultSize, 0 );\r
+    itemButton24->SetHelpText(_("Moves the image to the next paragraph."));\r
+    if (wxRichTextImageDialog::ShowToolTips())\r
+        itemButton24->SetToolTip(_("Moves the image to the next paragraph."));\r
+    itemBoxSizer22->Add(itemButton24, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5);\r
+\r
+    wxStaticLine* itemStaticLine25 = new wxStaticLine( itemDialog1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );\r
+    itemBoxSizer2->Add(itemStaticLine25, 0, wxGROW|wxALL, 5);\r
+\r
+    wxStdDialogButtonSizer* itemStdDialogButtonSizer26 = new wxStdDialogButtonSizer;\r
+\r
+    itemBoxSizer2->Add(itemStdDialogButtonSizer26, 0, wxGROW|wxALL, 5);\r
+    m_saveButton = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );\r
+    m_saveButton->SetHelpText(_("Click to confirm your changes."));\r
+    if (wxRichTextImageDialog::ShowToolTips())\r
+        m_saveButton->SetToolTip(_("Click to confirm your changes."));\r
+    itemStdDialogButtonSizer26->AddButton(m_saveButton);\r
+\r
+    m_cancelButton = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );\r
+    m_cancelButton->SetHelpText(_("Click to discard your changes."));\r
+    if (wxRichTextImageDialog::ShowToolTips())\r
+        m_cancelButton->SetToolTip(_("Click to discard your changes."));\r
+    itemStdDialogButtonSizer26->AddButton(m_cancelButton);\r
+\r
+    itemStdDialogButtonSizer26->Realize();\r
+\r
+////@end wxRichTextImageDialog content construction\r
+}\r
+\r
+\r
+/*!\r
+ * Should we show tooltips?\r
+ */\r
+\r
+bool wxRichTextImageDialog::ShowToolTips()\r
+{\r
+    return true;\r
+}\r
+\r
+/*!\r
+ * Get bitmap resources\r
+ */\r
+\r
+wxBitmap wxRichTextImageDialog::GetBitmapResource( const wxString& name )\r
+{\r
+    // Bitmap retrieval\r
+////@begin wxRichTextImageDialog bitmap retrieval\r
+    wxUnusedVar(name);\r
+    return wxNullBitmap;\r
+////@end wxRichTextImageDialog bitmap retrieval\r
+}\r
+\r
+/*!\r
+ * Get icon resources\r
+ */\r
+\r
+wxIcon wxRichTextImageDialog::GetIconResource( const wxString& name )\r
+{\r
+    // Icon retrieval\r
+////@begin wxRichTextImageDialog icon retrieval\r
+    wxUnusedVar(name);\r
+    return wxNullIcon;\r
+////@end wxRichTextImageDialog icon retrieval\r
+}\r
+\r
+/*!\r
+ * Set the image attribute\r
+ */\r
+void wxRichTextImageDialog::SetImageAttr(const wxRichTextAnchoredObjectAttr& attr)\r
+{\r
+   m_attr = attr;\r
+   TransferDataToWindow();\r
+}\r
+\r
+/*!\r
+ * Apply the new style\r
+ */\r
+wxRichTextImage* wxRichTextImageDialog::ApplyImageAttr()\r
+{\r
+    wxRichTextImage* image = wxDynamicCast(m_image, wxRichTextImage);\r
+\r
+    TransferDataFromWindow();\r
+    if (m_buffer->GetRichTextCtrl())\r
+    {\r
+        m_buffer->GetRichTextCtrl()->SetImageStyle(image, m_attr);\r
+    }\r
+    return image;\r
+}\r
+\r
+void wxRichTextImageDialog::SetImageObject(wxRichTextImage* image, wxRichTextBuffer* buffer)\r
+{\r
+    wxRichTextObject* parent = image->GetParent();\r
+\r
+    m_buffer = buffer;\r
+    m_image = image;\r
+    m_parent = parent;\r
+    SetImageAttr(image->GetAnchoredAttr());\r
+    if (image->GetImageCache().IsOk())\r
+    {\r
+        if (m_attr.m_width == -1)\r
+        {\r
+            m_attr.m_width = image->GetImageCache().GetWidth();\r
+            wxASSERT(m_attr.m_unitsW == wxRICHTEXT_PX);\r
+            \r
+            m_attr.m_unitsW = wxRICHTEXT_PX;\r
+        }\r
+        if (m_attr.m_height == -1)\r
+        {\r
+            m_attr.m_height = image->GetImageCache().GetHeight();\r
+            wxASSERT(m_attr.m_unitsH == wxRICHTEXT_PX);\r
+            \r
+            m_attr.m_unitsH = wxRICHTEXT_PX;\r
+        }\r
+    }\r
+}\r
+\r
+bool wxRichTextImageDialog::TransferDataToWindow()\r
+{\r
+    int remain = 100;\r
+\r
+    m_alignment->SetSelection(m_attr.m_align);\r
+    m_float->SetSelection(m_attr.m_floating);\r
+\r
+    // Update scale\r
+    m_unitsW->SetSelection(m_attr.m_unitsW);\r
+    m_unitsH->SetSelection(m_attr.m_unitsH);\r
+    m_unitsOffset->SetSelection(m_attr.m_unitsOffset);\r
+\r
+    // Update metric\r
+    m_width->Clear();\r
+    if (m_attr.m_unitsW == wxRICHTEXT_MM)\r
+    {\r
+        int remainder = m_attr.m_width % remain;\r
+        *m_width << m_attr.m_width / remain;\r
+        if (remainder)\r
+        {\r
+            *m_width << '.' << remainder;\r
+        }\r
+    }\r
+    else\r
+    {\r
+        *m_width << m_attr.m_width;\r
+    }\r
+\r
+    m_height->Clear();\r
+    if (m_attr.m_unitsH == wxRICHTEXT_MM)\r
+    {\r
+        int remainder = m_attr.m_height % remain;\r
+        *m_height << m_attr.m_height / remain;\r
+        if (remainder)\r
+        {\r
+            *m_height << '.' << remainder;\r
+        }\r
+    }\r
+    else\r
+    {\r
+        *m_height << m_attr.m_height;\r
+    }\r
+\r
+    m_offset->Clear();\r
+    if (m_attr.m_unitsOffset == wxRICHTEXT_MM)\r
+    {\r
+        int remainder = m_attr.m_offset % remain;\r
+        *m_offset << m_attr.m_offset / remain;\r
+        if (remainder)\r
+        {\r
+            *m_offset << '.' << remainder;\r
+        }\r
+    }\r
+    else\r
+    {\r
+        *m_offset << m_attr.m_offset;\r
+    }\r
+\r
+    return true;\r
+}\r
+\r
+bool wxRichTextImageDialog::TransferDataFromWindow()\r
+{\r
+    wxString width = m_width->GetValue();\r
+    wxString height = m_height->GetValue();\r
+    wxString offset = m_offset->GetValue();\r
+    int w, h, o;\r
+\r
+    m_attr.m_align = m_alignment->GetSelection();\r
+    m_attr.m_floating = m_float->GetSelection();\r
+\r
+    m_attr.m_unitsW = m_unitsW->GetSelection();\r
+    m_attr.m_unitsH = m_unitsH->GetSelection();\r
+    m_attr.m_unitsOffset = m_unitsOffset->GetSelection();\r
+\r
+    if (ConvertFromString(width, w, m_attr.m_unitsW))\r
+        m_attr.m_width = w;\r
+    if (ConvertFromString(height, h, m_attr.m_unitsH))\r
+        m_attr.m_height = h;\r
+    if (ConvertFromString(offset, o, m_attr.m_unitsOffset))\r
+        m_attr.m_offset = o;\r
+\r
+    return true;\r
+}\r
+\r
+bool wxRichTextImageDialog::ConvertFromString(const wxString& string, int& ret, int scale)\r
+{\r
+    const wxChar* chars = string.GetData();\r
+    int remain = 2;\r
+    bool dot = false;\r
+    ret = 0;\r
+\r
+    for (unsigned int i = 0; i < string.Len() && remain; i++)\r
+    {\r
+        if (!(chars[i] >= '0' && chars[i] <= '9') && !(scale == wxRICHTEXT_MM && chars[i] == '.'))\r
+            return false;\r
+\r
+        if (chars[i] == '.')\r
+        {\r
+            dot = true;\r
+            continue;\r
+        }\r
+\r
+        if (dot)\r
+            remain--;\r
+\r
+        ret = ret * 10 + chars[i] - '0';\r
+    }\r
+\r
+    while (remain-- > 0 && scale == wxRICHTEXT_MM)\r
+        ret *= 10;\r
+\r
+    return true;\r
+}\r
+\r
+\r
+/*!\r
+ * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_PARA_UP\r
+ */\r
+void wxRichTextImageDialog::OnRichtextimagedialogParaUpClick( wxCommandEvent& WXUNUSED(event))\r
+{\r
+    // Before editing this code, remove the block markers.\r
+    wxRichTextRange range = m_image->GetRange();\r
+    wxRichTextObjectList::compatibility_iterator iter = m_buffer->GetChildren().GetFirst();\r
+    if (iter == NULL)\r
+        return;\r
+\r
+    while (iter)\r
+    {\r
+        if (iter->GetData() == m_parent)\r
+            break;\r
+        iter = iter->GetNext();\r
+    }\r
+\r
+    iter = iter->GetPrevious();\r
+    if (iter == NULL)\r
+        return;\r
+\r
+    wxRichTextObject *obj = iter->GetData();\r
+    wxRichTextRange rg = obj->GetRange();\r
+    m_image = m_image->Clone();\r
+\r
+    m_buffer->DeleteRangeWithUndo(range, m_buffer->GetRichTextCtrl());\r
+    m_buffer->InsertObjectWithUndo(rg.GetEnd(), m_image, m_buffer->GetRichTextCtrl(), 0);\r
+    m_parent = obj;\r
+    m_image->SetRange(wxRichTextRange(rg.GetEnd(), rg.GetEnd()));\r
+}\r
+\r
+\r
+/*!\r
+ * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_PARA_DOWN\r
+ */\r
+\r
+void wxRichTextImageDialog::OnRichtextimagedialogDownClick( wxCommandEvent& WXUNUSED(event))\r
+{\r
+    // Before editing this code, remove the block markers.\r
+    wxRichTextRange range = m_image->GetRange();\r
+    wxRichTextObjectList::compatibility_iterator iter = m_buffer->GetChildren().GetFirst();\r
+    if (iter == NULL)\r
+        return;\r
+\r
+    while (iter)\r
+    {\r
+        if (iter->GetData() == m_parent)\r
+            break;\r
+        iter = iter->GetNext();\r
+    }\r
+\r
+    iter = iter->GetNext();\r
+    if (iter == NULL)\r
+        return;\r
+\r
+    wxRichTextObject *obj = iter->GetData();\r
+    wxRichTextRange rg = obj->GetRange();\r
+    m_image = m_image->Clone();\r
+\r
+    m_buffer->DeleteRangeWithUndo(range, m_buffer->GetRichTextCtrl());\r
+    m_buffer->InsertObjectWithUndo(rg.GetEnd(), m_image, m_buffer->GetRichTextCtrl(), 0);\r
+    m_parent = obj;\r
+    m_image->SetRange(wxRichTextRange(rg.GetEnd(), rg.GetEnd()));\r
+}\r
+\r
index e257814c1e73a571c8263a431079357ba004d05d..d7963e6163a63f1762b67808dc674e935a25be14 100644 (file)
@@ -813,8 +813,8 @@ bool wxRichTextXMLHandler::ExportXML(wxOutputStream& stream, wxMBConv* convMem,
 
         wxString style = CreateStyle(obj.GetAttributes(), false);
 
-        if (imageObj.GetImage().Ok() && !imageObj.GetImageBlock().Ok())
-            imageObj.MakeBlock();
+        //if (imageObj.GetImage().Ok() && !imageObj.GetImageBlock().Ok())
+        //    imageObj.MakeBlock();
 
         OutputIndentation(stream, indent);
         OutputString(stream, wxT("<") + objectName, convMem, convFile);