diff --git a/build/cmake/samples/CMakeLists.txt b/build/cmake/samples/CMakeLists.txt
index cf650069d1..82357c1604 100644
--- a/build/cmake/samples/CMakeLists.txt
+++ b/build/cmake/samples/CMakeLists.txt
@@ -16,7 +16,7 @@ wx_add_sample(calendar DEPENDS wxUSE_CALENDARCTRL)
wx_add_sample(caret DEPENDS wxUSE_CARET)
wx_add_sample(clipboard DEPENDS wxUSE_CLIPBOARD)
wx_add_sample(collpane DEPENDS wxUSE_COLLPANE)
-wx_add_sample(combo DATA dropbuth.png dropbutn.png dropbutp.png DEPENDS wxUSE_COMBOCTRL)
+wx_add_sample(combo DATA dropbuth.svg dropbutn.svg dropbutp.svg three-dots.svg DEPENDS wxUSE_COMBOCTRL)
wx_add_sample(config conftest.cpp DEPENDS wxUSE_CONFIG)
wx_add_sample(console CONSOLE IMPORTANT)
wx_add_sample(dataview IMPORTANT dataview.cpp mymodels.cpp mymodels.h DEPENDS wxUSE_DATAVIEWCTRL)
diff --git a/samples/combo/Makefile.in b/samples/combo/Makefile.in
index dfeda5666a..0286a6297e 100644
--- a/samples/combo/Makefile.in
+++ b/samples/combo/Makefile.in
@@ -184,7 +184,7 @@ combo$(EXEEXT): $(COMBO_OBJECTS) $(__combo___win32rc)
data:
@mkdir -p .
- @for f in dropbuth.png dropbutn.png dropbutp.png; do \
+ @for f in dropbuth.svg dropbutn.svg dropbutp.svg three-dots.svg; do \
if test ! -f ./$$f -a ! -d ./$$f ; \
then x=yep ; \
else x=`find $(srcdir)/$$f -newer ./$$f -print` ; \
diff --git a/samples/combo/combo.bkl b/samples/combo/combo.bkl
index 8b5869d52d..f8bb569e47 100644
--- a/samples/combo/combo.bkl
+++ b/samples/combo/combo.bkl
@@ -12,9 +12,10 @@
- dropbuth.png
- dropbutn.png
- dropbutp.png
+ dropbuth.svg
+ dropbutn.svg
+ dropbutp.svg
+ three-dots.svg
diff --git a/samples/combo/combo.cpp b/samples/combo/combo.cpp
index cddbc62ce4..5e0c4479f6 100644
--- a/samples/combo/combo.cpp
+++ b/samples/combo/combo.cpp
@@ -538,32 +538,7 @@ public:
style | wxCC_STD_BUTTON,
validator,name);
- //
- // Prepare custom button bitmap (just '...' text)
- wxMemoryDC dc;
- wxBitmap bmp(12,16);
- dc.SelectObject(bmp);
-
- // Draw transparent background
- wxColour magic(255,0,255);
- wxBrush magicBrush(magic);
- dc.SetBrush( magicBrush );
- dc.SetPen( *wxTRANSPARENT_PEN );
- dc.DrawRectangle(0,0,bmp.GetWidth(),bmp.GetHeight());
-
- // Draw text
- wxString str = "...";
- int w,h;
- dc.GetTextExtent(str, &w, &h, 0, 0);
- dc.DrawText(str, (bmp.GetWidth()-w)/2, (bmp.GetHeight()-h)/2);
-
- dc.SelectObject( wxNullBitmap );
-
- // Finalize transparency with a mask
- wxMask *mask = new wxMask( bmp, magic );
- bmp.SetMask( mask );
-
- SetButtonBitmaps(bmp,true);
+ SetButtonBitmaps(wxBitmapBundle::FromSVGFile("three-dots.svg", wxSize(16, 16)), true);
}
virtual void OnButtonClick() wxOVERRIDE
@@ -852,17 +827,14 @@ MyFrame::MyFrame(const wxString& title)
);
// Load images from disk
- wxImage imgNormal("dropbutn.png");
- wxImage imgPressed("dropbutp.png");
- wxImage imgHover("dropbuth.png");
+ wxBitmapBundle bmpNormal = wxBitmapBundle::FromSVGFile("dropbutn.svg", wxSize(16, 16));
+ wxBitmapBundle bmpPressed = wxBitmapBundle::FromSVGFile("dropbutp.svg", wxSize(16, 16));
+ wxBitmapBundle bmpHover = wxBitmapBundle::FromSVGFile("dropbuth.svg", wxSize(16, 16));
- if ( imgNormal.IsOk() && imgPressed.IsOk() && imgHover.IsOk() )
+ if ( bmpNormal.IsOk() && bmpPressed.IsOk() && bmpHover.IsOk() )
{
- wxBitmap bmpNormal(imgNormal);
- wxBitmap bmpPressed(imgPressed);
- wxBitmap bmpHover(imgHover);
- odc->SetButtonBitmaps(bmpNormal,false,bmpPressed,bmpHover);
- odc2->SetButtonBitmaps(bmpNormal,true,bmpPressed,bmpHover);
+ odc->SetButtonBitmaps(bmpNormal, false, bmpPressed, bmpHover);
+ odc2->SetButtonBitmaps(bmpNormal, true, bmpPressed, bmpHover);
}
else
wxLogError("Dropbutton images not found");
diff --git a/samples/combo/dropbuth.png b/samples/combo/dropbuth.png
deleted file mode 100644
index 089eda926d..0000000000
Binary files a/samples/combo/dropbuth.png and /dev/null differ
diff --git a/samples/combo/dropbuth.svg b/samples/combo/dropbuth.svg
new file mode 100644
index 0000000000..6eddfad199
--- /dev/null
+++ b/samples/combo/dropbuth.svg
@@ -0,0 +1,7 @@
+
+
diff --git a/samples/combo/dropbutn.png b/samples/combo/dropbutn.png
deleted file mode 100644
index 9dceceab13..0000000000
Binary files a/samples/combo/dropbutn.png and /dev/null differ
diff --git a/samples/combo/dropbutn.svg b/samples/combo/dropbutn.svg
new file mode 100644
index 0000000000..e7365d6163
--- /dev/null
+++ b/samples/combo/dropbutn.svg
@@ -0,0 +1,4 @@
+
+
diff --git a/samples/combo/dropbutp.png b/samples/combo/dropbutp.png
deleted file mode 100644
index 82e905e081..0000000000
Binary files a/samples/combo/dropbutp.png and /dev/null differ
diff --git a/samples/combo/dropbutp.svg b/samples/combo/dropbutp.svg
new file mode 100644
index 0000000000..1804ddfc7f
--- /dev/null
+++ b/samples/combo/dropbutp.svg
@@ -0,0 +1,7 @@
+
+
diff --git a/samples/combo/makefile.gcc b/samples/combo/makefile.gcc
index 06456ff995..36fffae7b8 100644
--- a/samples/combo/makefile.gcc
+++ b/samples/combo/makefile.gcc
@@ -222,7 +222,7 @@ $(OBJS)\combo.exe: $(COMBO_OBJECTS) $(OBJS)\combo_sample_rc.o
data:
if not exist $(OBJS) mkdir $(OBJS)
- for %%f in (dropbuth.png dropbutn.png dropbutp.png) do if not exist $(OBJS)\%%f copy .\%%f $(OBJS)
+ for %%f in (dropbuth.svg dropbutn.svg dropbutp.svg three-dots.svg) do if not exist $(OBJS)\%%f copy .\%%f $(OBJS)
$(OBJS)\combo_sample_rc.o: ./../../samples/sample.rc
$(WINDRES) -i$< -o$@ --define __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) --include-dir $(SETUPHDIR) --include-dir ./../../include $(__CAIRO_INCLUDEDIR_p) --include-dir . $(__DLLFLAG_p_1) --define wxUSE_DPI_AWARE_MANIFEST=$(USE_DPI_AWARE_MANIFEST) --include-dir ./../../samples --define NOPCH
diff --git a/samples/combo/makefile.vc b/samples/combo/makefile.vc
index f17d5dd505..3bdaa06fe6 100644
--- a/samples/combo/makefile.vc
+++ b/samples/combo/makefile.vc
@@ -431,7 +431,7 @@ $(OBJS)\combo.exe: $(COMBO_OBJECTS) $(OBJS)\combo_sample.res
data:
if not exist $(OBJS) mkdir $(OBJS)
- for %f in (dropbuth.png dropbutn.png dropbutp.png) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
+ for %f in (dropbuth.svg dropbutn.svg dropbutp.svg three-dots.svg) do if not exist $(OBJS)\%f copy .\%f $(OBJS)
$(OBJS)\combo_sample.res: .\..\..\samples\sample.rc
rc /fo$@ /d WIN32 $(____DEBUGRUNTIME_3_p_1) /d _CRT_SECURE_NO_DEPRECATE=1 /d _CRT_NON_CONFORMING_SWPRINTFS=1 /d _SCL_SECURE_NO_WARNINGS=1 $(__NO_VC_CRTDBG_p_1) $(__TARGET_CPU_COMPFLAG_p_1) /d __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) /i $(SETUPHDIR) /i .\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_1_p) /i . $(__DLLFLAG_p_1) /d _WINDOWS /i .\..\..\samples /d NOPCH .\..\..\samples\sample.rc
diff --git a/samples/combo/three-dots.svg b/samples/combo/three-dots.svg
new file mode 100644
index 0000000000..1e0e5bb40e
--- /dev/null
+++ b/samples/combo/three-dots.svg
@@ -0,0 +1,4 @@
+
+