mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-03-23 18:54:01 +08:00
Move wxStyledTextCtrlMiniMap from stc sample to the library
After experimenting with this code in the sample, move it to its permanent place in the library. This commit is best viewed using Git --color-moved option and ignoring whitespace changes.
This commit is contained in:
17
Makefile.in
17
Makefile.in
@@ -2337,6 +2337,7 @@ STCDLL_OBJECTS = \
|
||||
stcdll_PlatWX.o \
|
||||
stcdll_ScintillaWX.o \
|
||||
stcdll_xh_styledtextctrl.o \
|
||||
stcdll_minimap.o \
|
||||
$(__STC_PLATFORM_SRC_OBJECTS_2)
|
||||
STCDLL_ODEP = $(_____pch_wxprec_stcdll_wx_wxprec_h_gch___depname)
|
||||
STCLIB_CXXFLAGS = $(__stclib_PCH_INC) $(__INC_TIFF_BUILD_p) $(__INC_TIFF_p) \
|
||||
@@ -2371,6 +2372,7 @@ STCLIB_OBJECTS = \
|
||||
stclib_PlatWX.o \
|
||||
stclib_ScintillaWX.o \
|
||||
stclib_xh_styledtextctrl.o \
|
||||
stclib_minimap.o \
|
||||
$(__STC_PLATFORM_SRC_OBJECTS_3)
|
||||
STCLIB_ODEP = $(_____pch_wxprec_stclib_wx_wxprec_h_gch___depname)
|
||||
GLDLL_CXXFLAGS = $(__gldll_PCH_INC) $(__INC_TIFF_BUILD_p) $(__INC_TIFF_p) \
|
||||
@@ -4215,6 +4217,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \
|
||||
wx/xrc/xh_richtext.h \
|
||||
wx/stc/stc.h \
|
||||
wx/xrc/xh_styledtextctrl.h \
|
||||
wx/stc/minimap.h \
|
||||
$(WEBVIEW_PLATFORM_HDR) \
|
||||
wx/webview.h \
|
||||
wx/webviewarchivehandler.h \
|
||||
@@ -6046,6 +6049,7 @@ COND_USE_STC_1___MONOLIB_STC_SRC_OBJECTS = \
|
||||
monodll_PlatWX.o \
|
||||
monodll_ScintillaWX.o \
|
||||
monodll_xh_styledtextctrl.o \
|
||||
monodll_minimap.o \
|
||||
$(__STC_PLATFORM_SRC_OBJECTS)
|
||||
@COND_USE_STC_1@__MONOLIB_STC_SRC_OBJECTS = $(COND_USE_STC_1___MONOLIB_STC_SRC_OBJECTS)
|
||||
@COND_TOOLKIT_OSX_COCOA@__STC_PLATFORM_SRC_OBJECTS = monodll_PlatWXcocoa.o
|
||||
@@ -7827,6 +7831,7 @@ COND_USE_STC_1___MONOLIB_STC_SRC_OBJECTS_1 = \
|
||||
monolib_PlatWX.o \
|
||||
monolib_ScintillaWX.o \
|
||||
monolib_xh_styledtextctrl.o \
|
||||
monolib_minimap.o \
|
||||
$(__STC_PLATFORM_SRC_OBJECTS_1)
|
||||
@COND_USE_STC_1@__MONOLIB_STC_SRC_OBJECTS_1 = $(COND_USE_STC_1___MONOLIB_STC_SRC_OBJECTS_1)
|
||||
@COND_TOOLKIT_OSX_COCOA@__STC_PLATFORM_SRC_OBJECTS_1 \
|
||||
@@ -17057,6 +17062,9 @@ monodll_ScintillaWX.o: $(srcdir)/src/stc/ScintillaWX.cpp $(MONODLL_ODEP)
|
||||
monodll_xh_styledtextctrl.o: $(srcdir)/src/xrc/xh_styledtextctrl.cpp $(MONODLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/xrc/xh_styledtextctrl.cpp
|
||||
|
||||
monodll_minimap.o: $(srcdir)/src/stc/minimap.cpp $(MONODLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/stc/minimap.cpp
|
||||
|
||||
monodll_PlatWXcocoa.o: $(srcdir)/src/stc/PlatWXcocoa.mm $(MONODLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/stc/PlatWXcocoa.mm
|
||||
|
||||
@@ -21836,6 +21844,9 @@ monolib_ScintillaWX.o: $(srcdir)/src/stc/ScintillaWX.cpp $(MONOLIB_ODEP)
|
||||
monolib_xh_styledtextctrl.o: $(srcdir)/src/xrc/xh_styledtextctrl.cpp $(MONOLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_styledtextctrl.cpp
|
||||
|
||||
monolib_minimap.o: $(srcdir)/src/stc/minimap.cpp $(MONOLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/stc/minimap.cpp
|
||||
|
||||
monolib_PlatWXcocoa.o: $(srcdir)/src/stc/PlatWXcocoa.mm $(MONOLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/stc/PlatWXcocoa.mm
|
||||
|
||||
@@ -34529,6 +34540,9 @@ stcdll_ScintillaWX.o: $(srcdir)/src/stc/ScintillaWX.cpp $(STCDLL_ODEP)
|
||||
stcdll_xh_styledtextctrl.o: $(srcdir)/src/xrc/xh_styledtextctrl.cpp $(STCDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/src/xrc/xh_styledtextctrl.cpp
|
||||
|
||||
stcdll_minimap.o: $(srcdir)/src/stc/minimap.cpp $(STCDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/src/stc/minimap.cpp
|
||||
|
||||
stcdll_PlatWXcocoa.o: $(srcdir)/src/stc/PlatWXcocoa.mm $(STCDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(STCDLL_OBJCXXFLAGS) $(srcdir)/src/stc/PlatWXcocoa.mm
|
||||
|
||||
@@ -34544,6 +34558,9 @@ stclib_ScintillaWX.o: $(srcdir)/src/stc/ScintillaWX.cpp $(STCLIB_ODEP)
|
||||
stclib_xh_styledtextctrl.o: $(srcdir)/src/xrc/xh_styledtextctrl.cpp $(STCLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/src/xrc/xh_styledtextctrl.cpp
|
||||
|
||||
stclib_minimap.o: $(srcdir)/src/stc/minimap.cpp $(STCLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/src/stc/minimap.cpp
|
||||
|
||||
stclib_PlatWXcocoa.o: $(srcdir)/src/stc/PlatWXcocoa.mm $(STCLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(STCLIB_OBJCXXFLAGS) $(srcdir)/src/stc/PlatWXcocoa.mm
|
||||
|
||||
|
||||
@@ -3193,11 +3193,13 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
||||
src/stc/PlatWX.cpp
|
||||
src/stc/ScintillaWX.cpp
|
||||
src/xrc/xh_styledtextctrl.cpp
|
||||
src/stc/minimap.cpp
|
||||
</set>
|
||||
|
||||
<set var="STC_CMN_HDR" hints="files">
|
||||
wx/stc/stc.h
|
||||
wx/xrc/xh_styledtextctrl.h
|
||||
wx/stc/minimap.h
|
||||
</set>
|
||||
|
||||
<set var="STC_OSX_COCOA_SRC" hints="files">
|
||||
|
||||
@@ -2909,11 +2909,13 @@ set(STC_CMN_SRC
|
||||
src/stc/PlatWX.cpp
|
||||
src/stc/ScintillaWX.cpp
|
||||
src/xrc/xh_styledtextctrl.cpp
|
||||
src/stc/minimap.cpp
|
||||
)
|
||||
|
||||
set(STC_CMN_HDR
|
||||
wx/stc/stc.h
|
||||
wx/xrc/xh_styledtextctrl.h
|
||||
wx/stc/minimap.h
|
||||
)
|
||||
|
||||
set(STC_OSX_COCOA_SRC
|
||||
|
||||
@@ -2864,12 +2864,14 @@ RICHTEXT_HDR =
|
||||
# wxSTC
|
||||
|
||||
STC_CMN_SRC =
|
||||
src/stc/minimap.cpp
|
||||
src/stc/stc.cpp
|
||||
src/stc/PlatWX.cpp
|
||||
src/stc/ScintillaWX.cpp
|
||||
src/xrc/xh_styledtextctrl.cpp
|
||||
|
||||
STC_CMN_HDR =
|
||||
wx/stc/minimap.h
|
||||
wx/stc/stc.h
|
||||
wx/xrc/xh_styledtextctrl.h
|
||||
|
||||
|
||||
@@ -1758,7 +1758,8 @@ STCDLL_OBJECTS = \
|
||||
$(OBJS)\stcdll_stc.o \
|
||||
$(OBJS)\stcdll_PlatWX.o \
|
||||
$(OBJS)\stcdll_ScintillaWX.o \
|
||||
$(OBJS)\stcdll_xh_styledtextctrl.o
|
||||
$(OBJS)\stcdll_xh_styledtextctrl.o \
|
||||
$(OBJS)\stcdll_minimap.o
|
||||
STCLIB_CXXFLAGS = -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png \
|
||||
-I..\..\3rdparty\libwebp\src -I..\..\src\zlib -I..\..\3rdparty\pcre\src\wx \
|
||||
-I..\..\src\expat\expat\lib $(__DEBUGINFO) $(__OPTIMIZEFLAG) \
|
||||
@@ -1777,7 +1778,8 @@ STCLIB_OBJECTS = \
|
||||
$(OBJS)\stclib_stc.o \
|
||||
$(OBJS)\stclib_PlatWX.o \
|
||||
$(OBJS)\stclib_ScintillaWX.o \
|
||||
$(OBJS)\stclib_xh_styledtextctrl.o
|
||||
$(OBJS)\stclib_xh_styledtextctrl.o \
|
||||
$(OBJS)\stclib_minimap.o
|
||||
GLDLL_CXXFLAGS = -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png \
|
||||
-I..\..\3rdparty\libwebp\src -I..\..\src\zlib -I..\..\3rdparty\pcre\src\wx \
|
||||
-I..\..\src\expat\expat\lib $(__DEBUGINFO) $(__OPTIMIZEFLAG) \
|
||||
@@ -2720,7 +2722,8 @@ ____MONOLIB_STC_SRC_FILENAMES_OBJECTS = \
|
||||
$(OBJS)\monodll_stc.o \
|
||||
$(OBJS)\monodll_PlatWX.o \
|
||||
$(OBJS)\monodll_ScintillaWX.o \
|
||||
$(OBJS)\monodll_xh_styledtextctrl.o
|
||||
$(OBJS)\monodll_xh_styledtextctrl.o \
|
||||
$(OBJS)\monodll_minimap.o
|
||||
endif
|
||||
ifeq ($(USE_STC),1)
|
||||
__wxscintilla_library_link_DEP = $(__wxscintilla)
|
||||
@@ -3586,7 +3589,8 @@ ____MONOLIB_STC_SRC_FILENAMES_1_OBJECTS = \
|
||||
$(OBJS)\monolib_stc.o \
|
||||
$(OBJS)\monolib_PlatWX.o \
|
||||
$(OBJS)\monolib_ScintillaWX.o \
|
||||
$(OBJS)\monolib_xh_styledtextctrl.o
|
||||
$(OBJS)\monolib_xh_styledtextctrl.o \
|
||||
$(OBJS)\monolib_minimap.o
|
||||
endif
|
||||
ifeq ($(MONOLITHIC),0)
|
||||
ifeq ($(SHARED),1)
|
||||
@@ -8774,6 +8778,9 @@ $(OBJS)\monodll_ScintillaWX.o: ../../src/stc/ScintillaWX.cpp
|
||||
$(OBJS)\monodll_xh_styledtextctrl.o: ../../src/xrc/xh_styledtextctrl.cpp
|
||||
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\monodll_minimap.o: ../../src/stc/minimap.cpp
|
||||
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\monodll_xml.o: ../../src/xml/xml.cpp
|
||||
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
@@ -11391,6 +11398,9 @@ $(OBJS)\monolib_ScintillaWX.o: ../../src/stc/ScintillaWX.cpp
|
||||
$(OBJS)\monolib_xh_styledtextctrl.o: ../../src/xrc/xh_styledtextctrl.cpp
|
||||
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\monolib_minimap.o: ../../src/stc/minimap.cpp
|
||||
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\monolib_xml.o: ../../src/xml/xml.cpp
|
||||
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
@@ -18195,6 +18205,9 @@ $(OBJS)\stcdll_ScintillaWX.o: ../../src/stc/ScintillaWX.cpp
|
||||
$(OBJS)\stcdll_xh_styledtextctrl.o: ../../src/xrc/xh_styledtextctrl.cpp
|
||||
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\stcdll_minimap.o: ../../src/stc/minimap.cpp
|
||||
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\stclib_dummy.o: ../../src/common/dummy.cpp
|
||||
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
@@ -18210,6 +18223,9 @@ $(OBJS)\stclib_ScintillaWX.o: ../../src/stc/ScintillaWX.cpp
|
||||
$(OBJS)\stclib_xh_styledtextctrl.o: ../../src/xrc/xh_styledtextctrl.cpp
|
||||
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\stclib_minimap.o: ../../src/stc/minimap.cpp
|
||||
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\gldll_dummy.o: ../../src/common/dummy.cpp
|
||||
$(CXX) -c -o $@ $(GLDLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
|
||||
@@ -1976,7 +1976,8 @@ STCDLL_OBJECTS = \
|
||||
$(OBJS)\stcdll_stc.obj \
|
||||
$(OBJS)\stcdll_PlatWX.obj \
|
||||
$(OBJS)\stcdll_ScintillaWX.obj \
|
||||
$(OBJS)\stcdll_xh_styledtextctrl.obj
|
||||
$(OBJS)\stcdll_xh_styledtextctrl.obj \
|
||||
$(OBJS)\stcdll_minimap.obj
|
||||
STCDLL_RESOURCES = \
|
||||
$(OBJS)\stcdll_version.res
|
||||
STCLIB_CXXFLAGS = /M$(__RUNTIME_LIBS_626)$(__DEBUGRUNTIME) /DWIN32 \
|
||||
@@ -2001,7 +2002,8 @@ STCLIB_OBJECTS = \
|
||||
$(OBJS)\stclib_stc.obj \
|
||||
$(OBJS)\stclib_PlatWX.obj \
|
||||
$(OBJS)\stclib_ScintillaWX.obj \
|
||||
$(OBJS)\stclib_xh_styledtextctrl.obj
|
||||
$(OBJS)\stclib_xh_styledtextctrl.obj \
|
||||
$(OBJS)\stclib_minimap.obj
|
||||
GLDLL_CXXFLAGS = /M$(__RUNTIME_LIBS_642)$(__DEBUGRUNTIME) /DWIN32 \
|
||||
/I..\..\src\tiff\libtiff /I..\..\src\jpeg /I..\..\src\png \
|
||||
/I..\..\3rdparty\libwebp\src /I..\..\src\zlib /I..\..\3rdparty\pcre\src\wx \
|
||||
@@ -3095,7 +3097,8 @@ ____MONOLIB_STC_SRC_FILENAMES_OBJECTS = \
|
||||
$(OBJS)\monodll_stc.obj \
|
||||
$(OBJS)\monodll_PlatWX.obj \
|
||||
$(OBJS)\monodll_ScintillaWX.obj \
|
||||
$(OBJS)\monodll_xh_styledtextctrl.obj
|
||||
$(OBJS)\monodll_xh_styledtextctrl.obj \
|
||||
$(OBJS)\monodll_minimap.obj
|
||||
!endif
|
||||
!if "$(USE_STC)" == "1"
|
||||
__wxscintilla_library_link_DEP = $(__wxscintilla)
|
||||
@@ -3961,7 +3964,8 @@ ____MONOLIB_STC_SRC_FILENAMES_1_OBJECTS = \
|
||||
$(OBJS)\monolib_stc.obj \
|
||||
$(OBJS)\monolib_PlatWX.obj \
|
||||
$(OBJS)\monolib_ScintillaWX.obj \
|
||||
$(OBJS)\monolib_xh_styledtextctrl.obj
|
||||
$(OBJS)\monolib_xh_styledtextctrl.obj \
|
||||
$(OBJS)\monolib_minimap.obj
|
||||
!endif
|
||||
!if "$(MONOLITHIC)" == "0" && "$(SHARED)" == "1"
|
||||
__basedll___depname = \
|
||||
@@ -9274,6 +9278,9 @@ $(OBJS)\monodll_ScintillaWX.obj: ..\..\src\stc\ScintillaWX.cpp
|
||||
$(OBJS)\monodll_xh_styledtextctrl.obj: ..\..\src\xrc\xh_styledtextctrl.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\xrc\xh_styledtextctrl.cpp
|
||||
|
||||
$(OBJS)\monodll_minimap.obj: ..\..\src\stc\minimap.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\stc\minimap.cpp
|
||||
|
||||
$(OBJS)\monodll_xml.obj: ..\..\src\xml\xml.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\xml\xml.cpp
|
||||
|
||||
@@ -11891,6 +11898,9 @@ $(OBJS)\monolib_ScintillaWX.obj: ..\..\src\stc\ScintillaWX.cpp
|
||||
$(OBJS)\monolib_xh_styledtextctrl.obj: ..\..\src\xrc\xh_styledtextctrl.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\xrc\xh_styledtextctrl.cpp
|
||||
|
||||
$(OBJS)\monolib_minimap.obj: ..\..\src\stc\minimap.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\stc\minimap.cpp
|
||||
|
||||
$(OBJS)\monolib_xml.obj: ..\..\src\xml\xml.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\xml\xml.cpp
|
||||
|
||||
@@ -18695,6 +18705,9 @@ $(OBJS)\stcdll_ScintillaWX.obj: ..\..\src\stc\ScintillaWX.cpp
|
||||
$(OBJS)\stcdll_xh_styledtextctrl.obj: ..\..\src\xrc\xh_styledtextctrl.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) ..\..\src\xrc\xh_styledtextctrl.cpp
|
||||
|
||||
$(OBJS)\stcdll_minimap.obj: ..\..\src\stc\minimap.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) ..\..\src\stc\minimap.cpp
|
||||
|
||||
$(OBJS)\stclib_dummy.obj: ..\..\src\common\dummy.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp
|
||||
|
||||
@@ -18710,6 +18723,9 @@ $(OBJS)\stclib_ScintillaWX.obj: ..\..\src\stc\ScintillaWX.cpp
|
||||
$(OBJS)\stclib_xh_styledtextctrl.obj: ..\..\src\xrc\xh_styledtextctrl.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) ..\..\src\xrc\xh_styledtextctrl.cpp
|
||||
|
||||
$(OBJS)\stclib_minimap.obj: ..\..\src\stc\minimap.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) ..\..\src\stc\minimap.cpp
|
||||
|
||||
$(OBJS)\gldll_dummy.obj: ..\..\src\common\dummy.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(GLDLL_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp
|
||||
|
||||
|
||||
@@ -862,6 +862,7 @@
|
||||
<ClCompile Include="..\..\src\stc\ScintillaWX.cpp" />
|
||||
<ClCompile Include="..\..\src\stc\stc.cpp" />
|
||||
<ClCompile Include="..\..\src\xrc\xh_styledtextctrl.cpp" />
|
||||
<ClCompile Include="..\..\src\stc\minimap.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\src\msw\version.rc">
|
||||
@@ -914,6 +915,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'">true</ExcludedFromBuild>
|
||||
</CustomBuild>
|
||||
<ClInclude Include="..\..\include\wx\stc\stc.h" />
|
||||
<ClInclude Include="..\..\include\wx\stc\minimap.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
<ClCompile Include="..\..\src\stc\ScintillaWX.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\stc\minimap.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\stc\stc.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -44,6 +47,9 @@
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\wx\stc\minimap.h">
|
||||
<Filter>Common Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\wx\stc\stc.h">
|
||||
<Filter>Common Headers</Filter>
|
||||
</ClInclude>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
203
include/wx/stc/minimap.h
Normal file
203
include/wx/stc/minimap.h
Normal file
@@ -0,0 +1,203 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/stc/minimap.h
|
||||
// Purpose: Declaration of wxStyledTextCtrlMiniMap class.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2025-10-16
|
||||
// Copyright: (c) 2025 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_STC_MINIMAP_H_
|
||||
#define _WX_STC_MINIMAP_H_
|
||||
|
||||
#include "wx/stc/stc.h"
|
||||
|
||||
#if wxUSE_STC
|
||||
|
||||
#include "wx/overlay.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStyledTextCtrlMiniMap: a minimap used together with wxStyledTextCtrl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_STC wxStyledTextCtrlMiniMap : public wxStyledTextCtrl
|
||||
{
|
||||
public:
|
||||
// Default constructor, use Create() later.
|
||||
wxStyledTextCtrlMiniMap() : wxStyledTextCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
// Create the minimap with the given parent window and associated with the
|
||||
// given editor.
|
||||
wxStyledTextCtrlMiniMap(wxWindow* parent, wxStyledTextCtrl* edit)
|
||||
{
|
||||
Create(parent, edit);
|
||||
}
|
||||
|
||||
bool Create(wxWindow* parent, wxStyledTextCtrl* edit);
|
||||
|
||||
virtual ~wxStyledTextCtrlMiniMap();
|
||||
|
||||
private:
|
||||
// Check if the cached information about visible and total number of lines
|
||||
// has changed and update it and return true if it did.
|
||||
bool UpdateLineInfo();
|
||||
|
||||
// Get document line at the given mouse position in the map.
|
||||
int GetDocLineAtMapPoint(const wxPoint& pos) const
|
||||
{
|
||||
return LineFromPosition(PositionFromPoint(pos));
|
||||
}
|
||||
|
||||
// Set the editor first visible line without triggering the matching map
|
||||
// update.
|
||||
void SetEditFirstVisibleLine(int firstLine)
|
||||
{
|
||||
m_lastSetEditFirst = firstLine;
|
||||
|
||||
m_edit->SetFirstVisibleLine(firstLine);
|
||||
}
|
||||
|
||||
// Set the first visible line in the map without triggering the matching
|
||||
// editor update.
|
||||
void SetMapFirstVisibleLine(int firstLine)
|
||||
{
|
||||
m_lastSetMapFirst = firstLine;
|
||||
|
||||
SetFirstVisibleLine(firstLine);
|
||||
}
|
||||
|
||||
// Get the map first visible line corresponding to the given editor
|
||||
// first visible line.
|
||||
int GetMapFirstFromEditFirst(int editFirst) const;
|
||||
|
||||
// Scroll the editor to correspond to the current position in the map.
|
||||
void SyncEditPosition();
|
||||
|
||||
// Scroll the map to correspond to the current position in the editor.
|
||||
void SyncMapPosition();
|
||||
|
||||
// Helper function returning the visible line of the map corresponding to
|
||||
// the given visible line in the main editor.
|
||||
int MapVisibleFromEditVisible(int editVisible) const
|
||||
{
|
||||
auto const docLine = m_edit->DocLineFromVisible(editVisible);
|
||||
return VisibleFromDocLine(docLine);
|
||||
}
|
||||
|
||||
struct ThumbInfo
|
||||
{
|
||||
int pos = 0; // Position of the top of the thumb in pixels.
|
||||
int height = 0; // Height of the thumb in pixels.
|
||||
};
|
||||
|
||||
// Get the current thumb position and height.
|
||||
ThumbInfo GetThumbInfo() const;
|
||||
|
||||
void DrawVisibleZone(wxDC& dc);
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// Show the same selection in the map as in the editor.
|
||||
void SyncSelection()
|
||||
{
|
||||
SetSelectionStart(m_edit->GetSelectionStart());
|
||||
SetSelectionEnd(m_edit->GetSelectionEnd());
|
||||
}
|
||||
|
||||
void OnEditUpdate(wxStyledTextEvent& event);
|
||||
void OnMapUpdate(wxStyledTextEvent& event);
|
||||
|
||||
// Return true if the visible zone indicator is currently being dragged.
|
||||
bool IsDragging() const
|
||||
{
|
||||
return m_isDragging;
|
||||
}
|
||||
|
||||
void HandleMouseClick(wxMouseEvent& event);
|
||||
|
||||
// Called when the user starts dragging at the given point.
|
||||
void StartDragging(const wxPoint& pos);
|
||||
|
||||
// Called while dragging the visible zone indicator.
|
||||
void DoDrag(wxPoint pos);
|
||||
|
||||
// Called when we stop dragging, either because the mouse button was
|
||||
// released or because the mouse capture was lost.
|
||||
void DoStopDragging();
|
||||
|
||||
|
||||
// The associated main document control.
|
||||
wxStyledTextCtrl* /* const */ m_edit;
|
||||
|
||||
// Overlay showing the visible zone indicator being dragged.
|
||||
wxOverlay m_overlay;
|
||||
|
||||
// The constant vertical offset between the mouse pointer and the middle of
|
||||
// the thumb while dragging. Only valid if m_isDragging is true.
|
||||
int m_dragOffset = 0;
|
||||
|
||||
// Height of a single line in the map: this value is cached when creating
|
||||
// the control.
|
||||
int m_mapLineHeight = 0;
|
||||
|
||||
// The values in this struct change when the window size changes and, for
|
||||
// the display line count, may also change later when wrapping is enabled
|
||||
// as Scintilla re-wraps lines during idle time.
|
||||
struct LinesInfo
|
||||
{
|
||||
// Number of lines visible in the map.
|
||||
int mapVisible = 0;
|
||||
|
||||
// Number of lines visible in the editor.
|
||||
int editVisible = 0;
|
||||
|
||||
// Last valid value for the first map line.
|
||||
int mapMax = 0;
|
||||
|
||||
// Last valid value for the first editor line.
|
||||
int editMax = 0;
|
||||
|
||||
// Last valid value for the thumb position (in map line units).
|
||||
int thumbMax = 0;
|
||||
|
||||
LinesInfo() = default;
|
||||
LinesInfo(const LinesInfo& other) = default;
|
||||
LinesInfo& operator=(const LinesInfo& other) = default;
|
||||
|
||||
bool operator==(const LinesInfo& rhs) const
|
||||
{
|
||||
return mapVisible == rhs.mapVisible &&
|
||||
editVisible == rhs.editVisible &&
|
||||
mapMax == rhs.mapMax &&
|
||||
editMax == rhs.editMax &&
|
||||
thumbMax == rhs.thumbMax;
|
||||
}
|
||||
|
||||
bool operator!=(const LinesInfo& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
wxString Dump() const;
|
||||
} m_lines;
|
||||
|
||||
// Last values set by this code: we can safely ignore notifications about
|
||||
// changes that still use these values.
|
||||
//
|
||||
// -1 here means "invalid" and is used because it's guaranteed to be
|
||||
// different from any valid first line value.
|
||||
int m_lastSetEditFirst = -1;
|
||||
int m_lastSetMapFirst = -1;
|
||||
|
||||
// Flag set while dragging the thumb.
|
||||
bool m_isDragging = false;
|
||||
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxStyledTextCtrlMiniMap);
|
||||
};
|
||||
|
||||
#endif // wxUSE_STC
|
||||
|
||||
#endif // _WX_STC_MINIMAP_H_
|
||||
File diff suppressed because it is too large
Load Diff
666
src/stc/minimap.cpp
Normal file
666
src/stc/minimap.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -333,6 +333,7 @@
|
||||
#include <wx/statline.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/statusbr.h>
|
||||
#include <wx/stc/minimap.h>
|
||||
#include <wx/stc/stc.h>
|
||||
#include <wx/stdpaths.h>
|
||||
#include <wx/stdstream.h>
|
||||
|
||||
Reference in New Issue
Block a user