2002-01-21 23:30:43 +03:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: Insight Segmentation & Registration Toolkit
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Insight Consortium. All rights reserved.
|
|
|
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
2001-05-22 18:41:15 +04:00
|
|
|
#ifndef FLTKPROPERTYLIST_H
|
|
|
|
#define FLTKPROPERTYLIST_H
|
|
|
|
|
|
|
|
#include "../cmStandardIncludes.h"
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
2001-06-21 16:41:14 +04:00
|
|
|
class CMakeSetupGUIImplementation;
|
|
|
|
|
|
|
|
|
2001-05-22 18:41:15 +04:00
|
|
|
namespace fltk {
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
//PropertyList Items
|
2001-06-11 02:19:16 +04:00
|
|
|
class PropertyItem
|
2001-05-22 18:41:15 +04:00
|
|
|
{
|
|
|
|
// Attributes
|
|
|
|
public:
|
2001-06-13 08:16:35 +04:00
|
|
|
std::string m_HelpString;
|
|
|
|
std::string m_propName;
|
|
|
|
std::string m_curValue;
|
2001-05-22 18:41:15 +04:00
|
|
|
int m_nItemType;
|
2001-06-13 08:16:35 +04:00
|
|
|
std::string m_cmbItems;
|
2001-05-22 18:41:15 +04:00
|
|
|
bool m_Removed;
|
2001-10-28 06:47:23 +03:00
|
|
|
bool m_NewValue;
|
|
|
|
bool m_Dirty;
|
2001-05-22 18:41:15 +04:00
|
|
|
public:
|
2001-06-13 08:16:35 +04:00
|
|
|
PropertyItem( std::string propName,
|
|
|
|
std::string curValue,
|
|
|
|
std::string helpString,
|
|
|
|
int nItemType,
|
|
|
|
std::string cmbItems )
|
2001-05-22 18:41:15 +04:00
|
|
|
{
|
2001-10-28 06:47:23 +03:00
|
|
|
m_HelpString = helpString;
|
|
|
|
m_propName = propName;
|
|
|
|
m_curValue = curValue;
|
|
|
|
m_nItemType = nItemType;
|
|
|
|
m_cmbItems = cmbItems;
|
|
|
|
m_Removed = false;
|
|
|
|
m_NewValue = true;
|
|
|
|
m_Dirty = false;
|
2001-05-22 18:41:15 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2001-06-21 16:41:14 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-05-22 18:41:15 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// PropertyList window
|
|
|
|
|
|
|
|
class PropertyList
|
|
|
|
{
|
|
|
|
// Construction
|
|
|
|
public:
|
|
|
|
enum ItemType
|
|
|
|
{
|
|
|
|
COMBO = 0,
|
|
|
|
EDIT,
|
|
|
|
COLOR,
|
|
|
|
FONT,
|
|
|
|
FILE,
|
|
|
|
CHECKBOX,
|
|
|
|
PATH
|
|
|
|
};
|
2001-06-21 16:41:14 +04:00
|
|
|
|
|
|
|
PropertyList( CMakeSetupGUIImplementation * );
|
2001-05-22 18:41:15 +04:00
|
|
|
|
|
|
|
// Attributes
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Operations
|
|
|
|
public:
|
2001-06-13 08:16:35 +04:00
|
|
|
int AddItem( std::string txt );
|
2001-05-22 18:41:15 +04:00
|
|
|
int AddProperty(const char* name,
|
|
|
|
const char* value,
|
|
|
|
const char* helpString,
|
|
|
|
int type,
|
2001-10-28 06:47:23 +03:00
|
|
|
const char* comboItems,
|
|
|
|
bool reverseOrder);
|
|
|
|
void RemoveProperty(const char* name);
|
|
|
|
std::set<PropertyItem*> & GetItems()
|
2001-05-22 18:41:15 +04:00
|
|
|
{
|
|
|
|
return m_PropertyItems;
|
|
|
|
}
|
2001-10-28 06:47:23 +03:00
|
|
|
|
|
|
|
void InvalidateList(void);
|
2001-05-22 18:41:15 +04:00
|
|
|
void Invalidate(void)
|
|
|
|
{
|
|
|
|
// fltk redraw();
|
|
|
|
}
|
|
|
|
|
|
|
|
int GetCount(void) const
|
|
|
|
{
|
|
|
|
return m_PropertyItems.size();
|
|
|
|
}
|
|
|
|
void OnButton(void);
|
|
|
|
void OnHelp(void);
|
|
|
|
void RemoveAll();
|
|
|
|
PropertyItem* GetItem(int index);
|
|
|
|
PropertyItem* GetItemDataPtr(int m_curSel);
|
|
|
|
|
2001-10-28 06:47:23 +03:00
|
|
|
void ClearDirty(void) { m_Dirty = false; }
|
|
|
|
void SetDirty(void) { m_Dirty = true; }
|
|
|
|
bool IsDirty(void) const { return m_Dirty; }
|
|
|
|
|
2001-05-22 18:41:15 +04:00
|
|
|
// Implementation
|
|
|
|
public:
|
|
|
|
virtual ~PropertyList();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2001-10-28 06:47:23 +03:00
|
|
|
int AddPropItem(PropertyItem* pItem,bool reverseOrder);
|
2001-05-22 18:41:15 +04:00
|
|
|
|
|
|
|
std::set<PropertyItem*> m_PropertyItems;
|
|
|
|
|
2001-06-21 16:41:14 +04:00
|
|
|
CMakeSetupGUIImplementation * m_CMakeSetup;
|
|
|
|
|
2001-10-28 06:47:23 +03:00
|
|
|
bool m_Dirty;
|
|
|
|
|
2001-05-22 18:41:15 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // end namespace fltk
|
|
|
|
|
|
|
|
#endif
|