From d6ca5acf069781b4ad35dc474ed45fbff014ed24 Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 8 Apr 2020 12:59:41 +0000 Subject: [PATCH] .reference git-svn-id: svn://ultimatepp.org/upp/trunk@14278 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- reference/FileSelLazyIcon/FileSelLazyIcon.upp | 3 ++- reference/FileSelLazyIcon/main.cpp | 10 ++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/reference/FileSelLazyIcon/FileSelLazyIcon.upp b/reference/FileSelLazyIcon/FileSelLazyIcon.upp index 0da717ba0..d1d146a14 100644 --- a/reference/FileSelLazyIcon/FileSelLazyIcon.upp +++ b/reference/FileSelLazyIcon/FileSelLazyIcon.upp @@ -1,7 +1,8 @@ description "Demostrates FileSel features that uses separate thread to resolve file image\377"; uses - CtrlLib; + CtrlLib, + plugin/jpg; file main.cpp; diff --git a/reference/FileSelLazyIcon/main.cpp b/reference/FileSelLazyIcon/main.cpp index 0028d484b..1917a78f7 100644 --- a/reference/FileSelLazyIcon/main.cpp +++ b/reference/FileSelLazyIcon/main.cpp @@ -1,16 +1,14 @@ #include +#include using namespace Upp; -static void sLoadImage(const String& path, Image& result) -{ - result = StreamRaster::LoadFileAny(path); -} - GUI_APP_MAIN { FileSel fs; fs.AllFilesType(); - fs.WhenIconLazy = sLoadImage; + fs.WhenIconLazy = [](const String& path, Image& result) { + result = StreamRaster::LoadFileAny(path); + }; fs.ExecuteOpen(); }