2013-10-28 05:58:49 -05:00
|
|
|
//##################################################################################################
|
|
|
|
//
|
|
|
|
// Custom Visualization Core library
|
2015-07-29 07:19:43 -05:00
|
|
|
// Copyright (C) 2014 Ceetron Solutions AS
|
2013-10-28 05:58:49 -05:00
|
|
|
//
|
|
|
|
// This library may be used under the terms of either the GNU General Public License or
|
|
|
|
// the GNU Lesser General Public License as follows:
|
|
|
|
//
|
|
|
|
// GNU General Public License Usage
|
|
|
|
// This library is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <<http://www.gnu.org/licenses/gpl.html>>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
// GNU Lesser General Public License Usage
|
|
|
|
// This library is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU Lesser General Public License at <<http://www.gnu.org/licenses/lgpl-2.1.html>>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
//##################################################################################################
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2015-07-29 07:19:43 -05:00
|
|
|
#include "cafPdmUiEditorHandle.h"
|
|
|
|
#include "cafPdmUiFieldEditorHandle.h"
|
2013-10-28 05:58:49 -05:00
|
|
|
|
2015-07-29 07:19:43 -05:00
|
|
|
#include <vector>
|
2013-10-28 05:58:49 -05:00
|
|
|
|
2015-07-29 07:19:43 -05:00
|
|
|
#include <QString>
|
2013-10-28 05:58:49 -05:00
|
|
|
|
2015-07-29 07:19:43 -05:00
|
|
|
class QToolBar;
|
|
|
|
class QMainWindow;
|
2024-03-07 12:45:43 -06:00
|
|
|
class QAction;
|
2015-07-29 07:19:43 -05:00
|
|
|
|
2017-11-29 10:09:13 -06:00
|
|
|
namespace caf
|
2013-10-28 05:58:49 -05:00
|
|
|
{
|
2017-11-29 10:09:13 -06:00
|
|
|
class PdmUiFieldEditorHandle;
|
|
|
|
class PdmUiItem;
|
|
|
|
class PdmFieldHandle;
|
2013-10-28 05:58:49 -05:00
|
|
|
|
2017-11-29 10:09:13 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-07-29 07:19:43 -05:00
|
|
|
class PdmUiToolBarEditor : public PdmUiEditorHandle
|
|
|
|
{
|
2013-10-28 05:58:49 -05:00
|
|
|
public:
|
2020-06-19 00:53:59 -05:00
|
|
|
PdmUiToolBarEditor( const QString& title, QMainWindow* mainWindow );
|
2018-10-18 09:35:51 -05:00
|
|
|
~PdmUiToolBarEditor() override;
|
2015-07-29 07:19:43 -05:00
|
|
|
|
2023-10-17 02:34:19 -05:00
|
|
|
bool isEditorDataEqualAndValid( const std::vector<caf::PdmFieldHandle*>& fields ) const;
|
2020-06-19 00:53:59 -05:00
|
|
|
void setFields( std::vector<caf::PdmFieldHandle*>& fields );
|
2017-11-29 09:17:44 -06:00
|
|
|
void clear();
|
2019-10-21 09:18:07 -05:00
|
|
|
|
2020-06-19 00:53:59 -05:00
|
|
|
void setFocusWidgetFromKeyword( const QString& fieldKeyword );
|
2019-10-22 03:39:18 -05:00
|
|
|
QString keywordForFocusWidget();
|
2020-06-19 00:53:59 -05:00
|
|
|
|
2017-12-01 06:55:36 -06:00
|
|
|
void show();
|
|
|
|
void hide();
|
2015-07-29 07:19:43 -05:00
|
|
|
|
2019-10-22 03:39:18 -05:00
|
|
|
static QString uiEditorConfigName();
|
2019-10-21 09:18:07 -05:00
|
|
|
|
2017-11-29 10:09:13 -06:00
|
|
|
private:
|
2020-06-19 00:53:59 -05:00
|
|
|
void configureAndUpdateUi( const QString& uiConfigName ) override;
|
|
|
|
|
|
|
|
static QWidget* focusWidget( PdmUiFieldEditorHandle* uiFieldEditorHandle );
|
2013-10-28 05:58:49 -05:00
|
|
|
|
|
|
|
private:
|
2017-11-29 10:09:13 -06:00
|
|
|
QPointer<QToolBar> m_toolbar;
|
2015-07-29 07:19:43 -05:00
|
|
|
|
2017-11-29 10:09:13 -06:00
|
|
|
std::vector<caf::PdmFieldHandle*> m_fields;
|
|
|
|
std::map<QString, PdmUiFieldEditorHandle*> m_fieldViews;
|
2015-07-29 07:19:43 -05:00
|
|
|
|
2017-11-29 10:09:13 -06:00
|
|
|
QList<QAction*> m_actions;
|
2013-10-28 05:58:49 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace caf
|