[GME-commit]
GMESRC/Paradigms/MetaGME/NamespaceConfigure NmspSpec.cpp,1.1,1.2
NmspSpec.h,1.1,1.2 component.rc,1.1,1.2 resource.h,1.1,1.2
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Wed Oct 11 18:07:16 CDT 2006
Update of /project/gme-repository/GMESRC/Paradigms/MetaGME/NamespaceConfigure
In directory escher:/tmp/cvs-serv15770
Modified Files:
NmspSpec.cpp NmspSpec.h component.rc resource.h
Log Message:
Fixing some behaviour issues.
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: component.rc
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/NamespaceConfigure/component.rc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** component.rc 25 Sep 2006 16:14:56 -0000 1.1
--- component.rc 11 Oct 2006 17:07:14 -0000 1.2
***************
*** 107,118 ****
BEGIN
CONTROL "",IDC_TREE1,"SysTreeView32",TVS_HASBUTTONS |
! TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
! 7,7,235,64
EDITTEXT IDC_EDIT1,7,89,235,14,ES_AUTOHSCROLL
DEFPUSHBUTTON "OK",IDOK,256,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,256,24,50,14
CONTROL "Enabled",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | NOT
! WS_VISIBLE | WS_TABSTOP,261,92,41,10
! LTEXT "Namespace value set:",IDC_STATIC,9,78,82,8
END
--- 107,119 ----
BEGIN
CONTROL "",IDC_TREE1,"SysTreeView32",TVS_HASBUTTONS |
! TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS |
! WS_BORDER | WS_TABSTOP,7,7,235,64
EDITTEXT IDC_EDIT1,7,89,235,14,ES_AUTOHSCROLL
+ PUSHBUTTON "Set",IDC_SAVE,244,89,28,14
DEFPUSHBUTTON "OK",IDOK,256,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,256,24,50,14
CONTROL "Enabled",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | NOT
! WS_VISIBLE | WS_TABSTOP,247,69,41,10
! LTEXT "Namespace value:",IDC_STATIC,9,78,82,8
END
Index: NmspSpec.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/NamespaceConfigure/NmspSpec.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NmspSpec.cpp 25 Sep 2006 16:14:56 -0000 1.1
--- NmspSpec.cpp 11 Oct 2006 17:07:14 -0000 1.2
***************
*** 13,16 ****
--- 13,17 ----
NmspSpec::NmspSpec(CWnd* pParent /*=NULL*/)
: CDialog(NmspSpec::IDD, pParent)
+ , m_edChanged( false)
{
}
***************
*** 26,29 ****
--- 27,31 ----
DDX_Control(pDX, IDC_TREE1, m_tree);
DDX_Control(pDX, IDC_CHECK1, m_bEnabled);
+ DDX_Control(pDX, IDC_SAVE, m_bSave);
}
***************
*** 35,38 ****
--- 37,42 ----
ON_NOTIFY(NM_SETFOCUS, IDC_TREE1, OnNMSetfocusTree1)
ON_NOTIFY(TVN_SELCHANGED, IDC_TREE1, OnTvnSelchangedTree1)
+ ON_BN_CLICKED(IDSAVE, OnBnClickedSave)
+ ON_EN_SETFOCUS(IDC_EDIT1, OnEnSetfocusEdit1)
END_MESSAGE_MAP()
***************
*** 52,55 ****
--- 56,60 ----
}
}
+ m_bSave.EnableWindow( m_edChanged = false);
}
***************
*** 134,137 ****
--- 139,143 ----
initElems();
m_tree.Expand( m_rootElem, TVE_EXPAND);
+ m_bSave.EnableWindow( m_edChanged = false);
return TRUE; // return TRUE unless you set the focus to a control
***************
*** 141,156 ****
void NmspSpec::OnEnKillfocusEdit1()
{
! // get the edited value
! CString txt;
! m_edName.GetWindowText( txt);
!
! // apply it to the selected library
! TVITEM tv;
! tv.mask = TVIF_PARAM | TVIF_HANDLE;
! tv.hItem = m_tree.GetNextItem( TVI_ROOT, TVGN_CARET);
! if( tv.hItem && m_tree.GetItem( &tv))
! {
! updateItemInfo( tv.lParam, txt);
! }
}
--- 147,152 ----
void NmspSpec::OnEnKillfocusEdit1()
{
! m_bSave.EnableWindow( m_edChanged);
! return;
}
***************
*** 161,165 ****
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
!
// TODO: Add your control notification handler code here
}
--- 157,161 ----
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
! m_bSave.EnableWindow( m_edChanged = true);
// TODO: Add your control notification handler code here
}
***************
*** 173,177 ****
--- 169,175 ----
void NmspSpec::OnNMSetfocusTree1(NMHDR *pNMHDR, LRESULT *pResult)
{
+ LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
updateEditField();
+ m_bSave.EnableWindow( m_edChanged = false);
*pResult = 0;
}
***************
*** 181,184 ****
--- 179,206 ----
LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
updateEditField( pNMTreeView ? pNMTreeView->itemNew.lParam : 0);
+ m_bSave.EnableWindow( m_edChanged = false);
*pResult = 0;
+ }
+
+ void NmspSpec::OnBnClickedSave()
+ {
+ CString txt;
+ m_edName.GetWindowText( txt);
+
+ // apply it to the selected library
+ TVITEM tv;
+ tv.mask = TVIF_PARAM | TVIF_HANDLE;
+ tv.hItem = m_tree.GetNextItem( TVI_ROOT, TVGN_CARET);
+ if( tv.hItem && m_tree.GetItem( &tv))
+ {
+ updateItemInfo( tv.lParam, txt);
+ //AfxMessageBox("updatIteminfo");
+ m_bSave.EnableWindow( m_edChanged = false);
+ m_tree.SetFocus();
+ }
+ }
+
+ void NmspSpec::OnEnSetfocusEdit1()
+ {
+ m_bSave.EnableWindow( m_edChanged);
}
Index: resource.h
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/NamespaceConfigure/resource.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** resource.h 25 Sep 2006 16:14:56 -0000 1.1
--- resource.h 11 Oct 2006 17:07:14 -0000 1.2
***************
*** 3,6 ****
--- 3,7 ----
// Used by Component.rc
//
+ #define IDC_SAVE 3
#define IDS_PROJNAME 100
#define IDD_DIALOG1 201
Index: NmspSpec.h
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/NamespaceConfigure/NmspSpec.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NmspSpec.h 25 Sep 2006 16:14:56 -0000 1.1
--- NmspSpec.h 11 Oct 2006 17:07:14 -0000 1.2
***************
*** 41,46 ****
--- 41,48 ----
CEdit m_edName;
CButton m_bEnabled;
+ CButton m_bSave;
CTreeCtrl m_tree;
HTREEITEM m_rootElem;
+ bool m_edChanged;
virtual BOOL OnInitDialog();
***************
*** 52,54 ****
--- 54,58 ----
afx_msg void OnNMSetfocusTree1(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnTvnSelchangedTree1(NMHDR *pNMHDR, LRESULT *pResult);
+ afx_msg void OnBnClickedSave();
+ afx_msg void OnEnSetfocusEdit1();
};
More information about the GME-commit
mailing list