Example #1
0
BOOL CMainWindow::Create() {
	newWindowX = newWindowY = 0;

	BOOL retval = LoadFrame( IDR_MAINWINDOW );

	userListWnd = NULL;
	
	if ( retval ) {
		retval = toolbar.Create( this, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_FLYBY | CBRS_TOOLTIPS );
	}

	if ( retval ) {
		retval = toolbar.LoadToolBar( IDR_MAINWINDOW );
	}

	if ( retval ) {
		status.Create( this );
		UINT indicator = ID_SEPARATOR;
		status.SetIndicators( &indicator, 1 );
	}

	if ( retval ) {
		chooser = new CStudentChooserWnd();
		retval = chooser->Create( this );
	}

	chooser->ShowWindow( preferences.GetInt( "ChooserWindowState" ) );

	if ( !preferences.GetBool( "ShowStudentChooser" ) ) {
		chooser->ShowWindow( SW_HIDE );
	}

	return retval;
}
BOOL CConnectionOptionsDlg::OnInitDialog() {
    if ( !CDialog::OnInitDialog() ) {
        return FALSE;
    }

    SetDlgItemText( IDC_DSN, preferences.GetString("DSNDatabase").c_str() );
    SetDlgItemText( IDC_ACCESS, preferences.GetString("AccessDatabase").c_str() );
    SetDlgItemText( IDC_SQLSERVER, preferences.GetString("SQLServer").c_str() );
    SetDlgItemText( IDC_SQLADDRESS, preferences.GetString("SQLAddress").c_str() );
    SetDlgItemText( IDC_SQLDATABASE, preferences.GetString("SQLDatabase").c_str() );

    CheckDlgButton( IDC_PREFIX, ( preferences.GetBool("UsePrefix") ? 1 : 0 ) );

    if ( preferences.GetString("ConnectionType")=="SQL" ) {
        CheckDlgButton( IDC_SQLRADIO, 1 );
        OnSQLRadio();
    } else {
        if ( preferences.GetString("ConnectionType")=="Access" ) {
            CheckDlgButton( IDC_ACCESSRADIO, 1 );
            OnAccessRadio();
        } else {
            CheckDlgButton( IDC_DSNRADIO, 1 );
            OnDSNRadio();
        }
    }

    return TRUE;
}
Example #3
0
void CStudentChooserDlg::OnNewStudentButtonClicked() {
    if ( preferences.GetBool( "ShowNewStudentOptions" ) ) {
        CNewStudentOptionsDlg dialog;
        dialog.DoModal();
    } else {
        mainWnd->NewStudent( schoolYearList.GetSelectedIndex() );
    }
}
Example #4
0
void CMainWindow::OnUpdateFileShowOptionsOnNew( CCmdUI* pCmdUI ) {
	pCmdUI->Enable( user.CanWrite() );
	pCmdUI->SetCheck( ( preferences.GetBool("ShowNewStudentOptions") ? 1 : 0 ) );
}
Example #5
0
void CMainWindow::OnFileShowOptionsOnNew() {
	preferences.SetBool( "ShowNewStudentOptions", !preferences.GetBool( "ShowNewStudentOptions" ) );
}