mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6462 Add reordering to color legend items
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
#include "RimColorLegendItem.h"
|
||||
#include "RimColorLegend.h"
|
||||
|
||||
#include "cafPdmUiSliderEditor.h"
|
||||
|
||||
#include "cvfColor3.h"
|
||||
|
||||
#include <QColor>
|
||||
@@ -36,7 +38,9 @@ RimColorLegendItem::RimColorLegendItem()
|
||||
CAF_PDM_InitFieldNoDefault( &m_color, "Color", "Color", "", "", "" );
|
||||
m_color = cvf::Color3f( cvf::Color3::ColorIdent::BLACK );
|
||||
|
||||
CAF_PDM_InitField( &m_categoryValue, "CategoryValue", 0, "Category Value", "", "", "" );
|
||||
CAF_PDM_InitField( &m_categoryValue, "CategoryValue", 0, "Category Number", "", "", "" );
|
||||
m_categoryValue.uiCapability()->setUiEditorTypeName( caf::PdmUiSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &m_categoryName, "CategoryName", QString( "" ), "Category Name", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_nameProxy, "NameProxy", "Name Proxy", "", "", "" );
|
||||
@@ -130,6 +134,21 @@ caf::PdmFieldHandle* RimColorLegendItem::userDescriptionField()
|
||||
return &m_nameProxy;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimColorLegendItem::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
caf::PdmUiSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiSliderEditorAttribute*>( attribute );
|
||||
if ( myAttr )
|
||||
{
|
||||
myAttr->m_minimum = 0;
|
||||
myAttr->m_maximum = 100;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// "stringify" category value and name; category value with leading zeros presupposing max 2 digits
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user