00001 #if !defined(AFX_SELCONF_H__C00FC7AA_4D0A_4DC6_946B_BFFF99DD2CB3__INCLUDED_)
00002 #define AFX_SELCONF_H__C00FC7AA_4D0A_4DC6_946B_BFFF99DD2CB3__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007
00008
00009 #include "resource.h"
00010 #include "Table.h"
00011 #include <AFXCMN.H>
00012 #include <afxtempl.h>
00013 #include "string"
00014 #include "vector"
00015 #include "map"
00016
00017 typedef struct
00018 {
00019 int id;
00020 CString s;
00021 char kind;
00022 int cliqueId;
00023 bool val;
00024 CString resp;
00025 const void * ptr;
00026 } entry;
00027
00028 typedef CTypedPtrList<CPtrList, entry*> CEntryList;
00030
00031
00032 class SelConf : public CDialog
00033 {
00034
00035 public:
00036 SelConf( unsigned int configs, CWnd* pParent = NULL);
00037 ~SelConf();
00038
00039
00040
00041 enum { IDD = IDD_DIALOG1 };
00042 CComboBox m_config;
00043
00044
00045
00046
00047
00048
00049 protected:
00050 virtual void DoDataExchange(CDataExchange* pDX);
00051
00052
00053
00054 public:
00055 int addEntry( const CString& role, char kind, int clique, bool in, const CString& repr, const void * ptr);
00056 bool getEntry( int row, CString& role, bool& in, CString& repr, const void * &ptr);
00057
00058 void addConfigs( std::vector< std::string >& configs);
00059 int findAmongConfigs( std::string& config_name);
00060
00061 std::string m_currSelConfigStr;
00062
00063 void getDescsAncs( bool which, DWORD_PTR changed, std::vector< int > & res);
00064 bool addPossibleAncestors( CStringList& list, int changed);
00065
00066 static int m_sortOrder;
00067 static bool getEntries( LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort, entry& e, entry& f);
00068 static int CALLBACK MyNameCompare(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
00069 static int CALLBACK MyKindCompare(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
00070 static int CALLBACK MyExtdCompare(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
00071 static int CALLBACK MyReprCompare(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
00072
00073 protected:
00074 const int m_numberOfConfigs;
00075 static int m_lastId;
00076 CEntryList m_entries;
00077
00078 void selectAll( bool pVal);
00079 void fillUpTable();
00080 void getDataFromTable();
00081 CTable m_table;
00082
00083 void saveUserPref( bool check);
00084 void refreshTable();
00085
00086 std::vector< std::string > m_configStrings;
00087
00088
00089 virtual BOOL OnInitDialog();
00090 virtual void OnOK();
00091 afx_msg void OnEditupdateCombo1();
00092 afx_msg void OnCloseupCombo1();
00093 afx_msg void OnBnClickedDeselectallbtn();
00094 afx_msg void OnBnClickedSelectallbtn();
00095
00096 DECLARE_MESSAGE_MAP()
00097 };
00098
00099
00100
00101
00102 #endif // !defined(AFX_SELCONF_H__C00FC7AA_4D0A_4DC6_946B_BFFF99DD2CB3__INCLUDED_)