[go: up one dir, main page]

Menu

[r999]: / trunk / VTS3 / ScriptParmList.h  Maximize  Restore  History

Download this file

143 lines (106 with data), 4.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#if !defined(AFX_SCRIPTPARMLIST_H__CBE193B5_B97C_11D4_BEF2_00A0C95A9812__INCLUDED_)
#define AFX_SCRIPTPARMLIST_H__CBE193B5_B97C_11D4_BEF2_00A0C95A9812__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <afxcview.h>
//
// ScriptParm
//
class ScriptParm {
friend class ScriptParmList;
protected:
bool parmMark; // marked for deletion
public:
CString parmName; // parameter name
int parmSymbol; // hash code
CString parmValue; // current value (editable)
CString parmScriptValue; // value as defined in the script
CString parmDesc; // description
int parmLine; // where parm is defined in script
bool parmEnv; // parm is from the environment
ScriptParm( const char *name );
~ScriptParm( void );
};
typedef ScriptParm *ScriptParmPtr;
//
// ScriptParmList
//
class ScriptParmList : public CListView
{
protected:
ScriptParmList(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(ScriptParmList)
// Attributes
public:
int m_iSelectedElem;
CImageList m_ilStatus; // status images
// madanner 5/03, We have to maintain a copy of the list control so we can safely
// search the array of parameters from another thread (the script thread managed by
// the task manager). Don't delete memory from this list... all handled elsewhere.
CTypedPtrArray<CPtrArray, ScriptParm *> m_apParms;
CListCtrl *m_pListCtrl; // handy pointer to list control
// Operations
public:
// list operations
void Add( CString &name, CString &valu, CString &desc, int line, bool env ); // add a child at the end
void Mark( bool env ); // set up for cleanup
void Release( void ); // delete those still marked
int Length( void ); // number of children
ScriptParmPtr operator [](int indx); // get a child
void Reset( void ); // change all values to script defined
int LookupIndex( int code ); // find by code, return index in list
ScriptParmPtr LookupParm( int code ); // find by code, return pointer to parm
void UpdateItemVisual( int nIndex, ScriptParmPtr pp ); // visually change nth item in list
void UpdateParameterVisual( ScriptParmPtr pp ); // visually change parm identified here in list
void SetCurrentEnv( void ); // set this list as the current environment
void ResetCurrentEnv( void ); // reset
void LoadEnv( void ); // load environment parameters into this list
void UnloadEnv( void ); // unload environment parameters
void MatchEnv( void ); // match loaded parameters with current environment
void MatchEnvParm( ScriptParmPtr envpp ); // match a parameter
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ScriptParmList)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~ScriptParmList();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(ScriptParmList)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnItemChanging(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDoubleClick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
typedef ScriptParmList *ScriptParmListPtr;
//
// ScriptParmListList
//
class ScriptParmListList : public CList<ScriptParmListPtr,ScriptParmListPtr> {
public:
ScriptParmListList( void );
~ScriptParmListList( void );
void Add( ScriptParmListPtr slp ); // add a list
void Remove( ScriptParmListPtr slp ); // remove a list
int Length( void ); // number of tokens
ScriptParmListPtr operator []( int i ); // index operator
};
typedef ScriptParmListList *ScriptParmListListPtr;
extern ScriptParmList *gCurrentEnv; // points to current environment
extern ScriptParmListList gScriptParmLists; // list of parameter lists
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SCRIPTPARMLIST_H__CBE193B5_B97C_11D4_BEF2_00A0C95A9812__INCLUDED_)