Exemplo n.º 1
0
void Columns_OnMoveDown (HWND hDlg)
{
   LPVIEWINFO lpvi = (LPVIEWINFO)CB_GetSelectedData (GetDlgItem (hDlg, IDC_COLUMNS));
   HWND hAvail = GetDlgItem (hDlg, IDC_COL_AVAIL);
   HWND hShown = GetDlgItem (hDlg, IDC_COL_SHOWN);
   int ii = LB_GetSelected (hShown);

   if (ii != -1)
      {
      size_t iAvail = (size_t)LB_GetData (hShown, ii);
      lpvi->aColumns[ ii ] = lpvi->aColumns[ ii+1 ];
      lpvi->aColumns[ ii+1 ] = iAvail;

      for (size_t iCol = 0; iCol < nCOLUMNS; ++iCol)
         {
         if (lpvi == &COLUMNS[ iCol ].vi)
            COLUMNS[ iCol ].fChanged = TRUE;
         }

      Columns_OnSelect (hDlg);
      LB_SetSelectedByData (hShown, (LPARAM)iAvail);
      Columns_OnSelShown (hDlg);
      PropSheetChanged (hDlg);
      }
}
Exemplo n.º 2
0
void Columns_OnInsert (HWND hDlg)
{
   LPVIEWINFO lpvi = (LPVIEWINFO)CB_GetSelectedData (GetDlgItem (hDlg, IDC_COLUMNS));
   HWND hAvail = GetDlgItem (hDlg, IDC_COL_AVAIL);
   HWND hShown = GetDlgItem (hDlg, IDC_COL_SHOWN);
   int ii = LB_GetSelected (hAvail);

   if (ii != -1)
      {
      size_t iAvail = LB_GetData (hAvail, ii);
      int iShown = 1+ LB_GetSelected (hShown);

      TCHAR szText[ cchRESOURCE ];
      SendMessage (hAvail, LB_GETTEXT, ii, (LPARAM)szText);

      LB_AddItem (hShown, szText, iAvail);
      SendMessage (hAvail, LB_DELETESTRING, ii, 0);

      lpvi->aColumns[ lpvi->nColsShown ] = iAvail;
      lpvi->nColsShown ++;

      for (size_t iCol = 0; iCol < nCOLUMNS; ++iCol)
         {
         if (lpvi == &COLUMNS[ iCol ].vi)
            COLUMNS[ iCol ].fChanged = TRUE;
         }

      Columns_OnSelAvail (hDlg);
      Columns_OnSelShown (hDlg);
      PropSheetChanged (hDlg);
      }
}
Exemplo n.º 3
0
void Columns_OnDelete (HWND hDlg)
{
   LPVIEWINFO lpvi = (LPVIEWINFO)CB_GetSelectedData (GetDlgItem (hDlg, IDC_COLUMNS));
   HWND hAvail = GetDlgItem (hDlg, IDC_COL_AVAIL);
   HWND hShown = GetDlgItem (hDlg, IDC_COL_SHOWN);
   int ii = LB_GetSelected (hShown);

   if (ii != -1)
      {
      TCHAR szText[ cchRESOURCE ];
      SendMessage (hShown, LB_GETTEXT, ii, (LPARAM)szText);

      size_t iAvail = (size_t)LB_GetData (hShown, ii);
      LB_AddItem (hAvail, szText, iAvail);
      SendMessage (hShown, LB_DELETESTRING, ii, 0);

      for ( ; ii < (int)lpvi->nColsShown-1; ++ii)
         {
         lpvi->aColumns[ ii ] = lpvi->aColumns[ ii+1 ];
         }
      lpvi->nColsShown --;

      for (size_t iCol = 0; iCol < nCOLUMNS; ++iCol)
         {
         if (lpvi == &COLUMNS[ iCol ].vi)
            COLUMNS[ iCol ].fChanged = TRUE;
         }

      Columns_OnSelAvail (hDlg);
      Columns_OnSelShown (hDlg);
      PropSheetChanged (hDlg);
      }
}
Exemplo n.º 4
0
LPSUBSET Subsets_OnCheckAll (HWND hDlg, LPSUBSET subOld, BOOL fCheck)
{
   LPSUBSET sub = subOld;
   HWND hList = GetDlgItem (hDlg, IDC_SUBSET_LIST);

   if (!fCheck)  // unchecking things?
      {
      if (!sub)
         {
         sub = New (SUBSET);
         memset (sub, 0x00, sizeof(SUBSET));
         }
      }

   int iiMax = (int) SendMessage (hList, LB_GETCOUNT, 0, 0);

   for (int ii = 0; ii < iiMax; ++ii)
      {
      if (LB_GetCheck (hList, ii) != fCheck)
         {
         LB_SetCheck (hList, ii, fCheck);
         }
      }

   if (sub)
      {
      sub->fModified = TRUE;
      Subsets_GetSubsetFromDialog (hDlg, sub);
      Subsets_SetName (hDlg, sub);
      PropSheetChanged (hDlg);
      }

   return sub;
}
Exemplo n.º 5
0
BOOL CALLBACK Options_General_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
{
   if (AfsAppLib_HandleHelp (IDD_OPTIONS_GENERAL, hDlg, msg, wp, lp))
      return TRUE;

   switch (msg)
      {
      case WM_INITDIALOG_SHEET:
         PropCache_Add (pcGENERAL, 0, hDlg);
         break;

      case WM_DESTROY_SHEET:
         PropCache_Delete (hDlg);
         break;

      case WM_INITDIALOG:
         PropCache_Add (pcGENERAL, NULL, hDlg);
         Options_General_OnInitDialog (hDlg);
         break;

      case WM_COMMAND:
         switch (LOWORD(wp))
            {
            case IDAPPLY:
               Options_General_OnApply (hDlg);
               break;

            case IDC_OPT_SVR_LONGNAMES:
            case IDC_OPT_SVR_DBL_PROP:
            case IDC_OPT_SVR_DBL_DEPENDS:
            case IDC_OPT_SVR_DBL_OPEN:
            case IDC_OPT_SVR_OPENMON:
            case IDC_OPT_SVR_CLOSEUNMON:
            case IDC_OPT_WARN_BADCREDS:
               PropSheetChanged (hDlg);
               break;
            }
         break;
      }

   return FALSE;
}
Exemplo n.º 6
0
LPSUBSET Subsets_OnLoad (HWND hDlg, LPSUBSET subOld)
{
   LPSUBSET subNew = NULL;

   TCHAR szSubset[ cchNAME ] = TEXT("");
   if (subOld)
      lstrcpy (szSubset, subOld->szSubset);

   if (Subsets_GetLoadName (hDlg, szSubset))
      {
      if ((subNew = Subsets_LoadSubset (NULL, szSubset)) != NULL)
         {
         Subsets_SetName (hDlg, subNew);
         Subsets_PutSubsetOnDialog (hDlg, subNew);
         PropSheetChanged (hDlg);
         }
      }

   return subNew;
}
Exemplo n.º 7
0
LPSUBSET Subsets_OnCheck (HWND hDlg, int iSel, LPSUBSET subOld)
{
   LPSUBSET sub = subOld;
   HWND hList = GetDlgItem (hDlg, IDC_SUBSET_LIST);

   if (!LB_GetCheck (hList, iSel))  // unchecked?
      {
      if (!sub)
         {
         sub = New (SUBSET);
         memset (sub, 0x00, sizeof(SUBSET));
         }
      }

   if (sub)
      {
      sub->fModified = TRUE;
      Subsets_GetSubsetFromDialog (hDlg, sub);
      Subsets_SetName (hDlg, sub);
      PropSheetChanged (hDlg);
      }

   return sub;
}
Exemplo n.º 8
0
BOOL CALLBACK Server_Scout_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
{
   if (AfsAppLib_HandleHelp (IDD_SVR_SCOUT, hDlg, msg, wp, lp))
      return TRUE;

   if (msg == WM_INITDIALOG)
      SetWindowLongPtr (hDlg, DWLP_USER, ((LPPROPSHEETPAGE)lp)->lParam);

   LPIDENT lpiServer = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER);

   switch (msg)
      {
      case WM_INITDIALOG:
         Server_Scout_OnInitDialog (hDlg, lpiServer);
         StartTask (taskSVR_SCOUT_INIT, hDlg, lpiServer);
         break;

      case WM_ENDTASK:
         LPTASKPACKET ptp;
         if ((ptp = (LPTASKPACKET)lp) != NULL)
            {
            if (ptp->idTask == taskSVR_SCOUT_INIT)
               Server_Scout_OnEndTask_InitDialog (hDlg, ptp);
            else if (ptp->idTask == taskSVR_SCOUT_APPLY)
               Server_Scout_OnEndTask_Apply (hDlg, ptp);
            FreeTaskPacket (ptp);
            }
         break;

      case WM_COMMAND:
         switch (LOWORD(wp))
            {
            case IDOK:
            case IDCANCEL:
               break;

            case IDAPPLY:
               Server_Scout_OnApply (hDlg, lpiServer);
               break;

            case IDC_SVR_WARN_AGGFULL:
               Server_Scout_OnAggWarn (hDlg, lpiServer);
               PropSheetChanged (hDlg);
               break;

            case IDC_SVR_WARN_SETFULL:
               Server_Scout_OnSetWarn (hDlg, lpiServer);
               PropSheetChanged (hDlg);
               break;

            case IDC_SVR_WARN_AGGALLOC:
            case IDC_SVR_WARN_SVCSTOP:
            case IDC_SVR_WARN_TIMEOUT:
            case IDC_SVR_WARN_SETNOVLDB:
            case IDC_SVR_WARN_SETNOSERV:
            case IDC_SVR_WARN_AGGFULL_PERCENT:
            case IDC_SVR_WARN_SETFULL_PERCENT:
            case IDC_SVR_AUTOREFRESH_MINUTES:
               PropSheetChanged (hDlg);
               break;

            case IDC_SVR_AUTOREFRESH:
               Server_Scout_OnAutoRefresh (hDlg, lpiServer);
               PropSheetChanged (hDlg);
               break;
            }
         break;
      }

   return FALSE;
}
Exemplo n.º 9
0
BOOL CALLBACK Filesets_General_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
{
   if (AfsAppLib_HandleHelp (IDD_SET_GENERAL, hDlg, msg, wp, lp))
      return TRUE;

   if (msg == WM_INITDIALOG)
      SetWindowLongPtr (hDlg, DWLP_USER, ((LPPROPSHEETPAGE)lp)->lParam);

   LPIDENT lpi = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER);

   switch (msg)
      {
      case WM_INITDIALOG_SHEET:
         PropCache_Add (pcSET_PROP, (LPIDENT)lp, hDlg);
         break;

      case WM_DESTROY_SHEET:
         PropCache_Delete (hDlg);
         break;

      case WM_INITDIALOG:
         Filesets_General_OnInitDialog (hDlg, lpi);
         StartTask (taskSET_PROP_INIT, hDlg, lpi);
         NotifyMe (WHEN_OBJECT_CHANGES, lpi, hDlg, 0);
         break;

      case WM_DESTROY:
         DontNotifyMeEver (hDlg);
         break;

      case WM_ENDTASK:
         LPTASKPACKET ptp;
         if ((ptp = (LPTASKPACKET)lp) != NULL)
            {
            if (ptp->idTask == taskSET_PROP_INIT)
               Filesets_General_OnEndTask_InitDialog (hDlg, ptp, lpi);
            FreeTaskPacket (ptp);
            }
         break;

      case WM_NOTIFY_FROM_DISPATCH:
         StartTask (taskSET_PROP_INIT, hDlg, lpi);
         Delete ((LPNOTIFYSTRUCT)lp);
         break;

      case WM_COMMAND:
         switch (LOWORD(wp))
            {
            case IDOK:
            case IDCANCEL:
               break;

            case IDAPPLY:
               Filesets_General_OnApply (hDlg, lpi);
               break;

            case IDC_SET_WARN:
            case IDC_SET_WARN_SETFULL:
            case IDC_SET_WARN_SETFULL_DEF:
               Filesets_General_OnWarnings (hDlg, lpi);
               PropSheetChanged (hDlg);
               break;

            case IDC_SET_WARN_SETFULL_PERCENT:
               PropSheetChanged (hDlg);
               break;

            case IDC_SET_QUOTA:
               if (Filesets_SetQuota (lpi))
                  {
                  // this new task will block until the setquota req is done
                  StartTask (taskSET_PROP_INIT, hDlg, lpi);
                  }
               break;

            case IDC_SET_LOCK:
               StartTask (taskSET_LOCK, NULL, lpi);
               break;

            case IDC_SET_UNLOCK:
               StartTask (taskSET_UNLOCK, NULL, lpi);
               break;
            }
         break;
      }

   return FALSE;
}
Exemplo n.º 10
0
BOOL CALLBACK Aggregates_General_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
{
   if (AfsAppLib_HandleHelp (IDD_AGG_GENERAL, hDlg, msg, wp, lp))
      return TRUE;

   if (msg == WM_INITDIALOG)
      SetWindowLongPtr (hDlg, DWLP_USER, ((LPPROPSHEETPAGE)lp)->lParam);

   LPIDENT lpi = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER);

   switch (msg)
      {
      case WM_INITDIALOG_SHEET:
         PropCache_Add (pcAGG_PROP, (LPIDENT)lp, hDlg);
         break;

      case WM_DESTROY_SHEET:
         PropCache_Delete (hDlg);
         break;

      case WM_INITDIALOG:
         Aggregates_General_OnInitDialog (hDlg);
         StartTask (taskAGG_PROP_INIT, hDlg, lpi);
         break;

      case WM_ENDTASK:
         LPTASKPACKET ptp;
         if ((ptp = (LPTASKPACKET)lp) != NULL)
            {
            if (ptp->idTask == taskAGG_PROP_INIT)
               Aggregates_General_OnEndTask_InitDialog (hDlg, ptp);
            else if (ptp->idTask == taskAGG_PROP_APPLY)
               Aggregates_General_OnEndTask_Apply (hDlg, ptp);
            FreeTaskPacket (ptp);
            }
         break;

      case WM_COMMAND:
         switch (LOWORD(wp))
            {
            case IDOK:
            case IDCANCEL:
               break;

            case IDAPPLY:
               Aggregates_General_OnApply (hDlg);
               break;

            case IDC_AGG_WARNALLOC:
               PropSheetChanged (hDlg);
               break;

            case IDC_AGG_WARN:
            case IDC_AGG_WARN_AGGFULL:
            case IDC_AGG_WARN_AGGFULL_DEF:
               Aggregates_General_OnWarnings (hDlg);
               PropSheetChanged (hDlg);
               break;

            case IDC_AGG_WARN_AGGFULL_PERCENT:
               PropSheetChanged (hDlg);
               break;
            }
         break;
      }

   return FALSE;
}
Exemplo n.º 11
0
BOOL CALLBACK Server_Hosts_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
{
   if (AfsAppLib_HandleHelp (IDD_SVR_HOSTS, hDlg, msg, wp, lp))
      return TRUE;

   LPSVR_HOSTS_PARAMS lpp;
   if ((msg == WM_INITDIALOG_SHEET) || (msg == WM_DESTROY_SHEET))
      lpp = (LPSVR_HOSTS_PARAMS)lp;
   else
      lpp = (LPSVR_HOSTS_PARAMS)PropSheet_FindTabParam (hDlg);

   switch (msg)
      {
      case WM_INITDIALOG_SHEET:
         PropCache_Add (pcSVR_HOSTS, lpp->lpiServer, hDlg);
         break;

      case WM_DESTROY_SHEET:
         PropCache_Delete (hDlg);
         break;

      case WM_INITDIALOG:
         Server_Hosts_OnInitDialog (hDlg, lpp);
         break;

      case WM_DESTROY:
         Server_Hosts_Free (lpp);
         break;

      case WM_ENDTASK:
         LPTASKPACKET ptp;
         if ((ptp = (LPTASKPACKET)lp) != NULL)
            {
            if (ptp->idTask == taskSVR_HOSTLIST_OPEN)
               Server_Hosts_OnEndTask_ListOpen (hDlg, lpp, ptp);
            FreeTaskPacket (ptp);
            }
         break;

      case WM_COMMAND:
         switch (LOWORD(wp))
            {
            case IDAPPLY:
               Server_Hosts_OnApply (hDlg, lpp);
               break;

            case IDC_HOST_ADD:
               Server_Hosts_OnAddEntry (hDlg, lpp);
               PropSheetChanged (hDlg);
               break;

            case IDC_HOST_REMOVE:
               Server_Hosts_OnDelEntry (hDlg, lpp);
               PropSheetChanged (hDlg);
               break;
            }
         break;

      case WM_NOTIFY:
         switch (((LPNMHDR)lp)->code)
            {
            case FLN_ITEMSELECT:
               if (((LPNMHDR)lp)->hwndFrom == GetDlgItem (hDlg, IDC_HOST_LIST))
                  {
                  Server_Hosts_OnSelect (hDlg, lpp);
                  }
               break;
            }
         break;
      }

   return FALSE;
}