Exemple #1
0
BOOL QSQL_DEF::VarsList		/* ---- Variables List ------------------ */
( HWND                  hDlg,           // window handle
  LPARAM		lParam		// message
)
/* Variables list. */
{ WORD                  selItemCount;   // number of selected items

  switch (HIWORD(lParam))
  { case LBN_SELCHANGE:
      selItemCount = SendDlgItemMessage(hDlg, IDL_VARS, LB_GETSELCOUNT,
					0, 0);
      if (selItemCount)
	if (SendDlgItemMessage(hDlg, IDL_VARS, LB_GETSEL, (WORD)
	      SendDlgItemMessage(hDlg, IDL_VARS, LB_GETCOUNT, 0, 0) - 1, 0))
	  selItemCount--;		// ignores mask item

      if (selItemCount)
      { EnableWindow(GetDlgItem(hDlg, IDD_REMVAR), TRUE);
	if (selItemCount == 1)
	  EnableSelVar(hDlg);
	else
	  DisableSelVar(hDlg);
      } // if
      else
      { EnableWindow(GetDlgItem(hDlg, IDD_REMVAR), FALSE);
	DisableSelVar(hDlg);
      } // else
      return TRUE;
    case LBN_DBLCLK:
      selItemCount = SendDlgItemMessage(hDlg, IDL_VARS, LB_GETSELCOUNT,
                                        0, 0);
      if (selItemCount)
	if (SendDlgItemMessage(hDlg, IDL_VARS, LB_GETSEL, (WORD) 
	      SendDlgItemMessage(hDlg, IDL_VARS, LB_GETCOUNT, 0, 0) - 1, 0))
          selItemCount--;               // ignores mask item

      if (selItemCount == 1)
        return EditObjectDialog(hDlg);
      return FALSE;
    default:
      return FALSE;
  } // switch
} // VarList
void WizardModeDialog::wiz_edit_object(void)
{
    EditObjectDialog();
    this->accept();
}