static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam) { LPSECURITYALARMPARAMS lpsecurity = (LPSECURITYALARMPARAMS)lParam; HWND hwndUsers = GetDlgItem (hwnd, IDC_REFALARM_BYUSER ); HWND hwndDatabase = GetDlgItem (hwnd, IDC_REFALARM_DATABASE); HWND hwndTables = GetDlgItem (hwnd, IDC_REFALARM_ONTABLE ); char szTitle [MAX_TITLEBAR_LEN]; char szFormat [100]; char szDatabaseName [MAXOBJECTNAME]; if (!AllocDlgProp (hwnd, lpsecurity)) return FALSE; // // force catolist.dll to load // CATOListDummy(); LoadString (hResource, (UINT)IDS_T_CREATE_SECURITY, szFormat, sizeof (szFormat)); wsprintf (szTitle, szFormat, GetVirtNodeName ( GetCurMdiNodeHandle ()), lpsecurity->DBName); SetWindowText (hwnd, szTitle); lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_REFALARM)); // // Get the available database names and insert them into the combo box // ComboBoxFillDatabases (hwndDatabase); ComboBoxSelectFirstStr(hwndDatabase); ComboBox_GetText (hwndDatabase, szDatabaseName, sizeof (szDatabaseName)); if (x_strlen (szDatabaseName) > 0) x_strcpy (lpsecurity->DBName, szDatabaseName); // // Get the available table names and insert them into the table list // if (x_strlen (lpsecurity->DBName) > 0) { if (!CAListBoxFillTables (hwndTables, lpsecurity->DBName, FALSE)) { CAListBoxDestroyItemData (hwndTables); return FALSE; } } // // Get the available users names and insert them into the CA list box // CAListBoxFillUsersP (hwndUsers); PreCheckItem (hwnd); EnableDisableOKButton (hwnd); richCenterDialog (hwnd); return TRUE; }
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam) { LPGRANTPARAMS lpgrant = (LPGRANTPARAMS)lParam; HWND hwndDatabases = GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_DATABASES); HWND hwndGrantees = GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_GRANTEES); HWND hwndProcedures= GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_PROCEDURES); UCHAR szDatabaseName[MAXOBJECTNAME]; char szTitle [MAX_TITLEBAR_LEN]; char szFormat[100]; if (!AllocDlgProp (hwnd, lpgrant)) return FALSE; // // force catolist.dll to load // CATOListDummy(); if (lpgrant->ObjectType == OT_PROCEDURE) LoadString (hResource, (UINT)IDS_T_GNREF_PROCEDURE, szFormat, sizeof (szFormat)); else LoadString (hResource, (UINT)IDS_T_GNREF_SEQUENCE, szFormat, sizeof (szFormat)); wsprintf ( szTitle, szFormat, GetVirtNodeName (GetCurMdiNodeHandle ())); SetWindowText (hwnd, szTitle); if (lpgrant->ObjectType == OT_PROCEDURE) lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_GNREF_PROCEDURE)); else lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)ID_HELPID_GNREF_SEQUENCE)); if (lpgrant->GranteeType == OT_GROUP) { Button_SetCheck (GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_GROUP), TRUE); FillGrantees (hwndGrantees, lpgrant->GranteeType); } else if (lpgrant->GranteeType == OT_ROLE) { Button_SetCheck (GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_ROLE), TRUE); FillGrantees (hwndGrantees, lpgrant->GranteeType); } else { if (x_strcmp (lpgrant->PreselectGrantee, lppublicdispstring()) == 0) Button_SetCheck (GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_PUBLIC), TRUE); else { Button_SetCheck (GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_USER), TRUE); lpgrant->GranteeType = OT_USER; FillGrantees (hwndGrantees, lpgrant->GranteeType); } } ComboBoxFillDatabases (hwndDatabases); ComboBoxSelectFirstStr (hwndDatabases); ComboBox_GetText (hwndDatabases, szDatabaseName, sizeof (szDatabaseName)); x_strcpy (lpgrant->DBName, szDatabaseName); if (lpgrant->ObjectType == OT_PROCEDURE) { if (!CAListBoxFillProcedures (hwndProcedures, szDatabaseName)) CAListBoxDestroyItemData (hwndProcedures); } else { ShowWindow( GetDlgItem (hwnd,IDC_GNREF_PROCEDURE_OPTION) ,SW_HIDE);// Hided "With grant Option" control LoadString (hResource, (UINT)IDS_STATIC_SEQUENCE, szFormat, sizeof (szFormat)); SetDlgItemText( hwnd, IDC_STATIC_GNREF_PROCEDURE, szFormat ); if (!CAListBoxFillSequences (hwndProcedures, lpgrant->DBName)) CAListBoxDestroyItemData (hwndProcedures); } if (x_strlen (lpgrant->PreselectGrantee) > 1) PreselectGrantee (hwndGrantees, lpgrant->PreselectGrantee); if (x_strlen (lpgrant->PreselectObject) > 1) CAListBoxSelectStringWithOwner (hwndProcedures, lpgrant->PreselectObject, lpgrant->PreselectObjectOwner); EnableDisableOKButton (hwnd); richCenterDialog(hwnd); return TRUE; }