Exemplo n.º 1
0
BOOL Display_HandleColumnNotify (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp, LPVIEWINFO pvi)
{
   if (msg == WM_NOTIFY)
      {
      HWND hList = GetDlgItem (hDlg, (int)((LPNMHDR)lp)->idFrom);
      if (fIsFastList (hList))
         {
         switch (((LPNMHDR)lp)->code)
            {
            case FLN_COLUMNRESIZE:
               FL_StoreView (hList, pvi);
               return TRUE;

            case FLN_COLUMNCLICK:
               LPFLN_COLUMNCLICK_PARAMS pp = (LPFLN_COLUMNCLICK_PARAMS)lp;

               int iCol;
               BOOL fRev;
               FastList_GetSortStyle (hList, &iCol, &fRev);

               if (iCol == pp->icol)
                  FastList_SetSortStyle (hList, iCol, !fRev);
               else
                  FastList_SetSortStyle (hList, pp->icol, FALSE);

               FL_StoreView (hList, pvi);
               return TRUE;
            }
         }
      }

   return FALSE;
}
Exemplo n.º 2
0
void Quit (int rc)
{
   if (g.hMain && IsWindow(g.hMain))
      {
      if (gr.fPreview && !gr.fVert)
         FL_StoreView (GetDlgItem (g.hMain, IDC_SERVERS), &gr.diHorz.viewSvr);
      else
         FL_StoreView (GetDlgItem (g.hMain, IDC_SERVERS), &gr.diVert.viewSvr);

      WINDOWPLACEMENT wpl;
      wpl.length = sizeof(wpl);
      if (GetWindowPlacement (g.hMain, &wpl))
         {
         if (gr.fPreview)
            gr.rMainPreview = wpl.rcNormalPosition;
         else
            gr.rMain = wpl.rcNormalPosition;
         }
      }

   StoreSettings (REGSTR_SETTINGS_BASE, REGSTR_SETTINGS_PATH, REGVAL_SETTINGS, &gr, sizeof(gr), wVerGLOBALS_RESTORED);

   if (Subsets_SaveIfDirty (g.sub))
      {
      if (Action_fAnyActive())  // just *pretend* to close the app
         {
         Action_WindowToTop (FALSE);
         ShowWindow (g.hMain, SW_HIDE);
         }
      else
         {
         g.rc = rc;
         PostQuitMessage (g.rc);
         }
      }
}
Exemplo n.º 3
0
BOOL CALLBACK Aggregates_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
{
   if (HandleColumnNotify (hDlg, msg, wp, lp, &gr.viewAgg))
      return FALSE;

   switch (msg)
      {
      case WM_INITDIALOG:
         {
         RECT rTab;
         GetClientRect (GetParent(hDlg), &rTab);
         TabCtrl_AdjustRect (GetParent (hDlg), FALSE, &rTab); 
         ResizeWindow (hDlg, awdAggregates, rwaMoveToHere, &rTab);

         FL_RestoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAgg);
         FastList_SetTextCallback (GetDlgItem (hDlg, IDC_AGG_LIST), GetItemText, &gr.viewAgg);

         Aggregates_SubclassList (hDlg);
         }
         break;

      case WM_HELP:
         WinHelp (hDlg, cszHELPFILENAME, HELP_FINDER, 0);
         break;

      case WM_DESTROY:
         DontNotifyMeEver (hDlg);
         FL_StoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAgg);
         break;

      case WM_SIZE:
         // if (lp==0), we're minimizing--don't call ResizeWindow().
         //
         if (lp != 0)
            ResizeWindow (hDlg, awdAggregates, rwaFixupGuts);
         break;

      case WM_SERVER_CHANGED:
         {
         LPIDENT lpiServer = Server_GetServerForChild (hDlg);
         DontNotifyMeEver (hDlg);
         NotifyMe (WHEN_AGGS_CHANGE, lpiServer, hDlg, 0);

         // Fix the text at the top of the Aggregates tab:
         //
         TCHAR szName[ cchRESOURCE ];
         LPTSTR pszText;

         if (lpiServer != NULL)
            {
            LPSERVER_PREF lpsp = (LPSERVER_PREF)lpiServer->GetUserParam();
            lpiServer->GetServerName (szName);
            if (lpsp && !lpsp->fIsMonitored)
               pszText = FormatString (IDS_AGGREGATE_UNMON, TEXT("%s"), szName);
            else
               pszText = FormatString (IDS_AGGREGATES_IN_SERVER, TEXT("%s"), szName);
            }
         else if (g.lpiCell != NULL)
            {
            g.lpiCell->GetCellName (szName);
            if (g.sub)
               pszText = FormatString (IDS_AGGREGATE_SOME, TEXT("%s"), szName);
            else
               pszText = FormatString (IDS_AGGREGATES_IN_CELL, TEXT("%s"), szName);
            }
         else
            {
            pszText = FormatString (IDS_AGGREGATES_IN_NOTHING);
            }

         SetDlgItemText (hDlg, IDC_AGG_DESC, pszText);
         FreeString (pszText);

         UpdateDisplay_Aggregates (FALSE, GetDlgItem (hDlg, IDC_AGG_LIST), NULL, 0, NULL, NULL, NULL);
         }
         break;

      case WM_NOTIFY_FROM_DISPATCH:
         Aggregates_OnNotifyFromDispatch ((LPNOTIFYSTRUCT)lp);
         Delete ((LPNOTIFYSTRUCT)lp);
         break;

      case WM_NOTIFY: 
         switch (((LPNMHDR)lp)->code)
            { 
            case FLN_LDBLCLICK:
               if (((LPNMHDR)lp)->hwndFrom == GetDlgItem (hDlg, IDC_AGG_LIST))
                  {
                  if (FL_GetSelectedData (GetDlgItem (hDlg, IDC_AGG_LIST)))
                     PostMessage (GetDlgItem (hDlg, IDC_AGG_LIST), WM_COMMAND, M_PROPERTIES, 0);
                  return TRUE;
                  }
               break;
            }
         break;

      case WM_CONTEXTMENU: 
         {
         POINT ptScreen;
         POINT ptClient;
         ptScreen.x = LOWORD(lp);
         ptScreen.y = HIWORD(lp);

         ptClient = ptScreen;
         ScreenToClient ((HWND)wp, &ptClient);

         if ((HWND)wp == GetDlgItem (hDlg, IDC_AGG_LIST))
            Aggregates_ShowPopupMenu ((HWND)wp, ptClient, ptScreen);
         }
         break; 

      case WM_COMMAND:
         switch (LOWORD(wp))
            {
            case IDC_AGG_CREATESET:
               SendMessage (GetDlgItem (hDlg, IDC_AGG_LIST), WM_COMMAND, M_SET_CREATE, 0);
               break;
            }
         break;
      }

   return FALSE;
}
Exemplo n.º 4
0
BOOL CALLBACK Filesets_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
{
   if (HandleColumnNotify (hDlg, msg, wp, lp, &gr.viewSet))
      return FALSE;

   switch (msg)
      {
      case WM_INITDIALOG:
         {
         RECT rTab;
         GetClientRect (GetParent(hDlg), &rTab);
         TabCtrl_AdjustRect (GetParent (hDlg), FALSE, &rTab); 
         ResizeWindow (hDlg, awdFilesets, rwaMoveToHere, &rTab);

         FL_RestoreView (GetDlgItem (hDlg, IDC_SET_LIST), &gr.viewSet);
         FastList_SetTextCallback (GetDlgItem (hDlg, IDC_SET_LIST), GetItemText, &gr.viewSet);

         Filesets_SubclassList (hDlg);

         Filesets_OnView (hDlg);
         Filesets_OnSelect (hDlg);
         }
         break;

      case WM_HELP:
         WinHelp (hDlg, cszHELPFILENAME, HELP_FINDER, 0);
         break;

      case WM_DESTROY:
         FL_StoreView (GetDlgItem (hDlg, IDC_SET_LIST), &gr.viewSet);
         DontNotifyMeEver (hDlg);
         break;

      case WM_SIZE:
         // if (lp==0), we're minimizing--don't call ResizeWindow().
         //
         if (lp != 0)
            ResizeWindow (hDlg, awdFilesets, rwaFixupGuts);
         break;

      case WM_CONTEXTMENU:
         {
         POINT ptScreen;
         POINT ptClient;
         ptScreen.x = LOWORD(lp);
         ptScreen.y = HIWORD(lp);

         ptClient = ptScreen;
         ScreenToClient ((HWND)wp, &ptClient);

         if ((HWND)wp == GetDlgItem (hDlg, IDC_SET_LIST))
            Filesets_ShowPopupMenu ((HWND)wp, ptClient, ptScreen);
         }
         break; 

      case WM_SERVER_CHANGED:
         {
         LPIDENT lpiServer = Server_GetServerForChild (hDlg);
         DontNotifyMeEver (hDlg);
         NotifyMe (WHEN_OBJECT_CHANGES, NULL, hDlg, 0);

         // Fix the text at the top of the Aggregates tab:
         //
         TCHAR szName[ cchRESOURCE ];
         LPTSTR pszText;

         if (lpiServer != NULL)
            {
            LPSERVER_PREF lpsp = (LPSERVER_PREF)lpiServer->GetUserParam();
            lpiServer->GetServerName (szName);
            if (lpsp && !lpsp->fIsMonitored)
               pszText = FormatString (IDS_FILESET_UNMON, TEXT("%s"), szName);
            else
               pszText = FormatString (IDS_FILESETS_IN_SERVER, TEXT("%s"), szName);
            }
         else if (g.lpiCell != NULL)
            {
            g.lpiCell->GetCellName (szName);
            if (g.sub)
               pszText = FormatString (IDS_FILESET_SOME, TEXT("%s"), szName);
            else
               pszText = FormatString (IDS_FILESETS_IN_CELL, TEXT("%s"), szName);
            }
         else
            {
            pszText = FormatString (IDS_FILESETS_IN_NOTHING);
            }

         SetDlgItemText (hDlg, IDC_SET_DESC, pszText);
         FreeString (pszText);

         UpdateDisplay_Filesets (FALSE, GetDlgItem (hDlg, IDC_SET_LIST), NULL, 0, NULL, NULL, NULL);
         }
         break;

      case WM_NOTIFY_FROM_DISPATCH:
         Filesets_OnNotifyFromDispatch ((LPNOTIFYSTRUCT)lp);
         Delete ((LPNOTIFYSTRUCT)lp);
         break;

      case WM_COMMAND:
         switch (LOWORD(wp))
            {
            case IDC_SET_CREATE:
               SendMessage (GetDlgItem (hDlg, IDC_SET_LIST), WM_COMMAND, M_SET_CREATE, 0);
               break;

            case IDC_SET_DELETE:
               SendMessage (GetDlgItem (hDlg, IDC_SET_LIST), WM_COMMAND, M_SET_DELETE, 0);
               break;

            case IDC_SET_REP:
               SendMessage (GetDlgItem (hDlg, IDC_SET_LIST), WM_COMMAND, M_SET_REPLICATION, 0);
               break;

            case IDC_SET_SETQUOTA:
               SendMessage (GetDlgItem (hDlg, IDC_SET_LIST), WM_COMMAND, M_SET_SETQUOTA, 0);
               break;
            }
         break;

      case WM_MOUSEMOVE:
         Filesets_ContinueDrag (hDlg);
         break;

      case WM_LBUTTONDOWN:
         if (l.fDragging && l.fRightBtn)
            Filesets_FinishDrag (hDlg, FALSE, FALSE);
         break;

      case WM_RBUTTONDOWN:
         if (l.fDragging && !l.fRightBtn)
            Filesets_FinishDrag (hDlg, FALSE, FALSE);
         break;

      case WM_LBUTTONUP:
         if (l.fDragging && !l.fRightBtn)
            Filesets_FinishDrag (hDlg, TRUE, FALSE);
         break;

      case WM_RBUTTONUP:
         if (l.fDragging && l.fRightBtn)
            Filesets_FinishDrag (hDlg, TRUE, TRUE);
         break;

      case WM_ENDTASK:
         LPTASKPACKET ptp;
         if ((ptp = (LPTASKPACKET)lp) != NULL)
            {
            if (ptp->idTask == taskSET_SELECT)
               Filesets_OnEndTask_Select (hDlg, ptp);
            else if (ptp->idTask == taskSET_BEGINDRAG)
               Filesets_OnEndTask_BeginDrag (hDlg, ptp);
            else if (ptp->idTask == taskSET_DRAGMENU)
               Filesets_OnEndTask_DragMenu (hDlg, ptp);
            else if (ptp->idTask == taskSET_MENU)
               Filesets_OnEndTask_Menu (hDlg, ptp);
            FreeTaskPacket (ptp);
            }
         break;

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

            case FLN_ITEMEXPAND:
               if (((LPNMHDR)lp)->hwndFrom == GetDlgItem (hDlg, IDC_SET_LIST))
                  {
                  HLISTITEM hItem = ((LPFLN_ITEMEXPAND_PARAMS)lp)->hItem;
                  LPIDENT lpi = (LPIDENT)FastList_GetItemParam (GetDlgItem (hDlg, IDC_SET_LIST), hItem);
                  BOOL fExpanded = ((LPFLN_ITEMEXPAND_PARAMS)lp)->fExpanded;

                  if (lpi && lpi->fIsServer())
                     {
                     LPSERVER_PREF lpsp;
                     if ((lpsp = (LPSERVER_PREF)lpi->GetUserParam()) != NULL)
                        {
                        lpsp->fExpandTree = fExpanded;
                        Server_SavePreferences (lpi);
                        }
                     }
                  else if (lpi && lpi->fIsAggregate())
                     {
                     LPAGGREGATE_PREF lpap;
                     if ((lpap = (LPAGGREGATE_PREF)lpi->GetUserParam()) != NULL)
                        {
                        lpap->fExpandTree = fExpanded;
                        Aggregates_SavePreferences (lpi);
                        }
                     }
                  }
               break;

            case FLN_BEGINDRAG:
               return Filesets_BeginDrag (hDlg, ((LPFLN_DRAG_PARAMS)lp)->fRightButton);

            case FLN_LDBLCLICK:
               if (((LPNMHDR)lp)->hwndFrom == GetDlgItem (hDlg, IDC_SET_LIST))
                  {
                  BOOL fShowProperties = TRUE;

                  HLISTITEM hItem;
                  if ((hItem = FastList_GetFocus (GetDlgItem (hDlg, IDC_SET_LIST))) != NULL)
                     {
                     if (FastList_FindFirstChild (GetDlgItem (hDlg, IDC_SET_LIST), hItem))
                        fShowProperties = FALSE;
                     }

                  LPIDENT lpi = Filesets_GetFocused (hDlg);
                  if (lpi && !lpi->fIsCell() && fShowProperties)
                     {
                     PostMessage (GetDlgItem (hDlg, IDC_SET_LIST), WM_COMMAND, M_PROPERTIES, 0);
                     return TRUE;
                     }
                  }
               break;
            }
         break;
      }

   return FALSE;
}
Exemplo n.º 5
0
BOOL CALLBACK Filesets_Restore_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
{
   static LPSET_RESTORE_PARAMS psrp = NULL;
   if (msg == WM_INITDIALOG)
      psrp = (LPSET_RESTORE_PARAMS)lp;

   if (HandleColumnNotify (hDlg, msg, wp, lp, &gr.viewAggRestore))
      return FALSE;

   if (AfsAppLib_HandleHelp (IDD_SET_RESTORE, hDlg, msg, wp, lp))
      return TRUE;

   if (psrp != NULL)
      {
      switch (msg)
         {
         case WM_INITDIALOG:
            FastList_SetTextCallback (GetDlgItem (hDlg, IDC_AGG_LIST), GetItemText, &gr.viewAggRestore);
            Filesets_Restore_OnInitDialog (hDlg, psrp);
            break;

         case WM_CONTEXTMENU:
            HWND hList;
            hList = GetDlgItem (hDlg, IDC_AGG_LIST);

            POINT ptScreen;
            POINT ptClient;
            ptScreen.x = LOWORD(lp);
            ptScreen.y = HIWORD(lp);

            ptClient = ptScreen;
            ScreenToClient (hList, &ptClient);

            if (FL_HitTestForHeaderBar (hList, ptClient))
               {
               HMENU hm = TaLocale_LoadMenu (MENU_COLUMNS);
               DisplayContextMenu (hm, ptScreen, hList);
               }
            break;

         case WM_ENDTASK:
            LPTASKPACKET ptp;
            if ((ptp = (LPTASKPACKET)lp) != NULL)
               {
               if (ptp->idTask == taskSET_LOOKUP)
                  Filesets_Restore_OnEndTask_LookupFileset (hDlg, ptp, psrp);
               else if (ptp->idTask == taskSVR_ENUM_TO_COMBOBOX)
                  Filesets_Restore_OnEndTask_EnumServers (hDlg, psrp);
               else if (ptp->idTask == taskAGG_ENUM_TO_LISTVIEW)
                  Filesets_Restore_OnEndTask_EnumAggregates (hDlg, psrp);
               FreeTaskPacket (ptp);
               }
            break;

         case WM_COLUMNS_CHANGED:
            LPARAM lpSel;
            lpSel = FL_GetSelectedData (GetDlgItem (hDlg, IDC_AGG_LIST));
            FL_RestoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAggRestore);
            Filesets_Restore_OnSelectServer (hDlg, psrp);
            break;

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

               case IDC_RESTORE_INCREMENTAL:
                  psrp->fIncremental = IsDlgButtonChecked (hDlg, IDC_RESTORE_INCREMENTAL);
                  break;

               case IDC_RESTORE_SERVER:
                  if (HIWORD(wp) == CBN_SELCHANGE)
                     Filesets_Restore_OnSelectServer (hDlg, psrp);
                  break;

               case IDC_RESTORE_SETNAME:
                  if (HIWORD(wp) == EN_UPDATE)
                     Filesets_Restore_OnSetName (hDlg, psrp);
                  break;

               case IDC_RESTORE_FILENAME:
                  Filesets_Restore_OnFileName (hDlg, psrp);
                  break;

               case IDC_RESTORE_BROWSE:
                  Filesets_Restore_OnBrowse (hDlg, psrp);
                  break;
               }
            break;

         case WM_DESTROY:
            FL_StoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAggRestore);
            psrp = NULL;
            break;

         case WM_NOTIFY:
            switch (((LPNMHDR)lp)->code)
               {
               case FLN_ITEMSELECT:
                  Filesets_Restore_OnAggregate (hDlg, psrp);
                  break;
               }
            break;
         }
      }

   return FALSE;
}
Exemplo n.º 6
0
BOOL Columns_OnApply (HWND hDlg, LPVIEWINFO lpviDefault)
{
   BOOL fPostMessage = FALSE;

   for (size_t iCol = 0; iCol < nCOLUMNS; ++iCol)
      {
      if (COLUMNS[ iCol ].fChanged)
         {
         CHILDTAB iTab = (CHILDTAB)-1;
         int idcList;

         VIEWINFO vi;
         memcpy (&vi, &COLUMNS[ iCol ].vi, sizeof(VIEWINFO));

         LPVIEWINFO lpviTarget = NULL;

         switch (iCol)
            {
            case ceSERVERS:
               if (gr.fPreview && !gr.fVert)
                  lpviTarget = &gr.diHorz.viewSvr;
               else
                  lpviTarget = &gr.diVert.viewSvr;
               FL_RestoreView (GetDlgItem (g.hMain, IDC_SERVERS), &COLUMNS[ iCol ].vi);
               UpdateDisplay_Servers (FALSE, NULL, 0);
               break;

            case ceFILESETS:
               lpviTarget = &gr.viewSet;
               iTab = tabFILESETS;
               idcList = IDC_SET_LIST;
               break;

            case ceAGGREGATES:
               lpviTarget = &gr.viewAgg;
               iTab = tabAGGREGATES;
               idcList = IDC_AGG_LIST;
               break;

            case ceSERVICES:
               lpviTarget = &gr.viewSvc;
               iTab = tabSERVICES;
               idcList = IDC_SVC_LIST;
               break;

            case ceREPLICAS:
               lpviTarget = &gr.viewRep;
               break;

            case ceAGGS_MOVE:
               lpviTarget = &gr.viewAggMove;
               break;

            case ceAGGS_CREATE:
               lpviTarget = &gr.viewAggCreate;
               break;

            case ceAGGS_RESTORE:
               lpviTarget = &gr.viewAggRestore;
               break;
            }

         if (lpviTarget != NULL)
            {
            memcpy (lpviTarget, &COLUMNS[ iCol ].vi, sizeof(VIEWINFO));
            if (lpviDefault == &COLUMNS[ iCol ].vi)
               fPostMessage = TRUE;
            }

         if (iTab != (CHILDTAB)-1)
            {
            for (HWND hServer = g.hMain;
                 hServer != NULL;
                 hServer = PropCache_Search (pcSERVER, ANYVALUE, hServer))
               {
               HWND hTab = GetDlgItem (hServer, IDC_TABS);
               int iTabShown = TabCtrl_GetCurSel (hTab);

               if (iTab == iTabShown)
                  {
                  HWND hChild = Server_GetCurrentTab (hServer);
                  HWND hList = GetDlgItem (hChild, idcList);

                  TCHAR szClassName[ cchRESOURCE ];
                  if (GetClassName (hList, szClassName, cchRESOURCE))
                     {
                     if (lstrcmp (szClassName, WC_FASTLIST))
                        continue;
                     }

                  FL_StoreView (hList, &vi);
                  COLUMNS[ iCol ].vi.lvsView = vi.lvsView;
                  FL_RestoreView (hList, &COLUMNS[ iCol ].vi);
                  Server_ForceRedraw (hServer);
                  }

               if (hServer == g.hMain)
                  hServer = NULL;
               }
            }
         }
      }

   return fPostMessage;
}
Exemplo n.º 7
0
BOOL CALLBACK Filesets_Create_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
{
   static LPSET_CREATE_PARAMS pscp = NULL;
   if (msg == WM_INITDIALOG)
      pscp = (LPSET_CREATE_PARAMS)lp;

   if (HandleColumnNotify (hDlg, msg, wp, lp, &gr.viewAggCreate))
      return FALSE;

   if (AfsAppLib_HandleHelp (IDD_SET_CREATE, hDlg, msg, wp, lp))
      return TRUE;

   if (pscp != NULL)
      {
      switch (msg)
         {
         case WM_INITDIALOG:
            FastList_SetTextCallback (GetDlgItem (hDlg, IDC_AGG_LIST), GetItemText, &gr.viewAggCreate);
            Filesets_Create_OnInitDialog (hDlg, pscp);
            break;

         case WM_CONTEXTMENU:
            HWND hList;
            hList = GetDlgItem (hDlg, IDC_AGG_LIST);

            POINT ptScreen;
            POINT ptClient;
            ptScreen.x = LOWORD(lp);
            ptScreen.y = HIWORD(lp);

            ptClient = ptScreen;
            ScreenToClient (hList, &ptClient);

            if (FL_HitTestForHeaderBar (hList, ptClient))
               {
               HMENU hm = TaLocale_LoadMenu (MENU_COLUMNS);
               DisplayContextMenu (hm, ptScreen, hList);
               }
            break;

         case WM_ENDTASK: 
            LPTASKPACKET ptp;
            if ((ptp = (LPTASKPACKET)lp) != NULL)
               {
               if (ptp->idTask == taskAGG_FIND_QUOTA_LIMITS)
                  Filesets_Create_OnEndTask_FindQuotaLimits (hDlg, ptp, pscp);
               else if (ptp->idTask == taskAGG_ENUM_TO_LISTVIEW)
                  Filesets_Create_OnEndTask_EnumAggregates (hDlg);
               else if (ptp->idTask == taskSVR_ENUM_TO_COMBOBOX)
                  {
                  EnableWindow (GetDlgItem (hDlg, IDC_SET_SERVER), TRUE);
                  Filesets_Create_StartDisplay_Aggregates (hDlg, &pscp->lpiParent);
                  }
               FreeTaskPacket (ptp);
               }
            break;

         case WM_COLUMNS_CHANGED:
            LPARAM lpSel;
            lpSel = FL_GetSelectedData (GetDlgItem (hDlg, IDC_AGG_LIST));
            FL_RestoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAggCreate);
            Filesets_Create_OnSelectServer (hDlg, (LPIDENT*)&lpSel);
            break;

         case WM_COMMAND:
            switch (LOWORD(wp))
               {
               case IDOK:
                  if (pscp->lpiParent && pscp->lpiParent->fIsAggregate() && pscp->szName[0])
                     EndDialog (hDlg, LOWORD(wp));
                  break;

               case IDCANCEL:
                  EndDialog (hDlg, LOWORD(wp));
                  break;

               case IDC_SET_SERVER:
                  if (HIWORD(wp) == CBN_SELCHANGE)
                     Filesets_Create_OnSelectServer (hDlg, &pscp->lpiParent);
                  break;

               case IDC_SET_NAME:
                  GetDlgItemText (hDlg, IDC_SET_NAME, pscp->szName, cchNAME);
                  Filesets_Create_EnableOK (hDlg, pscp);
                  break;

               case IDC_SET_QUOTA:
                  if (HIWORD(wp) == SPN_UPDATE)
                     {
                     pscp->ckQuota = SP_GetPos (GetDlgItem (hDlg, IDC_SET_QUOTA));
                     if (gr.cbQuotaUnits == cb1MB)
                        pscp->ckQuota *= ck1MB;
                     }
                  break;

               case IDC_SET_QUOTA_UNITS:
                  if (HIWORD(wp) == CBN_SELCHANGE)
                     {
                     gr.cbQuotaUnits = (size_t)CB_GetSelectedData (GetDlgItem (hDlg, IDC_SET_QUOTA_UNITS));
                     StartTask (taskAGG_FIND_QUOTA_LIMITS, hDlg, pscp->lpiParent);
                     }
                  break;

               case IDC_SET_CLONE:
                  pscp->fCreateClone = IsDlgButtonChecked (hDlg, IDC_SET_CLONE);
                  break;
               }
            break;

         case WM_DESTROY:
            FL_StoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAggCreate);
            pscp = NULL;
            break;

         case WM_NOTIFY: 
            switch (((LPNMHDR)lp)->code)
               { 
               case FLN_ITEMSELECT:
                  LPIDENT lpi;
                  if ((lpi = (LPIDENT)FL_GetSelectedData (GetDlgItem (hDlg, IDC_AGG_LIST))) != NULL)
                     {
                     pscp->lpiParent = lpi;

                     StartTask (taskAGG_FIND_QUOTA_LIMITS, hDlg, pscp->lpiParent);
                     Filesets_Create_EnableOK (hDlg, pscp);
                     }
                  break;
               }
            break;
         }
      }

   return FALSE;
}
Exemplo n.º 8
0
BOOL CALLBACK Machines_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
{
   if (Display_HandleColumnNotify (hDlg, msg, wp, lp, &gr.viewMch))
      return FALSE;

   switch (msg)
      {
      case WM_INITDIALOG:
         {
         RECT rTab;
         GetClientRect (GetParent(hDlg), &rTab);
         TabCtrl_AdjustRect (GetParent (hDlg), FALSE, &rTab);
         ResizeWindow (hDlg, awdMachinesTab, rwaMoveToHere, &rTab);

         HIMAGELIST hSmall = AfsAppLib_CreateImageList (FALSE);
         HIMAGELIST hLarge = AfsAppLib_CreateImageList (TRUE);
         FastList_SetImageLists (GetDlgItem (hDlg, IDC_MACHINES_LIST), hSmall, hLarge);

         FastList_SetSortFunction (GetDlgItem (hDlg, IDC_MACHINES_LIST), General_ListSortFunction);

         FL_RestoreView (GetDlgItem (hDlg, IDC_MACHINES_LIST), &gr.viewMch);
         FastList_SetTextCallback (GetDlgItem (hDlg, IDC_MACHINES_LIST), Display_GetItemText, &gr.viewMch);
         SetDlgItemText (hDlg, IDC_MACHINES_PATTERN, g.szPatternMachines);
         Machines_EnableButtons(hDlg);
         Display_PopulateMachineList();

         l.dwTickLastType = 0;
         }
         break;

      case WM_HELP:
         WinHelp (hDlg, cszHELPFILENAME, HELP_FINDER, 0);
         break;

      case WM_DESTROY:
         FL_StoreView (GetDlgItem (hDlg, IDC_MACHINES_LIST), &gr.viewMch);
         break;

      case WM_SIZE:
         // if (lp==0), we're minimizing--don't call ResizeWindow().
         //
         if (lp != 0)
            ResizeWindow (hDlg, awdMachinesTab, rwaFixupGuts);
         break;

      case WM_TIMER:
         switch (wp)
            {
            case ID_SEARCH_TIMER:
               if ( (l.dwTickLastType) && (GetTickCount() > l.dwTickLastType + msecSEARCH_TIMER) )
                  {
                  KillTimer (hDlg, ID_SEARCH_TIMER);
                  Display_PopulateMachineList();
                  }
               break;
            }
         break;

      case WM_CONTEXTMENU:
         POINT ptScreen;
         ptScreen.x = LOWORD(lp);
         ptScreen.y = HIWORD(lp);
         OnRightClick (pmMACHINE, GetDlgItem (hDlg, IDC_MACHINES_LIST), &ptScreen);
         break;

      case WM_COMMAND:
         switch (LOWORD(wp))
            {
            case IDC_MACHINES_PATTERN:
               if (HIWORD(wp) == EN_UPDATE)
                  {
                  l.dwTickLastType = GetTickCount();
                  KillTimer (hDlg, ID_SEARCH_TIMER);
                  SetTimer (hDlg, ID_SEARCH_TIMER, msecSEARCH_TIMER +15, NULL);
                  }
               break;

            default:
               OnContextCommand (LOWORD(wp));
               break;
            }
         break;

      case WM_NOTIFY:
         switch (((LPNMHDR)lp)->code)
            {
            case FLN_ITEMSELECT:
               Main_SetMenus();
               Machines_EnableButtons(hDlg);
               break;

            case FLN_LDBLCLICK:
               PostMessage (hDlg, WM_COMMAND, MAKELONG(M_PROPERTIES,BN_CLICKED), (LPARAM)GetDlgItem (hDlg, M_PROPERTIES));
               break;
            }
         break;
      }

   return FALSE;
}