MeshLib Documentation
Loading...
Searching...
No Matches
MRLambdaRibbonItem.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRRibbonMenuItem.h"
4
5namespace MR
6{
7
8// Simple ribbon item acting given lambda
10{
11public:
12 using SimpleLambda = std::function<void()>;
13 LambdaRibbonItem( std::string name, SimpleLambda lambda ) :
14 RibbonMenuItem( std::move( name ) ),
15 lambda_( std::move( lambda ) )
16 {}
17
18 virtual bool action() override
19 {
20 lambda_();
21 return false;
22 }
23private:
24 SimpleLambda lambda_;
25};
26
27} // namespace MR
Definition MRLambdaRibbonItem.h:10
virtual bool action() override
Definition MRLambdaRibbonItem.h:18
LambdaRibbonItem(std::string name, SimpleLambda lambda)
Definition MRLambdaRibbonItem.h:13
std::function< void()> SimpleLambda
Definition MRLambdaRibbonItem.h:12
Definition MRRibbonMenuItem.h:20
const std::string & name() const
Definition MRRibbonMenuItem.h:35
Definition MRCameraOrientationPlugin.h:8