Exemplo n.º 1
0
void CStudentChooserDlg::DoDataExchange( CDataExchange* pDX ) {
    CDialog::DoDataExchange( pDX );
    DDX_Control( pDX, IDC_SEARCHFIRSTNAME,  searchFirstName );
    DDX_Control( pDX, IDC_SEARCHLASTNAME,   searchLastName );
    DDX_Control( pDX, IDC_SEARCHSSN,        searchSSN );
    DDX_Control( pDX, IDC_SEARCHCHECK,      searchCheck );
    DDX_Control( pDX, IDC_STUDENTLIST,      studentList );
    DDX_Control( pDX, IDC_NEWSTUDENT,       newButton );
    DDX_Control( pDX, IDC_OPENSTUDENT,      openButton );
    DDX_Control( pDX, IDC_SEARCHBUTTON,     searchButton );
    DDX_Control( pDX, IDC_SEARCHSCHOOLYEAR, schoolYearList );

    searchCheck.SetCheck( 1 );

    schoolYearList.DisableNull();
    schoolYearList.SetList( storage.GetSchoolYearList() );

    RefreshStudentList();

    searchLastName.SetFocus();

    if ( !user.CanWrite() ) {
        newButton.EnableWindow( FALSE );
    }

    try {
        schoolYearList.Select( preferences.GetInt( "CurrentSchoolYear" ) );
        RefreshStudentList();
    }
    catch (...) {}
}
Exemplo n.º 2
0
void CMainWindow::OnUpdateFileDelete( CCmdUI* pCmdUI ) {
	pCmdUI->Enable(
		user.CanWrite() &&
		MDIGetActive() &&
		MDIGetActive()->IsKindOf( RUNTIME_CLASS( CStudentChooserWnd ) ) &&
		chooser->IsWindowVisible()
	);
}
Exemplo n.º 3
0
void CMainWindow::OnUpdateFileSave( CCmdUI* pCmdUI ) {
	pCmdUI->Enable(
		user.CanWrite() &&
		MDIGetActive() &&
		MDIGetActive()->IsKindOf( RUNTIME_CLASS( CStudentEditWnd ) ) &&
		((CStudentEditWnd*)MDIGetActive())->IsModified()
	);
}
Exemplo n.º 4
0
void CMainWindow::OnUpdateFileShowOptionsOnNew( CCmdUI* pCmdUI ) {
	pCmdUI->Enable( user.CanWrite() );
	pCmdUI->SetCheck( ( preferences.GetBool("ShowNewStudentOptions") ? 1 : 0 ) );
}
Exemplo n.º 5
0
void CMainWindow::OnUpdateFileNew( CCmdUI* pCmdUI ) {
	pCmdUI->Enable( user.CanWrite() );
}