mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
Fix warning with lambda captuer while compiling Gui01 tutorial.
This commit is contained in:
parent
8d25d929d5
commit
e909742efd
11 changed files with 16 additions and 15 deletions
|
|
@ -183,7 +183,7 @@ class AsyncWork {
|
|||
Ret2 ret;
|
||||
|
||||
template<class Function, class... Args>
|
||||
void Do(Function&& f, Args&&... args) { co.Do([=]() { ret = f(args...); }); }
|
||||
void Do(Function&& f, Args&&... args) { co.Do([=, this]() { ret = f(args...); }); }
|
||||
const Ret2& Get() { return ret; }
|
||||
Ret2 Pick() { return pick(ret); }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public:
|
|||
void Set(Stream& in_, F& filter) {
|
||||
Init();
|
||||
in = &in_;
|
||||
filter.WhenOut = [=](const void *ptr, int size) { Out(ptr, size); };
|
||||
filter.WhenOut = [this](const void *ptr, int size) { Out(ptr, size); };
|
||||
Filter = [&filter](const void *ptr, int size) { filter.Put(ptr, size); };
|
||||
End = [&filter] { filter.End(); };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public:
|
|||
Function(Function&& src) { Pick(pick(src)); }
|
||||
Function& operator=(Function&& src) { if(&src != this) { Free(ptr); ptr = src.ptr; src.ptr = NULL; } return *this; }
|
||||
|
||||
Function Proxy() const { return [=] (ArgTypes... args) { return (*this)(args...); }; }
|
||||
Function Proxy() const { return [this] (ArgTypes... args) { return (*this)(args...); }; }
|
||||
|
||||
template <class F>
|
||||
Function& operator<<(F fn) { if(!ptr) { Pick(pick(fn)); return *this; }
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ ColorPopUp::ColorPopUp()
|
|||
voidtext = t_("(none)");
|
||||
|
||||
settext.SetImage(CtrlImg::color_edit());
|
||||
settext << [=] {
|
||||
settext << [this] {
|
||||
String text;
|
||||
if(!IsNull(color) && color != VoidColor())
|
||||
text = ColorToHtml(color);
|
||||
|
|
|
|||
|
|
@ -402,11 +402,12 @@ void MemoryProfileInfo() {
|
|||
};
|
||||
|
||||
FileSelButton::FileSelButton(MODE mode, const char *title)
|
||||
: title(title), mode(mode)
|
||||
: title(title)
|
||||
, mode(mode)
|
||||
{
|
||||
button.NoWantFocus();
|
||||
button.SetImage(mode == MODE_DIR ? CtrlImg::DirSmall() : CtrlImg::FileSmall());
|
||||
button << [=] { OnAction(); };
|
||||
button << [this] { OnAction(); };
|
||||
}
|
||||
|
||||
void FileSelButton::Attach(Ctrl& parent)
|
||||
|
|
|
|||
|
|
@ -513,7 +513,7 @@ public:
|
|||
cc.clock <<= THISBACK(OnClockChoice);
|
||||
cc.WhenPopDown = THISBACK(OnClose);
|
||||
cc.calendar.WhenSelect = WhenSelect.Proxy();
|
||||
this->WhenPaper = [=](Color c) {
|
||||
this->WhenPaper = [this](Color c) {
|
||||
drop.SetPaper(c);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ DropChoice::DropChoice() {
|
|||
always_drop = hide_drop = false;
|
||||
AddButton().Main() <<= THISBACK(Drop);
|
||||
NoDisplay();
|
||||
list.WhenSelect = [=] { Select(); };
|
||||
list.WhenSelect = [this] { Select(); };
|
||||
dropfocus = true;
|
||||
EnableDrop(false);
|
||||
dropwidth = 0;
|
||||
|
|
@ -21,7 +21,7 @@ void DropChoice::AddTo(Ctrl& _owner)
|
|||
owner = &_owner;
|
||||
|
||||
if(auto *ef = dynamic_cast<EditField *>(owner))
|
||||
ef->WhenPaper = [=](Color c) { MultiButtonFrame::SetPaper(c); };
|
||||
ef->WhenPaper = [this](Color c) { MultiButtonFrame::SetPaper(c); };
|
||||
}
|
||||
|
||||
void DropChoice::EnableDrop(bool b)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ bool HelpWindow::GoTo0(const String& link)
|
|||
}
|
||||
if(WhenMatchLabel) {
|
||||
WString lw = label.ToWString();
|
||||
return view.GotoLabel([=](const WString& data) { return WhenMatchLabel(data, lw); }, true, true) || lnk;
|
||||
return view.GotoLabel([this, lw](const WString& data) { return WhenMatchLabel(data, lw); }, true, true) || lnk;
|
||||
}
|
||||
return view.GotoLabel(label, true, true) || lnk;
|
||||
}
|
||||
|
|
@ -324,7 +324,7 @@ HelpWindow::HelpWindow()
|
|||
Sizeable().Zoomable();
|
||||
Title(t_("Help"));
|
||||
BackPaint();
|
||||
view.WhenLink = [=](const String& h) { GoTo(h); };
|
||||
view.WhenLink = [this](const String& h) { GoTo(h); };
|
||||
AddFrame(toolbar);
|
||||
view.SetZoom(Zoom(1, 1));
|
||||
zoom.m = 160;
|
||||
|
|
@ -337,7 +337,7 @@ HelpWindow::HelpWindow()
|
|||
SetBar();
|
||||
tree.BackPaint();
|
||||
view.BackPaintHint();
|
||||
view.WhenMouseWheel = [=] (int zdelta, dword keyflags) {
|
||||
view.WhenMouseWheel = [this] (int zdelta, dword keyflags) {
|
||||
if(keyflags & K_CTRL) {
|
||||
zoom.m = clamp((zoom.m / 5 + sgn(zdelta)) * 5, 60, 600);
|
||||
SetZoom();
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ void MultiButton::MultiButtons()
|
|||
if(droppush) {
|
||||
SubButton& b = buttons.Add();
|
||||
b.owner = this;
|
||||
b.WhenPush = [=] { DropPush(); };
|
||||
b.WhenPush = [this] { DropPush(); };
|
||||
b.main = true;
|
||||
droppush = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ void TextCtrl::ViewLoading()
|
|||
|
||||
if(msecs(start) > 20) {
|
||||
view_loading_pos = view->GetPos();
|
||||
PostCallback([=] { ViewLoading(); });
|
||||
PostCallback([this] { ViewLoading(); });
|
||||
WhenViewMapping(view_loading_pos);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ void BufferPainter::FinishPathJob()
|
|||
fillcount = jobcount;
|
||||
Swap(cofill, cojob); // Swap to keep allocated rasters (instead of pick)
|
||||
|
||||
fill_job & [=] {
|
||||
fill_job & [this] {
|
||||
PAINTER_TIMING("CO FILL JOB");
|
||||
int miny = ip->GetHeight() - 1;
|
||||
int maxy = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue